A New Year

Happy New Year!

To all my readers, no matter when you are actually getting round to this post, I wish you all a happy new year, and that this year goes well for you (or has been going well for you so far, if you’re reading this a bit further in the future).

Now, on to the main event…

What Are you doing for New Year?

This year, as before, I am not really going to be having a New Year Resolution. This is mainly due to the number of times I have tried, and failed to keep one, and also due to a lot of the time them being completely pointless, or something that is un-achievable. However, unlike previous years, I will be making a list of goals, which will be listed here for all to see, which I can try and achieve by the end of the year.

Spend January Sober

Yes, this included last night for New Years. This was actually quite enjoyable, sat around chatting with my good friends, enjoying good food and some comedy, and then Karaoke. And not a drop of alcohol was drunk (by me, anyway…). This is due to me joining in on a sponsored ‘Dry-Athlon’, for Cancer Research UK. My sponsorship page is at TBSliver – Dryathlon, so please go put as much as you can in there, as it is for a very good cause.

Just so you know, this is not the first time I have done a sponsored no-drinking event, several years ago I participated in a ‘Thirst For Life’, although the internet seems to have swallowed any reference I can find to the exact event.

Release (Atleast) One CPAN Module

Ok, this one is surprising that it hasnt happened already. Considering that I work for Shadowcat Systems, a well known company in the Perl world, and one of the people I work for is mst (who is well known for his ‘well volunteered’ saying), that I havent ended up with a module to care for is surprising.

This wont actually take as long as you would think, for the first release atleast – I have been working on a Zsh plugin manager which may also become able to manage other shell systems – Bash plugin manager anyone? Anyway, the work is currently at App-Antigen, and is almost ready for first release – infact I have been using it for the last few weeks successfully. Any comments, pull requests, patches, and improvements are more than welcome – including if you see something and go ‘why the hell did you do it that way?’.

Talk at a Tech Conference

There are a large number of Tech Conferences which I am either attending, or helping to run (on the day at least). But something that has not happened yet, is for me to do a talk, lightning or otherwise, at one of these events. Over the next month, I will be trying to come up with some ideas for talks to give at various conferences, and if you have any ideas for talks which you think I could give, feel free to e-mail me or find me on IRC – Contact details are on my About page.

Write a Blog Post once a Week

Something which I am starting right now (obviously) is to write a post on this blog atleast once a week. So hopefully there should be no more than 7 days between any two posts! This is one of the only targets for this year which will be more difficult than the others, due to the time of it. However, I am quietly confident I can manage this, as well as improve the software that this blog is running on (which is due a blog post in the near future as well!).

Participate in Leigh Keatings Page-a-Day Challenge

This is something else which I will start as soon as I get hold of a cheap diary – Leigh Keating’s Page-a-Day Challenge. This is an interesting writing challenge, and the things I write in here may just end up as a blog post! I can see my one ending up as a much more technical diary than for fiction writing (as is the case in Leigh’s), however this will have to wait and see what the year will bring.

Wrap Up

This list is by no means exhaustive, and I will probably be creating a new page with the details from this venture up at some point in the future, which may also include any other note-worthy achievements for this year. For now though, I will leave you with your thoughts, and hopefully some of you will join me in the Page-A-Day challenge!


First Post!

So here I am again, typing another blog post. Except this time, im writing it in markdown, and it will then be statically generated to HTML, using some exceedingly clever perl which I have been adding things to.

The main program is called App-SCS, and was created by Matt Trout (mst). This app is only a very basic website creator, and although very powerful, has not many features to start with. So I have started working on a Blogging platform for it! The code can be found in my Github, at App-SCS-Blog. An example app with the Blog working in it (with instructions on how to install it!) is at App-SCS-Example

Infact, for ultimate insanity, the raw markdown, html, and js for this site can also be found in my Github, at TBSliver-Me

Android Android Studio Java linux Programming

Android Studio Under Debian – The Return

So, in trying to actually run Android Studio on a new machine, I’ve had to add a few more dependencies. You can see the original post here: Android Studio Under Debian. Now I am running Debian Testing, and came up against some more interesting missing dependencies after that when creating a new project. So if you get an error like so:

