<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
    <title>Diary of a Switcher</title>
    <subtitle>Various nonsensical writings</subtitle>
    <link rel="self" type="application/atom+xml" href="https://blog.piefox.com/atom.xml"/>
    <link rel="alternate" type="text/html" href="https://blog.piefox.com"/>
    <generator uri="https://www.getzola.org/">Zola</generator>
    <updated>2014-08-02T00:00:00+00:00</updated>
    <id>https://blog.piefox.com/atom.xml</id>
    <entry xml:lang="en">
        <title>Force HSTS for Wikipedia in Chrome</title>
        <published>2014-08-02T00:00:00+00:00</published>
        <updated>2014-08-02T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://blog.piefox.com/posts/wikipedia-hsts/"/>
        <id>https://blog.piefox.com/posts/wikipedia-hsts/</id>
        
        <content type="html" xml:base="https://blog.piefox.com/posts/wikipedia-hsts/">&lt;p&gt;Earlier I was browsing wikipedia and noticed it wasn’t being accessed over HTTPS. I checked and, sure enough, wikipedia doesn’t set an HSTS value (there’s some discussion of it on their bugzilla, their primary reason seems to be the failure mode if a country were to block HTTPS then there wouldn’t be a way for Mozilla Firefox users to manually remove the rule and access wikipedia again).&lt;&#x2F;p&gt;
&lt;p&gt;Since I’m using Chrome I’m happy to force HSTS. I’d also like to pin the public key. In order to do this I had to get the HSTS pubkey hash for wikipedia.org; I found an excellent utility from StalkR on their blog about almost this exact issue,  &lt;a rel=&quot;nofollow noreferrer&quot; href=&quot;http:&#x2F;&#x2F;blog.stalkr.net&#x2F;2011&#x2F;08&#x2F;hsts-preloading-public-key-pinning-and.html&quot;&gt;HTSTS Preloading, Public Key Pinning and Chrome&lt;&#x2F;a&gt;, &lt;em&gt;http_pins.py&lt;&#x2F;em&gt;. I used &lt;a rel=&quot;nofollow noreferrer&quot; href=&quot;https:&#x2F;&#x2F;github.com&#x2F;StalkR&#x2F;misc&#x2F;blob&#x2F;d9cb74c3cd6720d53cbcdacb4fd010840da71d16&#x2F;crypto&#x2F;http_pins.py&quot;&gt;this revision of the code&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;p&gt;This code expects a local certificate, so I had to get a CRT version of wikipedia’s certificate. I did this using OpenSSL (required by http_pins.py). The command is:&lt;&#x2F;p&gt;
&lt;blockquote&gt;
&lt;p&gt;openssl s_client -showcerts -connect en.wikipedia.org:443 &amp;lt;&#x2F;dev&#x2F;null | openssl x509 -pubkey -noout &amp;gt;wikipedia.crt&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;p&gt;This uses OpenSSL’s client to connect to en.wikipedia.org, fetches the certificate chain and then hangs up. The certificate chain is then sent to another openssl command that extracts the first certificate’s public key and writes it to wikipedia.crt. It would be a good idea to check that the intermediate certificate chain is sensible before proceeding.&lt;&#x2F;p&gt;
&lt;p&gt;Next, run http_pins.py on that file. Here’s what I got (but you should check yourself):&lt;&#x2F;p&gt;
&lt;blockquote&gt;
&lt;p&gt;$ .&#x2F;http_pins.py wikipedia.crt&lt;br &#x2F;&gt;
wikipedia.crt:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;SPKI fingerprint (sha256): 99:4a:39:4a:21:55:bf:ac:c6:46:71:9b:c0:dd:0b:d4:4b:f7:4a:95:36:19:fa:7c:de:52:75:07:2f:5a:23:77&lt;br &#x2F;&gt;
Public-Key-Pins: max-age=600; pin-sha256=“mUo5SiFVv6zGRnGbwN0L1Ev3SpU2Gfp83lJ1By9aI3c=”&lt;br &#x2F;&gt;
Warning! Per RFC you need at minimum two pins&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;blockquote&gt;
&lt;p&gt;You can now go to the Chrome HSTS page, chrome:&#x2F;&#x2F;net-internals&#x2F;#hsts , and add the domain “wikipedia.org”, ticking Include subdomains for STS and Include subdomains for PKP, then adding the quoted value from above (but prefixing it with with sha256&#x2F;). For me (and hopefully you too!) this was:&lt;&#x2F;p&gt;
&lt;blockquote&gt;
&lt;p&gt;sha256&#x2F;mUo5SiFVv6zGRnGbwN0L1Ev3SpU2Gfp83lJ1By9aI3c=&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;p&gt;Happy secure browsing! Remember if this breaks something it’s not my fault :-) you can always go back into the Chrome HSTS page and delete the preset you’ve added for wikipedia.org&lt;&#x2F;p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>Forcing TLS on YouTube with Chrome</title>
        <published>2013-11-21T00:00:00+00:00</published>
        <updated>2013-11-21T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://blog.piefox.com/posts/youtube-force-tls/"/>
        <id>https://blog.piefox.com/posts/youtube-force-tls/</id>
        
        <content type="html" xml:base="https://blog.piefox.com/posts/youtube-force-tls/">&lt;p&gt;I use &lt;em&gt;Youtube Options&lt;&#x2F;em&gt; extension for Chrome to opportunistically enable HTTPS on YouTube, but there’s a problem with this - the initial request is made by HTTP (and this makes the use of the Back button challenging, because you have to double-tap it if you came in by HTTP and were redirected to HTTPS).&lt;&#x2F;p&gt;
&lt;p&gt;Unfortunately, Google have not yet rolled out &lt;em&gt;Enforce SSL&lt;&#x2F;em&gt; to YouTube (which, as I understand it, sets an HTTP Strict Transport Security flag so the browser always makes the first request by HTTPS). However, Chrome has a convenient settings page that lets you add your own entries to the local HSTS set.&lt;&#x2F;p&gt;
&lt;p&gt;chrome:&#x2F;&#x2F;net-internals&#x2F;#hsts&lt;&#x2F;p&gt;
&lt;p&gt;On this page you can query HSTS for a domain - or, usefully, add custom entries. I queried youtube.com which gave me:&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;Found&lt;&#x2F;strong&gt;: mode: OPPORTUNISTIC sts_include_subdomains:true pkp_include_subdomains:true domain:youtube.compubkey_hashes:sha1&#x2F;vq7OyjSnqOco9nyMCDGdy77eijM=,sha1&#x2F;Q9rWMO5T+KmAym79hfRqo3mQ4Oo=&lt;&#x2F;p&gt;
&lt;p&gt;I simply took the pubkey_hashes value, pasted them into the “Add Domain” box at the top, ticked “Include subdomains for STS” and “Include subdomains for PKP”,  then clicked “Add”. Now querying youtube.com results in:&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;Found&lt;&#x2F;strong&gt;: mode: STRICT sts_include_subdomains:true pkp_include_subdomains:true domain:youtube.compubkey_hashes:sha1&#x2F;vq7OyjSnqOco9nyMCDGdy77eijM=,sha1&#x2F;Q9rWMO5T+KmAym79hfRqo3mQ4Oo=&lt;&#x2F;p&gt;
&lt;p&gt;And I no longer get HTTP requests made when I visit http:&#x2F;&#x2F;www.youtube.com - success!&lt;&#x2F;p&gt;
&lt;p&gt;I’m not sure if this lives in a cache that gets purged over time, so I’ve kept &lt;em&gt;Youtube Options&lt;&#x2F;em&gt; installed in the meantime.&lt;&#x2F;p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>Visualising a water filling algorithm</title>
        <published>2013-11-01T00:00:00+00:00</published>
        <updated>2013-11-01T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://blog.piefox.com/posts/visualising-a-water-filling-algorithm/"/>
        <id>https://blog.piefox.com/posts/visualising-a-water-filling-algorithm/</id>
        
        <content type="html" xml:base="https://blog.piefox.com/posts/visualising-a-water-filling-algorithm/">&lt;p&gt;I was looking at the water filling problem described at &lt;a rel=&quot;nofollow noreferrer&quot; href=&quot;http:&#x2F;&#x2F;qandwhat.apps.runkite.com&#x2F;i-failed-a-twitter-interview&#x2F;&quot;&gt;“I Failed a Twitter Interview”&lt;&#x2F;a&gt;. The problem is, given a topography expressed as an array of heights, to figure out the volume of water that will pool if it rains on that topography. I’m generally fairly rubbish at puzzles, and my solution to the problem only worked for a particular subset of the problem.&lt;&#x2F;p&gt;
