Modding TUGm to use custom MAC on a VPS

Tugs Uptime Project is a great service for monitoring and recording the uptime of your various hosts.

They have various clients for (almost) all operating systems. Unfortunately all of their clients base the machine id by MD5-ing the machine MAC address. This works perfectly unless you are using a VPS… which will have no MAC address for its network interfaces, generating the same machine ID on every host.

So in an attempt to make their latest Linux client – TUPm – usable on my VPSs, I made some changes to the client and conf file to add support for defining my own custom MAC (when a MAC is not found).

Raspberry PI as NAS

A friend of mine was wondering about using a Raspberry PI as a NAS, the question being: how fast is the PI at file transfers from/to an external hard disk connected via a USB rack.

So I booted up my PI, mounted some random 3.5 inch Samsung 160GB SATA hard drive inside another random Spire USB-SATA external (powered) rack and gave it a go at some testing.

Upgrading the SD card used on WRT54GL v1.1 running dd-wrt

If you’ve done the SD card mod on WRT54GL, you might at some point change it with a bigger / faster card. You could just replace the SD card with a bigger one, but then you’d have to install/re-configure everything set up on it (like Optware stuff). […]

Using dd to repeatedly erase a specific range of sectors on the hard disk

I recently needed to erase a specific range of sectors on a hard disk that had developed bad sectors. And I needed to erase them repeatedly, to make sure the remaining sectors in that area are stable.
This is were the dd tool comes in handy: dd if=/dev/zero of=/dev/sda seek=START count=SIZE bs=1M
For example…

View sorted list of connected IPs

At points one may need to quickly check and see who is connected to a server – and in case of servers running services such as http, ftp (so on) the number of their connections.
The netstat program does indeed display the list of connections, but browsing through it when there is a large number of connections is rather difficult.

Disable yum fastestmirror plugin on CentOS

The fastestmirror plugin may be useful at some points, but it can be a pain in the ass at others.
For example, I tried updating my CentOS installation today and because of the mirror caching it was downloading the updates at 30K/s. After disabling the plugin the speed from picking a different mirror jumped to 3MB/s.

To disable the plugin…

Restricting access to hidden site using .htaccess

Just like in real-life construction and rebuilding, you sometimes need to demolish and rebuild an existing website. And you probably want to do this behind a very nice and safe wall.

The wall, in our case, will be a “currently rebuilding. please visit soon” index.html file. If directory index priority is set to html then php, now the index.html file will be our visible website and hide the soon-to-be-demolished php-based website.

Console commands to hibernate and standby on CentOS

It’s great that Linux nowadays supports all the power management features available on computers. But it’s odd that beside the buttons to trigger standby/hibernate – which are only available in a graphical interface – there are no simple console commands to put the computer to sleep or into hibernation.