NodeQuery Widget


NodeQuery is at its core a simple bash script for Linux servers that reports the health of the server to a web based front-end. It reports statistics such as average system load, ram usage, disk usage, running processes, network usage and more.

After a friend introduced me to it recently I noticed it lacked any widgets for displaying information about servers publicly, which is exactly why I decided to work on one.


As of the time of this post the widget is a work in progress, but the current features are:

  • Simple install: upload to your web server and install ImageMagick.
  • Display the widget with an img tag wherever you would like.
  • Each theme is a .php file that can decide how to render the image output.
  • Two built-in themes: ram_cpu_tall and ram_cpu_short.
  • Easy configuration: just open the conf.json file and adjust accordingly.


A short theme that displays RAM and CPU usage as well as whether the server is online.

A less compact taller and darker theme that displays more information about RAM usage.


You can find the nodequery-widget project on GitHub, please feel free to fork and contribute if you have any ideas you’d like to see implemented, or a new theme to share!


Twitter Contest Bot

“This is the story of how I wrote a Twitter bot to automatically enter contests and ended up winning on average 4 contests per day, every day, for about 9 months straight.” – Hunter Scott

Recently Hunter Scott, an American programmer and Electrical Engineer at Motorola Solutions, wrote a post on his blog about using a bot to win over 1,000 contests on Twitter by re-tweeting contest tweets. The story broke on various news article such as Engadget, the Independent, and the Guardian.

Like so many who read about this story, I immediately realized how amazing it is that nobody had done this before. So in a state of complete boredom I decided to quit procrastinating and conduct a bit of research on the Twitter API and see how quickly I could whip up a similar bot using Python.

A little bit about Python

Prior to this experiment I hadn’t used Python too much, so I had to familiarize myself with its syntax. After an hour or so of tinkering around I had created a script – that although very basic – accomplished the same fundamental result as Hunter’s bot.

Whilst coding with Python I came to realize how pleasant it is for a few good reasons:

  1. Python uses indentation for scope. Instead of using curly braces (or then, end, and do in Lua), you simply use tabs to denote where a block begins or ends.
  2. You don’t need to provide parenthesis around the arguments of a function call, and while I’ve seen this in other languages too, it’s nice for simple methods that take only a string.
  3. The package manager “pip” is lovely to use, and very quick to get started on a new script and import any necessary dependencies.

How does it work?

The Twitter API for Python is used to scan new tweets for keywords like “RT to win” every 10 seconds (to adhere to Twitter’s request limits), and are added to a queue.

r = api.request('search/tweets', {'q':'RT to win', 'since_id':last_twitter_id})
for item in r:
    if item['retweet_count'] > 0:

Then, every 5 seconds, the first item in the queue is re-tweeted. The content of the post is analyzed to figure out whether it is required to be favourited, or for the author to be followed.

if len(post_list) > 0:
    post = post_list[0]
    api.request('statuses/retweet/:' + str(post['id']))

Where can I find this bot?

This bot is written purely for educational purposes. I hold no liability for what you do with this bot or what happens to you by using this bot. Abusing this bot can get you banned from Twitter, so make sure to read up on proper usage of the Twitter API.

If you’re interested in checking out the source code, you can find it over at the twitter-contest-bot repository on GitHub. From the time of this posting it has been Starred by users 53 times and Forked over 25 times. Two GitHub users have already contributed to it through pull-requests and I expect more will probably do the same.

Yesterday night I received an e-mail from GitHub user raulrene, he was letting me know that he too had created a similar bot (coded with JavaScript) in response to the news. You can find his bot here. I have sinced included a link to it under the Alternatives section of twitter-contest-bot/, and he has done the same.

I posted a link to the bot on Reddit in response to a post about Hunter’s bot; it very quickly received over 300 upvotes from users, and garnered way more attention I thought it would. R.I.P. my inbox.

In conclusion, Python is cooler than I thought and writing bots is pretty fun. – Future of the Web

Ethereum, what’s that?

If you haven’t heard of Ethereum you should certainly check it out. I followed the Bitcoin movement from it’s humbled beginnings, but unfortunately didn’t invest too much into BTC (otherwise I’d be rich.)

Ethereum, powered by the altcoin Ether, is a decentralized platform for the creation of Dapps. It’s like Bitcoin in the way that it is a distributed, encrypted, peer-to-peer system that runs on a block chain.

What are Dapps?

Dapps are essentially a decentralized application – or Contract – that uses peer-to-peer networking and a block chain to stay alive and run, with their output verified by each node. This is great because Dapps can be used as a method for various trust-less systems, such as but certainly not limited to: electronic voting, autonomous democratic socities, or Kickstarter style crowd-funding of projects with no central authority.

Why does this matter?

Huge companies and experts in cryptography are collaborating to build the infrastructure paving the way toward the Internet-of-Things, and Ethereum is a contender for part of the systems involved in its development.

If we’re going to move toward a world where everything is connected, it needs to be a world where everything is connected to each other, and not to a centralized network that routes information to and from each device. Why? Trust. If 26 billion devices are routing communication through a central server, each device, and more importantly, each human must trust that authority with their data, and to relay the correct information.

As we’ve seen countless times over the last decade or so, central authority cannot be blindly trusted. If we as a society, and as a species, are going to move forward; we have to develop a system to remove this trust altogether.