&lt;p&gt;I was then trying to understand the solution the author presented, so I wrote a visualisation of it. I’ve included the code below, it produces a move-by-move visualisation of the state of the solver. Writing it helped me understand the elegance of the presented by the solution.&lt;&#x2F;p&gt;
&lt;p&gt;The output looks like the following (where ~ represents water):&lt;&#x2F;p&gt;
&lt;pre style=&quot;background-color:#2e3440;color:#d8dee9;&quot;&gt;&lt;code&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;                      _                      
&lt;&#x2F;span&gt;&lt;span&gt;    _     _          |8|                     
&lt;&#x2F;span&gt;&lt;span&gt;   |7|~~~|7|~_~~~~~~~| |       _             
&lt;&#x2F;span&gt;&lt;span&gt;   | |~~~| ||6|~~~~_~| |~~~~_~|6|            
&lt;&#x2F;span&gt;&lt;span&gt;   | |~~~| || |~_~|5|| |~~~|5|| |            
&lt;&#x2F;span&gt;&lt;span&gt;   | |~_~| || ||4|| || |~~~| || |    _  _    
&lt;&#x2F;span&gt;&lt;span&gt; _ | ||3|| || || || || |~~~| || |~~~|3||3| _ 
&lt;&#x2F;span&gt;&lt;span&gt;|2|| || || || || || || |~~~| || |~~~| || ||2|
&lt;&#x2F;span&gt;&lt;span&gt;| || || || || || || || |~_~| || |~_~| || || |
&lt;&#x2F;span&gt;&lt;span&gt;Current Volume: 20
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Code:&lt;&#x2F;p&gt;
&lt;pre style=&quot;background-color:#2e3440;color:#d8dee9;&quot;&gt;&lt;code&gt;&lt;span&gt;import java.util.Random; 
&lt;&#x2F;span&gt;&lt;span&gt; 
&lt;&#x2F;span&gt;&lt;span&gt;public class WaterLevel 
&lt;&#x2F;span&gt;&lt;span&gt;{ 
&lt;&#x2F;span&gt;&lt;span&gt;	private static final long PER_MOVE_SLEEP = 300; 
&lt;&#x2F;span&gt;&lt;span&gt; 
&lt;&#x2F;span&gt;&lt;span&gt; 
&lt;&#x2F;span&gt;&lt;span&gt;	public static void main(String[] args) throws java.lang.Exception 
&lt;&#x2F;span&gt;&lt;span&gt;	{ 
&lt;&#x2F;span&gt;&lt;span&gt;		calculateVolume(generate(10, 15), true); 
&lt;&#x2F;span&gt;&lt;span&gt;	} 
&lt;&#x2F;span&gt;&lt;span&gt; 
&lt;&#x2F;span&gt;&lt;span&gt; 
&lt;&#x2F;span&gt;&lt;span&gt;	public static void calculateVolume(final int[] land, final boolean showMoves) 
&lt;&#x2F;span&gt;&lt;span&gt;	{ 
&lt;&#x2F;span&gt;&lt;span&gt;		final int[] water = new int[land.length]; 
&lt;&#x2F;span&gt;&lt;span&gt; 
&lt;&#x2F;span&gt;&lt;span&gt;		int leftMax = 0; 
&lt;&#x2F;span&gt;&lt;span&gt;		int rightMax = 0; 
&lt;&#x2F;span&gt;&lt;span&gt;		int left = 0; 
&lt;&#x2F;span&gt;&lt;span&gt;		int right = land.length - 1; 
&lt;&#x2F;span&gt;&lt;span&gt;		int volume = 0; 
&lt;&#x2F;span&gt;&lt;span&gt; 
&lt;&#x2F;span&gt;&lt;span&gt;		while (left &amp;lt; right) 
&lt;&#x2F;span&gt;&lt;span&gt;		{ 
&lt;&#x2F;span&gt;&lt;span&gt;			leftMax = Math.max(leftMax, land[left]); 
&lt;&#x2F;span&gt;&lt;span&gt;			rightMax = Math.max(rightMax, land[right]); 
&lt;&#x2F;span&gt;&lt;span&gt; 
&lt;&#x2F;span&gt;&lt;span&gt;			final boolean movedLeft; 
&lt;&#x2F;span&gt;&lt;span&gt;			if (leftMax &amp;gt;= rightMax) 
&lt;&#x2F;span&gt;&lt;span&gt;			{ 
&lt;&#x2F;span&gt;&lt;span&gt;				volume += rightMax - land[right]; 
&lt;&#x2F;span&gt;&lt;span&gt;				water[right] = (rightMax - land[right]); 
&lt;&#x2F;span&gt;&lt;span&gt;				right--; 
&lt;&#x2F;span&gt;&lt;span&gt;				movedLeft = false; 
&lt;&#x2F;span&gt;&lt;span&gt;			} 
&lt;&#x2F;span&gt;&lt;span&gt;			else 
&lt;&#x2F;span&gt;&lt;span&gt;			{ 
&lt;&#x2F;span&gt;&lt;span&gt;				volume += leftMax - land[left]; 
&lt;&#x2F;span&gt;&lt;span&gt;				water[left] = (leftMax - land[left]); 
&lt;&#x2F;span&gt;&lt;span&gt;				left++; 
&lt;&#x2F;span&gt;&lt;span&gt;				movedLeft = true; 
&lt;&#x2F;span&gt;&lt;span&gt;			} 
&lt;&#x2F;span&gt;&lt;span&gt; 
&lt;&#x2F;span&gt;&lt;span&gt;			if (showMoves || left == right) 
&lt;&#x2F;span&gt;&lt;span&gt;			{ 
&lt;&#x2F;span&gt;&lt;span&gt;				&#x2F;&#x2F; Render the state 
&lt;&#x2F;span&gt;&lt;span&gt;				render(land, water, left, right, volume, movedLeft); 
&lt;&#x2F;span&gt;&lt;span&gt; 
&lt;&#x2F;span&gt;&lt;span&gt;				&#x2F;&#x2F; Wait until rendering the next frame 
&lt;&#x2F;span&gt;&lt;span&gt;				if (left != right) 
&lt;&#x2F;span&gt;&lt;span&gt;				{ 
&lt;&#x2F;span&gt;&lt;span&gt;					try 
&lt;&#x2F;span&gt;&lt;span&gt;					{ 
&lt;&#x2F;span&gt;&lt;span&gt;						Thread.sleep(PER_MOVE_SLEEP); 
&lt;&#x2F;span&gt;&lt;span&gt;					} 
&lt;&#x2F;span&gt;&lt;span&gt;					catch (InterruptedException e) 
&lt;&#x2F;span&gt;&lt;span&gt;					{ 
&lt;&#x2F;span&gt;&lt;span&gt;						throw new RuntimeException(e); 
&lt;&#x2F;span&gt;&lt;span&gt;					} 
&lt;&#x2F;span&gt;&lt;span&gt;				} 
&lt;&#x2F;span&gt;&lt;span&gt;			} 
&lt;&#x2F;span&gt;&lt;span&gt;		} 
&lt;&#x2F;span&gt;&lt;span&gt;	} 
&lt;&#x2F;span&gt;&lt;span&gt; 
&lt;&#x2F;span&gt;&lt;span&gt; 
&lt;&#x2F;span&gt;&lt;span&gt;	&#x2F;** 
&lt;&#x2F;span&gt;&lt;span&gt;	 * Generate a topography 
&lt;&#x2F;span&gt;&lt;span&gt;	 * 
&lt;&#x2F;span&gt;&lt;span&gt;	 * @param maxHeight 
&lt;&#x2F;span&gt;&lt;span&gt;	 *      maximum height 
&lt;&#x2F;span&gt;&lt;span&gt;	 * @param width 
&lt;&#x2F;span&gt;&lt;span&gt;	 *      width 
&lt;&#x2F;span&gt;&lt;span&gt;	 * 
&lt;&#x2F;span&gt;&lt;span&gt;	 * @return 
&lt;&#x2F;span&gt;&lt;span&gt;	 *&#x2F; 
&lt;&#x2F;span&gt;&lt;span&gt;	private static int[] generate(int maxHeight, int width) 
&lt;&#x2F;span&gt;&lt;span&gt;	{ 
&lt;&#x2F;span&gt;&lt;span&gt;		final Random random = new Random(); 
&lt;&#x2F;span&gt;&lt;span&gt; 
&lt;&#x2F;span&gt;&lt;span&gt;		int[] land = new int[width]; 
&lt;&#x2F;span&gt;&lt;span&gt; 
&lt;&#x2F;span&gt;&lt;span&gt;		for (int i = 0; i &amp;lt; land.length; i++) 
&lt;&#x2F;span&gt;&lt;span&gt;			land[i] = random.nextInt(maxHeight); 
&lt;&#x2F;span&gt;&lt;span&gt; 
&lt;&#x2F;span&gt;&lt;span&gt; 
&lt;&#x2F;span&gt;&lt;span&gt;		return land; 
&lt;&#x2F;span&gt;&lt;span&gt;	} 
&lt;&#x2F;span&gt;&lt;span&gt; 
&lt;&#x2F;span&gt;&lt;span&gt; 
&lt;&#x2F;span&gt;&lt;span&gt;	private static int max(final int... land) 
&lt;&#x2F;span&gt;&lt;span&gt;	{ 
&lt;&#x2F;span&gt;&lt;span&gt;		int max = land[0]; 
&lt;&#x2F;span&gt;&lt;span&gt; 
&lt;&#x2F;span&gt;&lt;span&gt;		for (int level : land) 
&lt;&#x2F;span&gt;&lt;span&gt;			max = Math.max(max, level); 
&lt;&#x2F;span&gt;&lt;span&gt; 
&lt;&#x2F;span&gt;&lt;span&gt;		return max; 
&lt;&#x2F;span&gt;&lt;span&gt;	} 
&lt;&#x2F;span&gt;&lt;span&gt; 
&lt;&#x2F;span&gt;&lt;span&gt; 
&lt;&#x2F;span&gt;&lt;span&gt;	&#x2F;** 
&lt;&#x2F;span&gt;&lt;span&gt;	 * Render the map, showing the land - and on top of it, the computed water thus far (and also showing the left and right 
&lt;&#x2F;span&gt;&lt;span&gt;	 * pointers) 
&lt;&#x2F;span&gt;&lt;span&gt;	 * 
&lt;&#x2F;span&gt;&lt;span&gt;	 * @param land 
&lt;&#x2F;span&gt;&lt;span&gt;	 *      the land height 
&lt;&#x2F;span&gt;&lt;span&gt;	 * @param water 
&lt;&#x2F;span&gt;&lt;span&gt;	 *      the water depths computed so far 
&lt;&#x2F;span&gt;&lt;span&gt;	 * @param left 
&lt;&#x2F;span&gt;&lt;span&gt;	 *      the left pointer position 
&lt;&#x2F;span&gt;&lt;span&gt;	 * @param right 
&lt;&#x2F;span&gt;&lt;span&gt;	 *      the right pointer position 
&lt;&#x2F;span&gt;&lt;span&gt;	 * @param volume 
&lt;&#x2F;span&gt;&lt;span&gt;	 *      the current total volume 
&lt;&#x2F;span&gt;&lt;span&gt;	 * @param movedLeft 
&lt;&#x2F;span&gt;&lt;span&gt;	 *      true if we have just moved the left pointer (false if we&amp;#39;ve just moved the right) 
&lt;&#x2F;span&gt;&lt;span&gt;	 *&#x2F; 
&lt;&#x2F;span&gt;&lt;span&gt;	public static void render(final int[] land, 
&lt;&#x2F;span&gt;&lt;span&gt;							  final int[] water, 
&lt;&#x2F;span&gt;&lt;span&gt;							  final int left, 
&lt;&#x2F;span&gt;&lt;span&gt;							  final int right, 
&lt;&#x2F;span&gt;&lt;span&gt;							  final int volume, 
&lt;&#x2F;span&gt;&lt;span&gt;							  final boolean movedLeft) 
&lt;&#x2F;span&gt;&lt;span&gt;	{ 
&lt;&#x2F;span&gt;&lt;span&gt;		&#x2F;&#x2F; Compute max land level so we don&amp;#39;t waste space rendering open air 
&lt;&#x2F;span&gt;&lt;span&gt;		final int max = max(land); 
&lt;&#x2F;span&gt;&lt;span&gt; 
&lt;&#x2F;span&gt;&lt;span&gt;		&#x2F;&#x2F; Allocate enough space for the output 
&lt;&#x2F;span&gt;&lt;span&gt;		final StringBuilder sb = new StringBuilder((3 + max) * 3 * land.length); 
&lt;&#x2F;span&gt;&lt;span&gt; 
&lt;&#x2F;span&gt;&lt;span&gt;		&#x2F;&#x2F; Render the pointer position (and indicate movement) 
&lt;&#x2F;span&gt;&lt;span&gt;		for (int i = 0; i &amp;lt; land.length; i++) 
&lt;&#x2F;span&gt;&lt;span&gt;		{ 
&lt;&#x2F;span&gt;&lt;span&gt;			if (i == left) 
&lt;&#x2F;span&gt;&lt;span&gt;				sb.append(movedLeft ? &amp;quot; &amp;gt; &amp;quot; : &amp;quot; . &amp;quot;); 
&lt;&#x2F;span&gt;&lt;span&gt;			if (i == right) 
&lt;&#x2F;span&gt;&lt;span&gt;			{ 
&lt;&#x2F;span&gt;&lt;span&gt;				sb.append(!movedLeft ? &amp;quot; &amp;lt; &amp;quot; : &amp;quot; . &amp;quot;).append(&amp;#39;\n&amp;#39;); 
&lt;&#x2F;span&gt;&lt;span&gt;				break; 
&lt;&#x2F;span&gt;&lt;span&gt;			} 
&lt;&#x2F;span&gt;&lt;span&gt;			else 
&lt;&#x2F;span&gt;&lt;span&gt;				sb.append(&amp;quot;   &amp;quot;); 
&lt;&#x2F;span&gt;&lt;span&gt;		} 
&lt;&#x2F;span&gt;&lt;span&gt; 
&lt;&#x2F;span&gt;&lt;span&gt;		&#x2F;&#x2F; Now render the map 
&lt;&#x2F;span&gt;&lt;span&gt;		for (int altitude = (max + 1); altitude &amp;gt; 0; altitude--) 
&lt;&#x2F;span&gt;&lt;span&gt;		{ 
&lt;&#x2F;span&gt;&lt;span&gt;			for (int j = 0; j &amp;lt; land.length; j++) 
&lt;&#x2F;span&gt;&lt;span&gt;			{ 
&lt;&#x2F;span&gt;&lt;span&gt;				final int groundLevel = land[j]; 
&lt;&#x2F;span&gt;&lt;span&gt; 
&lt;&#x2F;span&gt;&lt;span&gt;				if (altitude - 1 == groundLevel) 
&lt;&#x2F;span&gt;&lt;span&gt;					if (water[j] != 0) 
&lt;&#x2F;span&gt;&lt;span&gt;						sb.append(&amp;quot;~_~&amp;quot;); &#x2F;&#x2F; Wet ground 
&lt;&#x2F;span&gt;&lt;span&gt;					else 
&lt;&#x2F;span&gt;&lt;span&gt;						sb.append(&amp;quot; _ &amp;quot;); &#x2F;&#x2F; The ground 
&lt;&#x2F;span&gt;&lt;span&gt;				else if (groundLevel &amp;gt; altitude) 
&lt;&#x2F;span&gt;&lt;span&gt;					sb.append(&amp;quot;| |&amp;quot;); &#x2F;&#x2F; Below the ground 
&lt;&#x2F;span&gt;&lt;span&gt;				else if (groundLevel == altitude) 
&lt;&#x2F;span&gt;&lt;span&gt;				{ 
&lt;&#x2F;span&gt;&lt;span&gt;					sb.append(&amp;quot;|&amp;quot; + altitude + &amp;quot;|&amp;quot;); &#x2F;&#x2F; Just beneath the ground 
&lt;&#x2F;span&gt;&lt;span&gt;				} 
&lt;&#x2F;span&gt;&lt;span&gt;				else if (groundLevel + water[j] &amp;gt;= altitude) 
&lt;&#x2F;span&gt;&lt;span&gt;					sb.append(&amp;quot;~~~&amp;quot;); &#x2F;&#x2F; Underwater 
&lt;&#x2F;span&gt;&lt;span&gt;				else 
&lt;&#x2F;span&gt;&lt;span&gt;					sb.append(&amp;quot;   &amp;quot;); 
&lt;&#x2F;span&gt;&lt;span&gt;			} 
&lt;&#x2F;span&gt;&lt;span&gt;			sb.append(&amp;#39;\n&amp;#39;); 
&lt;&#x2F;span&gt;&lt;span&gt;		} 
&lt;&#x2F;span&gt;&lt;span&gt; 
&lt;&#x2F;span&gt;&lt;span&gt;		sb.append(&amp;quot;Current Volume: &amp;quot;).append(volume).append(&amp;quot;\n&amp;quot;); 
&lt;&#x2F;span&gt;&lt;span&gt; 
&lt;&#x2F;span&gt;&lt;span&gt;		System.out.println(sb); 
&lt;&#x2F;span&gt;&lt;span&gt;	} 
&lt;&#x2F;span&gt;&lt;span&gt;}
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>Glassfish 3.1.2.2 Web Profile and EclipseLink MOXy</title>
        <published>2013-05-11T00:00:00+00:00</published>
        <updated>2013-05-11T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://blog.piefox.com/posts/glassfish-3122-web-profile-and/"/>
        <id>https://blog.piefox.com/posts/glassfish-3122-web-profile-and/</id>
        
        <content type="html" xml:base="https://blog.piefox.com/posts/glassfish-3122-web-profile-and/">&lt;p&gt;I’ve been evaluating Glassfish to possibly replace Tomcat as our servlet container of choice at work. Because one of the things I love about Tomcat is that it’s so light-weight I read the list of included features in Glassfish Full Profile with a growing sense of dread.&lt;&#x2F;p&gt;
