Simon Wadsworth

Master of Science | Computer Scientist

Why the Chiefs will succeed
Published Sun 24 February 2013 by Simon Wadsworth in Sports

It’s unusual for me to blog about sports (well actually it’s unusual for me to blog), but I thought I would give my opinion on why the Chiefs will be successful again this year in Super Rugby. I believe it’s to do with their attitude and culture within the team, as it is with all sports. The Chiefs work as a team, they feed off each other and provide opportunities for each other, working towards team glory, not personal glory. This is what will make them succeed.

If you consider in the 2011 season the Chiefs finished 10th, winning only a third of their games, to going onto winning the whole competition in 2012, something had to have changed within the team, and not just the coaches. This is why I believe the Chiefs can succeed. Their players play for each other and their fans, not themselves.



New Zealand Prepaid Mobile data offerings
Published Mon 17 December 2012 by Simon Wadsworth in New Zealand

Recently there were quite a few posts on the NZNOG mailing list regarding mobile data options in New Zealand, especially for travelling and cost. I thought I would write a post regarding the different options and my opinions on them. I am specifically looking at packs marketed as “Prepaid Mobile Broadband” plans. So I won’t be counting data included in plans such as the $19 prepaid combos that 2degrees, Vodafone and Telecom offer.

Pricing

Telecom

Telecom’s prepaid offerings are:

  • Mobile Broadband 500MB 7 Day - $10
    • 500MB valid for 7 days only. Would be good if you only needed data for a very short time. Only available for purchase until 28 February 2013 unfortunately.
  • Mobile Broadband 3GB 90 Day - $60
    • 3GB valid for 90 days. This is better value if you plan on staying more than a month but only want to check your email and do some light browsing. Works out roughly $20 a month and is $20/GB. Only available for purchase until 28 February 2013 unfortunately.
  • Mobile Broadband 500MB - $25
    • 500MB but valid for 30 days. $50/GB
  • Mobile Broadband 2GB - $50
    • 2GB valid for 30 days. $25/GB. Far better value than the 500MB pack, so if you’re planning on using it a bit more than just emails once or twice a day, then probably better to go with this plan.

On all Telecom plans, once you reach your including limit you revert to their Casual data rate which is $1 for 10MB and $1 for every MB over that. You can of course just purchase another data pack.

Vodafone

  • Broadband Lite - $10
    • 100MB valid for a month. Would be good for extremely light usage. $100/GB
  • Broadband Surfer - $30
    • 512MB valid for a month. Would be okay for someone wanting to check emails and the occasional light surfing. Approximately $60/GB
  • Broadband Plus 2GB - $50
    • 2GB valid for a month. Vodafones best value prepaid mobile broadband plan. If you can afford the $50 this would be your best bet. $25/GB

2degrees

2degrees is a bit different. Due to the way their network works they have two different data systems, but see down a bit further for that.

Their National Mobile Data packs are:

  • 50MB for $6
  • 100MB for $10

Their Mobile Broadband Zone packs are:

  • Broadband Zones 1GB - $20
    • Valid for 1 month. Reasonably good value for some browsing and email checking
  • Broadband Zones 3GB - $50
    • Valid for 2 months. Depending on your budget for 2 months this could be better value over the 1GB plan. You get 1.5GB per month (although that’s not a hard limit, more of a guide, you can choose to use any amount in either of the two months, providing you stay under 3GB in the two months). $16.67/GB
  • Broadband Zones 12GB - $99
    • Valid for 6 months. You get 2GB per month, but as with the previous one that’s not a hard limit. Very good value. If you need data over a prolonged period, or just need alot then this would be the one to go with. $8.25/GB

Best pricing: 2degrees

Coverage and Performance

Telecom

Telecom have 3G coverage nationwide. They use 850MHz and 2100MHz as infill. It is important to note that just because a phone supports 2100MHz doesn’t guarantee coverage. There is very real potential for coverage to be lost even in cities if you don’t have a device that supports the 850MHz frequency.

The boast to be the fastest, and to be the “smartphone” network. In reality I have found their coverage to be very good, and have been able to pickup signal in areas that Vodafone and 2degrees can’t be received. I have also seen Youtube videos streamed without buffering in fringe coverage areas, where Vodafone and 2degrees coverage has ended.

Vodafone

Vodafone have 3G coverage on the 2100MHz frequency and 900MHz. Their original 3G network deployment in Urban areas used 2100MHz, but they have been moving towards 900MHz on new towers to provide 3G coverage to all New Zealanders (in roughly the same coverage area as their 2G GSM network).

