Easy server monitoring script

I manage or monitor a few servers, and it's a good idea to keep an eye on how they're holding up. The Linux `uptime` command is all I need - show me how long the server's been up (or if it's cycled recently - power hiccup?), and CPU load averages. I just whipped up a dead-simple solution to let me embed the uptime reports from the servers into my retro homepage....

October 29, 2010 · 2 min

Modifying the BuddyPress AdminBar

On UCalgaryBlogs, I'd modified the adminbar to include a link to the current site's dashboard if a person was logged in, making it easy to get to the members-only side of WordPress without having to go through My Blogs and finding the right blog, then mousing over the pop-out "Dashboard" link. Most people never found that, and it's not very intuitive. So, I hacked in a hard-coded link to Dashboard in bp-core-adminbar....

November 13, 2009 · 2 min

Fixing WPMU 2.8.4 and the ignored Banned Email Domains option

I've been having a heck of a time battling sploggers at UCalgaryBlogs.ca - roaches that create accounts and blogs so they can foist their spam links to game Google (thanks for providing spammers with such a powerful incentive, Google). There's an option in WordPress Multiuser to ban email domains - provide the domains, one per line, into a text box, and it will reject any roaches trying to create accounts from those domains....

September 30, 2009 · 2 min

WordPress, draft/private pages, and the parent hierarchy structure

I'm working with a class of 250+ geology undergrads, split up into 53 groups. They're using a WordPress site to publish online presentations as the product of a semester-long group project. I'm using the great WP-Sentry plugin to let them collaboratively author the pages without worrying about other students in the class being able to edit their work (I know - but it makes them more comfortable so it's a good thing to add)....

March 26, 2009 · 2 min

security hole in wordpress-admin-bar under WPMU?

I just tried logging into ucalgaryblogs.ca using a test user account, and was surprised to see a strange item in the admin bar at the top of the page: I was curious, so I clicked it. mwah? Those are site-admin items, being displayed to a non-admin user. I was actually able to click the "Admin Message" item to set that, even though the logged in user wasn't an admin. Scary. Luckily, nobody's noticed the extra menu yet - or if they have, they've behaved....

February 23, 2009 · 1 min

how I move stuff between servers with rsync

A few times on Twitter, I've mentioned how "easy" it is to move stuff between servers using the rsync shell command. It's actually an extremely powerful program for synchronizing two directories - even if they're not on the same volume, or even on the same computer. To do this, you'll need to login to one of the servers via SSH. Once there, invoke the geeky incantation: rsync -rtlzv --ignore-errors -e ssh ....

January 7, 2009 · 2 min

Cleaning up the Upcoming Events block in Drupal

We use the Events module to manage workshops here in the Teaching & Learning Centre, and use the “Upcoming Events” block to display the next few workshops on our website. Works great, but the default text leaves a bit to be desired. By default, it shows the event title, and “(2 days)” - which indicates that the event begins in 2 days. But, it could also mean that the event lasts for 2 days....

October 15, 2007 · 1 min

Script for running Cron on all sites in a shared Drupal instance

After realizing that the sympal_scripts were silently failing to properly call cron.php on sites served from subdirectories on a shared Drupal multisite instance, I rolled up my sleeves to build a script that actually worked. What I've come up with works, but is likely not the cleanest or most efficient way of doing things. But it works. Which is better than the solution I had earlier today. I also took the chance to get more familiar with Ruby....

January 1, 2007 · 2 min

Drupal Shared Hosting Site Installer

Update: I added a cleaned up copy of my script, in case it comes in handy for anyone. Read the end of this post for more info... I just finished whipping up a workable bash script to automate installing and (basically) configuring a new site on a shared Drupal hosting server. Here's the basic scenario. First, you set up a "template" site, and configure it however you want all new sites to start....

July 20, 2006 · 2 min

Automatically backing up multiple Subversion repositories

We're using Subversion to manage files for all of our projects in the Teaching & Learning Centre. More projects means more Subversion repositories to backup. Instead of maintaining a list of projects and repositories, we stick all repositories in a common root directory, and I've just put together a dead simple script to automatically dump all of them to a directory of my choosing. I've added this script to the crontab for the www user on the server, and it runs svndump on all repositories, gzipping the output for archive (and possibly restore)....

April 5, 2006 · 1 min