AuthorJack Concanon

221 Byte Tron Game

Interesting little story on Slashdot today about a Tron game made in just 221 bytes – http://alokmenghrajani.github.com/tron/ – does seem very small but then you have to remember that Javascript and Chrome do provide a large amount of the handling code, pretty much all that had to be implemented was a tick function and a draw function with the direction being represented by an on key up event.

Might have to attempt it in something like python or C++ for extra brutality.

WordPress Twitter Integration

Moved host from the fairly useless 123-reg and am now with http://krystal.co.uk/ (their servers are located in an ex MOD bunker!), so I thought it was high time to give the website the usual refresh and do up. This time I am using WordPress and so far so good really. Excellent support and community, simply fantastic administration section. Couldn’t ask for more.

I’m in the process of adding features and fixing things around the site. Also I am moving content over from the old site to here as it can’t be easily imported. The old site is still available using an alternate link, http://www.low-tech.co.uk/, which will be moved over at a later date.

So one thing I thought I’d share is how I integrated my Twitter feed into my main feed on the site as I saw a few people asking about it and there isn’t a plugin available for it. It’s very simple really but requires editing of PHP files, I might make it into a plugin when I have a bit of spare time to learn how plugins work.

Firstly you need to set up some cron job or alternative for downloading your Twitter RSS feed however frequently you like. Your Twitter RSS feed is located at:

https://twitter.com/statuses/user_timeline/{your_twitter_username}.rss

Once you have got that inside a folder it’s time to parse it. Instead of using some sort of XML parser I am instead using a nice XML2Array function that I found here http://www.bin-co.com/php/scripts/xml2array/.

Create a function in your functions.php file to parse your RSS feed, mine looks like this.

Now in your home.php or index.php you need to use that function to get your array of tweets and then put them into your main feed. The idea is that in your main while loop you first check your tweet array to see if you have tweets that are newer than that post, if there are then display the tweet and remove it from the array. Eventually all the tweets left are older than the posts on that page so you can just output them at the end.

My home.php has this inside the main loop with $tweets being the array of tweets.

At the end simply repeat the foreach loop to print the remaining tweets in the tweet array.

Conky Config Script

Here’s my conky script. If you don’t know what conky is it is a real lightweight and extremely customisable system monitoring program. This script is for my quad core so take out the extra cpu lines depending on how many cores you have. Feel free to share your config files below.

Pi Approximator in Python Using Liebniz Formula

Calculates Pi to an increasing degree of accuracy using Leibniz formula. The more cycles that it runs for then the greater the accuracy of the result.

Python Watchman System Monitor

A ‘live’ console based systems monitor in Python. Can be easily extended to monitor various other things. Currently only monitors disk usage, memory usage and zombie processes. Can provide advice for a user. Written to aid some non technical system users. Update: Added percentage bars and tidied up. Also added a CPU monitor.

Backup and Restore Script

Backup and restore files from specific folders. Maybe someone could make it keep track of where it was backed up from and restore back to previous location…

Create Notification Bubbles In Gnome

If you’ve ever been leaving something to run in a terminal and wanted a way of alerting yourself that it has finished AND you run gnome then I have the perfect solution. Have you noticed the little black notification bubbles that appear at the top right of the screen to tell you about things such as emails and the like? Well you can very easily make your own notifications by installing libnotify-bin. You will now have a program called notify-send.

The most basic command is notify-send “test” “Test” which will give you the following –

This program can also allow you to specify icons for this notification too, for example the command notify-send -i calendar “test” “Test” will give you this –

There are plenty of other options in there but it is a very nifty and useful thing to have installed.

PHP IRC Bot

OOP IRC Bot, easy to maintain and update. Has admin functions. Quite old now so maybe one day I will port it Python or something, not that active on IRC anymore.

Reading a CSV File in C++

This is an example of how to read a CSV file in C++, the while loop and the struct will need to be changed according to how your CSV file is set up. In mine I only require the name and id so use two getlines in the while loop. This most likely could be optimised in some way.

Torrentflux – Download Failed Straight Away

I’ve installed torrentflux on my linux server at home and it was all running fine until it seems that I decided I knew what was best and started messing with things. I had changed the owner of the users folder from www-data to my local login name.

The problems that this caused were that every time I added a new torrent to be downloaded it would fail instantly. Creating a new user solved this problem as obviously a new user was created with the correct owner and permissions in the user folder but me thinking that I had solved this issue then proceeded to change the owner of that folder too leading to the same problem. Took me a very long time to work out that due to changing the permissions from the default apache user to my own user was stopping the apache run torrentflux from writing data to my user folders.

Things to be learnt from this are that changing the owner permissions of folders is always going to end badly. Secondly, if you’re having the same problem as me then just remember to check the permissions and owner of your torrentflux user folders.

(No copyright material was harmed in the making of the post.)

© 2026 Acodemics

Theme by Anders NorénUp ↑