<?xml version="1.0"?>
<rss version="2.0">
  <channel>
    <title>Advogato blog for elwell</title>
    <link>http://www.advogato.org/person/elwell/</link>
    <description>Advogato blog for elwell</description>
    <language>en-us</language>
    <generator>mod_virgule</generator>
    <pubDate>Fri, 24 May 2013 09:38:09 GMT</pubDate>
    <item>
      <pubDate>Thu, 16 May 2013 15:15:05 GMT</pubDate>
      <title>Internal Gravatar type service</title>
      <link>http://www.advogato.org/person/elwell/diary.html?start=104</link>
      <guid>http://www.blogger.com/comment.g?blogID=7631594461748448660</guid>
      <description>&lt;p&gt;Since arriving at my new job (excellent ta, thanks for asking) I've once again come across some internal pages that it'd be nice to associate mugshots with (thumbnail is fine) in a service just like &lt;a href="http://gravatar.com/" &gt;gravatar&lt;/a&gt; offer. In fact, exactly like gravatar offer... then it could be used with some minimal URL re-writing and minor code changes in applications&lt;/p&gt;&lt;div&gt;
  &lt;br/&gt;&lt;/div&gt;&lt;div&gt;IMHO when you have a corporate photo-id upon your person, then this should be available on the intranet - it shouldn't be *that* hard to use the same algorithm on a small webserver vhost to select a suitably sized photo (since its corporate, these can be mapped automatically to LDAP or some other identity management service) entries.&lt;/div&gt;&lt;div&gt;
  &lt;br/&gt;&lt;/div&gt;&lt;div&gt;Perhaps I'll have a code, but not next week as we have new toys arriving from our vendor (rhymes with &#xA0;'play') finally :-)&lt;/div&gt;</description>
    </item>
    <item>
      <pubDate>Sat, 9 Feb 2013 08:09:57 GMT</pubDate>
      <title>qlock something clone</title>
      <link>http://www.advogato.org/person/elwell/diary.html?start=103</link>
      <guid>http://www.blogger.com/comment.g?blogID=7631594461748448660</guid>
      <description>&lt;p&gt;Much as I like the design of the&#xA0;&lt;a href="http://www.qlocktwo.com/" &gt;qlock two&lt;/a&gt;, I really can't ever justify the price of buying one. Although there are designs for clones on instructables.com, I'm going to rework the design using addressable RGB strips rather than individual white LEDs - it means there's more work in the woodwork of the casing (to prevent bleeding to adjacent cells) but should provide for nicer coloring - being able to fade in the current time from the background colour (which will be hooked to the house MQTT feed for things like power / temperature etc) Oh, and it'll be NTP synced.&lt;br/&gt;&lt;br/&gt;Not sure what I'll use as the main controller yet - possibly a R-Pi as its a bit more flexible than the standard arduino. Anyway, once I've worked out the pitch, it's time to learn vcarve down at the&#xA0;&lt;a href="http://artifactory.org.au/" &gt;local hackerspace&lt;/a&gt;.&lt;/p&gt;</description>
    </item>
    <item>
      <pubDate>Wed, 5 Dec 2012 14:09:32 GMT</pubDate>
      <title>Virtual hostnames with Debian and dhcp</title>
      <link>http://www.advogato.org/person/elwell/diary.html?start=102</link>
      <guid>http://www.blogger.com/comment.g?blogID=7631594461748448660</guid>
      <description>&lt;p&gt;At $dayjob we have a large number of Linux Virtual Machines runnining on Hyper-V.&lt;br/&gt;&lt;br/&gt;Most of these run Scientific Linux / Scientific Linux CERN, but we have a requirement to run debian hosts too.&lt;br/&gt;&lt;br/&gt;Some observations that may help others:&lt;br/&gt;&lt;br/&gt;Linux Integration Components&lt;br/&gt;Even the latest MS ones (3.4 at last count) don't support debian / ubuntu. Hoever if you're running squeeze (6.0.x) then there's a 3.2 backport kernel available in debian backports that seems to work fine&lt;br/&gt;&lt;br/&gt;Templates / DHCP hostnames&lt;br/&gt;I noticed that our debian template host wasn't setting the hostname (assigned via dhcp) so using the example at&#xA0;http://nullcore.wordpress.com/2011/12/09/setting-the-system-hostname-from-dhcp-in-ubuntu-11-10/ I worked on a similar script that doesn't end up with a trailing period in the FQDN and appends to /etc/hosts if needed&lt;br/&gt;&lt;br/&gt;lo:&amp;lt;pre&amp;gt;&lt;br/&gt;&lt;br/&gt;#!/bin/sh&lt;br/&gt;# Filename: &#xA0; &#xA0; /etc/dhcp/dhclient-exit-hooks.d/hostname&lt;br/&gt;# Purpose: &#xA0; &#xA0; &#xA0;Used by dhclient-script to set the hostname of the system&lt;br/&gt;# &#xA0; &#xA0; &#xA0; &#xA0; &#xA0; &#xA0; &#xA0; to match the DNS information for the host as provided by&lt;br/&gt;# &#xA0; &#xA0; &#xA0; &#xA0; &#xA0; &#xA0; &#xA0; DHCP.&lt;br/&gt;&lt;br/&gt;# Based on http://nullcore.wordpress.com/2011/12/09/setting-the-system-hostname-from-dhcp-in-ubuntu-11-10/&lt;br/&gt;&lt;br/&gt;# Do not update hostname for virtual machine IP assignments&lt;br/&gt;if [ "$interface" != "eth0" ]&lt;br/&gt;then&lt;br/&gt;&#xA0; &#xA0; return&lt;br/&gt;fi&lt;br/&gt;&lt;br/&gt;if [ "$reason" != BOUND ] &amp;amp;&amp;amp; [ "$reason" != RENEW ] \&lt;br/&gt;&#xA0; &#xA0;&amp;amp;&amp;amp; [ "$reason" != REBIND ] &amp;amp;&amp;amp; [ "$reason" != REBOOT ]&lt;br/&gt;then&lt;br/&gt;&#xA0; &#xA0; &#xA0; &#xA0; return&lt;br/&gt;fi&lt;br/&gt;hostname=${new_host_name}.${new_domain_name}&lt;br/&gt;&lt;br/&gt;#echo dhclient-exit-hooks.d/hostname: Dynamic Hostname = $hostname&lt;br/&gt;#echo dhclient-exit-hooks.d/hostname: Dynamic IP address = $new_ip_address&lt;br/&gt;&lt;br/&gt;echo $hostname &amp;gt; /etc/hostname&lt;br/&gt;/etc/init.d/hostname.sh&lt;br/&gt;&lt;br/&gt;# and append to hosts&lt;br/&gt;grep -q $hostname /etc/hosts&lt;br/&gt;if [ $? -eq 1 ] ; then&lt;br/&gt;&#xA0; &#xA0; &#xA0;echo "$new_ip_address&lt;span style="white-space: pre;"&gt; &lt;/span&gt;$hostname $new_host_name" &amp;gt;&amp;gt; /etc/hosts&lt;br/&gt;fi&lt;br/&gt;&lt;/p&gt;&lt;div&gt;&amp;lt;/pre&amp;gt;&lt;/div&gt;&lt;div&gt;
  &lt;img width="1" height="1" src="https://blogger.googleusercontent.com/tracker/7631594461748448660-9430318792661277?l=blog.elwell.org.uk" alt=""/&gt;&lt;/div&gt;</description>
    </item>
    <item>
      <pubDate>Mon, 26 Nov 2012 14:08:26 GMT</pubDate>
      <title>Rant</title>
      <link>http://www.advogato.org/person/elwell/diary.html?start=101</link>
      <guid>http://www.blogger.com/comment.g?blogID=7631594461748448660</guid>
      <description>&lt;br/&gt;[aelwell@pcitgtelwell ~]$ man dvbnet&lt;br/&gt;No manual entry for dvbnet&lt;br/&gt;[aelwell@pcitgtelwell ~]$ dvbnet --help&lt;br/&gt;&lt;br/&gt;DVB Network Interface Manager&lt;br/&gt;Copyright (C) 2003, TV Files S.p.A&lt;br/&gt;&lt;br/&gt;dvbnet: invalid option -- '-'&lt;br/&gt;Segmentation fault (core dumped)&lt;br/&gt;[aelwell@pcitgtelwell ~]$ dvbnet -h&lt;br/&gt;&lt;br/&gt;DVB Network Interface Manager&lt;br/&gt;Copyright (C) 2003, TV Files S.p.A&lt;br/&gt;&lt;br/&gt;Segmentation fault (core dumped)&lt;br/&gt;&lt;div&gt;
  &lt;br/&gt;&lt;/div&gt;&lt;div&gt;
  &lt;br/&gt;&lt;/div&gt;&lt;div&gt;
  &lt;br/&gt;&lt;/div&gt;&lt;div&gt;
  &lt;br/&gt;&lt;/div&gt;&lt;div&gt;that is all.&lt;/div&gt;&lt;div&gt;
  &lt;img width="1" height="1" src="https://blogger.googleusercontent.com/tracker/7631594461748448660-8204446495710505033?l=blog.elwell.org.uk" alt=""/&gt;&lt;/div&gt;</description>
    </item>
    <item>
      <pubDate>Wed, 14 Nov 2012 23:08:38 GMT</pubDate>
      <title>k-net / ipv6 / toastman / tomato USB</title>
      <link>http://www.advogato.org/person/elwell/diary.html?start=100</link>
      <guid>http://www.blogger.com/comment.g?blogID=7631594461748448660</guid>
      <description>&lt;p&gt;I have a reflashed router using the toastman mod - which works really well *but* the ipv6 configuration pages miss out one crucial setting when configuring the native ipv6 stack from k-net here, notably the WAN ipv6 address...&lt;br/&gt;&lt;br/&gt;ssh root@router and&lt;br/&gt;# ip addr add 2A03:4980::XXXX/96 dev vlan2 (IP D'interco)&lt;br/&gt;# ip -6 route add default via &#xA0;2A03:4980::11:0:1 (Gateway)&lt;br/&gt;&lt;br/&gt;and lo, it should now work from clients on lan.&lt;br/&gt;&lt;br/&gt;Blogging so I know where to find the info next time...&lt;/p&gt;&lt;div&gt;
  &lt;img width="1" height="1" src="https://blogger.googleusercontent.com/tracker/7631594461748448660-1813480174137789211?l=blog.elwell.org.uk" alt=""/&gt;&lt;/div&gt;</description>
    </item>
    <item>
      <pubDate>Wed, 7 Nov 2012 16:07:37 GMT</pubDate>
      <title>Alice and Bob go hashing</title>
      <link>http://www.advogato.org/person/elwell/diary.html?start=99</link>
      <guid>http://www.blogger.com/comment.g?blogID=7631594461748448660</guid>
      <description>&lt;p&gt;Alice wants to share some files with Bob over a public medium. Alice's computer is presumed 'secure'&lt;br/&gt;&lt;br/&gt;she can easily generate a nice long 'passprase' by generating a cryptographic hash of the plaintext (say sha256sum) and use this as a key for a symmetrical crypt&lt;br/&gt;&lt;br/&gt;ie&lt;br/&gt;&lt;br/&gt;alice$&amp;gt; echo "hello world" &amp;gt; plaintext # generate sample input file&lt;br/&gt;alice$&amp;gt; sha256sum plaintext #&#xA0;a948904f2f0f479b8f8197694b30184b0d2ed1c1cd2a1ec0fb85d299a192a447&lt;br/&gt;&lt;br/&gt;and then crypt the file&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;alice$&amp;gt; openssl aes-256-cbc -in plaintext -out ciphertext&lt;br/&gt;enter aes-256-cbc encryption password: [SHA256SUM GENERATED ABOVE]&lt;br/&gt;Verifying - enter aes-256-cbc encryption password: [ditto]&lt;br/&gt;alice$&amp;gt; ls -l plaintext ciphertext&lt;br/&gt;-rw-rw-r--. 1 alice alice 32 Nov &#xA0;7 16:01 ciphertext&lt;br/&gt;-rw-rw-r--. 1 alice alice 12 Nov &#xA0;7 16:00 plaintext&lt;br/&gt;&lt;/p&gt;&lt;div&gt;
  &lt;br/&gt;&lt;/div&gt;&lt;div&gt;
  &lt;br/&gt;&lt;/div&gt;&lt;div&gt;Alice can then send the symmetric key to Bob via their normal secure channel (assumed to be working)&lt;/div&gt;&lt;div&gt;and bob can decrypt with&lt;/div&gt;&lt;div&gt;
  &lt;br/&gt;&lt;/div&gt;&lt;div&gt;bob$&amp;gt;&#xA0;openssl aes-256-cbc -d -in ciphertext&#xA0;&lt;/div&gt;&lt;div&gt;
  &lt;div&gt;enter aes-256-cbc decryption password: [SHA SUM]&lt;/div&gt;
  &lt;div&gt;hello world&lt;/div&gt;
