Programming and writing about it.

echo $RANDOM

Category: Utilities

Quick Tip: ‘Download’ YouTube (or like) Videos, Linux only

You watch videos on YouTube, Google videos, and all those FLV powered video sharing portals. You want to download it and save it for your later pleasure. Ofcourse, lots of desktop and online portals are available. Well, if you are on Linux (atleast; don’t know about other Unix), you need none.

The video that you are currently viewing is on your Linux in a file: /tmp/FlashFOO (the FOO can be any random string. After the video is completely buffered, you just have to copy the file to your local disk for persistent storage. That is it.

You can watch as many you want and copy them too. Each of the Flash* files have a unique random character string.


Shell script to rotate a bunch of Images

# Uses the 'convert' utility to rotate a bunch of images via some specified angle in
# clockwise
# By Amit K.Saha

# Angle is to be supplied as a command line parameter
#./ 90

for i in *.png
convert -rotate $1 $i $i

Shell Scipt to convert a bunch of images using ‘convert’

convert is a command line tool available with ImageMagick which can be used to convert between image formats. This shell script uses it to convert a bunch of images from ‘.ps’ to ‘.png’. Follow embedded instructions to customize it to your needs.


# Uses the 'convert' utility to convert a bunch of images from one
#format to another
# the script should reside in the same directory as the images
# You need to have 'ImageMagick' installed

# By Amit K.Saha
# Help taken from

#to convert to/from different formats
# change 'ext' to reflect the format you want to convert "from"
# Chnage target to the format you want to convert to


for i in *.ps
base=$(basename $i $ext) #to extract only the filename and NOT the extension
convert $i $base.$target


Displaying Directory Trees in Linux

Here are two programs which can be used to display the directory structure in an attractive manner:

  1. Graphical Directory Tree
  2. Unix Tree/Linux Tree