By fernando | March 10, 2011

Piping data to multiple processes

Here’s a simple shell script to stream data to multiple processes. It has many applications, but the reason I wrote it is to stream the same data to multiple netcat processes on remote machines. Here’s the code: #!/bin/bash usage() { cat <&2 usage : multi-fifo target0 [target1 [target2 [...]]] Where each targetN is a program [...]

By fernando | April 29, 2009

SOUNDEX(), triggers, and stored procedures

MySQL provides a SOUNDEX() function, which returns the soundex of a given string. For details, refer to the manual, but to put it simply, it allows you to compare strings based on how they sound, hence letting you do proximity searches on your database. If you’re just querying for a word, it’s usage is pretty [...]

By fernando | April 21, 2009

Extending procedure_analyse

My previous post explored a stored procedure that extended procedure_analyse with the intent of helping DBAs optimize table structure. Here’s an improved version. I’ve followed Arjen Lentz‘s suggestion and added support for the max_elements and max_memory parameters. I also added a new Indexed column to the output, which is an ENUM(‘No’,’Yes’,’Overindexed’). Yes and No are [...]

By fernando | March 4, 2009

Coding Buddies

Coding Horror always has insightfull articles, and this one on code peer reviews is no exception. Why is it that writers, musicians and, well, any respected and professional artist or scientist gets his/her work reviewed before it’s published, but the same isn’t true in IT? My guess? Most programmers aren’t neither artists, nor scientists. They’re [...]

By fernando | February 4, 2009

Generating random salts from bash

From the ‘just because it can be done’ column, here comes a handy shell script to generate random salts. So, without further ado,  here it goes: #!/bin/bash [ $# -eq 0 ] && { echo “usage: salt <length>”>&2 exit } strings </dev/urandom | while read line; do echo $line | tr ‘\n\t ‘ $RANDOM:0:1 >> [...]

By fernando | February 2, 2009

I love playing Monopoly

This is the latest speed test I run against Santiago de Chile, where a lonely database server is waiting for my queries. Well, it’s got a lot of waiting to do. This results are from a 2048 down /256 up Kb/s connection for which I pay U$S 52/monthly. Yeah, I feel your envy already. The [...]

By fernando | February 2, 2009

Erlybird 0.17.0 released

Yep, I’m really late for this. However, I didn’t want to let it pass. I checked up on erlybird a couple of times before, but it was only available as a source project, and you needed a particular netbeans version in order to build the module. I’m as geek as it gets, but I’m also [...]

By fernando | January 19, 2009

Intrusion detection at the application level, for PHP

Here’s phpids, an Intrusion Detection System for PHP. According to the site, it aims to counter XSS, SQL Injection, header injection, directory traversal, RFE/LFI, DoS and LDAP attacks, and unknown attack patterns,  through it’s Centrifuge component. Installation is simple. Just download it, copy the lib directory to a directory in your project structure, or add [...]

By fernando | January 19, 2009

Symbolics Lisp Machine

Wanna have your own Symbolics Lisp Machine? Here’s the info. I have enough room, I just live a few thousand miles too far, and have to deal with very picky Customs officials.

By fernando | January 16, 2009

New release of MySQL Proxy GPL

MySQL Proxy has a new release, just three days ago, and if that wasn’t good enough, it’s now hosted on Launchpad, so it’s repository is on bazaar, which is great, and is what I’ve been using for my new projects. MySQL Proxy sits between clients and servers and offers many possibilities, load balancing being the [...]