Category: Code

Get stock quotes into a spreadsheet

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

countdown

This small script is an alternative to sleep(1) that gives a visual clue to the user about the remaining seconds in the delay (Download) There are numerous instances where you might want your shell scripts to sleep(1) giving the user

count

count is a minimalist perl script in the spirit of seq(1) but with a simpler syntax. It only counts in increments of 1, but -on the other hand- it knows how to count down. (Download) For instance, “count 10 1

de64

Base64 is used to encode binary data in printable ASCII form. de64 is a trivial perl script to decode such strings: (Download) One application of de64 is decoding UTF8 LDAP attributes inside LDIF files. For instance, “cn:: Um9iZXJ0byBNYXJ0w61uZXo=” may be

Luhn algorithm in PHP

As I mentioned before, the Luhn algorithm is used to validate some interesting numbers, most notably GSM IMEIs and credit card numbers. Here’s another implementation I wrote, this time in PHP. (Download)

perlwhich

Are you wondering where the heck does some arcane module come from? Wonder no more, perlwhich comes to the rescue: (Download) Next time you need to know some module’s path just run it like this: If a module resides in

Luhn algorithm in Perl

Here’s an implementation of the Luhn algorithm in perl. (Download) This program was designed for shell scripting, using something like but it should be trivial to modify it for other purposes. I’m using this algorithm to validate GSM IMEI numbers,

Phonetize

A small filter to phonetize STDIN into the NATO phonetic alphabet. It’s very useful to spell passwords over the phone. Here’s the source code. Yup, I know about Lingua::Alphabet::Phonetic::NATO but I needed a quick script without module dependencies. Yes, I

Top