&lt;p&gt;Our .war files only want a basic Servlet environment that provides a database link - they use this to expose RESTful resources and services. Because of this, the Glassfish Web Profile seemed to suit our needs best - all the niceness of multiple domains &amp;amp; a more robust automated deployment without the word “Enterprise” being mentioned too often.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;moxy-trouble&quot;&gt;MOXy Trouble&lt;a class=&quot;zola-anchor&quot; href=&quot;#moxy-trouble&quot; aria-label=&quot;Anchor link for: moxy-trouble&quot;&gt;#&lt;&#x2F;a&gt;&lt;&#x2F;h2&gt;
&lt;p&gt;So I took one of our applications and deployed it in Glassfish. But when our code tried to initialise an EclipseLink MOXy JAXBContext we got:&lt;&#x2F;p&gt;
&lt;pre style=&quot;background-color:#2e3440;color:#d8dee9;&quot;&gt;&lt;code&gt;&lt;span&gt;java.lang.NoClassDefFoundError: javax&#x2F;xml&#x2F;bind&#x2F;JAXBException  
&lt;&#x2F;span&gt;&lt;span&gt;...  
&lt;&#x2F;span&gt;&lt;span&gt;    at java.lang.Thread.run(Thread.java:722)  
&lt;&#x2F;span&gt;&lt;span&gt;Caused by: java.lang.ClassNotFoundException: javax.xml.bind.JAXBException not found by org.eclipse.persistence.moxy [156]  
&lt;&#x2F;span&gt;&lt;span&gt;    at org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1460)  
&lt;&#x2F;span&gt;&lt;span&gt;    at org.apache.felix.framework.BundleWiringImpl.access$400(BundleWiringImpl.java:72)  
&lt;&#x2F;span&gt;&lt;span&gt;    at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:1843)  
&lt;&#x2F;span&gt;&lt;span&gt;    at java.lang.ClassLoader.loadClass(ClassLoader.java:356)  
&lt;&#x2F;span&gt;&lt;span&gt;    ... 31 more    
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Hmm, not so good! I did some digging and discovered the problem was a combination of factors:&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;Glassfish Web Profile doesn’t include a JAXB implementation&lt;&#x2F;li&gt;
&lt;li&gt;Because it has no JAXB implementation it falls back on the JAXB implementation in the Java environment&lt;&#x2F;li&gt;
&lt;li&gt;For OSGI purposes, it assumes the version of JAXB provided by the environment is “0.0.0”&lt;&#x2F;li&gt;
&lt;li&gt;EclipseLink MOXy (helpfully included in Glassfish Web Profile) requires version 2.0.0 of javax.bind.xml&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;p&gt;So unfortunately the version of JAXB available to MOXy is 0.0.0 but it needs 2.0.0.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;the-solution&quot;&gt;The Solution&lt;a class=&quot;zola-anchor&quot; href=&quot;#the-solution&quot; aria-label=&quot;Anchor link for: the-solution&quot;&gt;#&lt;&#x2F;a&gt;&lt;&#x2F;h2&gt;
&lt;p&gt;The solution to this problem turned out to be pretty simple - simply copy the JAXB implementation included in the Glassfish Full Profile into the lighter Web Profile installation:&lt;&#x2F;p&gt;
&lt;pre style=&quot;background-color:#2e3440;color:#d8dee9;&quot;&gt;&lt;code&gt;&lt;span&gt;cp jaxb-osgi.jar ~&#x2F;glassfish&#x2F;glassfish&#x2F;modules&#x2F;cp jaxb-api-osgi.jar ~&#x2F;glassfish&#x2F;glassfish&#x2F;modules&#x2F;endorsed&#x2F;  
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;I actually had an additional step - the latest MOXy libraries (2.4.1) have a bug that affects our software and currently necessitates we use a snapshot release - so I replaced glassfish&#x2F;modules&#x2F;org.eclipse.persistence.* with the 2.4.2-SNAPSHOT jars. Restart the domain and hey presto, no exceptions.&lt;&#x2F;p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>iPhone 4S to Samsung Galaxy S3: The Hardware</title>
        <published>2012-07-10T00:00:00+00:00</published>
        <updated>2012-07-10T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://blog.piefox.com/posts/iphone-4s-to-samsung-galaxy-s3-switch/"/>
        <id>https://blog.piefox.com/posts/iphone-4s-to-samsung-galaxy-s3-switch/</id>
        
        <content type="html" xml:base="https://blog.piefox.com/posts/iphone-4s-to-samsung-galaxy-s3-switch/">&lt;p&gt;I’ve been a long-time iPhone user but lately Apple’s lawsuit-heavy approach to their competition has been annoying me - so I decided to give Android a try. I ended up picking the Samsung Galaxy S3.&lt;&#x2F;p&gt;
