Hoke’s Ramblings

Marvellous Movies!

by Chris on Jun.19, 2008, under Entertainment

Hulk (the incredible one) kick’d asz! Then I saw Iron Man, it kick’d moar asz!!1

For Iron Man, make sure you stay till after the credits.

And if you haven’t seen either, see Iron Man first.

2 Comments more...

Wake On LAN Through the Internet

by Chris on Jun.14, 2008, under Tech

Wow. Four posts in as many days! This blog is smokin’!

Firstly, I’d like to say that to add to the super l33tness of this post, I used WOL and VNC from halfway around the globe to get local admin access to my router to check all the settings necessary for this to work. l33t.

Wake on LAN is a very useful tool that allows you to send what is known as a ‘magic packet’ over a LOCAL area network to boot up a specific PC, whose MAC address appears in the packet. Googling this will give you any number of applications and tutorials to accomplish this. Getting this to work from outside your LAN however, is a tad trickier.
(continue reading…)

Leave a Comment more...

DIY Email to SMS Gateway

by Chris on Jun.14, 2008, under Tech

Well, despite the ‘Wake on LAN’ being the ‘popular’ choice for my first how-to, as Murphy would have it, it’s not working now for some inexplicable reason. Hence the subject of this post will be getting emails to be automagically rerouted to your cell-phone by SMS.

Firstly, you unfortunately need to pay somebody to send you SMSes. Good choices in South Africa are WinSMS or BulkSMS. In both cases you sign up for an account and prepay a certain amount of SMSes. The example below uses BulkSMS.

Next, you need to set up a mail forwarder to execute a php script. I’m not entirely sure it’s possible with all hosts, but it is with Site5.

Create a mail account (I get bounce errors if the account doesn’t actually exist) eg “sms2me@mydomain.com”. Instead of forwarding to another email address, specify the following:

| /usr/local/bin/php /home/your_home_dir/path_to/sms2mail.php

Next you need the script to actually take the mail passed to it and ship it off through your third party gateway.

Disclaimer: This is code was pulled in from all over until I got the cursed thing to work. Requires curl libraries to do the form post. No warranties express, implied or otherwise apply. Some emails still come through with rich formatting etc, which uses up all your 160 available characters. I need to look into this at some stage.

#!/usr/bin/php
<?php
   // read from stdin
   $fd = fopen("php://stdin", "r");
   $email = "";
   while (!feof($fd)) {
      $email .= fread($fd, 1024);
   }
   fclose($fd);

   // handle email
   $lines = explode("\n", $email);

   // empty vars
   $from = "";
   $subject = "";
   $headers = "";
   $message = "";
   $splittingheaders = true;

   for ($i=0; $i < count($lines); $i++) {
      if ($splittingheaders) {
         // this is a header
         $headers .= $lines[$i]."\n";

         // look out for special headers
         if (preg_match("/^Subject: (.*)/", $lines[$i], $matches)) {
            $subject = $matches[1];
         }
         if (preg_match("/^From: (.*)/", $lines[$i], $matches)) {
            $from = $matches[1];
         }
      } else {
         // not a header, but message
         $message .= $lines[$i]."\n";
      }

      if (trim($lines[$i])=="") {
         // empty line, header section has ended
         $splittingheaders = false;
      }
   }

   $headers2 = "From: $from\r\n" .
      "Reply-To: $from\r\n";

   mail('###@gmail.com', "[SMS] ".$subject, $message, $headers2);

   $message = substr($message,0,155); // make sure it fits

   $ch = curl_init();
   curl_setopt($ch, CURLOPT_URL, 'http://bulksms.2way.co.za:5567/eapi/submission/send_sms/2/2.0');
   curl_setopt ($ch, CURLOPT_POST, 1);
   $post_fields = "username=###&password=###&message=$message&msisdn=27#########";
   curl_setopt ($ch, CURLOPT_POSTFIELDS, $post_fields);
   curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
   $response_string = curl_exec($ch);
   curl_close($ch);
?>


Now back to getting my wake on wan to work again…

Leave a Comment more...

What is this blog for?

by Chris on Jun.12, 2008, under Tech

Ok, so clearly I (and you, the blessed reader) aren’t getting enough bang for my buck, blog-wise, so why on earth did I renew for another year, you might ask?

Well, besides blogging, I’ve hacked together a couple of useful server-side scripts over the years that I still find immensely useful, in my personal capacity, reader-be-damned. Here are a few of them:

  1. Screenscraping TVsite.co.za to get the day’s telly viewing on one page, one click from my bookmarks toolbar
  2. Sending Wake-on-Lan “magic packets” to my router, which passes them on to my desktop at home, so that I can boot up my PC from anywhere in the world to use VNC, with just a click of one of my (non-shared) del.ico.us bookmarks.
  3. Automatically emailing my gmail account when above happens, so I know my PC’s booted up properly (ok, this has nothing to do with my webhosting, but my ISP’s open mail server)
  4. Emails to a private account on my domain get forwarded through an SMS gateway to my number, so I can get booking confirmations etc sent straight to my phone.

A couple of these, particularly the Wake-on-Lan and email gateway story were a bit of a headache to get to work, so if people are interested, I may actually write some blog-entries with how-tos!

3 Comments more...

Another year

by Chris on Jun.11, 2008, under General