Their coverage can be a bit sketchy sometimes, although I have often heard of it being available in places where Telecom is not. I have also heard horrendous stories about latency and speeds on Vodafone. I haven’t experienced this myself, the speeds I’ve had over Vodafones network have been entirely reliable.

If you move outside of their 3G coverage areas you will be on their 2G data network which will be horribly slow.

Vodafone do have DC-HSDPA in some areas, but I have no information regarding the performance of this.

2degrees

2degrees are building their own network using the 900MHz and 2100MHz as infill in urban areas. Areas that have had their own towers installed and activated are part of their Mobile Broadband Zone and therefore the cheaper and better value pricing packs are available. Where they do not have their own network you are roaming on Vodafones network so coverage will match theirs, and you can expect the same performance as Vodafone.

In terms of their own network performance I have generally found it to be faster than Vodafone, and match XT, out performing XT in some cases.

2degrees do provide EDGE on 2G connections, so if you end up outside their 3G network you will get slightly better 2G speeds than Vodafone, but it will still be painful.

Best coverage and performance: Telecom

Overall if you want good nationwide coverage and good speeds with good value then Telecom would be the way to go. However if you are inside 2degrees Mobile Broadband zones and are not planning on using it outside these zones, then 2degrees provide the best value for money out of the three. If you need nationwide coverage and your equipment only supports 900MHz not 850MHz, then Vodafone would be your choice, but it’s hard to recommend Vodafone in any other situation, simply because of their pricing.

Networks New Zealand 2degrees Vodafone Telecom



Using an OpenWRT router for 2degrees (Snap) IPv6
Published Sat 24 November 2012 by Simon Wadsworth in Linux

2degrees Broadband (previously Snap) offer IPv6 to all their residential customers, with the preferred method to use one of their CPEs the Fritzbox 7340 or the Fritzbox 7390. These devices come with a price premium, so I decided to look for a cheaper alternative with what I already have. I have a Draytek Vigor 120 and a TP-Link TL-WR1043ND with OpenWRT installed. I use the Vigor 120 in bridged mode to allow my WR1032ND to hold up the connection using PPPoE. This should work on their ADSL2+, and UFB connections (you can VLAN tag the WAN port as VLAN10 which I believe is required for UFB, but I won’t go into how to do this). I am unsure if it will work with VDSL2 however.

I am unsure whether this method will work with a non bridged modem (unless of course it’s capable of doing IPv6 itself, in which case you probably don’t want this tutorial), but I suspect it won’t as your PPP session needs to be assigned a link-local IPv6 address.

This assumes you are already using PPPoE to connect via an OpenWRT box, if you’re not I advise setting this up first. The OpenWRT website provides excellent instructions on how to do this.

The first step needed is to install the required packages into OpenWRT. I am using Attitude Adjustment, but have previously used Backfire so these settings should still work.

ppp-mod-pppoe for pppoe connectivity
kmod-ipv6
wide-dhcpv6-client
radvd

The first step to do is to enable IPv6 negotiation on your PPP link. This can be done through luci under Network > Interfaces > WAN > Advanced Settings and selecting Enable IPv6 negotiation on the PPP link. Alternatively if you prefer to edit the configuration files you can add option ipv6 ‘1’ to your /etc/config/network file under config interface ‘wan’

Snap use DHCPv6 to allocate you a dynamic IPv6 prefix (they don’t provide static IPv6 prefixes yet, they really should but I understand this is a work in progress). Therefore you need to use a DHCPv6 client to get it.

The /etc/config/dhcp6c file should already exist. Edit it and change the enabled, interface, pd, and config interface ‘lan’ settings to be the same. Do not configure a prefix on the WAN interface. I find it causes IPv6 to not work. If it doesn’t create it and copy the following into it.

config 'dhcp6c' 'basic'
        option 'enabled' '1'                            # 1 = enabled; 0 = disabled
        option 'interface' 'wan'                        # This is the interface the DHCPv6 client will run on
        option 'dns' 'dnsmasq'                          # Which DNS server you run (only dnsmasq currently supported)
        option 'debug' '0'                              # 1 = enable debugging; 0 = disable debugging

        # Send options (1 = send; 0 = do not send)
        option 'pd' '1'                                 # Prefix Delegation
        option 'na' '0'                                 # Non-Temporary Address
        option 'rapid_commit' '1'                       # Rapid Commit

        # Request options (1 = request; 0 = do not request)
        option 'domain_name_servers' '0'
        option 'domain_name' '0'
        option 'ntp_servers' '0'
        option 'sip_server_address' '0'
        option 'sip_server_domain_name' '0'
        option 'nis_server_address' '0'
        option 'nis_domain_name' '0'
        option 'nisp_server_address' '0'
        option 'nisp_domain_name' '0'
        option 'bcmcs_server_address' '0'
        option 'bcmcs_server_domain_name' '0'

        # Override the used DUID, by default it is derived from the interface MAC
        # The given value must be uppercase and globally unique!
        #option 'duid' '00:03:00:06:D8:5D:4C:A5:03:F2'

        # Script to run when a reply is received
        option 'script' '/usr/bin/dhcp6c-state'

