Category: Code

Link: JSESSIONID considered harmful

Craig Condit makes a strong case against JSESSIONID in JSESSIONID considered harmful. And I just learned that it is disabled by default in Grails 1.1.

Posted in Code, General, Java, Security Tagged with: , ,

uHOWTO: Recover stuck modified keys from VMware Player or Workstation

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

Posted in General, Linux, sh, SysAdmin, Tech Tagged with: , , ,

update…where id in (select…) and mySQL ERROR 1093

What’s wrong with this picture? mysql> UPDATE IGNORE flight SET intl=1 WHERE id IN (SELECT AS id FROM flight f LEFT JOIN airport a ON WHERE<>‘mx’ FOR UPDATE); ERROR 1093 (HY000): You can‘t specify target table ‘flight‘

Posted in Code, General, SQL

Bourne Shell Server Pages

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:

Posted in Code, Hack!, sh, Tech Tagged with: , ,

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.

Posted in Code, General, Perl, Python, Tech

Moving from MyISAM to InnoDB: bulk table conversion

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. The original post also suggests using grep to limit the scope of the conversion to

Posted in Code, General, sh, SysAdmin


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

Posted in Code, General, Perl

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

Posted in Code, General, Hack!, Perl

Demo for Luhn algorithm in PHP

If you have a number that adheres to the Luhn algorithm for validation, you may check it easily with this short PHP snippet. (Download) You may test this script at Please consider that this is a demo, so please

Posted in Code, General, PHP

Find out LDAP client IPs 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

Posted in Code, General, Perl, SysAdmin