Quickly limiting access to php scripts using .htaccess

Sometimes one needs to quickly block access to offending scripts – like for instance when a site has been hacked and malicious files have been uploaded to the account and are used to send out spam emails.

Apache provides a simple way to block out files from being accessible to visitors. And as most intrusions involve directly access hacked php files, the bit below will do wonders at blocking out those direct calls while leaving the main site fully functional (sort of).

Running VirtualBox headless via web interface on CentOS

I’ve been searching for a headless VM manager for running and managing virtual machines on Linux.

VirtualBox seems the best solution for the task so far, as it is capable of running headless on Linux and has an (unofficial but great) web interface to manage it.

SpamAssassin fails to start on CentOS 5.10

If you’re still running a CentOS 5.10 machine, you may notice that after recent updates SpamAssassin no longer works on your system. Trying to start it manually will get you a puzzling error:

Starting spamd: child process [12345] exited or timed out without signaling production of a PID file: exit 255 at /usr/bin/spamd line 2588.

Manually running sa-update also triggers an error (albeit more detailed)…

Split multi-contact .vcf address book into individual .vcf’s

Moving contacts from one phone to another is a tricky business. And when the manufacturers of the said two phones are different, this process quickly turns into a pain in the b**t.

It’s a known fact that Android (and, weirdly, older Sony-Ericsson) phones export their contacts as a single multi-contact vcf file. And it’s also a know (and hated) fact that Nokia’s (otherwise great) Suite program can only import single-contact vCards.

Migrating existing RAID1 volumes to bigger drives

Every once in a while hardware needs to be replaced. Sometimes boards, sometimes CPUs and sometimes drives. Drives are the ones most difficult to replace as they hold all that precious data one does not want to lose.

I personally hate reinstalling stuff; so I try as much as possible to “migrate” my data around. In this tutorial I’ll be replacing two drives under a RAID1 array with two newer bigger drives (and resize the array accordingly).

Handling processes / services on hibernation / wakeup in CentOS

Hibernation is a great feature on any computer. It allows for a temporary pause in execution in which the system in question can be unplugged, cleaned, modified, or moved.

But what happens when some services don’t play nice and fail to resume properly from sleep? Fortunately, Linux’s power management utilities provide the necessary functionality…

Maximizing Netgear WNDR4500v2 functionality with DD-WRT (USB, FTP, Samba, TFTP, Printer sharing)

The Negear WNDR4500v2 router is quite a beefy piece of hardware with advanced firmware, including plenty of features even for a maniac user like me.

I would most likely not have replaced it from day 1 however if it had one more feature that I absolutely needed: TFTP/PXE/BootP options for the DHCP server. There is where DD-WRT comes in…

Restarting USB subsystem in CentOS

After a long uptime specific (cheap) devices or components connected to the USB ports lock up or malfunction. Unplugging and plugging them usually fixes issues, but physical access to the system (especially a remote server) is neither always possible or desirable.

In cases like this, Linux (unlike Windows) can trigger a USB subsystem restart by deactivating and reactivating the USB controller(s).