Category: Perl

Whitespace Matters

Mark Jason Dominus just released SuperPython 0.91, “a Perl source filter for the SuperPython language, allowing SuperPython code to be embedded into Perl programs”. In terms of language, it goes way beyond python itself to give proper semantics to whitespace.

md5pass

This snippet is a simple wrapper around Digest::MD5‘s md5_base64() builds unsalted MD5 digests encoded in base64, very useful for LDAP management and LDIF file processing. (Source code) Use it as such: $ bin/md5pass > password {md5}X03MO1qnZdYdgyfeuILPmQ== [tags]Perl, MD5, code, code

Some lovely ASCII Art

Andrew Savige’s Bottles of Beer have been found by the Python pundits (and by some gutless Perl defectors ;-) ) and are being waved as a textbook executable-line-noise example. There’s people that can’t stand beauty when they see it. (That

Find out LDAP client IPs

ips.pl is a simple perl filter that processes SunONE Directory Server 5.2 access logs to find out the IP addresses that queries are coming from. It’s very useful to evaluate the impact for migrating LDAP infrastructures. Most comments and variable

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

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