Archive for June, 2008

Create ISO Image of a Folder

Create an iso image of a directory


mkisofs -J -allow-leading-dots -R -V "Label CD" -iso-level 4 -o ./cd.iso data_cd

Uncompressing a BZ2 File

Decompress a file called ‘file.bz2′


bunzip2 file.bz2

XMLStarlet

Using XMLStarlet...


 curl -s 'http://bashcurescancer.com/rss/' | xml sel -t -m '//link' -v '.' -n
http://bashcurescancer.com

http://bashcurescancer.com/processing-xml-on-the-command-line.html
http://bashcurescancer.com/do-not-close-stderr.html
http://bashcurescancer.com/prepend-to-a-file-with-sponge-from-moreutils.html
http://bashcurescancer.com/bug-in-curl-is-fixed.html
http://bashcurescancer.com/using-kill-to-see-if-a-process-is-alive.html
http://bashcurescancer.com/performance-testing-with-curl.html
http://bashcurescancer.com/new-command-prepend.html
...

My KMix Settings

This kmix setting will setup your microphone for recording. I got it thru trial and error - its not perfect…


Compare contents of two files

Compare contents of two files by deleting only unique lines from ‘file1′


comm -1 file1 file2

Uncompressed Tarball

Create a uncompressed tarball


tar -cvf archive.tar file

Text type convert

Convert a text file format from MSDOS to UNIX


dos2unix input_file output_file

Script to Convert FLV to AVI

This will convert a flv file to a avi file. I got this off linux.com. It uses mencoder - so make sure you have that.


#!/bin/sh

if [ -z "$1" ]; then
  echo "Usage: $0 {-divx|-xvid} list_of_flv_files"
  exit 1
fi

# video encoding bit rate
V_BITRATE=1000

while [ "$1" ]; do
  case "$1" in
    -divx)
      MENC_OPTS="-ovc lavc -lavcopts \
        vcodec=mpeg4:vbitrate=$V_BITRATE:mbd=2:v4mv:autoaspect"
      ;;
    -xvid)
      MENC_OPTS="-ovc xvid -xvidencopts bitrate=$V_BITRATE:autoaspect"
      ;;
    *)
      if file "$1" | grep -q "Macromedia Flash Video"; then
        mencoder "$1" $MENC_OPTS -vf pp=lb -oac mp3lame \
          -lameopts fast:preset=standard -o \
          "`basename $1 .flv`.avi"
      else
        echo "$1 is not Flash Video. Skipping"
      fi
      ;;
  esac
  shift
done

Building an RPM from a Spec File

Use this command to build an RPM if you have a Spec File


rpmbuild -ba SPEC_FILE

Show routing table

show routing table


route -n