Archive for May, 2007
LCOD – 5.9.07 – Updating CPAN in Perl
Posted by Jon Zobrist in Linux, Linux Command of the Day, Perl, Programming on May 9, 2007
Perl rocks, it’s easily my favorite programming language. One of the nice things about Perl is the CPAN (Comprehensive Perl Archive Network). Your Linux box has CPAN installed already, and to begin using it you should first update it. To do so run the commands just below. The first time you invoke CPAN it’ll launch the configuration module, just hit enter until it gets into the part about which mirrors you want to use, it’ll have you pick geographic areas first, and then tell you to enter servers by number, separated by spaces. I usually put in about 20 servers, which looks like kinda this
30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10
#invoke perl’s CPAN shell (and first time configuration with)
bash$ perl -MCPAN -e shell
#once configuration is done, update CPAN, and then reload
CPAN> install Bundle::CPAN
CPAN> reload cpan
Now, head on over to CPAN and search for some cool new Perl modules to play with!
A great place to dive into the world of Perl is Perl.org
Also the Perl Monks is a good Perl site, and Use Perl is as well.
Make sure you have a correct build environment setup, on Ubuntu/Debian you need to install the build-essential package (sudo apt-get install build-essential)
LCOD – 5.9.07 – Find out what Perl DBI drivers are installed
Posted by Jon Zobrist in Linux, Linux Command of the Day, MySQL Server Support on May 9, 2007
A perl one liner for you.
Say you’re installing something that is DBI and it’s giving errors or having problems,
or anything, and you want to know if it’s because you don’t have the correct perl DBI
driver installed? This is a simple, one liner, which will tell you a list of all the perl DBI drivers.
Run from the command line
perl -e ‘use DBI;@driver_names = DBI->available_drivers; print “@driver_names\n”;’
You should get output like
DBM ExampleP File Proxy SQLite2 Sponge mysql
enjoy
LCOD – 5.6.07 – Recovering pictures from flash disks
Posted by Jon Zobrist in Linux, Linux Command of the Day on May 6, 2007
Ever have a corrupted flash memory card? Plug it into Linux and you’ll see tons of FAT corrupt or unreadable errors in dmesg output. Plug it into Windows and you’ll see a ton of files and folders with crazy corrupt names.
First thing you do, whenever you’re faced with any type of file recovery situation, is STOP USING THE DISK! Do not write ANYTHING to the disk.
Then, install PhotoRec (In Ubuntu 7.0.4 I ran, apt-get install testdisk).
http://www.cgsecurity.org/wiki/PhotoRec
I won’t attempt to write better PhotoRec instructions than you’ll find here
http://www.pcstats.com/articleview.cfm?articleid=1869&page=6
I used this recently on 2 8GB cards each with about 600 pictures in Canon RAW format, and it seems to have recovered all of them, except 1 which seems to be corrupt. Compared to the 160 or so that showed up in Windows, this is really a life saver.