&lt;p&gt;I had some difficulty finding reviews that told me what I wanted to know (namely, how does the Galaxy S3 compare to the iPhone 4S hardware and iOS 5) so I thought I’d write a little about it. This post is dedicated to talking about the hardware, hopefully later post(s) will talk about the software.&lt;&#x2F;p&gt;
&lt;p&gt;Some of the points here are overly particular - I &lt;em&gt;really&lt;&#x2F;em&gt; like the iPhone 4 design and Samsung just aren’t in the same league.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;size&quot;&gt;Size&lt;a class=&quot;zola-anchor&quot; href=&quot;#size&quot; aria-label=&quot;Anchor link for: size&quot;&gt;#&lt;&#x2F;a&gt;&lt;&#x2F;h3&gt;
&lt;p&gt;The S3 felt a little odd initially, my hands are on the large side but this phone really is a lot bigger than the iPhone: the entire iPhone fits within just the screen part of the S3. It’s also a fair bit thinner and lighter (which is continuing to make the phone feel less secure in my hand, although I assume this will pass). It feels comically large when using it in public, although I’m sure this is just something I need to get used to, coming from the diminutive iPhone.&lt;&#x2F;p&gt;
&lt;p&gt;It’s a little bit too large for comfortable single-handed use, especially when I need to swipe down the notification bar - I have to adjust my grip to a less secure one to swipe down the notification bar with my thumb.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;screen&quot;&gt;Screen&lt;a class=&quot;zola-anchor&quot; href=&quot;#screen&quot; aria-label=&quot;Anchor link for: screen&quot;&gt;#&lt;&#x2F;a&gt;&lt;&#x2F;h3&gt;
&lt;p&gt;While it’s not as comfortable to use with one hand the large screen is &lt;em&gt;extremely&lt;&#x2F;em&gt; nice for browsing the web, typing or looking at photos. The frame at the top and bottom is much smaller than on the iPhone, giving the screen much more of a presence.&lt;&#x2F;p&gt;
&lt;p&gt;The Galaxy S3’s screen is tinted a little more yellow than the iPhone, and it’s also not as bright - that’s not necessarily a bad thing all the time… (I can’t be the only person who’s woken up in the middle of the night, used my phone to check the time and been blinded for a few seconds with the backlight set to ‘eye melting’ when it’s on the lock screen).&lt;&#x2F;p&gt;
&lt;p&gt;The automatic brightness on the S3 is just a touch on the dim side, so I’ve opted to keep it at 50% brightness&lt;&#x2F;p&gt;
&lt;h3 id=&quot;back&quot;&gt;Back&lt;a class=&quot;zola-anchor&quot; href=&quot;#back&quot; aria-label=&quot;Anchor link for: back&quot;&gt;#&lt;&#x2F;a&gt;&lt;&#x2F;h3&gt;
&lt;p&gt;The back of the S3 is flexible plastic that pulls off fairly easily (to access the battery, micro sim and micro sd card slot). It’s not as nice a feel as the iPhone 4S glass back (which I really loved) but apart from the fact that it’s plastic it feels firm and doesn’t creak or flex when you hold it in your hand.&lt;&#x2F;p&gt;
&lt;p&gt;The back curves, but just at the edges, so it doesn’t have the same overly curved feel of the iPhone 3G. The plastic back feels nicer than that on the iPhone 3G, too.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;micro-sd-card&quot;&gt;Micro SD Card&lt;a class=&quot;zola-anchor&quot; href=&quot;#micro-sd-card&quot; aria-label=&quot;Anchor link for: micro-sd-card&quot;&gt;#&lt;&#x2F;a&gt;&lt;&#x2F;h3&gt;
&lt;p&gt;Having a micro SD card is really nice - getting a high capacity iPhone always made me feel like I was getting ripped off, and I’ve not noticed any slowdown from having my music on the SD card. There are some software annoyances here but otherwise I’m pleased that I can buy a relatively cheap 64GB SD card to store music, videos and photos separately from apps.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;lock-button&quot;&gt;Lock Button&lt;a class=&quot;zola-anchor&quot; href=&quot;#lock-button&quot; aria-label=&quot;Anchor link for: lock-button&quot;&gt;#&lt;&#x2F;a&gt;&lt;&#x2F;h3&gt;
&lt;p&gt;The lock button is on the right hand side of the S3 and it feels very strange, coming from the iPhone where it’s on the top. It isn’t as well separated as on the iPhone (and also doesn’t feel as good to press as the button on the iPhone, which has a nice firm click to it)&lt;&#x2F;p&gt;
&lt;h3 id=&quot;volume-rocker&quot;&gt;Volume Rocker&lt;a class=&quot;zola-anchor&quot; href=&quot;#volume-rocker&quot; aria-label=&quot;Anchor link for: volume-rocker&quot;&gt;#&lt;&#x2F;a&gt;&lt;&#x2F;h3&gt;
&lt;p&gt;The volume rocker is quite inconveniently placed - I have a tendency to hit the lock button at the same time - and because it’s a rocker it’s not as easy to hit up&#x2F;down.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;camera&quot;&gt;Camera&lt;a class=&quot;zola-anchor&quot; href=&quot;#camera&quot; aria-label=&quot;Anchor link for: camera&quot;&gt;#&lt;&#x2F;a&gt;&lt;&#x2F;h3&gt;
&lt;p&gt;I really love the camera in the iPhone 4S - the camera in the S3 isn’t as good, the photos are noticeably noisier in low light. I’m planning on posting a set of comparison photos to highlight this.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;speaker&quot;&gt;Speaker&lt;a class=&quot;zola-anchor&quot; href=&quot;#speaker&quot; aria-label=&quot;Anchor link for: speaker&quot;&gt;#&lt;&#x2F;a&gt;&lt;&#x2F;h3&gt;
&lt;p&gt;Surprisingly, the Galaxy S3’s speaker is significantly quieter and tinnier than the iPhone speaker - I wasn’t expecting this! I listen to a lot of podcasts using the speaker and it’s really noticeable (it’s even more noticeable with music but I tend to plug in my headset for that)&lt;br &#x2F;&gt;
Volume Rocker&lt;&#x2F;p&gt;
&lt;h3 id=&quot;headphone-port&quot;&gt;Headphone Port&lt;a class=&quot;zola-anchor&quot; href=&quot;#headphone-port&quot; aria-label=&quot;Anchor link for: headphone-port&quot;&gt;#&lt;&#x2F;a&gt;&lt;&#x2F;h3&gt;
&lt;p&gt;The headphone jack doesn’t feel right, it doesn’t have the same firm feeling as the iPhone 4S and it has the same flaw as the iPhone 3G - because the jack is at a curve part of the 3.5mm jack is exposed. It’s not the end of the world - but again, a slight annoyance.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;headsets&quot;&gt;Headsets&lt;a class=&quot;zola-anchor&quot; href=&quot;#headsets&quot; aria-label=&quot;Anchor link for: headsets&quot;&gt;#&lt;&#x2F;a&gt;&lt;&#x2F;h3&gt;
&lt;p&gt;I’ve been using my iPhone in-ear headset which sounds nice and the start&#x2F;stop click button works - but because of different resistor layouts the volume up&#x2F;down buttons don’t work. I don’t know if there’s a standard but I was surprised by this.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;charging-cable&quot;&gt;Charging Cable&lt;a class=&quot;zola-anchor&quot; href=&quot;#charging-cable&quot; aria-label=&quot;Anchor link for: charging-cable&quot;&gt;#&lt;&#x2F;a&gt;&lt;&#x2F;h3&gt;
&lt;p&gt;I &lt;strong&gt;really&lt;&#x2F;strong&gt; like having micro USB on the phone instead of the iPhone dock connector - I have amassed a small army of Apple dock connector to USB cables over the years (and consequently have fewer micro USB cables - just the one that came with the phone (which is black and bulky) and the one that came with my kindle (which suits the phone much better - the white colour and the curved design looks right with the S3).&lt;&#x2F;p&gt;
&lt;p&gt;I’ve opted to stick with the apple UK USB plug - it’s very slender compared to the converter that ships with the Galaxy S3 and the design has a much nicer feel to it.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;call-quality&quot;&gt;Call Quality&lt;a class=&quot;zola-anchor&quot; href=&quot;#call-quality&quot; aria-label=&quot;Anchor link for: call-quality&quot;&gt;#&lt;&#x2F;a&gt;&lt;&#x2F;h3&gt;
&lt;p&gt;I’ve not talked on the phone yet so I don’t have any experience of the call quality - although it wouldn’t be hard to get better than the iPhone!&lt;&#x2F;p&gt;
&lt;h3 id=&quot;data-signal&quot;&gt;Data signal&lt;a class=&quot;zola-anchor&quot; href=&quot;#data-signal&quot; aria-label=&quot;Anchor link for: data-signal&quot;&gt;#&lt;&#x2F;a&gt;&lt;&#x2F;h3&gt;
&lt;p&gt;I use the O2 network and don’t have great coverage at my house - normally the iPhone has a weak EDGE or 3G connection. On the Galaxy S3 I get 2-3 bars of HSPDA (and occasionally HSPDA+) - the iPhone doesn’t indicate when it has HSDPA, though, so this might be an unfair comparison.&lt;&#x2F;p&gt;
&lt;p&gt;It &lt;em&gt;feels&lt;&#x2F;em&gt; like I have better signal, though.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;wifi-signal&quot;&gt;Wifi signal&lt;a class=&quot;zola-anchor&quot; href=&quot;#wifi-signal&quot; aria-label=&quot;Anchor link for: wifi-signal&quot;&gt;#&lt;&#x2F;a&gt;&lt;&#x2F;h3&gt;
&lt;p&gt;The wifi reception on the Galaxy seems worse than with the iPhone… it’s not really caused me a problem, though.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;battery-life&quot;&gt;Battery Life&lt;a class=&quot;zola-anchor&quot; href=&quot;#battery-life&quot; aria-label=&quot;Anchor link for: battery-life&quot;&gt;#&lt;&#x2F;a&gt;&lt;&#x2F;h3&gt;
&lt;p&gt;My initial impressions are that the battery life is better than the iPhone, although the second day I had the phone out and about the GPS Daemon on the phone sucked up 65% of the battery in a few short hours (during which time I was stationary in my office). I’m not sure if there will be a repeat of this - it’s unclear which application caused the GPS Daemon to go nuts, although I do have Google Latitude set up as an experiment, the battery life would likely improve if I disable that.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;back-and-menu-buttons&quot;&gt;Back and Menu buttons&lt;a class=&quot;zola-anchor&quot; href=&quot;#back-and-menu-buttons&quot; aria-label=&quot;Anchor link for: back-and-menu-buttons&quot;&gt;#&lt;&#x2F;a&gt;&lt;&#x2F;h3&gt;
&lt;p&gt;It’s a little confusing getting Back and Menu buttons after having used the iPhone with its one button for so long - I quite like the menu button (although Google seem to be pushing to remove it, so perhaps this isn’t the best time to get used to it…) and, while the back button seems like a great idea (and is certainly very useful for navigation) I find myself hitting it frequently when I’m just trying to hold the phone - I’m sure in time I’ll train myself to hold the Galaxy S3 The Right Way, I’m just still used to how best to hold the iPhone.&lt;&#x2F;p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>MacOS Lion Sanity</title>
        <published>2011-07-21T00:00:00+00:00</published>
        <updated>2011-07-21T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://blog.piefox.com/posts/macos-lion-tweaks/"/>
        <id>https://blog.piefox.com/posts/macos-lion-tweaks/</id>
        
        <content type="html" xml:base="https://blog.piefox.com/posts/macos-lion-tweaks/">&lt;p&gt;My changes to macOS Lion to make it work more like how I prefer&lt;&#x2F;p&gt;
