Linux Notes

From MattWiki
Jump to: navigation, search

To Change the Command prompt

export PS1=': \!,$? ; '

To Display the current version of mythtv

$/usr/local/bin/mythbackend --version

To Display the installed rpm's

rpm -qa | grep <Program Name>
rpm -qa | grep myth  or  rpm -qa | grep ivtv

To Display the current Libs being used by mythtv

ldd /usr/local/bin/mythfrontend | grep myth

Convert AVI files to MPG files

ffmpeg -i "file.avi" -target ntsc-svcd "file.mpg"

Combining 2 (or more) AVI files.

avimerge -o "bigfile.avi" -i tmp1.avi tmp2.avi ... ... 

Check the speed of your harddrive

/sbin/hdparm -tT /dev/hda

To See the Size of any sub Directory's

du -h
du -h --max-depth=1 (To show the size of the directory's in the current directory)

To See a list of open files

lsof |grep filename

Mounting a Windows share

mount -t cifs /mythtv -ouser=username,password=password
mount -t cifs matthomevpc:Archive\ 2 /remote/Archive2 -ouser=Matt\ Rude,password=,uid=matt,gid=matt

Burn an ISO images

cdrecord -v -eject <ISO_NAME>.iso

Mount an ISO to the file system

mount -o loop -t iso9660 <ISO-DIR>/<ISO-NAME>.iso /<DIR-Name>
mount -o loop -t iso9660 /mythtv/ISO/Fedora-8-i386-DVD.iso /var/ftp/f8

Check daylight savings time rules

/usr/sbin/zdump -v -c 2008 'America/Chicago'|grep 2007

Changing host a recording is on

From the directory that the recording are in run:

for m in `mysql -h -u mythtv -pmythtv mythconverg -N -B -e "SELECT basename FROM recorded WHERE hostname = '' and storagegroup = 'Default';"`
 if [ -f $m ]; then
  echo "$m is on this host, Updateing Database..."
  `mysql -h -u mythtv -pmythtv mythconverg -N -B -e "UPDATE mythconverg.recorded SET hostname = '', lastmodified = NOW( ) WHERE basename = '$m';"`
  echo "$m is not stored on this host"