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!


Read More

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.

Read More – 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:


Read More

Alex Grist’s Departure

A while ago Alex Grist wrote a blog post outlining his side of the story regarding his departure from Cloud Sixteen. Unfortunately Cloud Sixteen never got an official chance to respond, so I’m going to detail what happened here.

Since late 2004, early 2005, I have been working with Lua on GMod. For a good 6 years I released scripts for free to the community, and hosted plenty of communities to engage both sandbox and roleplaying playerbases with huge success.

Around 5-6 years ago I began working on a roleplaying script called Cider. It was heavily enjoyed by the light roleplay community and before I knew it my server was packed. I eventually released this for free to the community and began evolving it into something more serious; from playing it I had developed a taste for serious roleplay, and Taco’n’Banana inspired me heavily.

Through many iterations, and over many years, Cider went through various names in its transition to a framework: Cider, Cydar, Blueprint, (a few others), kuroScript, OpenAura, and Clockwork.

Clockwork was my greatest achievement. I had completely re-written the inventory and item system to support fully dynamic and persistent item types, it was awesome. I made a schema called Test Bed to demonstrate the new features Clockwork had to offer, and CW: Test Bed was hosted by Cloud Sixteen. People loved it!

As time went on and I continued to develop Clockwork in public beta, university began to take over a large portion of my life. I managed to keep working on Clockwork in my spare time on the back of OpenAura’s success. It was when GMod 13 was released that many things about Garry’s Mod changed. I simply didn’t have the week or so required to convert Clockwork to GMod 13’s new format, as university was getting particularly heavy on me.

I needed to hire somebody. Alex Grist was always good fun, me and him would banter with the authentication system in OpenAura and Clockwork, I would try to make it uncrackable and he would try to crack it – good fun! We’d even talk in Steam about this, and I held no grudge on him at all for what he was doing.

It was for this reason that I decided to hire him, and so I did. Alex was given the deal that he could take money for pre-orders for the duration of the time that he works on Clockwork, and he did. Alex Grist did a great job working on Clockwork in my absence, and I respect him greatly for the pressure he took on.

When Alex decided to leave Cloud Sixteen after I had refused to up the percentage of money he could take from regular (non pre-order) sales, I was a very disappointed; he was a valuable asset to me, but I just couldn’t give him more money at that time.

I wish Alex all the best. I hope in the future we could work together again, under different and renewed circumstances.

Read More

CyanogenMod vs MIUI

There’s hundreds (or at least tens) of custom Android ROMs out there, so many to choose from, so it can be a little daunting when trying to find one right for you. I’ve been using MIUI for a little over two years now and it has always suited my needs. There’s plenty of features I like about MIUI, but just to list a couple of the most important ones to me:

  • Has a very clean, customizable interface, with great theming capabilities.
  • Regularly updated, and has good support for older phones.
  • Private messaging system (you can access a hidden set of messages for specific contacts.)

A phone is something you’re looking at a lot, most of the time without even thinking about it: whether it’s just to check the time; to see what your friends are up to on Facebook, or whatever. So it’s important that it’s ergonomically and aesthetically pleasing.

I had my Samsung Galaxy S2 for a long time, it was my pride and joy, I customized it to no end. When it got stolen from me ~4 months ago I bought another one straight away, it wasn’t easy, but I managed to find somebody with one that was pretty much new. The reason I didn’t go for a newer model like the S3 or S4 is simply because I couldn’t justify the price, a bigger screen or the latest processor just didn’t appeal to me.

Over the past couple of weeks the battery has started to let me down, though, and I’ve found myself having to charge my phone way too often. The first thing I did was go and order a new extended battery on Amazon, but in the interim I wiped everything and downloaded CyanogenMod.


I remember using CyanogenMod in the early days way before I started using MIUI, and always found the interface to be ugly and unintuitive. When I switched to MIUI I found the interface to be sleek, and clean, and everything appeared to run faster and smoother. Here’s why I’ve decided to switch back to CyanogenMod:

  • No stable update has been released for SGS2 for at least 3 months, but the update that was released then is very stable and very fast.
  • CyanogenMod have expanded greatly since I first used the ROM years ago, the team is much wiser, and the development is far greater.
  • The community is great, the developers are friendly, and new features have since been added.
  • I find that CyanogenMod is always the first out of the two to release ROMs for the latest Android versions (KitKat, for example.)
  • You can hide applications from the drawer that don’t matter to you. This includes any stock applications you don’t like seeing.

Since switching I’ve found that my battery is going down at a much slower pace, but I was still heavily put-off by the interface design; that was until I found this:

Theme Chooser Themes

This is a great application that unlocks the true potential of CyanogenMod’s Theme Chooser, which is almost on par with MIUI’s theming system.

It allows you to download and install fully featured themes within the app, for practically no cost (unless you want to buy a premium theme, which always tend to a far greater magnitude of awesome.)There are plenty of free themes to choose from, however I came across a premium theme called Simplex Blue Theme that I instantly fell in love with. It’s simple. It’s sleek. It’s all kinds of grey, and best of all it’s only £1.22. I’d spend double that on a coffee.
Well, that’s all folks.

Read More

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.

Read More

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.

Read More

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.

Read More

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.”

Read More