&lt;h1 id=&quot;zsh-history-verify&quot;&gt;zsh history verify&lt;a class=&quot;zola-anchor&quot; href=&quot;#zsh-history-verify&quot; aria-label=&quot;Anchor link for: zsh-history-verify&quot;&gt;#&lt;&#x2F;a&gt;&lt;&#x2F;h1&gt;
&lt;p&gt;I was surprised by this, the new version of zsh (4.3.11) (or Apple when configuring it) sets the &lt;code&gt;histverify&lt;&#x2F;code&gt; option. This means if you want to use the ! prefix or !! for executing previous commands you’ll need to press enter twice:&lt;&#x2F;p&gt;
&lt;pre style=&quot;background-color:#2e3440;color:#d8dee9;&quot;&gt;&lt;code&gt;&lt;span&gt;peter@laptop:~$ echo x   x
&lt;&#x2F;span&gt;&lt;span&gt;peter@laptop:~$ sudo !!
&lt;&#x2F;span&gt;&lt;span&gt;peter@laptop:~$ sudo echo x   x   
&lt;&#x2F;span&gt;&lt;span&gt;peter@laptop:~$   `  
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Not the most annoying feature in the world but it does slow me down. I prepended &lt;code&gt;unsetopt histverify&lt;&#x2F;code&gt; to my .zshrc to disable this.&lt;&#x2F;p&gt;
&lt;h1 id=&quot;inverted-scrolling&quot;&gt;Inverted scrolling&lt;a class=&quot;zola-anchor&quot; href=&quot;#inverted-scrolling&quot; aria-label=&quot;Anchor link for: inverted-scrolling&quot;&gt;#&lt;&#x2F;a&gt;&lt;&#x2F;h1&gt;
&lt;p&gt;I understand this feature. I like this feature. But I use Windows, Linux and OS X daily (on my own and other peoples computers) and this would confuse my brain. System Preferences, Trackpad, Scroll &amp;amp; Zoom, “Scroll Direction: Natural” unticked&lt;&#x2F;p&gt;
&lt;h1 id=&quot;keep-three-finger-swipe-left-and-right-for-browers&quot;&gt;Keep three finger swipe left and right for browers&lt;a class=&quot;zola-anchor&quot; href=&quot;#keep-three-finger-swipe-left-and-right-for-browers&quot; aria-label=&quot;Anchor link for: keep-three-finger-swipe-left-and-right-for-browers&quot;&gt;#&lt;&#x2F;a&gt;&lt;&#x2F;h1&gt;
&lt;p&gt;This is already a well established multitouch gesture. Three finger swipe left and right to navigate history. I don’t want to use it to switch desktops. System Preferences, Trackpad, More Gestures, “Swipe between pages” to “swipe left or right with three fingers” and “Swipe between full-screen apps” to “Swipe left with four fingers”&lt;&#x2F;p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>EC2 Availability Zones and Instance Types</title>
        <published>2011-07-14T00:00:00+00:00</published>
        <updated>2011-07-14T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://blog.piefox.com/posts/ec2-availability-zones-and-instance-types/"/>
        <id>https://blog.piefox.com/posts/ec2-availability-zones-and-instance-types/</id>
        
        <content type="html" xml:base="https://blog.piefox.com/posts/ec2-availability-zones-and-instance-types/">&lt;p&gt;&lt;strong&gt;UPDATED 2014&lt;&#x2F;strong&gt;: See the bottom of the page for a table of results updated as of the 21st of March 2014.&lt;&#x2F;p&gt;
&lt;p&gt;One of the odd things Amazon doesn’t tell you about EC2 is that some instance types simply aren’t supported by particular availability zones in the US-East region.&lt;&#x2F;p&gt;
&lt;p&gt;I work on libraries for provisioning so I should, perhaps, have noticed this earlier - however I just noticed it today when I was updating some code to handle the new per-Availability Zone Spot Price feeds. Some zones simply aren’t listed!&lt;&#x2F;p&gt;
&lt;p&gt;When provisioning normal instances in an availability zone that doesn’t support that instance type you get the error “&lt;em&gt;Your requested instance type (m2.4xlarge) is not supported in your requested Availability Zone (us-east-1b). Please retry your request by not specifying an availability zone or choosing us-east-1a, us-east-1c, us-east-1d&lt;&#x2F;em&gt;”&lt;&#x2F;p&gt;
&lt;p&gt;At work we don’t generally launch instances that are targeted to an Availability Zone, however I have seen this before when launching t1.micro instances (which, again, were unavailable in my us-east-1b). I assumed this meant that availability zone had run out of t1.micro capacity and provisioned it elsewhere - never noticing that it was always the same zone giving this complaint.&lt;&#x2F;p&gt;
&lt;p&gt;But now it’s clear as day in the spot price history tables - when an instance type isn’t supported by an Availability Zone it’s not listed in the graph (and it appears greyed out in the drop-down list at the top right of the price history page)&lt;&#x2F;p&gt;
&lt;p&gt;Amazon also do this bizarre psychometric loadbalancing thing where the zone called “us-east-1a” for my account may be the zone called “us-east-1b” for yours. If you do automated provisioning and want to target specific Availability Zones you’ll probably want a way to avoid accidentally targeting Normal or Spot instances at Availability Zones where they won’t be supported.&lt;&#x2F;p&gt;
&lt;p&gt;The way that my API works is the provider makes offers which the client can bid on (so I can write a piece of code to discard offers for instance types that aren’t supported by a particular availability zone)&lt;&#x2F;p&gt;
&lt;p&gt;As of the time of posting, here’s the list of unsupported Instance Type &#x2F; Availability Zone combinations for my primary account:&lt;&#x2F;p&gt;
&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Instance Type&lt;&#x2F;th&gt;&lt;th&gt;Not Available In&lt;&#x2F;th&gt;&lt;&#x2F;tr&gt;&lt;&#x2F;thead&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;t1.micro&lt;&#x2F;td&gt;&lt;td&gt;us-east-1b  &lt;br&gt;us-east-1c  &lt;br&gt;us-east-1d&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;m1.small&lt;&#x2F;td&gt;&lt;td&gt;us-east-1a  &lt;br&gt;us-east-1d&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;m2.xlarge&lt;&#x2F;td&gt;&lt;td&gt;us-east-1b&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;m2.2xlarge&lt;&#x2F;td&gt;&lt;td&gt;us-east-1b&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;m2.4xlarge&lt;&#x2F;td&gt;&lt;td&gt;us-east-1b&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;cc1.4xlarge&lt;&#x2F;td&gt;&lt;td&gt;us-east-1b  &lt;br&gt;us-east-1d&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;cg1.4xlarge&lt;&#x2F;td&gt;&lt;td&gt;us-east-1b  &lt;br&gt;us-east-1c&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;&#x2F;tbody&gt;&lt;&#x2F;table&gt;
&lt;p&gt;Despite being an incredibly uncommunicative company, Amazon finally responded to this issue with a somewhat bland response on their forums:&lt;&#x2F;p&gt;
&lt;blockquote&gt;
&lt;p&gt;As Availability Zones grow over time, our ability to continue to expand them can become constrained. In these scenarios, we will prevent customers from launching in the constrained zone if they do not yet have existing resources in that zone. We also might remove the constrained zone entirely from the list of options for new customers. This means that occasionally, different customers will see a different number of Availability Zones in a particular Region. Both approaches aim to help customers avoid accidentally starting to build up their infrastructure in an Availability Zone where they might have less ability to expand.      We recommend the purchase of Reserved Instances to assure capacity for a particular instance type in a specific Availability Zone when you need it.&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;p&gt;Gee, thanks. Except there are deficits in &lt;strong&gt;all&lt;&#x2F;strong&gt; US-East Availability Zones.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;the-situation-in-2014&quot;&gt;The situation in 2014&lt;a class=&quot;zola-anchor&quot; href=&quot;#the-situation-in-2014&quot; aria-label=&quot;Anchor link for: the-situation-in-2014&quot;&gt;#&lt;&#x2F;a&gt;&lt;&#x2F;h2&gt;
&lt;p&gt;I’ve re-run the code mentioned above, this time looking for instance types with neither spot price history data in the last month nor reserved instance offerings in a specific availability zone. The table is shown below. Obviously my particular availability zone names will not match yours, I’ll be posting code shortly to let you run these tests against your own EC2 account. I suspect the situation may no longer be as simple as it was - it may be possible to launch on-demand instances in these availability zones but there may be no spot or reserved capacity available.&lt;&#x2F;p&gt;
&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;&lt;&#x2F;th&gt;&lt;th&gt;&lt;&#x2F;th&gt;&lt;&#x2F;tr&gt;&lt;&#x2F;thead&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;c1.medium&lt;&#x2F;td&gt;&lt;td&gt;ap-southeast-1a&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;c1.xlarge&lt;&#x2F;td&gt;&lt;td&gt;ap-southeast-2b&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;us-west-2a&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;us-west-2b&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;c3.2xlarge&lt;&#x2F;td&gt;&lt;td&gt;sa-east-1a&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;sa-east-1b&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;us-east-1d&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;us-west-2a&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;us-west-2b&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;c3.4xlarge&lt;&#x2F;td&gt;&lt;td&gt;ap-southeast-1b&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;sa-east-1a&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;sa-east-1b&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;us-east-1d&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;c3.8xlarge&lt;&#x2F;td&gt;&lt;td&gt;ap-southeast-2a&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;sa-east-1a&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;sa-east-1b&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;us-west-2a&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;c3.large&lt;&#x2F;td&gt;&lt;td&gt;ap-northeast-1a&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;ap-southeast-1a&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;ap-southeast-1b&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;ap-southeast-2a&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;ap-southeast-2b&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;sa-east-1a&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;sa-east-1b&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;us-east-1b&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;us-west-2a&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;c3.xlarge&lt;&#x2F;td&gt;&lt;td&gt;ap-southeast-2b&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;eu-west-1a&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;eu-west-1c&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;sa-east-1a&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;sa-east-1b&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;cc2.8xlarge&lt;&#x2F;td&gt;&lt;td&gt;ap-northeast-1c&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;ap-southeast-1a&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;ap-southeast-1b&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;ap-southeast-2a&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;ap-southeast-2b&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;sa-east-1a&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;sa-east-1b&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;us-west-1a&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;us-west-1b&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;cg1.4xlarge&lt;&#x2F;td&gt;&lt;td&gt;ap-northeast-1a&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;ap-northeast-1c&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;ap-southeast-1a&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;ap-southeast-1b&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;ap-southeast-2a&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;ap-southeast-2b&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;eu-west-1a&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;eu-west-1b&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;eu-west-1c&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;sa-east-1a&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;sa-east-1b&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;us-east-1b&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;us-east-1c&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;us-west-1a&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;us-west-1b&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;us-west-2a&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;us-west-2b&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;us-west-2c&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;cr1.8xlarge&lt;&#x2F;td&gt;&lt;td&gt;ap-northeast-1a&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;ap-southeast-1a&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;ap-southeast-1b&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;ap-southeast-2a&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;ap-southeast-2b&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;eu-west-1a&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;eu-west-1b&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;eu-west-1c&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;sa-east-1a&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;sa-east-1b&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;us-west-1a&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;us-west-1b&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;us-west-2a&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;us-west-2b&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;g2.2xlarge&lt;&#x2F;td&gt;&lt;td&gt;ap-northeast-1a&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;ap-southeast-1a&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;ap-southeast-1b&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;ap-southeast-2a&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;ap-southeast-2b&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;eu-west-1b&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;sa-east-1a&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;sa-east-1b&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;us-east-1c&lt;&#x2F;td&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;us-east-1d&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;us-west-1b&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;hi1.4xlarge&lt;&#x2F;td&gt;&lt;td&gt;ap-northeast-1c&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;ap-southeast-1a&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;ap-southeast-1b&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;ap-southeast-2a&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;ap-southeast-2b&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;sa-east-1a&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;sa-east-1b&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;us-east-1b&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;us-west-1a&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;us-west-1b&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;us-west-2a&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;hs1.8xlarge&lt;&#x2F;td&gt;&lt;td&gt;ap-northeast-1a&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;ap-northeast-1c&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;ap-southeast-1a&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;ap-southeast-1b&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;ap-southeast-2a&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;ap-southeast-2b&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;eu-west-1a&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;eu-west-1b&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;eu-west-1c&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;sa-east-1a&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;sa-east-1b&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;us-east-1b&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;us-east-1c&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;us-east-1d&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;us-west-1a&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;us-west-1b&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;us-west-2a&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;us-west-2b&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;us-west-2c&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;i2.2xlarge&lt;&#x2F;td&gt;&lt;td&gt;ap-northeast-1a&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;ap-northeast-1c&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;ap-southeast-1a&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;ap-southeast-1b&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;ap-southeast-2a&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;ap-southeast-2b&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;eu-west-1a&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;eu-west-1b&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;eu-west-1c&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;sa-east-1a&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;sa-east-1b&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;us-east-1b&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;us-east-1c&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;us-east-1d&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;us-west-1a&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;us-west-1b&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;us-west-2a&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;us-west-2b&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;us-west-2c&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;i2.4xlarge&lt;&#x2F;td&gt;&lt;td&gt;ap-northeast-1a&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;ap-northeast-1c&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;ap-southeast-1a&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;ap-southeast-1b&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;ap-southeast-2a&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;ap-southeast-2b&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;eu-west-1a&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;eu-west-1b&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;eu-west-1c&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;sa-east-1a&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;sa-east-1b&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;us-east-1b&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;us-east-1c&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;us-east-1d&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;us-west-1a&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;us-west-1b&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;us-west-2a&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;us-west-2b&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;us-west-2c&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;i2.8xlarge&lt;&#x2F;td&gt;&lt;td&gt;ap-northeast-1a&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;ap-northeast-1c&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;ap-southeast-1a&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;ap-southeast-1b&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;ap-southeast-2a&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;ap-southeast-2b&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;i2.8xlarge&lt;&#x2F;td&gt;&lt;td&gt;eu-west-1a&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;eu-west-1b&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;eu-west-1c&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;sa-east-1a&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;sa-east-1b&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;us-east-1b&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;us-east-1c&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;us-east-1d&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;us-west-1a&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;us-west-1b&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;us-west-2a&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;us-west-2b&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;us-west-2c&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;i2.xlarge&lt;&#x2F;td&gt;&lt;td&gt;ap-northeast-1a&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;ap-northeast-1c&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;ap-southeast-1a&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;ap-southeast-1b&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;ap-southeast-2a&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;ap-southeast-2b&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;eu-west-1a&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;eu-west-1b&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;eu-west-1c&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;sa-east-1a&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;sa-east-1b&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;us-east-1b&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;us-east-1c&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;us-east-1d&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;us-west-1a&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;us-west-1b&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;us-west-2a&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;us-west-2b&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;us-west-2c&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;m1.large&lt;&#x2F;td&gt;&lt;td&gt;us-west-1b&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;ap-northeast-1a&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;ap-southeast-2a&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;ap-southeast-2b&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;us-west-2c&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;m1.small&lt;&#x2F;td&gt;&lt;td&gt;ap-northeast-1a&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;ap-northeast-1c&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;ap-southeast-2a&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;ap-southeast-2b&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;sa-east-1b&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;us-west-2c&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;m1.xlarge&lt;&#x2F;td&gt;&lt;td&gt;ap-northeast-1c&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;ap-southeast-2a&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;ap-southeast-2b&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;sa-east-1a&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;us-west-1a&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;us-west-2a&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;us-west-2b&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;us-west-2c&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;m2.2xlarge&lt;&#x2F;td&gt;&lt;td&gt;eu-west-1b&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;m2.4xlarge&lt;&#x2F;td&gt;&lt;td&gt;eu-west-1b&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;sa-east-1a&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;us-west-2a&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;us-west-2b&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;m2.xlarge&lt;&#x2F;td&gt;&lt;td&gt;us-west-2a&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;m3.2xlarge&lt;&#x2F;td&gt;&lt;td&gt;ap-northeast-1c&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;ap-southeast-1b&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;ap-southeast-2a&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;eu-west-1a&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;eu-west-1b&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;eu-west-1c&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;sa-east-1a&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;sa-east-1b&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;us-east-1c&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;us-east-1d&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;m3.large&lt;&#x2F;td&gt;&lt;td&gt;ap-southeast-1a&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;ap-southeast-1b&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;us-east-1b&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;us-east-1c&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;us-east-1d&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;us-west-2a&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;us-west-2b&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;us-west-2c&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;m3.medium&lt;&#x2F;td&gt;&lt;td&gt;ap-northeast-1a&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;ap-southeast-2a&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;ap-southeast-2b&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;us-east-1c&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;us-west-2a&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;us-west-2b&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;us-west-2c&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;m3.xlarge&lt;&#x2F;td&gt;&lt;td&gt;ap-northeast-1a&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;ap-northeast-1c&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;ap-southeast-1a&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;ap-southeast-1b&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;ap-southeast-2a&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;sa-east-1a&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;us-east-1c&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;us-west-2a&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;us-west-2b&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;t1.micro&lt;&#x2F;td&gt;&lt;td&gt;ap-southeast-1b&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;ap-southeast-2a&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;ap-southeast-2b&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;eu-west-1a&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;eu-west-1b&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;eu-west-1c&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;sa-east-1a&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;sa-east-1b&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;us-west-1a&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;&#x2F;tbody&gt;&lt;&#x2F;table&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>Encrypted, streaming backups with tar and gpg with fifos</title>
        <published>2011-06-25T00:00:00+00:00</published>
        <updated>2011-06-25T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://blog.piefox.com/posts/encrypted-streaming-backups-gpg/"/>
        <id>https://blog.piefox.com/posts/encrypted-streaming-backups-gpg/</id>
        
        <content type="html" xml:base="https://blog.piefox.com/posts/encrypted-streaming-backups-gpg/">&lt;p&gt;I wanted to back up a server to a USB drive earlier.&lt;&#x2F;p&gt;
