Joel Spolsky wrote an interesting article on ways to make coding mistakes obvious, like using semantic prefixes on variable names. If you have unfiltered data from the user, you can make the variable something like $usFoo so that you always remember that the data is unsafe, and won’t output it unfiltered (therefore preventing malicious code injection).
Firewalling an OpenVZ node and containers
The OpenVZ wiki has a nice script for firewalling an OpenVZ node and it’s containers. It creates a service and configures iptables to block all traffic to the node (except the ports you specify), but allow all traffic through to the containers, so that they can manage their own firewall. It also allows the container’s […]
Content Above Anchors Disappear
It turns out there’s a serous problem with the One True Layout method of creating equal height columns. All of the content above an anchor will be shifted up, making it seem like it disappeared. There aren’t any universal or reliable fixes for this, so the Faux Columns method is probably the best choice if […]
Working with Qmail’s Queue
Relaying Qmail Through a Spam Filter
If you’re running a mail service on a web server so it can send out e-mail from contact forms, etc then you’ll want to make sure it’s relaying outbound mail through a spam filter, or it could be used to send spam if the forms get hijacked. For qmail, you just need to create /var/qmail/control/smtproutes […]
Memorable IP Address
If you’re troubleshooting a network’s uplink to the Internet and want a memorable external IP address to ping, then you can use 4.2.2.2, which is one of Verizon’s DNS servers.
Skipping Disk Check When Rebooting Linux Server
If you don’t run a disk check on a Linux server in awhile and you reboot, it may force a disk check, which can take 30+ minutes, and it’ll be offline the entire time. You can reboot and skip the check with shutdown -fr now or force a check with shutdown -Fr now. (via go2linux.org)