Wednesday, January 07, 2009

Disable Image Dragging in Firefox 3

Put this line inside the image tag:

onmousedown="if (event.preventDefault) { event.preventDefault(); }"

Counting Files Recusively In Linux

Just change the .mp3 extension below.

$ ls -1R | grep -i .*.mp3 | wc -l

Tuesday, January 06, 2009

Performing / Managing Background Jobs in Linux

To perform processes in the background in Linux, use the command screen (instead of the session-tied-up nohup).

Screens are terminal sessions which can be detached (placed in the background) and reattached (placed in the foreground). When detached, these screens still run and can be brought back again for use in future connections.

Command list:

screen -list
     Displays all the running screens and their socknames
screen -S
     Creates a new screen with as the name instead of a generated one
screen -r
     Reattaches a detached screen

When a screen is attached, you can either use..

Ctrl+A then Ctrl+D to detach the current screen, or
Ctrl+D to terminal the screen.

Connecting to CVS Using Alternate Port With SSH Tunneling

Create / Modify the file ~/.ssh/config and add the lines:

Host 123.123.123.123
Port 56789


Then use the following connection string in bash:

$ cvs -d :ext:username@123.123.123:/home/devel/cvs ...