> /home/tbsliver/<snip>/app/src/main/res/drawable-xxhdpi/ic_launcher.png: Error: Cannot run program “/home/tbsliver/Development/android-studio/sdk/build-tools/20.0.0/aapt”: error=2, No such file or directory

Then you need to install a few extra packages. Elsewhere on the internet it will tell you to install ‘ia32-libs’, however these have been replaced with two other packages. So install them as so:

sudo apt-get install lib32z1 lib32ncurses5

And then you will also need one final package which you will get errors about otherwise:

sudo apt-get install lib32stdc++6

After that, it should work and run the Gradle commands nicely! hope this helps someone! (or just reminds me what the issues are later)


Getting Google Hangouts working under Debian Testing (Jessie)

So, ive been having issues trying to get Google Hangouts working in Debian, specifically under Jessie. It shows the green connecting symbol, then gives up and shows an error screen (which is oh so helpful….). After trying multiple things or installing, uninstalling, installing 32bit versions, etc., I came across some instructions here. These actually fixed it! And for those who dont trust links to random sites on a blog, the instructions are below:

first, uninstall google-chrome-stable (or beta, though I havent tried it with that), and google-talkplugin (if you have it installed).

Then, uninstall libudev0. This (for me atleast) was the culprit…

Then, reinstall google-chrome-stable, and google-talkplugin, and your away! Hopefully this will help someone.

Some extra notes: I am using Debian Testing AMD64, on a Lenovo ThinkPad X200 Tablet. Because sometimes info like that helps…


Creating a USB Boot Disk

So, just needed to create another USB Boot disk, and had to search through my command line history for the command set I used… tends to be, if you’ve ever needed to do anything more than once, its probably a good idea to write it down. So here is how to create a Linux USB pen, on the command line, step by step…

Step One: Plug in the USB Pen. Yes its that simple! No that isn’t it for this step. You then need to run ‘dmesg’ to find out what the computer thinks this drive is under. You should see something in the most recent messages about the USB pen, including something about /dev/sd*. Mine was /dev/sdb, with /dev/sdb1 being the actual drive. So, you then run ‘umount /dev/sdb1’ (replacing sdb1 with whatever your results are).

Step Two: Download the .iso image you want to use for the boot image. In my case, atleast this time, it was Ubuntu, with a file name of ‘ubuntu-13.04-server-amd64.iso’. Then, you can actually write the image! to do that you run ‘dd if=Downloads/ubuntu-13.04-server-amd64.iso of=/dev/sdb’. Thats it. What dd does, is copy and convert something – in this case, a binary image for a cd/dvd – and converts it into the files on a usb drive. in the command, you can see ‘if=’ which is how you set the input file, and ‘of=’ which is how you set the output file. Nice and easy!

Extra Credit: Now when dd is running, it has no progress bar or anything… it just sits there and says nothing at all. There is a way, however, to get it to say something. What you need to do, is open another terminal (in a new tab, screen, tmux window, whatever), and type ‘watch kill -USR1 `pidof dd`’. Note the backticks around pidof dd – those are important. On my keyboard, they are on the key above tab, although this may vary from country to country. This will then cause the terminal that you ran dd in, to start spitting out text – which will tell you exactly how much of the file it has written. If you’re just setting it running then going to do something else though, you probably dont need to bother with it.

WARNING WARNING WARNING: Be VERY sure where you are writing the output file – dd can and WILL overwrite a hard drive, quite happily. I’ve never tried to overwrite my main hard drive – I dont know if its possible while your using it as your main boot disk, but I would rather not find out. Also, make sure you dont have any data on the USB pen that you want to keep, as this will completely overwrite everything on the disk, even if it is much bigger than the actual disk image you are going from.

Other than that, have fun, and enjoy your new boot disk!


Freeglut 2.8.1 install

Ok so a quick post – have been trying to get freeglut to install under Debian, so I can do some OpenGL work in Perl. However, just couldnt get it to work – it kept complaining that GL/gl.h and GL/glut.h were both missing. Turns out I was missing two extra bits… So to get it to install, I had to do:

sudo aptitude install libgl1-mesa-dev libglu1-mesa-dev

and then could do the make all. Woo!

Android Android Studio IDE's Java linux Programming

Android Studio under Debian