&lt;p&gt;I wanted the backup to be encrypted and didn’t want to waste any time writing an unencrypted tarball to file and then encrypt it. GPG is really good for encrypting files so initially I tried its symmetric mode (tar -c &#x2F; | gpg –symmetric -o backup.tar.gpg) but it seems this mode can’t accept streaming input (it takes the key on standard in and I can’t find a way to have it read the key from somewhere else).&lt;&#x2F;p&gt;
&lt;p&gt;I realised (too late for myself, unfortunately) that this is a perfect time to use a FIFO! I was excited for FIFOs when I first discovered them in school but have never really had a use for them myself.&lt;&#x2F;p&gt;
&lt;p&gt;A FIFO is a special file which allows a single person to open it for write and a single person to open it for read &amp;amp; pipes the data straight from the writer to the reader.&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;First, create a FIFO file.&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;pre style=&quot;background-color:#2e3440;color:#d8dee9;&quot;&gt;&lt;code&gt;&lt;span&gt;mkfifo &#x2F;mnt&#x2F;backup.fifo
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;ol start=&quot;2&quot;&gt;
&lt;li&gt;Now start the writing end of the fifo (in the background). This is creating the archive.&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;pre style=&quot;background-color:#2e3440;color:#d8dee9;&quot;&gt;&lt;code&gt;&lt;span&gt;tar -zcvf &#x2F;mnt&#x2F;backup.fifo --exclude=&#x2F;proc --exclude=&#x2F;mnt --exclude=&#x2F;sys &#x2F; &amp;amp;
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;ol start=&quot;3&quot;&gt;
&lt;li&gt;Now start the reading end of the fifo. This is doing the encryption.&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;pre style=&quot;background-color:#2e3440;color:#d8dee9;&quot;&gt;&lt;code&gt;&lt;span&gt;gpg --symmetric &#x2F;mnt&#x2F;backup.fifo -o &#x2F;mnt&#x2F;usb&#x2F;backup.tar.gz.gpg
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>VyprVPN&#x27;s PPTP under Linux - the command-line way</title>
        <published>2010-04-21T00:00:00+00:00</published>
        <updated>2010-04-21T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://blog.piefox.com/posts/vyprvpn-pptp-under-linux/"/>
        <id>https://blog.piefox.com/posts/vyprvpn-pptp-under-linux/</id>
        
        <content type="html" xml:base="https://blog.piefox.com/posts/vyprvpn-pptp-under-linux/">&lt;p&gt;So I just got an account with vyprvpn and it’s pretty good… I have tunnels set up on my phone, laptops and desktops – everywhere but my Linux machine. I don’t use any of that network manager nonsense so I’ve got to do it through the commandline. It was a little intimidating to start with but fairly easy in the end.&lt;&#x2F;p&gt;
&lt;p&gt;These instructions are for Ubuntu 9.10. They show how to connect to the VyprVPN European servers… to use others, simply replace “eu1.vpn.giganews.com” with “us1.vpn.giganews.com” or “us2.vpn.giganews.com” as you wish.&lt;&#x2F;p&gt;
&lt;p&gt;(as root)&lt;&#x2F;p&gt;
&lt;pre style=&quot;background-color:#2e3440;color:#d8dee9;&quot;&gt;&lt;code&gt;&lt;span&gt;    # apt-get install pptp-linux pptpd
&lt;&#x2F;span&gt;&lt;span&gt;    # cd &#x2F;etc&#x2F;ppp&#x2F;peers
&lt;&#x2F;span&gt;&lt;span&gt;    # vim eu (or open it using your preferred text editor)
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Put the following in the file:&lt;&#x2F;p&gt;
&lt;pre style=&quot;background-color:#2e3440;color:#d8dee9;&quot;&gt;&lt;code&gt;&lt;span&gt;    pty &amp;quot;pptp eu1.vpn.giganews.com --nolaunchpppd&amp;quot;
&lt;&#x2F;span&gt;&lt;span&gt;    lock
&lt;&#x2F;span&gt;&lt;span&gt;    noauth
&lt;&#x2F;span&gt;&lt;span&gt;    nobsdcomp
&lt;&#x2F;span&gt;&lt;span&gt;    nodeflate
&lt;&#x2F;span&gt;&lt;span&gt;    name (your username)
&lt;&#x2F;span&gt;&lt;span&gt;    remotename eu
&lt;&#x2F;span&gt;&lt;span&gt;    ipparam eu
&lt;&#x2F;span&gt;&lt;span&gt;    require-mppe-128
&lt;&#x2F;span&gt;&lt;span&gt;    usepeerdns
&lt;&#x2F;span&gt;&lt;span&gt;    defaultroute
&lt;&#x2F;span&gt;&lt;span&gt;    persist
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Next it’s simply a matter of setting up your password. To do this:&lt;&#x2F;p&gt;
&lt;pre style=&quot;background-color:#2e3440;color:#d8dee9;&quot;&gt;&lt;code&gt;&lt;span&gt;    # cd &#x2F;etc&#x2F;ppp&#x2F;
&lt;&#x2F;span&gt;&lt;span&gt;    # vim chap-secrets
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Put the following in the file:&lt;&#x2F;p&gt;
&lt;pre style=&quot;background-color:#2e3440;color:#d8dee9;&quot;&gt;&lt;code&gt;&lt;span&gt;    (your username) eu1 &amp;quot;(your password)&amp;quot; *
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Finally you can connect to VyprVPN with the “pon” and disconnect from it using the “poff” command:&lt;&#x2F;p&gt;
&lt;pre style=&quot;background-color:#2e3440;color:#d8dee9;&quot;&gt;&lt;code&gt;&lt;span&gt;    #pon eu
&lt;&#x2F;span&gt;&lt;span&gt;    (wait a little while)
&lt;&#x2F;span&gt;&lt;span&gt;    #ifconfig ppp0
&lt;&#x2F;span&gt;&lt;span&gt;    ppp0 Link encap:Point-to-Point Protocol
&lt;&#x2F;span&gt;&lt;span&gt;    inet addr:x.x.x.x P-t-P:x.x.x.x Mask:255.255.255.255
&lt;&#x2F;span&gt;&lt;span&gt;    UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1396 Metric:1
&lt;&#x2F;span&gt;&lt;span&gt;    RX packets:6 errors:0 dropped:0 overruns:0 frame:0
&lt;&#x2F;span&gt;&lt;span&gt;    TX packets:6 errors:0 dropped:0 overruns:0 carrier:0
&lt;&#x2F;span&gt;&lt;span&gt;    collisions:0 txqueuelen:3
&lt;&#x2F;span&gt;&lt;span&gt;    RX bytes:84 (84.0 B) TX bytes:102 (102.0 B)
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;You should also see the default route has changed to route through your VPN. I’ve not resolved how to neatly switch the default route back once the VPN is disabled so when I want to terminate the VPN link I have the following commands:&lt;&#x2F;p&gt;
&lt;pre style=&quot;background-color:#2e3440;color:#d8dee9;&quot;&gt;&lt;code&gt;&lt;span&gt;    # poff
&lt;&#x2F;span&gt;&lt;span&gt;    # ip route add default dev eth0 (where eth0 is my default network connection)
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>Easier EC2 Logins</title>
        <published>2010-01-20T00:00:00+00:00</published>
        <updated>2010-01-20T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://blog.piefox.com/posts/easier-ec2-logins/"/>
        <id>https://blog.piefox.com/posts/easier-ec2-logins/</id>
        
        <content type="html" xml:base="https://blog.piefox.com/posts/easier-ec2-logins/">&lt;p&gt;With the addition of the new Northern California region to EC2 I ran into a problem: I had too many keys in my SSH Agent. To fix it I came up with the (somewhat imperfect) solution of removing the EC2 keys from my SSH Agent and moving the logic to the ssh config file; I’ve also written some regular expressions that pick the key automatically based on the hostname (or, if you’re using IPs, imperfectly matches the EC2 subnets).&lt;&#x2F;p&gt;
&lt;p&gt;This solution also skips hostkey checking since our instances have a maximum life of a few hours so there’s no point keeping the old hostkey fingerprints around.&lt;&#x2F;p&gt;
&lt;p&gt;Here’s an excerpt from my .ssh&#x2F;config file&lt;&#x2F;p&gt;
&lt;pre style=&quot;background-color:#2e3440;color:#d8dee9;&quot;&gt;&lt;code&gt;&lt;span&gt;# Default params  
&lt;&#x2F;span&gt;&lt;span&gt;Host *  
&lt;&#x2F;span&gt;&lt;span&gt;    HashKnownHosts no  
&lt;&#x2F;span&gt;&lt;span&gt;    StrictHostKeyChecking no  
&lt;&#x2F;span&gt;&lt;span&gt;    ConnectTimeout 15  
&lt;&#x2F;span&gt;&lt;span&gt;    ForwardAgent yes  
&lt;&#x2F;span&gt;&lt;span&gt;    RSAAuthentication yes  
&lt;&#x2F;span&gt;&lt;span&gt;    PasswordAuthentication yes  
&lt;&#x2F;span&gt;&lt;span&gt;    HostBasedAuthentication no  
&lt;&#x2F;span&gt;&lt;span&gt;    ForwardX11 yes  
&lt;&#x2F;span&gt;&lt;span&gt;  
&lt;&#x2F;span&gt;&lt;span&gt;#  
&lt;&#x2F;span&gt;&lt;span&gt;# Amazon EC2 hosts  
&lt;&#x2F;span&gt;&lt;span&gt;#               
&lt;&#x2F;span&gt;&lt;span&gt;  
&lt;&#x2F;span&gt;&lt;span&gt;# EC2 Northern Virginia  
&lt;&#x2F;span&gt;&lt;span&gt;#  216.182.224.0&#x2F;20  
&lt;&#x2F;span&gt;&lt;span&gt;#  72.44.32.0&#x2F;19     
&lt;&#x2F;span&gt;&lt;span&gt;#  67.202.0.0&#x2F;18     
&lt;&#x2F;span&gt;&lt;span&gt;#  75.101.128.0&#x2F;17   
&lt;&#x2F;span&gt;&lt;span&gt;#  174.129.0.0&#x2F;16    
&lt;&#x2F;span&gt;&lt;span&gt;#  204.236.224.0&#x2F;19  
&lt;&#x2F;span&gt;&lt;span&gt;Host *.compute-1.amazonaws.com 174.129.* 204.236.2[23]?.* 67.202.* 75.101.[12]??.* 216.182.2[23]?.* 72.44.[3456]?.*  
&lt;&#x2F;span&gt;&lt;span&gt;    User root  
&lt;&#x2F;span&gt;&lt;span&gt;    CheckHostIP no  
&lt;&#x2F;span&gt;&lt;span&gt;    IdentityFile ~&#x2F;.keys&#x2F;ssh&#x2F;ec2&#x2F;us_east_1.key  
&lt;&#x2F;span&gt;&lt;span&gt;    StrictHostKeyChecking no  
&lt;&#x2F;span&gt;&lt;span&gt;    UserKnownHostsFile &#x2F;dev&#x2F;null  
&lt;&#x2F;span&gt;&lt;span&gt;    IdentitiesOnly yes  
&lt;&#x2F;span&gt;&lt;span&gt;    ForwardAgent no  
&lt;&#x2F;span&gt;&lt;span&gt;  
&lt;&#x2F;span&gt;&lt;span&gt;# EC2 Northern California:  
&lt;&#x2F;span&gt;&lt;span&gt;#  204.236.128.0&#x2F;18  
&lt;&#x2F;span&gt;&lt;span&gt;Host *.us-west-1.compute.amazonaws.com 204.236.1??.*  
&lt;&#x2F;span&gt;&lt;span&gt;    User root  
&lt;&#x2F;span&gt;&lt;span&gt;    CheckHostIP no  
&lt;&#x2F;span&gt;&lt;span&gt;    IdentityFile ~&#x2F;.keys&#x2F;ssh&#x2F;ec2&#x2F;us_west_1.key  
&lt;&#x2F;span&gt;&lt;span&gt;    StrictHostKeyChecking no  
&lt;&#x2F;span&gt;&lt;span&gt;    UserKnownHostsFile &#x2F;dev&#x2F;null  
&lt;&#x2F;span&gt;&lt;span&gt;    IdentitiesOnly yes  
&lt;&#x2F;span&gt;&lt;span&gt;    ForwardAgent no  
&lt;&#x2F;span&gt;&lt;span&gt;  
&lt;&#x2F;span&gt;&lt;span&gt;# EC2 Ireland:  
&lt;&#x2F;span&gt;&lt;span&gt;#  79.125.0.0&#x2F;17  
&lt;&#x2F;span&gt;&lt;span&gt;Host *.eu-west-1.compute.amazonaws.com 79.125.?.* 79.125.??.* 79.125.1[012]?.*  
&lt;&#x2F;span&gt;&lt;span&gt;    User root  
&lt;&#x2F;span&gt;&lt;span&gt;    CheckHostIP no  
&lt;&#x2F;span&gt;&lt;span&gt;    IdentityFile ~&#x2F;.keys&#x2F;ssh&#x2F;ec2&#x2F;eu_west_1.key  
&lt;&#x2F;span&gt;&lt;span&gt;    StrictHostKeyChecking no  
&lt;&#x2F;span&gt;&lt;span&gt;    UserKnownHostsFile &#x2F;dev&#x2F;null  
&lt;&#x2F;span&gt;&lt;span&gt;    IdentitiesOnly yes  
&lt;&#x2F;span&gt;&lt;span&gt;    ForwardAgent no
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>First iPhone app</title>
        <published>2009-04-16T00:00:00+00:00</published>
        <updated>2009-04-16T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://blog.piefox.com/posts/first-iphone-app/"/>
        <id>https://blog.piefox.com/posts/first-iphone-app/</id>
        
        <content type="html" xml:base="https://blog.piefox.com/posts/first-iphone-app/">&lt;p&gt;I’ve been looking at the iPhone SDK recently and flicking through the pretty cool Stanford iPhone Programming course, so I (sorta) did the 2nd assignment tonight. What fun.&lt;&#x2F;p&gt;
&lt;p&gt;Not too shabby for 2 hours work. I’m also a bit happier with Objective C and Cocoa now - I was dreading them because of how arcane Objective C looks, but it seems decent enough, weird syntax aside.&lt;&#x2F;p&gt;
&lt;p&gt;I’m really not overly enamoured with xcode, though - I wish its editor was tabbed like Eclipse. And the Groups &amp;amp; Files list isn’t awfully advanced. I’ve been using the “Implementation Files” group and it’s helped a lot, limiting the header-clutter C environments have in abundance.&lt;&#x2F;p&gt;
&lt;p&gt;So yeah, what fun. I must look around to see if there are any other assignments I can do for the iPhone to learn the various areas - just diving straight into my Serious Dynamic Media Content Presentation demo app for work might be a tad much at this stage:)&lt;&#x2F;p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>Linux: aufs and chroot</title>
        <published>2009-03-13T00:00:00+00:00</published>
        <updated>2009-03-13T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://blog.piefox.com/posts/aufs-and-chroot/"/>
        <id>https://blog.piefox.com/posts/aufs-and-chroot/</id>
        
        <content type="html" xml:base="https://blog.piefox.com/posts/aufs-and-chroot/">&lt;p&gt;I’ve been playing around with chroot with aufs to snapshot a machine’s state so it can be rolled back easily (not for security, though!). It’s all been going well - you need to make a few changes to &#x2F;etc&#x2F;mtab once you’ve mounted the new system since it has all the mounts for the base system.&lt;&#x2F;p&gt;
