Jekyll2023-01-20T22:56:09+00:00https://zed0.co.uk/blog/Ben FalconmoreI am currently a software engineer. I have an interest in programming, skiing, climbing, hiking, and Lego.Zurich: breadboards and fondue2022-01-15T02:14:52+00:002022-01-15T02:14:52+00:00https://zed0.co.uk/blog/2022/01/15/zurich-breadboards-and-fondue<p>Before our ski season we spent some time with a friend in Zurich.
As thanks for letting us stay with him on short notice we bought him a home fondue set which saw a lot of use.
We also spent a lot of time trimming wires and checking logic on Ben Eater’s <a href="https://eater.net/8bit">8-bit CPU kit</a>, which was a lot of fun. Sadly due to a faulty NAND chip we couldn’t complete it during our stay.</p>
<p><a href="https://zed0.co.uk/blog/assets/2022/01/20211227_140238.jpg"><img src="https://zed0.co.uk/blog/assets/2022/01/20211227_140238_400.jpg" alt="" /></a></p>
<p><a href="https://zed0.co.uk/blog/assets/2022/01/20211227_150156.jpg"><img src="https://zed0.co.uk/blog/assets/2022/01/20211227_150156_400.jpg" alt="" /></a></p>
<p><a href="https://zed0.co.uk/blog/assets/2022/01/20211228_142431.jpg"><img src="https://zed0.co.uk/blog/assets/2022/01/20211228_142431_400.jpg" alt="" /></a></p>
<p><a href="https://zed0.co.uk/blog/assets/2022/01/20211228_233421.jpg"><img src="https://zed0.co.uk/blog/assets/2022/01/20211228_233421_400.jpg" alt="" /></a></p>
<p><a href="https://zed0.co.uk/blog/assets/2022/01/20211229_213344.jpg"><img src="https://zed0.co.uk/blog/assets/2022/01/20211229_213344_400.jpg" alt="" /></a></p>
<p><a href="https://zed0.co.uk/blog/assets/2022/01/IMG_20211227_201604.jpg"><img src="https://zed0.co.uk/blog/assets/2022/01/IMG_20211227_201604_400.jpg" alt="" /></a></p>
<p><a href="https://zed0.co.uk/blog/assets/2022/01/IMG_20211229_012216.jpg"><img src="https://zed0.co.uk/blog/assets/2022/01/IMG_20211229_012216_400.jpg" alt="" /></a></p>
<p><a href="https://zed0.co.uk/blog/assets/2022/01/IMG_20211231_032649.jpg"><img src="https://zed0.co.uk/blog/assets/2022/01/IMG_20211231_032649_400.jpg" alt="" /></a></p>zed0Before our ski season we spent some time with a friend in Zurich. As thanks for letting us stay with him on short notice we bought him a home fondue set which saw a lot of use. We also spent a lot of time trimming wires and checking logic on Ben Eater’s 8-bit CPU kit, which was a lot of fun. Sadly due to a faulty NAND chip we couldn’t complete it during our stay.Power Mac G4 Cube tear-down (or build-up)2012-07-22T03:14:52+01:002012-07-22T03:14:52+01:00https://zed0.co.uk/blog/2012/07/22/power-mac-g4-cube-tear-down-or-build-up<p>I was recently given one of the old (released 2000) Mac G4 Cube computers to play around with, if you’ve never heard of the Cube it’s probably because it didn’t do very well commercially, it was $1600 for one despite not having a huge amount going for it but the form factor.
<img src="http://www.deskpicture.com/DPs/Technology/Apple/G4Cube_2.jpg" alt="" /></p>
<p>Due to the casing these have unsurprisingly been incredibly popular with the <a href="http://forums.bit-tech.net/showthread.php?t=227181">modding community</a> as you get a nice frame to build a modern computer within, there’s just enough space for a mini ITX motherboard, a hard drive, RAM, laptop sized optical drive and a (very) small power supply if you’re lucky. The G4 Cube was a fanless computer and the G4 processor runs pretty hot so most of this space can be found with relative ease by removing the enormous heat sink which takes up almost 30% of the interior space and runs the entire way through the machine.</p>
<p>I didn’t actually think of taking pictures of this until I had already taken it to bits, so instead of showing the pictures in reverse I’m going to describe this as a build-up rather than a tear-down.</p>
<p><a href="https://zed0.co.uk/blog/assets/2012/07/DSC_0220.jpg"><img src="https://zed0.co.uk/blog/assets/2012/07/DSC_0220-225x300.jpg" alt="" /></a></p>
<p>The first part is the CPU which is attached to the heat sink, I could have seperated these but I didn’t have any thermal paste handy so I thought I’d leave it attached.</p>
<p><a href="https://zed0.co.uk/blog/assets/2012/07/DSC_0222.jpg"><img src="https://zed0.co.uk/blog/assets/2012/07/DSC_0222-225x300.jpg" alt="" /></a></p>
<p>The heat sink is huge, it runs the entire height of the cube and makes up a large part of the weight of the box. On each side of the heat sink are runners that the retractable handle slides into, this is one of the neatest features about the Cube and I’m rather regretting not taking any pictures of it.</p>
<p><a href="https://zed0.co.uk/blog/assets/2012/07/DSC_0223.jpg"><img src="https://zed0.co.uk/blog/assets/2012/07/DSC_0223-300x225.jpg" alt="" /></a></p>
<p>The motherboard is pretty well designed with pretty much no space to spare, a PCI slot, 3 SDRAM slots, 2 Firewire ports, 2 USB ports, PS/2 port. The motherboard plugs directly into the white connector on the CPU, in fact at first I didn’t think that they were even separable.</p>
<p><a href="https://zed0.co.uk/blog/assets/2012/07/DSC_0225.jpg"><img src="https://zed0.co.uk/blog/assets/2012/07/DSC_0225-300x225.jpg" alt="" /></a></p>
<p>A small Ethernet card also attaches to the underside of the motherboard giving it a (for the day) pretty speedy 10Mb connection.</p>
<p><a href="https://zed0.co.uk/blog/assets/2012/07/DSC_0229.jpg"><img src="https://zed0.co.uk/blog/assets/2012/07/DSC_0229-225x300.jpg" alt="" /></a></p>
<p>Connecting all the parts so far onto the back panel the Cube starts to take shape.</p>
<p><a href="https://zed0.co.uk/blog/assets/2012/07/DSC_0236.jpg"><img src="https://zed0.co.uk/blog/assets/2012/07/DSC_0236-300x225.jpg" alt="" /></a></p>
<p>After taking apart many standard ATX power supplies I was surprised at how small this voltage regulator board was. This is probably half because most of the power is handled in an external power transformer leaving very little for this board to do.</p>
<p><a href="https://zed0.co.uk/blog/assets/2012/07/DSC_0238.jpg"><img src="https://zed0.co.uk/blog/assets/2012/07/DSC_0238-300x225.jpg" alt="" /></a></p>
<p>The voltage regulator board plugs straight into the motherboard with a little fiddling (the back panel interferes slightly). In this picture I’ve also connected the hard drive and the slim form CD drive to the bottom of the cube however these were fairly standard parts and I didn’t think they warranted too much discussion here.</p>
<p><a href="https://zed0.co.uk/blog/assets/2012/07/DSC_0241.jpg"><img src="https://zed0.co.uk/blog/assets/2012/07/DSC_0241-300x225.jpg" alt="" /></a></p>
<p>The AGP graphics card is an ATI Rage Pro with a whole 16MB of SDRAM, a VGA port and an Apple Display Connector. She may not look like much but she’ll run glxgears at 250FPS.</p>
<p><a href="https://zed0.co.uk/blog/assets/2012/07/DSC_0240.jpg"><img src="https://zed0.co.uk/blog/assets/2012/07/DSC_0240-300x225.jpg" alt="" /></a></p>
<p>To connect the AGP graphics card to the PCI motherboard this nifty adapter was used (also taking care of turning 90°), unfortunately sources say that this won’t work on other computers (and here I was wanting to get a last bit of use out of my old AGP card!).</p>
<p><a href="https://zed0.co.uk/blog/assets/2012/07/DSC_0242.jpg"><img src="https://zed0.co.uk/blog/assets/2012/07/DSC_0242-225x300.jpg" alt="" /></a></p>
<p>Attaching the graphics card via adapter and we’ve got the final piece in place before putting the casing back on.</p>
<p><a href="https://zed0.co.uk/blog/assets/2012/07/DSC_0243.jpg"><img src="https://zed0.co.uk/blog/assets/2012/07/DSC_0243-225x300.jpg" alt="" /></a></p>
<p>Putting the aluminium casing back on an the cube is operational again. I didn’t take any photos but this whole construction slides into the perspex container and locks in place, it’s not all that interesting.</p>
<p><a href="https://zed0.co.uk/blog/assets/2012/07/DSC_0244.jpg"><img src="https://zed0.co.uk/blog/assets/2012/07/DSC_0244-225x300.jpg" alt="" /></a></p>
<p>I left the Cube out of its case and on the floor installing Debian. Unfortunately the Cube came before USB booting was used much so I needed to write a CD in order to install Debian, this proved a bit of an issue since none of my computers actually had a CD writer connected at the time.</p>
<p>Installing Debian was also rather interesting, for some reason when it installed yaboot (a bootloader for powerpc) it failed to configure it properly meaning I needed to go in with the rescue console and sort out where it was pointing. When I got it trying to boot the correct partition yaboot threw an input/output error accessing the vmlinux and initrd files which were in /boot/. For some reason I have yet to fathom if I copied the contents of /boot to /toot and then changed yaboot’s config to point there it worked fine, I was quite lucky to find this fix deep in a mailing list since I was pretty stumped at this point.</p>
<p>Now Debian is up and running it works pretty smoothly with <a href="http://awesome.naquadah.org/">awesome</a>, unfortunately Chromium is not available for the powerpc architecture at the moment so I’m using Midori instead (Firefox was way too intensive), it even runs Flash and can almost cope with YouTube (audio is full speed, video skips a lot of frames).</p>
<p>In comparison with a Raspberry Pi (mine should be in the post soon hopefully) the G4 cube only has a 500MHz processor (where the raspi has 700MHz) but it makes up for it with a colossal 1.5GB of RAM with all it’s slots full (about 6 times what the raspi has).</p>
<p>I am very tempted to mod my own computer into this, because you always need more computers! The perspex casing is pretty heavy so I’d probably try to make something that didn’t use that and used the nifty handle (which I failed to take any pictures of) for portability, I imagine the casing would find other uses (LED cubes come to mind).</p>zed0I was recently given one of the old (released 2000) Mac G4 Cube computers to play around with, if you’ve never heard of the Cube it’s probably because it didn’t do very well commercially, it was $1600 for one despite not having a huge amount going for it but the form factor.Review/Build of 10212-1: Imperial Shuttle2012-05-14T17:33:49+01:002012-05-14T17:33:49+01:00https://zed0.co.uk/blog/2012/05/14/reviewbuild-of-10212-1-imperial-shuttle<p>I have had Tower Bridge (<a href="http://brickset.com/detail/?set=10214-1">10214-1</a>) for several months now and been generally quite impressed with the build in general as well as the value, given this I thought it would be nice to get some more of the collectors sets. I happened to see that the Imperial Shuttle (<a href="http://brickset.com/detail/?Set=10212-1">10212-1</a>) was down to £200 (down from £250) in the Lego May 4th Star Wars sale and I had been admiring it for some time so I gave in and bought it.</p>
<p>Looking at the reviews beforehand I was rather sceptical of the “challenging construction” that reviews had claimed in this model, the same had been claimed of Tower Bridge and I had found it reasonably easy, putting it together in about 3.5 hours, which I guess isn’t bad for 4287 pieces.
The reviews also complained that the wings were fragile and that the landing gear had to be removed while the model was on its display stand; neither of these things particularly bothered me since I wasn’t planning to use the model for play and “swooshability” wasn’t much of an issue.</p>
<p>Despite claims from Lego that it would be late, due to the popularity of the sale, the set arrived in the post on Saturday and I opened the set claiming that I would be finished by 3am.
Due to the sale I got a free poster of the new Ultimate Collector Series R2-D2 (which I’m not keen on, I don’t think that they did the rounded body very well), a micro scale TIE fighter, and a E-3PO (silver version of C-3PO); I disregarded all of these, eager to get on with the build.</p>
<p>One of the first things I noticed on opening the set was that, although there are 4 instruction booklets, the pieces all come in bags sorted by type rather than according to which set of instructions you needed them for (unlike Tower Bridge and the Medieval Market Village). Due to this I spread all of the pieces out on the floor and relied on searching the old fashioned way (I almost always build on the floor due to childhood habits, though my knees are getting a bit old for it now).</p>
<p>I ran into a hitch on the first few instructions due to mistaking dark grey for black in the instructions; I thought that Lego had taken to outlining pieces that were black in white to prevent confusion but they were pretty indistinguishable for this set. I de-constructed the model I had so far when I realised that there weren’t any of the pieces I needed in black and rebuilt it using dark grey.</p>
<p>I was struck fairly soon by just how complicated the model was, the build starts you off by building the main body of the shuttle and the mechanism for winding the wings up and down, some of the steps were fairly fiddly and required you to balance a piece of Technic while you slotted a rod into place. I realised about this point that the reviews had been justified in calling this a challenging build.</p>
<p><a href="https://zed0.co.uk/blog/assets/2012/05/DSC_0195.jpg"><img src="https://zed0.co.uk/blog/assets/2012/05/DSC_0195-300x224.jpg" alt="" /></a></p>
<p>As can be seen above there is a reasonably complex interior to the body of the shuttle, both for the wing mechanism and to keep the structure from falling apart. The vertical wing slots into the red Technic pieces that can be seen at the rear of the model.</p>
<p>I realised now just how large the model was going to be, the pictured part was around 250mm across and, by my reckoning, there would be at least that again on either side for the side wings.</p>
<p>The vertical wing is the first to be constructed, using the new style Technic beams (the ones without studs on top) for structural stability and using various types of pegs to hold a standard bricks in place. The whole construction is then slotted into the top of the body of the shuttle.</p>
<p>Continuing to build up the wings confirmed to me that this model is absolutely huge, when I slotted the vertical wing into place it bested the height of my coffee table which isn’t exactly small:</p>
<p><a href="https://zed0.co.uk/blog/assets/2012/05/DSC_0196.jpg"><img src="https://zed0.co.uk/blog/assets/2012/05/DSC_0196-224x300.jpg" alt="" /></a></p>
<p>The side wings are constructed similarly to the vertical, but with more fiddly bits, some of the first pieces have to be balanced for several instructions until they are held in place securely. Apart from being fiddly the wings are reasonably standard to make, although you do have to follow mirrored instructions for each which, although I didn’t mind, might discourage some builders.</p>
<p>I was quite worried about how strong the wing connections would be since the wings are quite big and connected wholly in the space of three studs but they seem to hold ok. The cogs to adjust the wings seemed to slip a little before I had put all the pegs in but afterwards they worked fine.</p>
<p>After the wings are connected you build various guns around the shuttle and the display stand. It turned out that at some point in the build I had once again mistaken dark grey for black in the instructions and so I had a 1x4 plate that was the wrong colour that I needed to use in the display stand. Given that it was at this point about 4:30am I couldn’t bear the thought of tearing the shuttle apart to find the rogue black piece so I just used the dark grey one in the display stand; at least it wasn’t too obvious.</p>
<p><a href="https://zed0.co.uk/blog/assets/2012/05/DSC_0197.jpg"><img src="https://zed0.co.uk/blog/assets/2012/05/DSC_0197-224x300.jpg" alt="" /></a></p>
<p>I finally finished construction at around 5am and moved the shuttle to the kitchen bench before heading to bed.</p>
<p>All in all I thought it was a pretty enjoyable build. The instructions could use a little clarification and I won’t underestimate a set like this again, the total build time was about 5 hours (for 2503 pieces) compared to Tower Bridge (about 3.5 hours for 4287 pieces). The set is huge, it can be seen above towering over Tower Bridge. I would definitely recommend it to advanced builders if you want something challenging, great value for money in terms of build time.</p>zed0I have had Tower Bridge (10214-1) for several months now and been generally quite impressed with the build in general as well as the value, given this I thought it would be nice to get some more of the collectors sets. I happened to see that the Imperial Shuttle (10212-1) was down to £200 (down from £250) in the Lego May 4th Star Wars sale and I had been admiring it for some time so I gave in and bought it.Colossal Castle IX entry2011-12-31T04:12:51+00:002011-12-31T04:12:51+00:00https://zed0.co.uk/blog/2011/12/31/colossal-castle-ix-entry<p>This is one of the pieces of Lego I made with the many sets I got for Christmas this year.
I happened to notice that <a href="http://www.classic-castle.com/">Classic-Castle.com</a> was having a <a href="http://www.classic-castle.com/events/ccc/rules.cgi?contest=cccix">competition</a> so I thought I’d give that a shot.</p>
<p>This was designed for the “Hidden Treasure” category, the premise is that two dwarves are re-exploring a long forgotten mineshaft.</p>
<p>There is a light element which theoretically makes the gem at the bottom light up but in practice it’s far too dim and most of the lighting down there was done with a Maglite.</p>
<div class="col-lg-10 col-lg-offset-1 centered">
<div id="carousel" class="carousel slide" data-ride="carousel">
<!-- Indicators -->
<ol class="carousel-indicators">
<li data-target="#carousel" data-slide-to="0" class="active">
</li>
<li data-target="#carousel" data-slide-to="1">
</li>
<li data-target="#carousel" data-slide-to="2">
</li>
<li data-target="#carousel" data-slide-to="3">
</li>
<li data-target="#carousel" data-slide-to="4">
</li>
<li data-target="#carousel" data-slide-to="5">
</li>
<li data-target="#carousel" data-slide-to="6">
</li>
<li data-target="#carousel" data-slide-to="7">
</li>
<li data-target="#carousel" data-slide-to="8">
</li>
<li data-target="#carousel" data-slide-to="9">
</li>
<li data-target="#carousel" data-slide-to="10">
</li>
<li data-target="#carousel" data-slide-to="11">
</li>
<li data-target="#carousel" data-slide-to="12">
</li>
<li data-target="#carousel" data-slide-to="13">
</li>
<li data-target="#carousel" data-slide-to="14">
</li>
<li data-target="#carousel" data-slide-to="15">
</li>
</ol>
<!-- Wrapper for slides -->
<div class="carousel-inner">
<div class="item active">
<img src="https://zed0.co.uk/blog/assets/2011/12/IMG_2033-e1325303715286.jpg" alt="" />
</div>
<div class="item">
<img src="https://zed0.co.uk/blog/assets/2011/12/IMG_1989-e1325304474948.jpg" alt="" />
</div>
<div class="item">
<img src="https://zed0.co.uk/blog/assets/2011/12/IMG_1992-e1325304484828.jpg" alt="" />
</div>
<div class="item">
<img src="https://zed0.co.uk/blog/assets/2011/12/IMG_1944-e1325304442600.jpg" alt="" />
</div>
<div class="item">
<img src="https://zed0.co.uk/blog/assets/2011/12/IMG_1996-e1325304493879.jpg" alt="" />
</div>
<div class="item">
<img src="https://zed0.co.uk/blog/assets/2011/12/IMG_1942.jpg" alt="" />
</div>
<div class="item">
<img src="https://zed0.co.uk/blog/assets/2011/12/IMG_1928.jpg" alt="" />
</div>
<div class="item">
<img src="https://zed0.co.uk/blog/assets/2011/12/IMG_1964.jpg" alt="" />
</div>
<div class="item">
<img src="https://zed0.co.uk/blog/assets/2011/12/IMG_1931-e1325304363795.jpg" alt="" />
</div>
<div class="item">
<img src="https://zed0.co.uk/blog/assets/2011/12/IMG_1953-e1325304453157.jpg" alt="" />
</div>
<div class="item">
<img src="https://zed0.co.uk/blog/assets/2011/12/IMG_1962-e1325304463113.jpg" alt="" />
</div>
<div class="item">
<img src="https://zed0.co.uk/blog/assets/2011/12/IMG_1934-e1325304432129.jpg" alt="" />
</div>
<div class="item">
<img src="https://zed0.co.uk/blog/assets/2011/12/IMG_1948.jpg" alt="" />
</div>
<div class="item">
<img src="https://zed0.co.uk/blog/assets/2011/12/IMG_2012-e1325304504526.jpg" alt="" />
</div>
<div class="item">
<img src="https://zed0.co.uk/blog/assets/2011/12/IMG_2030-e1325304515160.jpg" alt="" />
</div>
<div class="item">
<img src="https://zed0.co.uk/blog/assets/2011/12/IMG_2046-e1325303681694.jpg" alt="" />
</div>
</div>
<!-- Controls -->
<a class="left carousel-control" href="#carousel" role="button" data-slide="prev">
<span class="icon-prev" aria-hidden="true"></span>
<span class="sr-only">Previous</span>
</a>
<a class="right carousel-control" href="#carousel" role="button" data-slide="next">
<span class="icon-next" aria-hidden="true"></span>
<span class="sr-only">Next</span>
</a>
</div>
<!--/Carousel -->
</div>zed0This is one of the pieces of Lego I made with the many sets I got for Christmas this year. I happened to notice that Classic-Castle.com was having a competition so I thought I’d give that a shot.Net2010-09-26T17:56:00+01:002010-09-26T17:56:00+01:00https://zed0.co.uk/blog/2010/09/26/net<p>While I was bored a few days ago I thought I’d have a look at how terminal based GUI applications work, as I was wanting to see the nitty gritty of it I decided that it would be more educational to work directly with ANSI codes.</p>
<p>The project I ended up with was writing a terminal based version of the game Netwalk, probably best known from <a href="http://www.chiark.greenend.org.uk/~sgtatham/puzzles/">Simon Tatham’s Portable Puzzle Collection</a>. This was inspired by playing around with the <a href="http://en.wikipedia.org/wiki/Box-drawing_characters">box drawing characters</a>, making a grid and thinking, “hey, that looks like Net!”</p>
<p>Thus, I have created a fairly simple version of the game, the source is on <a href="http://github.com/zed0/Netgame">my GitHub page</a>. If you want to try playing it then you can download it from there and compile it with g++. Alternatively if you have an account on codd (the Warwick compsoc server) then you can run it directly from /home/zed0/programming/net/netgame .</p>
<p>The game seems to run without issue through PuTTY, on the condition that you are using UTF-8. The only other configuration I’ve tried it with is Cygwin, which compiles and runs fine, however, assuming you’re using the default Cygwin terminal, you’ll need to change the font to one which has the box drawing characters.</p>
<p>As this was made in the space of a few hours there are quite a lot of improvements to be made.<br />
My current todo list includes:<br />
Adjusting the drawing methods so that it only updates the bits of the screen it needs to.<br />
Adding wrapping as the game is fairly trivial without it.<br />
Writing a better map generation algorithm.</p>
<p>On that last point I haven’t really got many ideas. Writing an algorithm to generate a tree which takes up the entire map is fairly trivial, however I have no idea how to ensure that the map has a unique solution which would be desirable. If any mathsy people know how to do this then please comment.</p>
<p>Feel free to suggest other features or <a href="http://github.com/zed0/Netgame/issues">report bugs</a>. Multiplayer has been suggested, which I may, at some point, try to implement.</p>zed0While I was bored a few days ago I thought I’d have a look at how terminal based GUI applications work, as I was wanting to see the nitty gritty of it I decided that it would be more educational to work directly with ANSI codes. The project I ended up with was writing a terminal based version of the game Netwalk, probably best known from Simon Tatham’s Portable Puzzle Collection. This was inspired by playing around with the box drawing characters, making a grid and thinking, “hey, that looks like Net!” Thus, I have created a fairly simple version of the game, the source is on my GitHub page. If you want to try playing it then you can download it from there and compile it with g++. Alternatively if you have an account on codd (the Warwick compsoc server) then you can run it directly from /home/zed0/programming/net/netgame . The game seems to run without issue through PuTTY, on the condition that you are using UTF-8. The only other configuration I’ve tried it with is Cygwin, which compiles and runs fine, however, assuming you’re using the default Cygwin terminal, you’ll need to change the font to one which has the box drawing characters. As this was made in the space of a few hours there are quite a lot of improvements to be made. My current todo list includes: Adjusting the drawing methods so that it only updates the bits of the screen it needs to. Adding wrapping as the game is fairly trivial without it. Writing a better map generation algorithm. On that last point I haven’t really got many ideas. Writing an algorithm to generate a tree which takes up the entire map is fairly trivial, however I have no idea how to ensure that the map has a unique solution which would be desirable. If any mathsy people know how to do this then please comment. Feel free to suggest other features or report bugs. Multiplayer has been suggested, which I may, at some point, try to implement.WPA Enterprise networks on rooted Android 1.62010-06-05T23:38:00+01:002010-06-05T23:38:00+01:00https://zed0.co.uk/blog/2010/06/05/wpa-enterprise-networks-on-rooted-android-1-6<p>So I spent a while in DCS (Department of Computer Science) today trying to get my phone to connect to the network.</p>
<p>For some reason on the Cyanogen ROM I’m using at the moment (I don’t know about the official 1.6 build) wireless certificates were failing to install properly. They appear to install fine, however the drop down for certificates still shows no entries when one tries to connect to a network.</p>
<p>The easiest solution (at least for users with root access) to this appears to be to transfer the certificates to ones SD card and then edit the file /data/misc/wifi/wpa_supplicant.conf to add a new network.
Assuming one is connecting to the wifi in DCS this looks something like this:</p>
<figure class="highlight"><pre><code class="language-bash" data-lang="bash"><table class="rouge-table"><tbody><tr><td class="gutter gl"><pre class="lineno">1
2
3
4
5
6
7
8
9
10
11
</pre></td><td class="code"><pre><span class="nv">network</span><span class="o">={</span>
<span class="nv">ssid</span><span class="o">=</span><span class="s2">"dcs_wl"</span>
<span class="nv">key_mgmt</span><span class="o">=</span>WPA-EAP
<span class="nv">group</span><span class="o">=</span>CCMP TKIP
<span class="nv">eap</span><span class="o">=</span>TLS
<span class="nv">identity</span><span class="o">=</span><span class="s2">"csuxxx"</span>
<span class="nv">ca_cert</span><span class="o">=</span><span class="s2">"/sdcard/root.der"</span>
<span class="nv">private_key</span><span class="o">=</span><span class="s2">"/sdcard/csuxxx.p12"</span>
<span class="nv">private_key_passwd</span><span class="o">=</span><span class="s2">"blah123BLAH"</span>
<span class="nv">priority</span><span class="o">=</span>11
<span class="o">}</span></pre></td></tr></tbody></table></code></pre></figure>
<p>If one tries to connect beforehand then there will already be an entry for dcs_wl which can be edited.</p>
<p>Voila, it now connects automatically.</p>
<p>From what <a href="http://blog.sinjakli.co.uk/">Chris Sinjakli</a> has said, he found connecting to the network significantly easier so it may well be that more recent ROMs don’t have this problem.</p>zed0So I spent a while in DCS (Department of Computer Science) today trying to get my phone to connect to the network.Easter Lego2010-05-23T23:54:00+01:002010-05-23T23:54:00+01:00https://zed0.co.uk/blog/2010/05/23/easter-lego<p>During the Easter holidays I found myself rather bored at points, thus, given the amount of Lego in my room, I did the only logical thing:</p>
<div class="col-lg-10 col-lg-offset-1 centered">
<div id="carousel" class="carousel slide" data-ride="carousel">
<!-- Indicators -->
<ol class="carousel-indicators">
<li data-target="#carousel" data-slide-to="0" class="active">
</li>
<li data-target="#carousel" data-slide-to="1">
</li>
<li data-target="#carousel" data-slide-to="2">
</li>
<li data-target="#carousel" data-slide-to="3">
</li>
<li data-target="#carousel" data-slide-to="4">
</li>
<li data-target="#carousel" data-slide-to="5">
</li>
<li data-target="#carousel" data-slide-to="6">
</li>
</ol>
<!-- Wrapper for slides -->
<div class="carousel-inner">
<div class="item active">
<img src="https://zed0.co.uk/blog/assets/2010/05/2010-05-23_23.27.37.jpg" alt="" />
</div>
<div class="item">
<img src="https://zed0.co.uk/blog/assets/2010/05/2010-05-23_23.35.04.jpg" alt="" />
</div>
<div class="item">
<img src="https://zed0.co.uk/blog/assets/2010/05/2010-05-23_23.26.03.jpg" alt="" />
</div>
<div class="item">
<img src="https://zed0.co.uk/blog/assets/2010/05/2010-05-23_23.28.28.jpg" alt="" />
</div>
<div class="item">
<img src="https://zed0.co.uk/blog/assets/2010/05/2010-05-23_23.34.18.jpg" alt="" />
</div>
<div class="item">
<img src="https://zed0.co.uk/blog/assets/2010/05/2010-05-23_23.33.55.jpg" alt="" />
</div>
<div class="item">
<img src="https://zed0.co.uk/blog/assets/2010/05/2010-05-23_23.31.08.jpg" alt="" />
</div>
</div>
<!-- Controls -->
<a class="left carousel-control" href="#carousel" role="button" data-slide="prev">
<span class="icon-prev" aria-hidden="true"></span>
<span class="sr-only">Previous</span>
</a>
<a class="right carousel-control" href="#carousel" role="button" data-slide="next">
<span class="icon-next" aria-hidden="true"></span>
<span class="sr-only">Next</span>
</a>
</div>
<!--/Carousel -->
</div>
<p>As usual sorry about the quality of the pictures, I’m terrible at keeping my hand steady for them.</p>
<p>I’m not sure what I was expecting when I started making this, it looks rather more like it’s from Bioshock than intended. I also didn’t expect it to be this yellow, but then realised I didn’t have enough dark grey pieces.
I have actually made quite a few Lego models over the last couple of years, I’ll probably blog about them too before too long.</p>zed0During the Easter holidays I found myself rather bored at points, thus, given the amount of Lego in my room, I did the only logical thing: Previous NextMinamicon Pictures2010-04-21T12:32:00+01:002010-04-21T12:32:00+01:00https://zed0.co.uk/blog/2010/04/21/minamicon-pictures<p>I went to <a href="http://www.minamicon.org.uk/">Minami Con</a> in Southampton last weekend which was a nice break before my term of horror.<br />
Here are a few photos (sorry about the quality, I can’t keep my hand steady while taking shots):</p>
<div class="col-lg-10 col-lg-offset-1 centered">
<div id="carousel" class="carousel slide" data-ride="carousel">
<!-- Indicators -->
<ol class="carousel-indicators">
<li data-target="#carousel" data-slide-to="0" class="active">
</li>
<li data-target="#carousel" data-slide-to="1">
</li>
<li data-target="#carousel" data-slide-to="2">
</li>
<li data-target="#carousel" data-slide-to="3">
</li>
<li data-target="#carousel" data-slide-to="4">
</li>
<li data-target="#carousel" data-slide-to="5">
</li>
<li data-target="#carousel" data-slide-to="6">
</li>
</ol>
<!-- Wrapper for slides -->
<div class="carousel-inner">
<div class="item active">
<img src="https://zed0.co.uk/blog/assets/2010/04/2010-04-17_11.51.38.jpg" alt="" />
</div>
<div class="item">
<img src="https://zed0.co.uk/blog/assets/2010/04/2010-04-17_11.58.24.jpg" alt="" />
</div>
<div class="item">
<img src="https://zed0.co.uk/blog/assets/2010/04/2010-04-17_15.46.55.jpg" alt="" />
</div>
<div class="item">
<img src="https://zed0.co.uk/blog/assets/2010/04/2010-04-17_16.26.42.jpg" alt="" />
</div>
<div class="item">
<img src="https://zed0.co.uk/blog/assets/2010/04/2010-04-17_23.09.35.jpg" alt="" />
</div>
<div class="item">
<img src="https://zed0.co.uk/blog/assets/2010/04/2010-04-18_09.46.44.jpg" alt="" />
</div>
<div class="item">
<img src="https://zed0.co.uk/blog/assets/2010/04/2010-04-18_19.43.47.jpg" alt="" />
</div>
</div>
<!-- Controls -->
<a class="left carousel-control" href="#carousel" role="button" data-slide="prev">
<span class="icon-prev" aria-hidden="true"></span>
<span class="sr-only">Previous</span>
</a>
<a class="right carousel-control" href="#carousel" role="button" data-slide="next">
<span class="icon-next" aria-hidden="true"></span>
<span class="sr-only">Next</span>
</a>
</div>
<!--/Carousel -->
</div>
<p>If you want more pictures then there are quite a few <a href="http://www.facebook.com/album.php?id=1051253988&aid=2052733">here on Facebook</a>.</p>zed0I went to Minami Con in Southampton last weekend which was a nice break before my term of horror. Here are a few photos (sorry about the quality, I can’t keep my hand steady while taking shots): Previous NextTethering on Debian2010-04-13T03:11:00+01:002010-04-13T03:11:00+01:00https://zed0.co.uk/blog/2010/04/13/tethering-on-debian<p>Rooting an android phone allows one to use several methods of tethering (using the phone’s internet on another device) including USB, bluetooth and wifi.
I have only tried wifi tethering and USB tethering so far but I imagine I will get round to trying bluetooth sometime.</p>
<p>Wifi tethering is simple, if your phone is rooted then you can simply get <a href="http://code.google.com/p/android-wifi-tether/">android-wifi-tether</a> , open the application and touch the icon in the centre of the screen, this will create a wireless access point which you can then connect to with your laptop. I had no problems at all with this using Debian lenny. There are various options for access control and encryption and it works fairly well. The main downside to this method is that it uses a horrific amount of power, meaning I usually need my phone plugged in anyway.</p>
<p>USB tethering is provided with <a href="http://www.cyanogenmod.com/">CyanogenMod</a> and many other popular roms and is in most respects better than wifi tethering if you have a USB cable. To start tethering just turn on USB tethering in Settings > Wireless controls > Internet tethering. Connect the laptop via USB cable and depending on what OS you are using it may just work or it may take some setup.
I haven’t tried Windows XP but I believe that you can just install either the android SDK or a separate RNDIS driver, apparently later versions of windows come with this.
I have heard many people say that it just works with Ubuntu, however with Debian I couldn’t find any packaged drivers but found that the RNDIS drivers from <a href="http://www.synce.org/moin/">SynCE</a> worked fine
Download <a href="http://downloads.sourceforge.net/synce/usb-rndis-lite-0.11.tar.gz">http://downloads.sourceforge.net/synce/usb-rndis-lite-0.11.tar.gz
</a></p>
<figure class="highlight"><pre><code class="language-bash" data-lang="bash"><table class="rouge-table"><tbody><tr><td class="gutter gl"><pre class="lineno">1
2
3
4
5
</pre></td><td class="code"><pre><span class="nb">tar</span> <span class="nt">-xvzf</span> usb-rndis-lite-0.11.tar.gz
<span class="nb">cd </span>usb-rndis-lite-0.11/
make
<span class="nb">sudo</span> ./clean.sh
<span class="nb">sudo </span>make install</pre></td></tr></tbody></table></code></pre></figure>
<p>I found that network-manager picked it up immediately, though if you don’t use network-manager you may need to do:</p>
<figure class="highlight"><pre><code class="language-bash" data-lang="bash"><table class="rouge-table"><tbody><tr><td class="gutter gl"><pre class="lineno">1
</pre></td><td class="code"><pre>ifup rndis0</pre></td></tr></tbody></table></code></pre></figure>
<p>I’m looking forward to trying this out for a longer duration on my 7 hour train trip back to Warwick on Wednesday.</p>zed0Rooting an android phone allows one to use several methods of tethering (using the phone’s internet on another device) including USB, bluetooth and wifi. I have only tried wifi tethering and USB tethering so far but I imagine I will get round to trying bluetooth sometime.Installing Debian on a G1 (HTC Dream)2010-04-09T03:32:00+01:002010-04-09T03:32:00+01:00https://zed0.co.uk/blog/2010/04/09/installing-debian-on-a-g1-htc-dream<p>I bought a G1 in November having heard good reviews of them from the few people I knew who owned one and pleasantly surprised at how easy it was to type on the keyboard, which was the main problem I had had with iPhones.</p>
<p>Anyway, I haven’t really done much messing with it until the last couple of weeks when I discovered myself very bored while at home for the Easter break. Having heard it was possible a while ago I started off by rooting the phone and installing <a href="http://www.cyanogenmod.com/">CyanogenMod</a> (<a href="http://wiki.cyanogenmod.com/index.php/Full_Update_Guide_-_G1/Dream_Firmware_to_CyanogenMod">instructions here for those of you who want to try it</a>), a replacement for the default Android installation, adding a features that haven’t been pushed down the line by vendors yet and a few extras such as the ability to store apps on the SD card, USB tethering and various Unix commands.</p>
<p>Having rooted the phone I was curious as to what I could now do and found it mentioned that it was possible to install Debian in a chroot since it already supports ARM EABI. I partially followed <a href="http://www.saurik.com/id/10">this post by saurik</a> but came across several issues and shortcuts due to using CyanogenMod.</p>
<p>Here are some brief instructions to get Debian working on CyanogenMod:</p>
<p>Making a Debian image
To avoid having to partition my SD card (I use it for various other things) I created a mountable image as follows (assuming you are running Debian on your computer too), to avoid confusion I also add an sdcard directory here that the sdcard will later be mounted in:</p>
<figure class="highlight"><pre><code class="language-bash" data-lang="bash"><table class="rouge-table"><tbody><tr><td class="gutter gl"><pre class="lineno">1
2
3
4
5
6
7
</pre></td><td class="code"><pre>apt-get install debootstrap
dd <span class="k">if</span><span class="o">=</span>/dev/zero <span class="nv">of</span><span class="o">=</span>debian.img <span class="nv">seek</span><span class="o">=</span>749999999 <span class="nv">bs</span><span class="o">=</span>1 <span class="nv">count</span><span class="o">=</span>1
mke2fs <span class="nt">-F</span> debian.img
mkdir debian
mount <span class="nt">-o</span> loop debian.img debian debootstrap <span class="nt">--verbose</span> <span class="nt">--arch</span> armel <span class="nt">--foreign</span> lenny debian http://ftp.de.debian.org/debian
mkdir debian/sdcard
umount debian</pre></td></tr></tbody></table></code></pre></figure>
<p>As CyanogenMod comes with the Linux filesystem drivers and busybox you don’t need to worry about adding them which means a large portion of saurik’s instructions can be skipped.
Mounting the Image
Mounting the loop device caused some problems but I eventually found that it was looking for the loop devices at /dev/block/loop* rather than /dev/loop* which was fixed by adding a few ifs to the start of the mounting script.</p>
<figure class="highlight"><pre><code class="language-bash" data-lang="bash"><table class="rouge-table"><tbody><tr><td class="gutter gl"><pre class="lineno">1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
</pre></td><td class="code"><pre><span class="c">#!/system/bin/sh</span>
<span class="k">if</span> <span class="o">[</span> <span class="o">!</span> <span class="nt">-e</span> /dev/loop0 <span class="o">]</span>
<span class="k">then
</span>ln /dev/block/loop0 /dev/loop0
<span class="k">fi
if</span> <span class="o">[</span> <span class="o">!</span> <span class="nt">-e</span> /dev/loop1 <span class="o">]</span>
<span class="k">then
</span>ln /dev/block/loop1 /dev/loop1
<span class="k">fi
if</span> <span class="o">[</span> <span class="o">!</span> <span class="nt">-e</span> /dev/loop2 <span class="o">]</span>
<span class="k">then
</span>ln /dev/block/loop2 /dev/loop2
<span class="k">fi
if</span> <span class="o">[</span> <span class="o">!</span> <span class="nt">-e</span> /dev/loop3 <span class="o">]</span>
<span class="k">then
</span>ln /dev/block/loop3 /dev/loop3
<span class="k">fi
if</span> <span class="o">[</span> <span class="o">!</span> <span class="nt">-e</span> /dev/loop4 <span class="o">]</span>
<span class="k">then
</span>ln /dev/block/loop4 /dev/loop4
<span class="k">fi
if</span> <span class="o">[</span> <span class="o">!</span> <span class="nt">-e</span> /dev/loop5 <span class="o">]</span>
<span class="k">then
</span>ln /dev/block/loop5 /dev/loop5
<span class="k">fi
if</span> <span class="o">[</span> <span class="o">!</span> <span class="nt">-e</span> /dev/loop6 <span class="o">]</span>
<span class="k">then
</span>ln /dev/block/loop6 /dev/loop6
<span class="k">fi
if</span> <span class="o">[</span> <span class="o">!</span> <span class="nt">-e</span> /dev/loop7 <span class="o">]</span>
<span class="k">then
</span>ln /dev/block/loop7 /dev/loop7
<span class="k">fi
</span>mount <span class="nt">-o</span> loop,noatime <span class="nt">-t</span> ext2 /sdcard/debian/debian.img /data/local/debian/mnt
busybox mount <span class="nt">-o</span> <span class="nb">bind</span> /sdcard /data/local/debian/mnt/sdcard
<span class="nb">export </span><span class="nv">PATH</span><span class="o">=</span>/usr/bin:/usr/sbin:/bin:<span class="nv">$PATH</span>
<span class="nb">export </span><span class="nv">TERM</span><span class="o">=</span>linux
<span class="nb">export </span><span class="nv">HOME</span><span class="o">=</span>/root
<span class="nb">export </span><span class="nv">USER</span><span class="o">=</span>root
busybox mount <span class="nt">-t</span> proc none /data/local/debian/mnt/proc
busybox mount <span class="nt">-t</span> sysfs sysfs /data/local/debian/mnt/sys
busybox mount <span class="nt">-t</span> devpts devpts /data/local/debian/mnt/dev/pts
<span class="k">if</span> <span class="o">[</span> <span class="o">!</span> <span class="nt">-e</span> /data/local/debian/installed <span class="o">]</span>
<span class="k">then
</span>busybox chroot /data/local/debian/mnt/ /debootstrap/debootstrap <span class="nt">--second-stage</span>
touch /data/local/debian/installed
<span class="k">fi</span></pre></td></tr></tbody></table></code></pre></figure>
<p>I saved this script as mountdeb.sh and the debian.img file in a folder called “debian” at the root of the SD card and mounted it on my G1 again.
I used a terminal emulator (search Market for Terminal Emulator by ZTA Technologies). First to enable things like tab completion and command history I changed the initial command (done through the menu in the Terminal) to:</p>
<figure class="highlight"><pre><code class="language-bash" data-lang="bash"><table class="rouge-table"><tbody><tr><td class="gutter gl"><pre class="lineno">1
</pre></td><td class="code"><pre>su <span class="nt">-c</span> &quot<span class="p">;</span>busybox sh&quot<span class="p">;</span></pre></td></tr></tbody></table></code></pre></figure>
<p>which nicely drops you in busybox as root instead of the poor implementation of sh that android comes with by default.</p>
<p>Running:</p>
<figure class="highlight"><pre><code class="language-bash" data-lang="bash"><table class="rouge-table"><tbody><tr><td class="gutter gl"><pre class="lineno">1
2
</pre></td><td class="code"><pre>/sdcard/debian/mountdeb.sh
chroot /data/local/debian/mnt/ /bin/bash</pre></td></tr></tbody></table></code></pre></figure>
<p>drops you into bash in your shiny new Debian installation from which you can use apt-get to install whatever you feel like.</p>
<p>Automating the Installation
Since I didn’t want to have to type the above into the phone every time I wanted to use Debian on my phone and I also much preferred being able to use <a href="http://code.google.com/p/connectbot/">ConnectBot</a> to access it I automated starting it as follows:</p>
<p>First I installed the dropbear ssh server onto the Debian install:</p>
<figure class="highlight"><pre><code class="language-bash" data-lang="bash"><table class="rouge-table"><tbody><tr><td class="gutter gl"><pre class="lineno">1
</pre></td><td class="code"><pre>apt-get install dropbear</pre></td></tr></tbody></table></code></pre></figure>
<p>This allowed me to either ssh to localhost from the phone or ssh in from my computer, which I was quite glad of after typing on the small keyboard for a while. Next to automate it.</p>
<p>Cyanogenmod provides facilities for auto running scripts using /etc/init.d/ however these all get run before android mounts /sdcard which means that we can’t run our script at this point unless we mount /sdcard ourselves (which does work but it means that none of the applications on the phone will be able to access /sdcard (I think there may be a way to change this by messing around with permissions but I haven’t tried it yet)).</p>
<p>Since init.d ran things too early I found an autorun application called Phone Prioritizer (<a href="http://forum.xda-developers.com/showthread.php?t=558822">available here</a> (put the .apk in the attached zip on your SD card and open it with the package installer. Unfortunately you have to register on the XDA forums to get it), not on Market for some reason) which allows a script to be executed once the system has started up (Broadcast the BOOT_COMPLETED intent), it also had some options for running cron like scripts but I disabled these for the moment. To start the Debian chroot I edited /sdcard/phonePrioritizer/afterboot.txt (the file it checks after booting) to read:</p>
<figure class="highlight"><pre><code class="language-bash" data-lang="bash"><table class="rouge-table"><tbody><tr><td class="gutter gl"><pre class="lineno">1
2
</pre></td><td class="code"><pre>busybox sh /sdcard/debian/mountdeb.sh
busybox chroot /data/local/debian/mnt/ /usr/sbin/dropbear</pre></td></tr></tbody></table></code></pre></figure>
<p>Rebooting the phone I found I could immediately ssh in using ConnectBot on the phone. Some simple certificate setup later and I didn’t even need to type in a password from the phone to itself. :)</p>
<p>If anyone tries to follow these instructions let me know if you have any problems.</p>zed0I bought a G1 in November having heard good reviews of them from the few people I knew who owned one and pleasantly surprised at how easy it was to type on the keyboard, which was the main problem I had had with iPhones.