Blogish - Tom O'Connor http://tomoconnor.eu/blogish/ Blogish. It's a bit like a blog. That DMG ate my System Preferences http://tomoconnor.eu/blogish/dmg-ate-my-system-preferences <p>&nbsp;</p> <p>Well, that's certainly another strange problem.</p> <p>We have a tendency to build our own DMG images for certain bits of software we roll out here. &nbsp;Sometimes we'll incorporate our own patches, other times it's just to make the application structure more FHS compliant, and stop it "<em>shitting all over the filesystem</em>", as we so charmingly term it.</p> <p>In the past, we've used InstallEase to build a DMG and PKG installer for OSX. &nbsp;It's been pretty good up until last week, when one of our engineers built a PKG that had a nasty side effect of destroying the System Preferences once installed. &nbsp;We initially pegged this as "another weird thing about Lion", and rebuilt the image, and so on. &nbsp;</p> <p>We tested the installation again on a different computer, all the time using Munki for package deployment. &nbsp;</p> <p>These are the important test findings:&nbsp;</p> <p><strong>1) </strong>If you install the package interactively, it's fine.</p> <p><strong>2) </strong>If you install the older version, it's fine.</p> <p><strong>3) </strong>If you install the new version with munki, it breaks everything.</p> <p><strong>4) </strong>If you install anything else with munki, it's also fine.</p> <p>That points to a clear difference between installing Interactively (with a person doing it) and an automated deployment with Munki.</p> <p>I actually had a look at the package today, and gave it a <strong><em>good hard poking</em></strong>. &nbsp;I found 2 really rather worrying things.</p> <p><strong>1) </strong>Inside the Resources directory, there's an Universal Binary called DeleteObjectHelper (Not off to a good start here..), and a file called DeleteObjectList.plist</p> <p>DeleteObjectList contains:</p> <pre>&lt;?xml version="1.0" encoding="UTF-8"?&gt;<br />&lt;!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"&gt;<br />&lt;plist version="1.0"&gt;<br />&lt;dict&gt;<br /><span style="white-space: pre;"> </span>&lt;key&gt;objectList&lt;/key&gt;<br /><span style="white-space: pre;"> </span>&lt;array&gt;<br /><span style="white-space: pre;"> </span>&lt;dict&gt;<br /><span style="white-space: pre;"> </span>&lt;key&gt;filePath&lt;/key&gt;<br /><span style="white-space: pre;"> </span>&lt;string&gt;Library/Preferences&lt;/string&gt;<br /><span style="white-space: pre;"> </span>&lt;/dict&gt;<br /><span style="white-space: pre;"> </span>&lt;dict&gt;<br /><span style="white-space: pre;"> </span>&lt;key&gt;filePath&lt;/key&gt;<br /><span style="white-space: pre;"> </span>&lt;string&gt;Library/Receipts&lt;/string&gt;<br /><span style="white-space: pre;"> </span>&lt;/dict&gt;<br /><span style="white-space: pre;"> </span>&lt;/array&gt;<br />&lt;/dict&gt;<br />&lt;/plist&gt;</pre> <p><strong>2) </strong>Inside the postflight (think postinst for debian) file was the following:</p> <pre>#!/bin/bash<br />"$1/Contents/Resources/DeleteObjectHelper" "$1/Contents/Resources/DeleteObjectList.plist" "$HOME" "$3"</pre> <p>So here's what happens if you install it by hand. &nbsp;Postflight runs after installation, and replaces $HOME with /Users/YourName. &nbsp;DeleteObjectHelper goes off and deletes the files in ~/Library. &nbsp;I assume this is to delete older versions, or something similar.</p> <p>I suspect that if you run it non-interactively, with munki, then it might run as root. &nbsp;It might also not have the environment that you'd expect as an interactive user. That means that if $HOME was '/', or nonexistant, it might default to '/'. &nbsp;</p> <p><strong>Very Bad Indeed.</strong></p> <p>The pointer to all of this was something system.log complaining about Preferences files being missing, when trying to authenticate to our wireless. &nbsp;I've worked with *nix systems long enough to pretty much start looking in /var/log/(syslog|messages|system.log) as a matter of principal.</p> <p>So, for whatever reason, the process that builds the package is incorporating a thing for cleaning up after itself. &nbsp;Not a bad thing, but it does have a fantastic bug in it that seems to make it delete the System Preferences if it can't find $HOME. &nbsp;As it's running as root (or whomever powerful), it just goes ahead and deletes everything it can find.</p> <p>The questions that remain on my mind are these:</p> <p><strong>1) </strong>Why did it put that in there anyway, as none of our other hand-rolled packages have it.</p> <p><strong>2) </strong>Can we build PKG and DMG files with some kind of GNU toolchain on our Jenkins environment to stop this nonsense from happening again (We know exactly how the build process works, etc..)</p> <p><strong>3) </strong>What on *earth* went through those developer's minds when they wrote that Evil Little Binary?</p> <p>&nbsp;</p> Puppet, Apt and our very own Thundering Herd http://tomoconnor.eu/blogish/puppet-apt-and-our-very-own-thundering-herd <p>&nbsp;</p> <p>Puppet really is great. &nbsp;Don't ever get me wrong there. &nbsp;It's saved me masses of time and money over the last few years, and allowed me to do my job quickly and efficiently. &nbsp;</p> <p>That said, it really does have issues with scalability. &nbsp;After about 20-30 clients using WEBBrick, everything kinda falls over a bit.</p> <p>We had this problem at Baseblack. &nbsp;We've now got ~60 workstations and rendernodes all using Puppet for configuration management and software deployment. &nbsp;It's great. &nbsp;It far simplifies the process of rolling out updates and upgrades to new build machines. &nbsp;</p> <p>The problem we had was most clearly shown by the frequency with which the PSON error comes up.</p> <pre>"err: Could not retrieve catalog from remote server: Could not intern from pson: Could not convert from pson:"</pre> <p>And so on. &nbsp;</p> <p>This was always a transient error, and would go away if you ran puppet 2-3, or more times, and then it'd work fine. &nbsp;This isn't really a valid long-term solution. &nbsp;It's alright now and again, but it brings up a problem of reliability, and "how do you know when it's last run, if it can't be guaranteed to run every time".</p> <p>I wrote a dirty wrapperscript that would re-run it if it failed, and so on. &nbsp;This kinda worked a bit better, but sometimes, stuff would just not run anyway. &nbsp;</p> <p>So today, I'd had enough of this problem, and decided to do the Apache2/Mod_passenger thing. &nbsp;Back in the days of Puppet 0.24/0.25x this was a bit more of a pain in the arse than it seems to be now. &nbsp;Back then, the server of choice was Mongrel, now it's Passenger/mod_rack.</p> <p>Just follow this guide:&nbsp;<a href="http://docs.puppetlabs.com/guides/passenger.html">http://docs.puppetlabs.com/guides/passenger.html</a></p> <p>It's actually a pretty good explanation of the steps, and I don't see any need to replicate the information here. &nbsp;I made a couple of slight modifications. &nbsp;</p> <p><ol> <li>The config.ru file is horribly outdated in the given form, and I used this one instead: https://github.com/puppetlabs/puppet/blob/master/ext/rack/files/config.ru</li> <li>I changed the apache2 defaults for mpm_worker so that it could handle a shitload more requests than the default.&nbsp;</li> </ol></p> <p>Incidentally, this <a href="http://forum.linode.com/viewtopic.php?t=7622">thing is cool</a>. &nbsp;Some guy's written an insanely simple "calculator" spreadsheet for OpenOffice and Excel that allows you to calculate decent settings for MaxClients.</p> <p>&nbsp;</p> <pre>&lt;IfModule mpm_worker_module&gt;<br />ServerLimit 150<br />StartServers &nbsp; &nbsp; &nbsp; 5<br />MinSpareThreads &nbsp; &nbsp;5<br />MaxSpareThreads &nbsp; &nbsp;10<br />&nbsp; &nbsp; ThreadLimit &nbsp; &nbsp; &nbsp; &nbsp; 5&nbsp;<br />&nbsp; &nbsp; ThreadsPerChild &nbsp; &nbsp; &nbsp;5<br />MaxClients &nbsp; &nbsp; &nbsp; &nbsp;750<br />&nbsp; &nbsp; MaxRequestsPerChild &nbsp; 0<br />&lt;/IfModule&gt;</pre> <p>I wanted to be able to handle our own thundering herd of workstations and rendernodes, so that meant that the default ServerLimit had to go, and that it had to be able to handle *many* more threads than the default.</p> <p>I also moved the puppetmasterd "application" from /usr/share/puppet to /srv/puppet because in my mind (and the FHS), it makes more sense.</p> <p>There's a bit of a caveat in the process of moving that directory, in that wherever it is, it must be chowned puppet:puppet. &nbsp;After that, it's all fine.</p> <p>The problems really started for us after that. &nbsp;It worked fine with one workstation testing it, but throw 2+ at passenger, and apache tended to kill off the ruby children.&nbsp;</p> <p>The big hint was in /var/log/apache2/error.log:&nbsp;</p> <pre>[Tue Feb 21 15:50:12 2012] [alert] (11)Resource temporarily unavailable: apr_thread_create: unable to create worker thread<br /><br />[Tue Feb 21 15:50:15 2012] [error] (12)Cannot allocate memory: fork: Unable to fork new process</pre> <p>So, our puppetmaster runs on Proxmox as a VM. &nbsp;Proxmox is an OpenVZ virtualisation host, and as a result, it has hardlimits based around the content of /proc/user_beancounters. &nbsp;This is the thing that's basically stopping Apache from spawning threads to handle the requests.</p> <p>There's a&nbsp;<a href="http://blog.eukhost.com/webhosting/how-to-remove-openvz-limits-on-a-vps/">page here</a> about how to remove OpenVZ's limits:&nbsp;</p> <pre>clear; cat /proc/user_beancounters<br />vzctl set 101 &ndash;tcpsndbuf 999999999:999999999 &ndash;save<br />vzctl set 101 &ndash;tcprcvbuf 999999999:999999999 &ndash;save<br />vzctl set 101 &ndash;numtcpsock 999999999:999999999 &ndash;save<br />vzctl set 101 &ndash;numflock 999999999:999999999 &ndash;save<br />vzctl set 101 &ndash;othersockbuf 999999999:999999999 &ndash;save<br />vzctl set 101 &ndash;numothersock 999999999:999999999 &ndash;save<br />vzctl set 101 &ndash;numfile 999999999:999999999 &ndash;save<br />vzctl restart 101</pre> <p>Where 101 is the #id of your VZ container. &nbsp;</p> <p>I also had to bump the allocated memory up from 512M to 2GB, and push the swap (and why not) up to 1GB. &nbsp;</p> <p>After a quick restart of the Puppet container, and restarting apache one last time, I sucessfully ran 56 puppetd. &nbsp;One on each of the nodes, all at once, without a single error.</p> <p>Sounds like success to me.</p> <p>--</p> <p>The next problem we've got that's currently holding back speedy software deployments, and apt-updates, is our apt-cacher-ng server. &nbsp;That too is a Proxmox VM, and I initially thought that the same problems might be true, with having a connection limit on OpenVZ, which would be preventing stuff from getting a connection. &nbsp;</p> <p>If I run apt-get update on 50+ nodes simultaneously, the probability that some of them will error, something about connection to http://apt failing, is pretty close to P(1).</p> <pre>W: Failed to fetch http://ppa.launchpad.net/ubuntu-x-swat/x-updates/ubuntu/dists/lucid/main/binary-amd64/Packages.gz &nbsp;Unable to connect to apt:3142:<br />W: Failed to fetch http://ppa.launchpad.net/webupd8team/java/ubuntu/dists/lucid/main/binary-amd64/Packages.gz &nbsp;Unable to connect to apt:3142:<br />E: Some index files failed to download, they have been ignored, or old ones used instead.</pre> <p>The 3142 bit is because we've got apt-cacher-ng running on port 3142, and a line in /etc/apt/apt.conf.d/ containing</p> <pre>Acquire::http { Proxy "http://apt:3142"; };</pre> <p>This is the most fool-proof way to make sure that *everything* gets cached, PPAs, and the whole kitchen sink. &nbsp;This is what we want to do, because having a full debmirror is a) wasteful of disk space, something we're always at a premium with, working in VFX, and also, disk space is expensive; especially after the Thailand floods.</p> <p>So, we're using apt-cacher-ng, and I don't personally see that changing anytime soon.&nbsp;</p> <p>Right. &nbsp;So I bumped up the limits in openVZ's configuration, and there's still a problem that means that the apt requests aren't getting handled.</p> <p>I suspect that because Apt's protocol is just HTTP, that it might be possible to use something like Varnish or HAProxy and a bunch of apt-cacher-ng backends. &nbsp;</p> <p>It doesn't appear that apt-cacher-ng can run with multiple threads for handling lots more requests/second.&nbsp;</p> <pre>root@apt:/# netstat -anp|grep 3142|wc -l<br />2964</pre> <p>Yah.. That could be a problem.</p> <p>That said, I've just tested hammering it with ab as follows:</p> <pre>tom.oconnor@charcoal-black:~$ ab -n25000 -c550 -X apt:3142 &nbsp;http://ppa.launchpad.net/mozillateam/firefox-stable/ubuntu/dists/lucid/main/binary-amd64/Packages.gz<br />This is ApacheBench, Version 2.3 &lt;$Revision: 655654 $&gt;<br />Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/<br />Licensed to The Apache Software Foundation, http://www.apache.org/<br />Benchmarking ppa.launchpad.net [through apt:3142] (be patient)<br />Completed 2500 requests<br />...<br />Finished 25000 requests<br /><br />Server Software: &nbsp; &nbsp; &nbsp; &nbsp;Debian<br />Server Hostname: &nbsp; &nbsp; &nbsp; &nbsp;ppa.launchpad.net<br />Server Port: &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;80<br />Document Path: &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;/mozillateam/firefox-stable/ubuntu/dists/lucid/main/binary-amd64/Packages.gz<br />Document Length: &nbsp; &nbsp; &nbsp; &nbsp;420 bytes<br />Concurrency Level: &nbsp; &nbsp; &nbsp;550<br />Time taken for tests: &nbsp; 3.127 seconds<br />Complete requests: &nbsp; &nbsp; &nbsp;25000<br />Failed requests: &nbsp; &nbsp; &nbsp; &nbsp;0<br />Write errors: &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 0<br />Non-2xx responses: &nbsp; &nbsp; &nbsp;25018<br />Total transferred: &nbsp; &nbsp; &nbsp;20990102 bytes<br />HTML transferred: &nbsp; &nbsp; &nbsp; 10507560 bytes<br />Requests per second: &nbsp; &nbsp;7994.07 [#/sec] (mean)<br />Time per request: &nbsp; &nbsp; &nbsp; 68.801 [ms] (mean)<br />Time per request: &nbsp; &nbsp; &nbsp; 0.125 [ms] (mean, across all concurrent requests)<br />Transfer rate: &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;6554.54 [Kbytes/sec] received<br />Connection Times (ms)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; min &nbsp;mean[+/-sd] median &nbsp; max<br />Connect: &nbsp; &nbsp; &nbsp; &nbsp;0 &nbsp; 16 208.9 &nbsp; &nbsp; &nbsp;1 &nbsp; &nbsp;3002<br />Processing: &nbsp; &nbsp; 1 &nbsp; 19 &nbsp;97.9 &nbsp; &nbsp; &nbsp;9 &nbsp; &nbsp;1478<br />Waiting: &nbsp; &nbsp; &nbsp; &nbsp;1 &nbsp; 19 &nbsp;97.9 &nbsp; &nbsp; &nbsp;9 &nbsp; &nbsp;1477<br />Total: &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;4 &nbsp; 35 230.9 &nbsp; &nbsp; 10 &nbsp; &nbsp;3023<br />Percentage of the requests served within a certain time (ms)<br />&nbsp; 50% &nbsp; &nbsp; 10<br />&nbsp; 66% &nbsp; &nbsp; 12<br />&nbsp; 75% &nbsp; &nbsp; 13<br />&nbsp; 80% &nbsp; &nbsp; 13<br />&nbsp; 90% &nbsp; &nbsp; 16<br />&nbsp; 95% &nbsp; &nbsp; 20<br />&nbsp; 98% &nbsp; &nbsp;128<br />&nbsp; 99% &nbsp; 1056<br />&nbsp;100% &nbsp; 3023 (longest request)</pre> <p>&nbsp;</p> <p>25k requests, at 550 concurrency, and I still can't make it return errors.</p> <p>So it looks like the problem isn't with serving files from the cache, it's downloading new stuff at the same time, and serving simultaneously. &nbsp;</p> <p>So it's blocking. &nbsp;Well that's an epic stack o' fail.</p> <p>Here's some <a href="http://awaseconfigurations.wordpress.com/2011/11/13/problems-with-apt-cacher-ng-and-parallel-fabric-execution-or-the-crash-of-the-cacher/">more evidence</a> to back up my findings. &nbsp;They're using Squid.&nbsp;</p> <p>They're also using Fabric for orchestration. &nbsp;Intriguing.</p> <p>&nbsp;</p> <p>&nbsp;</p> <p>More here on this one later on.. When I've actually figured it out.</p> Not Storing Files In A Database http://tomoconnor.eu/blogish/not-storing-files-database <p> <p>Originally a comment here <a href="http://creativedev.in/2012/01/storing-a-file-in-database/">http://creativedev.in/2012/01/storing-a-file-in-database/</a></p> <p>In the above article, Bhumi gives a method for storing files *in* the database, using MySQL and PHP.</p> <p>My personal distaste for PHP aside, I don't think I could ever find a reason to store files *in* the database, rather than *on* the filesystem.</p> <p>I'm also primarily talking about RDBMS type databases, not NoSQL, which tend to have a mechanism for storing files a little bit more sanely than "old-fashioned" databases.</p> <p>Let's take a look at this idea in a bit more depth.</p> <p>If you read the original article, there's the very basic bare bones of a web application. &nbsp;There's a form. &nbsp;There's a MySQL table definition. &nbsp;There's a bit of PHP for handling uploaded files.</p> <p>Personally, I write pretty much exclusively in Python. &nbsp;This isn't going to be a technical article with codesamples however, more just a look at comparing the methodologies of storing in a database to storing in a filesystem.</p> <p><strong>Why would you choose a BLOB database type over a Filesystem? &nbsp;</strong></p> <p>I think there's gotta be about one use-case for storing files in a database. &nbsp;Hang on. &nbsp;I take that back. &nbsp;There aren't any.</p> <p>Filesystems are optimised for File Access. &nbsp;Databases are best optimised for row/column based tabular data access. &nbsp;The two should not be confused.</p> <p>Here's how I store uploaded files: &nbsp;</p> <p><strong>1)</strong> Upload the file to .../uploaded_files/...</p> <p><strong>2)</strong>&nbsp;Rename it to something sensible. &nbsp;</p> <p><strong>3)</strong> In the database, store the original filename, and the path to the uploaded file. &nbsp;</p> <p><strong>3a)</strong> Possibly also store some neat metadata, call magic() on it, store the size, the MD5Sum, and so on. &nbsp;</p> <p>It greatly depends on the application, but it's conceivable that some of the file metadata might need to be retrieved in the file's lifespan within the application. &nbsp;It's a lot quicker to stat the file once, and store the result, than it would be to stat it many times whenever the information is requested.</p> <p>This makes a few drastic differences to database-based file storage.</p> <p><strong>1)</strong> The database contains data of a predictable size. &nbsp;I mean, it's easier to calculate and predict the size of the Table based on the known bit-widths for each column. &nbsp;Once you start introducing BLOBs into your database, all bets for size are off.</p> <p><strong>2)</strong> Database Backups are smaller. - Not having arbitrary binary data in your database means that gzipping a SQL dump is likely to be more deterministic than it would if you already had gzipped (for example) binary data stored as a BLOB. &nbsp;<br />When you attempt to compress already compressed data, the output is frequently larger.</p> <p><strong>3)</strong> You can scale easier by having a shared/clustered filesystem, such as Gluster.</p> <p><strong>4)</strong> If it's a website, loading files can happen externally of your webapp, simply have a media subdomain and handle files with a lightweight webserver such as LigHTTP or Nginx.</p> <p>This means that your webapplication isn't a bottleneck for loading every damn file that's requested, into memory, stripping the slashes or base64_decoding it, before streaming it back to the user.&nbsp;</p> <p>This is actually one of the most important points. &nbsp;If the data is stored in a proprietary format in the database, you can't use regular filesystem utilities to access it. &nbsp;You need to do all that in your application.&nbsp;</p> <p><strong>Why reinvent so many wheels when the OS-provided Filesystem tools are all so outstanding?</strong></p> <p>How would you stat the file inside a database? Write it out to /tmp/tmpXXXXX and then stat that, before deleting the temporary file?</p> <p>Sounds a bit slow, to me.</p> <p>What if the file is Huge? How long could that take? What if the uploaded file is bigger than your system RAM? Surely it'd make sense to be able to handle multiple large files...</p> <p>What if your application breaks? Could it silently corrupt files on their way in / out? What if Something Bad Happens, and your database is partially corrupted. &nbsp;Would all the files potentially be corrupted? What about recovery on a non-application-serving system. &nbsp;Could be tricky potentially.. &nbsp;Certainly more tricky than just rsyncing files around.</p> <p>See what I mean? &nbsp;</p> <p>You *can* store files in a database. &nbsp;</p> <p>Doesn't mean you should.</p> </p> Building updated packages for sun-java6 6u30 http://tomoconnor.eu/blogish/building-updated-packages-sun-java6-6u30 <p>Firstly, welcome back.</p> <p>It's now 2012, and there's lots more to write about.</p> <p>&nbsp;</p> <p>Recently, Oracle withdrew the ability for Linux distributions to repackage Java and distribute their own packages. &nbsp;This has been widely regarded as a bad idea. &nbsp;I tend to agree.</p> <p>So, let's re-roll an old sun-java6 deb file, with a new content to contain the latest 6u30 java release.</p> <p>You will need:&nbsp;</p> <p>&nbsp;</p> <ol> <li>1. A set of build packages (I've got a set for lucid, so if this goes away, I'll find some way to host them.) from http://archive.canonical.com/ubuntu/pool/partner/s/sun-java6/</li> <li>The latest Java packages:<a href="http://download.oracle.com/otn-pub/java/jdk/6u30-b12/jdk-6u30-linux-i586.bin">&nbsp;http://download.oracle.com/otn-pub/java/jdk/6u30-b12/jdk-6u30-linux-i586.bin</a> and&nbsp;<a href="http://download.oracle.com/otn-pub/java/jdk/6u30-b12/jdk-6u30-linux-x64.bin">http://download.oracle.com/otn-pub/java/jdk/6u30-b12/jdk-6u30-linux-x64.bin</a></li> <li>dch. &nbsp;just install devscripts package to get this.&nbsp;</li> <li>&nbsp;Some idea of how packaging on debian/ubuntu works.</li> </ol> <p>&nbsp;</p> <p><strong>Let's get started.</strong></p> <pre>mkdir package-build<br />cd package-build<br />wget http://archive.canonical.com/ubuntu/pool/partner/s/sun-java6/sun-java6_6.26-2lucid1.dsc<br />wget http://archive.canonical.com/ubuntu/pool/partner/s/sun-java6/sun-java6_6.26-2lucid1.debian.tar.gz<br />wget http://archive.canonical.com/ubuntu/pool/partner/s/sun-java6/sun-java6_6.26.orig.tar.gz<br />wget http://download.oracle.com/otn-pub/java/jdk/6u30-b12/jdk-6u30-linux-i586.bin<br />wget http://download.oracle.com/otn-pub/java/jdk/6u30-b12/jdk-6u30-linux-x64.bin<br />tom.oconnor@charcoal-black:~/package-build$ ls -1<br />jdk-6u30-linux-x64.bin<br />jdk-6u30-linux-i586.bin<br />sun-java6_6.26-2lucid1.debian.tar.gz<br />sun-java6_6.26-2lucid1.dsc<br />sun-java6_6.26.orig.tar.gz<br />tom.oconnor@charcoal-black:~/package-build$ dpkg-source -x *.dsc<br />gpgv: Signature made Tue 13 Dec 2011 22:31:53 GMT using RSA key ID CC559573<br />gpgv: Can't check signature: public key not found<br />dpkg-source: warning: failed to verify signature on ./sun-java6_6.26-2lucid1.dsc<br />dpkg-source: info: extracting sun-java6 in sun-java6-6.26<br />dpkg-source: info: unpacking sun-java6_6.26.orig.tar.gz<br />dpkg-source: info: unpacking sun-java6_6.26-2lucid1.debian.tar.gz<br />tom.oconnor@charcoal-black:~/package-build$ cd sun-java6-6.26/<br />tom.oconnor@charcoal-black:~/package-build/sun-java6-6.26$ ls<br />debian &nbsp;jdk-6u26-dlj-linux-amd64.bin &nbsp;jdk-6u26-dlj-linux-i586.bin<br />tom.oconnor@charcoal-black:~/package-build/sun-java6-6.26$ rm *.bin<br />tom.oconnor@charcoal-black:~/package-build/sun-java6-6.26$ ../jdk-6u30-linux-i586.bin jdk-6u30-dlj-linux-i586.bin<br />tom.oconnor@charcoal-black:~/package-build/sun-java6-6.26$ ../jdk-6u30-linux-x64.bin jdk-6u30-dlj-linux-amd64.bin<br />tom.oconnor@charcoal-black:~/package-build/sun-java6-6.26$ vim debian/rules</pre> <p>Head down to the block<em> "# check if the sources are the "same"</em></p> <p>Then find and comment the block following it, out, so you get this.</p> <pre># &nbsp; &nbsp; &nbsp; : # check if the sources are the "same"<br /># &nbsp; &nbsp; &nbsp; set -e; set -- $(all_archs); a1=$$1; shift; \<br /># &nbsp; &nbsp; &nbsp; unzip -q -d tmp-$$a1/src $$a1-jdk/src.zip; \<br /># &nbsp; &nbsp; &nbsp; for a2; do \<br /># &nbsp; &nbsp; &nbsp; &nbsp; unzip -q -d tmp-$$a2/src $$a2-jdk/src.zip; \<br /># &nbsp; &nbsp; &nbsp; &nbsp; echo "Comparing sources: tmp-$$a1/src tmp-$$a2/src ..."; \<br /># &nbsp; &nbsp; &nbsp; &nbsp; echo " &nbsp; &nbsp;diff -ur $(diff_ignore)"; \<br /># &nbsp; &nbsp; &nbsp; &nbsp; diff -ur $(diff_ignore) tmp-$$a1/src tmp-$$a2/src; \<br /># &nbsp; &nbsp; &nbsp; done</pre> <p>Save that file, and then run:</p> <pre>dch -v 6.30</pre> <p>This will create a changelog entry for version<em> 6.30</em>, and open <strong>$EDITOR</strong> to edit the changelog entry.&nbsp;</p> <p>Enter a stub entry..&nbsp;</p> <p>I put something like&nbsp;</p> <pre>* Updating internal contents to 6u30</pre> <p>.. There's some output, but you can ignore this.</p> <pre>dch warning: New package version is Debian native whilst previous version was not<br />dch warning: your current directory has been renamed to:<br />../sun-java6-6.30<br />dch warning: no orig tarball found for the new version.</pre> <p>&nbsp;</p> <pre>tom.oconnor@charcoal-black:~/package-build/sun-java6-6.26$ cd ..<br />tom.oconnor@charcoal-black:~/package-build$ cd sun-java6-6.30/<br />tom.oconnor@charcoal-black:~/package-build/sun-java6-6.30$ dpkg-buildpackage -b -uc</pre> <p>... LOTS OF STUFF ...</p> <pre>tom.oconnor@charcoal-black:~/package-build/sun-java6-6.30$ cd ..<br />tom.oconnor@charcoal-black:~/package-build$ ls<br />ia32-sun-java6-bin_6.30_amd64.deb &nbsp; &nbsp; sun-java6_6.26-2lucid1.dsc &nbsp;sun-java6-6.30 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;sun-java6-bin_6.30_amd64.deb &nbsp; sun-java6-fonts_6.30_all.deb &nbsp; sun-java6-jdk_6.30_amd64.deb &nbsp;sun-java6-plugin_6.30_amd64.deb<br />sun-java6_6.26-2lucid1.debian.tar.gz &nbsp;sun-java6_6.26.orig.tar.gz &nbsp;sun-java6_6.30_amd64.changes &nbsp;sun-java6-demo_6.30_amd64.deb &nbsp;sun-java6-javadb_6.30_all.deb &nbsp;sun-java6-jre_6.30_all.deb &nbsp; &nbsp;sun-java6-source_6.30_all.deb</pre> <p>&nbsp;</p> <p>Woo. Debs.</p> <p>What you want to do with them now is up to you. &nbsp;Next blogpost, I'm going to go over creating a package repository with reprepro.</p> <p>&nbsp;</p> <p>Thanks &nbsp;to <a href="http://twitter.com/mibus">@mibus</a> for his similar <a href="http://www.mibus.org/2011/12/31/oracle-java-6-ubuntu/">article</a>, which this is based partially on.&nbsp;</p> <p>&nbsp;</p> <p>&nbsp;</p> <p>&nbsp;</p> <p>&nbsp;</p> 2011: Personal Retrospective http://tomoconnor.eu/blogish/2011-personal-retrospective <p> <p><strong>This post has been abridged / redacted to preserve the identity of individuals mentioned. &nbsp;If you know me well enough, ask and I might show you the unredacted version. &nbsp;Or you might be able to figure it out yourself.&nbsp;</strong></p> <p>&nbsp;</p> <p>My, what a year it's been. &nbsp;Mostly good, but pricked throughout with sadness on occasion.</p> <p>Such a lot has happened, I've changed jobs twice. &nbsp;I left a good Infrastructure Engineer job in July for a promise of a better job at another company. &nbsp;I did 3 months of hard graft on a new infrastructure project there, only to find they'd chosen to make me redundant, and terminate my contract at 3 months. &nbsp;Bit of a bugger that, and the way it was phrased to me made it feel like it was a personal attack. &nbsp;The line I was given by the CTO was "You're not a good fit for the team", but that was actually bollocks, because everyone in the team confirmed my feelings, that I was actually a good fit for the team. &nbsp;A little stubborn, but that's a good quality in an engineer, I feel.</p> <p>That was on the 14th of October..&nbsp;</p> <p>Turns out, that my "<em>redundancy</em>" / <em>"contract termination"</em> / "<em>whatever</em>" came at a time when they also got rid of 2 product managers and a senior developer. &nbsp;Such is life. &nbsp;</p> <p>So, I spent about 3 weeks job hunting, various interviews ranging from "yes, that sounds really cool" to "<em>eugh. Massive company, sounds too boring for words</em>". &nbsp;I picked up a week-odd's work of contract work related to my former infrastructure job, and that kept me entertained for a while long enough.&nbsp;</p> <p>Soon enough, a good offer at a decent company turned up. &nbsp;I heard from my former colleague at the 3 month place, that a cool VFX company were looking for a DevOp engineer of my type of background. &nbsp;</p> <p>I applied, and was interviewed twice. &nbsp;Turns out that I'd previously been recommended to them by a guy who'd interviewed me in the past, so it felt like it really was all meant to be. &nbsp;</p> <p>I started there in the first week of November.. It feels like it was much longer ago, for some reason. Probably because I've been so impossibly busy. &nbsp;Still, that beats the original infrastructure job where I was impossibly bored.</p> <p>There's lots of new infrastructure stuff to do there, and we're doing lots of stuff with cool tech. &nbsp;I'm not entirely sure what I can talk about, so I'll just say that it's all insanely cool.</p> <p>This is good, because I was starting to feel quite bored of working for the same kinds of Web2.0 companies. &nbsp;Scalability, yeah, very buzzwordy for 2011, and important nonetheless, but once you've solved the problem, it feels very self-similar when you come to do it again for a different client or a different employer. &nbsp;</p> <p>There will always be the same problems, namely <strong>Time</strong>, <strong>Money</strong> and <strong>Knowledge</strong>. &nbsp;Scaling a system takes time, the hardware and servers cost money, and the developers need to know how to make their code performant.</p> <p>I don't think I'd go so far to say that I'm bored of Web2.0, but I'm certainly bored of the cheapskate mindset. &nbsp;I've said numerous times, both online and IRL, that if you want to play with the big boys, it's gonna cost you. &nbsp;There's some things you just can't do for free. &nbsp;Building decent software is definitely one of them.</p> <p>So. I'm working for a &nbsp;VFX / post-production company. &nbsp;They did all sorts of insanely crazy VFX for some recent films. &nbsp;It's truly cool. &nbsp;There's plenty of *new* challenges, and very little of the same old web stuff. &nbsp;This is good. &nbsp;Sometimes all you need to keep you interested is a sea change. &nbsp;It certainly worked for me.&nbsp;</p> <p>Until the 24th of October, my partner and I had been in a relationship (and also sharing a flat in Chiswick). &nbsp;It had become pretty apparent that we both wanted our own space, and the relationship in its current format had become pretty much impossible. &nbsp;I think it was all brought home to me when I wanted to start dating again, and to some extent, it felt like he already had. &nbsp;I got home from a trip a few hours earlier than planned, and there was some random guy on the sofa. &nbsp;I jumped in the shower, and by the time I got out, both of them had vanished, without saying a word. <em>&nbsp;Definitely an uncomfortable moment.&nbsp;</em></p> <p>I spent a very long time trying to rationalise the feelings that I'd once had, and whatever was left of them. &nbsp;I came to the eventual conclusion that what i really wanted was a companion. &nbsp;Someone I could chat to now and again, but not have any requirement to y'know, bugger them.</p> <p>When it came down to it, this was pretty much what the relationship had become after a couple of years. &nbsp;We'd done <em>Open Relationship Rules </em>from the outset, initially because he was living in Spain, which made everything a bit tricky, but even when we were living together, in the same flat; sharing the same bed, we'd kept those rules because they worked better for us. &nbsp;</p> <p>I think that should probably have been a bit of a better warning sign. &nbsp;I suspect in future, I'll be more aware.</p> <p>So we broke up, and went our seperate ways. &nbsp;I moved out, and found a new flat.. A somewhat bigger flat, and a new flatmate. &nbsp;An incredibly nice guy, and we do get on well. &nbsp;And I'm glad that I'm not living alone. &nbsp;I think I'd have ended up feeling pretty damn lonely. &nbsp;I mean, there's nights when Alex isn't home, and it's quiet, and I think that if I were living like that all the time, I'd end up pretty bored and probably self-destructive. &nbsp;So yeah, it's good to have a new place, and a new flatmate. &nbsp;</p> <p>I gather my ex is sticking in Chiswick in the old flat. &nbsp;He took over my share of the rent, but I suspect he'll fulfil his long-held dream of living around the corner from his office.&nbsp;</p> <p>I tried dating a guy back in January, whilst I was still technically in a relationship, albeit an open one, with my ex. That turned out a bit weird in the end, as I was falling head-over-heels in love with him, and he wasn't feeling the reciprocal feelings. At least, not to the same extent. &nbsp;That was weird. &nbsp;I don't think I've been in that position for a very long time, and such, I'd forgotten just how hard it was to deal with. &nbsp;One of the things that makes us human, I suspect, is the ability to reflect on past experiences and imagine how alternative paths might have turned out.<br />In some regards, this is a good ability. &nbsp;Truth be told, it's a bitch, and hindsight is a killer when it comes to that kind of thing.&nbsp;</p> <p>Still, he seems happier now with his new boyfriend. &nbsp;I suppose at the end of the day, that's all you can really ask for, for the best for your friends.</p> <p>After my long-term ex and I broke up, I tried dating again, again. &nbsp;Possibly too soon, as I still found that I was craving solace in being alone. &nbsp;Not the best thing if you're trying to make a new relationship (albeit, only dating) work. &nbsp;I don't know what that experience has taught me. &nbsp;Possibly that I'm a busy bugger, and I'm happiest when I'm busy, and that potentially higher-maintenance individuals are unlikely to be a good fit for me. &nbsp; Perhaps it's nothing of the sort, and I was just trying too hard, too soon.</p> <p>&nbsp;</p> <p>So far, it sounds like it's been a pretty depressing and gloomy year, perhaps.&nbsp;</p> <p>But I've done some insanely cool stuff. &nbsp;I went up the BT Tower, and took photos. Photography has played a pretty big part of my life in 2011, too. &nbsp;I got back into film photography with a Nikon F301 and a Nikon F5. &nbsp;Perhaps next year I'll buy a video camera, and branch out in that regard too.</p> <p>I went to a couple of awesome Winter parties, in a stunning tuxedo (that I now own). I've been blogging and writing technical articles a lot more in 2011 than ever before. &nbsp;I've got a Most Valued Blogger award and republishing arrangement from an online journal, and I'm looking to write some guest articles for some technical magazines in 2012. &nbsp;I'd also like to think about writing a book in the new year.&nbsp;</p> <p>I'm going to summarise 2011 as a number of small setbacks, but a persistent push forward against adversity, between job problems and the woes of the end of a long term relationship. &nbsp;It's not all doom and gloom, and I know it could have been a lot worse of a year. &nbsp;But from my reasonably comfortable life, some changes that might seem small to others are quite large and affect me in different ways.&nbsp;</p> <p>I find myself reminded once again of the phrase from Ulysses.</p> <p><em>"To strive, to seek, to find, and not to yield"</em></p> <p>I first saw this phrase gracing the doorway of the Mechanical Engineering department at Birmingham University, and for me, it's always struck a chord.</p> <p>So that's about it. &nbsp;The personal reflection and retrospective on 2011. &nbsp;Here's to a better year in 2012.</p> </p> Twitter and their REST blunder http://tomoconnor.eu/blogish/twitter-and-their-rest-blunder <p> <p>Hah. &nbsp;So it's New Year's Eve. &nbsp; Twitter is down, and has been for about 3-4 hours. &nbsp;That's because the NYE celebrations have already started. &nbsp;Somewhere on the other side of the world.</p> <p>I include Twitter on my personal website. &nbsp;The one you're reading. &nbsp;There's a template tag that displays my five latest tweets.&nbsp;</p> <p>About 2-3 hours ago, I got some error reports about XML parse errors on that template tag. &nbsp;I use api.twitter.com and pull in the XML feed for parsing. &nbsp;No problems there, it's always worked.</p> <p>It relies on testing that the status from Twitter was sensibly formed. &nbsp;In order for that to happen, the request has to return HTTP 200 OK. &nbsp;That's cool. &nbsp;That's easy, and it's one of the principle tenets of RESTful APIs. &nbsp;</p> <p>Until tonight, it seems.&nbsp;</p> <pre>curl -I 'http://api.twitter.com/1/statuses/user_timeline.xml?screen_name=metacheetr&amp;count=5'<br />HTTP/1.1 200 OK<br />Content-Type: text/html; charset=UTF-8<br />Content-Length: 4968<br />Set-Cookie: k=217.146.95.120.e7f9484aa1ec178d; path=/; expires=Sat, 07-Jan-2012 16:25:06 UTC; domain=.api.twitter.com; httponly<br />Date: Sat, 31 Dec 2011 16:25:06 UTC<br />Server: tfe<br />Twitter is currently down for maintenance.<br />We expect to be back soon. For more information, check out Twitter Status &raquo;<br />Thanks for your patience!</pre> <p>So what we find is that Twitter are returning HTTP 200 OK, for a status which is blatently not what I asked for.</p> <p><strong>This is BAD.</strong> &nbsp;This is bad for two reasons, mostly.</p> <p><ol> <li>Web developers and engineers rely on HTTP Status codes to actively represent the output of the service, and also to provide a machine-readable representation of the webpage returned.</li> <li>One of the principle tenets of RESTful APIs is that the status returned should accurately represent the state of the service.&nbsp;</li> </ol></p> <p>There's nothing to stop you returning a HTML response with a HTTP 5xx status code. &nbsp;It's better to do that, in fact. &nbsp;The user sees something pretty, and the machine readable representation says "Er, this service is fucked.</p> <p>But if you return 200, and encapsulate a non-standard error message, inside an arbitrary block of HTML, it makes machine parsing incredibly difficult.</p> <p>So I'm turning off the latest_tweets template tag for a bit. &nbsp;At least until Twitter read this, apologise, and start returning decent HTTP status codes.</p> <p>Come on guys, you're one of the flagship startups of Web 2.0, if we can't look up to you to set a good example, what hope does everyone else have?&nbsp;</p> </p> A manifest for Agile DevOps http://tomoconnor.eu/blogish/manifest-agile-devops <p>&nbsp;</p> <p>I&rsquo;ve decided. &nbsp;We need to start doing <a href="http://en.wikipedia.org/wiki/Planning_poker">points poker</a> here at Baseblack if we&rsquo;re going to carry on this Agile DevOps thing.&nbsp;</p> <p>I&rsquo;ve got to admit, the first time I came across the Agile methodology was quite late in my career. &nbsp;In the past, prioritisation of &ldquo;operations&rdquo; projects was reasonably first come first serve, or by order of priority (frequently, business need, and seldom operational requirement).</p> <p>For software development teams, Agile is a pretty good, native fit. &nbsp;The concepts embodied by stories and sprints fit a development team very cleanly. &nbsp;When it comes to systems administration and engineering, or what I&rsquo;ve come to refer to as DevOps, Agile can be a bit more awkward initially.&nbsp;</p> <p>Operations teams across the globe will tell you that their tasks are intrinsically more &ldquo;sprawly&rdquo;, and that interconnections between tasks are frequently more complex. &nbsp;</p> <p>The truth of the matter is, that frequently there is no simple and sensible way to break up a task into entirely unconnected subtasks. &nbsp;Something which can bugger up Agile, if you&rsquo;re too hard and fast with the requirements and rules by which you play the game.</p> <p>Pretty early on in this new job, I started looking at the previous DevOp Engineer&rsquo;s puppet manifests. They were *mostly* ok, but with some absolute crazy meatballs thrown in for good measure. &nbsp;</p> <p>It&rsquo;s actually a common fault of Sysadmins to want to throw out the previous team&rsquo;s work and start afresh, but in this case it actually was easier to start fresh than repair the foibles and cockups of the old code. &nbsp;&nbsp;</p> <p>Given that I&rsquo;d already spent 3-4 days reading and trying to interpret the state of the system, and it was blatently apparent that there were too many bits of &ldquo;wouldn&rsquo;t it be cool if we hacked this in to make it do X&rdquo;, and not enough actual hard and fast config to make things work. &nbsp;</p> <p>I&rsquo;ll put that one down to my predecessor not being very puppet-savvy.</p> <p>One of the big reasons this sprint overran was that the discovery process (first 3-4 days) was mostly involved with exploring the state of the systems, and what we wanted to accomplish. &nbsp;In the old manifests, there were huge chunks of code that installed numerous applications, which would be easier to manage and integrate if modularised. &nbsp;</p> <p>A good proportion of time in the implementation phase went into creating lots of individual modules for various applications and packages.</p> <p>As I was saying earlier about interconnected tasks, this wasn&rsquo;t just a Fix Puppet sprint.</p> <p>The background to fixing puppet was to enable the faster building of new machines from unboxing to users logging in. &nbsp;</p> <p>There were some massively weird problems with the internal DNS, using Bind9, and the old DHCP server was prone to some peculiar lease issues, and it was running on a physical VM host, when it probably ought to have been a VM guest. &nbsp;Fixing DNS would best be done whilst fixing DHCP. &nbsp;Fixing DNS meant installing PowerDNS, which in turn means installing Postgresql. Setting up DNS Slaves means installing PowerDNS on multiple servers and configuring Postgres replication.</p> <p>There&rsquo;s no way that I&rsquo;m building out multiple copies of anything without Puppet, so there&rsquo;s &nbsp;the first bit of recursive loop.</p> <p>The way to untangle this is to realise that puppet<a href="http://puppetlabs.com/blog/deploying-puppet-in-client-server-standalone-and-massively-scaled-environments/"> doesn&rsquo;t need a puppetmaster</a> to run manifests. &nbsp;All you need to do is write the puppet configs and then use the puppet agent itself to run the manifests from files. &nbsp;You can then use that to bootstrap a puppetmaster, or a DNS server, or just get a sense of how it will all fit together when you do the final server buildout.</p> <p>I&rsquo;m going to leave this here. &nbsp;I think the general conclusions to draw are the following.&nbsp;</p> <p>1) Agile is great.. It doesn&rsquo;t fit all teams, and it&rsquo;s worth trying. &nbsp;If it doesn&rsquo;t fit, no worries. &nbsp;If it does, cool.</p> <p>2) Planning is the biggest stage of any project, or at least, should be.&nbsp;</p> <p>3) Infrastructure projects shouldn&rsquo;t be forced into the traditional Agile Sprint, because they tend to become a lot more sprawly on investigation of the actual problem than they look at first glance.</p> <p>I&rsquo;m about to post the articles on <a href="/blogish/postgres-replication-91">Postgres replication</a>, and the<a href="/blogish/low-level-infrastructure-puppet-dns-and-dhcp/"> technical portion</a> of this article.</p> <p>&nbsp;</p> Low-level Infrastructure: Puppet, DNS and DHCP http://tomoconnor.eu/blogish/low-level-infrastructure-puppet-dns-and-dhcp <p>&nbsp;</p> <p>Right. &nbsp;Let&rsquo;s have a look at the massive technical implications of the Fix Puppet idea.&nbsp;</p> <p>As I mentioned in my <a href="/blogish/manifest-agile-devops/">earlier blogpost</a>, in order to fix puppet in a sensible way, we&rsquo;ll have to review all, and overhaul some of the underlying infrastructure that allows it all to run.</p> <p>The interlinks and dependencies between all the parts are a little tricky to visualise. &nbsp;So, here&rsquo;s a picture.</p> <p><img id="plugin_obj_142" title="Picture - massive directed graph of dependencies" src="/media/cms/images/plugins/image.png" alt="Picture - massive directed graph of dependencies" /></p> <p>Anything in red needs attention, and the stuff in green *just works*. &nbsp;Things in blue are install stages, and these are what we&rsquo;re working on making perfect.</p> <p>Right, so we&rsquo;ve basically got a directed graph, representing the steps and stages that have to happen to a new machine before users can log in.&nbsp;</p> <p><strong>The steps taken to build a machine, roughly look like this:</strong></p> <p>&nbsp;</p> <ol> <li>Unbox.</li> <li>Plug in.</li> <li>Configure Netboot.</li> <li>Hand MAC Address to DHCP server and assign a hostname.</li> <li>Client PXEBoots.</li> <li>Client downloads a preseed file.</li> <li>Client installs itself.</li> <li>Client Reboots.</li> <li>Puppet runs on First Boot.</li> <li>Puppet completes.</li> <li>Client Reboots again.</li> <li>Users login</li> </ol> <p>&nbsp;</p> <p>That&rsquo;s about it, really. The first 4 steps are a hell of a lot easier with the support and co-operation of the supplier. &nbsp;It&rsquo;s nice to have systems preconfigured to PXE boot as the BIOS default, and even cooler if they can send the MAC addresses as labels on each physical machine.</p> <p>If we&rsquo;re going to build out a new infrastructure, we&rsquo;re going to need to review and reinstall the servers that provide this infrastructure, before we can build any workstations.</p> <p>I&rsquo;m a massive massive fan of puppet, and believe that it should be used for the configuration of all servers and workstations. &nbsp;As such, I didn&rsquo;t want to rebuild anything without using puppet, so the first step, had to be getting puppet working again.</p> <p><strong>So, without further ado, let&rsquo;s take a look at the Puppet portion of this, well, one of them.</strong></p> <p>My predecessor saw fit that all nodes should be defined with puppet-dashboard, which is itself, a fine piece of software, but I think more for reporting than specification. &nbsp;</p> <p>Initially, at least, I rebuilt the puppet manifest from a <a href="https://github.com/tomoconnor/puppet">known-good configuration</a>. &nbsp;Namely the base configs I wrote for a blogpost about a year ago; base configs that I&rsquo;m going to update soon.</p> <p>I&rsquo;m a bit of an old fashioned puppet user. &nbsp;I like my nodes defined in nodes.pp, not some External Node Classifier service. &nbsp;<br />Reason being, I like to be able to look in one place and find exactly what I want. &nbsp;It&rsquo;s not a massive ballache to clone down the puppet git repo, make a change and push it back up.</p> <p>In fact, it&rsquo;s better than having a web interface for your node classifications, because git provides you with an intrinsic log of what was changed, and it&rsquo;s easy to revert to an old version, because everything&rsquo;s stored in source control. &nbsp;</p> <p>You can also test what you&rsquo;re about to do, because again, it&rsquo;s just a source control repo. &nbsp;I&rsquo;m a fan of having <a href="http://jenkins-ci.org/">Jenkins</a> run a few sanity checks on your puppet repo, but that&rsquo;s a digression for another blogpost.</p> <p>I&rsquo;m not going to go into great depth about how to install DHCP and DNS, and how to make it work with puppet, at least, not here. &nbsp;</p> <p>What I will say, though is that <a href="https://github.com/puppetlabs/puppet-module-tool">Puppet Module Tool</a>&nbsp;is the most fantastically easy way to generate boilerplate modules for puppet.</p> <p>All you need to do is run</p> <pre>puppet-module generate tomoconnor-dhcp </pre> <p>and you get a full puppet module folder called tomoconnor-dhcp which contains all the structure according to the best practice guidelines.</p> <p>&nbsp;</p> <p>Excellent.</p> <p>As part of the review process, it became quite apparent that <strong><em>Bind9</em></strong> has no sensible admin/management interface, or at least, there wasn&rsquo;t one installed, and frankly, anything that has such horrific config files should be shot.</p> <p>Having had good experience and results using <a href="http://powerdns.com/content/downloads.html">PowerDNS</a> in the past, we decided that this would be a valid upgrade from BIND.<br />PowerDNS relies on a SQL backend for storing the record data in. &nbsp;</p> <p>You can use either <a href="http://www.mysql.com/">MySQL</a> or <a href="http://www.postgresql.org/">PostgreSQL</a>, or possibly some others. &nbsp;Since MySQL can be a bitch, and is, to all serious purposes, a toy database, Postgres seems like a better choice. &nbsp;9.1 is stable, and there are &nbsp;deb package available for it. &nbsp;9.1 also does <a href="/blogish/postgres-replication-91/">hot-standby replication</a>, which is a miracle, because Postgres replication used to be a massive pain in the testicles.</p> <p>There were, initially some mysterious problems with the TFTPd server being generally crappy, mostly regarding timeouts, which was because the storage of the TFTP data was on a painfully slow disk. &nbsp;Moving it from there to the NFS mount dramatically increased performance and stopped TFTP going crazy.</p> <p>In the TFTP'd config, there's a block for configuring the boot options of the preseed install. &nbsp;This is how PXE hands over the details of the preseed server, and the classes of preseed file to run (basically, which modules)</p> <p> <pre>label lucid_ws<br />&nbsp; &nbsp; &nbsp; &nbsp; menu label ^2) Auto Install Ubuntu Lucid WorkStation<br />&nbsp; &nbsp; &nbsp; &nbsp; text help<br />&nbsp; &nbsp; &nbsp; &nbsp; Start hands off install of a workstation.<br />&nbsp; &nbsp; &nbsp; &nbsp; endtext<br />&nbsp; &nbsp; &nbsp; &nbsp; menu default<br />&nbsp; &nbsp; &nbsp; &nbsp; kernel ubuntu-1004-installer/amd64/linux<br />&nbsp; &nbsp; &nbsp; &nbsp; append tasks=standard pkgsel/language-pack-patterns= pkgsel/install-language-support=false vga=normal initrd=ubuntu-1004-installer/amd64/initrd.gz -- quiet auto debian-installer/country=GB debian-installer/language=en debian-installer/keymap=us debian-installer/locale=en_GB.UTF8 netcfg/choose_interface=eth0 netcfg/get_hostname=ubuntu netcfg/get_domain=installdomain.wibblesplat.com url=http://autoserver/d-i/lucid/preseed.cfg classes=wibblesplat;workstation DEBCONF_DEBUG=1</pre> </p> <p>Initially, the Preseed files contained all sorts of crazy hacky shit in the d-i late-command setting. &nbsp;</p> <p><br /><strong><em>late-command</em></strong> is cool. &nbsp;It&rsquo;s basically the last thing to run before the first reboot when you build a new debian/ubuntu system. &nbsp;You can tell it to do all sorts of stuff in there. &nbsp;You probably shouldn&rsquo;t, though. &nbsp;Especially when what you&rsquo;re doing in there is better done elsewhere.</p> <p>The previous Preseed file contained a whole bunch of &ldquo;inject these source files into <em>/etc/apt/sources.list</em>&rdquo;, which is utter bullshit, because you can do exactly the same thing with d-i local repositories, which does the same thing, only far far cleaner.</p> <p>That&rsquo;s not to say that my refactored preseed files don&rsquo;t use late-command at all.</p> <p>I&rsquo;ve chosen to insert some lines into <em>/etc/rc.local</em>&nbsp;on the freshly built system that ensures a puppet run at first boot.&nbsp;</p> <p>On the preseed server, there&rsquo;s a file called &ldquo;<strong><em>firstboot.sh</em></strong>&rdquo; which gets dropped into /usr/local/bin by way of a wget command in late-command.&nbsp;</p> <p>The next thing that happens in late-command is a line to remove &ldquo;exit 0&rdquo; from /etc/rc.local and replace it with a thing that calls &ldquo;<strong><em>/usr/local/bin/firstboot.sh</em></strong>&rdquo;</p> <p>When firstboot runs, it runs puppet, checks for sanity, and then removes itself from /etc/rc.local.</p> <p>The code to actually do that looks like this:</p> <pre>d-i preseed/late_command string &nbsp;\<br />wget -q -O /target/root/firstboot.sh http://autoserver/d-i/bin/firstboot.sh &amp;&amp; \<br />chmod +x /target/root/firstboot.sh &amp;&amp; \<br />sed -i 's_exit 0_sh /root/firstboot.sh_' /target/etc/rc.local</pre> <p>This relies on having something on http://autoserver that is basically just apache hosting some files for the preseeder to retrieve during installation.</p> <p>&nbsp;Cool huh?&nbsp;</p> <p>That ensures that the first thing that happens once the new machine has been built and rebooted, is a puppet run.</p> <p>Some stuff we do here relies on our hand-rolled deb packages, which are stored in our own, internal APT repo. &nbsp;We&rsquo;ve also got an APT cache, created and maintained by <a href="http://www.unix-ag.uni-kl.de/~bloch/acng/html/index.html">apt-cacher-ng</a>, which at least means that when you&rsquo;re rebuilding systems frequently, that all the packages you would otherwise download from <strong>archive.ubuntu.com</strong> come straight over the LAN. &nbsp;</p> <p>The major problem initially with this was the speed, or lack of. &nbsp;It certainly wasn&rsquo;t performing anywhere near speeds you&rsquo;d expect from a 1GE LAN, and the reason was again, slow disks. Moving the apt-cache files to the NFS highspeed storage again helped performance. &nbsp;If we struggle in future, I&rsquo;m going to look at a SSD cache for this, but I think that the performance of the SAS/SATA disks on massively parallel storage provided by our NFS servers will be adequate for the forseeable future.</p> <p>Next up, the Puppetmaster. &nbsp;Again, I was pretty keen on building this from scratch, but using puppet itself to configure it&rsquo;s own master. &nbsp;Sounds pretty counter-intuitive, right? But the puppet client can bootstrap the master quite easily by using files as it&rsquo;s source. &nbsp;</p> <p>The first step is to clone down the latest puppet manifests from git, so you either need to git export elsewhere, or install git-core. &nbsp;Your choice.</p> <p>Once you&rsquo;ve got those, all you need to do is install puppet-client, and run:</p> <pre> puppet apply /path/to/your/manifests/site.pp</pre> <p>If you&rsquo;ve written the manifests right, and you&rsquo;ve got your master defined as a node, you should find that puppet will install puppetmaster, and so on, and then you get a ready and working puppetmaster that just configured itself.</p> <p>I used puppet-module tool to generate modules for the following services/items: &ldquo;applications&rdquo; - which actually contains a bunch of custom/proprietary application install rules, a declassified example is there&rsquo;s a googlechrome.pp file that installs chrome from a PPA.</p> <p>Other modules: dhcp, kernel, ldap, network, nfs, nscd, ntp, nvidia, postgres, powerdns and ssmtp.</p> <p>As is the trend with puppet, and modern DevOps, a vast majority of the code in the entire manifest repository has been gleaned and researched from other puppet modules on github. Acknowledgement is in place where it&rsquo;s due, and the working copies we&rsquo;re using are frequently forked on github from the original.</p> <p>It&rsquo;s great, this, actually. &nbsp;If you search on PuppetForge http://forge.puppetlabs.com/ the array of modules available is staggering. &nbsp;It makes bootstrapping a new manifest set remarkably quick and easy.</p> <p>The NFS module contains a bunch of requirements for mounting NFS shares, and the definitions for an NFS share to be mounted. &nbsp;All pretty simple stuff, but modularised for ease of use.</p> <p>I&rsquo;m particularly proud of the postgres module which has a master class, and a slave class, which installs and configures the required files and packages to enable streaming hot-standby replication on Postgres9.1</p> <p>I will release the declassified fork of this soon.</p> <p>I&rsquo;m going to wrap this post up here. &nbsp;It&rsquo;s a massively long one, and there&rsquo;s still lots more left to write. &nbsp;</p> <p>&nbsp;</p> Postgres Replication on 9.1 http://tomoconnor.eu/blogish/postgres-replication-91 <p> <p>Our new PowerDNS cluster (of 2 nodes, so far).. Is backed by Postgresql. &nbsp;</p> <p>In the past, I&rsquo;ve found that Postgres performs far better for a PowerDNS backend, than MySQL, and certainly better than the BIND, LDAP or SQLite backends.</p> <p>Until version 9.x, Postgres replication was a pretty sorry state of affairs. &nbsp;There were a few options for replication.&nbsp;</p> <p>Slony was commonly used, if not very good.. You&rsquo;d tend to get a horrific SPoF around the single master. &nbsp;In total, there were 9 or 10 different third party solutions for Postgres replication and clustering. &nbsp;They all had their pros and cons, and some were great, and some were downright awful. &nbsp;</p> <p>In 2008, the Postgres core team started to bring replication and clustering into the fold with the rest of the features of Postgres, and now, in 9.x, the option of hot and warm standby are both available, and stable.</p> <p>There&rsquo;s a comprehensive writeup of the history of Postgres replication here: <a href="http://wiki.postgresql.org/wiki/Replication,_Clustering,_and_Connection_Pooling">http://wiki.postgresql.org/wiki/Replication,_Clustering,_and_Connection_Pooling</a></p> <p>One of the things I adore about the hot-standby replication mode is that the basic configuration (/etc/postgresql/9.1/main/postgresql.conf) is identical between master and standby.</p> <p>This makes puppeting insanely easier than it would&rsquo;ve been if the master and standby had to have largely different configuration files.</p> <p>I changed about 5 config settings in the main config file.</p> <pre>listen_addresses = '*'<br />wal_level = hot_standby&nbsp;<br />max_wal_senders = 5<br />wal_keep_segments = 32<br />log_destination = 'syslog'</pre> <p>^^ I only changed the log_destination to make centralised logging easier in future.</p> <p>There&rsquo;s a limited change to pg_hba.conf to allow host-based authentication of the standby to the master. &nbsp;</p> <p>Add a line like:</p> <pre>host &nbsp; &nbsp;all &nbsp; &nbsp; all &nbsp; &nbsp; $SLAVE_IP/32 &nbsp; &nbsp; &nbsp;trust</pre> <p>I actually did this as a Puppet template file.</p> <p>On the standby server, you drop a file called &ldquo;recovery.conf&rdquo;, into /var/lib/postgresql/9.1/main</p> <p>Yes, the *DATA* directory. &nbsp;Yes, that makes no sense. Yes, It should by rights be /etc/postgres.... but it isn&rsquo;t.</p> <p>In that file, you have 2 lines.</p> <pre>standby_mode = 'on'<br />primary_conninfo = 'host=&lt;%= psql_master -%&gt; user=&lt;%=replication_user -%&gt; password=&lt;%=replication_password -%&gt; '</pre> <p>That&rsquo;s copypasta&rsquo;d from a puppet template. &nbsp;</p> <p>The interpolated lines are more like:</p> <pre>standby_mode = 'on'<br />primary_conninfo = 'host=192.168.100.100 user=replicant password=wibblewibblewibble '</pre> <p>Then all you&rsquo;ve gotta do is instantiate the standby with pg_basebackup, and then restart the master, and the standby, and they should come up, connect to each other, and start streaming replication updates.</p> <p>It&rsquo;s pretty magical.</p> <p>pgbasebackup lives in /usr/lib/postgresql/9.1/bin/pg_basebackup</p> <p>and should be run (as postgres user)</p> <pre>/usr/lib/postgresql/9.1/bin/pg_basebackup -D /var/lib/postgresql/9.1/main/ -x -h $Master_Hostname -U postgres</pre> <p>You should start the standby first, so that the master doesn&rsquo;t have a chance to get out of sync.</p> <p>The standby will start accepting read-only connections as soon as it&rsquo;s up to date with the master.</p> </p> Baking Certificates into OSX Lion for 802.1X http://tomoconnor.eu/blogish/baking-certificates-mobileconfig-osx-lion-and-8021x <p>&nbsp;</p> <p>This is tricky. &nbsp;No question about that. &nbsp;</p> <p>In order to configure OSX Lion to use 802.1X authentication over WiFi, to login, and also connect (without prompting for credentials), we need to generate a .mobileconfig parameter file (plist).</p> <p>These files are a bugger to craft by hand, so what we'll do is use the Enterprise iPhone tool, to build one which can be used for a deployment to an iPhone, or OSX Lion laptop/desktop.</p> <p>Apple have a bunch of stuff about Enterprise Deployment, <a href="/wibblescrote/cms/page/50/edit-plugin/118/{http:/www.apple.com/support/iphone/enterprise/">here</a>.</p> <p>The file you want, however, is the<a href="http://support.apple.com/kb/DL1465"> iPhone Configuration Utility 3.4 for Mac OS X</a>.</p> <p>You'll need to run this on an Apple device, Macbook Air, or MBP, or iMac, etc.. As far as I know, you can't do this from an iPad.</p> <p>1. Download and install from the DMG.&nbsp;</p> <p>Run the Configuration Utility .</p> <p><img id="plugin_obj_119" title="Picture - Main screen of the iPhone Configuration " src="/media/cms/images/plugins/image.png" alt="Picture - Main screen of the iPhone Configuration " /></p> <p>Click "Configuration Profiles" in the selector on the LHS.</p> <p>Select "New", and you should get a blank new profile.&nbsp;</p> <p>Enter some details.</p> <p><img id="plugin_obj_120" title="Picture - Enter some Details" src="/media/cms/images/plugins/image.png" alt="Picture - Enter some Details" /></p> <p>"Identifier" is a reversed format of your profile, in a kinda java package-style notation, ie, <em>wifi.wibblesplat.com</em> becomes <em>com.wibblesplat.wifi</em>; Simples!</p> <p>As part of the Profile, you can configure all sorts of settings that will be installed on the target device. &nbsp;Scroll down through General, Passcode, down to "Credentials".&nbsp;</p> <p><img id="plugin_obj_121" title="Picture - Selecting Credentials" src="/media/cms/images/plugins/image.png" alt="Picture - Selecting Credentials" /></p> <p>When you hit "Configure", you can choose a certificate file.&nbsp;</p> <p><img id="plugin_obj_122" title="Picture - Choose your Certificate File" src="/media/cms/images/plugins/image.png" alt="Picture - Choose your Certificate File" /></p> <p>At this point, we're going to pause here, and quickly recap how to create self-signed SSL certificates.</p> <p><strong>Open Terminal, and create a new directory that we can shove all the SSL related gubbins into.</strong></p> <pre>cloud-white:~ tom.oconnor$ mkdir wibblesplat</pre> <pre>cloud-white:~ tom.oconnor$ cd wibblesplat/</pre> <p><strong>Next, we need to generate a private key.</strong></p> <pre>cloud-white:wibblesplat tom.oconnor$ openssl genrsa -des3 -out wibblesplat.key 1024<br />Generating RSA private key, 1024 bit long modulus<br />...++++++<br />...........................++++++<br />e is 65537 (0x10001)<br />Enter pass phrase for wibblesplat.key:<br />Verifying - Enter pass phrase for wibblesplat.key:</pre> <p><strong>You should enter a passphrase here, but we can strip it off later.</strong></p> <p><strong>Now we've got the key, we'll use that to generate a Certificate Signing Request (CSR)</strong></p> <pre>cloud-white:wibblesplat tom.oconnor$ openssl req -new -key wibblesplat.key -out wibblesplat.csr<br />Enter pass phrase for wibblesplat.key:<br />You are about to be asked to enter information that will be incorporated<br />into your certificate request.<br />What you are about to enter is what is called a Distinguished Name or a DN.<br />There are quite a few fields but you can leave some blank<br />For some fields there will be a default value,<br />If you enter '.', the field will be left blank.<br />-----<br />Country Name (2 letter code) [AU]:GB<br />State or Province Name (full name) [Some-State]:England<br />Locality Name (eg, city) []:London<br />Organization Name (eg, company) [Internet Widgits Pty Ltd]:Wibblesplat Ltd<br />Organizational Unit Name (eg, section) []:R&amp;D Department<br />Common Name (eg, YOUR name) []:*.wibblesplat.com<br />Email Address []:<br />Please enter the following 'extra' attributes<br />to be sent with your certificate request<br />A challenge password []:<br />An optional company name []:</pre> <p>Of course, you need to fill in the CSR with your<strong> *own*</strong> information, but that goes without saying, doesn't it? Do you sign your cheques with "<em>Signature</em>" in a cursive hand?</p> <p>Next, we'll strip the passphrase from the key, because it makes it a bugger if you use this certificate for Apache, or whatever, and it will always block and wait for the key if you've not stripped it.</p> <pre>cloud-white:wibblesplat tom.oconnor$ openssl rsa -in wibblesplat.key -out wibblesplat.unprotected.key<br />Enter pass phrase for wibblesplat.key:<br />writing RSA key</pre> <p><strong>Now we've got the key and the CSR, we can generate a SSL Certificate</strong>. You can specify anything from 1 day to 7304 days (20 years) for the validity. &nbsp;For CA Roots, it's probably best not to use 1 day ;).</p> <pre>cloud-white:wibblesplat tom.oconnor$ openssl x509 -req -days 900 -in wibblesplat.csr -out wibblesplat.crt -signkey wibblesplat.unprotected.key&nbsp;<br />Signature ok<br />subject=/C=GB/ST=England/L=London/O=Wibblesplat Ltd/OU=R&amp;D Department/CN=*.wibblesplat.com<br />Getting Private key</pre> <p><strong>Now we've got the Certificate (.crt), the Key (.key), the unpassphrased key (.unprotected.key), and the Certificate Signing Request (.csr)</strong></p> <pre>cloud-white:wibblesplat tom.oconnor$ ls<br />wibblesplat.crt &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; wibblesplat.key<br />wibblesplat.csr &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; wibblesplat.unprotected.key</pre> <p><strong>Let's jump back to the main theme of this evening's symposium.&nbsp;</strong></p> <p>Now we've got a generated certificate, we can continue with profile generation.</p> <p>We were here.&nbsp;</p> <p><img id="plugin_obj_123" title="Picture - We were here" src="/media/cms/images/plugins/image.png" alt="Picture - We were here" /></p> <p>Navigate to wherever you left those SSL certificate files, and select the .crt</p> <p><img id="plugin_obj_124" title="Picture - Found a certificate" src="/media/cms/images/plugins/image.png" alt="Picture - Found a certificate" /></p> <p>When you click "Open", the right hand side of the credentials pane will display the signed certificate.&nbsp;</p> <p><img id="plugin_obj_125" title="Picture - Opened the Certificate" src="/media/cms/images/plugins/image.png" alt="Picture - Opened the Certificate" /></p> <p>Excellent. &nbsp;</p> <p>Now we can configure the Wifi settings to use that certificate.</p> <p>Scroll back up through the Profile settings, up to "Wi-Fi".</p> <p><img id="plugin_obj_126" title="Picture - Configure Wifi" src="/media/cms/images/plugins/image.png" alt="Picture - Configure Wifi" /></p> <p>Hit "Configure", and the right hand pane changes to another profile builder screen.</p> <p>Enter the SSID of your Wi-Fi, and select Security Type "WPA / WPA2 Enterprise"&nbsp;</p> <p><img id="plugin_obj_127" title="Picture - Configure Wifi SSID" src="/media/cms/images/plugins/image.png" alt="Picture - Configure Wifi SSID" /></p> <p>Scroll down the Right hand side down to "Enterprise Settings" and click some boxes.&nbsp;</p> <p><img id="plugin_obj_128" title="Picture - Configure Enterprise Wifi" src="/media/cms/images/plugins/image.png" alt="Picture - Configure Enterprise Wifi" /></p> <p>Click the "Trust" tab, and select the Certificate that we added to the Stored Credentials.</p> <p><img id="plugin_obj_130" title="Picture - Trust me, I'm a server" src="/media/cms/images/plugins/image.png" alt="Picture - Trust me, I'm a server" /></p> <p>Under "Trusted Server Certificate Names", hit the [+] button, and add whatever matches the CN of your certificate. &nbsp;In this case, it's "*.wibblesplat.com".</p> <p>Nearly Done!</p> <p>Along the top button bar, hit "Export", and you get the Export Dialog:&nbsp;</p> <p><img id="plugin_obj_131" title="Picture - Export Me!" src="/media/cms/images/plugins/image.png" alt="Picture - Export Me!" /></p> <p>For "Security" ensure "None" is selected, then hit "Export..."</p> <p>Save the file with the .mobileconfig extension</p> <p><img id="plugin_obj_132" title="Picture - Export File as mobileconfig" src="/media/cms/images/plugins/image.png" alt="Picture - Export File as mobileconfig" /></p> <p>Right. &nbsp;That's the OSX bit done.</p> <p>The next thing I did, was to jump back over to my Ubuntu desktop, and fire up Meld.</p> <p>In case you've never used it, Meld is a great, interactive, diff tool. &nbsp;It supports 2 and 3 way diffs, and you can shuffle bits of code between the two panes of it easily.</p> <p>We're going to open someone else's mobileconfig file, and sanity check our own.</p> <p>Ronald Ip over at <a href="http://www.iphoting.com/">iphoting.com</a> has published his <a href="http://www.iphoting.com/blog/archives/817-Lion-Wireless-Access-in-SMU.html">configuration profile</a> for accessing the wireless at Singapore Management University.</p> <p>It's an interesting read, and the link to the .mobileconfig file is at the bottom of his blogpost, also <a href="http://cl.ly/2O302f3S2r073D3B2427">here</a>.</p> <p>Open up Meld (you might need to <em>apt-get install meld</em>).</p> <p>Create a New Diff, and select the file you downloaded from iphoting as the Original, and your generated mobileconfig file as the "Mine".</p> <p><img id="plugin_obj_133" title="Picture - Choose files to meld" src="/media/cms/images/plugins/image.png" alt="Picture - Choose files to meld" /></p> <p>Now all you need to do is Sanity Check them. &nbsp;Make sure that, side by side, the files look *similar*. &nbsp;Of course, they can't be identical, but you want some idea that the keys and values are in the same order (this is <strong>*important*</strong>), and that yours has got most of the same information as the master.</p> <p><strong><em>**Important: **</em></strong></p> <p>If you wish to use 802.1X to authenticate to Radius for logins, then you'll need to configure a "Login Window" profile.&nbsp;</p> <p>This means you need to add a "macloginwindow" user account to your LDAP (or whatever your Radius server looks up against), and then configure the username and password for that in this file.</p> <p>To do that, edit the .mobileconfig file in a decent text editor, and add the lines</p> <pre>&lt;key&gt;UserName&lt;/key&gt;<br />&lt;string&gt;macloginwindow&lt;/string&gt;<br />&lt;key&gt;UserPassword&lt;/key&gt;<br />&lt;string&gt;000INSERTSecurePasswordInHERE000&lt;/string&gt;</pre> <p>Those lines need to go *just* after the block:</p> <pre>&lt;key&gt;TTLSInnerAuthentication&lt;/key&gt;<br />&lt;string&gt;MSCHAPv2&lt;/string&gt;</pre> <p>Then after&nbsp;</p> <pre>&lt;key&gt;SSID_STR&lt;/key&gt;<br />&lt;string&gt;wibblesplat-wifi&lt;/string&gt;</pre> <p>Insert&nbsp;</p> <pre>&lt;key&gt;SetupModes&lt;/key&gt;<br />&lt;array&gt;<br /><span style="white-space: pre;"> </span>&lt;string&gt;System&lt;/string&gt;<br /><span style="white-space: pre;"> </span>&lt;string&gt;Loginwindow&lt;/string&gt;<br />&lt;/array&gt;</pre> <p>Which will define that you're doing System settings, and Login Window settings.</p> <p>If you don't want to do Login Window stuff (but frankly, why wouldn't &nbsp;you), then &nbsp;you can safely remove the LoginWindow key.</p> <p>Somewhere near the bottom of the file, there's a Key marked "<em>PayloadType</em>", with Value "<em>Configuration</em>".</p> <p>One line above that, insert the two lines:</p> <pre>&lt;key&gt;PayloadScope&lt;/key&gt;<br />&lt;string&gt;System&lt;/string&gt;</pre> <p>&nbsp;</p> <p>That should be it for manual changes. &nbsp;As soon as I figure out how to do those from the OSX iPhone configurator, I'll update this. &nbsp;I suspect that because LoginWindow isn't actually an iPhone option, but more pertains to OSX on non-mobile devices, that it's not actually covered as a Thing in the Configurator.</p> <p>Once you're pretty happy, you can get on with the next step. &nbsp;On Lion, you can load the files with the omnipotent "open" command from Terminal. We used HTTP to distribute the files, but you could equally just scp them across to your Lion clients.</p> <p>You need to do the profile load as an Admin User, so in Terminal, do something like:</p> <pre>su - adminuser open wibblesplat.mobileconfig</pre> <p>Some box might appear asking if you want to apply the settings, say yes. &nbsp;</p> <p>You've come this far, it'd be foolish to say no.</p> <p>Then all you've gotta do is reboot. &nbsp;</p> <p>Technically, you might not need to, but at least rebooting should clear any saved session state, and you'll get a more representative idea of what ought to happen.</p> <p>Done. &nbsp;Congratulations. &nbsp;You've just baked in configuration details for WPA2 Enterprise and 802.1x</p> Renewing a SSL Certificate on OSX Server http://tomoconnor.eu/blogish/renewing-ssl-certificate-osx-server <p>&nbsp;</p> <p>This article relies on having a soon-to-expire SSL certificate on an Apple OSX Server. &nbsp;Ours are running Snow Leopard, and I&rsquo;m yet to try the whole thing on Lion.</p> <p>I&rsquo;ve got to admit, I went through a bit of a rigmarole to do this.</p> <p>To generate a new certificate, you need a key, and a CSR.</p> <p>To get the key, you need to export a PKCS12 file from KeychainAccess as ROOT. &nbsp;Yes, Root. Yes, OSX = Toy operating system. No, another admin user won&rsquo;t cut it. Yes it&rsquo;s a pain in the arse.&nbsp;</p> <p>For an imaginary wibblesplat.com:</p> <p>&nbsp;</p> <ol> <li>Open Terminal.</li> <li>Run </li> </ol> <pre><ol><li>sudo /Applications/Utilities/Keychain\ Access/Contents/MacOS/Keychain\ Access</li></ol></pre> <ol> <li>Unlock the System keychain.</li> <li>Locate certificate (Category -&gt; Certificates) , Control + click =&gt; Export...&nbsp;</li> <li>Export to<strong> /tmp/wibblesplat.p12</strong></li> <li>Feed it a password for the p12 archive. &nbsp;Do NOT forget this. You&rsquo;ll need it.</li> <li>Go back to the Server Admin panel, grab the expiring certificate, and hit the Gearwheel, then select Generate Certificate Signing Request.</li> <li>Save that to a file. (<strong>/tmp/wibblesplat.csr</strong>)</li> </ol> <p>Next, we need to split the PKCS12 archive, to get the old private key out.</p> <pre>tom.oconnor@cloud-white:~$ cd /tmp<br />tom.oconnor@cloud-white:/tmp$ openssl pkcs12 -in wibblesplat.p12 -nocerts -out wibblesplat.key</pre> <p>&gt; Enter Import Password: *****<br />&gt; MAC verified OK<br />&gt; Enter PEM pass phrase: *****<br />&gt; Verifying - Enter PEM pass phrase: *****</p> <p>Strip the passphrase from the key (otherwise you have to enter it lots when you restart services.)</p> <pre>tom.oconnor@cloud-white:/tmp$ openssl rsa -in wibblesplat.key -out wibblesplat.unprotected.key</pre> <p>&gt; Enter pass phrase for wibblesplat.key: *****<br />&gt; writing RSA key</p> <p>Export the old Certificate from the p12. &nbsp;You might as well.</p> <pre>tom.oconnor@cloud-white:/tmp$ openssl pkcs12 -in wibblesplat.p12 -clcerts -nokeys -out wibblesplat.old.crt</pre> <p>Generate the Certificate from the CSR from earlier, and the freshly exported key.</p> <pre>tom.oconnor@cloud-white:/tmp$ openssl x509 -req -days 7300 -in wibblesplat.csr -signkey wibblesplat.unprotected.key -out wibblesplat.new.crt</pre> <p>&gt; Signature ok<br />&gt; subject=/CN=wibblesplat.com/C=GB<br />&gt; Getting Private key</p> <p>Now, you go back to Server Admin. &nbsp;Re-select the expired certificate, and hit Gearwheel -&gt; Replace with new signed certificate.</p> <p>Find &nbsp;the file "wibblesplat.new.crt" in Finder, and drag it into the Server Admin "Replace Screen"</p> <p>You don&rsquo;t need to replace the Key, because of the above steps, we used the old key.</p> <p>Head back over to Keychain Access,&nbsp;</p> <p>Find the newly updated certificate, and you should find that the new expiry time is somewhere about 20 years from now (7300 days, which is the longest you can set a certificate Valid To date)</p> <p>Then double click the new certificate, and under the Trust dropdown/treeview thingy, set&nbsp;</p> <p><strong style="font-style: italic;">"</strong>When using this certificate, to<strong style="font-style: italic;"> Always Trust"</strong></p> <p>Congrats. &nbsp;You've just replaced an expired certificate with one that won't expire for 20 years (well, near enough.)</p> Analysis and Comment: Why Point of Sale is a POS http://tomoconnor.eu/blogish/analysis-and-comment-why-point-sale-pos <p>&nbsp;</p> <p>A little background, perhaps:<br />Last night I attended a Winter Party at a bar called The Sterling, in the ground floor of the Gherkin.&nbsp;<br />I have absolutely no problem with the organisation of the Party itself, but more complaints about the Venue.&nbsp;</p> <p>&nbsp;</p> <p>I drink in various bars quite a lot. &nbsp;I've worked in a few bars. &nbsp;I observe how bar staff operate, and how their tills work. &nbsp;There's a few longstanding massive problems with pretty much every till/billing system I've ever seen in a bar.</p> <p>Some are downright terrible, and who knows what the designers/integrators were thinking. &nbsp;These typically have a<strong> full 103 button QWERTY keyboard</strong>, and you've gotta type shit in, to get stuff to come up on the tab. &nbsp;It's slow, poorly designed for purpose, and not ideal to use a keyboard in a wet/food preparation environment, so the keyboard gets filthy and broken, so the staff hammer on the keys harder and harder.. Yeah. You can see where this is going.</p> <p>There's the <strong>generic Touchscreen POS system</strong>, that's been adapted for bar use. Generally a better lot, but the biggest problem is traditional POS relies on having barcodes on everything, and a scanner on the till. &nbsp;Doesn't work very well for bar things, where things aren't quite as fixed-format as a traditional shop.</p> <p>One of my favourite haunts in Brighton gave all the staff a very<strong> small barcode reader</strong>, and everything was barcoded.</p> <p>You ask for a double G&amp;T, the barman swipes the Gordons shot twice, and a bottle of tonic, and you're done. &nbsp;It worked *perfectly*. &nbsp;This is the right kind of idea. &nbsp; Sadly, it's about the only place I've ever seen it.</p> <p>While we're vaguely on the topic of Brighton, &nbsp;there was a particular favourite cocktail bar down there which had the most remarkably unfriendly till system. <a href="http://twitter.com/pobk">@PoBK</a> and I persuaded the barman to let us have a look at the interface after it took him nearly 10 minutes to enter the contents of a custom cocktail. &nbsp;The conclusion we came to was that some idiot designer had melded the keyboard entry system with the touchscreen system, but failed to recognise the actual *modus operandi* of a bar. &nbsp;Every time you wanted a new ingredient, you had to re-search the database, then enter the quantity, in Millilitres on the keyboard.</p> <p><strong>So here's an idea. &nbsp;Cocktail bars need a till system that's designed for their use.</strong> Frequently used ingredients in frequently used sizes have more accessible buttons than other, less frequently used things. &nbsp;Ergo,&nbsp;Gordons Gin has a big button, Anchovy paste, a smaller one, at the end of a list.</p> <p>Also enter a bunch of cocktails (matching the menu) into the database, so you can ring up a mojito with one click, rather than say, entering 2 shots of rum, mint, lime, etc etc etc.</p> <p><strong>I'm going to change theme here, momentarily.</strong></p> <p>One of the biggest complaints I've heard of (mostly) last night's venue, is the concept of tab inflation.</p> <p>A number of people have reported on Twitter and IRC that their tab receipt contains/contained drink items which were not their own.&nbsp;</p> <p>I can come up with a few reasons for this. &nbsp;All of them are avoidable, and yet were not avoided by design/implementation.</p> <p>Having observed the staff using the bar tab feature, this is the typical pattern:</p> <p>&nbsp;</p> <ol> <li>Customer orders drinks.&nbsp;</li> <li>Customer presents tab card, (a business card sized piece of paper with a number on)</li> <li>Barstaff hit "Add to Tab" button, which displays a screen of small (1 square cm) touchscreen buttons with numbers 1 to 500, or so.&nbsp;</li> <li>Barstaff select matching button to tab card, and receipt is printed.</li> <li>Customer gets drunk.</li> <li><strong>GOTO: 1</strong></li> </ol> <div><strong><br /></strong></div> <p><strong>There's a number of problems with this. &nbsp;</strong></p> <p>Let's start with Authorisation and Authentication, or "<em>How does the bar know you are who you say you are</em>". &nbsp;Well, under the above system, they don't. &nbsp; <br />I could grab/steal/replicate/forge anyone's card, and rack up a massive amount of money on their tab, because there's no checking mechanism in the system to be sure that the tab belongs to me. &nbsp;</p> <p>In the past, I've seen systems (often in hotels) where you sign the paper against your room number, the bar staff keep the paper, then when you check out, you can see the list of receipts.&nbsp;</p> <p>My local pub asks for the name on the payment card that is securing the tab.</p> <p>There's a pub in Hammersmith that uses a slightly more upmarket solution where the tab card is actually a key to a lockbox that holds your debit/credit card. A bit better, but that also leaves much to be desired in the whole card security theatre.</p> <p>Authentication is a bit of a bugger. Many of the ideas that work well, aren't ideally suited to the fast paced realm of bar service. &nbsp;Many of the ideas that are currently used are massively insecure.</p> <p>From what I've heard, the above problem isn't the actual vector for tab inflation, or at least, if it is, it's of considerably smaller incidence and volume.</p> <p>The biggest problem is threefold. Primarily, the bar staff have to manually read the number from the card, and secondly, match it with a list of small numbers from 1 to 500 (ish), thirdly, and from an <strong>User Experience (UX)</strong> point of view, most importantly, the buttons are small, closely spaced, and there doesn't appear to be a molly guard (something to stop you from incrementing the wrong tab, in short, "Are you sure you mean tab 123?").</p> <p>On more than one occasion last night, I heard the admission "<strong><em>I might've put that on the wrong tab, I'm not so good with numbers.</em></strong>" - Fair enough. &nbsp;I'm not brilliant with numbers myself, but I can design that point of failure out of your system.</p> <p>Here's the simplest solution. &nbsp;It's so simple you're gonna kick yourself. &nbsp;Print some computer-readable representation of the tab card number, on the card itself.&nbsp;</p> <p>A few options, in ascending price might be: Barcode, QR Code, Mag-stripe, Punched Card, RFID contactless technology, <a href="#Image1">SmartButton</a>, Fingerprint recognition (This'd be cool.)</p> <p>Yep, that's it. &nbsp;It's slightly more expensive, but you'd soon find that you'd be losing less revenue through unclaimed drinks. &nbsp;You'd get more money from repeat business, because you've not alienated customers by saying "you lied, and you did actually buy this drink" when they, blatently, haven't.</p> <p>Add a simple short authorisation code that the customer sets when they start the tab, and you've got primitive Authorisation as well as Authentication.</p> <p>&nbsp;</p> <p>&nbsp;</p> <p><a name="Image1"></a>[1]&nbsp;<img id="plugin_obj_113" title="Picture - Smart Button" src="/media/cms/images/plugins/image.png" alt="Picture - Smart Button" /></p> eBuyer's Black Monday http://tomoconnor.eu/blogish/ebuyer-black-monday <p>&nbsp;</p> <p>It's only a few days after Black Friday, and eBuyer have experienced their very own Black Monday. &nbsp;</p> <p>I'll set the scene. &nbsp;This morning, I had an email mailshot advertising a &pound;1 sale of clearance range items on eBuyer. &nbsp;Sounded like an ideal plan, especially if there were any hard disks up for grabs.&nbsp;</p> <p>I never actually got that far though. &nbsp;I followed the "sneak preview" instructions, duly "liked" eBuyer on facebook. &nbsp;10:30 rolled by, and oh look. &nbsp;Error 500 from eBuyer. &nbsp;Refresh. &nbsp;Try again. &nbsp;Same error. &nbsp;<strong>Connection terminated.</strong>&nbsp; Session reset. &nbsp;<strong>Page returned no data.&nbsp;</strong></p> <p>Let's have a look at the Facebook page for eBuyer. &nbsp;Seems to be some problem here.. Reports coming in from all over the web that the site's down. <strong><em>&nbsp;*gasp*</em></strong> Surely.. No? Oh my god.. They didn't anticipate the extra load on their servers that this clearance sale would cause? &nbsp;</p> <p>What a surprise. &nbsp;Another company suffering *seriously* bad PR. There's enough bile and vitriol about the entire fiasco split between their <a href="http://www.facebook.com/ebuyer">Facebook page</a>, and <a href="https://twitter.com/#!/search/ebuyer">#ebuyer on twitter</a>&nbsp;.</p> <p><strong>So what actually happened? &nbsp;</strong></p> <p><strong>&nbsp;</strong>Well, eBuyer effectively started a DDoS against themselves at about 10:30 this morning. &nbsp;It's fairly safe to assume that there's two main problems. &nbsp;</p> <p><strong>1) </strong>Their site is almost entirely dynamic content that has to be generated on every page view, especially as the clearance prices are only visible if you're logged in. &nbsp;So there's cookies involved, so the content can't be cached. &nbsp;This means that every page has to be "built" from scratch by the web-server(s), it's gotta make requests to the backend databases for prices and stock levels. &nbsp;Imagine this happening for every user.. Then every user's click, then every user's click in multiple tabs. &nbsp;No wonder the site's fucked.</p> <p><strong>2) </strong>More importantly, the majority of their connectivity has been saturated by people trying to access the site. &nbsp; There's commenters on Facebook and Twitter both saying if you chain-refresh the site, basically keeping your finger held down on F5, then you'll get to the site quicker. &nbsp;Probably not guys. &nbsp;</p> <p>The problem is that you've got the audience of the email, the people from twitter advertising, anyone who's seen the Retweet and anyone from Facebook all piling down to go and have a look at the eBuyer deal. &nbsp;</p> <p>Then there's the others.. The rubberneckers. &nbsp;Those are the types who slow you down on the highway by leaning out of the window of their car watching the ambulances wheel off the bodies. &nbsp;They're down there too. &nbsp;Looking for the charred remains of eBuyer and the scorchmark of their PR agency. &nbsp;</p> <p><strong>So how did Amazon survive their Black Friday sales?&nbsp;</strong></p> <p>Well, that's fairly straightforward. &nbsp;Amazon are *vast* and incredibly intelligent when it comes to business analysis. &nbsp;Amazon have been running sales for a lot longer, on a massive scale, but they've learnt from their mistakes. &nbsp;I can remember the Amazon sites falling over at peak time over Christmas. &nbsp;It's happened. &nbsp;It used to happen quite often, but they scaled up, and they scaled out. &nbsp;That's the only way they got to be one of the top eCommerce sites active on the internet. &nbsp;</p> <p>I'm not saying that eBuyer need the same level of architecture as Amazon have, but the key point is the Business Intelligence that's missing. &nbsp;This is how the conversation should've gone:</p> <p><strong>Date: </strong>01/11/11<br /><strong>Place: </strong>Business Intelligence Dept, Ebuyer HQ.</p> <p><strong>Alice: </strong><em>"Hey Bob.. On our mailing list, we've got a reader coverage of, hey, let's say 750,000 people, right?"</em></p> <p><strong>Bob : </strong><em>"Sure Alice, Why?"</em></p> <p><strong>Alice: </strong><em>"When we launch the &pound;1 deals on the 28th of November, I bet they're all gonna visit at 10:20, so they can sit there and refresh until we launch the deals."</em></p> <p><strong>Bob:</strong> <em>"Oh Alice, you're so wise. &nbsp;We need to tell the Operations team so that they can get some extra server power in for that day."</em></p> <p><strong>Alice : </strong><em>"Correctamundo, Bob. &nbsp;Imagine if we launched these deals and our site went down. &nbsp;Boy would our faces be red!".</em></p> <p>&nbsp;</p> <p>I can speak with experience when I say that I've worked in places where they fail to plan for scalability during sale season, or before a product launch. &nbsp;It's impossibly stressful to be given less than a week's notice of this kind of event, and have to be in the position to ensure the site's stability and continued uptime. &nbsp;In some cases, it is *actually impossible*, especially without a massive amount of planning, scaling up the number of servers, increasing the bandwidth to the routing core. &nbsp;Sorting out load balancing, particularly eCommerce aware load balancing.. It's tricky.</p> <p>&nbsp;</p> <p>This is where "cloud" services and infrastructure comes into it's own. &nbsp;Numerous cloud IaaS providers are offering scalable bandwidth, pay as you go, scalable servers, add as many as you like to their scalable cloud load balancers. &nbsp;eBuyer would only have had to pay for a couple of weeks usage, probably. &nbsp;A few days for testing, then 2 days either side of today to iron out bugs. &nbsp;I'm sure that it could have been handled more gracefully.&nbsp;</p> <p>Somewhere inside eBuyer HQ, someone forgot to tell the Operations team. &nbsp;Perhaps one day, advertising and marketing teams will come down from their high horses, and realise that without full support from the entire company, an advertising campaign such as this is actually seriously detrimental to the company. &nbsp;</p> <p><strong>Live situation update: It's 11:44 on the 28th</strong>, and eBuyer's site is <strong>still down</strong>. &nbsp;@ebuyer on Twitter are attempting to make up for their technical faux-pas by promising better servers for future sales. &nbsp;Yes, well done.. That's called "Locking the door after the horse has bolted".</p> <p>&nbsp;</p> <p>I last wrote about a&nbsp;<a href="/blogish/cost-forward-thinking/">similar problem in 2009</a>, when Derren Brown advertised his website on his TV show, and it was down for 2-3 days. &nbsp;Since then, I'm still seeing the same problems, companies failing to anticipate server load caused by advertising. &nbsp;Nothing's changed. &nbsp;It's still embarrasing. &nbsp;It's still unacceptable, and in this case, for eBuyer, it's going to prove very costly. &nbsp;Not only have they lost the potential of more sales from their &pound;1 sale, but they've also lost the regular traffic buying stuff for their day-to-day needs.</p> <p>Black Monday for eBuyer, Stunningly good day for their competitors.</p> <p>&nbsp;</p> So, You Wanna Be a Sysadmin? http://tomoconnor.eu/blogish/so-you-wanna-be-sysadmin <p>&nbsp;</p> <p>So you wanna be a good sysadmin? I don't blame you. It's fun, and it's lucrative. Especially if you do it right.</p> <p>The difference between a good admin and a bad one are many and varied.</p> <p>Most importantly, it boils down to a level of devotion to the company. And a knowledge that is expansive. &nbsp;</p> <p>Not that it has to be all-encompassing. One of the important things to know is the limit of your knowledge. &nbsp;Know your comfort zones, and know your limits.</p> <p>There is nothing wrong with not having an instant answer, but there is something with not being able to find an answer. Powers of inference and deduction are key to your success, and you should exercise them frequently.</p> <p>I'd much rather work with someone who knows what they do not know, than someone who will blag it.&nbsp;</p> <p>You've also got to recognise your weaknesses, and work hard to ensure that they don't impact your work.</p> <p>&nbsp;</p> <p>Among sysadmins, the biggest weakness I see is ego.</p> <p>Ego, especially in an enterprise or commercial environment is a killer. Egotistical sysadmins will act as if the system is their Property. &nbsp;Often failing to document important infrastructure, or trying to make sure that "the company can never fire them" &nbsp;as they've engineered themselves into a critical position.</p> <p>This is a massive, yet all too common anti-pattern among admins.&nbsp;</p> <p>As I mention earlier on, a good admin needs to be devoted to the success of the company. With or without them.</p> <p>One of the biggest problems with Sysadmins with an ego the size of a planet, is the inability to accept personal responsibility. &nbsp;This is a real double-edged sword. &nbsp;There&rsquo;s some things which, at some point in time, will be, or will have been your fault. &nbsp;It&rsquo;s up to you to do two things. &nbsp;One, you&rsquo;ve gotta take the rap for it. &nbsp;Admit you were wrong, and apologise. &nbsp;Secondly, and more importantly, it&rsquo;s down to you to debrief the rest of the company about what happened, why it happened, and what you and your team will do to ensure that it doesn&rsquo;t happen again. &nbsp; You&rsquo;re allowed to make some mistakes, everyone does, but it&rsquo;s a fool who doesn&rsquo;t learn from past mistakes.</p> <p>&nbsp;</p> <p>You also need to consider what happens if you're unfortunate enough to get fired/made redundant?</p> <p>Bad times, but you'll only make them worse for yourself if you're petty enough to have installed logic bombs or backdoors. &nbsp;</p> <p>Let me tell you this. There are some very skilled sysadmins out there. Some better at computer forensics than me. Many with better toolkits and detection algorithms and hardware to recover deleted files.</p> <p>We will catch you. You will get found out. You will get into trouble, and you will never work in IT again.</p> <p>You could spend 10 years building systems and making a perfect CV, but if you let your ego get the better of you, you might as well have not bothered.</p> <p>&nbsp;</p> <p>I work hard to ensure that the changes I make are made for a reason; and they're well documented. The thing I fear most in any system, is a Single Point Of Failure. Engineers have worked for years to eliminate SPOFs from a number of systems. &nbsp;The important SPOF that must not be forgotten is the human factor.</p> <p>If you were hit by a bus tomorrow, what would happen? &nbsp;Are there passwords that only you know? &nbsp;Scripts that are only on your Mac?&nbsp;</p> <p>Citing &lsquo;security&rsquo; as a reason not to disclose information is stupid and childish. &nbsp;Sure, don&rsquo;t put passwords on a public wiki, but do put them in a password management utility, and do share access to that to your team. &nbsp;It&rsquo;s the same as that old adage, &ldquo;There&rsquo;s no I in TEAM&rdquo;, but without a solid team, your skills are of no use to the company. &nbsp;</p> <p>&nbsp;</p> <p>Empire building is a common trait among sysadmins. Often in a new job, an admin will seek and destroy existing systems because they're not perfect in their eyes. Only in their eyes, mind you.</p> <p>An existing system could have been running non-stop for 20 years on AS/400, but that doesn't warrant a costly move to x86 blades, based on a pitch from an amply bosomed <a href="http://www.standalone-sysadmin.com/blog/2011/09/seriously-stop-with-the-booth-babes/">Booth Babe</a>.</p> <p>No, again, you need to think in terms of what is best for the company. "The Greater Good", not flashy new toys.</p> <p>The flashy new toys thing is massively dangerous. &nbsp;There are companies out there who don&rsquo;t shop around, who aren&rsquo;t interested in actually researching what they&rsquo;re being sold, and where mis-selling of infrastructure happens a lot. &nbsp;It&rsquo;s down to the sysadmin (or engineer) to actually test out stuff, instead of going with whichever has the best looking hardware, or the most promised (but invariably, individually licensed) feature sets. &nbsp;If that means going with slightly less bleeding edge technology, because it&rsquo;s more tried and tested, then so be it.&nbsp;</p> <p>&nbsp;</p> <p>There is absolutely nothing wrong with being a lazy sysadmin. &nbsp;Being irresponsible, on the other hand, is a massively concerning trait, and should be addressed as soon as possible. &nbsp;</p> <p>I frequently find myself doing things to make my life easier. &nbsp;I&rsquo;m a big fan of automated installations, Puppet, Kickstart/debian-installer, and centralised logging and monitoring. &nbsp;</p> <p>The reason for this, is that I don&rsquo;t want to repeat myself. &nbsp;I find building systems very enjoyable, but the minutia are very tiresome. &nbsp;I&rsquo;d rather do something once, and repeat the action, rather than do something a dozen times on different servers.</p> <p>Being a lazy sysadmin effectively means that you can concentrate on the important and interesting stuff, rather than spending all day working on something boring and trivial. &nbsp;</p> <p>Being irresponsible would be ignoring logs, and being obstructive with documentation, and going out of your way to piss people off. &nbsp;This is the &ldquo;media&rdquo; view of many sysadmins, not helped by the wicked and evil character Denis Nedry in Jurassic Park. &nbsp;You remember, he took power systems and security offline so that he could steal stuff un-noticed, then initiated logic bombs and so on to cover his tracks and prevent his detection. &nbsp;</p> <p>&nbsp;</p> <p>Don&rsquo;t be like that. &nbsp;You might &nbsp;end up like him, getting eaten by a Dilophosaurus.</p> <p>(You&rsquo;ll probably just get fired, and never work in IT again)</p> <p>&nbsp;</p> Coming Out - My story http://tomoconnor.eu/blogish/coming-out-my-story <p>&nbsp;</p> <p>I came out roughly of my own accord, I think it was sometime in November 2000, but I can't be that precise on the date. &nbsp;It seems a long time ago now. &nbsp;I say 'roughly of my own accord', because as the story will unfold, some might say I was outed. &nbsp;</p> <p>As a mere technicality, I came out to my internet group of friends a while before this. &nbsp;I remember that a lot more clearly as being a few days before my 13th birthday, or was it my 14th? Anyway.</p> <p>I found a huge group of other guys, all the same age (apparently(!)) who were all going through the same things. &nbsp;</p> <p>In the actual process of my coming out in reality, I'd been planning my thoughts on paper, as I knew that the conversation itself would come up soon, and when it did, I'd wanna be ready. &nbsp;I wasn't the best secret-keeper at that age. &nbsp;I told a bunch of "friends" at school, some were supportive, some gave up my truths to the kids who bullied me anyway, and that gave them more ammunition. &nbsp;Anyway.&nbsp;</p> <p>Writing things down on paper proved to be the catalyst for my eventual coming out. &nbsp;One of my teachers got hold of this notebook. &nbsp;Fuck knows how. &nbsp;Perhaps I'd left it somewhere in a lapse of personal security.&nbsp;</p> <p>Anyway. &nbsp;She phoned my parents. &nbsp;And told them <strong>Everything</strong>.</p> <p>I got back from a youth group, and Dad said "One of your teachers called earlier, and we need to talk". &nbsp;My mind rattled through a bunch of alternative possibilities. &nbsp;Was I in trouble? What on earth had I done that could possibly cause that kind of parent-teacher interaction with such urgency.</p> <p>We sat down in the lounge, and Mum asked me outright. &nbsp;"Tom, are you gay?". &nbsp;I admitted, and I don't remember a lot after that. &nbsp;I remember crying in her arms, more out of relief than anything else.</p> <p>Turns out my parents had known all along. <em>&nbsp;As they always seem to do.&nbsp;</em></p> <p>My parents and I have a very healthy, open dialogue about my homosexuality. &nbsp;They've met almost all of my boyfriends, they've been out clubbing with me in Birmingham, for my 20th and 21st birthdays. &nbsp;</p> <p>I only wish that everyone could have such open and accepting parents, but I'm afraid that the truth of the matter is, that not everyone is as accepting and modern-thinking as my folks.&nbsp;</p> <p>To that end, if you're coming out today, then rest assured, the community will support you, and the organisations that exist will do so too.</p> <p>Further Reading: <a href="/blogish/it-gets-better/">My It Gets Better story</a></p> <p>Endnote:<br />The next day, I had an interesting conversation with the headteacher of my school. Apparently the teacher in question had acted outside of school policies, and was pretty severely reprimanded in the coming weeks. &nbsp;I don't begrudge her actions today, but it's certainly not the best way to go about these things.</p> <p>&nbsp;</p> <p> <p>For help and advice on coming to terms with being gay, you can call the Lesbian &amp; Gay Foundation&nbsp;helpline on 0845 3 30 30 30 (local call rate), between 10am and 10pm or use their&nbsp;<a href="http://www.lgf.org.uk/Our-services/helpline-and-email-advice/">online contact form</a> to receive a reply within 72 hours.&nbsp;</p> <p>Stonewall also offer <a href="http://www.stonewall.org.uk/at_home/coming_out/default.asp">advice on coming out</a>.</p> </p> <p>&nbsp;</p> A Sensible Java Build Tool http://tomoconnor.eu/blogish/sensible-java-build-tool <p>&nbsp;</p> <p>I've been writing Java in one sense or another for a few years now. &nbsp;I learnt stuff at university, then used it in a few jobs. &nbsp;I've written Beans and Applets, and various bits of stuff in between.&nbsp;</p> <p>It's fairly safe to say, that I like Java. &nbsp;</p> <p>One thing however, that's been a pretty consistent bugbear in all the time I've been writing Java, has been the classpath, and dependency resolution. &nbsp;Luckily, all that can now change. &nbsp;</p> <p>I used to think that Ant was a pretty neat build tool. &nbsp;All the IDEs supported it, it kinda worked most of the time, but sometimes, building was a bit of a ballache - Some stuff had to be in your lib/ folder, sometimes in Ant's lib/ too. &nbsp;</p> <p>Lately though, and this week in particular, I've been playing with Maven. &nbsp;</p> <p>Maven is a pretty fucking cool build tool for Java applications. &nbsp;I suspect it probably works with other languages, but it's "designed" for Java.&nbsp;</p> <p>I don't think I really have the expertise or knowledge to explain how Maven works, partly because I haven't studied the inner workings that deeply, but also, because it's far better explained here (http://maven.apache.org/what-is-maven.html).</p> <p>Instead, I'm going to dive right in, and explain what I've been working on this week. &nbsp;</p> <p>The company I work for currently, is making a pretty radical shift away from using PHP for everything. &nbsp;Instead, we've been investigating Java for creating a middleware layer that everything can talk to.</p> <p>I'm pretty chuffed with this, but I do wish that it had come a lot earlier on. &nbsp;If it had, I might not have been so decisive to leave when offered a better job.</p> <p>Basically, when we came up with this project, I insisted that we do it properly, for a change. &nbsp;</p> <p>I suggested that a good workflow would be something like: Netbeans IDE -&gt; Maven Project -&gt; Git SCM -&gt; Jenkins CI -&gt; Maven Repository (We chose Artifactory, but I did test Sonatype Nexus too, but didn't like it).</p> <p>This is a good pattern for the Joel Test's "<em>Can you make a build in one step?</em>"</p> <p>I basically wanted to create a demo project that can be used as the basis for all future FR projects, I do the R&amp;D to make the initial POM work, then everyone else can clone this, or inherit from it..&nbsp;</p> <p>This decision was twofold, I also wanted to figure out JPA/Hibernate and have some clue how that works for reverse engineering the classes from an existing database, the answer to that is: Pretty well, actually. - But that's another story.</p> <p>My IDE of choice is Netbeans. &nbsp;I've been using it since I was at university, except for a small android-related foray into Eclipse, and an experimental nosing around IntelliJ IDEA.&nbsp;</p> <p><strong>Stuff I did:</strong></p> <p><ol> <li>Created a new Netbeans Maven project from the quickstart archetype.</li> <li>Added the Dependencies on Hibernate (all the sub-dependencies get resolved, and added)</li> <li>Added the &lt;scm&gt;&lt;/scm&gt; and &lt;ciManagement&gt;&lt;/ciManagement&gt; lines to the POM</li> <li>Added maven-shade-plugin to allow us to build a fat JAR, which makes the jar bigger - it includes all the dependency JARs, but does make deployment a damnsight easier.</li> <li>Configured &lt;distributionManagement&gt;&lt;/distributionManagement&gt; to contain the url of the repository we're using.</li> </ol></p> <p>That's pretty much it. &nbsp;<a href="https://gist.github.com/1099270">Here's the finished POM</a>, with various bits of secret removed.&nbsp;</p> <p>When I edit something in Netbeans, and commit a change, there's a post-commit hook (post-receive) that calls the Jenkins API, and builds the project. &nbsp;Jenkins then deploys the artifacts (a fat JAR and a POM) to the Artifactory.</p> <p>Epic.</p> <p>&nbsp;</p> Deeply Concerning http://tomoconnor.eu/blogish/deeply-concerning <p> <p>Right. &nbsp;This is important. &nbsp;I want you stop what you're doing and read this. &nbsp;It won't take long.&nbsp;</p> <p>I've just witnessed another act of homophobic bullying amongst school children. &nbsp;</p> <p>Sadly this time, they weren't in uniform, so tracking down the school responsible is going to be somewhat harder. &nbsp;What I can tell you is that there were 4 boys, three black, one white, and all very troubling.</p> <p>The thing that troubles me most, as gay man living in london, is that if these kids are to be believed, then we are all under threat. &nbsp;</p> <p>As the kids boarded the bus, three of the kids goaded the other one with chants like "<em>dirty queer</em>" and "<em>fuckin battyboy</em>". &nbsp;This alone troubles me. &nbsp;</p> <p>I thought that now that Section 28 has been repealed, that schools are supposed to encourage a level of tolerance and acceptance. &nbsp;This is evidently not true of these kids. &nbsp;</p> <p>I think we need to do something about this. &nbsp;<strong>Together</strong>. &nbsp;Not as a group of gay people trying to right the wrongs of the school curriculum, but as members of society.</p> <p>I genuinely feel bad for the kid they were harassing, that kid being merely an echo of my former self. &nbsp;</p> <p>One of the problems I experience when I see these types of incident is that I don't always feel comfortable to intervene. &nbsp;Last time was a different case, the kids were all in&nbsp;<a href="http://www.hollandparkschool.co.uk/">Holland Park School</a>&nbsp;uniforms, so if any of them tried anything funny, I'd have at least some idea where they were from.</p> <p>These kids today looked and acted a lot tougher. &nbsp;I tried my best to listen in to their further goading and haranguing over their tinny R&amp;B <a href="http://www.urbandictionary.com/define.php?term=Sodcasting">sodcasting</a>, but didn't really get very far.</p> <p>The general high-level overview of it is "<em>You're different, we don't like that. You'd better die before we kill you</em>". &nbsp;I don't know about you, but I'd say that kind of talk is pretty bad for teenagers who by that age, really should know better.</p> <p>So. &nbsp;Here's an interesting idea. &nbsp;I'd like to know what the actual problem is. &nbsp;</p> <p>Are schools not handling homophobia, when it comes up, do they brush it casually under the rug, like <strong>The Chase</strong> did?</p> <p>&nbsp;</p> <p>Do they have any out gay members of staff who are prepared to act as a positive role model for students? I know as sure as hell that this would have helped when I was having similar problems.</p> <p>What exactly are kids taught these days with regard to homosexuality? &nbsp;I mean, when I was at school it was very glossed over. &nbsp;Something along the lines of "<em>There are these people called homosexuals. &nbsp;What they do is bad.</em>"</p> <p>I would like all of you to write a letter to the Headteacher of your local school. &nbsp;If it's one that your children go to, then that's all the better. &nbsp;I want you to ask them the following questions.</p> <p><ol> <li>What does the school do to combat homophobic bullying?</li> <li>What level of teaching is there with regard to homosexuality?</li> <li>Do you have any out gay members of staff who act as outreach to gay kids growing up?</li> <li>If not, why not?</li> </ol></p> <p>Usually, I'm pretty proud of London. &nbsp;It's a great city.&nbsp;</p> <p>Sadly today, I feel let down by the city and its future generations. &nbsp;It's deeply concerning, and up to us to do something about it.&nbsp;</p> </p> Bored Engineer http://tomoconnor.eu/blogish/bored-engineer <p>So there's this saying, "There's nothing more dangerous than a bored engineer"; I tend to think that it's true. &nbsp;I've had very little to do at work lately, which has been in equal parts frustrating and annoying. &nbsp;I like having stuff to do. I like having plans for the future, but at the moment, there's very little.</p> <p>Anyway. &nbsp;I popped into Westfield the other day, and caught a Free BBC Prom. &nbsp;Very cool. &nbsp;Then I had a poke around on my mobile and realised two things.</p> <p>1) There is no mobile proms website.</p> <p>2) There is no mobile proms app!</p> <p>So I thought I'd have a go at writing one. &nbsp;Given that I have a Google Nexus S, and all of the SDK bits.</p> <p>I wrote a parser/scraper for the BBC Proms website (about 100 lines of python, using BeautifulSoup and simplejson) - I might Github this later on.</p> <p>I then set about writing a thing for the Android that would let me browse the list of proms, give me information about where they are, what time, etc. &nbsp;It's pretty close to being complete. &nbsp;Another day of development and it'll do most stuff.</p> <p>If you've got a 2.1 or better Android, then you can have a play with the v0.2 Beta of PromGuide by clicking <a href="/media/PromGuide-0.2.apk" target="_blank">here</a>&nbsp;or scanning the following QR code:</p> <p><img src="http://bit.ly/jBZ6TK.qrcode" alt="0.2 PromGuide QR Code" width="249" height="249" /></p> <p>If you find it useful, or broken, or totally hopeless, leave me some feedback.</p> Cloud Backup Strategy http://tomoconnor.eu/blogish/cloud-backup-strategy <p> <p>It has recently been brought to my attention that a number of users of cloud-based hosting services tend to use an "integrated" backup solution provided by the cloud host. &nbsp;This is probably some form of snapshot-based backup of a server's state.&nbsp;</p> <p>I quite like the idea of doing this, especially if there's no impact to the server being backed up whilst the snapshot is taken.&nbsp;</p> <p>However, I can immediately see one big problem with it. &nbsp;</p> <p>At least one scenario I can see that would require me to restore a backup is failure of the server host. &nbsp;Under this circumstance, it might be possible that a) you will be unable to get hold of the backup, which is probably stored somewhere on their storage cloud. or b) You can get access to the storage, but the backup is a proprietary format, either a raw snapshot, or a VMDK disk image which might be difficult/impossible to transfer to a different host. &nbsp;</p> <p>I'd be especially scared of using snapshot-backups for a database server, because in the unlikely event that the restore target is different to the backed up server, you might have some compatability problems, especially if you're using x86 MySQL and go to a x86-64 host. &nbsp;</p> <p>For this reason, I think it's probably best to have a couple of different backup strategies. &nbsp;</p> <p>I suggest having a snapshot backup is a good thing, and will allow a very fast restore process, but is only useful while your server's host is online. &nbsp;</p> <p>In the event that your host has gone down, it's important to have an offline/offsite backup. &nbsp;This alternative backup should also be as platform agnostic as possible.</p> <p>In other words, any databases should be exported as SQL files, and as far as possible, the system state should be backed up. &nbsp;I tend to keep track of what packages have been installed by storing `dpkg --get-selections &gt; /var/lib/backup/dpkg-state` or similar. &nbsp;This means that if I have to rebuild a server, i can just use that file, and restore the state of package installations really quickly and easily. &nbsp;</p> <p>That, and a copy of /etc, and restoration should be pretty easy.</p> <p>On the other hand, the concept of trying to restore a VMware, KVM or Xen snapshot (which might be inaccessible, or otherwise unavailable for export/download) onto a different system entirely, frankly fills me with a little bit of fear.</p> <p>Given the choice, a snapshot restore is almost certainly preferable, but it'd be prudent to have a backup strategy for your backup strategy. ;)</p> </p> Britannia Country House Hotel, Manchester. http://tomoconnor.eu/blogish/welcome-gates-hell <p>&nbsp;</p> <p>I cannot begin to understand what the General Manager of the Britannia Country House Hotel, Manchester (BCH) is thinking when he runs the hotel day-by-day.</p> <p>Never before, have I found such incompetance among public-facing hoteliers. Firstly, a Disabled room was requested at the time of making the booking. &nbsp;We were given a non-disabled room on the 4th floor.&nbsp;</p> <p>*pester*</p> <p>Now a disabled room on the 1st floor.&nbsp;</p> <p>4 hours later, the main lift packs up. Stops working entirely, because *apparently*, 5 days ago, it was full of 8 american tourists, with 8 biiiiig bags, all crammed in so tightly they exceeded the weight limit and had to be freed by the fire service.</p> <p>Did the BCH have the lift fully repaired since then? Apparently not. &nbsp;We got in and it made a worrying *groink* noise before the doors closed.</p> <p>Anyway, 4 hours or so after checkin, the lift freezes and goes to the 4th floor, where it locks itself down, and won't move for love nor money.</p> <p>Leaving my disabled roomie trapped on the first floor.</p> <p>On investigation, it's revealed that they don't have an Evac-chair. &nbsp;Nor a service lift, not any means of getting people from Disabled Rooms (on the first floor), down to safety. &nbsp;</p> <p>Fuck knows what their fire contingency plan is. &nbsp;(Actually, my roomie spoke to the duty manager who was equally unaware of any fire contingency plans.</p> <p>Apparently there wasn't a lift engineer available to fix it within 24 hours, so he had to be carried down a flight of stairs on a chair, by 4 heavy barmen. &nbsp;Not exactly dignified. &nbsp;</p> <p>So after a *lot* of jiggery-pokery with some more unhelpful, rude and incompetant hoteliers, we now had a room on the ground floor, save for being up 3 steps, which have a plywood/carpet ramp. &nbsp;Which moves and flexes with every step. &nbsp;It's also quite a steep ramp, probably impossible to navigate with a wheelchair, based on its narrowness too.&nbsp;</p> <p>The room is also smaller than the previous room, with no disabled handrails, or pull cord.</p> <p>I also discovered, much to my infuriation (being someone who requires a hot shower in the morning, lest I be an evil cunt all day), that the shower didn't actually work. &nbsp;Some kind of mixer tap with a pull-up knob to divert the water flow, actually doesn't pull up at all.</p> <p>Secondly, and more worryingly, The in-room phone doesn't work. &nbsp; Combine this, with the room not having a disabled pull alarm, means that if Sam did fall in the bathroom, or anywhere else, he'd be completely stranded. &nbsp;Can't rely on mobile phone signals in these rooms, the windows seem to be lead-glass and the walls forged from bricks of Depleted Uranium.</p> <p>The hotel manager sent a maintainance man around, who poked at the shower, and the phone, and came to the conclusion that the shower was *so* old, and full of limescale that it was shagged, and the phone was more frustratingly "fucked". Apparently this hotel is made of 2 sections. &nbsp;The front bit is newer, and more modern, and the back bit is a converted block of flats. &nbsp;Apparently none of the phones in this back bit work.</p> <p>I managed to get 2 decent showers out of the shower, before it returned to original form, and stopped being functionally usable, and was just a dribbly tap. &nbsp;Great.&nbsp;</p> <p>I would mention it to the hotel staff again, but I don't think they really give a fuck.</p> <p>So, it's Monday morning, and we're not due to check out until Tuesday morning. &nbsp;*knock knock*. Oh, it's you. Head of Housekeeping. &nbsp;I think I'll name you Chardonnay for the duration.&nbsp;</p> <p>Yes, we're not checking out until Tuesday.&nbsp;</p> <p>*4 hours later*</p> <p>*sounds of key in lock*</p> <p>I go and answer the door, before she has a chance to unlock it further, and see middle aged cleaning woman (Helga, perhaps?), doesn't speak a fucking word of english, other than "my boss say this room empty"</p> <p>me: "Well, we're not checking out till tomorrow"</p> <p>her: "My boss say room empty"</p> <p>me: "Well, your boss is an idiot".</p> <p>her: "I go away now"</p> <p>5 minutes later, Chardonnay, Helga, and some guy turns up, and &nbsp;says "Yes, the cleaning lady doesn't speak much english"</p> <p>me: "Yes, I told you earlier, we're not checking out today."</p> <p>*sighs*</p> <p>Seriously. Would it be too much to ask for people who are employed in the UK to be able to speak passable english?</p> <p>Would it make sense if they knew what Do Not Disturb means?</p> <p>I wonder how many times Helga has caught someone in flagrante delicto whilst trying to service their rooms? &nbsp;Is she some kind of voyeuristic cleaning-pervert?</p> <p>"I wash your sheets, you make them dirty!"</p> <p>FFS, BCH. I'm used to far better customer service. Far better staff, far less rude cleaning staff, and generally, not being fucking disturbed when i leave a DND sign on the knob. &nbsp;What part of that is so fucking difficult to grasp?</p> <p>The available food at the hotel is similarly gash. &nbsp;Apparently they have an on-site pizza place. &nbsp;I'm yet to actually see anyone eating in it though. &nbsp;Someone asked at reception about the hotel pizza place, and they got given a Dominos menu. &nbsp;Insert comment here about dogfooding (or is that the toppings on the pizza?)</p> <p>There was a "Light Bites" menu available, which seems to have been mostly microwaved ready-meals, except for the "Stuffed Potato Skins", which were skins filled with tomato puree (tube quality), topped with cheddar, and microwaved.</p> <p>Eugh. So so so acidic.&nbsp;</p> <p>Sam ordered the Bruschetta, and we were both surprised that it was Ciabatta, untoasted, cut end-ways, rather than length ways, so it was 6 slices, each with a surface area of about 3 square inches, and coated with a thick layer of Margarine, topped with some raw onion, raw peppers and raw tomatoes.&nbsp;</p> <p>Perhaps we're spoiled, and London really is the paramount of global cuisine, but something tells me, that this isn't the case, and the cooks at the hotel are as incompetant as the rest of the fucking staff.</p> <p>On the day we checked in, Thursday, there was a "Carvery", which was actually just some lukewarm roast pork, and palid apple sauce, where I got a paltry 4 small slices of pig, and could have quite happily devoured 4x that amount, but apparently that wasn't an option. &nbsp;For this, we paid &pound;13.50.&nbsp;</p> <p>On other days, there was one of three options, Something meaty, and tasteless, something fishy, and smells funny, and something vegetarian and cold.</p> <p>Nothing particularly appetising, or nutricious. &nbsp;I am reminded at this time of school dinners, for a similar calorific value, and flavour level.</p> <p>Which reminds me. &nbsp;Further to the aforementioned disability problems, out of a possible 6 bars, only one was at ground level, with no steps to get to, but this wasn't open anywhere near as often as any of the others. &nbsp;The main lobby bar is down a flight of 3, quite deep, stairs. &nbsp;The bar in their built-in "nightclub" is down a flight of 4 steps, then up a further flight of 5. &nbsp;The bar in the back "bistro" area, requires climbing 6 steps, and descending 4.</p> <p>Basically, if you're unfortunate enough to be disabled, and unable to use stairs, you'd better be either tee-total or not thirsty, because your chances of getting a drink are pretty much nil.</p> <p>I'd hate to have to navigate the hotel in a wheelchair, many of the doors are seriously weighty, including the one to the corridor for our room, and that one doesn't open fully, because there's a mysteriously placed sticky-out-bit of wall, which makes opening the door past about 60 degrees, completely impossible.</p> <p>It's almost as if the floor plans were designed by Goebbels himself, as a disabillity assault course, designed to weed out the less capable.</p> <p>Perhaps a word of praise, now. &nbsp;Although only a brief one. &nbsp;The beer is cheap, cold and plentiful, and the bar staff are cute. &nbsp;However, they seem to hate the rest of the hotel staff as much as I do. &nbsp;A fantastic insight, for which I am deeply grateful to see that they have absolutely no faith in their management either.</p> <p>&nbsp;</p> <p>Overall review. &nbsp;Shocking. Don't stay here at any cost. &nbsp;If you do find yourself here, Run like hell.</p> <p>I keep finding "quirks" about this place that leave me aghast and open-mouthed. &nbsp;The lift/disabled access thing being fairly prominent in my mind.&nbsp;</p> <p>Oh, and I saw a rat in the lobby.&nbsp;</p> <p>Photos of this hellish establishment can be found here:&nbsp;<a title="Holy fuck, this place is terrible!" href="https://picasaweb.google.com/tom.bioinf/HotelFromHell?authkey=Gv1sRgCO-O3fCkvsG83AE&amp;feat=directlink">https://picasaweb.google.com/tom.bioinf/HotelFromHell?authkey=Gv1sRgCO-O3fCkvsG83AE&amp;feat=directlink</a></p> Desktops as Servers http://tomoconnor.eu/blogish/desktops-servers <p> <p>Personally, I hate the idea of using a desktop as a server in a production environment. &nbsp;I'm going to define the term "production environment" first. If you've got an environment, any environment where the service provided is relied on by anybody, for any reason, then that's a production environment. &nbsp;If it's just for you, and you don't mind when it all goes wrong and the shit hits the fan, then that's fine.</p> <p><strong>Case in point:</strong> I've got 2 re-appropriated desktops as a pair of Domain Controllers for testing a domain deployment. &nbsp;Each desktop is running Windows 2008 R2 server, and provides Active Directory, DHCP, DNS and Windows Deployment Services. &nbsp;This was fine for testing, and playing around with building workstations, but the problem comes when people find out about this, and want to rely on it. &nbsp;For about a week, I was experimenting with using Windows' DHCP and DNS servers for the entire office. &nbsp;This was fine and dandy until there was a powercut, and neither of the desktops came back on automatically. &nbsp;This is because, unlike most servers, the default ACPI configuration is to start "off", and not "last setting" or "on".</p> <p>So the desktops didn't boot up, and nobody could get a new DHCP lease. &nbsp;Bit of a bugger that, but easily fixed.</p> <p>In the event that I ever do get this kind of scenario in the office in production, where people are reliant on the availability of the Domain Controllers for login and file sharing, then I've already got some HP Proliant servers specced up and ready to order.&nbsp;</p> <p>There's other problems too. &nbsp;Desktop hard disks aren't designed for 24/7/365 operation, and aren't designed for a high duty cycle like that of a server. &nbsp;What disk manufacturers call "Enterprise Disks" are much more sturdily built than "Desktop Disks", they're designed to work harder, at higher temperatures, with higher duty cycles, and are generally designed to be always on. &nbsp;</p> <p>There's also a running trend amongst high capacity desktop hard disks, where they're "Green" or "Energy Efficient". &nbsp;One of the ways that manufactures implement this, is having the disk stop spinning when it's not in use, or send the entire unit to sleep. &nbsp;If you have a RAID set built out of Green Disks, then you'll probably find at some point that the array ends up degraded - "broken" in layman's terms. &nbsp;There's probably nothing wrong with the disk, but the disk firmware has shut it down, or put it to sleep because it's not immediately being used. &nbsp;The RAID controller, software or hardware, sees this as a disk failure, and all hell breaks loose. &nbsp;Especially if you have 2 of them that go to sleep, in a RAID 5 array, then you're really screwed.</p> <p>Desktop motherboards are also a different breed, they're generally designed with Athlon or Intel Core processors in mind, which have a very different fetch-execute cycle to a Server-grade Opteron or Xeon. &nbsp;They're kinda not really designed with server operation in mind, and are sorta "slower" or less performant than an equivalent speed server processor.</p> <p>On the topic of Desktop Motherboards, they're also less built for high memory configurations, typically with 2 or 4 DDR3 slots, and their capability to accept ECC (Error Correcting Code) RAM is very variable. &nbsp;Some do, some don't.</p> <p>I like build-in redundancy, and defence-in-depth, especially when building server solutions. &nbsp;I like having ECC RAM, it's more expensive, but does protect against bit-flip scenarios, those which could cause kernel oops, panics and blue screens of death. &nbsp;I also like having more than one of things, like multiple disks, and so on. &nbsp;I visibly squirm when I find SMEs using desktops as servers, in production, and then find that the "server" (or desktop) only has one hard disk.</p> <p>Server motherboards also often have neat features built in, like more PCI slots (and 64 bit width ones -- handy for RAID cards). &nbsp;There's also iLO/DRAC/IPMI for remote management built in, but remember, if you have remote management, make sure it's configured before it's too late.&nbsp;</p> <p>They also tend to have better BIOSes, which are designed for headless operation, no more "Keyboard not found - Please press F1 to continue" messages, which prevent your headless server from booting.</p> <p>Servers that are built as servers, on server hardware, cost more than a desktop, but last far longer. &nbsp;You get a much greater Return On Investment by not having to replace disks and memory that have failed in the first year, because they've simply worn out.&nbsp;</p> <p>As with any electronic equipment, the bathtub curve of failure rates applies, but the entire graph length is much shorter for consumer-grade hardware.&nbsp;</p> <p>If you look at the cost of a server, along side the cost of a desktop, then the cost of a server really is quite a lot higher. &nbsp;The rub is that the cost of downtime can be enormous, especially if the services provided by the server is core to the business, or it's core to the operations, such as logins, and file sharing (in the case of an office domain).</p> <p>Hardware is cheap, Downtime is damn expensive.&nbsp;</p> <p>Perhaps, along side everything else, the old adage is truer than ever:</p> <p>You really do get what you pay for.</p> </p> mod_rewrite is killing social media. http://tomoconnor.eu/blogish/mod-rewrite-killing-social-media <p>&nbsp;</p> <h2>mod_rewrite is killing social media.</h2> <p>This is a little ranty, but it's really pissed me off lately.&nbsp;</p> <p>That&rsquo;s right. It&rsquo;s you. The ones with image hotlink protection, and the ones who rewrite URLs to do strange and special SEO things, but who don&rsquo;t actually think about what happens when you send someone a link to something.</p> <p>(For the uninformed, hotlink protection is that thing where you get sent a link to an image, but the site owner is being draconian, and redirects you to google, because your referer wasn&rsquo;t their own site, so the image must have been stolen, and put on another webpage (!))</p> <p>Here&rsquo;s what happens. &nbsp;Someone makes a blog, and posts a funny image of a kitten. &nbsp; We all like kittens, so I copypasta the link, and send it to my friend.&nbsp;</p> <p>Problem is, the site owner is being a twat. They think that we&rsquo;re still in the 1990s, and bandwidth is expensive. &nbsp;They set cookies when I visit the site, and then they look for those when I look at their images.&nbsp;</p> <p>I post a tweet like &ldquo;Hey, check out this cute kitty! http://you.are.killing.the.inter.net/kitty.jpeg&rdquo;</p> <p>I have the cookies, so it looks fine. My friends, however, do not, so they redirect to google, or something equally stupid.</p> <p>Here&rsquo;s the result. Either I look stupid, or they look stupid, or both. &nbsp;Neither of these are particularly good things.&nbsp;</p> <p>I can&rsquo;t save the image, and host it somewhere else, because that would be stealing it from the site owner / copyright holder, adding a dose of further legal problems, and also a massive layer of effort on top.&nbsp;</p> <p>Here&rsquo;s what site owners should do. &nbsp;Stop being a twat. &nbsp;If you&rsquo;re concerned about bandwidth usage from your assets, host them on Amazon&rsquo;s S3 cloud, and shovel it all through Cloudfront. &nbsp;Set up a CNAME to your Cloudfront Distribution point, like &ldquo;media.killing.the.inter.net&rdquo;, and serve your static assets through there. &nbsp;You&rsquo;ve got enough bundled bandwidth in the Free Tier to last more than long enough, and you also leave a sensible system by which I can share your media files on the social web.</p> <p>The first time I found this today, was on some guy&rsquo;s site where he claimed to be &ldquo;the self appointed curator of the internet&rdquo;. &nbsp;Hell, &nbsp;I think I&rsquo;m better for the health and wellbeing of the internet, personally. &nbsp;I don&rsquo;t protect against hotlinking, because it&rsquo;s stupid. It&rsquo;s like anti-right-click scripts on websites. Those are fucking dumb too.&nbsp;</p> <p>By &ldquo;protecting&rdquo; your images with some mod_rewrite trickery, you&rsquo;re actually diminishing the traffic to your website. I&rsquo;m never going to link to you again, because you&rsquo;ve got crap policies. &nbsp;You&rsquo;ve also lost the inquisitive organic traffic sources, the people who go &ldquo; I wonder what else is on that site&rdquo;, because you bounce them through to google, instead of your homepage, or the page that the image was originally on. &nbsp;That would be smart, that would mean you&rsquo;d get more traffic in general, more adword hits, etc etc. &nbsp;</p> <p>But no, you&rsquo;re all still living in the past, back in the days when bandwidth was an expensive commodity. &nbsp;Wake up and smell the megabits. &nbsp;We&rsquo;re not in that world any more. &nbsp;If your host is threatening to cut you off for costing them a fortune in bandwidth, tell them to fuck off, and find somewhere else. &nbsp;There&rsquo;s no shortage.</p> <p>Hell, go it alone on an EC2 micro instance on the free tier. &nbsp;I&rsquo;ll even tell you how to do it.&nbsp;</p> <p>Secondly, if I&rsquo;m visiting webpages on your site, I&rsquo;d like you to do 2 things. They&rsquo;re really simple, and you should have been doing them for years.&nbsp;</p> <p>1) When I click a link, I&rsquo;d like the Address bar to change accordingly. &nbsp;Or you can show a permalink link. &nbsp;One or the other. &nbsp; I&rsquo;d like to be able to share your website with my friends on twitter, or IRC, or Facebook. &nbsp;I can&rsquo;t do this if you don&rsquo;t give me the links to share. &nbsp;All I end up sharing is an invalid link that then bounces them to a HTTP Err 500 page, or a 302 Redirect to google. &nbsp;Yeah. Smart move there. &nbsp; NOT.</p> <p>2) This is the biggie. &nbsp;I&rsquo;d really like it if once you&rsquo;ve generated an URL, then it doesn&rsquo;t change. &nbsp;Ever. You could make my life immeasurably easier if I can keep a bookmark to your site for 10 years, and never have to wonder &ldquo;where&rsquo;d that page go? I&rsquo;m sure that URL is right...&rdquo;</p> <p>Oh, and read this: <a href="http://www.w3.org/Provider/Style/URI" target="_blank">http://www.w3.org/Provider/Style/URI</a></p> <p>&nbsp;</p> Seriously, What? http://tomoconnor.eu/blogish/seriously-what <p>Sometimes you read something on the internet and think "Huh? Really?". &nbsp;When I read this, I swear, you could almost hear my brain go *boggle*. &nbsp;</p> <p>When I first started using Java, I remember reading something in the EULA (yes, I read it), about not using it for mission-critical or life-critical circumstances. &nbsp;Something about avionics and nuclear power stations.&nbsp;<br /><a href="http://java.sun.com/j2se/1.4.2/j2re-1_4_2_02-license.html" target="_blank">Specifically </a>"<span style="font-family: Arial, Helvetica, FreeSans, Luxi-sans, 'Nimbus Sans L', sans-serif; font-size: 12px;">You acknowledge that Licensed Software is not designed or intended for use in the design, construction, operation or maintenance of any nuclear facility."</span></p> <p><span style="font-family: Arial, Helvetica, FreeSans, Luxi-sans, 'Nimbus Sans L', sans-serif; font-size: 12px;">&nbsp;</span>The thing is, we all click-through these, because we all suspect that nobody would actually use Java for a nuclear power station, or say, host a mission-critical service on the cloud.&nbsp;</p> <p>However, tonight, that is <a href="https://forums.aws.amazon.com/thread.jspa?threadID=65649&amp;tstart=0" target="_blank">exactly what it appears someone has done</a>. &nbsp;I've also archived the page as a PDF, should it get deleted from sheer terror.<br /><img id="plugin_obj_83" title="File - Scary infrastructure decisions ahead." src="/media/cms/images/file_icons/pdf.gif" alt="File - Scary infrastructure decisions ahead." /></p> <p>I am honest-to-FSM scared by the concept that there could be no built-in redundancy to that system. &nbsp;(Part of me wants the CTO from them to contact me WRT systems consultancy, the other part wants me to run around screaming)</p> <p>I think the commenters say it best, but I'll still add my $0.02 here.</p> <p>While Amazon EC2 may be compliant to a number of standards, and have previously had no major issues, this latest incident should serve as a reminder to all users of cloud infrastructure. &nbsp;</p> <p>It's no different to any other system. &nbsp;It can go down, you can lose your data, and shit can hit the fan.</p> <p>Have lots of redundancy built-in from day one. &nbsp;Have lots of different layers of security and redundancy, like Defense-in-depth for nuclear reactors. &nbsp;</p> <p>Plan for the worst case scenarios, because in systems engineering, we deal with the when, not the what if.&nbsp;</p> The Name Game http://tomoconnor.eu/blogish/name-game <h2>This is real-life Social Engineering.</h2> <p>(If you've just read for the first time today, you should read all of it.)</p> <p><strong>The current meme is the "Royal Wedding Name". &nbsp;</strong></p> <p><strong>BOHICA.&nbsp;</strong></p> <p><strong>Again, It seems that some of you aren't understanding how these things work. &nbsp;The Royal Wedding Name asks for&nbsp;</strong></p> <ol> <li><strong>Your grandparent's name (first name, male or female)</strong></li> <li><strong>Your first pet's name</strong></li> <li><strong>The name of the street you&nbsp;grew up on.</strong></li> </ol> <div><strong><br /></strong></div> <div><strong>Right, you lot. Stop this now. &nbsp; I hate these name game memes, because as you should remember from last time, they're a crafted attack to reveal bits of information about you. &nbsp; Remember what I did to someone's facebook profile based on this info?</strong></div> <div><strong>This one's been going on for a lot longer than I thought.. And a lot of you will be using your real grandparents' names, and the real names of your pets, and the real streets you've lived on. &nbsp;That's just silly. &nbsp;And dangerous.</strong></div> <div><strong>And it's your fault if you get your identity stolen because of that.&nbsp;</strong></div> <div><strong><br /></strong></div> <h3><strong>Previous Memes:</strong></h3> <div><strong>March 4th 2011</strong></div> <p>The current meme is the "Pornstar Name"</p> <p>This meme is asking for your First Pet, and your Mother's Maiden Name.&nbsp;</p> <p>Seriously, These are two of the most common security questions used on a very large number of websites. &nbsp;By publicly tweeting the answer, you are handing over all the details a nefarious hacker needs to compromise your account, and steal your identity.</p> <p>I cannot stress this highly enough. &nbsp;Do NOT tweet your Porn Name / Pornstar Name, or any other of these Name Game memes.</p> <p>There&rsquo;s &nbsp;often a meme going around on facebook/twitter/etc.. One of these note things, you do it, you tag your friends, they do it, and so on, or it proliferates on twitter.</p> <p>These bug me enormously, because they ask for a fair bit of information. &nbsp;Here&rsquo;s a brief summary of the answers you give.</p> <p>&nbsp;</p> <ol> <li>Your Full Name</li> <li>Your Mother&rsquo;s Middle Name.</li> <li>Your Grandfather&rsquo;s Name.</li> <li>Your favourite: Colour, Animal, Drink, Ice cream flavour, Cookie</li> <li>Place of Birth</li> <li>Street where you live</li> <li>Street you grew up on</li> <li>Name of your Pet</li> </ol> <p>&nbsp;</p> <p>I recognise some of those as secret question/answer pairs from a number of websites. &nbsp; I&rsquo;m really only kicking the tyres on this one, but what if someone designed these memes to gather data about people, including data about their past, place of birth, residential address, pet names, other stuff that&rsquo;s commonly asked for sample questions on &ldquo;Secret Question/Answer&rdquo; credentials online.</p> <p>I decided not to participate in this one unsurprisingly. &nbsp;In fact, I recommend that everyone who has done the &ldquo;Name Game&rdquo; note looks closely at their note privacy settings, just to make sure they don&rsquo;t mind everyone knowing this information about them.</p> <p>&nbsp;</p> Where are your eggs stored? http://tomoconnor.eu/blogish/where-are-your-eggs-stored <p>&nbsp;</p> <p>When I was growing up, one of the things that particularly interested me about the English language were idioms and proverbs. &nbsp;</p> <p>I think today, whilst many are still suffering the effects of the week, we should look a little more closely at one particular proverb, and perhaps its effective meaning today.</p> <p><strong>"Don't put all your eggs in one basket"</strong> :- This phrase is commonly (and some might say, <a href="http://herbison.com/herbison/broken_eggs.html" target="_blank">incorrectly</a>) attributed to Miguel Cervantes (in Don Quixote), but some sources have reported its usage as early as 1600. &nbsp;Also of little surprise is that many other historical cultures had similar phrases.</p> <p>OK. &nbsp;We've established that historical peoples knew about having redundancy in their Ova storage and distribution methods, so pray-tell, why has this fantastic tradition been forgotten?</p> <p>I am, of course, talking about the recent (21/04/11) Amazon EC2 and related services outage. &nbsp;<a href="http://www.informationweek.com/news/cloud-computing/infrastructure/229402054" target="_blank">Reddit, Foursquare and Quora</a> are the big 3 companies who've been very public about their outage, but I wonder how many smaller companies and startups who rely on Amazon services for their server needs are also ending up out of pocket (due to lost revenues), or simply offline.</p> <p>So the problem is this. &nbsp;Amazon are fucking cheap, in comparison to pretty much any other VPS solution. &nbsp;This is a royal pain in the arsehole, from a systems engineering point of view, because Amazon also price all of their other services similarly cheap. &nbsp;S3 is Seriously Cheap Storage, (they should have called it SCS perhaps). &nbsp; There's also the Load-balancer and cloudfront CDN frontend, again, incredibly cheap. &nbsp;There's a real movement towards building ones entire infrastructure around the Amazon cloud, and I think this is the problem. &nbsp;Amazon even offer a DNS service (Route 53), so you can serve your website's DNS records from the cloud too. &nbsp;</p> <p>Can anyone see the problem with this? &nbsp;The architecture of the intrinsic scalability of the Amazon cloud does certainly allow you to create lots of small servers for things, so you've got a webserver basket, containing a half dozen server-eggs; and another basket for database-eggs. &nbsp;There's a massive problem here. &nbsp;Enormous problem. &nbsp;All of your baskets are inside one enormous basket. &nbsp;One incredibly big basket called "the Amazon cloud". &nbsp;</p> <p>What appears to be happening to Amazon's cloud at the moment is one of two things:</p> <p><strong>1) </strong>People have built crap websites, or have only one egg. &nbsp;If you've only got one server, and it goes down, you're screwed again. &nbsp;You might as well have a dedicated server from anywhere else. &nbsp;You've still got a massive Single Point of Failure, and when the worst case scenario happens, you're fucked.</p> <p><strong>2) </strong>People have lots of inter-cloud redundancy, but no intra-cloud redundancy. &nbsp;This is akin to having lots of small baskets of eggs, in one big picnic hamper.&nbsp;</p> <p>This is actually very common. &nbsp;It's trivially easy to construct a pretty big network on the Amazon Cloud, you add more EC2 compute nodes, then add some S3 storage, EBS block stores, Cloudfront CDN, oh, maybe Route 53 DNS, how about Simple Payments Service for micropayment, maybe Simple Message Queue, and that's before I get onto their database offerings.</p> <p>Amazon have gone a long way to making sure that everything you could ever need for this kind of system building architecture is there, at one place. &nbsp;<br />They're like Home Depot, only there's a greater chance of Amazon having what you want.&nbsp;</p> <p><strong>ERRR.<br /></strong>There's a problem here. &nbsp;I feel the same way about people who buy a 50 disk SATA array, and fill it with disks with the same batch number. &nbsp;It's no surprise that if one fails, you're probably going to get another failure, caused by the same bug or hardware problem. &nbsp;</p> <p>If you're going for true redundancy in the face of real adversity, then you need to start putting your eggs in many separate baskets. &nbsp;Globally distributed baskets. Baskets held by many different people. &nbsp;</p> <p>I generally approve the use of S3 for system backups, because by and large, it's fast, cheap, and pretty secure (especially if you encrypt it). &nbsp;It's *really* fast if you're uploading from inside Amazon's network. &nbsp;There is an epic problem though. &nbsp;Say you take nightly snapshots, and upload them to S3. &nbsp;One day, your server goes down, either Amazon's fault or one of a number of other reasons. &nbsp;</p> <p>I can see 2 enormous problems here. &nbsp;Primarily, if it's a fault on the Amazon network, it may affect your snapshot storage, and the ability to access them in a timely fashion, so while your Disaster Recovery Plan may say "Download the disk image and redeploy", you may not be able to download the disk image. &nbsp;Then you're screwed.</p> <p>It's also possible that a disk error on the Amazon side corrupts your snapshot images, in which case, again, you're screwed. &nbsp;In a subtly different way.&nbsp;</p> <p>Secondly, and this is a far more "doh!" problem, you may be able to locate and download your disk images, but not decrypt them, because the encryption key is stored on the primary server (also inside the backup image, encrypted). &nbsp;This is easily solved. &nbsp;Copy the key, print it out, and store it in an envelope in the company safe / bank deposit box / other secure location.</p> <p>The biggest problem with all of this, is that there doesn't seem to be a straightforward way to share data and server instances across diverse cloud providers. &nbsp;I'd like to build an universal image, and then deploy it to the Rackspace Cloud, Amazon EC2, Flexiscale, and so on, and be able to&nbsp;</p> <p><strong>a) </strong>interchange data between them easily (not too hard, but would require some API glue)</p> <p><strong>b) </strong>have a global system for GSLB between them, so that if EC2 is offline, then all traffic is mopped up by the other two clouds.</p> <p><strong>c) </strong>Have a sensible "in-one-place" billing system (more API glue)</p> <p>Physically, and from an engineering point of view, the biggest challenge of that lot is b. &nbsp;You'd need true global redundancy, and that don't come cheap. &nbsp; However, I think that's the topic for another blogpost. &nbsp;</p> <p>In the meantime, perhaps you should evaluate where your eggs are, and how many baskets you have.</p> <p>You should worry somewhat when all of your eggs are in one superbasket. &nbsp;</p> <p>Then I think it's time for an ovum redistribution exercise.</p> <p>&nbsp;</p> ISC DHCP and PowerDNS http://tomoconnor.eu/blogish/isc-dhcp-and-powerdns <p> <p>Lately, I've been playing around with a pair of domain controllers in the office, trying to figure out a good way to implement a domain. &nbsp;See, the problem is, this kind of thing is a "nice-to-have" rather than a core requirement. &nbsp;At least as far as the business directors are concerned. &nbsp;Their argument is something like "It worked fine with just a bunch of PCs connected to a switch".</p> <p>I do like things manageable, and planned, and certainly now as we're approaching 50 desktops in the office, plus mobile devices, plus laptops, and FSM knows what else, that there's a real need for a bit more structure and management.</p> <p>I ditched the Draytek's DHCP ability to allow me to test out Windows 2008R2's DNS / DHCP server, which interoperate fabulously, but do have a few limitations when it comes to specifying static leases (outside of the dynamic range). &nbsp;Bit annoying.</p> <p>It does however do the dynamic dns updates, whenever a client gets a new lease, the DNS gets updated automatically. &nbsp;This is cool indeed.</p> <p>I've been thinking of a way to replace this DNS and DHCP functionality with a bit of open-source goodness, because it's a nice thing to have, and even nicer to have for free.</p> <p>I chose <a href="http://www.powerdns.com/content/home-powerdns.aspx" target="_blank">PowerDNS</a>, because, well, I like it, and it's pretty scalable. &nbsp;Apparently it's the DNS of choice for the Wikimedia foundation, and i've used it before in a couple of other tasks. &nbsp;It's got a pretty nice MySQL backend, and also one for Postgres. &nbsp;For the time being, i'll be using the MySQL one, because that's what we tend to use around here.</p> <p>So.. DHCPd, I chose <a href="http://www.isc.org/software/dhcp" target="_blank">ISC's DHCPd</a>, because it's easily installed in Ubuntu. &nbsp;Always a winner there.&nbsp;</p> <p>After a considerable amount of googling around, I figured out how to use the dhcpd.conf file to trigger an event to happen on commit, release and expiry hooks. &nbsp;<a href="https://lists.isc.org/mailman/htdig/dhcp-users/2011-February/012753.html" target="_blank">https://lists.isc.org/mailman/htdig/dhcp-users/2011-February/012753.html</a> and <a href="http://invalidmagic.wordpress.com/2010/03/27/magic-dhcp-stuff-isc-dynamic-host-configuration-protocol/" target="_blank">http://invalidmagic.wordpress.com/2010/03/27/magic-dhcp-stuff-isc-dynamic-host-configuration-protocol/</a>&nbsp;were pretty useful.</p> <p>Then all I had to do was write a bit of python that would interact with the database, and update the records table.</p> <p><strong>Two major things caught me out.&nbsp;</strong></p> <p><strong>1)</strong> Don't forget to COMMIT the data to the database, PowerDNS uses InnoDB on MySQL, so you'll need to commit the transaction, or bugger all happens.</p> <p><strong>2)</strong> apparmor on Ubuntu prevents dhcpd from using the exec() syscall. &nbsp;This is easily resolved by setting apparmor from enforcing to complaining for dhcpd.</p> <p>Here's a couple of bits of code, one is the python updater, and the other shows how this all fits into the dhcpd.conf file.</p> <p><a title="dhcp-event.py" href="https://gist.github.com/931984" target="_blank">https://gist.github.com/931984&nbsp;</a></p> <p><a title="dhcpd.conf example" href="https://gist.github.com/931988" target="_blank">https://gist.github.com/931988</a></p> <p>&nbsp;</p> </p> Policing the Tweet-waves http://tomoconnor.eu/blogish/policing-tweet-waves <p>&nbsp;</p> <p>On Saturday morning, I noticed a particularly dangerous meme (for want of a better word), making the rounds on Twitter.</p> <p>Basically, <a href="http://img847.imageshack.us/img847/438/fallout.jpg" target="_blank">this image</a>&nbsp;was being retweeted over 25 times a minute. &nbsp;</p> <p>After some digging around, I managed to trace the source of the image (that is, it's first known posting) to the /x/ board on 4chan.&nbsp;</p> <p><a href="http://tweetmeme.com/" target="_blank">Tweetmeme</a>&nbsp;&nbsp;<a href="http://tweetmeme.com/story/4329179481/" target="_blank">tells us</a> that it was first reported as being tweeted by @<a href="http://twitter.com/ryphons" target="_blank">ryphons</a>, who still hasn't contacted me for further information, WRT the image source.</p> <p>Tweetmeme also reports over 400 retweets, but I'm certain that the actual figure is much much higher.</p> <p>So, the main thing that I take issue with, is that the image was being interpreted as fact, rather than a simulation, or prediction of what might happen. &nbsp;There is mass panic in Japan already, the last thing we need (as humanity) is the panic and hysteria to spread to the west coast of the USA.&nbsp;</p> <p>While I am not a nuclear physicist, and cannot directly comment on the state of the nuclear reactors. I can definitely say that there is something seriously wrong with taking this kind of "map" as fact.</p> <p>One of the most interesting things about this, aside from @ryphons not stating the original source (Was he the original creator?), is that the company whose logo is on the image "<a href="http://www.australian-radiation-services.com.au/" target="_blank">Australian Radiation Services</a>" have no record, on their website, or on google's index of their site, of the image being theirs. &nbsp;</p> <p>That should be raising red flags for you already.</p> <p>Combine that with the fact that the apparent source of the image was twitter, and prior to that, 4chan, that most reputable news agency (!), and it should be fairly clear why I made the decision to attempt to stem the spread of this image across twitter.</p> <p>I came under quite a lot of flak from a number of tweeps, who were concerned that I was playing down the situation. &nbsp;Rightly so. &nbsp;I am / was trying to prevent undue panic and the spread of misinformation.&nbsp;</p> <p>Twitter is an incredibly powerful tool, allowing fairly free transfer of information between large groups of individuals. &nbsp;Sadly it's also got lots of wankers, spreading <strong>Fear, Uncertainty and Doubt</strong>. &nbsp;It's this that we (as the clever people on Twitter) need to stop.&nbsp;</p> <p>There are many sources of valid information about the situation in Japan, notably from @<a href="http://twitter.com/arclight" target="_blank">arclight</a>&nbsp;and blogging scientists like (<a href="http://morgsatlarge.wordpress.com/2011/03/13/why-i-am-not-worried-about-japans-nuclear-reactors" target="_blank">http://morgsatlarge.wordpress.com/2011/03/13/why-i-am-not-worried-about-japans-nuclear-reactors</a>)</p> <p>&nbsp;</p> <p>I am a scientist. &nbsp;I don't believe in "god", I don't believe in "karma", and I certainly don't approve of trash media. &nbsp;I believe in factual information, and interpretations thereof by qualified individuals.&nbsp;</p> <p>I don't read the Daily Mail for exactly the same reason. &nbsp;What you've got to bear in mind is that the media outlets are in this for the money. &nbsp;They'll continue to print uncertain and scaremongering drivel, because that's what people buy, out of uncertainty, or purely morbid curiosity. &nbsp;Sad fact of the matter is, that tabloid quality news outsells fact and science by quite a large margin.</p> <p>That alone, as a fact is quite sad. &nbsp;<span style="white-space: pre;"> </span></p> <p>&nbsp;</p> Proposal: Increasing Facebook Security http://tomoconnor.eu/blogish/proposal-increasing-facebook-security <p>As I proved in my last blogpost, it's actually trivial to compromise a facebook account given a very small amount of personal information. &nbsp;After talking to a number of other geeks on Friday night, two things became quite apparent.&nbsp;</p> <ol> <li>Facebook security is poor, at best, and the ability to change the user's contact email address is shocking.</li> <li>Security questions and secret answers are easily exposed by social engineering, thus, these questions only work effectively if you have a completely different identity which you only use for secret questions and answers.</li> </ol> <p>I don't approve entirely of having secret questions that aren't related to you directly.. I mean, if you had a secret question which was "What is your mother's maiden name?", and you gave an answer which wasn't true, you'd have to do two things. a) remember that you lied, and b) always use the same one, or you'd be forever confused.</p> <p>Anyway. &nbsp;The real point to tonight's blogpost is that Facebook Security is gash. &nbsp;Seriously, even I was surprised that I was able to change my friend's contact email address, and sucessfully change his password. &nbsp;</p> <p>The only good thing about all of this, is that Facebook lock the account for 24 hours, and email the other email accounts, &nbsp;This was the only way that my friend was able to regain control of his account.</p> <p>I propose that facebook implement two-factor authentication for password resets, and possibly logins too. &nbsp;Given that Facebook already has and retains your phone numbers, it would be trivial, both in cost and implementation to produce a mechanism of 2-factor authentication for advanced profile control.</p> <p><strong>User story:</strong></p> <ol> <li>Alice wants to reset her facebook password. &nbsp;</li> <li>She clicks the Forget Password link, and correctly identifies her profile.</li> <li>She selects one of her registered phone numbers for 2-factor authentication.</li> <li>She then selects whether she is to recieve a voice call, or SMS message.</li> <li>Facebook send a validation code to the number, either as a SMS, or a short voice call, reading out the code.</li> <li>Alice enters the validation code, confirming her identity.</li> </ol> <p>This system would only work if you couldn't change the numbers that Facebook could contact you on (like you can currently change your contact email address), and you had already confirmed your phone numbers with Facebook in advance (on registration, perhaps, it could authenticate your phone number)</p> <p>I don't suppose anyone who works for Facebook reads this, do they?</p> <p><em><strong>Interesting sidenote:</strong></em></p> <p>It appears that it is <a href="http://www.facebook.com/help/?faq=15685" target="_blank">not possible</a> to change a Facebook Security Question, for "security reasons". &nbsp;</p> <p style="padding-left: 30px;">"To protect account security, it is not possible to update your account&rsquo;s security question once you have added one.&nbsp;"</p> <p>Why the buggery not? &nbsp;This seems unusual. &nbsp;Surely these kinds of events (twitter memes, facebook notes for these Name Game things) expose users' security questions and answers, and most important thing to do after a data breach, is to change the credentials in question. &nbsp;</p> <p>Most peculiar...&nbsp;</p> Identity Theft http://tomoconnor.eu/blogish/identity-theft <p>To prove a point about the latest "Pornstar Name" Meme that's currently going around Twitter. &nbsp;Basically, the meme asks for you to tweet your Pornstar name which is comprised of the name of your first pet, and your mother's maiden name.&nbsp;</p> <p>I'm furious about this. &nbsp;Those two names are the two most common answers to security questions found on a number of websites.</p> <p>So. &nbsp;A theory: "Given just a user's facebook name, and their Pornstar name, it should be possible to compromise their facebook account".</p> <p><strong>I did this test with the full permission of the real account holder. &nbsp;I do not condone the use of this information for nefarious or illegal purposes, it is presented for educational use only</strong>.</p> <p>Proof:</p> <p>Open facebook, and click the "Forgot Password" link.</p> <p><img id="plugin_obj_71" title="Picture - Forgot your password?" src="/media/cms/images/plugins/image.png" alt="Picture - Forgot your password?" /></p> <p>1) Identify the target account:</p> <p><img id="plugin_obj_72" title="Picture - Identify the account" src="/media/cms/images/plugins/image.png" alt="Picture - Identify the account" /></p> <p>2) Confirm the account, but click "No longer have access to these"</p> <p><img id="plugin_obj_66" title="Picture - Confirm the account" src="/media/cms/images/plugins/image.png" alt="Picture - Confirm the account" /></p> <p>3) Provide a new email address:</p> <p><img id="plugin_obj_67" title="Picture - Provide a new email." src="/media/cms/images/plugins/image.png" alt="Picture - Provide a new email." /></p> <p>4) Go check that email account for further details on how to proceed.</p> <p><img id="plugin_obj_68" title="Picture - step5.png" src="/media/cms/images/plugins/image.png" alt="Picture - step5.png" /></p> <p>4b) There is a missing step here. &nbsp;I forgot to screencap the bit where it asks your secret question, which may or may not be one of the ones referred to in the Meme, but I bet it is. &nbsp;Mother's maiden name and the names of pets are the most common questions.</p> <p>5) You can then create a new password :O (For an account you don't own. .. Yeah, it's pretty bad, this, isn't it?)</p> <p><img id="plugin_obj_69" title="Picture - step7.png" src="/media/cms/images/plugins/image.png" alt="Picture - step7.png" /></p> <p>6) There is, however a problem. &nbsp;Facebook by default will lock the account for 24 hours. &nbsp;This does however protect the user, as it sends them a load of emails to their other email accounts, basically saying "OH SHIT, WHAT ARE YOU DOING?!!"</p> <p><img id="plugin_obj_70" title="Picture - Locked Account" src="/media/cms/images/plugins/image.png" alt="Picture - Locked Account" /></p> <h2>IMPORTANT:</h2> <p>I'm presenting this information as proof of the theory that the Pornstar Name meme is damaging, and provides enough information to compromise an account. &nbsp;</p> <p><strong>Again,&nbsp;I did this test with the full permission of the real account holder. &nbsp;I do not condone the use of this information for nefarious or illegal purposes, it is presented for educational use only.</strong></p> <p>&nbsp;</p> isdisconnected.info http://tomoconnor.eu/blogish/is-disconnected-info <p><strong>New Project: isdisconnected.info (or How to build an application in 5 days)</strong></p> <p><br />About a week ago, my good friend <a href="http://twitter.com/Moof" target="_blank">@Moof</a> <a href="http://twitter.com/Moof/status/37283994777157633" target="_blank">asked the question</a> <em>&ldquo;Is there a website out there monitoring if countries currently in revolt have full connections to the internet? Is eg Bahrain disconnected?&rdquo;</em></p> <p><em></em><br />I thought this sounded like a challenge too good to pass up, and set about coming up with a way to figure out how we could programattically determine the state of a country&rsquo;s internet. &nbsp;</p> <p><br />I&rsquo;ve lately come up against the problem that when faced with a new idea, the hardest problem is getting it created, and working fast enough to ensure that your idea isn&rsquo;t stolen by another like-minded individual.&nbsp;</p> <p><br />With this in mind, I started work as soon as i&rsquo;d finished $dayjob at about 5pm on the 14th, and didn&rsquo;t stop until 3am. &nbsp;Putting together a week of 5pm - 3am development time, and calling in a favour from a <a href="http://www.jamescun.com/" target="_blank">very good designer</a> I know, meant that we were able to launch the site by early friday afternoon. &nbsp;</p> <p><br /><a href="http://isdisconnected.info" target="_blank">isdisconnected.info</a> is a simple at-a-glance view of the world&rsquo;s internet connection status. &nbsp;Every country has a button, with their name and flag, which is either Green, Orange or Red, depending on the status of their internet.<br />Green is a Systems OK, all checks passed state, Orange indicates that some of the country&rsquo;s server are inaccessible, OR there are no servers registered for that country, and Red indicates that the country is Offline, ie, all servers registered against that country returned a false check status.</p> <p><br />The application is written exclusively in Python/Django, and backed onto a PostgreSQL database, with a hint of memcached in there to accelerate the page load-times. &nbsp;In the hour or two before go-live, I was experimenting with diferent caching settings.<br /><br />Using no page caching at all, the time to load the index page was about 4s (down to page generation, more than anything), rising to 8-10s whilst handling 20 concurrent connections. &nbsp;Moof expected a viral response to the site, especially if it ended up on <a href="http://twitter.com/linklog" target="_blank">Linklog</a>, or <a href="http://www.reddit.com" target="_blank">reddit</a>, so fast performance was a high priority.&nbsp;<br /><br />Due to the way the pages are generated, some of the data doesn&rsquo;t lead itself to caching. &nbsp;Static assets are already served from Nginx, so that&rsquo;s pretty fast and well behaved. &nbsp;The individual country pages (<a href="http://gb.isdisconnected.info" target="_blank">http://gb.isdisconnected.info</a>) don&rsquo;t lend themselves to caching, because some of the data is very changable. &nbsp;<br />In spite of that, the service that provides the data for the graph, does heavily cache the stream. &nbsp;Given that the resolution of the graph is on a scale of hours, the caching time reflects that, so that concurrent hits to a page will get cached graph data. &nbsp;</p> <p>We can also anticipate that more hits will occur to a country which is Offline or Unstable, as people will want to find out what&rsquo;s going on, so having some level of caching on those pages is very important.</p> <p>I experimented with a site-wide cache of all pages generated, but discovered early on that cache invalidation was a big problem, basically country statuses weren&rsquo;t updating quickly enough, based on the lifetime of the cache object, so as a trade-off of having more up-to-date information, against not quite caching so much, having a correct view of the global internet won out, naturally.<br /><br />The index page, now that the list is cached for 10 minutes, loads roughly 1600% faster than before. &nbsp;There&rsquo;s two tiers of caching taking place on this page, firstly queries are cached with Memcached (transparently by Django), and sections of the index are template-cached.</p> <p><br />I&rsquo;m very aware that the site is currently prone to false-negatives, that is to say, sometimes countries appear Unstable or Offline when they&rsquo;re not, but we&rsquo;ve also seen good reporting of positives, such as Saturday morning when <a href="http://ly.isdisconnected.info" target="_blank">Libya </a> was disconnected. &nbsp;<br /><strong>This is a beta service</strong>, at best, still under active development, and still very much reliant on the power of crowd-sourcing to visit out website, get the word out about the application and the project, and ideally submit IP addresses for us to check.<br /> The more IP addresses we&rsquo;ve got, the more accurate the check data will be, and then the more accurate the site will be.<br />It&rsquo;s very difficult to perform accurate statistical functions on a very small dataset, and when you do, the margin for error is vast.<br />We&rsquo;re actively improving the site to make it more feature rich, as well as more accurate by determining servers to register against countries more intelligently.</p> <p>We&rsquo;ve got a reasonably good idea of what&rsquo;s required to make the data even more accurate, and we&rsquo;re working on that at the moment. &nbsp;</p> Monitoring with Munin http://tomoconnor.eu/blogish/monitoring-munin <p>&nbsp;</p> <p>One of the things I&rsquo;m massively fond of when it comes to systems administration, is logging and monitoring. &nbsp;I love <a href="http://munin-monitoring.org/" target="_blank">munin</a>, and still prefer it over <a href="http://www.cacti.net/" target="_blank">Cacti</a> and <a href="http://www.zabbix.com/" target="_blank">Zabbix</a>. &nbsp;I think the main reason is that it allows plugins to be configured with absolutely no browser interaction. &nbsp;<br />Creating a new graph on cacti and zabbix both require a considerable number of clicks. &nbsp;It&rsquo;s easy to install new munin plugins with things like <a href="http://projects.puppetlabs.com/projects/puppet" target="_blank">Puppet</a>. &nbsp;So.. Munin. &nbsp;Let&rsquo;s take a bit of a closer look.</p> <p>There&rsquo;s two parts to a munin installation. &nbsp;<strong>Munin server</strong>, and <strong>munin-node</strong>. &nbsp;</p> <p>Munin server doesn&rsquo;t really do the cool stuff, just data aggregation and graph creation. &nbsp;</p> <p>I&rsquo;ve included an example munin.conf <a href="https://gist.github.com/813786" target="_blank">here</a>.</p> <p>There&rsquo;s only a couple of quirks here. &nbsp;</p> <p>I&rsquo;ve found for the majority of installations, that you can leave the vast majority of settings in-place as they are from the version installed by apt / yum / $package_manager_of_your_choice.</p> <p>So, the actual munin documentation suggests that use_node_name is a dodgy thing to do, but it&rsquo;s actually pretty useful, especially when you&rsquo;re defining SNMP hosts.</p> <p>use_node_name tells the not to grapher to use the hostname that&rsquo;s in [brackets], but instead to use the name in the connection banner (you can see this yourself, once munin is running, to telnet (or nc) to localhost:4949, and the line &ldquo;#munin node at &lt;your host&gt;&rdquo;)</p> <p>SNMP hosts.. are without doubt the coolest thing that Munin can do. &nbsp;by default, the auto-configuration of SNMP hosts will allow you to monitor some interesting things about routers, switches and windows hosts. &nbsp; So.. the only major quirk about this, is that because the snmp plugins run on one of your munin-node instances, so you have to set that as the address in the host definition. &nbsp;In the example, I&rsquo;ve done this on the munin server. &nbsp;</p> <p><strong>Munin-node. </strong>&nbsp;Very extensible, but as far as config goes, the default configuration that comes in the installation is more than capable.&nbsp;</p> <p><a href="https://gist.github.com/813792" target="_blank">Here&rsquo;s mine</a>.</p> <p>If you have multiple munin-servers, or want to retrieve munin-plugin data from Nagios servers, then you can add multiple &ldquo;allow&rdquo; regex lines. &nbsp;</p> <p>&nbsp;</p> <p>So.. Munin plugins. &nbsp;This is the Really Cool Stuff.</p> <p>You can write munin plugins in any language you like. &nbsp;The vast majority on <a href="http://exchange.munin-monitoring.org/" target="_blank">Munin Exchange </a>&nbsp;are written in Perl or Bash. &nbsp;I prefer writing in Python, and the <a href="http://samuelks.com/python-munin/" target="_blank">munin-python</a>&nbsp;module is gorgeous. &nbsp;</p> <p>Basically, you need to handle two things, &ldquo;<em>config</em>&rdquo; and &ldquo;<em>run</em>&rdquo; modes. &nbsp;</p> <p>Munin-run is the thing that handles the plugin, and runs &ldquo;your-plugin config&rdquo;. &nbsp;This is what defines the format of the RRD files that munin uses to generate graphs. &nbsp;OK, so let&rsquo;s look at a simple munin plugin. &nbsp;I think we&rsquo;ll monitor... the number of files in /tmp (well, why not?)</p> <p><a title="Plugin details" href="https://gist.github.com/813813" target="_blank">https://gist.github.com/813813</a></p> <p>If we run that with python tmp_files config, then we get:</p> <pre>graph_title Number of Files in /tmp</pre> <pre>graph_category system</pre> <pre>graph_args --base 1000 -l 0</pre> <pre>graph_vlabel files</pre> <pre>files.info The number of files in /tmp</pre> <pre>files.warning 10</pre> <pre>files.critical 120</pre> <pre>files.min 0</pre> <pre>files.type GAUGE</pre> <pre>files.label files</pre> <p>and if we run it without &ldquo;config&rdquo;, we get:&nbsp;</p> <pre>files.value 18</pre> <p>So, that works. &nbsp;:)</p> <p>&nbsp;</p> <p>Now if we copy that into /usr/share/munin/plugins, and chmod +x, and symlink it into /etc/munin/plugins.. and restart munin-node..&nbsp;</p> <pre>$ sudo mv tmp_number.py /usr/share/munin/plugins/tmp_number</pre> <pre>$ sudo ln -s /usr/share/munin/plugins/tmp_number /etc/munin/plugins/tmp_number</pre> <pre>$ sudo chmod a+x /usr/share/munin/plugins/tmp_number</pre> <pre>$ sudo /etc/init.d/munin-node restart</pre> <pre>&nbsp;* Stopping Munin-Node &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; [ OK ]</pre> <pre>&nbsp;* Starting Munin-Node &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; [ OK ]</pre> <pre>$ munin-run tmp_number</pre> <pre>files.value 18</pre> <p>&nbsp;</p> <p>Cool. &nbsp;Right.. now that&rsquo;s done, and munin-node&rsquo;s been restarted, all we have to do is wait a while, and the new graph will get created. &nbsp;This can take a while, 5-10 minutes is a good guesstimate, but it can be longer.</p> <p>This is the graph produced by the plugin:</p> <p><img style="vertical-align: middle;" src="/media/tmp_number-day.png" alt="Example output from tmp_munin plugin" width="495" height="271" /></p> <p>Clever, eh?</p> <p>If you find that you&rsquo;ve waited ages, and still have no graphs, take a look at /var/log/munin on the munin-server and munin-node. &nbsp;There&rsquo;s plenty of non-cryptic logging there, and it&rsquo;s all pretty self explanatory.</p> <p>&nbsp;</p> Dedicated, Dedicated, Dedicated, Dedicated http://tomoconnor.eu/blogish/dedicated-dedicated <p>After answering <a href="http://serverfault.com/questions/218333/scalable-wordpress-host-for-high-volume-site/218360#218360" target="_blank">this </a><a href="http://serverfault.com/questions/218333/scalable-wordpress-host-for-high-volume-site/218360#218360" target="_blank">question</a>, I reconsidered my answer a number of times, and I&rsquo;ve finally decided to rewrite it as a longer version as a blog/essay on my website. &nbsp;One of my <a href="http://serverfault.com/users/7783/robert-moir" target="_blank">fellow sysadmin types</a> on <a href="http://serverfault.com/" target="_blank">Serverfault</a>&nbsp;wrote an <a href="http://serverfault.com/questions/218005/my-servers-been-hacked-emergency/218011#218011" target="_blank">answer</a>&nbsp;from a blog-post, and I intend to do the opposite. &nbsp;<br />&nbsp;<br />Right. <br />I see a lot of questions which are basically, &ldquo;<em>I want my blog/social network/niche site/new product launch site to handle a whole bunch of traffic, how do I do it?</em>&rdquo;. &nbsp;</p> <p><br />That&rsquo;s pretty much what a lot of these questions boil down to, eventually. &nbsp;<br />I&rsquo;m going to make a few assumptions too. &nbsp;<br />Given that someone&rsquo;s taking the time to ask, I&rsquo;ll assume that they&rsquo;re actually concerned about uptime of the site. &nbsp;For whatever reason, whether it&rsquo;s because their employer is telling them that they must have 5 nines uptime or better, or the site&rsquo;s actually making money for them. &nbsp;Whatever the reason, we can generally accept that these websites are business oriented, and <em>*should*</em> have a reasonable budget assigned. <br />After having worked for a few different companies now, I can also fully accept that this second assumption might be a bit great, and not everyone has a good concept of how large, or encompassing the budget should be.</p> <p>&nbsp;<br />Let&rsquo;s start at the bottom, with the really basic stuff. &nbsp;<br />One server will be OK for a certain level of uptime, but at some point, you&rsquo;ll near the sharp increase of the <a href="http://en.wikipedia.org/wiki/Bathtub_curve" target="_blank">bathtub curve</a>, and the probability that the hardware will fail goes up rapidly, and when it does, which it will, and if Murphy&rsquo;s law is anything to go by, it&rsquo;ll fail when you&rsquo;re out of town, at a wedding, or in the pub.<br />It&rsquo;s for this exact reason that as a Systems Engineer, I can&rsquo;t count any lower than two. &nbsp;What I mean by this, is that everything should come in pairs. &nbsp;Two servers, containing &gt;2 hard disks, 2 power supplies, and so on. &nbsp;<br />So, let&rsquo;s build a server, based on the above theories. &nbsp;<br />Disks fail lots. &nbsp;They&rsquo;ve got moving parts. &nbsp;So let&rsquo;s concentrate on those. &nbsp;If you&rsquo;ve only got one disk, and it &nbsp;fails, you&rsquo;re screwed. &nbsp;So let&rsquo;s put 2 disks into this server. &nbsp;<br />You&rsquo;ve got a choice again between hardware and software RAID. &nbsp;Linux software RAID is pretty good these days, but in some cases, hardware RAID is still preferable. &nbsp;I&rsquo;m a massive fan of <a href="http://www.3ware.com/products/serial_ata.asp" target="_blank">3ware</a> and <a href="http://www.adaptec.com/" target="_blank">Adaptec</a> cards. &nbsp;Hardware RAID, &nbsp;if you get a good card, is invaluable. &nbsp;FakeRAID, as typically found on motherboards, or low-end raid cards is a bit of a ripoff. &nbsp;It&rsquo;s actually a form of software RAID, and utilises the main CPU. &nbsp;On a hardware RAID card, the onboard CPU takes a massive load off from your main CPU, and is more efficient at processing nested RAID levels than the software RAID is, which uses the main CPU, which probably should be doing the really cool stuff that your server is designed for, not low-level stuff like disk processing.<br />There&rsquo;s also something to be said for hardware RAID when it comes to non-linux operating systems. &nbsp;I gather that hardware RAID on windows platforms is a lot more stable than software RAID on the same.<br />So, basically, if you value your sleep, and your uptime, then you&rsquo;re going to need to protect yourself from these failures.</p> <p><br />That&rsquo;s disks out of the way for the time being, let&rsquo;s talk about power. <br />Most good servers (and by good, I mean ones I&rsquo;d consider in a high-availability infrastructure), have the capability of dual, or multiple power supplies. &nbsp;These are brilliant, and protect against PSU failure, and power rail failure. &nbsp;Be warned however; if you connect the PSUs to different phases, you&rsquo;ll probably see a very pretty, yet expensive fireworks show, and possibly set off the fire detection systems in the datacenter. &nbsp;Not a great idea.</p> <p><br />In spite of the benefits of multiple PSU servers, they are more expensive, and to some extent, don&rsquo;t offer a massive benefit, if the multiples are all plugged into the same power source, then you&rsquo;re really only protecting against PSU failure.<br />The biggest problem I&rsquo;ve seen in a datacenter, related to power, is the rack monkeys unplugging or rebooting the wrong server. &nbsp;As far as mitigating this goes, accidental unpluggings can be cut down with <a href="http://www.comms-express.com/products/iec-lock-c13-female-iec-c14-male-lead/" target="_blank">locking C13 cables</a> , and remote-hands reboots can be avoided by using iLO/DRAC or an IP-PDU (Power Distribution Unit).<br />Whilst we&rsquo;re on the topic of ancilliary rack hardware, things worth having:</p> <ul> <li>IP-PDU (<a href="http://www.apc.com/products/resource/include/techspec_index.cfm?base_sku=AP8959EU3" target="_blank">APC </a>are very good)</li> <li>IP-KVM (<a href="http://www.raritan.co.uk/" target="_blank">Raritan </a>and <a href="http://www.avocent.com/" target="_blank">Avocent </a>both seem to be leaders in this market, Startech are ok but the interface is a bit clunky.)</li> <li>IP-Serial Console (Raritan, Avocent, etc. )</li> </ul> <p>&nbsp;</p> <p>I&rsquo;ve rarely seen a 1U keyboard/monitor shelf in a rack. &nbsp;There actually is little point, you&rsquo;d be better off with a good Dell laptop, an USB-&gt;Serial cable, and perhaps stow a keyboard and monitor seperately in your rack somewhere.</p> <p><br />Wow, I really digressed there. &nbsp;Sorry about that. &nbsp;Where was I? &nbsp;Disks, Power, let&rsquo;s look at the network.</p> <p><br />Good servers have multiple NICs. &nbsp;You need to design your network to make use of this. &nbsp;Having one server/one NIC is good until your switch dies, or the NIC dies, or similar. &nbsp;Then your server goes down, and people get shouty.<br />But again, a pair of NICs is no good if they&rsquo;re only connected to a single switch. &nbsp;Not only will it intensify any Spanning-Tree problems you may have, but it also provides no protection against switch failure.</p> <p>So, a pair of switches. &nbsp;Or similar multiples of two, thereof. &nbsp;</p> <p><br />Not only do you want a pair of switches on the network infrastructure, but you also want them to connect to a HA pair of firewalls, I quite like <a href="http://www.cisco.com/en/US/products/ps6120/index.html" target="_blank">Cisco 55xx</a> series, the 5510 and better offer good Active/Standby pairing, so switching between the two is simple, and they each monitor each other, and will share a virtual IP between them, with HSRP.</p> <p><br />Next up, routing. &nbsp;You&rsquo;ll want a couple, if not more connections to the internets, for really nice stable connectivity. &nbsp;I&rsquo;ve argued this point over with a couple of colleagues, former and current. &nbsp;When you&rsquo;re relying on someone else for your network connectivity, &nbsp;and you only have a single connection to their network, regardless of how diverse their network may be, you still only have a single connection, and that&rsquo;s your biggest point of failure. &nbsp;You can harden your servers as much as possible against device and part failure, and I still highly recommend that you do, but if you don&rsquo;t have resilliency and redundancy at every level, then there&rsquo;ll still be a single point of failure somewhere on your network.</p> <p><br />It&rsquo;s actually perfectly acceptable to have multiple IP Transits from different providers and provide different IP addresses. &nbsp;As long as your application can cope with that. &nbsp;</p> <p>The ultimate solution however, requires having a couple of powerful routers at the edge of your network. &nbsp;<br />These connect to a couple of transit providers and advertise your IP addresses over BGP. &nbsp;You get a full internet routing table, and the rest of the internet sees the routes to your netblock. &nbsp;The real bugger is though, that you&rsquo;ve gotta have a reasonably large netblock to get noticed. &nbsp;At the moment, this is a /24 or bigger. &nbsp;That&rsquo;s 255 IP addresses, and given the current rate of IPv4 depletion, getting justification for one of these is getting harder and harder.<br />Your carrier/transit provider can help you with the paperwork to get it all sorted out, though. &nbsp;To stop the size of the full routing table becoming enormously massive, ISPs filter out netblocks smaller than a /24, so a certain amount of route aggregation takes place. &nbsp;</p> <p>Having BGP capable routers, and maintaining your own connections to the internet isn&rsquo;t a walk in the park. &nbsp;It&rsquo;s a specialist task, and requires a skilled systems engineer to operate &nbsp;and maintain it. &nbsp;Not a task for the unprepared.<br />There are other advantages of course, if for example, you use the Akamai CDN lots, and you&rsquo;re paying a lot for traffic to their network, then you may be able to enter into a peering agreement with them, where the traffic to their network is delivered cheaply, or for free, because it&rsquo;s mutually beneficial for both parties in the agreement. &nbsp;</p> <p>So I think we&rsquo;ve covered most of the major points on hardware and network resilliency and availability. &nbsp;Let&rsquo;s look at how to put that all together and build a hosting cluster.</p> <p>For the purposes of brevity, and clarity, let&rsquo;s assume for the time being that you&rsquo;ve chosen to use a dedicated host provider. &nbsp;I can personally recommend <a href="http://www.melbourne.co.uk/" target="_blank">Melbourne</a>. &nbsp;I use them at $dayjob for some dedicated server needs.<br />If you&rsquo;re choosing to do the owned hardware / rented rack space thing, then there&rsquo;s not a great deal of difference in the actual configuration of the servers, but there&rsquo;s more complexity involved, etc.</p> <p>For most small/medium size hosting needs, I tend to recommend a 4 node hosting cluster. &nbsp;This is based on having 2 web servers, and 2 database backends. &nbsp;<br />When you start off with a single webserver, with the database server on the same physical box, the fastest way to increase performance is to split and have 2 physical boxes, one for the webserver, one for the database. &nbsp;The biggest problem with this is, that speed and scalability/redundancy/resilience tend to go hand in hand. &nbsp;&nbsp;I personally don&rsquo;t like single points of failure, so having a pair of everything has become something of a personal motto. &nbsp;<br /><strong><em>&ldquo;I&rsquo;m a systems engineer, I can&rsquo;t count any lower than two&rdquo;<br /></em></strong></p> <p>So if you&rsquo;re concerned about uptime, then having a group of servers is a great thing. &nbsp;<br /><img style="vertical-align: middle;" src="https://lh6.googleusercontent.com/J7FmzTo0DFVg_jxe-VWitYV62v_0ZGEoCcZYvINgb2zktZEyhSBftQfMZ1OixrkUWIRBVfFN3Ttvg3SvaRrrFt0LYZkV6YJXMIBynpTHDYsCMNHRaTQ" alt="Simple 4-node hosting cluster." width="550px;" height="434px;" /><br /> This is a rather quick and dirty sketch I knocked up in mspaint. &nbsp;</p> <p>I&rsquo;ve been asked to provide the configuration information about this cluster, so I&rsquo;ll copy that from my VM server later on. &nbsp;I tend to use my <a href="http://broadberry.co.uk/intel-core-i7-workstations" target="_blank">powerful desktop</a> to build test infrastructures quite a lot, so knocking up and provisioning 4 VMs is no massive stress.</p> <p><br />A note now on configuration management. &nbsp;I have been in the position in the past where the &ldquo;How to build a server&rdquo; information is in a wiki page somewhere. &nbsp;This is alright, but you do tend to end up with a difficult to document process. &nbsp;&nbsp;</p> <p><br />Instead, I prefer a combination of Preseeding and <a href="http://docs.puppetlabs.com/" target="_blank">Puppet</a>. &nbsp;&nbsp;For no other reason than it&rsquo;s what I prefer, we&rsquo;ll be using Ubuntu 10.04 LTS in this article, although the processes for any other distribution aren&rsquo;t too different. &nbsp;When it comes to Puppet, both Debian/Ubuntu, and RHEL/Centos work well. &nbsp;I haven&rsquo;t tested Puppet with any other Distros, but I gather that it&rsquo;s fairly well supported across the board.</p> <p><br />Preseeding is the process of automating the steps of installing the operating system. &nbsp;It&rsquo;s basically an unattended installation process, that tells the installer what you would have selected, had you been in front of every machine whilst installing. &nbsp;As you can no doubt imagine, when you&rsquo;re building a farm of servers, preseeding is a massive bonus, and a timesaver. <br />Ubuntu, Debian, and Redhat-like distributions all have a mechanism for Preseeding a machine from bare metal. &nbsp;I suspect that other distros do similar things, but I&rsquo;ve never used them in a production environment. &nbsp;Preseeding is a fairly broad topic, so I&rsquo;ll cover that in a separate blogpost.</p> <p><br />One of the things I adore about Puppet is the community contributed packages that are available at the touch of a button. &nbsp;I&rsquo;ve built a fairly comprehensive puppet infrastructure from a majority of contributed modules and packages. &nbsp;I tend to just <a href="http://www.google.co.uk/search?sourceid=chrome&amp;ie=UTF-8&amp;q=site:github.com+puppet-" target="_blank">search Google</a> for &ldquo;puppet-&rdquo; like puppet-apache and so on. <br />I, like many other sysadmins and systems engineers, am quite lazy, and have lately started to reap more benefits from the open-source puppet community. &nbsp;You can pretty much build an entire infrastructure for a simple LAMP stack, based solely on other people&rsquo;s puppet configs.</p> <p><br />Puppet is lovely, it really is very easy to get going with, just start off with a server as your &ldquo;puppetmaster&rdquo;. &nbsp;I&rsquo;ve tended to go towards using <a href="http://aws.amazon.com/ec2/" target="_blank">Amazon EC2</a> micro instances for these, for small deployments. &nbsp;When I&rsquo;m working on my VM network, i just use my workstation.</p> <p><br />I use bzr for my source control for puppet. &nbsp;I like bzr, and it&rsquo;s one of the best VCS tools i&rsquo;ve used. &nbsp;It doesn&rsquo;t matter what you use, as long as you use something. &nbsp;<br />But if you&rsquo;re not using source control, then there&rsquo;s bigger problems, and you need to rectify those first. <strong><em>Really</em></strong>.</p> <p><br />Luckily, the vast majority of peoples contributed puppet modules and classes interoperate pretty well. &nbsp;Once you&rsquo;ve got a decent setup for the /etc/puppet directory, and configured the puppet configuration itself, then the next bit is really easy.</p> <p><br />A very basic guide to setting up puppet can be found here:&nbsp;<br /><a href="http://bitfieldconsulting.com/puppet-tutorial" target="_blank">Bitfield Consulting - Puppet</a></p> <p><a href="http://bitfieldconsulting.com/puppet-tutorial" target="_blank"></a><br />Software we&rsquo;re going to use:</p> <ul> <li><a href="http://www.ubuntu.com" target="_blank">Ubuntu </a>10.04 LTS</li> <li><a href="http://httpd.apache.org/" target="_blank">Apache </a>2.2</li> <li><a href="http://varnish-cache.org/" target="_blank">Varnish </a>2.1.4 (although, in this article, i&rsquo;m using <a href="http://www.apsis.ch/pound/" target="_blank">Pound</a>, rather than Varnish, but I&rsquo;ll detail Varnish in another blogpost)</li> <li><a href="http://www.mysql.com/products/community/" target="_blank">MySQL &nbsp;</a>5.2.something</li> <li><a href="http://www.php.net/" target="_blank">PHP</a> 5.3.something</li> <li><a href="http://wordpress.org/" target="_blank">Wordpress</a>? I think WP will be OK, actually.&nbsp;</li> <li><a href="http://memcached.org/" target="_blank">Memcache </a>1.4.5</li> </ul> <p>&nbsp;</p> <p>All of it, nice free, open-source goodness. &nbsp;We like open-source.</p> <p><br /><a href="https://github.com/tomoconnor/puppet" target="_blank">This</a> is the full working puppet config that I use . &nbsp;It&rsquo;s all pretty much gleaned from &nbsp;other <a href="http://www.google.co.uk/search?sourceid=chrome&amp;ie=UTF-8&amp;q=site:github.com+puppet-" target="_blank">puppet-*</a> repos on github, and a few other places.</p> <p><br />So.. In theory, you should be able to checkout a copy of the above, and put it in /etc/puppet, and you should get a working puppetmaster, and be able to initialise 4 nodes. &nbsp;</p> <p><br />You will need to do some individual config, such as the loadbalancer setup, and adding vhosts for apache. &nbsp;I&rsquo;ve found that if you&rsquo;re building biiiig farms, with lots of the same stuff, then adding the vhost config to the puppet manifest is a good thing to do, but for 2 servers, this kind of manual config is very easy to do by hand.</p> <p><br />So that&rsquo;s about it. &nbsp;I think. &nbsp;<br />I know I've digressed momentarily from the main stream of this evening&rsquo;s symposium <em>[extra points if you know where this is from]</em>, but I think it&rsquo;s for the better. &nbsp;There&rsquo;s a lot of bits and bobs that I left out, and perhaps shouldn&rsquo;t have, and some stuff I left in, that perhaps shouldn&rsquo;t have been. &nbsp;I&rsquo;ve been meaning to write this up for a Very Long Time, and hope that it might be of some use to some of you, albeit under a somewhat bizarre set of circumstances <em>[and this..]</em>.</p> <p>&nbsp;</p> <p>I&rsquo;ll &nbsp;just recap briefly and say that when it comes to the server design for new projects, that a VPS server isn&rsquo;t a total writeoff, but I have found in a number of instances that the IO performance is the biggest bottleneck on these virtualised systems. &nbsp;<br />That isn&rsquo;t to say that every new project and infrastructure desires a 4 node LAMP server system, not by a long way, but if you actually have the traffic and requirement, and also the budget to do it, then having dedicated servers (or colocated/owned servers), then you&rsquo;ll probably find considerably better performance than you would with a VPS.</p> <p><br />A final side-note on general price and suitability, and something that&rsquo;s more relevant to the first part of this article.<br />All servers are not created equal. &nbsp;A 1U server from HP, might set you back as little as &pound;600, or as much as &pound;2500. &nbsp;On the other hand, you could build your own 1U servers from a 1U case, and off-the-shelf parts, but the build quality will be lower. <br />Combine that with the fact that you don&rsquo;t get any kind of parts warranty to the same extend that you do with business grade hardware, and that consumer parts aren&rsquo;t designed for a 100% duty cycle. &nbsp;<br />It is possible to make a desktop machine into a server, and do everything on the cheap, but I highly recommend against it. &nbsp;Things will fail, you won&rsquo;t get warning, you won&rsquo;t get warranty and it won&rsquo;t be pretty.</p> <p><br />If you&rsquo;re making money from your infrastructure, or the systems that sit on it, then you&rsquo;ve got some mechanism of getting the money back from the outlay of &ldquo;doing it right&rdquo;. &nbsp;If you&rsquo;re just building a lab environment, or playing with toy servers in your parents&rsquo; basement, then good luck to you, enjoy everything you do, but don&rsquo;t host other people&rsquo;s data on your toys.</p> <p><br />High-availability isn&rsquo;t something to look at lightly, it&rsquo;s a pretty hardcore branch of systems engineering. &nbsp;You&rsquo;re playing with the big boys now, and you need to have invested a similar amount of money in your hardware as they have in theirs.&nbsp;</p> <p><br />Unless you&rsquo;re Google, Facebook, or Twitter. &nbsp;But you&rsquo;re not.</p> <p>(If you are Google, Facebook or Twitter, then please leave me some insightful comments ;)</p> Velleman 8055 Drivers http://tomoconnor.eu/blogish/velleman-8055-drivers <p> <p>About 5 years ago, I wrote some "drivers" to interface a Velleman K8055 USB interface card . &nbsp;After a recent request, I have decided that they should be brushed up a little, and reinstated with a download link.</p> <p>I'm open to bug reports, but I can't promise that I'll be able to fix them quickly.&nbsp;</p> <pre>Instructions to compile/install You'll need the following dependencies: libusb-dev libqt4-dev qt4-qmake (ubuntu deps) 1) run qmake -o Makefile qcontrol.pro 2) cd lib 3) make all; make install 4) cd .. 5) make 6) plug in your 8055 usb board 7) sudo ./qcontrol 8) enjoy!</pre> <p>I'm reconsidering writing some python bindings for the libueib.so driver, stay tuned!</p> </p> Legacies http://tomoconnor.eu/blogish/legacies <p> <p>The legacy of a nobody</p> <p>&nbsp;</p> <p>I work hard, and try not to let the future bother me. &nbsp;I don't make 10 year plans, hell, I'm lucky if i know where I'll be in 30 days time. &nbsp;I don't make massive future plans, because I've found that everything can change massively week-to-week, and hastily made plans are often proved unservicable. &nbsp;I suppose this is par for the course when working in IT. &nbsp;There's a sheer unpredictability when working with the internet, long hours and late nights along the way, but basically all computer systems listen to Murphy's Law. &nbsp;</p> <p>&nbsp;</p> <p>You will be interrupted mid-holiday, mid-wank, or if you're really lucky (or unlucky...) mid-shag. &nbsp;When you have a network to maintain, I like to think it's like a parent with a child. &nbsp;Especially a toddler. &nbsp;There's always the haunting suspicion that something will happen, requiring emergency attention, although these things tend to be a lack of disk space, rather than a pea shoved into an unsuitable orifice.</p> <p>&nbsp;</p> <p>All that aside, these days, I find myself wondering more and more; "what will my legacy be?". &nbsp;That is to say, when I've died, how will I be remembered?&nbsp;</p> <p>I'm gay, and genetically messed up enough to be unable to have my own children, this alone is something that troubles me occasionally. &nbsp;Not the being gay bit, but being unable to continue my family's genes. &nbsp;Under the circumstances, that might be a good thing.&nbsp;</p> <p>In my father's and my own eyes, my grandfather was a great man. &nbsp;We both learned a great deal from him, both about engineering, and life in general. &nbsp;A great deal of my skill with metal and wood, and design comes directly from his influence. &nbsp;My interest in computing is mostly my dad's influence, at an early age, with an Apple IIe. &nbsp;I guess I'm just trying to say that my ancesters are greater than me. &nbsp;Greatness being totally subjective, of course, but I still get the massive feeling that there's something epic missing. &nbsp;</p> <p>&nbsp;</p> <p>For a very long time, I looked at my peers who had had children with a sense of disdain. &nbsp;Perhaps a something wasted, by having spawned so early on, but I now realise, at least they have done it. &nbsp;At whatever stage of life, at least they had the chance. &nbsp;</p> <p>&nbsp;</p> <p>Perhaps I could term my computer systems as my children. &nbsp;If that were the case, then I'd have had more than two dozen, over the last 10 years. &nbsp;Under this metaphor however, there's no longevity involved. &nbsp;Aside from some minor things which I know are still there, the majority of the systems with which I've worked have now ceased to be. &nbsp;Servers and Networks which I've designed and implemented have been replaced by smarter and faster ones. &nbsp;It's like a destructive evolution. &nbsp;One that leaves no fossils, no trace of earlier systems, and their designer. &nbsp;</p> <p>I haven't published any papers, written any journals, sown my seeds of academic greatness (ha!), or computational excellence. &nbsp;If I died tomorrow, there would be very little to mark my place in history.</p> <div></div> </p> N's Story http://tomoconnor.eu/blogish/n-story <p> <p>After receiving such a great response to my own article (thanks everyone!), a good friend of mine asked whether I'd publish his similar story here.</p> <p>If any of these stories give enough hope to just one teenager (or anyone) to let them survive the hardship of coming out, and homophobic abuse, then that's enough.</p> <p>For various reasons which will become apparent as you read, N has decided to use this moniker to protect his identity.</p> <p>So, without further ado, here is N's Story. &nbsp;</p> <p>&nbsp;</p> <p><strong>It Gets Better (No, really)</strong></p> <p>Reading Tom&rsquo;s article (credit where credit&rsquo;s due) inspired me to write my own It Gets Better story, to which as you&rsquo;ve noticed I had to add an allusion to the fact that were it not for most of my friends (i.e. true friends, yes, again we come back to that careful wording, in some ways it&rsquo;s even more important in my case) I&rsquo;d be looking very lonely in my corner.&nbsp;</p> <p>You see, being gay was unthinkable... literally.&nbsp;</p> <p>I grew up with two parents who&rsquo;ve both decided that I&rsquo;m a poor excuse for a human being, as first my father and more recently my mother decided that disowning me was the better part of parenting. Now don&rsquo;t get me wrong, I deeply love and admire my mum. I want to stress that, because you&rsquo;re not going to like her much and I do want to insist that she has redeeming qualities.&nbsp;</p> <p>For example, she was very supportive financially and always pro-active in standing up for me when I was bullied at secondary school (something I&rsquo;ll come back to later in this article).&nbsp;</p> <p>She also proved to be surprisingly OK with other people&rsquo;s sons being gay... although in that respect she deserves to be cited as an example of what a NIMBY (<em>Not In My Back Yard</em>) is, because she certainly wasn&rsquo;t OK with me not being straight.</p> <p>One of the things that I found moving in Tom&rsquo;s article, in respect to my own experience, was how similar our experience of growing up gay was.&nbsp;</p> <p>We both had our first big crush at the same ages, i.e. 6-8 years old, in my case, my best friend&rsquo;s boyfriend.&nbsp;</p> <p>It&rsquo;s ironic that her dad was openly homophobic and that the words &ldquo;poofs&rdquo; and &ldquo;queers&rdquo; being his very disgusted words on the subject, already hurt when it came up for whatever reason in conversation.&nbsp;</p> <p>I suppose the difference in my upbringing and Tom&rsquo;s was that no sooner did I realise that I Liked Other Boys at the innocent age of 6-8 (I only learned the word for it when I was about 10), that I was immediately hit by a wave of hostility, disgust and disapproval.&nbsp;</p> <p>Things became even worse when my parents separated, as I was stuck in the middle and both of them saw me as an extension of their ex-spouse.</p> <p>This meant that while sticking up for my mum at his house I was getting &ldquo;you&rsquo;re just like your father&rdquo; thrown at me (and occasionally fists, frozen bread and on one occasion I was threatened with homelessness... well I was 16 by the time that last incident happened), and on the other hand I was getting &ldquo;you and your mother&rdquo; from my &ldquo;dad&rdquo; who then disowned me two years down the line when the divorce came through (I was 15 at this point).&nbsp;</p> <p>I smothered my feelings the same way a rat eats her young if you disturb her. It was a way of protecting myself from the hurt that I was getting, and was partly a conscious decision, partly a defensive reflex.&nbsp;</p> <p>Of course, this set me up for trouble, and just how much will soon become apparent.</p> <p>My first head-on encounter with this concerned a massive crush on my then best friend when I was ten, a tall blonde lad (yep, another rugby/ football player) who had my heart skipping beats every time we spent time together and then broke it by saying &ldquo;Oh God, you&rsquo;re not homosexual are you?&rdquo; A question provoked by a completely unrelated &ldquo;I have something to tell you&rdquo; that referred to a message from someone else.&nbsp;</p> <p>I stammered a &ldquo;No... No. I&rsquo;m not.&rdquo;&nbsp;</p> <p>Yes, that is correct. I denied my sexual orientation and my love three times... and then the break time ended. Oh the irony.&nbsp;</p> <p>There was a moment I&rsquo;ll never forget concerning him though, this time for happier reasons. During a school trip, one of the other boys was being very very nasty about my obvious feelings for our friend and the fact that I was always trying to please him. And quite frankly my dear, I didn&rsquo;t give a fuck.&nbsp;</p> <p>I felt like my chest was going to explode with that warm feeling that radiates out of you when you&rsquo;re happily in love and you don&rsquo;t care who knows. And yes, there was a slight sexual element to what I felt (use your imagination).&nbsp;</p> <p>Now the trouble that was brewing began when I started secondary school. Suddenly I went from being an unassuming pupil among others and occasionally a teacher&rsquo;s pet, to being a teacher&rsquo;s pet and a target for name-calling, stone throwing, being blamed for things I hadn&rsquo;t done and a few things I just prefer to forget now.&nbsp;</p> <p>As in Tom&rsquo;s case, it lasted all of five years and seems to be what people I went to school with mostly remember me for. I had very briefly explored my sexuality with a couple of other boys my age in primary school (sorry to disappoint, but apart from the usual stuff most little boys do, such as showing each other our penises behind a wall, it didn&rsquo;t go very far) but this was now out of the question because I was already a loner and made to feel it.</p> <p>Noticing a girl in my class when I was 11 gave me an opportunity to try out romance, that might dare to speak its name, and I repeated this a couple of times over the next few years until I was 16.&nbsp;</p> <p>In every case it was timid, furtive, and ultimately purely platonic. What I tried to convince myself were, crushes turned out to be a lonely teenage boy trying to A) be straight and B) make friends.&nbsp;</p> <p>As they were always well out of my &ldquo;league&rdquo; in at least one way or another, and as I never got anywhere it was easy to think that it was just down to my isolation or for more noble motives (if they had boyfriends for example).&nbsp;</p> <p>The fact that when one of them actually made a sexual pass at me I didn&rsquo;t like it and ran away should of course have made it obvious that I wasn&rsquo;t that kind of boy.</p> <p>Unfortunately, the overtly homophobic context I was wading in, had started influencing me to the point that I went to great lengths to deny my feelings for other boys.&nbsp;</p> <p>Given that I was already trying to hide my socially acceptable feelings for girls, you&rsquo;ll appreciate why self-harming was only a step away whenever I so much as got a kick out of a hot Sixth Form boy or (male) fellow pupil smiling at me.&nbsp;</p> <p>I don&rsquo;t want to give too many ideas to anyone who&rsquo;s potentially fragile, but the mildest example happened when I was 12. A Sixth Form boy whose name I didn&rsquo;t know but for whom I was carrying a torch of Olympic proportions ran past and ruffled my hair with a friendly smile. I spent the rest of the day grinning from ear to ear with a happy look that lasted until I got home.&nbsp;</p> <p>As soon as I got to my bedroom, I consciously realised that I was in love with another boy. Something snapped and I started crying and cut off all the hair he&rsquo;d touched as if he&rsquo;d somehow &ldquo;made&rdquo; me gay. I&rsquo;ll draw a veil over the more painful and dangerous things I did to punish and &ldquo;cure&rdquo; myself over the years, but you get the idea.&nbsp;</p> <p>You may have noticed that I kept pushing my attraction to boys to the back of my mind and that convincing myself that it was as dirty, wrong and even dangerous as my parents, grandparents, teachers (thank you Section 28) and classmates said it was, took up every brief second of the time during which another boy would catch my eye.&nbsp;</p> <p>Obviously I had platonic relationships with other boys, and I had a few very loyal friends willing to risk being stoned in the Biblical sense of the word, which was the danger for anyone who ventured outside with me on the side of the school grounds by the playing fields.&nbsp;</p> <p>But there were of course Other Boys (men didn&rsquo;t interest me yet, unlike boys in my own year up to and including Sixth Formers) who I&rsquo;d see helping their parents on market stalls on Saturdays or at the swimming baths (particularly in the changing rooms obviously) and for whom I&rsquo;d have romantic feelings with a sexual element to them. This was something I definitely wasn&rsquo;t equipped to handle; and it eventually led to my nearly having a nervous breakdown just before my coming out at 17, to a friend who&rsquo;d literally come out to me a minute before.</p> <p>Bisexuality seemed the obvious term to define my sexuality at this point, as the only reason I&rsquo;d admitted to liking boys was that I couldn&rsquo;t hide or suppress it, and liking girls sexually was never called into question because it was assumed you did.&nbsp;</p> <p>I&rsquo;d also spent years trying to fantasise about girls, and succeeding (use your imagination if you must) and on those occasions in which a boy I liked was involved. This (very unhealthy) pattern carried over into two encounters with young women, both of which involved me reacting to being pounced on and kissed by kissing back and letting my imagination get me aroused.&nbsp;</p> <p>I&rsquo;d spent years getting turned on by imagining straight guys I fancied doing things with girls, so it was only after a random conversation with my father-in-law and wife that I realised just how much of a mess I&rsquo;d let my life become when it dawned on me, after years with the second woman (and paternity) that I&rsquo;d been barking up the wrong tree since 11 years old.</p> <p>I came out to my mother before I was ready, because the friend I came out to was threatening to tell her if I didn&rsquo;t.&nbsp;</p> <p><strong>A word on this </strong>&ndash; A) please don&rsquo;t submit to blackmail, and B) don&rsquo;t let other people&rsquo;s prejudices shape the way you see yourself.&nbsp;</p> <p>My mother&rsquo;s reaction to me telling her I was bisexual can be split into three stages.&nbsp;</p> <p>Her first reaction was an encouragement to try with girls and the ludicrous suggestion that I spend more time with her ex-husband, followed by a very hurt and disappointed order not to talk to anyone else, and particularly my sister about it.&nbsp;</p> <p>Her second reaction a few days later was to shove a leaflet on blood donation into my hand and to order me to read it *very* carefully. I think you get the message too. (Queer = AIDS = you die...) Her third reaction was a combination of avoiding the subject, one very brief &ldquo;And you&rsquo;re not gay&rdquo; (nice to know she was listening) at the end of a comment on an unrelated subject, and a steady stream of homophobic comments in which the word &ldquo;gay&rdquo; was always used as a provocation and as an insult.&nbsp;</p> <p>At the end of my first year of university she even told me that I was very selfish because there were rumours about my sexuality and she had to live with what the neighbours thought. So, on meeting a woman who loved me and whom I cared about deeply (and still do), I thought it only natural to be faithful and to build our relationship together. Whenever doubts began to accumulate, I dispelled them by telling myself that I was with someone who would please my family and that I was doing my duty both to her and to them. I didn&rsquo;t realise to what extent I&rsquo;d internalised my &ldquo;education&rdquo;, but that fact of course was going to open my eyes in its own time.</p> <p>I got a lot of homophobia while at University, including having stones thrown at me by a couple of other students. Don&rsquo;t be put off by this, because it doesn&rsquo;t invalidate the fact that universities take this very seriously and other students will support you just they did in my case.&nbsp;</p> <p>I should also add that your true friends won&rsquo;t reject you and any gay or bisexual men among them will be more than happy to know that you&rsquo;re being yourself.&nbsp;</p> <p>One straight friend once said as much to me when I apologised for a crush on one of his friends from home. To be precise, he said &ldquo;Nah, don&rsquo;t be sorry. It&rsquo;s best to be honest about your feelings. If he wants to be a woman about it that&rsquo;s his problem!&rdquo;&nbsp;</p> <p>&nbsp;</p> <p>My father-in-law and my wife are both Christian.&nbsp;</p> <p>I&rsquo;m not.&nbsp;</p> <p>They both believe that homosexuality is a sin, and so for reasons unrelated to me, when the topic came up during dinner, my father-in-law aired his view that &ldquo;It&rsquo;s obvious that homosexuality is a form of deviant behaviour&rdquo;.&nbsp;</p> <p>I replied that people who are homosexual aren&rsquo;t attracted to the opposite sex and that, although I respect the right of other people to hold the same view as he does on the subject, I disagree.&nbsp;</p> <p>What hit a nerve I think, was when I insisted that it&rsquo;s in a person&rsquo;s nature and not just a question of preference, as almost every gay man I know (I don&rsquo;t know as many lesbian women) has zero attraction to women.&nbsp;</p> <p>I&rsquo;ll spare you the theology, but I was left with the nagging sensation of having accidentally breached a wall I&rsquo;d put up at the back of my mind and it coincided with my attraction to women being questioned.&nbsp;</p> <p>A few friends, bi, gay and straight alike had expressed surprise at me being with a woman, as I&rsquo;d never shown any interest in girls before. Now this in itself didn&rsquo;t bother me, because I believed, and still believe, that there are bisexual people out there. I know a fair few, and they&rsquo;re very visibly attracted to people of both sexes.&nbsp;</p> <p>What I realised, as I sat down with pen and paper and worked my way over my private life properly, was that I was looking at myself objectively for the first time since I was 10.&nbsp;</p> <p>Assuming that I liked girls was an obvious conclusion to draw as a teenager, but as the final pieces fell into place, it hit me like a sledgehammer that my defensive reflex against any form of sexuality had impaired my judgement. The prejudice I&rsquo;d picked up that love without desire was pure had led me to the conclusion that I liked girls and to hate my romantic and physical feelings for other boys. And of course hating myself for not being able to change, was an inevitable side effect and conveniently stopped me from exploring my feelings, let alone my sexuality.</p> <p>And so the floodgates burst.&nbsp;</p> <p>Years of sabotaging budding relationships with other young men from the age of 17 to 22 and over and running away from any gay or bisexual man who made a pass at me suddenly became painfully fresh in my memory. So did years of avoiding any kind of contact with LGB organisations beyond professional relations while doing &ldquo;governmenty&rdquo; work, as one friend who I later learned is gay referred to it, for the Union of Students.&nbsp;</p> <p>Even my attraction to him was unrequited, as I decided not to ask him out (it turns out my hunch was right and that our attraction was mutual) to concentrate on sorting things out with my ex-boyfriend who&rsquo;d recently been subjected to homophobia of life-threatening proportions... and in no shape to be in a relationship of course and therefore unattainable. And I&rsquo;d accepted the break-up in the first place because my mum had just had a serious car accident... something I&rsquo;ll always &ldquo;kick&rdquo; myself for, particularly now.&nbsp;</p> <p>And at no point did girls interest me other than as friends. A point of which I was reminded by the memory of a speaker at an event in one of the Union bars when he said that at our university there was a ratio of &nbsp;something like 5 girls per boy. One young guy not far from me said &ldquo;Shiiiiit....&rdquo; in awe. As you&rsquo;ll have gathered, I was unfazed by this piece of information, not being interested in girls but very much under the spell of one of my very tall, muscular and athletic (and straight, so nothing happened) flatmate.&nbsp;</p> <p>Suffice to say I&rsquo;ve managed to unwittingly come out several more times than I should have done, given that I came out to myself properly at about 10 and again at 14-15 and then again at 15 to a boy I fancied, or more precisely outed myself by replying &ldquo;Depends. Do you?&rdquo; to his hostile &ldquo;Do you smoke helmet?&rdquo;.</p> <p>I then came out at 17 to a few close friends. Naturally the entire Sixth Form got to know and were almost unanimously OK with it. As Tom mentioned in his article, and as my then boyfriend pointed out, girls are generally very supportive friends (if not among the most supportive) when you come out.&nbsp;</p> <p>Wives, understandably are not so supportive. It&rsquo;s not a situation you&rsquo;d wish on anyone, but as I can&rsquo;t properly fulfil my role as a husband now that I&rsquo;m conscious of what really pushes my buttons, all the arguments about my sexual orientation being an &ldquo;abomination&rdquo; and something &ldquo; I can change&rdquo; if I really want to become meaningless.&nbsp;</p> <p>I don&rsquo;t hold with running away and abandoning your dependents, but staying together on the grounds that I signed a contract despite the consequences for my wife and child would be just as irresponsible.&nbsp;</p> <p>The irony is that it was my wife who convinced me of that, by arguing exactly the opposite. Not least by equating the relationship I had with my (now ex-)boyfriend to the &ldquo;marriage&rdquo; that some people have with their dog, or comparing any form of LGB group with Sodom and Gomorrah. By using the kind of ignorant comment I hear so often when you tell &ldquo;them&rdquo; that you&rsquo;re gay or bisexual - &ldquo;You don&rsquo;t look it.&rdquo;</p> <p>Now I&rsquo;m not a coward when it comes to physical dangers, and I&rsquo;ve survived enough people trying to grievously hurt me to be able to make that statement. Homophobic violence hurt me less than having to live with homophobic attitudes from people I actually care about, but conforming to what people expect of you doesn&rsquo;t require courage even though it&rsquo;s painful.&nbsp;</p> <p>Living your life according to what&rsquo;s right for you and others is much braver and also much more responsible. Not that I really stood a chance, but I did make several bad decisions, and trying to be straight when I thought I was bisexual was one of them.&nbsp;</p> <p>When you get into your twenties (or any age) and realise that you&rsquo;re living with the decision of a scared teen with no apparent support to turn to, it&rsquo;s time to stop running and repair the damage before it gets worse.&nbsp;</p> <p>If this sounds familiar, go back and read Tom&rsquo;s article, that&rsquo;s where to go from here.</p> <p>Given my current situation it&rsquo;s not easy to be optimistic, but that&rsquo;s where my friends come in. I have to admit to feeling jealous when I see how accepting some parents are, but the people who love me for the person I am will always be supportive.&nbsp;</p> <p>My best friend very tactfully let me know that he&rsquo;d known for years and that he understood how hard it had been for me to get the words out.&nbsp;</p> <p>One of my other close straight friends who&rsquo;s built like a rugby player even asked &ldquo;And how is that offensive?&rdquo; when I warned him that it was common knowledge on campus that I liked guys and that some people seemed to think we were a couple. I really hope he meets a girl who deserves that much sweetness. Of course, friends of &ldquo;other&rdquo; persuasions who&rsquo;ve been through the same stuff as I have can read this and smile now and again as their own memories suddenly become more vivid.&nbsp;</p> <p>And while I&rsquo;m building a future that takes into account the fact that I have the right to be happy too, friends like that are the ones who remind me that it does get better.</p> <p>Oh, one more thing for my friends. Cheers!</p> </p> It Gets Better http://tomoconnor.eu/blogish/it-gets-better <p>&nbsp;</p> <p>I can clearly remember the reactions of most of my friends when I came out. &nbsp;I've worded that carefully, notice.. Friends. &nbsp;All of my true friends were supportive, one guy, a bit of a rugby lad, put his arm around me and said "Well done mate".</p> <p>Mind you, that was when I'd chosen to come out, of my own accord. &nbsp;</p> <p>Truth be told, I'd actually been outed years before that. &nbsp;Let's take a look back at that. &nbsp;</p> <p>I've known that I'm gay for a very long time indeed. &nbsp;I had a crush on a guy I knew while growing up in America, a kid called Evan. &nbsp;Let's see.. that would have been 1992-1994, so I'd have been ages 6-8.</p> <p>Evan's folks had this massive "ranch-like" place a bit out in the sticks, or at least, that's how I remember it. &nbsp;He had this "secret" hiding place that only he knew about, and he took me there, and we did things, and I Liked It. &nbsp;(I'm being vague on details here, use your imagination if you absolutely must.)</p> <p>In the very early years of exploring my sexuality, it was defined by points in time, with other boys my age, and "exploring" with them too. &nbsp;If I look back now, I can count about 6 guys who were similarly explorative, and this is still in the America Years. &nbsp;The strangest thing, perhaps because of our collective youth, was that nobody made a snide or derisive comment about any of this. &nbsp;It was just fun. &nbsp;It was never gay, queer, faggottry. &nbsp;Perhaps we didn't know the words, but I think that's not true. &nbsp;Perhaps innocence just wins out over all, and we don't know that it's "wrong" or "bad". &nbsp;</p> <p>I think part of it is that we were mostly expat kids, at good schools, with good parents, and that kind of bullying and behavior isn't really part of the close community that had been built up. &nbsp;I don't remember any instance of persistent bullying at the Montessori School I went to. &nbsp;I suspect that might be because everyone lived in fear of the Headmistress, a seriously scary woman, who is still Headmistress there to this day.</p> <p>But I digress.</p> <p>In 1994/5, dad's overseas job ended, and we moved back to a smallish town in Worcestershire, called Malvern. &nbsp;I started school at the "West Malvern Primary", mid-way through the term, I think, and was widely accepted with wonder and confusion. &nbsp;A softly spoken, somewhat gangly kid with an american accent and foppish ways. &nbsp;I know this for a fact. &nbsp;I did not fit in.</p> <p>I knew nothing of football, or well, anything that defines the british boyish primary school group of friends. &nbsp;</p> <p>As a result, I did a better job of making friends with the girls, well, some of them. &nbsp;One friend I made then was Robyn, who has been my friend ever since, and was really supportive when I came out in 6th Form.&nbsp;</p> <p>To the typical british schoolboy, apparently making friends with girls automatically makes you gay. &nbsp;I have to admit now, I've never followed the logic behind this one. &nbsp;I was a massive teacher's pet, and not particularly bothered about it. &nbsp;I enjoyed learning, and would have happily spent my lunchtimes pestering with the aging BBC Micros or reading away in the library. &nbsp;In fact, as time wore on, this is exactly what I did.</p> <p>Around about 1996, I made a friend, a very boyish boy, he was on the school football team. &nbsp;Somehow (and I really wish I could remember exactly how this came about), we ended up "exploring together" too. &nbsp;First at his house, watching Neighbours while we did it, then at my house ,there was some element of computer gameplay rewarded with a wank, and this carried on for some time.</p> <p>I once asked him, "What happens if I win the game?", and his reply has stayed with me for all these years, "I'll fucking suck your cock", he said. &nbsp;</p> <p>Actually, there was another guy with whom I had some brief encounters, or perhaps another two, but they were fleeting, and largely unremarkable. &nbsp;(I never did win that game.)</p> <p>The problem came a little later on, when we all started at a Secondary school (High School, for my american audience). &nbsp;Pretty much everyone who had been at the primary school went to one of two secondary schools. &nbsp;The bible-bashing Dyson Perrins, or slightly less mad, and much better The Chase. &nbsp;For obvious reasons, I went to The Chase.</p> <p>This is where the trouble really started. &nbsp;Going from a small school in a good bit of town, to a much bigger school, with a massive variety of kids from different backgrounds and upbringings. &nbsp;This was terrifying. &nbsp;I still lacked the social skills to make new friends, and for a long time, was still riding on the old friends I had at primary school. &nbsp;The problem was, our timetables were largely different, and we didn't often see each other aside for a short period at lunchtimes.</p> <p>Having a hard time making friends was made worse when some of the boys from my primary school had said something to the older kids, or the other kids in my year, about the experiences we'd had the year before. &nbsp;Apparently now it was wrong, and very bad, and I was queer, and gay, and I had big ears, and i was weird and not quite right. &nbsp;</p> <p>Incidentally, whenever I got bullied, and told my parents, I always mentioned it based on the big ears fact. &nbsp;I still wonder whether anything would have been handled differently if it had been known homophobia at that stage. &nbsp;I suspect not, not least from the school's point of view. &nbsp;I just wasn't quite ready to admit it to my parents. &nbsp;Dunno what i'd have said under further questioning. &nbsp;It seemed better to base it on the tangible fact that, yes, I do have big ears.</p> <p>I suspect my parents already knew that there was more to this story, but there it is, that's the truth.</p> <p>To me, the scariest part of this story was that the bullying didn't stop for FIVE years. &nbsp;There was always somebody willing to make a jab at my alleged sexuality, or with some cover story, and make comments about the size of my ears, or the way I walk, or that I'm a geek, or a nerd, or any other derisive and derogatory remark they could invent.</p> <p>Not all schools are created equal, I understand this now, but to the 14-year old me, this wasn't obvious. &nbsp;</p> <p>The general pattern was this: Get bullied, tell someone, the bully gets a light ticking off, you get bullied for a) the original reason, and b) being a grass.</p> <p>Now, the thing that annoys me most about all of this, retrospectively (although, it annoyed me then, too), was The Chase had a lot of "threats" against bullies. &nbsp;"We'll do this, and we'll make an example of you in assembly, or we'll name and shame you to the local newspaper". &nbsp;None of this was ever done, not in any of my time there, and I suspect little has changed. &nbsp;A look at the school's website today, they seem to have a clearer code on equal opportunities, and the bullying code hasn't changed. &nbsp;I do wonder if the prevalence of homophobic abuse at the school has changed.</p> <p>I'm not afraid or ashamed to admit that on a number of times, I considered suicide, but ultimately, the reason I'm still here today, is because I didn't want to devastate my family. &nbsp;I don't want to go into detail on that for a number of reasons. &nbsp;</p> <p>Let's jump forwards 2 years, to 6th form (or college), and I'm largely more comfortable with my friends group. &nbsp;The people around me are those who I want to be around me, and the folk who bullied me are now elsewhere, working in dead-end jobs where they will be for the rest of their lives. &nbsp;</p> <p>I joined a youth group in 2000, Malvern Young Firefighters, and met a great group of people, from outside school, some I knew from primary school, others were unknowns, but the group, and leadership allowed me to develop a new sense of self-confidence that had formerly been destroyed by years of bullying. &nbsp;</p> <p>There was rarely any bullying in this group, I think, for two reasons. &nbsp;1) The group leaders ruled strictly, and 2) the peer group was much more tightly knit.</p> <p>Everything changes again at University. &nbsp;<br />I went to Birmingham, and I spent the better part of 4 years there. &nbsp;It's funny, you go from having hidden your sexuality all through school and highschool, to an environment where not only are there a few people who look like you, and think like you, and fuck like you, but there's hundreds of them. &nbsp;Birmingham has one of the finest, and friendliest LGBTQ societies that I've ever found.&nbsp;</p> <p>These people made me feel welcome, they protected and educated me about what it's actually like being gay. &nbsp;</p> <p>It's all different, and it gets better. It really does. &nbsp;<br />You too will find people like you at university, and in bigger cities, and in liberal arts colleges. &nbsp;You will find your first "real" boyfriend, and you'll go through everything that your peers at school went through at age 12 with a girl behind the bike-sheds.</p> <p>I'd never have met all the wonderful people I've met in the last 10 years, if I'd let the bullies win. &nbsp;I'd never have met my wonderful boyfriend if I'd died when I was 14. &nbsp;</p> <p>First loves, first lovers, first boyfriends are all things that will happen, and can happen, but you have to give them the chance.&nbsp;</p> <p>Here's the important point, &nbsp;they're all right, &nbsp;Joel Burns, Tyler Oakley, the numerous others on the Trevor Project and youTube. &nbsp;It does get better. &nbsp;It got better for me, and I promise you, it'll get better for you.</p> <p>Sometimes you have to make a pro-active stand, and get yourselves out of the situation, other things just change over time, like people's attitudes to homosexuality. &nbsp;It's a continuum, and it's changing all the time. &nbsp;You just have to give it time to change. &nbsp;The vast population aren't perfect like us, they can't see the world the way we do, but the reason people are homophobic is because they're also ignorant, and they're afraid. &nbsp;</p> <p>If you've been reading this, and thought at any point, "<em>Hey, that's me!</em>" or, "<em>That's what they do to me</em>", and you're being bullied, for whatever reason. &nbsp;Please don't suffer in silence, there's no need. &nbsp;Times are changing, and we live in a progressive world. &nbsp;There is somebody out there willing to listen. &nbsp;There are people who've been through the same things. &nbsp;There is support for gay teens, hell, there's support there for anyone.</p> <p>Please give yourselves a chance for things to get better. &nbsp;</p> <p><strong>It gets better. It really does.</strong></p> <p>&nbsp;</p> <p>If you're in the USA:</p> <p>http://www.thetrevorproject.org</p> <p>&nbsp;</p> <p>If you're in the UK:</p> <p>http://www.lgf.org.uk/</p> <p>http://www.samaritans.org/</p> <p>&nbsp;</p> <p>London Gay &amp; Lesbian Switchboard:</p> <p>http://www.llgs.org.uk/&nbsp;</p> <p>&nbsp;</p> <p>List of local LGBT support groups / helplines:</p> <p>http://queery.org.uk/StaticPages/Advice.asp</p> <p>&nbsp;</p> Mysterious Tiles http://tomoconnor.eu/blogish/mysterious-tiles <p>I recently acquired some ceramic tiles, and after a good bit of cleaning, they're all presentable and nice. &nbsp;There's 30 in total.</p> <p>Problem is, I'd like to know what the pattern is, who the designer/manufacturer was, and also, do they have any value.</p> <p>Some friends and family have suggested that they: "Look over 50 years old", "Look like a morris pattern", "look handmade", "look valuable", "mediaevally&nbsp;beautiful", "worth finding out about".</p> <p>Pictures on Flickr:</p> <p><a href="http://www.flickr.com/photos/tom_twinhelix/4704457478/">http://www.flickr.com/photos/tom_twinhelix/4704457478/</a></p> <p><a href="http://www.flickr.com/photos/tom_twinhelix/4703819869/in/photostream/">http://www.flickr.com/photos/tom_twinhelix/4703819869/in/photostream/</a></p> Zen and the Art of Speccing Servers http://tomoconnor.eu/blogish/zen-and-art-speccing-servers <p> <p>Say for example you want to build a new Virtualization cluster. &nbsp;You've chosen the CPUs you want, and know you want 32 GB of fast shiny RAM. &nbsp;</p> <p>The next thing to decide on is how the hell you're gonna store your VMDK (or otherwise) images, and then store the backups and snapshots too.</p> <p>So. &nbsp;A typical VM Host server might be one of three choices.</p> <p>For sake of argument, i'm using Dell as a vendor.</p> <p><strong>Option 1:</strong></p> <p>Dell R805, Dual AMD 2425HE, 6 cores per CPU, 2 CPUs.</p> <p>32G of fast DDR2 ECC RAM. &nbsp;</p> <p>Ah. Hard disks. Bugger.</p> <p>You can have only 2 disks, in the R805 chassis. &nbsp;Bugger.</p> <p>I'll have 2 fast SAS 300GB 6Gbit 15K 2.5" drives, in RAID 1.</p> <p>Bugger. &nbsp;Only 300GB of storage. &nbsp;That's about enough for 3 small servers, or one big one.</p> <p>Bugger.</p> <p><strong>Approx Cost: &pound;3100</strong></p> <p>&nbsp;</p> <p>So, If i want to use the R805, i'm gonna need some kind of backend storage, be it NAS, or SAN, or an Unified Storage Device, providing NFS and iSCSI. &nbsp;</p> <p><strong>Option 2:</strong></p> <p>Dell R815</p> <p>Dual or Quad CPU, also AMD, 8 or 12 cores per CPU.</p> <p>32 G of RAM, again</p> <p>More disks!</p> <p>Split volumes, R1 / R5 (shame it's not R6, but there we go.)</p> <p>2x300GB SAS + 4 x 500GB SATA</p> <p>Giving 300GB + 1.3TB</p> <p>A bit better, but prohibitively expensive.</p> <p><strong>Dual 8 Core CPU = &pound;6208</strong></p> <p>Quad 8 core CPU = &pound;6698</p> <p>Dual 12 Core &nbsp;= &pound;7408</p> <p>Quad 12 Core = &pound;8608</p> <p>Bugger.</p> <p>&nbsp;</p> <p><strong>Option 3:</strong></p> <p>Dell 2970</p> <p>Dual 2425HE, again</p> <p>32 GB RAM</p> <p>&nbsp;</p> <p><em>Option A (8x2.5" disks)</em></p> <p>2 x 300GB SAS + 6x500GB SATA</p> <p>= 300GB + 2.3TB</p> <p><strong>Total Cost : &pound; 5125</strong></p> <p>&nbsp;</p> <p><em>Option B (6x3.5" disks)</em></p> <p>2 x 300GB SAS + 4 x 2TB SATA</p> <p>= 300GB + 5.7TB</p> <p><strong>Total Cost : &pound;4705</strong></p> <p>OR</p> <p>2 x 300GB SAS + 4 x 1TB SATA</p> <p>= 300GB + 2.8TB</p> <p><strong>Total Cost : &pound;4145</strong></p> <p>Right. &nbsp;Now. &nbsp;The interesting part is that this last server, the cost of storage alone, is only &pound;191/TB.</p> <p>One of the biggest problems associated with having large disk storage on the actual VM host itself, is the problem of not being particularly able to free up pockets of unused disk space.</p> <p>Alternatively, a separate storage node would effectively allow better distribution of the storage, and exporting disks across the network. &nbsp;</p> <p>So let's price that up.</p> <p>&nbsp;</p> <p><strong>From Broadberry.co.uk&nbsp;</strong></p> <p>(Because I like their up-front pricing, and shiny configurator)</p> <p>Supermicro chassis, Intel server mobo, Intel Xeon E5504, dual CPU, 24GB RAM</p> <p>6x300GB 15K SAS = 1.3TB</p> <p>6x 2TB SATA = 9.5TB</p> <p>Total Storage: 10.8TB</p> <p><strong>Total Cost: &nbsp; &nbsp; &pound;6528</strong></p> <p>That's about &pound;605 per TB. &nbsp;Not ideal.&nbsp;</p> <p>&nbsp;</p> <p>But there's no real doubt that using iSCSI (or NFS) would provide masses more flexibility for the provisioning of storage for this project. &nbsp;Because the initial plan involved high-availability, using IP-based network storage protocols would also allow the disk-traffic to be routed across the public internet, using some kind of VPN technology.</p> <p>My gut feeling is that the best solution is a cheap(-er) server, backed onto a more expensive disk storage unit. &nbsp;</p> <p>I did consider pricing up a DAS array, and connecting it to one or other of the VM Hosts directly, either by FC or SAS, but then in the remote case of the failure, the disks aren't easily exportable to another server. Especially as SAS traffic can't be directly routed over the network.</p> </p> The Cost of Forward Thinking http://tomoconnor.eu/blogish/cost-forward-thinking <p> <p>In the last two weeks, I've seen at least two websites fall off the internet because of a distinct lack of forward planning</p> <p>Firstly, there was Derren Brown's blog</p> <p>After Derren did his "The Events" trick with the lotto balls and dark magic, the number of fans hitting his page daily looking for clues, news, and gossip, caused the server to fall over.&nbsp;It even caused some of the channel 4 servers some traffic troubles (and they've got a lot of nodes!)</p> <p>Derren's blog was down for at least 2 days, as far as i could see. &nbsp;If his producers/agents/IT manager had said "hey, this stunt might turn out to be popular, let's move onto a cloud infrastructure, with a CDN cache, we might have to invest a bit of money now, but we'll have better uptime than if we're just serving from a single 1U Dedi in a rack" then the site may have remained up and serving for far longer, to endure the wave of traffic generated by the publicity on tv.&nbsp;</p> <p>The second one of these, was caused tonight by Dragons' Den Online, a cut-down version of the popular Dragons' Den format.</p> <p>The final segment was dedicated to a web startup, introducing Yet Another Social Network for families..&nbsp;Something about sharing photos, videos, calendars and wishlists<br />Personally, I do all this with Flickr, Google Apps, and Amazon Wishlist.</p> <p>It was remarked to me at least once, that this could be breaking down the nature of the family unit, because everyone spends their time in front of the computer instead of actually interacting with each other</p> <p>But I Digress</p> <p>About 20 minutes ago, I was looking at their site, Family Fridge, and noticed that it winked out of existence as soon as the web address was mentioned.</p> <p>Yes, they got Slashdotted by the BBC</p> <p>I've seen many a site get taken down by getting a FryTweet, that's a pretty effective way to kill a webserver, when 50,000+ followers all open the site at once, it's not good for any website</p> <p>I suppose there's that old adage about "no such thing as bad publicity"...&nbsp;I can't help but apply the same scenario as before<br />"If we spend a little money now, get a cloud computing services infrastructure, then we can use the Dragons' Den as advertising and get a whole stack of new members in one night"<br />Sure, upgrading the platform isn't free, but the potential in increased revenue from such a "publicity stunt" is significant, and should be enough to offset the cost of the new infrastructure.</p> <p>Moreover, I think it proves to some extent that the investment might not be quite so sound</p> <p>Scalability is something of a buzzword of the times we live and work in, but it's also very important, the moment you launch a product on twitter or facebook, you've instantly got a far wider audience than perhaps you initially anticipated</p> <p>In my opinion, it looks kinda bad on the developers of this site, that either they never anticipated that this would happen, or they don't care.</p> <p>On a technical note, they probably wouldn't need to go as far as a cloud-computing infrastructure, or even a CDN.&nbsp;<br />Simple page optimisations and front-end caching can make a world of difference to generating a new dynamic page for every single visitor.</p> <p>Knowing my luck, someone on Twitter or Facebook will pick this up as "Interesting" and i'll get a hundred requests a second, and my poor overworked hosting account at Streamline will get overwhelmed. &nbsp;</p> </p> The True Age Test http://tomoconnor.eu/blogish/true-age-test <p> <p>A few weeks ago, I wrote about this facebook meme, &ldquo;The Name Game&rdquo; and I hypothesised that this wasn&rsquo;t a meme, but actually a data gathering exercise, possibly started by scammers.<br />I&rsquo;ve found another one. &nbsp;One of my friends took the &ldquo;True Age Test&rdquo;, and came out younger than their actual age. &nbsp;I&rsquo;ve just had a brief flick through the questions.</p> <p>Starting off with fairly harmless, questions which are related to the app, &ldquo;What is your actual age, what race are you, how much exercise do you get&rdquo; etc&hellip;</p> <p>Rapidly progresses into &ldquo;Have you ever had any heart conditions, did anyone in your family die before the age of 60 from coronary related illnesses&rdquo;</p> <p>Later, &ldquo;Do you have diabetes. Do you have any Digestive problems, Do you use drugs, How depressed do you feel, What is your relationship status&rdquo; and so on.</p> <p>Now, not only are these questions a bit personal, but there is no obvious information on how your data will be stored, or used, or archived. &nbsp;Given that facebook already shares a good proportion of your personal data with these applications, what is the probability that you&rsquo;ve just answered enough data to build up a probability report of how much a risk you would be to a) a future employer, b) a bank, building society, etc or c) an insurance salesman.</p> <p>It also doesn&rsquo;t state (nowhere that I saw, anyway) what they&rsquo;re gonna do with the data, Is it transient, or stored in a file somewhere. &nbsp;How long is it stored for? Do they plan to sell the data? Domestically, or overseas?</p> <p>Also, without a comprehensive code review, it&rsquo;s not very easy for people to see whether the data is going to be exported through a backdoor in the code, so even if they say &ldquo;Oh no, the data isn&rsquo;t stored, or identifiable&rdquo;, there doesn&rsquo;t seem to be any easy way to prove that.</p> <p>IIRC, Facebook don&rsquo;t ask to see your sourcecode to the application, so it might be quite easy for an individual with malevolent intent to gather a vast amount of potentially sensitive information quite easily.</p> <p>The motivation for people to participate in this application is simple &ldquo;I want to prove that my &lsquo;real age&rsquo; is younger than my biological age, therefore I feel good about myself&rdquo;.</p> <p>We all want to feel good, don&rsquo;t we?</p> <p>But at what cost?</p> </p> Drabble http://tomoconnor.eu/blogish/drabble <p> <p>I wonder if you&rsquo;ve heard of a Drabble?</p> <p>A drabble, simply put, is a story, normally science fiction or fantasy that is exactly one hundred (100) words in length. No more, no less.</p> <p>Here is mine:</p> <pre>It was a slow day in the spaceport.</pre> <pre>&ldquo;These rocket cowlings aren&rsquo;t going to fix themselves&rdquo;, Simon thought to himself, wistfully.</pre> <pre>It was 4 days since the incident, nobody said a word after it happened, not until this morning, that is.</pre> <pre>Simon knew exactly what to do; he lifted the great copper mallet above his head, and struck the cowling with all his might.</pre> <pre>The resonance shook the entire rocket, the mallet, his arm and the rest of his body. &ldquo;Damnit&rdquo;, Simon swore, just as a shadow appeared over Simon&rsquo;s left shoulder.</pre> <pre>&ldquo;I owe you a pint, for this&rdquo;, the shadow said.</pre> <pre><br /></pre> </p> The Wiki Problem http://tomoconnor.eu/blogish/wiki-problem <p> <p>I love collaborative websites. &nbsp;Wikipedia, Blogs, community oriented stuff like Stack Overflow and ServerFault</p> <p>There is however, the lingering problem of vandalism, and it&rsquo;s one that seems to crop up on pretty much ever collaborative website i&rsquo;ve ever seen. Wikipedia has a lot of newbies contribs which are utter nonsense, advertising, spam, page blanking and so on. &nbsp;There&rsquo;s a hefty team of people on Wikipedia however who go around reverting this kind of stuff. &nbsp;I&rsquo;m one of them. &nbsp;I use mediawiki at work also, so I&rsquo;m pretty confident around the entire wiki platform, and IMHO, mediawiki is the best wiki software out there.</p> <p>Anyway, on Saturday, I was quite pleased to discover that the Science Museum in London has now got a collaborative object wiki.</p> <p>I love the idea of having visitors add their own memories of stuff that is on exhibition. &nbsp;It seems that it&rsquo;s mostly household items that are well commented on, for example Frigidare Refridgerators.</p> <p>It was on this site, on saturday that I discovered that they had fallen to the terrible plague of edit vandalism, and the homepage of the wiki was now some statement about some girl called Louise and her love of turkey and cannock. It seemed she had also discovered her User Page, and decided to spread the nonsense to the public home page.</p> <p>I created an account, reverted her edit, left her a message on her talk page (Sometimes these passive-aggressive things are all you can do!), and then had a rather nice thank you message from one of the administrators.</p> <p>I think that might have been my 8 or 9th visit to the science museum. &nbsp;I&rsquo;m forever discovering new stuff there.. That, and they keep adding new stuff :-). &nbsp;I&rsquo;m quite looking forward to the future &ldquo;Biker Tribes&rdquo; exhibition, as I&rsquo;m rather mad about motorbikes these days (more on that soon! [Sidenote: Anyone following me on Flickr might be interested in my Motorbikes Collection]). &nbsp;<br />There&rsquo;s much more I could say in praise of the Science Museum, but I haven&rsquo;t time, or pixels left.</p> </p> Uncrackable Passwords http://tomoconnor.eu/blogish/uncrackable-passwords <p> <p>I got an email today from some software company.. Trying to sell me a password management tool. &nbsp;I used to use KeePass which was pretty effective. &nbsp;This one is considerably more expensive. &nbsp;Among its features, it boasts:</p> <p><ol> <li>Generate uncrackable passwords using the integrated Password Formulator</li> <li>Maximum protection of your sensitive data thanks to the security algorithm Rijndael 256-Bit!</li> <li>Instead of passwords like &ldquo;toothbrush&rdquo; or &ldquo;Rover&rdquo;, which can both be cracked in a few minutes, you now use passwords like &ldquo;g\/:1bmV5&Prime;&pound;$p&rsquo;}=8&gt;,,/2&not;%`CN?\A:y:Cwe-k)mUpHiJu:0md7p@&lt;i&rdquo; (with a 1-GHz-Pentium-PC, it takes approx. 307 years to guess this password!).</li> <li>Password lists on the internet: Place your encrypted password lists on the Internet and enjoy access to all of them, no matter where you are!</li> <li>Protection from keylogging (intercepting of keystrokes) &ndash; All password fields are internally protected from keylogging.</li> </ol></p> <p>I&rsquo;ve got issues with all three five points above.</p> <p><ol> <li>That&rsquo;s a pretty bold statement to say that your passwords are uncrackable.. I suspect they really mean that they haven&rsquo;t been able to crack them, or somebody &nbsp;hasn&rsquo;t been able to crack them YET.</li> <li>Another word for &nbsp;Rijndael&hellip; &nbsp;Yep, AES. &nbsp;Really nothing that sophisticated. &nbsp;Under closer inspection they&rsquo;re really no better than the free alternatives.</li> <li>While &ldquo;g\/:1bmV5T$x_sb}8T4@CN?\A:y:Cwe-k)mUpHiJu:0md7p@&lt;i&rdquo; may be long, secure, mixed cases, characters, alphanumeric, and symbols, it&rsquo;s certainly not memorable. &nbsp;So what happens if you generate this password for XYZ internet banking service, and then you go on holiday and forget to pay a bill, or need to move some money about.. You don&rsquo;t have your password safe with you. &nbsp;Bugger.</li> <li>Does anyone else think this is potentially asking for trouble? Assuming XYZ company is hosting them, &ldquo;securely&rdquo;, how can you prove they don&rsquo;t have a backdoor to decrypt the files. &nbsp;Do you trust them? Considering you&rsquo;ve paid &euro;30 for this package, it&rsquo;s not really as binding as a really expensive legal SLA.</li> </ol></p> <p>The other thing that&rsquo;s at the front of my mind now, is what password do you use to lock the password safe? Do you use a long, complex, difficult to break one, which you&rsquo;ll probably never remember, and will need to write it down (therefore making it totally pointless anyway), or a simple short password like your first pet&rsquo;s name, and some thoughtful numbers after it.</p> <p>Sidenote to point 3. &nbsp;307 years on a 1GHz Pentium.. What about a dual-quad core Pentium Xeon. &nbsp;Or a distributed attempt across 256 nodes of dual-quad core Xeons. &nbsp;Still, it&rsquo;s reaching a bit far, but it doesn&rsquo;t mean that this password is unbreakable. &nbsp;Not by a long way.</p> <p>Uh, right.. So this software is going to prevent me from putting a PS2/USB hardware keylogger between the PC and the keyboard? I think not. And if it claims to protect against software keylogging, how could you prove that it wasnt a keylogger itself. &nbsp;It would be a pretty ingenious way to harvest credentials, make the user believe they&rsquo;ve just bought a security enhancement, really they&rsquo;re buying a back door. &nbsp;(I&rsquo;m not saying that&rsquo;s what they&rsquo;re doing, but it&rsquo;s certainly enough to make me want further verification of the publisher&rsquo;s honesty.)</p> <p>I really don&rsquo;t like the sound of this software, actually, I&rsquo;m not keen on this &ldquo;credentials management&rdquo; type thing at all. &nbsp;There&rsquo;s too many unanswered questions. &nbsp;And that&rsquo;s before we get onto the rather open question of the use of biometrics for passwords. There seems to be a growing trend at the moment where biometric data (fingerprints, webcam images, iris scans) provide the password data, as opposed to the identity data that is then confirmed with a password.</p> <p>Private keys and passwords are easy to change when compromised, but how do you change your fingerprint, facial shape, or iris detail when your credentials are compromised?</p> </p> Epic Fail http://tomoconnor.eu/blogish/epic-fail <p> <p>Another lesson learnt by a company who really should know better.</p> <p><strong>Raid != Backup.</strong></p> <p>This might be widely regarded as old news, but it&rsquo;s not too late IMO for me to add my $0.02.</p> <p>I picked this up on Slashdot about 20 minutes ago, &nbsp;and there&rsquo;s a few things that strike me as odd about the whole malarkey.</p> <p>Before I go any further though, I&rsquo;ve never heard of Journalspace until this article arose, &nbsp;then again, they&rsquo;re not really in my general field of view, I&rsquo;ve always had my own blog, on my own space.. so it&rsquo;s not really my &lsquo;thing&rsquo;.. Anyway, one thing that is my &lsquo;thing&rsquo; is data security and assurance.</p> <pre>Journalspace is no more.</pre> <pre>DriveSavers called today to inform me that the data was unrecoverable.</pre> <pre>Here is what happened: the server which held the journalspace data had two large drives in a RAID configuration. As data is written (such as saving an item to the database), it&rsquo;s automatically copied to both drives, as a backup mechanism.</pre> <p>Anyway&hellip; A few things strike me as odd.</p> <p>Was that RAID really their ONLY backup?.. for a site that had been going for 6 years, and probably had &gt;1000 users, I&rsquo;m surprised that they didn&rsquo;t write backups into their disaster recovery plan, and/or their plan to scale their site to meet their user&rsquo;s needs.</p> <p>Blaming OSX? That&rsquo;s a bit of a low blow. &nbsp; I&rsquo;ve never used OSX Server for webhosting, but it seems reasonably unlikely that this is the cause of their problems. &nbsp;And even if it was, that&rsquo;s still NO excuse not to have some form of backup.</p> <p>Disgruntled Employee Syndrome. &nbsp;While it&rsquo;s not always possible to keep 100% of employees happy for 100% of the time, it is reasonably easy to revoke root keys on servers, delete user accounts, remove privileges, etc when the employee leaves the company. &nbsp;It&rsquo;s like not taking their office keys from them when you escort them from the building. &nbsp;&ldquo;Come back and steal our data, we&rsquo;re practically leaving the whole office open&rdquo;.</p> <p>On a slightly different note,<em> RAID is not Backup, it&rsquo;s part of the solution.</em></p> <p>Well, actually, it&rsquo;s closer related to high availability and redundancy, but that is a different story.</p> <p>Off-machine backups are the key here. &nbsp;While they&rsquo;re costly, and time consuming to set up, they&rsquo;re also an essential part of the plan to maintain and scale.</p> <p>Mirrored disks on a RAID array will restore data fine if one of the disks fails, but if you run rm -rf /path/to/raid/folder, then the RAID will just mirror that command on each of the disks. &nbsp;Bye bye data&nbsp;</p> <p>I think it&rsquo;s somewhat unfair to expect all users to keep full backups of their own data. &nbsp;Not outrageous a demand, but you kinda expect at least some &nbsp;form of data storage, so that your 6 years of precious thoughts and feelings aren&rsquo;t lost into the ether one day.</p> <p>Given that each user might have 6 years of blogposts, maybe 2 a week?</p> <p>For 10,000 users, I make that about 600GB, averaging 100k per blogpost.</p> <p>(6*2*52*100*10000)</p> <p>Still, that&rsquo;s not a vast amount.. Could fit that on a fairly small DLT tape.. Could easily replicate that across a few servers, seperated geographically, you could write it to a shitload of &nbsp;DVDs, few dozen blurays, Shove it on a portable USB HDD and stick it in a fire safe in the CTO&rsquo;s basement.</p> <p>Hell, it&rsquo;s still less than a terabyte of data.</p> </p> Chip, Pin, Password... http://tomoconnor.eu/blogish/chip-pin-password-securecode-challenge-auth <p> <p>The list goes on. &nbsp;It really doesn&rsquo;t end there.</p> <p>Anyone who uses internet banking these days will find themselves handing over a vast array of numbers and passwords, authentication tokens and browser cookies. &nbsp;You have a card, this has a chip, you have a Challenge/Response card reader, and you have a pin.</p> <p>There&rsquo;s at least half a dozen banks in the UK that I can name who use the Challenge/Response type &nbsp;card readers.</p> <p>To log into my online banking, I need my Passwords, Pins and if i want to do &ldquo;advanced functionality&rdquo; I need my card and challenge auth reader.</p> <p>Now.. this is all very cool, I don&rsquo;t mind the CR device. &nbsp;No, my beef is with SecureCode.</p> <p>MasterCard / Natwest have licensed this &ldquo;extra level of auth&rdquo; for online transactions.</p> <p>Dominos pizza.. one of my favourite food retailers on the web have a requirement that I use my SecureCode password to authenticate that I&rsquo;m not a thief when i want to eat pizza.</p> <p>This is not helpful. &nbsp;The SecureCode password can&rsquo;t be any of the ones you already use for phone or netbanking</p> <p>and has to be &gt;8 chars alphanumeric. &nbsp;no symbols it seems ..</p> <p>Ok, so you can&rsquo;t remember it.. no problem, you just enter your DOB, some card details and it lets you through..</p> <p>How is that any more secure than just plain card details auth? &nbsp;IF anything.. isn&rsquo;t it less secure because it&rsquo;s loading a seperate site in an iframe on the retailer&rsquo;s website?</p> <p>Why can&rsquo;t i just use my Challenge/Response card reader and have everything work together?</p> <p>And secondly, Why can&rsquo;t I use that to login to online banking?</p> <p>If you work for natwest, mastercard, or any other monetary establishment, do pop a comment in and explain why the system is so archaic, and to be frank. SUCKS.</p> </p>