Beutelevision

by Thomas Beutel

Category: Programming

Patch old Fedora 8 server for Shellshock Bash bug

I had an old Fedora 8 server running legacy code that I needed to patch for the Shellshock Bash bug. I proved that bash was vunerable by running this command: env X=”() { :; } ; echo busted” /bin/bash -c “echo stuff” I saw the word “busted” in the output, meaning I needed to upgrade […]

Suppress Test::More Output For Use In Nagios

I needed a quick way to check for XML well-formedness in a Perl Nagios script and I found that Test::XML has a test called is_well_formed_xml($xml) that does the job nicely. The only problem was that as part of the Test::More framework, Test::XML outputs test results (as it should). In my case though, I just wanted […]

Updated WordPress, PayPal IPN no longer works

I recently updated a client’s WordPress to 3.9.2. There was a page on that WordPress that served as the PayPal notify_url and it had been working fine up until I updated. The page simply used a shortcode that I created in the functions.php file to process the incoming PayPal parameters. After the update, what I […]

Nagios, Belkin WeMo and a Plasma Globe

I monitor a number of servers using nagios and I always thought it would be neat to be able to have some sort of ambient device light up when there was a critical problem. Yes, I get email and text alerts, and nagios is always up in one tab on my browser, but I wanted […]

Nginx with php-fpm generating blank page

I struggled a long time trying to figure out why my nginz + php-fpm setup was not working. I could tell that the gateway was fine and I was getting a HTTP 200 OK response, but the output was blank and there were no illuminating entries in either the nginx or php-fpm logs. After a […]

Making Aquamacs kill and yank work with the clipboard

My favorite editor on the Mac is Aquamacs (me and Emacs go waaay back) and something that has long been a productivity killer for me was the different actions of C-y and CMD-V. This is due to there being two clipboards, the one belonging to the Mac and the one in Emacs (the kill ring). […]

Find a Javascript parent node that matches a certain string

Here’s a small bit of javascript that I use in my Sencha Touch projects to find a parent with an id that matches a string. function findParentNodeRegex(regex, childObj) { var testObj = childObj; var count = 1; while(!testObj.id.match(regex)) { //console.log(‘My name is ‘ + testObj.id + ‘. Let\’s try moving up one level to see […]

Detecting a click in a checkbox with jQuery

A simple script to detect when a checkbox is clicked. What you do with once you’ve detected the click is up to you. <html> <head> <script src=”http://www.google.com/jsapi”></script> <script> google.load(“jquery”, “1.3.2”); google.setOnLoadCallback(function() { $(‘#agree’).click( function() { if($(this).attr(‘checked’)){ alert(‘checked’); } else{ alert(‘unchecked’); } }); }); </script> </head> <body> <p> <input id=”agree” type=”checkbox” /> I agree </p> </body></html>

Redirect from within a WordPress admin page

I was trying to perform a redirect to generate a CSV file from within a WordPress admin page using the wp_redirect( ) function, but the problem was that I would always get the dreaded “Cannot modify header information – headers already sent” message. This is because admin plugins are simply hooks that are performed within […]

Result of expression ‘document.forms[0].submit’ [[object HTMLInputElement]] is not a function.

I was trying to add a small delay into my form submission like so: <form … onsubmit=”setTimeout(‘document.forms[0].submit()’,2000);return false;”> but everytime I tried it, I got the following error: Result of expression ‘document.forms[0].submit’ [[object HTMLInputElement]] is not a function. This one had me stumped, until I realized what it was telling me… that my submit button […]