Sunday, April 13, 2008

extract a range of lines from a file

problem:
You want to extract a range of lines from a file

solution:
sed comes to the rescue here! the following would print the line range from filename to stdout
sed -n '5,8p;8q' filename
5 = from line 5, including 5
8p = to line 8 including 8
8q = stop processing and quit

citation:
http://linuxactivist.blogspot.com

native overburning in os x

problem:
You have object(s) over 700mb you want to burn in os x, using Finder, on a 700mb CD-R

impact:
You can't burn it, Finder tells you you need larger media

solution:
For a slightly oversized dataset, say 710mb you can use overburning technique. This is a common feature of 3rd party burning tools/software. Here is a command line solution:

Create a set of folders and a shell script to suit, with the following contents:
hdiutil makehybrid -o tempfile contents_to_overburn/
hdiutil burn tempfile.iso
rm tempfile.iso
rm contents_to_overburn/*
citation:
http://www.harecoded.com

Tuesday, April 1, 2008

os x screen wuff — wuff

problem:
your ssh'ed into a linux server via os x terminal and backspace/tab produce (maybe other strokes) 'wuff — wuff!!' when using a screen.

impact:
highly fsking annoying!

solution:
found the solution to this problem on another blog.

just whack the following in your .bashrc / .bash_profile on the destination server

alias screen='TERM=screen screen'

citation:
http://www.benmabey.com/2007/12/13/wuff-wuff/