# Define one or more interfaces on which prefixes should be assigned
config 'interface' 'loopback'
        option 'enabled' '1'                            # 1 = enabled; 0 = disabled
        option 'sla_id' '0'                             # Site level aggregator identifier specified in decimal (subnet)
        option 'sla_len' '16' # Site level aggregator length (64 - size of prefix being delegated Snap is 64-48 = 16)

config 'interface' 'lan'
        option 'enabled' '1'
        option 'sla_id' '1'
        option 'sla_len' '16'

Now if you restart your router you should get a IPv6 prefix assigned to your LAN interface. Great! That’s what we wanted, but it’s not much use if we can’t tell the machines on our network what our IPv6 prefix is.

That is where radvd comes in. It’s a router advertisement daemon, that can be used to distribute our prefix to our clients. To configure radvd edit the /etc/config/radvd file and update the settings to match below. You must NOT put a prefix in the list prefix because we are assigned a dynamic prefix and we need radvd to work out what prefix to advertise to our connected devices.

config interface
        option interface        'lan'
        option AdvSendAdvert    1
        option AdvManagedFlag   0
        option AdvOtherConfigFlag 1
        list client             ''
        option ignore           0

config prefix
        option interface        'lan'
        # If not specified, a non-link-local prefix of the interface is used
        list prefix             ''
        option AdvOnLink        1
        option AdvAutonomous    1
        option AdvRouterAddr    0
        option ignore           0
        option AdvValidLifetime 3600
        option AdvPreferredLifetime 600

config route
        option interface        'lan'
        list prefix             ''
        option ignore           1

If you prefer change AdvValidLifetime and AdvPreferredLifetime to something higher. I did this because I often restart my router and am given a new prefix, and my machines will prefer and use the old one until expiry, meaning I can’t establish IPv6 connections. My recommendation is to use something like 3600 for both if you have a stable connection that rarely gets rebooted.

Save that file and restart your router, everything should work and you should have IPv6 connectivity on your machines. Be aware that your machines will not get a IPv6 DNS server so all the DNS queries will still be executed over IPv4. This generally isn’t a problem as DNS servers should still return IPv6 records to you regardless of the version used to access them.

As all your devices that support IPv6 now have a globally routable address I recommend having firewalls turned on on everything. However sometimes we have phones etc that don’t have firewalls and you perhaps you want to only allow incoming traffic to that device if there has been outgoing traffic first. OpenWRT can handle this in iptables. Installing the following packages and reboot should do the trick. I say should as I can’t exactly remember whether I had to do more, but if it doesn’t work leave a comment and I’ll investigate my configuration.

ip6tables
kmod-ip6tables

Networks IPv6 Snap OpenWRT ISPs



Hurricane Electric DNS Hosting Service
Published Fri 23 November 2012 by Simon Wadsworth in Internet

I recently wanted to move my DNS from my web hosts cPanel managed system because I really dislike cPanel (they are soon moving to Plesk, but this provided the perfect option to seperate my services). I looked around for DNS hosting services and looked at Zonomi a New Zealand based paid service with DNS servers located around the world. However I was worried about the cost as one of my domains alone would take up the allocated records.

I asked around and was told about Hurricane Electrics DNS service. It’s free and feature packed. It can handle a load of record types (including SSHFP) and can even do reverse zones if you need them. One of it’s neat features is built in dynamic DNS. I previously had a CNAME in my DNS pointing to a dyndns address from no-ip.com. Now it’s just a A record. Awesome!

They are a service I would highly recommend.

If you domain registrar allows you to specify the IP addresses of the DNS servers then you can use this to configure vanity NS records, by changing the NS records at your registrar to something like ns1.your-domain.com and the IP address of ns1.he.net etc up to ns5. ns2-ns5 provide a Dual Stacked IPv6 service, which is a neat benefit.

Finally if you are worried about query times for users outside the states, it’s not that bigger deal as most visitors will be using recursive DNS servers provided by their ISPs or employers and will cache your records, so subsequent users will receive the responses fast until they expire and need to be re-requested.

