Friday, January 27, 2012

pushd and popd

pushd saves the current working directory in memory.
popd returns to the path at the top of the directory stack.

Example
[sputnik@localhost html]$ pushd . # push current directory to memory
/var/www/html /var/www/html

[sputnik@localhost etc]$ cd /var/games/ # change directory

[mshnaydman@localhost games]$ popd # returns from directory
/var/www/html
[sputnik@imagick-test html]$

For more information, read the Wiki Page

Resize & write data into image

I had task to resize image and add unique identifier. See below handful utilities.

- Exiv2 (manage image metadata. Supports IPTC, Efix, XMP and others formats)
Example: Add the field to IPTC
[sputnik@test_hires] iptc -M"add Iptc.Application2.SpecialInstructions blah blah" myfile.jpg

- Imagemagick (resize, edit, view images or more)
Example: Resize image to 200x200 pixels
[sputnik@test_hires] convert -resize 200x200 myfile_input.jpg myfile_output.jpg

- Identify (image characteristics. is a member of the ImageMagick suite of tools)
Example: Get image size
[sputnik@test_hires] identify -format '%w:%h' $source

- File (determine file type)
Example: Get Filename information. For more 'man file'
file -i $filename | cut -d':' -f 2

Sunday, January 8, 2012

Astronomy Lectures

I start getting into Astronomy for last few weeks and find the subject very interested.
Here are 3 lectures by professor David Helfand that I find interesting:

Astronomy Lecture 1: What Is a Star?
Astronomy Lecture 2: Lives of the Stars
Astronomy Lecture 3: Planets Everywhere


There lectures still available in Google Videos.