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.

0
Your rating: None

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!

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

Apache mod_proxy '[error] (13)Permission denied' error on RHEL

Had an interesting issue today working on a mod_proxy setup of Apache forwarding requests in a reverse proxy setup to a backend Tomcat server. No matter what I did, I kept getting this in Apache's error log:

[error] (13)Permission denied: proxy: AJP: attempt to connect to 10.x.x.x:7009 (virtualhost.virtualdomain.com) failed
0
Your rating: None

Teaching Java How to Commit Suicide

At $work, we have a lot of java processes that are ran via cron and other wrappers that do some pretty critical tasks. The apps have been written so that the whole thing is wrapped in a try/catch that will call system.exit(1) should something not go right. Our wrapper scripts watch for a non-zero exit code, and alert Nagios if something went wrong.

This works great except for when a VM encounters an outOfMemory exception (OOM). The Java VM attempts to continue on, but if the main thread hits this exception, the entire VM will exit. However, the application code that exits with a status of 1 never gets called, so the application ends up dying with a status of 0. Well, Sun (Oracle now I guess) gave us a new option in Java 6 that was backported to 1.4.2_12 and up that allows us to tell Java to run a shell command when it encounters an OOM exception. By adding the option

-XX:OnOutOfMemoryError="kill -9 %p"

to our Java command line, the VM will execute a shell that calls the kill command, with an argument of the PID of the VM. The -9 option to kill will cause the VM to exit with a non-zero status, so that our wrappers will pick up the error and alert the right people.

Note: this feature was never backported to Java5 - sorry!

0
Your rating: None

Display a CCK Filefield or Imagefield Upload Widget on Your Own Custom Form

Took a fair amount of googling around to find the solution to this one. With the Node Gallery 3.x branch, we needed a way to quickly add an image to an existing gallery. We could have displayed the whole node form, but there's a lot of things on that form that we can just use the defaults for 99% of the time. We need just three fields filled in: Title, Caption, and the imagefield itself.

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

Drupal, meet Hudson; Hudson, Drupal...

At $work, we use Hudson extensively, and it rocks. For those who don't know already, Hudson is an implementation of Continuous Integration that is remarkably easy to use. I wrote about my first impressions of Hudson previously. Hudson's original audience was Java developers using Ant or Maven, but with plugins and some hacking, we can make it do some things for us as module contributors to Drupal.

3.333335
Your rating: None Average: 3.3 (3 votes)

ZFS in the Trenches presentation at LISA 09

Just got the chance to finally sit down and watch Ben Rockwood's presentation at LISA 09: ZFS in the Trenches. If you are even thinking about ZFS and how it works, it's a very informative presentation. There is very little marketing-speak, and he very specifically targets sysadmins as his audience. Great stuff! Of interesting note about his comparison of fsstat vs iostat, our Apache webservers routinely see about 5MB/sec reads being asked of ZFS, but the actual iostat on the disk shows that almost all of that traffic is being served up from ARC.

0
Your rating: None

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 (2 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

NGINX Performs Well on Solaris 10 x86

Just a quick posting of some simple benchmarks today.  Please note, these are not the be all, end all performance results that allow everyone to scream from atop yonder hill that Solaris performs better than Linux!  This was just me doing a little due dilligence.  I like Solaris 10, and wanted to run it on our webservers.  We're looking at using NGINX to serve up some static files, and I wanted to make sure it performed like it should on Solaris 10 before deploying it - you know, right tool for the job and all.  So, disclaimers aside, here's what I found.

0
Your rating: None
Syndicate content