Thanks to Brad Cowie for pointing me to them

Networks Internet DNS



People: Make tablet optimsed apps
Published Tue 08 November 2011 by Simon Wadsworth in Android

I recently purchased a Samsung Galaxy Tab 10.1, because my laptop was getting old, and I wanted something ultra portable. However I have so far found myself disappointed by the apps available. As I understand it, for iOS there are thousands of Tablet Optimized apps (that is they look nice on the big screens). Unfortunately I can’t say the same about Android. All of the Google Apps are fine (well most of them), but the likes of Facebook, Twitter etc have horrible apps that are not optimised for the tablet, to such a point for some of them they become unusable.

There is so much potential for tablet applications, and the extra screen space allows for some really nice application designs, but companies really need to step up here and optimised their apps, especially popular apps.

Facebook

As is clear from the picture below Facebook is rather simple. This is the home screen I get. However whenever I click on News Feed, for Friends etc it fills up the whole page. I can’t see any other information.

Official Facebook Application

Now compare that to FriendCaster, an alternative to the Official Facebook App. This is tablet optimized, and is my preference over the Official App. I can do so much on this. I can see a friends profile information on the left, while browsing their wall on the right. It’s segmented and flows nicely.

FriendCaster

Twitter

This is the official Twitter app. Completely unoptimized for a Tablet. Yuck! I actually can’t bare to look at this. I was semi able to handle Facebook but this app sent me on a spree to find nice replacements.

Official Twitter App

And find one I did. This is TweetComb. This is the Twitter application I use on my Tablet. It is sectioned, and I can even have more than three sections and scroll between them. This allows me to see new Tweets from people I follow, as well as Mentions and Direct Messages all on the one page. Now instead of a tweet being half a line, they take up 3 to 4, but that doesn’t matter. There has been a much improved use of space.

TweetComb

ESPN CricInfo

I’m going to be honest. This app had me in tears of laughter. It works perfectly on my phone. But as soon as I put it on my Tablet, well judge for yourself. The menu doesn’t open correctly, nothing really seems to work and it just looks absolutely terrible. I really hope that ESPN put some effort into this app, because it’s amazing. It like others has enormous potential, and with some TLC could be an awesome Cricket companion on my tablet. There is the potential to have the Live scores, while I can still browse around the stats, or view each individual batman’s results.

ESPN CricInfo

eBuddy

eBuddy works fantastically well on a phone. It’s the right size, and works nicely on restricted screen space. Now of course we scale it up to 10.1 (I imagine even say a 7 inch would be similar), and there is plenty of wasted space. I have some recommendations for this App, because I am yet to find one similar to replace it with. Firstly, List all my online buddies down the left. Then when I select one have the chat appear on the right say 2/3s of the screen. Secondly, you can group by accounts, so why not have it start of with Accounts. You select an Account (with the option for All so you can see All online contacts), and then it shows you contacts within that account, with the accounts still showing on the right. So the screen becomes partitioned, and still provides you with information. Then when you select a contact for the first time, it hides the accounts list, and waits for you to perhaps move back, before reshowing it, possibly even over the buddies list, keeping the chat visible. One more thing, address the font sizes.

eBuddy

Conclusion

Ultimately I realize that developing nice tablet optimized applications isn’t going to be easy. I look at my own Android application and know it’s crap, and it’s even worse on a tablet, but that wasn’t intended for the masses. It was a learning exercise where I developed a app that was useful to me, and I just happened to make it available publicly. I believe that Android doesn’t support automated font scaling, and this must be handled by the programmer. I am not sure whether this is to be included in the upcoming Ice Cream Sandwich release but I really hope it is. Also I recall reading that ICS will bridge the gap when developers develop an application, allowing them to easily adapt it for a Tablet device. Lets hope it works.

However, companies that make these apps that are used by many people shouldn’t use this excuse. You pay people money to develop applications for you, and they should be doing a good job. and I fear that it not only can’t be good for the companies (people moving from their Apps to more Tablet optimzed version as with the Facebook and Twitter apps above), but it can’t be good for Android as a tablet platform. I don’t want to see people moving towards iPads from Android tablets just to get the nice applications. It’s time developers stepped up their game, and developed applications that suit the tablet ecosystem.

N.B. Some parts of the screenshots are blurred for privacy reasons

Android Tablets



My change to KDE
Published Mon 08 August 2011 by Simon Wadsworth in Linux

About 6 or 7 years ago, I had a play around with a KDE based version of Linux. I hated it. I thought KDE was horrible.

But I didn’t really start using Linux for a couple more years. When I did again, I used Fedora, which of course is GNOME based, and found GNOME so easy to use, it quickly became my preference. None of this horrible KDE crap. Then came my eventual change to Ubuntu (partly because I was sick of having to change to root user to do things, where now I can just sudo, although at the same time having to type sudo all the time can be a pain, but that’s a discussion for a whole other post). But with the most recent version of Ubuntu, came Unity. And well what can I say. I hate Unity. I like the colour scheme, but the windowing system just annoys me. The sidebar just annoys me. So after using it for some time (a few months) I started looking at maybe using older versions of Linux, or even using a version I built myself. But in the end I changed to Kubuntu. I choose to use the premade version for numerous reasons. These include being too lazy to compile my own distro, and also the fact that previous experiences of installing KDE along side GNOME were less than pleasant. So now I have KDE and I love it!

Why I love it!

  • This may be part of Kubuntu and not of KDE, but my Windows shares just work
  • The lock screen is nicer
  • It natively supports window tiling
  • Konsole is amazing compared to gnome-terminal (it will be unstoppable once I install fish)
  • The settings are all in one place
  • So much more!

Ubuntu Linux KDE Gnome



Mobile Number Portability
Published Wed 27 July 2011 by Simon Wadsworth in New Zealand

Time and time again I hear people in New Zealand say the thing that stops them from changing mobile phone telco is the fact they have to change their number. And over and over again I hear people referring to themselves as being on 021, imply they are on Vodafone, or 027 and imply they are on Telecom. Well Vodafone, Telecom, 2degrees etc do have their own block of numbers that they allocate to know customers (021, 027, 022) etc, but that doesn’t mean that the number is on that network anymore, and it hasn’t for a long time. My phone number starts with an 027, but I am not on Telecom anymore. I changed to 2degrees over 6 months ago, and haven’t really looked back. It is really simple in New Zealand, and can take as little as 3 hours. (When I did mine it took about 3 hours from when I requested it, until it was done, but it can take longer). 2degrees simplify this process. If you are a 2degrees customer, you can login to their My 2degrees portal, and request your number be ported. All you need is the SIM card number from your old SIM card, or the ESN number if you are on Telecom CDMA (which is closing next year anyway). This information is also required for other networks, but I am not sure what their process is for getting a number ported from another network to theirs.

So now, people no longer have the excuse of “I can’t change my number” when it comes to making a decision about what Mobile Telco to give their business to. It’s completely irrelevant. So now competitive pricing, and high quality service, is even more important if Telcos want to keep their customers (I’m looking at you Vodafone and Telecom).

2degrees Vodafone Telecom Mobile



Reducing Web Server load using Amazon S3
Published Mon 11 July 2011 by Simon Wadsworth in Internet

Anyone who runs a website, will know that eventually a website will (hopefully) become so large, and popular that one server is simply not enough to host all the content or load that is thrown at it. A common method to reduce this is just to add more servers in and load balance them. But what if you can’t afford more servers. Well there is a very cheap alternative. This is Amazon’s S3 hosting. It is a cloud storage technology provided by Amazon Web Services, which provide extra features, likely access control, enabling public access and setting custom headers. The ultimate goal would be to use a fully fledged Content Distribution Network, but for starters Amazon S3 easily does the trick. All you have to pay for is the storage space you use, and data you actually transfer.

So how does this help, well by placing your content (images, video, even say CSS) on Amazon S3 and using an Amazon S3 address to link to the content, then the end user will pull the content from Amazon S3, reducing the number of connections needed on your server, and the amount of data your server needs to send, enabling it to answer other requests faster. Not only that you can provide Cache tags on the files meaning that the client will cache the file, to stop you incurring extra costs of the end user requesting the file all the time. Not only this, it makes it faster for the user.

I use Amazon S3 on my blog, and by assigning the S3 bucket name as a CNAME on my domain, I can use a nice URL to access my content, making it look highly personalized. Not only that if you are using Wordpress their are a number of addons that allow for Amazon S3 integration, my favourite being WP Total Cache, which will upload the files that it thinks should be served statically, and automatically rewrite the URLs to them. Not only that, if you change to Amazon CloudFront it will easily allow you to change to that.

So if you are having issues with your website being overloaded with traffic especially when it is images etc, try moving it to Amazon S3. And once it is in their, if you decide you need to added power of the Amazon CDN, it’s extremely simple to setup and use your pre-existing content in S3 as the source.

Networks Amazon S3