&lt;p&gt;The other slightly annoying thing is proc - inside the chroot I’ve mounted &#x2F;proc as proc so things like ps work but it’s a pity there’s no way to limit procfs to only showing processes with a particular root.&lt;&#x2F;p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>Force pseudo-tty allocation in openssh</title>
        <published>2009-03-12T00:00:00+00:00</published>
        <updated>2009-03-12T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://blog.piefox.com/posts/openssh-pseudo-tty-allocation/"/>
        <id>https://blog.piefox.com/posts/openssh-pseudo-tty-allocation/</id>
        
        <content type="html" xml:base="https://blog.piefox.com/posts/openssh-pseudo-tty-allocation/">&lt;p&gt;Edit: As webknjaz has pointed out in the comments below, “RequestTTY force” in .ssh&#x2F;config will do this now (in fact, it looks like it’s worked for all of the current decade at this point… I’ll leave the original blog post from 2009 intact for posterity &#x2F; looking back at old things that annoyed me).&lt;&#x2F;p&gt;
&lt;p&gt;ssh has this neat option -t which allocates a ptty so you can run interactive things like Screen or Vi - but there’s no .ssh&#x2F;config option for it (there’s one for the server, ForcePTTYAllocation). I don’t like having to do alias ssh=“ssh -t” when it’s something that should reasonably be read from the config file (just let me configure the default value of force_tty_flag, dammit!)&lt;&#x2F;p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>DHL Belfast Service Codes</title>
        <published>2009-02-12T00:00:00+00:00</published>
        <updated>2009-02-12T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://blog.piefox.com/posts/dhl-belfast-service-codes/"/>
        <id>https://blog.piefox.com/posts/dhl-belfast-service-codes/</id>
        
        <content type="html" xml:base="https://blog.piefox.com/posts/dhl-belfast-service-codes/">&lt;p&gt;DHL Belfast - Service centre codes, redelivery information
