at sda. Autorun USBdevicesDifficulty: Expert Application: hotplug scripts Want to run a specific application whenever a particular device isadded? The USB hotplug daemon can help you! This service is notifiedwhen USB devices are added to the system. For devices that requirekernel drivers, the hotplug daemon will call a script by the samename in /etc/hotplug/usb/, for example, a script called usb-storageexists there. You can simply add your own commands to the end of thisscript (or better still, tag a line at the end of it to execute ascript elsewhere). Then you can play a sound, autosync files, searchfor pictures or whatever. For devices that don't rely on kernel drivers, a lookup table isused matching the USB product and manufacturer ID. Many distrosalready set this up to do something, but you can customise thesescripts pretty easily. See http://jphoto.sourceforge.net/?selected=syncfor an example of what can be done. Rename andresize imagesDifficulty: Expert Application: bash Fond of your new camera but can't put up with the terrible names?Do you want also to prepare them for publishing on the web? Noproblem, a simple bash script is what you need: #!/bin/shcounter=1root=mypictresolution=400x300for i in `ls -1 $1/*.jpg`; do echo "Now working on $i" convert -resize $resolution $i ${root}_${counter}.jpg counter=`expr $counter + 1`doneSave the script in a file called picturename.sh and make itexecutable with chmod u+x picturename.shand store it somewhere in your path. Now, if you have a bunch of .jpgfiles in the directory /path/to/pictdir, all you have to do is toexecute picturename.sh /path/to/pictdirand in the current directory you'll find mypict_1.jpg, mypict_2.jpgetc, which are the resized versions of your original ones. You canchange the script according to your needs. Secure logoutDifficulty: Easy Application: bash When you are using a console on a shared machine, or indeed, juston your own desktop, you may find that when you logout, the screenstill shows a trace of who was logged in and what you were doing. Alot of distros will clear the screen, but some don't. You can solvethis by editing your ~/.bash_logout file and adding the command: clearYou can add any other useful commands here too. Transferring files without ftp or scpDifficulty: Easy Application: netcat Need to transfer a directory to another server but do not have FTPor SCP access? Well this little trick will help out using the netcatutility. On the destination server run: nc -l -p 1234 | uncompress -c | tar xvfp -And on the sending server run: tar cfp - /some/dir | compress -c | nc -w 3 [destination] 1234Now you can transfer directories without FTP and without needing rootaccess. Backingup a Debian package listDifficulty: Easy Application: Debian If you are running Debian and have lost track of which packagesyou are running, it could be useful to get a backup of your currentlyinstalled packages. You can get a list by running: dpkg --get-selections > debianlist.txtThis will put the entire list in debianlist.txt. You could theninstall the same packages on a different computer with: dpkg --set-selections < debianlist.txtYou should bear in mind that you would also need to copy overconfiguration files from /etc when copying your system to a newcomputer. To actually