Hey long term readers! Just another short entry so that things I find useful to know are actually accessible to other people if they so need it. Today: Getting Android Studio to work in Debian (Wheezy).

So when I first ‘installed’ (read: unzipped) Android Studio, it wouldn’t start up – something about a .jar file missing:

‘tools.jar’ seems to be not in Android Studio classpath. Please ensure JAVA_HOME points to JDK rather than JRE.

Which, as any programmer who encounters an odd error does, was promptly pasted into Google to see what other people had done about this. And really, there wasn’t a huge amount of things on it specifically, a lot of posts about needing to install the full Sun/Oracle JDK. Now, as I’m running Debian, that would mean changing the entire Java kit out from the OpenJDK that is currently installed… so I wondered – couldn’t I just install the OpenJDK Dev Kit? lo-and-behold, one simple aptitude install later and its all working – apart from an upgrade to Android Studio straight away… So, to get this working easily, and without any faffing about re-installing the entirety of Java, you just need to do this:

sudo aptitude install openjdk-6-jdk

Wait for it to finish, then re-try running Android Studio!

NB: I did find that the first time I ran it, the first menu screen didn’t render properly, but I think that may just have been a bug that was fixed in the update to Android Studio.


Some Github and Perlanet news

This is just a quick update, to let you know that the code from the Perlanet Simple walkthrough is now on Github, here! There are a few changes I’ve made, though mainly just re-organise the folder to make more sense. So now the actual script is in the ‘bin’ folder, the template and config files are in ‘etc’, and the output folder is the same as before, in ‘www’. This also means that the script and config have been changed slightly, to reflect these folder changes.

The original writer of the module, Dave Cross, has also asked if he can use this tutorial in the documentation, and so eventually you will see some of this somewhere in the Perlanet module. For now though, I will be working on the next stage of this tutorial!

If anyone has anything they would like to see done with Perlanet, feel free to ask and I will see if i can accomodate it.

Perl Shadowcat

Perlanet not-quite-so Simple

So in my current project at Shadowcat, I am using a CPAN module called Perlanet, as written by Dave Cross. This module/program is mainly for aggregating web feeds (Rss or Atom feeds) and creating a new feed and web page from them.

Now, with the stuff I’m doing for Shadowcat, I have been refactoring a lot of my code from the IronMan codebase, and customising it to do what I need. However, this did lead to a lot of ‘How the hell did that actually run?’ moments, as I didn’t fully understand the underlying modules. So to fix this, I am going to do some messing with Perlanet of my own, and hopefully have a useful walkthrough at the end of it.

Either that, or this will be an entertaining read of how to bash your head against a desk… so. To Coding!

Stage one: Throw out the current docs

Now, as with most CPAN modules, there is some documentation shipped with each piece of code. And, as with all documentation, sometimes its not massively useful. Now, this might just be me being thick, but when coming to use Perlanet::Simple, I had several problems even getting off the starting block. In the docs for Perlanet::Simple, it listed that to use it, all you need to do is:

my $perlanet = Perlanet::Simple->new_with_config('perlanet.yaml');

Now, of course you will need to include the module with ‘use Perlanet::Simple’, and need a file called ‘perlanet.yaml’ in the same directory, however apart from that… what? Well, turns out you need a few other things to make this not throw any errors…

use Perlanet::Simple;