&lt;/div&gt;&lt;div&gt;
  &lt;br/&gt;&lt;/div&gt;&lt;div&gt;
  &lt;br/&gt;&lt;/div&gt;&lt;div&gt;So - is using a hash function a Bad Idea?&#xA0;&lt;/div&gt;&lt;div&gt;The method is predictable -- yes but Mallory would need to know the plaintext (in which case, game over) to generate quickly, or would need to bruteforce ($time++)&lt;/div&gt;&lt;div&gt;
  &lt;br/&gt;&lt;/div&gt;&lt;div&gt;
  &lt;br/&gt;&lt;/div&gt;&lt;div&gt;Discussions / comments welcome&lt;/div&gt;&lt;div&gt;
  &lt;br/&gt;&lt;/div&gt;&lt;div&gt;
  &lt;img width="1" height="1" src="https://blogger.googleusercontent.com/tracker/7631594461748448660-1004680406882909726?l=blog.elwell.org.uk" alt=""/&gt;&lt;/div&gt;</description>
    </item>
    <item>
      <pubDate>Sun, 23 Sep 2012 20:11:06 GMT</pubDate>
      <title>Metering Musings</title>
      <link>http://www.advogato.org/person/elwell/diary.html?start=98</link>
      <guid>http://www.blogger.com/comment.g?blogID=7631594461748448660</guid>
      <description>&lt;p&gt;I've been intermittently trying to get our smart metering datafeed out to to a server for better logging, but I don't want to run a 300W PC to tell me my baseload in the house is 300+N W. There are several clamp meter / arduino designs thanks to the folks like &lt;a href="http://openenergymonitor.org/" &gt;OpenEnergyMonitor&lt;/a&gt; and &lt;a href="http://www.nanode.eu/" &gt;Nanode&lt;/a&gt;, but things &lt;i&gt;should&lt;/i&gt;&#xA0;be easier as there's a nice serial out &lt;a href="http://www.erdfdistribution.fr/medias/DTR_Racc_Comptage/ERDF-NOI-CPT_02E.pdf" &gt;already documented&lt;/a&gt; by ERDF (there's also the upcoming '&lt;a href="http://www.erdfdistribution.fr/medias/DTR_Generalites/ERDF-NOI-CPT_44E.pdf" &gt;linky&lt;/a&gt;' interface but we're still on old-school)&lt;br/&gt;&lt;/p&gt;&lt;div&gt;
  &lt;br/&gt;&lt;/div&gt;&lt;div&gt;How much does all this malarkey cost -- off the shelf there are USB opto interfaces, but they're about &#x20AC;50 each (erk) I originally purchased an arduino datalogger shield (&#x20AC;40 + an arduino) hoping to use it with a nanode, but I &#xA0;didn't get ethernet sending working (even after the slight hardware mod) - possibly due to known issues with stash depletion&lt;/div&gt;&lt;div&gt;
  &lt;br/&gt;&lt;/div&gt;&lt;div&gt;So - where do we go (cheaply) from here? a R-Pi gives me cheap hardware with more stable ethernet but I'd have to interface in the opto tty interface (gpio? usb?) as there's no onboard serial. Plan B is to use my bifferboard and use the console interface: small, yep. Low power, yep. Decent ethernet and OS (openwrt) - yes.&lt;/div&gt;&lt;div&gt;
  &lt;br/&gt;&lt;/div&gt;&lt;div&gt;So, time to order some parts and get down to prototyping...&lt;/div&gt;&lt;div&gt;
  &lt;img width="1" height="1" src="https://blogger.googleusercontent.com/tracker/7631594461748448660-8821523579661835747?l=blog.elwell.org.uk" alt=""/&gt;&lt;/div&gt;</description>
    </item>
    <item>
      <pubDate>Wed, 19 Sep 2012 21:07:39 GMT</pubDate>
      <title>Aaaand we're back</title>
      <link>http://www.advogato.org/person/elwell/diary.html?start=97</link>
      <guid>http://www.blogger.com/comment.g?blogID=7631594461748448660</guid>
      <description>&lt;p&gt;Yay. I now have shiny broadband again thanks to &amp;lt;a href="http://www.k-net.fr/"&amp;gt;k-net&amp;lt;/a&amp;gt;. One difference between now and last time is that I also have an ipv6 prefix off them, so my home machines are accessible withoit needing port forwarding. Well, would be if I could get the RA working better on the router.&lt;br/&gt;&lt;br/&gt;I have a linksys E3000, but that doesn't sipport ipv6 by default, so&#xA0;instead&#xA0;I&#xA0;have&#xA0;one of the TomatoUSB variants installed that does. I'd rather not use stateless config, but pre-assign IP addresses in advance so I can keep say kids machienes in a separate subnet. Overall - seems to work faiely well and the 'sam knows' box seems to have noticed too:&lt;br/&gt;&lt;/p&gt;&lt;div style="clear: both; text-align: center;"&gt;
  &lt;a href="http://3.bp.blogspot.com/-GzyC7ZUU_rA/UFouwTZJH_I/AAAAAAAABks/slj3VlWxSZE/s1600/samknows.png" &gt;
    &lt;img border="0" height="320" src="http://3.bp.blogspot.com/-GzyC7ZUU_rA/UFouwTZJH_I/AAAAAAAABks/slj3VlWxSZE/s320/samknows.png" width="278"/&gt;&lt;/a&gt;
