Streamyx down 15th April 2010 17:30

April 15th, 2010

So… in the middle of editing a configuration file on one of my servers and Streamyx is down. Interesting differences this time are that my router still claims to have an IP address, there’s an ADSL carrier, phone has a dialtone, TM’s support line at 1300 88 9515 is permanently engaged.

Update 15th April 2010 19:00 – back sometime after 18:00

TM Streamyx down Port Dickson 1st/2nd April

April 2nd, 2010

Just putting the finishing touches to my URL shortening service and *BOOM* everything dead: no Streamyx, no DiGi EDGE, can’t even browse from our handphones.

Just a quick note (thank you DiGi!) to keep track of it: Streamyx is dead from 11pm Thursday April 2nd 2010. I noticed soon after (when I tried to dial 1300 88 9515!) that the phone had no dial tone. Maybe something big is happening, because DiGi EDGE on my USB adapter was dead too, and so was DiGi GPRS from Jess’ phone! The handphones still worked for calls though, so I reported the fault to TM who always seem surprised that something is wrong. Maybe the network in their office is managed by DiGi.

Internet from the EDGE adapter and the handphone seemed to come and go for a while before midnight, but has been rock-solid since. Once I got online again, I sent an email to DiGi asking if there’s any opt-in scheme for receiving SMS alerts of network outages. Their Customer Helpline (the number is on the SIM card) doesn’t actually offer any help. It says it will at the first menu, but after choosing the obvious “speak to a representative” option, the next menu has no such option! There must be a way of communicating network disasters to us, rather than just leave us ‘in the dark’ mustn’t there? I’m not going to ask TM the same question – for what ought to be the obvious reason.

Update 2nd April – landline was still dead until about 11am this morning, when dialtone and ADSL both returned. Will we ever know why?

Update 7th April – TM called this morning to ‘check the line’ and ask if everything was OK now. The fault was due to ‘server broken’.

URL Shortening – use a service or do it yourself?

April 2nd, 2010

Jess saw the news about tr.im today as she was using Twitter and asked me which URL-shortening service she should use. URL shortening services allow you to include those monster URLs that some sites seem to be capable of producing in the short-format tweets that twitter is based on. If you’ve ever tried to send someone a link to a Google search, you may have seen this. A search for “url shortening” on Google produces this whopping 158-character strin… no this is not a string, it’s a hawser or a python, or something:

http://www.google.com/search?hl=en&safe=off&client=firefox-a&tbo=p&rls=com.ubuntu%3Aen-US%3Aofficial&tbs=nws%3A1&q=url+shortening&aq=f&aqi=&aql=&oq=&gs_rfai=

I sometimes wonder why sites who use URLs that large bother serving pages – I’m sure we’re only months away from a browser that can render the contents of the Location: header field! If – like me – you see an URL like that and edit out all the redundant cruft in there, you’ll be sending your friend a nice, short 46-character URL that does the same thing:

http://www.google.com/search?q=url+shortening

But if you were to include this in a tweet (or you’re not like me, and don’t look at gargantuan URLs and think “what a waste of characters”) you might want to shorten it even further. From 46 characters, a hypothetical URL-shortening service might give you something like

http://sh.rt/abc123

… for just 19 characters. Which one should you choose? Some might say “shorter the better”, but what it really comes down to is finance. URL shortening is an invisible service, often provided for free by individuals or groups employing the Slashdot Business Plan:

  1. Good idea
  2. …?
  3. Profit!

For short messaging services, IM and possibly mobile browsing, URL shortening is a “Good idea”. The problem is that if it’s done right, nobody knows who is doing it (beyond the domain name in the URL they briefly see) – there’s no opportunity to build a brand, add value, nothing! The upshot is that you can tell if someone is doing URL shortening ‘right’, because they won’t be able to win any revenue, and they’ll have to close shop!

An URL-shortening service closing shop is a minor disaster. The web is built on links from one point to another. When the URL-shortener dies, there’s no connection between the short URL that’s left on one site and the long URL you would once have been redirected to. That’s quite a risk to take, so you’d want to make your choice of URL-shortening service carefully, and possibly even consider paying for it.

URL-shortening is not rocket science. To make your own URL-shortening service, all you have to do (besides make it work 100% of the time, forever) is to provide a short URL on your domain which when requested will redirect the User-Agent to the original long URL. That’s it.

I persuaded Jess to let me write one for her using Spinneret. Her shop is lolyco.com – lolyco at 6 characters is shorter than tinyurl, so there’s your first check to see if you should roll your own short URLs: do you have a short domain name? The problem is how to get the service in. The shop is a PHP project served by Apache. Spinneret is a separate Java application server, so the method I chose is to use mod_proxy and the ProxyPass directive to hang my URL-shortening service on the “/u/” (‘u’ is short for URL) path – any requests to http://lolyco.com/u/..anything… are forwarded by mod_proxy to the URL shortening service which runs as a web service on a different port on the same server. Just for the sake of sharing, the Lolyco short URLs can be listed at:

http://lolyco.com/u/short-urls.html

And just for example – the first short URL is for this blog article:

