Linux

Port knocking

I've decided to try out port knocking. This is the knock script I came up with:

#!/bin/bash

echo -n "Enter port list separated by spaced: "
read ports

(
for port in $ports; do
  telnet $1 $port &
  sleep 0.1
done
sleep 1
pkill telnet
) >/dev/null 2>&1
sleep 1
exit

How many disks does it take to screw in a database?

My previous experience with optimizing disk performance in Linux revolved around getting huge chunks of data off disk quickly, but this means nothing to a typical database. Databases are usually limited by how many IOPS (Input/Output Operations Per Second) the disk subsystem can sustain. The database servers at work have plenty of RAM so disk reads nearly always come from the disk cache and disk writes appear to be our bottleneck.

The database servers each have a RAID 5 array with three 10k RPM drives, while the web servers each have mirrored 15k RPM drives. all SAS.

^V Esc c

Ever mess up your terminal by echoing something stupid, like cat /var/log/apache2/access.log.2.gz when you though you already gunzipped it?