tag:blogger.com,1999:blog-2598850313524340302024-02-08T19:15:54.437+00:00All SquidgyPeterhttp://www.blogger.com/profile/18278555310373233830noreply@blogger.comBlogger20125tag:blogger.com,1999:blog-259885031352434030.post-29469744306870435352019-12-30T15:43:00.006+00:002023-05-10T20:43:09.371+01:00SD Cards as Audio PlayersI've often found it useful to be able to convince Rhythmbox (or other similar media player software) that an SD Card (or other similar USB Mass Storage) should be treated as an Audio Player. This trickery means that Rhythmbox will show the "device" in its UI and allow synchronising playlists to the "device".
<br />
<br />
As I'm often forgetting how to achieve this, this blog post contains some notes on the topic. This is drawn from a combination of the Gnome docs "<a href="https://help.gnome.org/users/rhythmbox/stable/portable-audio-player.html.en">Portable Audio Player Source</a>" and the Almost a Technocrat blog "<code><a href="https://almost-a-technocrat.blogspot.com/2010/11/isaudioplayer.html">.is_audio_player</a></code>". The latter I have partially duplicated below in case it falls off the internet.
<br />
<br />
In short, you can turn some plain old mass storage into an audio device by adding a file <code>.is_audio_player</code> in the root of the storage. That's all that's needed to make it work.<br />
<br />
This neatly sidesteps <a href="https://en.wikipedia.org/wiki/Media_Transfer_Protocol">MTP</a> (the "Media Transfer Protocol") which many modern devices prefer to use, though offers similar feeling integrations to various media playing software.<br />
<br />
However if you want to go further then you can also customise various aspects of the apparent device by adding content to the file in what appears to be an ini-like format.
<br />
<br />
Quoted from Almost a Technocrat blog <code><a href="https://almost-a-technocrat.blogspot.com/2010/11/isaudioplayer.html">.is_audio_player</a></code>:<br />
<blockquote>
<a href="https://www.blogger.com/null" name="more"></a>
<ul>
<li><b>name</b><br />
<i>Device name (use "" to quote a name that have spaces in between) that will appear in the music management softwares.</i></li>
<ul>
<li><i>Without this option, the device name that appears in the music management softwares will follow the mount name specified in the system.</i></li>
</ul>
<li><b>audio_folders</b> <br />
<i>The list (comma separated values) of folders where music files are stored on the device. Music management softwares will copy tracks to the first folder in that list.</i></li>
<ul>
<li><i>Without this option, the music management software will transfer the music files to the root path.</i></li>
</ul>
<li><b>folder_depth</b><br />
<i>The maximum foler depth supported by the device. Do not set it if the device has no limitation.</i><br />
<i><br />
If the player stores all the music with the tree <b>/ <audio_folders> /<Artist> / <Album></b>, use the parameter <b>folder_depth = 2</b>.<br />
<br />
For a compilation of Beatles containing two discs with the tree <br />
<b>/ <audio_folders> /Beatles/Compilation/Disc1</b>, with folder_depth=2, sound files located in "Disc1" will not be seen.<br />
<br />
This parameter is also used when importing new songs:<br />
<b>folder_depth =0</b> : puts the files in the root folder specified in the first audio_folders as <br />
<audio_folders> /<filename> ;<br />
<b>folder_depth =1 </b>: place the files in a subfolder. He will be placed in the first reported in audio_folders as <br />
<audio_folders> /<artiste> - <album> / <filename> ;<br />
<b>folder_depth =2 and above</b> : puts the files in two sub-folder. These will be placed in the first reported in audio_folders as <br />
<audio_folders> /<artiste> / <album> / <filename>.</i></li>
<ul>
<li><i>Without this option, the folder depth is considered as 0 (folder_depth=0).</i></li>
</ul>
<li><b>output_formats </b><br />
<i>The list of file types (MIME types, <span class="Apple-style-span" style="font-style: normal;"><i>comma separated values</i></span>) supported by the device. The first type listed will be used for the automatic "on-the-fly" conversion/transcoding when transferring into the "portable audio player".</i></li>
<ul>
<li><i>Without this option, the music management software will use the file types set in it's preferences.</i></li>
</ul>
<li><b>input_formats </b><i>The list of file types (MIME types, <span class="Apple-style-span" style="font-style: normal;"><i>comma separated values</i></span>) supported by the device that can be save into the "portable audio player" using the microphone or from a radio show. </i></li>
<ul>
<li><i>Without this option, it is considered that the "portable audio player" cannot record audio.</i></li>
</ul>
<li><i></i><b>playlist_format </b><i><br />
The list of playlist formats <span class="Apple-style-span" style="font-style: normal;"><i>(MIME types, <span class="Apple-style-span" style="font-style: normal;"><i>comma separated values</i></span>)</i></span> supported by the device.</i></li>
<li><b>playlist_path </b><i><br />
The folder containing playlists files on the device. </i></li>
<ul>
<li><i>Without this option, the music management software will copy the playlists to the same folder where it copies the music files.</i></li>
</ul>
<li><i></i><b>cover_art_file_type </b><i><br />
The type of image supported by the device, such as jpeg, png, tiff, ico or bmp.</i></li>
<li><i></i><b>cover_art_file_name </b><i><br />
The filename expected by the device for the cover art image.</i></li>
<li><i></i><b>cover_art_size </b><i>The size of the cover art image, in pixels. The image is a square, so it's only one number.</i></li>
</ul>
<br />
<b>Note:</b><br />
To find out the MIME types of your Ubuntu Linux, goto "/usr/share/mime".<br />
<br />
<b>Example:</b><br />
<pre><code>-------.is_audio_player-------
name="My Portable Audio Player"
audio_folders=Music/, Sounds/
folder_depth=2
output_formats=audio/mpeg,audio/x-ms-wma,application/ogg
-----------------------------------</code></pre>
</blockquote>
Peterhttp://www.blogger.com/profile/18278555310373233830noreply@blogger.comtag:blogger.com,1999:blog-259885031352434030.post-24615847052492183612017-12-28T18:47:00.000+00:002017-12-28T18:47:49.780+00:00Diagnostic Assertions: How to make reading, writing & fixing tests easier<h4>Is testing hard?</h4>
<p>
All good engineers validate their work to ensure that it behaves as expected. As
a software engineer, that means writing automated tests which can easily be run
whenever your code changes.
</p><p>
While developers strive to create tests for their code, few enjoy doing so and
even fewer enjoy fixing their tests. This therefore creates a problem, as people
will tend to avoid doing things they don't enjoy.
</p><p>
If we can make the creation and fixing of tests easier then it seems likely that
more tests will be created, leading to software that is better checked in how it
behaves.
</p><p>
<em><strong>Note</strong>: this post is mostly a write-up of a <a
href="https://www.youtube.com/watch?v=DPRd4jEnuBE&t=3622">lightning talk</a>
I gave at <a href="http://2017.pyconuk.org/">PyCon UK 2017</a> at the end of
October, so if you'd rather consume this as four minute talk then head over to
<a href="https://www.youtube.com/watch?v=DPRd4jEnuBE&t=3622">the video on
YouTube</a>.</em>
</p>
<h4>Some bad tests</h4>
<p>
In the following examples, we assume that we already have a
<code>make_request</code> function defined which makes a web request of a local
client and that it's the local client we're testing. The tests themselves appear
to fail which is fine as it's the way that the tests themselves that we're
interested in looking at.
</p>
<script src="https://gist.github.com/PeterJCLaw/19d61ee446ce68a3c07a7387881c0741.js"></script>
<p>
These tests don't provide much in the way of useful output. even though we've
added messages to our assertions:
</p>
<pre><code>FFF
======================================================================
FAIL: test_invalid_post (__main__.RequestTests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "<ipython-input-2-438368b7f979>", line 14, in test_invalid_post
self.assertTrue(200 == response, "Bad status code")
AssertionError: Bad status code
======================================================================
FAIL: test_page_loads (__main__.RequestTests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "<ipython-input-2-438368b7f979>", line 6, in test_page_loads
self.assertTrue(200 == response, "Bad status code")
AssertionError: Bad status code
======================================================================
FAIL: test_valid_post (__main__.RequestTests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "<ipython-input-2-438368b7f979>", line 10, in test_valid_post
self.assertTrue(200 == response, "Bad status code")
AssertionError: Bad status code
----------------------------------------------------------------------
Ran 3 tests in 0.003s
FAILED (failures=3)
</code></pre>
<h4>Adding <code>longMessage</code></h4>
The standard <code>unittest</code> library provides a mechanism to get a bit more information from assertion messages in the form of the <a href="https://docs.python.org/2/library/unittest.html#unittest.TestCase.longMessage"><code>longMessage</code></a> attribute which you can set on your classes.
<script src="https://gist.github.com/PeterJCLaw/bf4a6c851e5462d0716b0c7fba51b86e.js"></script>
This improves the results slightly as we can now see what the expected and actual values are:
<pre><code>FFF
======================================================================
FAIL: test_invalid_post (__main__.RequestTests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "<ipython-input-3-fd71f2c85adb>", line 16, in test_invalid_post
self.assertTrue(200 == response, "Bad status code")
AssertionError: False is not true : Bad status code
======================================================================
FAIL: test_page_loads (__main__.RequestTests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "<ipython-input-3-fd71f2c85adb>", line 8, in test_page_loads
self.assertTrue(200 == response, "Bad status code")
AssertionError: False is not true : Bad status code
======================================================================
FAIL: test_valid_post (__main__.RequestTests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "<ipython-input-3-fd71f2c85adb>", line 12, in test_valid_post
self.assertTrue(200 == response, "Bad status code")
AssertionError: False is not true : Bad status code
----------------------------------------------------------------------
Ran 3 tests in 0.002s
FAILED (failures=3)
</code></pre>
<p>
However due to the way that the assertions are constructed that isn't actually
very helpful just yet.
</p>
<h4>Using <code>assertEqual</code></h4>
<p>
Thankfully <code>unittest</code> provides more useful assertion helpers. These
include a number of more advanced comparisons (in particular for collections),
though for now we'll just look at <code>assertEqual</code>.
</p><p>
By using <code>assertEqual</code> we let <code>unittest</code> do the
comparison, which means that it can also generate a more descriptive error
message:
</p>
<script src="https://gist.github.com/PeterJCLaw/828a8ae4f0c2e2e361de75760c624f63.js"></script>
<pre><code>FFF
======================================================================
FAIL: test_invalid_post (__main__.RequestTests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "<ipython-input-4-1e8aaded9316>", line 16, in test_invalid_post
self.assertEqual(200, response, "Bad status code")
AssertionError: 200 != (500, "Oops! Here's a stack trace...") : Bad status code
======================================================================
FAIL: test_page_loads (__main__.RequestTests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "<ipython-input-4-1e8aaded9316>", line 8, in test_page_loads
self.assertEqual(200, response, "Bad status code")
AssertionError: 200 != (200, '<h1>This is the good page</h1>') : Bad status code
======================================================================
FAIL: test_valid_post (__main__.RequestTests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "<ipython-input-4-1e8aaded9316>", line 12, in test_valid_post
self.assertEqual(200, response, "Bad status code")
AssertionError: 200 != (200, '<h2>Your submission was invalid</h2>') : Bad status code
----------------------------------------------------------------------
Ran 3 tests in 0.004s
FAILED (failures=3)
</code></pre>
<p>
This failure now shows us that the response is not in the format we expected, which explains some of the failures we've got.
</p><p>
Fixing that leads to our first passing tests:
</p>
<script src="https://gist.github.com/PeterJCLaw/f0d233cfdeb5e265571571f3c8cc2a23.js"></script>
<pre><code>F..
======================================================================
FAIL: test_invalid_post (__main__.RequestTests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "<ipython-input-5-5f85b03559e5>", line 16, in test_invalid_post
self.assertEqual(200, status_code, "Bad status code")
AssertionError: 200 != 500 : Bad status code
----------------------------------------------------------------------
Ran 3 tests in 0.004s
FAILED (failures=1)
</code></pre>
<p>
While that's clearly a step forward, we're still interested more in the failure
than the passing tests. As we can see, we now know <em>how</em> it's failing
(the wrong status code), though we don't really understand <em>why</em> it's
failing.
</p>
<h4>Assert more things</h4>
<p>
On the way to making our tests provide clearer explanations of what's wrong, we
should aim to have them check as much as would be useful to know has broken.
This is partly as we want to constrain the behaviour of the system under test,
but also because we can usually extract a better understanding of the system if
we know more about the failure.
</p>
<script src="https://gist.github.com/PeterJCLaw/011f89d94adf5f1ab85368ae0ba6901e.js"></script>
<p>
Having done this, we can see that one of the tests which was previously passing now catches a bug:
</p>
<pre><code>F.F
======================================================================
FAIL: test_invalid_post (__main__.RequestTests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "<ipython-input-6-5c8355f13e67>", line 18, in test_invalid_post
self.assertEqual(200, status_code, "Bad status code")
AssertionError: 200 != 500 : Bad status code
======================================================================
FAIL: test_valid_post (__main__.RequestTests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "<ipython-input-6-5c8355f13e67>", line 14, in test_valid_post
self.assertIn('submission succeeded', body)
AssertionError: 'submission succeeded' not found in '<h2>Your submission was invalid</h2>'
----------------------------------------------------------------------
Ran 3 tests in 0.003s
FAILED (failures=2)
</code></pre>
<h4>Extract helper assertions</h4>
<p>
Having added a large number of assertions to each of your tests, you'll find
that there is quite a lot of duplicated assertions. We can therefore apply the
usual practise of extracting the common parts to a helper so that we can achieve
both clarity and space improvements:
</p>
<script src="https://gist.github.com/PeterJCLaw/e02bdd1404ce4a694c7ef32193fa9044.js"></script>
<p>
This results in the same assertions being run and the same test failures being
found, though now it's much clearer to anyone reading the test code what the
intent of those assertions is.
</p>
<h4>Summary</h4>
<p>
There are a number of things which you can do to make it easier to find &
fix issues in your code, and test code is no different. To make it easier to
work with your <code>unittest</code> tests, you should make use of the
<code>longMessage</code> attribute and extract custom assertions where they will
improve clarity.
</p>
Peterhttp://www.blogger.com/profile/18278555310373233830noreply@blogger.comtag:blogger.com,1999:blog-259885031352434030.post-29663430853824910642011-11-17T20:00:00.001+00:002011-11-17T21:16:15.043+00:00Adventures of a Queen's Scout: The CenotaphWe join the story shortly before last weekend.
Having been awarded my Queen's Scout award I've been invited to take part in the Queen's Scout Honour Gaurd at the Cenotaph on Remembrance Sunday.
<br />
<br />
So, last Thursday, I drove up to London for a rehearsal at Whitehall, which outlined the tasks we would have on the day, and provided an introduction to the other Queen's Scouts taking part.
We met up on Whitehall mid-evening to be escorted inside the Foreign & Commonwealth Offices where we wandered around uncertainly before finding the room we'd been allocated to leave our stuff in.
The briefing that followed explained the tasks that we'd have three days later, namely handing out programmes to members of the public that were arriving to see the ceremony, and forming up outside the offices, right in front of the <a href="http://en.wikipedia.org/wiki/The_Cenotaph,_Whitehall">Cenotaph</a>.
<br />
<br />
The latter turned out to be very simple — we had to form up just inside the building, march outside and then stand still as the dignitaries walked past on their way out.
We practised this a few times in a corridor before moving out on to the pavement to confuse any late-night tourists, and soon mastered the manoeuvres.
<br />
<br />
Bright and early on Sunday morning (and chilly at 8:30am!) we again met outside the Foreign and Commonwealth office to make our way inside.
After heading outside with large stacks of orders of service, it became clear just how many people would be attending.
The number of people already present on Whitehall at 9am was quite remarkable, and by an hour later it was certainly filling up.
The trick, it emerged, was to wait by the entrances to hand out the programmes as people arrived, rather than trying to hand them out to the few people in the crowds that might not already have one.
<br />
<br />
Shortly after 10am we had to be back inside the offices so that the Armed Forces could begin forming up at the Cenotaph, and so that we could be in place for the start of the ceremony.
There was also a chance for a quick drink and biscuits before we had to get ready for the more formal part of our duties.
<br />
<br />
Following some initial confusion about where we should be forming up, we were eventually given the nod that we should begin marching outside.
We were the first to emerge from the building into the morning sunlight, which was thankfully beginning to warm things up a bit.
Not long after, the choristers and the Lord Bishop of London followed us out, signalling the start of the emergence of the dignitaries.
This was pretty much the start of the ceremony, and is captured on TV (of course), and if you've got access to <a href="http://en.wikipedia.org/wiki/Iplayer">iplayer</a> then you can start <a href="http://www.bbc.co.uk/i/b01772nn/?t=28m22s">watching along</a>.
<br />
<br />
Despite having known all along that there would be highly important people walking right past me, I don't think that it was until the politicians, led by David Cameron, were walking past that this really hit home.
I think my thoughts were approximately:
<blockquote>
Cameron... (woah, that's the actual prime minister) Clegg.. (they really do look like their photos) more politicians.. (hrm this is a bit serious) politicians.. politicians.. politicians.. Oh, look, it's <a href="http://en.wikipedia.org/wiki/Boris_Johnson">Boris</a>!
</blockquote>
<br />
<br />
The politicians were followed by other dignitaries, and eventually the Royal party, <a href="http://www.bbc.co.uk/i/b01772nn/?t=33m38s">lead by the Queen</a>.
It was quite a remarkable experience to see the Royal family walk literally a couple of feet in front of me.
Of course their arrival signalled that it was nearly 11 o'clock, and time for the 2 minutes silence.
Even having been warned that there would be a loud bang when the artillery gun on <a href="http://en.wikipedia.org/wiki/Horse_Guards_Parade">Horse Guards Parade</a> would be fired to coincide with Big Ben's chime of 11, but nothing quite prepares you for just how loud and thunderous it is (it may sound loud on the TV, but trust me, that doesn't get close).
<br />
<br />
Following the silence, the wreath laying and the short service lead by the Lord Bishop the dignitaries headed back into the Foreign & Commonwealth Offices.
The Honour Guard is the last to re-enter the building, in many ways it was good to be "off the hook" as we disappeared from public view, but it was also sad as it signalled the end of a unique experience.Peterhttp://www.blogger.com/profile/18278555310373233830noreply@blogger.comtag:blogger.com,1999:blog-259885031352434030.post-15112465594853070822011-11-15T22:04:00.001+00:002011-11-17T21:20:30.674+00:00Adventures of a Queen's Scout: Journey to the center of LondonBack when I was at school, everyone did the Duke of Edinburgh's Silver, it was just expected.
DOE Gold was offered, and each year some sixth-formers went for it.
Having been a cub and then a scout, and having completed by <a href="http://en.wikipedia.org/wiki/Explorer_Belt">Explorer Belt</a> a few years earlier, it seemed the natural thing to progress into.
One of the teachers suggested that we try doing it in Kayaks, rather than walking, which turned out to be a great fun.
We ended up spending a week exploring the river Allier, in the South of France, for a week.
The only downside to this mode of travel was that the nights were a little cold, though that is to be expected and balanced out the glorious sunshine we had during the days.
<br />
<br />
I didn't actually end up completing my DOE Gold until the summer after my A-Levels, when I spent a week on residential with a friend from scouts rebuilding the <a href="https://maps.google.com/maps?saddr=50.593781,-2.004775&daddr=50.594156,-2.004088&hl=en&sll=50.593028,-2.004141&sspn=0.002864,0.005499&vpsrc=0&mra=mift&mrsp=1&sz=18&t=h&z=18">stone path</a> down to <a href="http://en.wikipedia.org/wiki/Dancing_Ledge">Dancing Ledge</a> in South Dorset.
This complicated getting everything signed off, and I eventually got everything sorted and went to St James' Palace for a presentation in the summer of 2009, where we were graced by the Duke of Edinburgh himself.
Amusingly, the Duke recognised the Gold broach my mum, who was among the guests present, was wearing as being her DOE Gold award, and commented on it.
<br />
<br />
Fast forward to this Easter, when I was invited to attend the Queen's Scout parade at Windsor.
This is the formal, pomp-and-circumstance, part of the award being conferred, and collects all the recent Queen's Scouts from around the country to parade with a military band inside Windsor Castle.
There, the <a href="http://en.wikipedia.org/wiki/Chief_Scout_%28The_Scout_Association%29">Chief Scout</a> (currently <a href="http://en.wikipedia.org/wiki/Bear_Grylls">Bear Grylls</a>) and a representative of the Royal family congratulate each of the scouts and take a marching salute from each of the regional groups.
This is, in many ways, a more interesting ceremony than the local part where you are actually given the badges and certificate which confer the award.
<br />
<br />
I managed to arrange for my award ceremony to take place at the end of an otherwise (mostly) ordinary meeting at the start of the new term of my home scout group, <a href="http://www.1stealingnorth.co.uk/">First Ealing North</a>.
At the end of the meeting we presented a large number of badges to the scouts that had earned them towards the end of the previous term, or had had them signed off during our Summer Camp.
There were a surprisingly large number of badges, and it took quite a while.
This culminated with our County Commissioner presenting me with my Queen's Scout certificate and asking some questions about the things I had done, and encouraging all the scouts present to pursue their own awards.
Afterwards, one of the things that he mentioned was that there was an opportunity for Queen's Scouts from the London counties to be a part of the Honour Guard at the Cenotaph on Remembrance Sunday.
Since was a remarkable honour and literally a once-in-a-lifetime opportunity, I asked him to put my name down for inclusion, and I was lucky enough to be asked to take part by the organisers.
<br />
<br />
Continued in <a href="/2011/11/adventures-of-queens-scout-cenotaph.html">Part 2: The Cenotaph</a>...Peterhttp://www.blogger.com/profile/18278555310373233830noreply@blogger.comtag:blogger.com,1999:blog-259885031352434030.post-79760976651886901042011-09-08T20:56:00.000+01:002011-09-08T20:56:10.353+01:00Using MySQL as a backend for Apache Authentication<p>
You might be wondering why you'd want to use MySQL as a backend to Apache Authorisation.
For my planned use there was one very compelling reason: I already had a list of users with accounts in a MySQL database (from my CMS),
and I didn't want to have to replicate the list, or make my users have another login.
</p><p>
Some quick searching on the internet yielded an Apache module called
<a href="http://modauthmysql.sourceforge.net/"><code>mod_auth_mysql</code></a>, which sounded perfect.
Unfortunately all is not as simple as it sounds.
As a result I've compiled a guide that will hopefully be helpful to someone else too.
</p><p>
<h3>Install & Enable:</h3>
<p>
I'm using Ubuntu Natty and Apache2, which means that it's available from the repos, so:
<pre><code> (sudo) $ apt-get install libapache2-mod-auth-mysql
(sudo) $ a2enmod auth_mysql
(sudo) $ apache2ctl restart</code></pre>
</p>
<h3>Configure:</h3>
<p>
For reasons unknown the online <a href="http://modauthmysql.sourceforge.net/CONFIGURE">documentation</a>
on <a href="http://sf.net/">SourceForge</a> is out of date, referring to a much older version than the one in the current Ubuntu.
Thankfully I did find that as part of the package install some docs were also installed into <code>/usr/share/doc/libapache2-mod-auth-mysql/</code>.
There I found a couple of useful <a href="http://en.wikipedia.org/wiki/Gzip">GZipped</a> files: USAGE.gz and DIRECTIVES.gz.
Having found these it's much simpler than trying to piece things together from the old docs on SourceForge, but here are the highlights.
</p>
<h4>Disable other Auths:</h4>
<p>
For some reason Apache doesn't like using <code>mod_auth_mysql</code> concurrently with other auth types,
so you need to disable any other auths for the location where you're trying to use MySQL auth.
It's suggested that you can do this by disabling the other auth modules, but this simply confused things for me, and didn't seem to work.
The alternative (which I recommend) is to locally disable them using directives:
<pre><code> # You might only need one of these.
AuthBasicAuthoritative Off
AuthUserFile /dev/null</code></pre>
</p>
<h4>Create a MySQL account for apache:</h4>
<p>
You <em>could</em> use an existing account, but I wouldn't recommend this for two reasons:
<ol>
<li>The password needs to be stored in plaintext as part of the Apache config.</li>
<li>You'll probably want to restrict the access rights of the user down to just <code>SELECT</code> on the table the users are stored in.</li>
</ol>
I'm not going to detail how to do this here,
except to note that I used <a href="http://www.phpmyadmin.net/home_page/index.php">PHPMyAdmin</a>,
which made it really easy.
</p>
<h4>Setup your MySQL details:</h4>
<p>
Using the DIRECTIVES file as a reference this was actually pretty simple,
this is approximately what the MySQL bits of my config file look like:
<pre><code> AuthType Basic
Auth_MySQL On
# My CMS uses PHP's md5()
Auth_MySQL_Encryption_Types PHP_MD5
Auth_MySQL_Host localhost
Auth_MySQL_DB my_cms_db
Auth_MySQL_User apache
Auth_MySQL_Password password
# ^Change this^ !
Auth_MySQL_Password_Table users
Auth_MySQL_UserName_Field username
Auth_MySQL_Password_Field password
Auth_MySQL_Authoritative On</code></pre>
As you can see it's pretty easy to figure out which directives do what once you know the names.
The slight oddity is the <code>Auth_MySQL_Password_Table</code> directive,
which is the table the users and their password are looked up in.
</p>
<h3>You're done</h3>
<p>
Sit back and enjoy managing your users in MySQL.
</p>
Peterhttp://www.blogger.com/profile/18278555310373233830noreply@blogger.comtag:blogger.com,1999:blog-259885031352434030.post-67709998681202464822010-08-01T15:14:00.003+01:002010-08-01T15:20:14.527+01:00Ubuntu Upgrade - The AftermathWell, as mentioned above, I forgot to grab a list of custom repos, but that was about the only thing of note in what I can honest describe was the smoothest upgrade I've ever done. More so than some of the in-place ones I've done too, which I'm pretty impressed with. There were a few things that I had to tweak, but these were down to how I've got my system setup, and I doubt they'll affect the majority of people. (I needed to copy the grub bootsector twice -- I presume an update went through in my first batch of updates -- and the usual tomfoolery to get ATI's graphics manager to work how I want with my two screens, but again this is far improved vs Karmic.)<br /><br />Re-installing my packages was smooth too. I ran diff on the two lists of manually installed files, and then just looked down the list for those I wanted to bring back. Despite this I'm wishing that apt allowed you to add packages of the list of those to be installed once it was going, or at least during the downloading stage, since I still forgot some. Another nice feature there would be to sort the downloads such that it can begin some of the installs while other downloads continue.<br /><br />It was really pleasing to login to my clean install and immediately have all my old settings present (though since I store some on yet another partition I didn't quite get my look-and-feel back right away). Thankfully a quick dive into <code>/etc/fstab</code> to paste in my old settings quickly resolved this one.<br /><br />There are some slight issues with Lucid, most noticeably the desktop background isn't quite right though it had already been <a href="https://bugs.launchpad.net/ubuntu/+source/meta-gnome2/+bug/521492">filed as a bug</a> on <a href="https://launchpad.net/">Launchpad</a>.Peterhttp://www.blogger.com/profile/18278555310373233830noreply@blogger.comtag:blogger.com,1999:blog-259885031352434030.post-20505666895461662332010-07-29T19:54:00.008+01:002010-08-01T15:14:10.005+01:00Ubuntu Upgrade - The PlanWell once again it's time to upgrade my Ubuntu install. OK, so I'm a bit late to be upgrading from Karmic to Lucid, but I've been busy!<br /><br />Clearly I don't want to lose all that I've built up over the past year or so on this machine, but I have decided that I want to do a clean install. There are a number of reasons for this, the main one is that I haven't done so yet on this machine, and this Lucid is an LTS. Not that this means that I won't upgrade again in November, but it does provide an extra impetus to do it. The upshot here is that I'm going to need to generate a backup of my settings etc. so that I can restore them in Lucid.<br /><br /><h3>User files</h3>Thankfully my /home directory is in fact another partition, which makes it easier to keep, and provides a nearby backup location for all the other files that I've modified that don't live there.<br /><br /><h3>Installed packages:</h3>Thankfully apt remembers which packages the user installed, and which were installed as dependencies. Thus, after much forum searching, I've come up with the following line to grab all the manually installed packages:<br /><code><br />aptitude search '~i!~E' | grep -v "i A" | cut -d " " -f 4 | sort | uniq > manual<br /></code><br />This searches for all installed (~i) not-Essential (!~E) packaages, removing (-v) those that were installed automatically ("i A"). The descriptions are then removed (cut) and the list sorted and made unique. Since this is quite a big list (and I want to keep it so I can install them back) I threw this into a file.<br /><br />I plan to run the same line in the new install, and then just ignore any packages already there. I'll probably take the opportunity to re-evaluate what I have installed too.<br /><br /><h3>Config files</h3>Modified config files are so easy to overlook. I expect that everyone's modified a config file somewhere, probably the apache config? These are somewhat harder to find unless you know what you've modified. If you've used gedit to modify them then remembering that it makes backup copies of the files it mods by appending a ~ to the name can give a clue. Beyond that I've not found a foolproof way to locate them, If anyone finds one let me know!<br /><h4>Application Data</h4>Also (sort-of) in this category are things such as any LDAP or MYSQL databases that you might have lying around that you may want to keep.<br /><h4>Extra Repos</h4>I forget to have a look at what repos I had added to my defaults, damn. Be sure you don't!Peterhttp://www.blogger.com/profile/18278555310373233830noreply@blogger.comtag:blogger.com,1999:blog-259885031352434030.post-15240423617420108792010-05-11T22:59:00.004+01:002010-05-11T23:10:04.441+01:00Laptop KeyboardsI was about to email <a href="http://www.engadget.com">Engadget</a> with this as an `Ask Engadget` (I have anyway), and figured that this was probably a good place to re-post my gripe.<br /><br />I've been looking for a new laptop for, well, ages and anything that's about the size that I want (13") seems to have a <a href="http://www.notebookreview.com/assets/3415.jpg" title="One of many examples found via Google">stupid keyboard</a> unless I pay > £600. And even them most of them seem to suck.<br /><br />The issue I'm talking about is exemplified by the image from one of their recent <a href="http://www.engadget.com/2010/05/11/samsung-q330-q430-and-q530-slim-laptops-to-invade-britain-in-ju/">posts</a>, where it's clear that more thought has gone into the look of the keyboard (though even there they failed) than the usability. The key issues (pun not intended) is that the keys are in the wrong places. As someone used to the good old style of laptop <a href="http://www.usa-battery.net/images/t30-laptop-keyboard.jpg" title="Imagine the <> key on the left as a backslash">keyboards</a> (that being basically a desktop keyboard slightly shrunk, no numpad, the arrows moved to beneath the return key, the inset/home/etc. 6 being arranged in a column next to the return key) I can't get used to this new craze to put the backslash above a flat return key. This seems the silliest place possible for it. Not only is it out of reach when you want it (as a massive command line user that's a lot of the time) but it's liable to get hit when you swipe for the enter key (probably the most used on the entire board).<br /><br />Hence I'm wondering if there's a good reason that these keys are being moved around, and if there's any way we as a user community (please tell me I'm not the only one with this opinion!?) can let the manufacturers know that they're being silly?<br /><br />In the mean-time if anyone can recommend a good, portable, (hopefully affordable) 13" laptop with a sane keyboard layout I'd much appreciate it. (I'm aware of the <a href="http://www.viewsonic.com/products/vnb131.htm">ViewSonic VNB131</a> and very tempted by it, though even <a href="http://cdn.slashgear.com/wp-content/uploads/2010/03/viewsonic_vnb131_0_slashgear-539x363.jpg">that</a>'s not perfect)Peterhttp://www.blogger.com/profile/18278555310373233830noreply@blogger.comtag:blogger.com,1999:blog-259885031352434030.post-77629075270736952202009-06-22T06:21:00.008+01:002009-06-22T06:37:32.922+01:00Microsoft ClearTypeI had mixed feelings about ClearType on XP - it seemed to be an addon that didn't achieve much. In Vista I didn't realise until recently that it is a default part of the OS and actually without it stuff looks weird. The system fonts seem to go bold, but making them bold/unbold doesn't make much difference.<br /><br />In fact this change is the source of a number of forum posts akin to 'my fonts have gone bold, help!'. I myself spent a long time searching for a solution to this 'problem' - last time it occurred I ended up re creating my user account from scratch! I'm not sure why or how but this time it occurred to me to look up ClearType - I guess I saw it on one of the forums that discusses the issue.<br /><br />I still have no idea what actually causes the change to happen but here's how to undo it:<br /><ol><li>Open the control panel set called Personalization (right click on the desktop > Personalization)</li><li>Click 'Window Color and Appearance' then 'Open classic appearance properties for more color options' which is at the bottom</li><li>In the new dialogue box click 'Effects'</li><li>In the next new dialogue box tick 'Use the following method to smooth edges of screen fonts' and set the drop-down to be 'ClearType'</li><li>Click OK on both dialogue boxes to close them, applying the changes</li></ol>Peterhttp://www.blogger.com/profile/18278555310373233830noreply@blogger.comtag:blogger.com,1999:blog-259885031352434030.post-92085742185921245372009-06-07T16:41:00.003+01:002009-06-07T18:03:41.783+01:00WinXP on netbooksSo Microsoft are <em>again</em> <a href="http://www.bit-tech.net/news/hardware/2009/06/04/microsoft-no-netbooks-with-hybrid-storage/1" title="well pretty much dictating">dictating</a> to hardware manufacturers what they can and cannot use in their products if they want to have Windows XP on them. It doesn't matter if this decision is later reversed, or the story is true or not as it should never have been considered. (this goes for any company, in any market, that tries to restrict others in a similar fashion too).<br /><br />The restrictions on what hardware you can use to run certain products should be purely technical ones. Just imagine if you bought a DVD or Blu-ray player only to find that it didn't work with your TV not because you needed some connector you didn't have but <strong>because it was <em>too big</em></strong>! You'd be furious right?<br /><br />Thankfully this situation will improved when Windows 7 gets released, but even that <acronym title="Operating System">OS</acronym> has restrictions if you use the very lowest end licence version.<br /><br />The other issue here is that these limits do affect people who buy the non-Windows versions as these machines probably have the same hardware as their Windows counterparts, just a different OS installed.Peterhttp://www.blogger.com/profile/18278555310373233830noreply@blogger.comtag:blogger.com,1999:blog-259885031352434030.post-1682449305812916972009-04-29T21:42:00.004+01:002009-04-29T22:16:50.232+01:00Automatically mounting drives in UbuntuI know there's a number of guides out there that show you how to do this, but I always seem to end up combining a number of them to actually get what I want. What I want is the drive to be mounted once I'm logged in (I don't really care when, so long as it's instantly usable).<br /><br />Here's how I do it<br /><ol><br /><li>Use <code>sudo blkid</code> to get info about the drive you want to be mounted.</li><br /><li>Make the folder that it's going to be mounted in. I normally put a folder in <code>/media/</code> which has the same name as the drive. This keeps things simple and won't break any symlinks already in place. You do, however, need to unmount the drive first, and of course to make a new folder in <code>/media</code> you'll need to either be root or use sudo.<br /><br />I usually do this with:<br /><br /><code>sudo mkdir /media/Data</code></li><br /><li>Edit <code>/etc/fstab</code> (you'll need to be sudo) to add the following lines:<br /><code><br />UUID=$DRIVE-ID $FOLDER $TYPE defaults,umask=000 0 0<br /></code><br />This line specifies where to find the drive where to mount it and how. You need to replace $DRIVE-ID with the UUID number for the drive you got from <code>blkid</code>, replace $FOLDER with the full path to the folder you want the drive to be mounted in and $TYPE with the type of filesystem used on the drive, which you can also get from <code>blkid</code>.<br /><br />I usually add a comment line, so I know what's happening, then this becomes:<br /><code><br /># /dev/sda5 - Data<br />UUID=4820-8D15 /media/Data vfat defaults,umask=000 0 0<br /></code></li></ol><br />That's it. Now whenever you start Ubuntu your drive will already be mounted. If you want to mount it now without rebooting then you can tell Ubuntu to mount everything in the fstab now by using:<br /><br /><code>mount -a</code>Peterhttp://www.blogger.com/profile/18278555310373233830noreply@blogger.comtag:blogger.com,1999:blog-259885031352434030.post-63243100396022125812009-04-15T02:37:00.003+01:002009-04-15T02:53:09.458+01:00Opening files via WINE in UbuntuAs a windows user I enjoyed the power of <a href="http://www.flos-freeware.ch/notepad2.html">Notepad2</a> (a lightweight yet powerful notepad replacement), and while the features of gedit are useful they're not what I'm useful. Indeed a number of what I would regard as essential features are in a secondary plugin set that you have to track down in the repos (gedit-plugins), hence I wanted to use Notepad2 in Ubuntu. Thankfully Notepad2 worked immediately under WINE, removing any troubles that I might have incurred there, though I still needed a way to directly open files into the program, preferably via a simple double click.<br /><br />I investigated using a custom wine command, with a number of various symbols after the path to Notepad2, searching for the one that would pass the filename in a manner that it could understand, but without much luck. Google, however, had some answers and I found <a href="http://ubuntuforums.org/showthread.php?p=7073859">this post</a>.<br /><br />The solution is to call a small bash script which then generates a link file within WINE which points to the file you want. This works fine except that the program inside WINE doesn't get to see the original filename (this isn't a problem when saving, but is annoying when using programs that display the filename in the title bar and elsewhere). To resole this I made a couple of changes to the script such that the link file uses the name of the original file, rather than a pre-defined static one, these mods are in my <a href="http://ubuntuforums.org/showthread.php?p=7073859#post7073859">reply</a> to that thread.Peterhttp://www.blogger.com/profile/18278555310373233830noreply@blogger.comtag:blogger.com,1999:blog-259885031352434030.post-82063075400523205502009-03-25T22:35:00.005+00:002009-04-07T13:31:26.638+01:00Using network computer names on a local network in Ubuntu LinuxThis is something that works straight off in Windows, yet I just spent a while struggling with it in Ubuntu.<br /><br />The solution is remarkably simple:<br /><br />If the other computer is running windows and you can't ping it using its NT network name (and you'd like to) then you might need <code>winbind</code>, or to add <code>wins</code> to your <code>/etc/nsswitch.conf</code> file. Here is the <a href="http://www.poromenos.org/node/53">guide</a> I followed.<br /><br />If the other computer is running Ubuntu then you might need to add .local to the computer's name - if the remote computer is called <code>mydesktop</code> then <code>mydesktop.local</code> or <code>mydesktop.home</code> is probably the network name you need, depending on how your router is setup. This is known as <a href="http://en.wikipedia.org/wiki/Zero_configuration_networking">Zero configuration networking</a>.Peterhttp://www.blogger.com/profile/18278555310373233830noreply@blogger.comtag:blogger.com,1999:blog-259885031352434030.post-17343618692916030522009-03-25T20:34:00.010+00:002009-04-27T23:00:42.766+01:00Getting Apache working in Ubuntu LinuxEver since finding I could put stuff, <span style="font-weight: bold;">any</span> stuff, on the Internet, simply by putting it in a certain directory in my university file space and tweaking some permissions, I've been interested in playing with web things (more detail is on my <a href="http://users.ecs.soton.ac.uk/pjcl106/" title="Take a look, External Link">website</a>). More recently I found I needed a local testing server as uploading stuff only to find it didn't work got very tedious. As a windows user I grabbed <a href="http://www.apachefriends.org/en/xampp-windows.html">XAMPP</a>, which is great - you get a nice installer and a small GUI that turns it on and off, but you do get introduced to having to edit config files manually (I used <a href="http://www.flos-freeware.ch/notepad2.html">notepad2</a> for this).<br /><br />Eventually I found I needed to repeat this in <a href="http://www.ubuntu.com/">Ubuntu</a> which, for those who don't know, is a distribution of <a href="http://www.wikipedia.org/wiki/Linux">Linux</a> (you really should give it a go!). However for Linux I found a plethora of guides on how to get apache up and running, but they only answered some of my questions, so I'm having a go partly so I can remember what I found works!<br /><br />To install you'll want to grab the following packages from the repo manager (Synaptic in Ubuntu):<br /><dl><dt>apache2</dt> <dd>This is the main package for the webserver, and the only essential one, dependencies should be taken care of automatically</dd><br /><dt>php5</dt> <dd><a href="http://www.wikipedia.org/wiki/PHP">PHP</a> enable your server to dynamically change the pages that it serves (At the time of writing PHP5 is the most current, but PHP6 is due out soon)</dd><br /><dt>mysql</dt> <dd>MySQL is a database query language and this package enable you to host databases that you can use MySQL to grab data from</dd><br /><dt>phpmyadmin</dt> <dd><a href="http://www.phpmyadmin.net/home_page/index.php">PHPMyAdmin</a> is a tool written in PHP that enables easy MySQL database management</dd><dt><br /></dt><dt>ssh</dt> <dd><a href="http://www.wikipedia.org/wiki/ssh">ssh</a> enables you to remotely login to the host computer from another (<code>ssh user@host</code> from a terminal in linux or I use <a href="http://www.chiark.greenend.org.uk/%7Esgtatham/putty/">PuTTY</a> from windows.</dd></dl><br />Once you have installed apache you should go ahead and set a name for the server (this is partly to get rid of an error message you get when you restart it). You'll need to add <code>ServerName localhost</code> to the apache.conf file. In Ubuntu this is <code>/etc/apache2/apache2.conf</code>, but in other linux distros it can be found elsewhere.<br /><br />The default place for apache to look for files to serve is <code>/var/www/html/</code> though I believe that you can change this by editing the configuration file (however I've never had cause to do so).<br /><br />Some commands you'll probably find useful (these all need to be run as root or sudo):<br /><dl><dt>apache2ctl restart</dt> <dd>Restart the webserver - this needs to be done when you want a configuration change to take effect</dd><br /><dt>a2enmod <em>module</em></dt> <dd>Enable an apache module whose name is <em>module</em></dd><br /><dt>a2dismod <em>module</em></dt> <dd>Disable an apache module whose name is <em>module</em></dd></dl><br />Some modules you might find useful (use a2enmod, above):<br /><dl><dt><a href="http://httpd.apache.org/docs/2.2/mod/mod_userdir.html">UserDir</a></dt> <dd>This module allows users to put stuff in a directory (<em>public_html</em> by default) within their home directory that they want to be served by the server at their user-url (<em>/~username</em> by default). See below for config details.</dd><br /><dt><a href="http://httpd.apache.org/docs/2.2/mod/mod_proxy.html">Proxy</a></dt><dd>Proxy another server, be this another local server or one from the net. See the <a href="http://httpd.apache.org/docs/2.2/mod/mod_proxy.html">apache Proxy documentation</a> for more.</dd></dl><dl><dt><a href="http://httpd.apache.org/docs/2.2/mod/mod_proxy_http.html">Proxy_http</a></dt><dd>This is the module that actually allows http proxying. It depends on the Proxy module.</dd></dl><br />I use the UserDir module as I find it simpler to edit stuff in my home directory rather than navigate to <code>/var/www/html/</code>. I use the Proxy module to aid development of a web application for <a href="http://www.studentrobotics.org/">Student Robotics</a> which is written in python, using turbogears, and so has its own server built in.<br /><br />Configuring the UserDir module:<br />In a httpd.conf file (<code>/etc/apache2/httpd.conf</code> in Ubuntu) you could have the following lines:<br /><code> UserDir disabled<br /> UserDir enabled sam </code><br />Which enables UserDir for the user called sam but no-one else. That is <code>/~sam</code> will serve files in <code>/sam/home/public_html</code> (provided persmissions are set appropriately), but <code>/~anything-else</code> won't work. See the <a href="http://httpd.apache.org/docs/2.2/mod/mod_userdir.html">apache UserDir documentation</a> for more.Peterhttp://www.blogger.com/profile/18278555310373233830noreply@blogger.comtag:blogger.com,1999:blog-259885031352434030.post-71684501674265114142008-12-05T17:55:00.006+00:002008-12-05T18:42:10.386+00:00Ratchet-ScrewdriverToday I found myself in <a href="http://www.chaplaincy.soton.ac.uk/">chaplaincy</a> eating lunch and helping Rhiannon celebrate her birthday, initially this involved eating cake (which I was quite happy to do) before we moved on to playing a wink-murder style game (I think) called Mafia. In this game a small number of people are selected as Mafia characters while a doctor and detective are also selected, the others being villagers, by a narrator and all identities are secret. The game proceeds on a day-night cycle and each night the named characters attempt to do their jobs under the direction of the narrator while everyone is 'asleep' overnight during the day the villagers discuss the death (caused by the Mafia) and decide who to lynch, trying to kill off all the Mafia before the villagers are all killed off. This game fails to work with very few players, as we discovered attempting to play it in a group of seven.<br /><br />After a brief respite we moved on to Ratchet-Screwdriver, a game hitherto only known by its reputation. A detailed explanation of the Quaker version of the game can be found <a href="http://jriddell.org/ratchet-screwdriver.html">here</a> (apologies for breaking the first rule...) whilst <a href="http://www.wikipedia.org/">Wikipedia</a> lists it under the name <a href="http://www.wikipedia.org/wiki/Wink_%28game%29">Wink</a> and it has a number of <a href="http://www.facebook.com/">facebook</a> groups. Basically it involves an odd number of people sitting in pairs in a circle, with one person alone, the front person of the pair tries to reach the lone person (in order to kiss them on the cheek) when called by name or by a general call of 'Ratchet-Screwdriver', the back person tries to prevent this. Of course this results in very energetic, if not very fast moving, mildly intimate wrestling match, amongst evenly matched pairs, while less even pairs may find the weaker player immobilised or the stronger person ends the round very quickly. The person who succeeds to kiss the lone player becomes their partner and any other pairs who were active in that round switch their front-back alignment.<br /><br />We found that seven people was more than sufficient to make this a highly entertaining game, indeed most of the afternoon had passed before we decided to move onto a game that was both less active and less likely to generate carpet burns. The latter point sparked a discussion into the potential perfect surface to play on, we decided that a beach was probably quite good, but that carpet was definitely better than both a smooth lino type surface and a wooden floor. I can well imagine that played on grass (as suggested by the facebook group's picture) the game would result in even less injuries, though for indoors our best solution was jelly. I believe that I have since managed to find a less messy alternative to jelly in the form of Teflon, the surface on non-stick cookware (comments please).<br /><br />The only failing that we found with the Ratchet-Screwdriver was that the pairings eventually became near static, probably due to the small number of people playing and the relative strengths of the players. In this regard I would be interested in trying a variant for small groups suggested by Wikipedia that it calls <a href="http://en.wikipedia.org/wiki/Wink_(game)#Smut.2C_a_Variation_for_Smaller_Groups">Smut</a> (up for a rematch next Friday guys?).Peterhttp://www.blogger.com/profile/18278555310373233830noreply@blogger.comtag:blogger.com,1999:blog-259885031352434030.post-1261326810312808372008-11-28T11:27:00.004+00:002008-11-28T11:42:00.197+00:00TraditionsThis morning I was listening to the radio (the BBC's local radio station, known as Solent) when I heard that the firing of some muskets in a village called Wimborne as part of a practice known as scouring (which is intended to frighten off any spirits in the Christmas Tree as the town decoration lights are turned on) has been banned because 'it might scare the children'. A caller to the station compared scouring to bear bating as a tradition that <span style="font-style: italic;">should</span> be lost as there is little need for such things.<br /><br />Clearly this is a ridiculous standpoint as almost everything that makes Great Britain great is based in its traditions (however silly they might sound, I mean why would a spirit be hiding in the Tree to begin with?).<br /><br />Christmas is not a tradition as such (no more so than my birthday or yours), but it has been joined to some, and had others joined to it, such as the tree - which, if I remember correctly, was brought over from Germany by Prince Albert when he married Queen Victoria.<br /><br />So if we're to get rid of traditions such as the muskets then how many are we going get rid of and what would we actually have left? All because some pansy got scared by some noise?Peterhttp://www.blogger.com/profile/18278555310373233830noreply@blogger.comtag:blogger.com,1999:blog-259885031352434030.post-54931196957850163692008-07-19T12:13:00.015+01:002008-07-19T17:44:23.724+01:00Student RoboticsStudent Robotics (SR) is a project that I have been a part of since I started Uni almost two years ago. It started as a group of electronic engineering students thought that they could replicate the formula that's used by <a href="http://www.usfirst.org/">FIRST</a> but on a slightly smaller scale and with alterations so it would work in the UK.<br /><br />From that basis they recruited other students at the <a href="http://www.southampton.ac.uk/">University of Southampton</a> <a href="http://www.ecs.soton.ac.uk/">Department of Electronics and Computer Science (ECS)</a>, including myself, to help them build some kits that could be handed out to the students invited to the competition, as well as organise the competition. The group grew from a small, now depreciated, facebook group and meetings of a few people to its own <a href="http://www.studentrobotics.org/">website</a> and larger meetings, organised by a dedicated committee in a matter of a little over a term. The committee was formalised just before the Easter break of 2007, and I found myself in the position of Vice President, responsible for overseeing the mechanical side of the project. <a href="http://www.secomputing.co.uk/">Stephen English</a> was elected Chairman, supported by <a href="http://www.xgoat.com/">Robert Spanton</a> as President, Nick Greatbatch as Treasurer and Áron Kisdi as Secretary.<br /><br /><span class="nfakPe">During the summer term the group worked on a suitable competition concept that would allow teams less able to compete easily, but would </span>also allow more able teams to be more creative with their solutions: the teams would build roughly shoebox sized robots which would use a provided vision system to locate brightly painted wooden blocks or 'tokens' and then return them to a home area to score points. This, of course, went through a number of revisions and rule changes before the rules were published. Meanwhile a number of local schools were contacted and invited to be part of the competition, with varying responses and the hardware kits were prepared. Activity necessarily lessened<span class="nfakPe"> due to exam pressures, but picked up again with renewed vigour once they were over and during the summer holidays the electronics kits for the students were further improved such that by September they were almost ready for release.</span> Sponsors were also found in the form of ECS, the <a href="http://sca.susu.org/">SCA</a>, <a href="http://www.susu.org/">SUSU</a> and most notably <a href="http://www.motorola.com/">Motorola</a> via the <a href="http://www.motorola.com/giving">Motorola Foundation</a> and the website prepared for use by the teams and sponsors, on this front we used <a href="http://www.joomla.org/">Joomla</a>, an open source <a href="http://en.wikipedia.org/wiki/Content_management_system">Content Management System</a>, and <a href="http://trac.edgewall.org/">trac</a> for ticketting and <a href="http://en.wikipedia.org/wiki/Wiki">wiki</a>.<br /><br />In September of 2007 the group held a KickStart event for the sixth-form students invited from the local schools which began the first year's competition. This would be a six month planning and building period for the students, far longer than anything else many of them had ever participated in, and six months of mentoring for the university students who made up the SR group. The day consisted of four short talks on Prototyping, Time Management, Programming and Our Kits, given by SR menbers as well as an activity in which the teams made rubber band / balloon powered cars whilst being bombarded with distractions to simultate the competition and the time pressures that would be experienced then.<br /><br />During the Easter term of 2008 a University film crew made up of student on Media and Film courses requested to follow one of the teams progress in the competition and has since made a documentary of the selected team, which happened to win this year's competition.<br /><br />Easter 2008 brought the mentoring / building time to a close with the competition which everyone had been looking forward to. The competition was preceded by a day's crash course in programming for those who needed it provided by the mentors, some of whom, myself included, were learning the python language at the same time. The day also allowed the teams to compare their robots against those of other teams for the first time and for the mentors as a whole to check the viability of the robots.<br /><br />The Competition Day day dawned a mere two days later and too early in the morning to really think about stuff the SR mentors and others met to build the arena and otherwise prepare for a long day in the Cube. After breakfast the teams started arriving with their robots and were each allocated a pit area. In the pit areas were a table with a networked computer on, each running a live CD of <a href="http://www.ubuntu.com/">Ubuntu</a> <a href="http://en.wikipedia.org/wiki/Linux">Linux</a>, which had been set out the previous evening. This enabled them to work on the programming of their robots as the competition went on, allowing for bug fixes and improvements in their code, as well as to the SR code that was downloaded with theirs when they hit save. From the pits each robot would progress to the arena, an 8x8 metre square laid out in white coated hardboard with more hardboard up the sides, where it would (hopefully) drive around in search of tokens. Some of the robots were more successful than others, with some teams merely scoring points using a basic search algorithm, not using the vision system. The day was filmed both by the film crew making a documentary, but also by a crew from the local Daily Echo, who posted a <a href="http://www.dailyecho.co.uk/video/video/index.var.25902.0.0.php">video</a> on their site.<br /><br />The competition was regarded by all as a major success, and as SR plans next year, including various upgrades to the website, which now uses <a href="http://www.drupal.org/">Drupal</a>; hardware and software a new committee has been elected: Áron Kisdi is now Chairman, supported by <a href="http://chriscrossx.blogspot.com/">Chris Cross</a> as President, Dan Mulvaney as Vice President, Jeremy Morse as Treasurer and myself as Secretary. As such the new committee hopes to make next year's competition as good as this years.Peterhttp://www.blogger.com/profile/18278555310373233830noreply@blogger.comtag:blogger.com,1999:blog-259885031352434030.post-69730466488299979822008-07-10T16:28:00.000+01:002008-07-10T16:33:57.653+01:00First PostThis is my first post to this blog.<br />Well that was fun wasn't it.Peterhttp://www.blogger.com/profile/18278555310373233830noreply@blogger.comtag:blogger.com,1999:blog-259885031352434030.post-84516924516447773522006-08-23T11:44:00.000+01:002008-11-28T11:45:28.625+00:00Summer Camp 2006<span id="ctl00_MainContentPlaceholder_ctl01_ctl00_lblEntry">So I got back from Summer Camp yesterday evening, which (thank you for asking) was really great. Being a leader helped, but also the company was superb, as were the multitude of activities that the Scouts and Explorers went on (and so, of course, we were forced unwillingly to go on as well, to look after them).<br />I hope to have the Camp Manual that I promised to produce ready by Christmas, if not sooner. EDIT: that didn't happen.<br /></span>Peterhttp://www.blogger.com/profile/18278555310373233830noreply@blogger.comtag:blogger.com,1999:blog-259885031352434030.post-11657984873721291382006-04-30T11:43:00.001+01:002008-11-28T11:44:07.220+00:00My Confirmation<span id="ctl00_MainContentPlaceholder_ctl01_ctl00_lblEntry"><div>So last sunday I got comfirmed as a Roman Catholic. Don't worry you wont [I half hope] notice any major changes, I am still me.</div> <div>Interesting facts: My confirmation name was Joseph [the adoptive fater of Christ]. There were just under 50 of us confirmed at the 1 and three-quater hour service. The Bishop that confirmed us was Bishop George Stack [yes this was St George's Day..], an assistant bishop in the diocese of Westminster. Thanks are due to Max, who was my sponsor.</div></span>Peterhttp://www.blogger.com/profile/18278555310373233830noreply@blogger.com