The service of Mighty Ape
Published Sat 25 June 2011 by Simon Wadsworth in Shopping

Bloody hell Mighty Ape ship their products fast. They aim to ship all orders that are placed before 3p.m. the same day. And that they do. I ordered a game yesterday, and it arrived today, and today is a Saturday. I’m not sure why I got it on a Saturday considering you must pay more for shipping to get it on a Saturday, but hey I’m not going to complain. Bloody good effort Mighty Ape, I don’t mind paying a little bit for shipping.

Shopping



Limiting bandwidth on Apache
Published Wed 22 June 2011 by Simon Wadsworth in Internet

Now I don’t actually need to enforce data limits on my Apache virtual hosts, because I only host myself, so what I use is irrelevant, but I thought it would be interesting to find out how to do it. I know there are modules out there, but the one I found which I like is mod_cband. It works really well, and enables you to enforce data limits, but also speed limits and number of connections if you are experiencing heavy load say and wish to throttle it a bit. These instructions are based on Ubuntu Server 10.04LTS.

So to start I downloaded the mod_cband source code, available here. After extracting it you then need to compile it. To compile it you need to have APXS2 installed, which I installed by using the following command

sudo apt-get install apache2-prefork-dev

I assume if you are using the threaded version you would need to install the apache2-threaded-dev package. Now after you have installed this package, you can execute ./configure to begin the first phase. This will check dependencies etc and tell you if you are missing anything. You shouldn’t do, but if you are, resolve them before you continue.

Next you need to actually compile the source code. I had a problem here with the Makefile. You need to alter the Makefile slightly. You need to change the line that reads

APXS_OPTS=-Wc,-Wall -Wc,-DDST_CLASS=3

and add in -lm so that it now reads

APXS_OPTS=-lm -Wc,-Wall -Wc,-DDST_CLASS=3

If you don’t you will get an error when you try to start Apache.

