Thursday, January 27, 2011

mount command

Linux file system or file hierarchy is a tree structure. It starts with the root directory / and branches out to other directories. Unlike windows in linux you can change the root directory using chroot command, you probably use in the rescue mode.

Everything in linux is a file.

mount command attaches file systems. see man mount for more details.
mount -t [type] [device/source] [directory/destination]
mount -t ntfs-3g /dev/sda3 /mnt/data

mount iso image files mount -o loop /mnt/data/Videos/Expendables.iso /mnt/data
finally use umount command to detach the filesystem umount /mnt/data

access your gmail from terminal

create shell script vi gmail.sh


insert the following code :) put your username and password
!#/bin/bash
wget --secure-protocol=TLSv1 --user=sjn4me --password=123 https://mail.google.com/mail/feed/atom -O -

execute ./gmail.sh

Tuesday, January 25, 2011

resizing images in linux

copy the images to a new folder and run the following command
mogrify -resize 1280 *.JPG it means resize images 1280px wide


convert -sample 80x40 input.jpg output.jpg
convert -sample 25%x25% input.jpg output.jpg


for img in `ls *.jpg`
do
convert -sample 25%x25% $img thumb-$img
done


rotate images convert -rotate 90 input.jpg output.jpg


convert to different formats convert input.jpg output.png


add a text label 
convert -font helvetica -fill white -pointsize 36 -draw 'text 10,50 "Floriade 2002, Canberra, Australia"' floriade.jpg comment.jpg
convert -font fonts/1900805.ttf -fill white -pointsize 36 -draw 'text 10,475 "jeromenicholas.co.cc"' floriade.jpg stillhq.jpg


get information on tiff files tiffinfo sample.tif
get information on png files pnginfo sample.png


add a charcoal effect convert -charcoal 2 input.jpg output.jpg
colorize effect convert -colorize 255 input.jpg output.jpg


convert -implode 4 input.jpg output.jpg
convert -solarize 42 input.jpg output.jpg
convert -spread 5 input.jpg output.jpg


multiple commands convert -sample 25%x25% -spread 4 \ -charcoal 4 input.jpg output.jpg


http://www.imagemagick.org/

About

Blogger templates