So, Site5 has just hit my credit card for another year’s hosting fees. Hopefully the next 12 months will yield more blog entries than the last 12 did (a grand total of 6, including 2 pathetic jokes). @ $7.95 per month, that costs me a whopping R125 per entry!

1 Comment more...

DVD Shelf Organiser for TV Cabinet

by Chris on Jan.15, 2008, under DIY

Finally, after years of waiting, a blog entry worth reading!

A while back I bought a TV cabinet at an auction. The only problem with it was it had grotty broken slats on the display case door, which I didn’t much care for. I broke those out and replaced them with a pane of glass. Much nicer, but if you don’t keep the inside neat, it looks terrible.

before.jpgWhile it’s all very nice and geeky organising your DVD catalogue online, if they’re just tossed higgledy-piggledy into the display case, they’re pretty hard to browse, and aren’t all that nice to look at.

I had the notion that because the cabinet was slightly deeper than three DVD boxes, a bunch of appropriately sized steps, so that the DVDs could be stacked behind one another in layers, would go a long way to neatening up my cabinet.

So I whipped out my trusty tape measure and measured up the cabinet, and DVD boxes – taking my LOTR extended editions into account too! I then went to Builder’s Warehouse and got them to cut up a plank of 20mm SA Pine into slats that I roughly thought would do the job. I’m a tad embarrassed to say I botched the measurements of one of the planks, so I’m not going to be showing a side view of the finished product, but here’s a Sketchup rendition instead:dvd-riser-500px.png
Obviously you’ll need to adjust the width to match your needs – in fact I made mine way too snug and couldn’t actually get it into the cabinet once it was varnished, so some disassembly was required.

Everything is screwed together from the top, so that no screws are visible from the front. Basically three screws along the front of the horizontal slats hold the front panels in place, and then two screws on each side keep the horizontal slats on the L-shaped braces.

I (actually Lina) gave it a couple of coats of coloured varnish to make it match the cabinet. As I said, I botched the measurements, so I wasn’t planning on showing the finished product, but Lina said if I didn’t, no-one would ever get to appreciate her varnishing job. So here it is:
installed.jpg
After that it was just a matter of alphabetising, and squeezing them all in! It looks like I’m going to need to put in another shelf above the top level, but for now I’ve returned the LOTR boxes to the entrance hall bookshelf to give the rest of my collection some breathing room.
after2.jpg

While putting all the discs in alphabetical order I noticed some interesting coincidental juxtapositions, like “Hot Fuzz” next to “Ice Station Zebra”, and “The Silence of the Lambs” next to the “Sound of Music”.

I also realized that a heck of a lot of movies start with “S”!

2 Comments more...

Google Earth Traceroute database update

by Chris on Jan.08, 2008, under Tech

After analysing the logs for my website, it appears that the majority of the traffic coming here is for my Google Earth Traceroute. So being a diligent netizen, I have updated the IP georeferencing database to the Jan 2008 release. It appears to be quite a bit more accurate than the one I was using from 2006!

As per terms of use, I am obliged to say:

This product includes GeoLite data created by MaxMind, available from http://www.maxmind.com/.

Leave a Comment more...

Ghostbusters Spin-off

by Chris on Dec.03, 2007, under Pathetic jokes

Have you heard about the new all-female spin-off TV series of Ghostbusters? It’s called Killmore Ghouls

Leave a Comment more...

Nice

by Chris on Nov.18, 2007, under Pathetic jokes

Chris: will amost definately be in france at some stage early next year. will keep you posted

Brice: nice

Chris: not sure if i’ll be in Nice :)

2 Comments more...

India

by Chris on Oct.07, 2007, under Personal

If a trip to India isn’t worthy of a blog entry on hokemon.com, then nothing is.

I’ve just come back from a business trip of 10 days or so in India. It’s been a while since I was last overseas, so it felt pretty good to be stretching my wings again. I also quickly remembered how great it is to get back home though!

After fending off snide remarks about knocking us out of the T20 World Cup, India winning the tournament on our first day there proved to be an excellent icebreaker. I just wonder where Yuvraj (Six-Six) Singh is going to be driving his prize Porsche!

Things went pretty well there (besides being loaded on the wrong plane at Calcutta), and after knocking off early on our last day we were taken around Cuttack, allegedly one of the oldest cities in India (>1000 years). The Mahindra was pretty full though, so one of the guys took me there on the back of his motorbike. That’s the way to get around, I tell you! When EVERYBODY and EVERYTHING has right of way, and potholes are more common than tar, you NEED something maneuverable! It certainly gave me the opportunity to experience India from the locals’ perspective.

Once we got to Cuttack, Sanjeev dropped his bike off at his home and we all squeezed into the Bolero. It felt like something straight out of an India Jones movie, being chauffeured around in a huge car with bicyles and pedestrians, cows and dogs all vying for passage through the tiny streets.

They then took us on a shopping spree, including the local Reebok store so Ashley could pick up a premium Kashmir Willow bat for his brother. Shopping was fun, but Ash and I were getting a bit apprehensive about the ever diminishing time before our plane was due to take off, but after eventually having to be bit forceful we got taken to the airport and made it with a few minutes to spare.

India was full of new experiences, including sharing a Tata Indica with five other adult males, and I now have newfound respect for our roads. The food was pretty good, and not too spicy, which was my biggest fear when heading over there in the first place. Nice place, but like I said at the beginning, good to be back.

3 Comments more...

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!