Now execute make and when that is completed execute sudo make install. You will get some warnings here regarding comparison of different types, but they shouldn’t effect the running of the module. This will compile the library and install it into the correct location. Now to check that it is enabled type sudo a2enmod cband (assuming of course you are using a2enmod, otherwise you will have to manually edit the configuration files to check that it is there.

Now restart Apache and it should load everything correctly. Now it is time to configure Apache virtual hosts to limit bandwidth. There are many configuration options here, so I will only explain how to enforce Data limits. For other options refer to the mod_cband documentation.

To enable mod_cband your virtual hosts MUST have a ServerName directive, and all cband directives must come after this. If you don’t Apache will throw all sorts of warnings when you try and start it. So the simplest and quickest way to enable a data limit on a virtual host is by placing the following directive in the configuration.

CBandLimit 10M

That will place a limit of 10Megabytes on the user, which is pretty small, and I am sure no one would actually give something that small, but it is very simple to setup. There are many other options you can configure, like a page to send when the bandwidth is used up, or what HTTP code to send, and many more. You can also configure a page that allows you to see the status of the virtual hosts and their various restrictions.

Networks Apache Servers



Updating METADATA on Amazon S3 objects
Published Wed 15 June 2011 by Simon Wadsworth in Internet

So I host the static content from my blog on the Amazon S3 Simple Storage Service. This allows me to remove some of the load of my server for static content. However this means that over time I need to pay money for the S3 hosting, and if I have a lot of requests this could end up costly. So how do I get around this. Well by setting the Content-Control META tag onto the objects in S3, I can ensure that the static content is cached by the remote user for however long I want. In this case I have set it for 7 days. However updating all the files in S3 would take a long time to do manually, so I use this Python code to update the objects in my S3 bucket.

I had to modify it to support encoding as I use gzip encoding on some of the static content to reduce the amount of data needing to be transferred.

from boto.s3.connection import S3Connection

connection = S3Connection('API_KEY', 'API_SECRET')

buckets = connection.get_all_buckets()

for bucket in buckets:
    for key in bucket.list():
        print('%s' % key)
        encoding = None
        if key.name.endswith('.jpg'):
            contentType = 'image/jpeg'
        elif key.name.endswith('.gif'):
            contentType = 'image/gif'
        elif key.name.endswith('.png'):
            contentType = 'image/png'
        elif key.name.endswith('.css.gzip'):
            encoding = 'gzip'
            contentType = 'text/css'
        elif key.name.endswith('.js.gzip'):
            contentType = 'application/x-javascript'
            encoding = 'gzip'
        elif key.name.endswith('.css'):
            contentType = 'text/css'
        elif key.name.endswith('.js'):
            contentType = 'application/x-javascript'
        else:
            continue
        if encoding is not None:
            key.metadata.update({
                'Content-Type': contentType,
                'Cache-Control': 'max-age=604800',
                'Content-Encoding': encoding
            })
        else:
            key.metadata.update({
                'Content-Type': contentType,
                'Cache-Control': 'max-age=604800'
            })
            key.copy(
                key.bucket.name,
                key.name,
                key.metadata,
            )
            key.set_acl('public-read')

Amazon S3 Programming Cache



Enabling IPv6 on a home network
Published Mon 13 June 2011 by Simon Wadsworth in Internet

IPv6 is the next generation internet protocol. Currently few ISPs provide it to the customers, and therefore uptake is slow. However if you wish to have access to the IPv6 world now then there are options. If you only have a single machine than a tunnel is fine, but however if you wish to add it to an entire network then you need something more. If you have a spare old machine lying around, or a machine running Linux that is always on, then you can configure that as a router and use it to provide IPv6 to your LAN.

I have IPv6 connectivity to all the machines that are connected to my network. To achieve this, I use an Ubuntu Linux box as a router, which has a tunnel configured. This allows all the computers to connect onto the IPv6 internet transparently. This is a guide on how I did it.

I use sixxs.net as my IPv6 tunnel provider. They provide the use of the aiccu client which allows the configuration and setup of the tunnel automatically. It creates a interface sixxs which is one end of the tunnel. First things first, you need to register an account at sixxs.net. After your account is approved you are able to create an IPv6 tunnel. This will only allow you to connect one machine, but it is essential before you will be able to enable access to other machines. This will take a while to get approved, but once approved you can install the aiccu client. On Ubuntu you can install it using:

sudo apt-get install aiccu

During setup it will ask you to enter information regarding your tunnel, most likely your sixxs.net login information. Once entered it should authenticate and complete the installation. If it hasn’t started automatically, you need to start it.

sudo service aiccu startOr on older version of Ubuntu try sudo /etc/init.d/aiccu start

Then it will configure the tunnel and you should be able to connect to IPv6 sites. You can try this by typing traceroute6 ipv6.google.com. The next thing to do is to provide IPv6 addresses to your network. To do this, you must apply for a Subnet from sixxs. You will receive a /48 subnet, for which you assign /64s to your network. To distribute your prefix announcement onto your network you need something like radvd installed. Again on Ubuntu it is as simple as typing

sudo apt-get install radvd

Now once radvd is installed, you need to edit the configuration file. This is usually stored in /etc/radvd.conf. So open it up and you want to enter the following:

interface eth0
{
  AdvSendAdvert on;
  AdvManagedFlag on;
  prefix 2001:4232:532::/64
  {
    AdvOnLink on;
    AdvAutonomous on;
    AdvRouterAddr on;
  };
};

The prefix is from the subnet that sixxs has assigned you. In this case I was assigned 2001:4232:532::/48, so I chose to use the /64 of this for simple setup.

Now of course your interface that is connected to your IPv4 LAN, so what will now be the interface on your router not connected to IPv6 web, should have a static IP assigned to it. This makes it easier to remember, and use. So I just assigned 2001:4232:523::1 to eth0. I won’t cover how to do this, as it is relatively simple if you have done any networking in Linux before.

You now need to tell the linux kernel that you want it to forward traffic for IPv6. To enable IPv6 forwarding you need to edit /etc/sysctl.conf and add the following lines:

net.ipv6.conf.all.forwarding=1
net.ipv6.conf.default.forwarding=1

Now save this file and reboot. When the machine comes back up, check that aiccu and radvd have started ( I find I always have to start aiccu manually). If this is the case then your other machines should have Global IPv6 addresses assigned to them using the prefix you gave radvd. However I found this was not enough to allow my other machines to connect to the internet. After specifying the default route on the router as the IP at the sixxs end of the tunnel, all traffic from eth0 was then routed out over my tunnel, and all the other machines appeared to have native IPv6 connectivity, and were globally addressable. You therefore need to ensure that your machines have firewalls installed, and if you like setup IPv6 iptables on the router. This is what I have done to filter traffic that is not wanted in the network. Also as your IPv6 address will be based on your MAC Address, you can be easily tracked based on it. Windows by default enabled privacy extensions, but Linux does not. To enable this on your Linux clients edit /etc/sysctl.conf and add these lines:

net.ipv6.conf.wlan0.use_tempaddr=2
net.ipv6.conf.all.use_tempaddr=2
net.ipv6.conf.default.use_tempaddr=2

If you have eth0 then replace wlan0 with eth0 or add an extra line for each different interface. all and default should cover all of them, but I like to specify them individually as well just to be safe. I will write another article regarding IPv6 tables at a later date.

Networks IPv6 Linux sixxs



World IPv6 Day
Published Sun 05 June 2011 by Simon Wadsworth in Internet

World IPv6 day is on June 8, 2011. World IPv6 Day is a day where several large organisations, such as Google, Facebook, Yahoo, Akamai etc will offer there content of IPv6 for a day. I’m ready for it, and so on June 8, I will be browsing these sites in IPv6 for the day!

Here is what I get when I traceroute from my machine to ipv6.google.com

Tracing route to ipv6.l.google.com [2404:6800:8004::68]
over a maximum of 30 hops:

1 1 ms <1 ms 2001:4428:450::1
2 28 ms 26 ms 27 ms gw-113.wlg-01.nz.sixxs.net [2001:4428:200:70::1]
3 29 ms 26 ms 27 ms ge0-1-6.v6wlg0.acsdata.co.nz [2001:4428:0:6::1]
4 39 ms 50 ms 38 ms ge0-0-2321.v6akl1.acsdata.co.nz [2001:4428:0:911::4]
5 38 ms 39 ms 38 ms ten-0-0-0-134.bdr01.akl02.akl.VOCUS.net.au [2402:7800:110:511::d]
6 43 ms 38 ms 38 ms ten-0-2-0-400.bdr01.akl01.akl.VOCUS.net.au [2402:7800:110:1::1a]
7 62 ms 65 ms 62 ms 2402:7800:0:1::ca
8 62 ms 63 ms 94 ms 2402:7800:0:2::92
9 64 ms 63 ms 64 ms 2001:4860::1:0:9f7
10 67 ms 73 ms 70 ms 2001:4860:0:1::d7
11 63 ms 142 ms 65 ms 2404:6800:8004::68

Trace complete.

Networks IPv6



Flickering Flash in Firefox on Ubuntu x86-64
Published Sun 22 May 2011 by Simon Wadsworth in Linux

I have been plagued by an issue in Firefox when using Flash on 64-bits of Ubuntu, from around version 10.10 This issue was whenever I visited a website that used Flash, the Flash content would flicker, with white spots all over the Flash content. This was very annoying as I was not able to access sites such as Youtube. To get around this I just used Chromium for sites that used Flash.

However recently I discovered this was an issue with version 10.1 of Adobe Flash player, and that using the 10.3 beta solved the issue.

Here is how to install it. In the terminal window type:

sudo add-apt-repository ppa:sevenmachines/flash
sudo apt-get update
sudo apt-get install flashplugin64-installer

Flash Adobe Mozilla Firefox Ubuntu Linux



Yahoo unlocks IMAP access
Published Mon 01 November 2010 by Simon Wadsworth in Internet

Up until recently it has been near impossible to access Yahoo IMAP through any client that wasn’t the Zimbra Client, or else a device like a Blackberry or Apple iPhone etc. Zimbra sends a special command to the Yahoo IMAP servers which authenticate it as an allowed client. I had been using a modified version of Thunderbird that sent this command also, as I prefer the interface and search in Thunderbird.

However it now seems that Yahoo have allowed access to their IMAP servers without this command, and as a result all clients should be able to connect now. I have set up my unmodified Thunderbird on my Ubuntu laptop to connect and it worked fine. I also tried Outlook to see if it worked, and it worked without a hitch. One thing however that is not clear is whether or not this is temporary or whether Yahoo are now offering it free to all users. It is possibly part of their plans to become more competitive in the Webmail market, after having suffered a 10% loss in the number of users in the last year to rival services. This has made it the second largest behind Microsoft’s Windows Live Mail. Google has had a 21% increase in the number of users, and they of course offer IMAP access.

Incoming Server Settings
IMAP Server: imap.mail.yahoo.com
IMAP Port: 993
IMAP security: SSL/TLS

Outgoing Server Settings
SMTP Server: smtp.mail.yahoo.com
SMTP Port: 465
SMTP security: SSL/TLS

The SMTP requires authentication, the same username and password you use to authenticate to the IMAP server.

I find that if your email address is user@yahoo.com then user will work as your username, but I have not tried the full email as the username.

IMAP Networks Yahoo


CONTACT

Email
contact at simonwadsworth dot geek dot nz

Address
Hamilton, Waikato
New Zealand

Phone
+64 27 403 4531
02825516452@2talk.co.nz

SOCIAL LINKS

Generated with Pelican

Created by BLACKTIE.CO