http://lolyco.com/u/0

Not bad huh? That’s only 21 characters – the first 60 or so URLs will be that length, the next few thousand will be 22 characters long. There’s yet another bonus for Jess in doing it this way. Whenever she uses a lolyco.com short URL in a tweet to refer to a page at lolyco.com, a visitor’s browser will only have to resolve (look up) one domain name: lolyco.com, so that should make the DIY version seem even quicker to a visitor than a third-party URL shortener.

Just in case you’re a trainspotter, I’ve done no optimisation on the URL shortener (there are some obvious ones) and Apache Bench running on the same small VPS the short URL service is tells me that it reliably serves nearly 3,000 redirects per second (100 concurrent) at around 15Mbit/s average transfer rate with mean total time per request of 35 ms (0.35ms per concurrent request). In the event that lolyco.com ever receives more than 1,000 requests per second, I may consider optimising the service.

The ‘One’ theme again: 1Malaysia, Unifi, Monopoly

March 26th, 2010
TM's high-speed internet service

TM's high-speed internet service

TM has announced its new ‘High Speed Broadband’ products, called Unifi, with the Prime Minister making the announcement. TM is Telekom Malaysia, the telecommunications monopoly in Malaysia. There is an alleged telecommunications regulator called the MCMC (Multimed… Commission, or something) but it doesn’t seem to actually do anything but help TM.

More bandwidth ought to be good news, but TM aren’t offering bandwidth, they’re offering an expensive new bundle which includes Video On Demand (VOD). In better regulated regimes, what TM is doing is against the law – it’s the same practice that resulted in Microsoft being forced to unbundle Internet Explorer from Windows in the EU. Internet access in the EU is fiercely competitive, which is why you can find 20Mbit/s (TM’s new ‘flagship’ package) connections available in the UK for RM35RM80 per month. That’s in a country where the technicians’ (and customers’!) salaries and business overheads are many, many times that of TM’s!

We had a phone call from TM this morning, offering an upgrade from 512kbit/s to 1Mbit/s for an extra RM5 per month. Before moving to Malaysia, we lived in the UK and had ADSL for about 6 years prior to 2005. After the first two years (starting at 128kbit/s) , BT doubled the bandwidth every year or so FOR FREE. We were on 2Mbit/s when we left, for the equivalent of about RM40 per month, 5 years ago. And it never – ever – had a single problem or slow-down in that time. In the UK we lived in a hill-farming community in a little village of houses which were between 200 and 800 years old. In Malaysia we live in a modern development near a town. Before this year, it was a rare week that we didn’t have trouble (often complete breakdowns for days) with our TM Internet connection.

If you’re not in Malaysia, you might think this kind of thing is a joke. But if you’re in Malaysia and all you want is decent Internet access that works, at a fair price, so you can get more work done (and coincidentally contribute more tax to the government), it is desperately unfunny.

Pos Malaysia Shipping Price World Map

March 3rd, 2010
Pos Malaysia world shipping charges

Pos Malaysia world shipping charges.

The Pos Malaysia World Shipping Map is an example of what you can do with an API. Given a weight and a shipping method, you can draw a global map of relative shipping costs. Now that the Pos Malaysia data has been converted to use ISO3166-1 Country Codes, it’s trivial to take data from it and merge it with useful resources from elsewhere which also comply with international standards.

The map is a public domain SVG file from Wikipedia. The creators of the map specified ids for the countries using ISO3166 2-letter country codes. I generate CSS colour codes from the country code / relative price data obtained from the API, and build a coloured map on the server. The coloured map is about 2MB in size, so I convert it into a smaller PNG image and send the URL back to the browser.

Note that I’m not suggesting Pos should create fancy coloured maps. These maps arguably could be handy for checking completeness of shipping data coverage, or ‘eye-balling’ the global map to spot inconsistencies in charging. The world shipping map is just another example of what is possible for third parties IF Pos Malaysia exposed a usable API.

If you want to play with the world maps, be aware that spider.my is hosted on a tiny VPS (Virtual Private Server) in the USA – it only has 64MB of memory and 2GB of hard disk. It can be a little bit slow to convert the SVG graphics into an image. As long as I haven’t given up on getting Pos to adopt the API, you should be able to access the same features at pos.spider.my – that’s a bigger server sitting on my desk in Malaysia.

If the maps inspire you to try out an idea of your own, make sure you contact me first to encourage me to leave the API online! Better yet, find someone from Pos Malaysia to tell “Hey! Let that guy set up your API for you so we can do good stuff with your data!”.

You can send 10kg by Pos Parcel Surface very cheaply almost anywhere, compared to Bolivia and is that Uzbekistan?

10kg by Pos Parcel Surface

Pos Parcel Surface doesn’t permit sending 15kg to nearly as many destinations:

15kg by Pos Parcel Surface

And you’ll get eye strain spotting the countries to which you can (by Pos Parcel Surface) send 15kg, but you can’t send 20kg:

20kg by Pos Parcel Surface

These are tiny images, but they’re created from SVG on the server, so enormous versions are available on request!