By fernando | June 17, 2009

iptables trick to limit concurrent tcp connections

This is sort of a self-documenting post, and a self-support group about ill-behaved tomcat apps. Sometimes, you have multiple nodes accesing your MySQL server (or any kind of server, for that matter) concurrently. Eventually, software in one or more of these nodes might do nasty things (you know who you are buddy:)) MySQL provides a [...]

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 | 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 13, 2009

Top 25 most dangerous programming errors

Most people make at least 8 or 9 of these in a new project, and this alone is a good reason to use a programming framework, unless you know what you’re doing. The problem is, sometimes, people who skip on frameworks, don’t know what they’re doing. Or, as the Tao of Programming says: There once [...]