After some recent downtime due to an overzealous upgrade cycle (aka “Oh I won’t need to backup first..”) I feel it warranted to put a quick post about how I went about fixing things.
How the problem started
It started off with…
After some recent downtime due to an overzealous upgrade cycle (aka “Oh I won’t need to backup first..”) I feel it warranted to put a quick post about how I went about fixing things.
How the problem started
It started off with…
Over the past 6 months or so I have learnt just how productive I can be working outside of home. I don’t know if it’s the change of scene, having less distractions, or merely that a fresh cup of coffee is only a question away. Perhaps a topic for a future post? One thing is certain though, unless your local haunt has a ready supply of power points (and is happy to let you use them) you’re hack sessions are going to be rather shortlived.

It was for this reason that I decided to invest in an external battery for my laptop, in particular the HyperJuice External Battery for MacBook (150Wh). I should note that there are other sizes available too (60Wh, 100Wh, 222Wh), but for the price/performance..
..tradeoff I decided on this one.
My aim of this post isn’t to write a sales pitch or anything like that, though I must say that I was quite impressed with how sleek the casing design was. Personally I would have much preferred it in a matte black (even if this does match the MacBook Pro unibody better), but I guess beggars can’t be choosers.
Packing 150Wh this thing isn’t exactly what I would call lightweight, weighing in at approx 1.09kg and boasting “up to 34 hours MacBook usage!!!!!™” That is of course if you happen to subscribe to their particular scenario..
MacBook Pro 13” with 63.5-watt-hour (10 hours) rated internal battery, rounded to the nearest hour. Requires MagSafe Airline Adapter.
On my MacbookPro 15” with the screen set kind of bright, my iPhone plugged in to the USB port for internet tethering, and a plethora of tabs open in Rockmelt I find the real world usage is rather.. not quite as much. I haven’t actually bothered to work it out properly, but at a rough guess I would say I get between 2-4 hours off my internal battery, and then maybe 2-5 hours off the external. It seems it varies quite a bit too, though I haven’t really looked into why. I am also using the HyperJuice Magic Box to modify my existing MagSafe charger rather than a MagSafe Airline Adapter. Maybe changing to that will cause some magical additional battery life?
Finally, price. At US$350 odd for the 150Wh model this thing isn’t exactly the cheapest piece of tech i’ve ever bought. That being said, the fact that it at least doubles the length of my cafe based hack sessions means i’m pretty ok with it.
All in all i’m pretty impressed with the HyperJuice, though if I had my time again I would probably buy the 222Wh (to help make up the difference between marketing charge life and real world life) Hopefully in the near future someone will bring out something cheaper/more powerful (~$125 per 400Wh/kg), preferably in sandblasted matte black, but until then the HyperJuice is definitely worth a look.
Note: This had been sitting in my queue half written for a month or two now.. Woops. - alias
I’ve been having some issues getting subdomains working correctly. Put a little bit of time/effort into it here and there, but never really sat down to figure it out until tonight. Figured it out, and then promptly smacked my head on the desk at how simple the solution was.
I’ve changed the actual domains, but the process is the same.
The Problem
I recently purchased a new domain (let’s call it newsite.com), which I configured to use the nameservers at ns1.hostingprovider.com and ns2.hostingprovider.com. So far so good, or so I thought. I then proceeded to configure newsite.com in Plesk on the VPS (virtual private server) that I rent from hostingprovider.com, which is setup on myvps.net.
So far so good. I then created a subdomain in Plesk (foo.newsite.com), uploaded some test content and tried to access it. No good. Maybe it just needed to propagate? I put it aside and promptly forget about the new site for a week. Coming back to it I realised that it still wasn’t working (even though the DNS had well and truly propagated by now)
The Solution
..was so simple I can’t believe it took me as long as it did to figure it out. Let’s go back to what i said a little earlier..
which I configured to use the nameservers at ns1.hostingprovider.com and ns2.hostingprovider.com
Which isn’t the same as the nameserver running on my VPS (myvps.net)
To cut what was a long story short, I turned off the nameserver on the VPS (wasn’t using it, so why waste the resources) and manually created the subdomain in my hosting providers configuration. Save here. Wait there. Load the website. Oh look, it works now. Funny how updating the correct config makes things work.
*headdesk*
Just a few notes today about making programs (in this case git) available to a chrooted SSH account in Plesk. I’m assuming the account is already setup for ssh, etc so I will just be covering where to copy the files to.
Note: If you are here about getting an execv(“/bin/bash”) failed error, check Appendix B
Location
Copying Git
Firstly you will want to locate the git files. The easiest way to do this is by typing:
which git
This should tell you the path to git (in my case /usr/local/bin) Next we want to copy the files over to the equivalent path in the chroot directory (/path/to/chroot/usr/local/bin)
cp -R /usr/local/bin/git* /var/www/vhosts/chroot/usr/local/bin
In the case of git, we also want to copy over some other files
cp -R /usr/local/share/git-core /var/www/vhosts/chroot/usr/local/share/git-core
cp -R /usr/local/libexec
/var/www/vhosts/chroot/usr/local/libexec/git-core
Note: The libexec files are quite large (100’s of mb) so you may want to consider doing this in a better way.
Updating chroot’d directories
The final (rather simple) step involves updating any chrooted directories that have already been created. This can be done by running the recreate_chroot_env.sh script (downloadable from http://kb.parallels.com/818)
This can also be done without the script
/usr/local/psa/admin/sbin/chrootmng —remove —source=/var/www/vhosts/chroot —target=/var/www/vhosts/<domain name>
/usr/local/psa/admin/sbin/chrootmng —create —source=/var/www/vhosts/chroot —target=/var/www/vhosts/<domain name>
Thats it!!
Now when you login to your chrooted account you should be able to use git. I might add the required files for some more programs as I find the need to add them.
Appendix A: Files required for ftp
Appendix B: execv(“/bin/bash”) failed
One cause of this occuring is due to the bin files for a chrooted directory not exisiting/being properly setup. This can be fixed by following the instructions in Updating chroot’d directories above.. or if you’re too lazy to scroll (like me)
/usr/local/psa/admin/sbin/chrootmng —remove —source=/var/www/vhosts/chroot —target=/var/www/vhosts/<domain name>
/usr/local/psa/admin/sbin/chrootmng —create —source=/var/www/vhosts/chroot —target=/var/www/vhosts/<domain name>
I’ve been following the GitHub craze for a little while now, and finally coming to a stage where I would like to start contributing to some of the projects I follow. Having looked closely at the examples for one in particular, I noticed something simple, but beneficial that I could add, so I set out to become an active member of the internet!
I forked the repository, synced it down to my computer, made the changes, created a pull request, and got it merged with the main code. Win!!
It wasn’t until a week or two later that I was reading an article that mentioned creating pull requests from your main repos wasn’t really the best idea. Woops. So, to remind myself, and hopefully help some others out in the process, I’m documenting what is the ‘proper’ (if such a thing exists) process for forking.
Hopefully theres enough info here to at least set you on the right track to contributing if (when! do it, you know you want to..) you start contributing to open source projects.
Sources
So here comes the obligatory post about my resolutions for 2012. In no particular order or level of detail:
This one isn’t a resolution so much as a goal but a notable thing to do in any case:

Just a short one today to point out that I finally got around to configuring the domain (read: defeated the dns dragon) to work properly with tumblr!
From today forwards the blog will be accessible from http://blog.devalias.net as well as the old tumblr address (which will forward to the new domain anyway)
Hope you guys enjoy!
I’ve been getting hit pretty heavily lately with a pile of Russian spam, so I decided to look into adding language based spam filtering to my mailserver. This post serves as a reminder of what I did, and hopefully also helps some others in a similar situation.
Location
SpamAssassin Config File (local.cf)
Add the following line to your config file, ensuring any other ok_locale lines are commented (#) to increase the score for all mail that isn’t English or Japanese
ok_locale en ja
SpamAssassin TextCat Plugin (v310.pre)
For versions greater than 3.1, you will also need to enable TextCat. Make sure the loadplugin line is uncommented in the v310.pre file.
# TextCat - language guessor
loadplugin Mail::SpamAssassin::Plugin::TextCat
Restart
Now all thats left to do is restart your mailserver/spamassassin and you should be good to go!
References
Once I accepted that the redesign still wasn’t working, I created the opportunity to find out why not. See that interesting little trick I pulled there? Failure is an opportunity to problem solve!
I’m sure i’m not alone when I say that without Facebook events/bdays I would be so much more out of the loop. A while ago I realised that I could subscribe to events/bday feeds in my external calendars (in this case, my iPhone). Best; Day; Ever! Suddenly I don’t need to be at my computer to know what’s going on, which for me is great since I tend to have the ‘out of sight out of mind’ mentality. Even if I looked at them this morning, ask me at midday and I won’t remember a thing I have planned.
In any case, this stopped working for a while, and I finally got around to reenabling it yesterday, so figured I would make a quick post about how to find it for anyone else interested.
Hope you guys enjoy/find it useful! :)
Facebook Event Feed
Facebook Birthday Feed