&lt;/div&gt;&lt;br/&gt;&lt;div&gt;
  &lt;img width="1" height="1" src="https://blogger.googleusercontent.com/tracker/7631594461748448660-3649417976535931231?l=blog.elwell.org.uk" alt=""/&gt;&lt;/div&gt;</description>
    </item>
    <item>
      <pubDate>Mon, 25 Jun 2012 08:08:00 GMT</pubDate>
      <title>Radio Scrobbling via MQTT</title>
      <link>http://www.advogato.org/person/elwell/diary.html?start=96</link>
      <guid>http://www.blogger.com/comment.g?blogID=7631594461748448660</guid>
      <description>&lt;p&gt;Since I often listen to the most excellent &lt;a href="http://somafm.com/" &gt;Soma FM&lt;/a&gt; during the day (go support them, it's worth it!) I often wish that I could go and stash some similar tunes to listen to when I'm not online. To do this, I sell my soul to CBS and use last.fm to generate similar / listened to by others recommendations.&lt;br/&gt;&lt;br/&gt;Sadly Rhythmnbox doesn't scrobble radio stations (even though the scrobble &lt;a href="http://www.last.fm/api/show/track.scrobble" &gt;API&lt;/a&gt; has a flag for this&lt;br/&gt;&lt;i&gt;track.scrobble(chosenByUser=0) &lt;/i&gt;to indicate that its been chosen by a radio service), despite it updating my 'now listening' status on IM. So, in a geeky overkill solution I decided to &lt;a href="http://xkcd.com/974/" &gt;save time in the long run&lt;/a&gt; and use a pub/sub system with MQTT. Oh, and use some python and twitter along the way...&lt;br/&gt;&lt;br/&gt;The design is that I have an MQTT publisher that uses the tritter streaming api (via &lt;a href="https://github.com/tweepy/tweepy" &gt;tweepy&lt;/a&gt;) and filters for all the somafm twitter streams that Rusty pushes with BigUrl. This gives me near realtime announcements of the start of the track being played (after some trivial split / strip manipulation)&lt;br/&gt;&lt;br/&gt;ie&lt;br/&gt;&lt;br/&gt;justcovers &#xA0; &#xA0; &#xA0; Pat Boone - Enter Sandman &#xA0;(2012-06-25 07:20:30)&lt;br/&gt;digitalis &#xA0; &#xA0; &#xA0; &#xA0;Zephyrs - Stand Round Hold Hands (Ulrich &#xA0;(2012-06-25 07:20:37)&lt;br/&gt;secretagentsoma &#xA0;Eat Static - Love Truncheon &#xA0;(2012-06-25 07:21:02)&lt;br/&gt;beatblender &#xA0; &#xA0; &#xA0;Kerry Chandler (Lazy Dog Ben W - Isis &#xA0;(2012-06-25 07:21:29)&lt;br/&gt;sonicuniverse &#xA0; &#xA0;In The Country - Only The Birds Can See Us &#xA0;(2012-06-25 07:21:29)&lt;br/&gt;&lt;/p&gt;&lt;div&gt;
  &lt;br/&gt;&lt;/div&gt;&lt;div&gt;..which I can then publish to an internal MQTT broker using &lt;a href="http://mosquitto.org/" &gt;mosquitto&lt;/a&gt; python bindings.&lt;/div&gt;&lt;div&gt;
  &lt;br/&gt;&lt;/div&gt;&lt;div&gt;In a separate process I have a subscriber that I can point to the broker and 'subscribe' to the radio station when I'm listening and it &lt;a href="http://www.last.fm/user/Elwell/library/recent" &gt;scrobbles that information to last.fm&lt;/a&gt;.&#xA0;&lt;/div&gt;&lt;div&gt;
  &lt;br/&gt;&lt;/div&gt;&lt;div&gt;All in, an interesting sunday evening work.&#xA0;&lt;/div&gt;&lt;div&gt;
  &lt;img width="1" height="1" src="https://blogger.googleusercontent.com/tracker/7631594461748448660-1609333763083195139?l=blog.elwell.org.uk" alt=""/&gt;&lt;/div&gt;</description>
    </item>
    <item>
      <pubDate>Tue, 22 May 2012 10:15:37 GMT</pubDate>
      <title>Temp / Humidity update</title>
      <link>http://www.advogato.org/person/elwell/diary.html?start=95</link>
      <guid>http://www.blogger.com/comment.g?blogID=7631594461748448660</guid>
      <description>&lt;p&gt;Since &lt;a href="http://blog.elwell.org.uk/2012/05/dht22-arduino.html" &gt;yesterdays&lt;/a&gt; posting, I plugged the FTDI outpur from the nanode into my bifferboard (needed to install kmod-usb-serial-ftdi) and have knocked up a simple python script to read the output and post to pachube^Wcosm&lt;br/&gt;&lt;br/&gt;and lo:&lt;br/&gt;&lt;a href="https://cosm.com/feeds/60594" &gt;https://cosm.com/feeds/60594&lt;/a&gt;&lt;/p&gt;&lt;div&gt;
  &lt;img width="1" height="1" src="https://blogger.googleusercontent.com/tracker/7631594461748448660-4359308555217134035?l=blog.elwell.org.uk" alt=""/&gt;&lt;/div&gt;</description>
    </item>
  </channel>
</rss>
