Prevent Apache from listing files in directory

One way to prevent automatic directory listing with Apache2 is to disable its autoindex module (results in: 403 Forbidden):

  • sudo a2dismod autoindex
  • service apache2 restart

To enable it later again:

  • sudo a2enmod autoindex
  • service apache2 restart

Another way is to edit Apache2 main configuration file /etc/apache2/apache2.conf (results in: 404 Not Found):

  • Find the section which looks like the one below

<Directory /var/www/>
Options Indexes FollowSymLinks
AllowOverride None
Require all granted
</Directory>

  • Remove the word "Indexes":
  • service apache2 reload

Add image to MP3

You can add album art images to your mp3 files. Use EasyTAG (GUI) or eyed3 (CLI) ID3 tag editors to accomplish that.

Example. Use eyed3 to remove any embedded images, then list options for embedded image file, then embed an image for an icon:

  • eyeD3 --remove-images test.mp3
  • eyeD3 --list-image-types
  • eyeD3 --add-image=test.jpg:ICON test.mp3

Autostart improvised IDE

Possibly you prefer to use simple tools for your Web development tasks, and possibly you get annoyed by the need to start all those applications one by one every time.

You may automate the task though.

Here is a sample launcher script, which starts a console, a mySQL client logged into database (Note: the password is provided in plain text, which is not secure, so think if you can use that, if you can’t just leave “-p” and log in manually every time. Also note: password follows immediately after “-p”, there is no gap), a console ready to display errors from Apache error log, and a xed editor with some file already in it. The script is suited to fit 1680 x 1050 display.

If you are running Mint Mate, you can add a Custom Application Launcher calling this script to your panel, and you can use this icon for it, which fits nicely.

#!/bin/bash
mate-terminal --geometry 102x42+0+0 -x sh -c 'echo "\033]0; cli \a"; cd /var/www/mysite_com; exec bash' &
mate-terminal --geometry 102x42+870+0 -x sh -c 'echo "\033]0; mySQL \a"; mysql -u data_mysite -D data_mysite -pdata_mysite; exec bash' &
mate-terminal --geometry 204x16+0+725 -x sh -c 'echo "\033]0; log \a"; cd /var/log/apache2; tail -n 0 -f error_mysite_com.log; exec bash' &
caja "/var/www/mysite_com" &
xed "/var/www/mysite_com/index.php" &

 


Copy symlink as file

You can copy symbolic links so that at the destination they show up as regular files. Just use -L option for the cp command.

This example copies all files from the current directory to directory ~/keys, and turns any symbolic links to regular files in the process (“dereferences” them):

  • cp -L * ~/keys

Run screensaver in Mate

You can instantly activate the screensaver in Linux Mint Mate by running this command at the command prompt:

  • mate-screensaver-command --activate

 


LibreCAD icon for Linux Mint Mate

LibreCAD icon, PNG, 48×48 pixels, for use with Linux Mint Mate panel, matching Mint-Y theme icons.

As such an icon was not included in the distribution a custom one had to be made.

LibreCAD icon, PNG, 48x48 pixels

LibreCAD icon, PNG, 48×48 pixels


Desktop wallpaper switcher for Linux Mint

Those of you who have used Mac know that having ability to set different wallpapers for each of your workspaces is a nice feature.

Unfortunately such feature is not [always] available in Linux.

But, turns out that you can easily add this feature on your own.

Your system already has the utility xprop, which allows you to monitor your desktop parameters, and gsettings, which let you change desktop configuration on the fly. You just need a simple script to tie all that together. Feel free to copy the code below:

#!/bin/bash
 #
 # This script runs in background, waiting for you to switch to
 # another workspace, so that it can change the desktop wallpaper
 # accordingly when you do.
 #
 # Tested on Linux Mint 18 Mate
 #
 # Script by crcok from:
 # https://crcok.wordpress.com/2016/09/14/wallpaper-switcher-mint/
 # Based on the script by garolou from:
 # https://forums.linuxmint.com/viewtopic.php?t=118540#p672189
 #
 # If you know how to make Linux Mint Mate display a different set
 # of desktop icons for each of the workspaces, please come to
 # https://crcok.wordpress.com/2016/09/14/wallpaper-switcher-mint/
 # and share your ideas in comments.
 #

# Edit this. Your wallpaper directory. Don't forget the trailing slash.
 desktop_dir="/home/user/.wallpapers/"

# Edit this. Wallpaper image file names. One for each workspace you are using.
 desktop_img[0]="wallpaper01.jpg"
 desktop_img[1]="wallpaper02.jpg"
 desktop_img[2]="wallpaper03.jpg"
 desktop_img[3]="wallpaper04.jpg"

# This is a function nicely encapsulating a call to the desktop.
 # Note that it is Mate and not Gnome we are talking to here.
 setdesktop() {
 gsettings set org.mate.background picture-filename "$desktop_dir$1"
 }

# The main loop. Every time you change to another workspace,
 # xpropr will output its number and thus will trigger the change.
 xprop -root -spy _NET_CURRENT_DESKTOP | (
 while read -r; do
 desk=${REPLY:${#REPLY}-1:1}
 setdesktop ${desktop_img[$desk]}
 done
 )