my $perlanet = Perlanet::Simple->new_with_config(
configfile => 'perlanet.yaml'


(note: I have left out ‘use strict;’ and ‘use warnings;’ of all code snippets to save space, but they are implied in all snippets… plus you’d be mad not to use them anyway).

The main (and only) change is to make the call to ‘new_with_config’ a hash, by adding “configfile => ‘perlanet.yaml'” instead of just the filename (note – ‘new_with_config’ is not defined in Perlanet code, it is actually defied in MooseX::ConfigFromFile, and expects a hash to be passed to it).

Phew. well, as that now works, onto the rest!

Stage two: Configfile? What Configfile?!

The next stage to getting this fully working, is to create the config files that Perlanet will understand, which also means knowing what you want to aggregate. There are some demo files given in the examples folder on CPAN, however it’s probably easier to see whats going on when you create your own. So, to do this you need to have or know the following:

  • A title for your page
  • A subtitle or description of your page
  • The URL for your website
  • your name (you do know this, right?) and an e-mail address
  • The number of entries you want to have on the page
  • Where you want the generated page stored and the template to use for it
  • Where you want the generated feed stored and what format to use
  • An URL, title, and website for each feed you want to aggregate

You will also need a template file to use, which is in the TemplateToolkit format. I won’t go into how to create one of those, just use the one below…

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
<html xmlns="">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>[% feed.title %]</title>
<h1>[% feed.title %]</h1>
<p>[% feed.description %]</p>
[% FOREACH entry IN feed.entries %]
<h2><a href="[% | url | html %]">[% entry.title | html %]</h2></a>
[% entry.content.body %]
[% IF OR entry.issued %]
<p>Published[% IF %] by [% | html; END %]
[% IF entry.issued %] on [% entry.issued | html; END %]</p>
[% END %]
[% END %]
<hr />
<address>[% | html %] / [% feed.modified | html %]</address>

Now for this example, I will make something that aggregates 3 blogs – Makezine, Arduino, and Adafruit. These are mainly because I love making things, and these are 3 very popular blogs for Makers in general, but you could use any other blogs you want! All you need is the RSS or Atom feed link.

First thing, create a file called ‘perlanet.yaml’ in the same directory as your script. then add the following lines, populating it with your own bits as required:

title: Maker Planet
description: Make all the things!
name: Tom Bloor

This info is just the basic bits for the actual page you’re creating. The next few lines are for defining your input and output files:

# previous bits go here
entries: 20
file: www/index.html
file: www/atom.xml
format: Atom

In this part, you have defined the number of entries you want in your feed (here its 20, Perlanet actually defaults to a pretty sane 30, though ofcourse you can have this as high or as low as you like), the output file you want the html in (here it will be put in a folder called ‘www’) and the template to use for this file (see Template part earlier). The last part is completely optional, but will output an Atom feed file that you can then subscribe to! (You can also make this RSS by changing the format to RSS).

After these, you then add the feeds that you want!

# previous bits go here
- url:
- url:
title: Arduino Blog
- url:
title: Adafruit Industries

Here it shows the 3 feeds i chose earlier. It also shows the extra information you can add to each, though the title and web parts are completely optional – I think those are only used if you have them in your Template. (Or if you customise Perlanet, but that I’l go into later…).

With all those bits, you can now run your Perlanet, and it should just work! (as always, mileage may vary…)

Stage three: Bug Stomping

Phew! you made it this far. Now then, if you have managed to run your script, and it didnt throw any errors, and the web page that came out is respectable (Ok it may look pretty crap if you used the template I provided, however it IS very basic anyway…), then you may not need the few things I’ve learnt while doing this. However, if you have a few bugs to work out, then here are the few things I found worked.

  • Double check your perlanet.yaml file. Seriously, as you’ve created it by hand, there is most likely an error, a typo, a missed variable, something. Also check the whitespace – look at the example from CPAN (here) to see how it should be spaced.
  • If the web page looks especially bad, see if it isn’t just some stray style bits from the feed you have aggregated – they sometimes have spacing things in there that will screw with the layout. Will go into more detail later how to filter that out, for now… sorry.
  • Lastly, it may actually be an issue with the code I’ve posted. If nothing you try fixes the issue, or you find I have a mistake in my code, feel free to comment and I’l get back to you when I can, or fix the issue in my code. Other options, are to go to the many other Perl resources that are around, such as IRC, or the many other websites (too many to list…) that may be able to help.

Well that about sums it up! Next time, I will be going into more detail of changing the workings of Perlanet to do some more useful things. I will also probably go through some changes to the file and folder structure of this project to be a bit more sane, though for now it isn’t a massive project so probably doesn’t matter as much. enjoy!


Spelling mistake spotted by castaway (your -> you’re).
removed the ‘use Perlanet::Trait::YAMLConfig;’ as seems to not need it… random bug I had thats disappeared since.
Fixing highlighting items


Moar NGC problems..

Ok, in trying to print out an event from Google Calendar, there was an issue in getting the main content of the entry to print. the trick with this is to do:


this will then print out exactly what you want! woo…. (thanks theorbtwo & castaway)