Code

Drupal StackScript for RH Derivatives on Linode (Instant Drupal!)

StackScripts are a relatively new offering from Linode that allow users to build their own installation script by "stacking" previously existing scripts together to build the machine you want. You can keep your StackScript to yourself, or publish it for the world to use. Deploying a distribution with a StackScript takes only about 5 minutes, afterwards you have a fully configured system with applications up and running. Here's a sneak-peek at a my Drupal StackScript for RH Derivatives deployment just before launch:

0
Your rating: None

Assign Different Values to Different Nodes via One Action in Views Bulk Operations

The Views Bulk Operations module (a.k.a. VBO), is a godsend for busy Drupal site administrators. Don't just take my word for it - Lullabot wrote a chapter about it in O'Reilly's Using Drupal, it's included in the Open Atrium Drupal distribution, and it's even used on Drupal.org! Out of the box, VBO does a lot to streamline the things you do everyday, so that you spend less time doing them. A perfect example is bulk content moderation - with a few clicks of the mouse, you can mark a huge amount of comments as spam. You can even enable batch processing with a single click of a mouse so that you can literally do thousands of these without timing out.

VBO was attractive enough that we decided to offload the bulk/batch operations of Node Gallery to VBO. Integration for the most part was surprisingly easy - VBO "speaks" in Drupal Actions, so by writing actions, we were writing integration with VBO.

There's one undocumented case where VBO can be used that was critical for us. Most VBO actions you will find perform one action to a set of nodes, one at a time. Often times, that one action is to set a value of some sort on said nodes. In the case of Node Gallery, we wanted to be able to assign different weight values (used for sorting) to a bunch of nodes. The key here is that we aren't assigning a value of '2' to all selected node's weight, we want to assign a weight of 2 to node #1, 3 to node #2, 8 to node #3, and so on. While not straightforward, it's definitely achievable.

5
Your rating: None Average: 5 (1 vote)

HipHop PHP and Drupal

So, Facebook has released HipHop PHP - a PHP-to-C++ converter. While the name is stupid, the idea is not. 100% of their developers know PHP, I would guess that less than 5% of them are proficient at C++. So, HipHop takes their PHP code, and converts it to compiled C++ -- in turn, they get a huge boost in performance and get to keep their existing developers. HipHop is also it's own webserver too - fun!

My first thought was: I wonder what this could mean for Drupal? Well, David Struass, a maintainer of Pressflow (a set of patches for Drupal performance and scalability) put up a blog post about what it would take for Pressflow and Drupal to become HipHop-friendly. Exciting times!

3.666665
Your rating: None Average: 3.7 (3 votes)

QuickTip: Fix Eclipse Galileo buttons on Ubuntu 9.10

There's a nasty upstream bug in GTK present in Ubuntu 9.10 that makes Eclipse Galileo all but unusable -- specifically it makes clicking many buttons with the mouse just stop working. You can use tab and spacebar to make it work, but that's not much of a workaround. All you need to do is set an environment variable before starting Eclipse:

export GDK_NATIVE_WINDOWS=true
5
Your rating: None Average: 5 (3 votes)

Share Your Eclipse Plugins and Configurations Across Platforms

Over the years, I've come to know and love Eclipse.  Though it has roots in Java, ironically, I use Eclipse for just about everything except for coding Java (if I wrote Java code, I'm sure I'd use Eclipse).  Eclipse is great for browsing Subversion, coding PHP, coding Perl, and even coding shell scripts.  For die hards like me, there's the viPlugin that allows you to use all the vi commands you know and love within Eclipse.  About the time you get your perfect Eclipse setup established, you buy a new laptop on a new platform.  Or, in my case, I have three "primary" development workstations, each on a different OS.  The rest of this article will show you how to hook Dropbox into your Eclipse installation, allowing you to share your plugins and configurations across different versions of Eclipse, on different machines, and even on different platforms.

0
Your rating: None

Random Password Generation in a Perl One-Liner

Say you need a quick random 8 character alpha-numeric password. In sh, there isn't a $RANDOM variable and tr can give different results on different OS's. More than likely you have perl available - use it!

perl -le 'print map { (a..z,A..Z,0..9)[rand 62] } 0..pop' 8

Thanks to Chris Angell's Perl One-Liner page for this one. Do you have a better cross-platform way of doing it? Let me know!

2.5
Your rating: None Average: 2.5 (2 votes)

New and Improved check_mem.pl Nagios Plugin

We have always monitored RAM usage on all of boxes. Sure, there's the argument that unused RAM is money wasted, but I always like to know not just when the box is swapping, but when it's about to start swapping. There have been a few plugins over the years that I've used for this - check_ram for Solaris, check_mem for Linux, and there's also check_mem.pl. Well, migrating to Solaris 10 and ZFS started tripping the check_ram thresholds due to the ZFS ARC cache. So, I attempted to pull together a cross platform Nagios plugin that did it's best to give me what I wanted, and what do you know, it works! This graph shows the ZFS ARC cache at it's best:
cacti.png

4.166665
Your rating: None Average: 4.2 (12 votes)

Estimate time-to-completion with est

Like many of you other sysadmins, I run a lot of ad-hoc, long running jobs. Also like many of you, I have a full plate and can't stand to sit around watching things run. Often times, I will start such a job and forget to come back to it until the end of the day. I needed a way to find out quickly about how long these tasks would take to run so that I could make a mental note or set a reminder to check the task later.

0
Your rating: None

Google Reader + Podcasts + MP3Player == GReaderSync.pl

Google Reader is great, it lets you keep up on your feeds from anywhere - your phone, your MAC, your PC, and on and on. Podcasts are great too. Free education and entertainment abound. Most podcasts can be subscribed to via RSS. Google Reader is great for keeping up on the latest podcasts, but the interface sucks and I prefer to listen to podcasts on my MP3 player. I needed a good way to integrate Google Reader and my MP3 player. GReaderSync.pl is the result.

0
Your rating: None
Syndicate content