If you use VMware Player or VMware workstation under Linux and you’re an alt-tab fan like me, you might end up with stuck modifier keys, so you can’t use keys like Ctrl, Alt or Shift outside of VMware. Xiao Feng has written a nice script to recover from this annoying condition without having to reboot, and I tought I’d share it with everyone out there:
# Xiao Feng’s "Recovering from stuck modifier keys caused by VMware"
/usr/bin/xmodmap – << fixme
add shift = Shift_L Shift_R
add lock = Caps_Lock
add control = Control_L Control_R
add mod1 = Alt_L Alt_R
add mod2 = Num_Lock
add mod4 = Super_L Super_R
add mod5 = Scroll_Lock
xset r on
xset m 3.5 4
xset b off
xset s off
Easy. Portable. Buzzword-compliant. Ingenuous. Elegant. Right-out wicked cool: Bourne Shell Server Pages. As I write this I’m looking for a excuse to use this revolutionary technology in my next project!
Behold the simplicity of ASP and the power of sh:
Interface21: please take note. I expect a Spring.sh implementation before the year ends. ;-)
A couple of years ago Ludovico Magnocavallo tackled the issue of bulk conversion of MySQL tables from MyISAM to InnoDB with an elegant bash snippet.
for t in $(mysql –batch –column-names=false -e “show tables” mydbname); do
mysql -e “alter table $t type=InnoDB” mydbname;
The original post also suggests using grep to limit the scope of the conversion to just a few tables.
(It seems that now Google *does* yield practical answers to this question ;-)
This code stnippet grabs a .CSV file from Yahoo! Finance with selected quotes. This is very useful to keep an eye in your portfolio from within OpenOffice.org Calc, Gnumeric, Kspread,Microsoft Excel or similar program using your very own models.
To use it edit the paths and the symbols in the script, run it periodically from cron(8) to get $DEST/quotes.csv, import the file once and reference it from your own spreadsheet.
wget -q -O $TMP/quotes.csv ‘http://finance.yahoo.com/d/quotes.csv?s=^MXX+^DJI+^IXIC+MXN=X+AMXL.MX+ARA.MX+BIMBOA.MX+CIEB.MX+FEMSAUBD.MX+GFBBB.MX+GMODELOC.MX+TELMEXL.MX+TLEVISACPO.M+WALMEXV.MX&f=sl1d1t1c1ohgv&e=.csv’
echo ‘”SYMBOL”,”VALUE”,”A”,”B”,”C”,”D”,”E”,”F”,”G”,”H”‘ > $DEST/quotes.csv
cat $TMP/quotes.csv >> $DEST/quotes.csv