Howto resize a lot of images
If you have a lot of images and want them all resized, use mogrify from ImageMagick
Say you want all images to be 1000 pixels wide, simply do
mogrify -resize 1000 *.jpg
If you want all images to be max 100x100 pixels, and keep the aspect ratio do
mogrify -resize 100x100 *.jpg
If you want to force the image to be 100x100 pixels do
mogrify -resize 100x100! *.jpg
Read more at http://www.imagemagick.org/script/mogrify.php
Using UUID for USB harddrives in fstab
If you use a number of USB hard drives attached to a server (or desktop), you will notice that they (can) come up with different device names after each reboot. Because of the different names, it is difficult to use the names in /etc/fstab. To avoid this problem, it is possible to use UUID instead, which is an unique id number for each partition.
If you fstab line for the USB disk looks like
/dev/sdc2 /nas/data ext3 errors=remount-ro 0 1
You should get the UUID of /dev/sdc2 by running
blkid /dev/sdb2
Which gives something like
/dev/sdb2: LABEL="maxtor_b_data" UUID="b7a042b2-60c6-4116-8324-065a3d23520d" TYPE="ext3"
Change the fstab line to
UUID=b7a042b2-60c6-4116-8324-065a3d23520d /nas/data ext3 errors=remount-ro 0 1
And you are ready to go :)
Cleaning up /boot by removing unused kernels (Ubuntu)
At some point /boot will be full of old kernels (if /boot is a separate partition), which makes it impossible to make a dist-upgrade and it is therefore necessary to remove some old kernels.
Start by finding you current kernel
uname -r
which will give something like
2.6.24-25-server
Now, find all installed kernels
aptitude search linux|grep linux-image | grep "i "
which will give something like
i linux-image-2.6.24-12-server - Linux kernel image for version 2.6.24 on x
i linux-image-2.6.24-14-server - Linux kernel image for version 2.6.24 on x
i linux-image-2.6.24-15-server - Linux kernel image for version 2.6.24 on x
i linux-image-2.6.24-16-server - Linux kernel image for version 2.6.24 on x
i linux-image-2.6.24-17-server - Linux kernel image for version 2.6.24 on x
i linux-image-2.6.24-18-server - Linux kernel image for version 2.6.24 on x
i linux-image-2.6.24-19-server - Linux kernel image for version 2.6.24 on x
i linux-image-2.6.24-21-server - Linux kernel image for version 2.6.24 on x
i linux-image-2.6.24-22-server - Linux kernel image for version 2.6.24 on x
i linux-image-2.6.24-23-server - Linux kernel image for version 2.6.24 on x
i linux-image-2.6.24-24-server - Linux kernel image for version 2.6.24 on x
i linux-image-2.6.24-25-server - Linux kernel image for version 2.6.24 on x
i linux-image-server - Linux kernel image on Server Equipment.
Purge all of these, except the one found with uname -r and linux-image-server, which is a meta package
sudo apt-get purge linux-image-2.6.24-14-server linux-image-2.6.24-15-server linux-image-2.6.24-16-server linux-image-2.6.24-17-server linux-image-2.6.24-18-server linux-image-2.6.24-19-server linux-image-2.6.24-21-server linux-image-2.6.24-22-server linux-image-2.6.24-23-server linux-image-2.6.24-24-server
The above freed 250 MB from /boot and 550 MB from / at my system.
