Table of Contents

Scripts

HDHomeRun

See Channel Scan

MythTV

See Transcode

bash

$ ls
fotc.101.avi

$ for i in *.avi; do mv "$i" "the.flight.of.the.conchords${i/fotc/}"; done

$ ls
the.flight.of.the.conchords.101.avi
$ ls
dexter.S01E01.Dexter.DVDRip.XviD-SAiNTS.avi

$ rename 'y/A-Z/a-z/' *

$ ls
dexter.s01e01.dexter.dvdrip.xvid-saints.avi

$ rename 's/dexter.dvdrip.xvid-saints.//' *

$ ls
dexter.s01e01.avi

gawk

Say you have a text file containing columns and you want to do a search through the file for given column values. Let's assume the third column contains IP addresses and the sixth column contains port numbers. To find all the activity from IP “10.0.0.1” on port “1234”, you could do the following:

$ gawk '{if($3 == "10.0.0.1" && $6 == "1.2.3.4"){print $0}}' /path/to/file | less

vi

Remove Control Characters

:%s/^M//g

Explanation:

ssh

Port Forwarding

$ ssh -L 9999:dustin.homeip.net:80 dustin.homeip.net
http://localhost:9999/