Archive for May, 2007

LCOD – 5.9.07 – Updating CPAN in Perl

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)

, , , ,

No Comments

LCOD – 5.9.07 – Find out what Perl DBI drivers are installed

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

, , ,

No Comments

LCOD – 5.6.07 – Recovering pictures from flash disks

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.

, , , , ,

No Comments

Easy AdSense by Unreal