Simon Holywell

I didn’t think that Tumblr offered per-tag RSS feeds, but after spending some time trying to hack the JSON output from the Tumblr API into my aggregated front page, I tried appending “/rss” to the URL of one of my tag archive pages, and somewhat to my surprise, it worked.

Of course, RSS is…

A nice Tumblr tip.

On a recent project I needed a fast way to compare documents for likeness and return a percentage match. With much research and one unanswered Stackoverflow post later I came across Jesse Kornblum’s ssdeep utility intended for computer forensics such as looking for signatures in files when hunting rootkits etc. All the technical details of fuzzy hashing are described in his 2006 journal article Identifying almost identical files using context triggered piecewise hashing.

I was using a wrapper around the ssdeep binary written in pure PHP, but I recently decided to write my first PHP extension by tying into the fuzzy hashing API ssdeep provides. The result is a compiled .so PHP extension file or module and BSD licensed source code hosted on github.

There are full instructions provided in the readme file on github to either install the pre-compiled .so or build your own from source. If you end up using this extension or its code I would be very interested to find out more about your project.

wombert:

Expendables Body Count
A PHP wrapper for the unix at command

A project I am working on at the moment requires time delayed job queues and having found nothing yet that can manage it properly so I decided to wrap up `at` into a PHP class. This gives you simple methods to add, list and remove jobs from the `at` queue using object oriented code.

The code is very simple and I have documented it reasonably well so along with the examples you should get on your way quickly. The class can, of course, be used from the command line as well so if you want to write batch scripts in PHP to handle adding a collection of predefined `at` jobs for example - it can make it easier.

I feel the important features of `at` have been added into the code, but if you want to wrap any of the other functions then please do fork my code and make a patch or post a pull request. For more information on what `at` can do please either run `man at` in your console or visit the Edinburgh University’s man at page.

You can get the code from my repository on GitHub: PHP-at-Job-Queue-Wrapper.

If you do have any trouble getting the `at` daemon (atd) going then my previous post may help you debug it - please see If you are having problems getting Ubuntu atd running for more on that.

Sometimes you will want to batch remove extensions from a load of files:

for i in $(ls *.png); do mv $i ${i%.png}; done

If you want to remove extensions from files with a .txt extension then you would replace the two instances of .png in the script above with .txt.

You can take the extension off of all files using the following:

for i in $(ls *.*); do mv $i ${i%.*}; done

I also extended it by using it for a batch change of extensions rather than just removing the extension:

for i in $(ls *.html); do mv $i ${i%.html}.htm; done

Note the extra .htm after the curly braces in the above command.

If you are having problems getting Ubuntu atd running

If you just cannot get atd to start running check the permissions on your /var/spool/cron/atjobs and /var/spool/cron/atspool directories. The should be `chmod 770` and then `chmod +t`. Also they should be owned by `daemon:daemon`.

I was getting this error when attempting to set new at jobs:

Can’t open /var/run/atd.pid to signal atd. No atd running?

If I tried to start the daemon through the service management I was getting:

sudo service atd start
start: Job is already running: atd

But running `ps -elf | grep ‘atd’` yielded no appropriate results.

When trying to start the atd daemon manually on the command line I was getting:

simon@forge:~$ sudo atd -d
Cannot change to /var/spool/cron/atjobs: Permission denied

Which finally gave me the clue!

Getting the gearman PHP PECL package to build on Ubuntu is problematic with many unaccounted for dependency issues.

I only made a couple changes when following the instructions from JSJoy as I am running Karmic rather than Lucid I changed the apt-get sources to:

deb http://ppa.launchpad.net/gearman-developers/ppa/ubuntu karmic main
deb-src http://ppa.launchpad.net/gearman-developers/ppa/ubuntu karmic main

My sources file was also located at /etc/apt/sources.list and not /etc/sources.list as stated in the original post from JSJoy.

In this video, John Resig presents his 6 Secrets to becoming a jQuery Ninja address on how jQuery is arguably the most popular and useful Javascript framework available today. — zoopy.com

wombert:

The World’s Best Countries
A nice modern take on the original Stratos by Pininfarina set to be sent into production. Thankfully they preserved original rear end lights and lip spoiler. Not so sure about the headlights.
hotvvheels:

Stratos

A nice modern take on the original Stratos by Pininfarina set to be sent into production. Thankfully they preserved original rear end lights and lip spoiler. Not so sure about the headlights.

hotvvheels:

Stratos