So I got a package delivered to my parents house. But they weren’t in. So I had to arrange a redelivery to a different address. Which DHL requires the Service Centre Code for. But they don’t put it on their website (the DHL Belfast Service Centre code is 7767 for anyone that’s looking - I couldn’t find it anywhere on the internet so hopefully someone who googles for the same thing I did will find this)&lt;&#x2F;p&gt;
&lt;p&gt;Then when I called their number (08450 261 278) &amp;amp; entered the code the man told me that all I needed to do was e-mail belfast.redelivery@dhl.com with my package tracking number (the one starting JD00) and the new address and postcode. They should really put that sort of information up on their website.&lt;&#x2F;p&gt;
&lt;p&gt;Some other contributions from past comments on the previous iteration of this blog:&lt;&#x2F;p&gt;
&lt;pre style=&quot;background-color:#2e3440;color:#d8dee9;&quot;&gt;&lt;code&gt;&lt;span&gt;Unknown4 March 2009 at 13:10
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;Just so you know someone did have a similar problem to yourself and I did indeed find your post through google.
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;It was very helpful and I was able to skip the phone part and just email them.
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;Thank you very much
&lt;&#x2F;span&gt;&lt;span&gt;Reply
&lt;&#x2F;span&gt;&lt;span&gt;Unknown13 October 2009 at 12:39
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;Thanks for the information. This has made my life a lot easier.
&lt;&#x2F;span&gt;&lt;span&gt;Reply
&lt;&#x2F;span&gt;&lt;span&gt;Anonymous8 January 2010 at 16:58
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;I&amp;#39;m attempting the same thing so hopefully this will work. Thanks for your post. As you say, totally useless information on their website so if you are trying to do this remotely as I am (I&amp;#39;m in Italy, item being delivered in UK), getting through on the pointless phone line just wastes more time!
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;Thanks again!
&lt;&#x2F;span&gt;&lt;span&gt;Reply
&lt;&#x2F;span&gt;&lt;span&gt;Anonymous9 January 2010 at 16:34
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;I was looking for the DHL Vauxhall service centre code, unfortunately your blog post was the closest I could get to it on the web, but a tip for any other Googlers:
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;I rung the national DHL Express number of 08442480544 and explained I needed the Service Centre Code to speak to a real person at the centre. She didn&amp;#39;t quite understand me but when I said &amp;quot;4 digit code&amp;quot; she gave me the 4 Digit Op number of 7291 for Vauxhall. Presumably they&amp;#39;ll be equally helpful to anyone else looking for the service centre code!
&lt;&#x2F;span&gt;&lt;span&gt;Reply
&lt;&#x2F;span&gt;&lt;span&gt;Anonymous9 December 2010 at 19:44
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;I was looking for the DHL Vauxhall service centre code too..
&lt;&#x2F;span&gt;&lt;span&gt;Having a terrible experience with DHL this time. The status on tracking page says they left a card .. However no card was found anywhere around. Calling up the customer service line.. I was put on hold for 12 minutes to some screechy tune after which I gave up and hung up call.
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;Have mailed the customer service now. Hoping it works out.
&lt;&#x2F;span&gt;&lt;span&gt;Reply
&lt;&#x2F;span&gt;&lt;span&gt;Anonymous9 March 2011 at 13:41
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;If anyone needs the Quedgeley, Gloucester code ive just found its: 7464
&lt;&#x2F;span&gt;&lt;span&gt;Reply
&lt;&#x2F;span&gt;&lt;span&gt;Anonymous8 June 2011 at 12:22
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;Bristol is 7276
&lt;&#x2F;span&gt;&lt;span&gt;Reply
&lt;&#x2F;span&gt;&lt;span&gt;Anonymous4 August 2011 at 09:37
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;Maidstone (Aylesford): 2119
&lt;&#x2F;span&gt;&lt;span&gt;Reply
&lt;&#x2F;span&gt;&lt;span&gt;Anonymous29 December 2011 at 18:04
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;Edinburgh - 7241
&lt;&#x2F;span&gt;&lt;span&gt;Reply
&lt;&#x2F;span&gt;&lt;span&gt;Unknown23 May 2013 at 10:16
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;DHL Lambeth- 2154
&lt;&#x2F;span&gt;&lt;span&gt;Reply
&lt;&#x2F;span&gt;&lt;span&gt;Replies
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;    Anonymous7 December 2013 at 12:52
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;    Thank you. This was what I was looking for to ask for a redelivery since DHL didn&amp;#39;t leave the card so I needed to look for this Lambeth Service code 4 digtis myself.
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;    I love the internet for this!
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>Java&#x2F;OpenSSL CA generation</title>
        <published>2008-10-14T00:00:00+00:00</published>
        <updated>2008-10-14T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://blog.piefox.com/posts/java-openssl-ca-generation/"/>
        <id>https://blog.piefox.com/posts/java-openssl-ca-generation/</id>
        
        <content type="html" xml:base="https://blog.piefox.com/posts/java-openssl-ca-generation/">&lt;p&gt;I was trying to find a Java equivalent to &lt;code&gt;openssl x509 -hash -in certificate.pem&lt;&#x2F;code&gt;&lt;&#x2F;p&gt;
&lt;p&gt;It turns out it’s an OpenSSL invention; while there’s no pre-written solution, here’s one I wrote earlier:&lt;&#x2F;p&gt;
&lt;pre style=&quot;background-color:#2e3440;color:#d8dee9;&quot;&gt;&lt;code&gt;&lt;span&gt;    public static String opensslHash(X509Certificate cert) {
&lt;&#x2F;span&gt;&lt;span&gt;        try {
&lt;&#x2F;span&gt;&lt;span&gt;            return openssl_X509_NAME_hash(cert.getSubjectX500Principal());
&lt;&#x2F;span&gt;&lt;span&gt;        }
&lt;&#x2F;span&gt;&lt;span&gt;        catch (NoSuchAlgorithmException e) {
&lt;&#x2F;span&gt;&lt;span&gt;            throw new Error(&amp;quot;MD5 isn&amp;#39;t available!&amp;quot;, e);
&lt;&#x2F;span&gt;&lt;span&gt;        }
&lt;&#x2F;span&gt;&lt;span&gt;    }
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;    &#x2F;**
&lt;&#x2F;span&gt;&lt;span&gt;    * Generates a hex X509_NAME hash (like openssl x509 -hash -in cert.pem)
&lt;&#x2F;span&gt;&lt;span&gt;    * Based on openssl&amp;#39;s crypto&#x2F;x509&#x2F;x509_cmp.c line 321
&lt;&#x2F;span&gt;&lt;span&gt;    *&#x2F;
&lt;&#x2F;span&gt;&lt;span&gt;    public static String openssl_X509_NAME_hash(X500Principal p) throws NoSuchAlgorithmException {
&lt;&#x2F;span&gt;&lt;span&gt;        &#x2F;&#x2F; This code replicates OpenSSL&amp;#39;s hashing function
&lt;&#x2F;span&gt;&lt;span&gt;        &#x2F;&#x2F; DER-encode the Principal, MD5 hash it, then extract the first 4 bytes and reverse their positions
&lt;&#x2F;span&gt;&lt;span&gt;        byte[] derEncodedSubject = p.getEncoded();
&lt;&#x2F;span&gt;&lt;span&gt;        byte[] md5 = MessageDigest.getInstance(&amp;quot;MD5&amp;quot;).digest(derEncodedSubject);
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;        &#x2F;&#x2F; Reduce the MD5 hash to a single unsigned long
&lt;&#x2F;span&gt;&lt;span&gt;        byte[] result = new byte[] { md5[3], md5[2], md5[1], md5[0] };
&lt;&#x2F;span&gt;&lt;span&gt;        return toHex(result);
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;    }
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;    &#x2F;&#x2F; encode binary to hex
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;    private static String toHex(final byte[] bin) {
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;        if (bin == null || bin.length == 0)
&lt;&#x2F;span&gt;&lt;span&gt;            return &amp;quot;&amp;quot;;
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;        char[] buffer = new char[bin.length * 2];
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;        final char[] hex = &amp;quot;0123456789abcdef&amp;quot;.toCharArray();
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;        &#x2F;&#x2F; i tracks input position, j tracks output position
&lt;&#x2F;span&gt;&lt;span&gt;        for (int i = 0, j = 0; i &amp;lt; bin.length ;i++) {
&lt;&#x2F;span&gt;&lt;span&gt;            final byte b = bin[i];
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;            buffer[j++] = hex[(b &amp;gt;&amp;gt; 4) &amp;amp; 0x0F];
&lt;&#x2F;span&gt;&lt;span&gt;            buffer[j++] = hex[b &amp;amp; 0x0F];
&lt;&#x2F;span&gt;&lt;span&gt;        }
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;        return new String(buffer);
&lt;&#x2F;span&gt;&lt;span&gt;    }
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
</content>
        
    </entry>
</feed>
