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:


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.

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