“According to Gartner, Inc. (a technology research and advisory corporation), there will be nearly 26 billion devices on the Internet of Things by 2020.” [1]

Further reading

If you’re interesting in learning more about Ethereum, whether it’s investing in Ether or development of Dapps, check out some of the links below:


Codekiddy and Open-source

I know I haven’t written a blog post in a while… so I’ve recently made an addition to my calender to try and write at least one a week, so here goes.

A few months ago I was browsing through some archived folders on my development machine and came across some old projects that I’ve worked on over the years. Unfortunately I don’t often get time to work on personal projects that much anymore, and struggle to get any work done on Clockwork, but I’d really like to start open-sourcing some of these projects.

When I say a few months ago, I actually mean about 7; time goes extremely fast when you’re trying to get on with life, most of the time I don’t even realize it.


Codekiddy is a game engine I started making a few years ago for a course at University. It’s a nifty little engine written in C++, using a library called ClanLib. ClanLib isn’t so bad, it’s mostly cross-platform (although at this stage Codekiddy isn’t) and is really easy to use.

What’s cool about Codekiddy?

When I made Codekiddy (originally called Sidelined – a prototype game I was working on with a few friends before it all went downhill), I wanted it to be easy to mod. What better what to make something moddable than to implement Lua bindings, right?

  • Codekiddy uses Lua bindings for pretty much anything. It’s possible to create an entire game using the engine just from the bindings provided.
  • Codekiddy is pretty poorly documented (some text files in the project, I’d like to expand this documentation one day.)
  • LuaJIT is used to speed up Lua at run-time and works pretty well.
  • Includes a fully functional UI library written in Lua.
  • Loads content from an archived file, but content inside can be overriden by being placed in the distributed directory.
  • Includes a fully functional level editor with levels saved as JSON files (plus the ability to include a .lua script that runs specifically for that level.)
  • State system: MenuState, PlayState, etc.
  • Built-in Console (written in .lua, too, so fully customizable!)
  • Box2D physics, and entity management including base classes.
  • Built-in dynamic lighting system made by porting over box2dlights from Java to Lua.
  • Material system with material meta data in the form of custom .cmf files.

The only thing missing that I haven’t open-sourced yet is a fully working example game. I’ve actually made a couple, but I’m just trying to tidy one of them up to open-source as soon as I can.

And because I love Git so much, Codekiddy it’s freely available on GitHub. Contribute or fork as you please!

That’s all from me today, hopefully I’ll write another blog post next week, thanks guys.

Pickford Bros

Got my feedback from the Pickford Bros for my University assignment ‘Waka – a Pacman RPG’.

Choosing to ignore certain pieces of feedback (our suggestion to change the floaty movement), while accepting others, is a very good skill for a designer to have. In the commercial world any game designer is going to be bombarded by knumbskull suggestions all the way through development, often from the client who is funding the development. It’s easy to knuckle under and follow every suggestion that’s given, but usually that results in terrible games (the people giving the suggestions aren’t usually game designers).

On the other hand stubbornly refusing to change anything, and being really precious about your design, can be a handicap. So, selectively choosing the feedback that you think improves the game and implementing it, but sticking to your guns when you disagree with other feedback, shows maturity, and is the best way to behave in the commercial world. It’s always a balancing act, but sometimes other people have ideas that improve your game, other times they are rubbish ideas that will spoil the game, and other times you just have to keep the client happy one way or another.

I can’t say much more about the game than I did last time. I think it’s great, and there was clear progress and improvement from the last version. It satisfies the brief perfectly, and is fun to play. My only criticism is that the combat mini-game could maybe do with a bit more variety, and was a little easy, although I did fail on Boxxy a couple of times – the exp penalty for failing battles was perfect!

Great work, and we look forward to seeing your games in the future.

Codebase – Doxy Generation

So I made a documentation generator for Clockwork. I already looked into existing ones, but they just weren’t practical for what I’m after, so I wrote my own. It scans the entire Clockwork project for specific tags within comment blocks, and then generates a JSON array of documented functions, hooks, libraries and classes.

I’m currently working on a website which uses the generated JSON array to provide a neat interface for viewing the Clockwork documentation. Users will be able to post both comments and examples for each object, and other users can upvote the best ones to the top of the page.

Here’s a quick example of how it works.

Git Version Control

For those of you living under a rock, and are unfamiliar with it; Git is a fast, powerful, and easy to use distributed revision control system. It was created by the face behind the open-source Linux initiative, Linus Torvalds.Once you’ve set up a Git repository for your project, the basic principle of Git is this:

  1. Programmer A edits a file from a local clone of the repository on his/her system.
  2. When Programmer A has finished implementing Feature A or fixing Bug A, they “Commit” to their changes; a note can be added describing what they’ve changed, added, or removed.
  3. It would be wise at this point for Programmer A to “Pull” any changes to the remote repository; any alterations made will be cleverly merged.
  4. When Programmer A so desires, he or she can then “Push” the changes to the remote repository.
  5. Programmer B will receive these changes when he or she makes a “Pull”.

There’s way more to it than that, but that’s the basic idea; Git is awesome and I much prefer it to Apache Subversion (SVN).

Linus Torvalds
“Intelligence is the ability to avoid doing work, yet getting the work done.”