With a little side of applesauce...

Friday, September 25, 2009

ifconfig alias to hide unwanted interfaces

I have run VMWare for years, and get tired of scrolling up to find my eth0 IP Address. Here is a quick BASH function which hides the vmnet interfaces:

for c in $(sudo ifconfig -s | cut -d' ' -f1 | sed '1d; /vmnet/d'); do sudo ifconfig $c ; done

I just added it as a function to my .bashrc:
function ifcfg() { for c in $(sudo ifconfig -s | cut -d' ' -f1 | sed '1d; /vmnet/d'); do sudo ifconfig $c ; done; }

Thursday, September 17, 2009

Oracle - "getting rows N through M of a result set"

This is a great template query for returning rows N through M:


Why it is so complex in Oracle, I don't know... (ie MySQL)

Gnome Launchers - Manual edits

On Debian Lenny, I wanted to set custom icons for my Gnome Launchers, but couldn't do it using the properties dialogue... I found the files here:


And, set the Icon value to:


Finally, run the following command to reload the panel with the new icon:

killall gnome-panel

Friday, September 4, 2009

yafc - better recursion?

I was having trouble with recursive actions with ncftp... yafc to the rescue http://yafc.sourceforge.net/

Trickle bandwidth shaper

I just found this cool tool to shape bandwidth http://bit.ly/16VuFy (In this case FTP clients).

Tuesday, September 1, 2009

javascript - onChange and setting focus back to invalid entry

I was having trouble returning the cursor back to an input field after validating it during an onChange event, (as many have before). The following code works around this issue:

setTimeout(function () { obj.focus() }, 50); 

A jQuery example would be:
setTimeout( function () { $('#purchase_amount' + num).focus() }, 50 );

This answer comes in thanks to the author of the following posting: