Digital-Scurf Ramblings Digital-Scurf Ramblings http://blog.digital-scurf.org/ Digital-Scurf Ramblings ikiwiki 2016-02-29T11:19:31Z Kicad hacking - Intra-sheet links and ERC http://blog.digital-scurf.org/posts/intralinks/ Daniel Silverstone 2016-02-29T11:19:31Z 2016-02-29T11:20:00Z <blockquote> <p>This is a bit of an odd posting since it's about something I've done but is also here to help me explain why I did it and thus perhaps encourage some discussion around the topic within the Kicad community...</p> </blockquote> <p>Recently (as you will know if you follow this blog anywhere it is syndicated) I have started playing with <a href="http://kicad-pcb.org/">Kicad</a> for the development of some <a href="https://git.gitano.org.uk/hardware">hardware</a> projects I've had a desire for. In addition, some of you may be aware that I used to work for a hardware/software consultancy called Simtec, and there I got to play for a while with an EDA tool called Mentor Designview. Mentor was an expensive, slow, clunky, old-school EDA tool, but I grew to understand and like the workflow.</p> <p>I spent time looking at <a href="http://www.geda-project.org/">gEDA</a> and <a href="http://www.cadsoftusa.com/">Eagle</a> when I wanted to get back into hardware hacking for my own ends; but neither did I really click with. On the other hand, a mere 10 minutes with <a href="http://kicad-pcb.org/">Kicad</a> and I knew I had found the tool I wanted to work with long-term.</p> <p>I designed the <a href="https://git.gitano.org.uk/hardware/beerometer.git/">beer'o'meter</a> project (a flow meter for the pub we are somehow intimately involved with) and then started on my first personal surface-mount project -- <a href="https://git.gitano.org.uk/hardware/samdac.git/">SamDAC</a> which is a DAC designed to work with our HiFi in our study at home.</p> <p>As I worked on the <a href="https://git.gitano.org.uk/hardware/samdac.git/">SamDAC</a> project, I realised that I was missing a very particular thing from Mentor, something which I had low-level been annoyed by while looking at other EDA tools -- Kicad lacks a mechanism to mark a wire as being linked to somewhere else on the same sheet. Almost all of the EDA tools I've looked at seem to lack this nicety, and honestly I miss it greatly, so I figured it was time to see if I could successfully hack on Kicad.</p> <p>Kicad is written in C++, and it has been <em>mumble mumble</em> years since I last did any C++, either for personal hacking or professionally, so it took a little while for that part of my brain to kick back in enough for me to grok the codebase. Kicad is not a small project, taking around ten minutes to build on my not-inconsiderable computer. And while it beavered away building, I spent time looking around the source code, particularly the schematic editor <code>eeschema</code>.</p> <p>To skip ahead a bit, after a couple of days of hacking around, I had a proof-of-concept for the intra-sheet links which I had been missing from my days with Mentor, and some ERC (electrical rules checking) to go alongside that to help produce schematics without unwanted "sharp corners".</p> <p>In total, I added:</p> <ul> <li>an "intra-sheet link" schematic element, including: <a href="http://blog.digital-scurf.org/./posts/intralinks/tool.png"><img src="http://blog.digital-scurf.org/./posts/intralinks/43x123-tool.png" width="43" height="123" alt="Intra-sheet linking tool" class="img" align="right" /></a> <ul> <li>the schematic element itself</li> <li>loading and saving of the element (which required a bump in schematic file format versioning)</li> <li>UI for adding intra-sheet links to your schematic</li> <li>netlist build support to ensure that the links found their way into the internal netlist content.</li> </ul></li> </ul> <!-- --> <ul> <li>an ERC tickybox "Strict wiring checks" and behind that I hid: <a href="http://blog.digital-scurf.org/./posts/intralinks/ticky.png"><img src="http://blog.digital-scurf.org/./posts/intralinks/105x95-ticky.png" width="105" height="95" alt="Strict wiring checks" class="img" align="right" /></a> <ul> <li>checks for wires with dangling ends (dangles are bad)</li> <li>junctions which have no point in being present (pointless junctions are confusing to readers)</li> <li>checks that intra-sheet links exist in groups of two or more on any given net, since individual links are pointless.</li> </ul></li> </ul> <p>I forked the <a href="https://github.com/KiCad/kicad-source-mirror">Kicad mirror</a> on Github and pushed my own branch with this work to <a href="https://github.com/kinnison/kicad-source-mirror">my Kicad fork</a>.</p> <p>All of this is meant to allow schematic capture engineers to more clearly state their intentions regarding what they are drawing. The intra-sheet link could be thought of like a no-connect element, except instead of saying "this explicitly goes nowhere" we're saying "this explicitly goes somewhere else on this sheet, you can go look for it".</p> <p>Obviously, people who dislike (or simply don't want to use) such intra-sheet link elements can just disable that ERC tickybox and not be bothered by them in the least (well except for the toolbar button and menu item I suppose).</p> <p>Whether <a href="https://github.com/kinnison/kicad-source-mirror/commits/intralinks">this work</a> gets accepted into Kicad, or festers and dies on the vine, it was good fun developing it and I'd like to illustrate how it could help you, and why I wrote it in the first place:</p> <h1 id="acontrivedstory">A contrived story</h1> <blockquote> <p>Note, while this story is meant to be taken seriously, it is somewhat contrived, the examples are likely electrical madness, but please just think about the purpose of the checks etc.</p> </blockquote> <p>To help to illustrate the feature and why it exists, I'd like to tell you a somewhat contrived story about Fred. Fred is a schematic capture engineer and his main job is to review schematics generated by his colleagues. Fred and his colleagues work with Kicad (hurrah) but of late they've been having a few issues with being able to cleanly review schematics.</p> <p>Fred's colleagues are not the neatest of engineers. In particular they tend to be quite lazy when it comes to running busses, which are not (for example) address and data busses, around their designs and they tend to simply have wires which end in mid-space and pick up somewhere else on the sheet. All this is perfectly reasonable of course, and Kicad handles it with aplomb. Sadly it seems quite error prone for Fred's workplace.</p> <p>As an example, Fred's colleague Ben has been designing the power supply for a particular board. As with most power supplies, plenty of capacitors are needed to stabilise the regulators and smooth the output. In the example below, the intent is that all of the capacitors are on the <code>FOO</code> net.</p> <p><a href="http://blog.digital-scurf.org/./posts/intralinks/problem1.png"><img src="http://blog.digital-scurf.org/./posts/intralinks/problem1.png" width="400" height="600" alt="Contrived problem example 1" class="img" /></a></p> <p>Sadly there's a missing junction and/or slightly misplaced label in the upper section which means that C2 and C3 simply don't join to the <code>FOO</code> net. This could easily be missed, but the ERC can't spot it at all since there's more than one thing on each net, so the pins of the capacitors <em>are</em> connected to <em>something</em>.</p> <p>Fred is very sad that this kind of problem can sometimes escape notice by the schematic designer Ben, Fred himself, and the layout engineer, resulting in boards which simply do not work. Fred takes it upon himself to request that the strict wiring checks ERC is made mandatory for all designs, and that the design engineers be required to use intra-sheet link symbols when they have signals which wander off to other parts of the sheet like <code>FOO</code> does in the example. Without any further schematic changes, strict wiring checks enabled gives the following points of ERC concern for Ben to think about:</p> <p><a href="http://blog.digital-scurf.org/./posts/intralinks/problem2.png"><img src="http://blog.digital-scurf.org/./posts/intralinks/problem2.png" width="400" height="600" alt="Contrived problem example 2" class="img" /></a></p> <p>As you can see, the ERC is pointing at the wire ends and the warnings are simply that the wires are dangling and that this is not acceptable. This warning is very like the pin-not-connected warnings which can be silenced with an explicit no-connect schematic element. Ben, being a well behaved and gentle soul, obeys the design edicts from Fred and seeks out the intra-sheet link symbols, clearing off the ERC markers and then adding intra-sheet links to his design:</p> <p><a href="http://blog.digital-scurf.org/./posts/intralinks/problem3.png"><img src="http://blog.digital-scurf.org/./posts/intralinks/problem3.png" width="400" height="600" alt="Contrived problem example 3" class="img" /></a></p> <p>This silences the dangling end ERC check, which is good, however it results in another ERC warning:</p> <p><a href="http://blog.digital-scurf.org/./posts/intralinks/problem4.png"><img src="http://blog.digital-scurf.org/./posts/intralinks/problem4.png" width="400" height="600" alt="Contrived problem example 4" class="img" /></a></p> <p>This time, the warning for Ben to deal with is that the intra-sheet links are pointless. Each exists without a companion to link to because of the net name hiccough in the top section. It takes Ben a moment to realise that the mistake which has been made is that a junction is missing in the top section. He adds the junction and <strong>bingo</strong> the ERC is clean once more:</p> <p><a href="http://blog.digital-scurf.org/./posts/intralinks/problem5.png"><img src="http://blog.digital-scurf.org/./posts/intralinks/problem5.png" width="400" height="600" alt="Contrived problem example 5" class="img" /></a></p> <p>Now, this might not seem like much gain for so much effort, but Ben can now be more confident that the <code>FOO</code> net is properly linked across his design and Fred can know, when he looks at the top part of the design, that Ben intended for the FOO net to go somewhere else on the sheet and he can look for it.</p> <h1 id="whydothisatall">Why do this at all?</h1> <p>Okay, dropping out of our story now, let's discuss why these ERC checks are worthwhile and why the intra-sheet link schematic element is needed.</p> <blockquote> <p>Note: This bit is here to remind me of why I did the work, and to hopefully explain a little more about why I think it's worth adding to Kicad...</p> </blockquote> <p>Designers are (one assumes) human beings. As humans we (and I count myself here too) are prone to mistakes. Sadly mistakes are often subtle and could easily be thought of as deliberate if the right thought processes are not followed carefully when reviewing. Anyone who has ever done code review, proofread a document, or performed any such activity, will be quite familiar with the problems which can be introduced by a syntactically and semantically valid construct which simply turns out to be wrong in the greater context.</p> <p>When drawing designs, I often end up with bits of wire sticking out of schematic sections which are not yet complete. Sadly if I sleep between design sessions, I often lose track of whether such a dangling wire is meant to be attached to more stuff, or is simply left because the net is picked up elsewhere on the sheet. With intra-sheet link elements available, if I had intended the latter, I'd have just dropped such an element on the end of the wire before I stopped for the day.</p> <p>Also, when drawing designs, I sometimes forget to label a wire, especially if it has just passed through a filter or current-limiting resistor or similar. As such, even with intra-sheet link elements to show me when I mean for a net to go bimbling off across the sheet, I can sometimes end up with unnamed nets whose capacitors end up not used for anything useful. This is where the ERC comes in.</p> <p>By having the ERC complain if a wire dangles -- the design engineer won't forget to add links (or check more explicitly if the wire is meant to be attached to something else). By having junctions which don't actually link anything warned about, the engineer can't just slap a junction blob down on the end of a wire to silence that warning, since that doesn't mean anything to a reviewer later down the line. By having the ERC warn if a net has exactly one intra-sheet link attached to it, missing net names and errors such as that shown in my contrived example above can be spotted and corrected.</p> <p>Ultimately this entire piece of work is about ensuring that the <strong>intent</strong> of the design engineer is captured clearly in the schematic. If the design engineer <strong>meant</strong> to leave that wire dangling because it's joining to another bit of wire elsewhere on the sheet, they can put the intra-sheet links in to show this. The associated ERC checks are there purely to ensure that the validation of this intent is not bypassed accidentally, or deliberately, in order to make the use of this more worthwhile and to increase the usefulness of the ERC on designs where signals jump around on sheets where wiring them up directly would just create a mess.</p> The Beer'o'Meter project http://blog.digital-scurf.org/posts/beerometer/ Daniel Silverstone 2016-01-31T17:51:40Z 2016-01-31T17:51:00Z <p>As some of you may know, I have been working on a small hardware project called the Beer'o'Meter whose purpose is to allow us to extend <a href="http://www.yeoldevic.pub/">Ye Olde Vic</a>'s beer board to indicate the approximate fullness of each cask. For some time now, we've been operating an electronic beer board at the Vic which you may see <a href="https://twitter.com/YeOldeVic/status/692395337462452224">tweeted</a> out from time to time. The <a href="https://twitter.com/YeOldeVic/status/690221735912800257">pumpotron</a> has become very popular with the visitors to the pub, especially that it can be <a href="http://www.yeoldevic.pub/en/beer/">viewed online</a> in a basic textual form.</p> <p>Of course, as many of you who visit pubs know only too well. That a beer is "on" is no indication of whether or not you need to get there sharpish to have a pint, or if you can take your time and have a curry first. As a result, some of us have noticed a particular beer on, come to the pub after dinner, and then been very sad that if only we'd come 30 minutes previously, we'd have had a chance at the very beer we were excited about.</p> <p>Combine this kind of sadness with a two week break at Christmas, and I started to develop a Beer'o'Meter to extend the pumpotron with an indication of how much of a given beer had already been served. Recently <a href="https://goo.gl/photos/rWCNdkss2W74Yncx8">my boards came back</a> from <a href="http://www.elecrow.com/">Elecrow</a> along with various bits and bobs, and I have spent some time today building one up for test purposes.</p> <p>As always, it's important to start with some prep work to collect all the necessary components. I like to use cake cases as you may have noticed on the posting yesterday about the <a href="http://blog.digital-scurf.org/./posts/building-an-oscilloscope/">oscilloscope I built</a>.</p> <p><a href="http://blog.digital-scurf.org/./posts/beerometer/prep.jpg"><img src="http://blog.digital-scurf.org/./posts/beerometer/800x572-prep.jpg" width="763" height="572" alt="Component prep for the Beer'o'Meter" class="img" /></a></p> <p>Naturally, after prep comes the various stages of assembly. You start with the lowest-height components, so here's the board after I fitted the ceramic capacitors:</p> <p><a href="http://blog.digital-scurf.org/./posts/beerometer/step-1-ceramics.jpg"><img src="http://blog.digital-scurf.org/./posts/beerometer/800x572-step-1-ceramics.jpg" width="763" height="572" alt="Step 1, ceramic capacitors" class="img" /></a></p> <p>And here's after I fitted the lying-down electrolytic decoupling capacitor for the 3.3 volt line:</p> <p><a href="http://blog.digital-scurf.org/./posts/beerometer/step-2-decoupling-1.jpg"><img src="http://blog.digital-scurf.org/./posts/beerometer/800x572-step-2-decoupling-1.jpg" width="763" height="572" alt="Step 2, capacitors which lie down" class="img" /></a></p> <p>Next I <em>should</em> have fitted the six transitors from the middle cake case, but I discovered that I'd used the wrong pinout for them. Even after weeks of verification by myself <strong>and</strong> others, I'd made a mistake. My good friend <a href="http://www.kyllikki.org/">Vincent Sanders</a> recently <a href="http://vincentsanders.blogspot.co.uk/2016/01/creativity-is-allowing-yourself-to-make.html">posted</a> about how creativity is allowing yourself to make mistakes and here I had made a doozy I hadn't spotted until I tried to assemble the board. Fortunately TO-92 transistors have nice long legs and I have a pair of tweezers and some electrical tape. As such I soon had six transistors doing the river dance:</p> <p><a href="http://blog.digital-scurf.org/./posts/beerometer/riverdance.jpg"><img src="http://blog.digital-scurf.org/./posts/beerometer/800x572-riverdance.jpg" width="763" height="572" alt="Transistors doing the river-dance" class="img" /></a></p> <p>With that done, I noticed that the transistors now stood taller than the pins (previously I had been intending to fit the transistors before the pins) so I had to shuffle things around and fit all my 0.1" pins and sockets next:</p> <p><a href="http://blog.digital-scurf.org/./posts/beerometer/step-3-pins.jpg"><img src="http://blog.digital-scurf.org/./posts/beerometer/800x572-step-3-pins.jpg" width="763" height="572" alt="Step 3, pins and sockets" class="img" /></a></p> <p>Then I could fit my dancing transistors:</p> <p><a href="http://blog.digital-scurf.org/./posts/beerometer/step-4-transistors.jpg"><img src="http://blog.digital-scurf.org/./posts/beerometer/800x572-step-4-transistors.jpg" width="763" height="572" alt="Step 4, transistors" class="img" /></a></p> <p>We're almost finished now, just one more capacitor to provide some input decoupling on the 9v power supply:</p> <p><a href="http://blog.digital-scurf.org/./posts/beerometer/finished.jpg"><img src="http://blog.digital-scurf.org/./posts/beerometer/800x592-finished.jpg" width="791" height="592" alt="Finished -- decoupling fitted" class="img" /></a></p> <p>Of course, it wouldn't be complete without the <a href="https://www.adafruit.com/products/2471">ESP8266Huzzah</a> I acquired from <a href="https://www.adafruit.com/">AdaFruit</a> though I have to say that I'm unlikely to use these again, but rather I might design in the surface-mount version of the module instead.</p> <p><a href="http://blog.digital-scurf.org/./posts/beerometer/fitted.jpg"><img src="http://blog.digital-scurf.org/./posts/beerometer/800x572-fitted.jpg" width="763" height="572" alt="Fitted with the module" class="img" /></a></p> <p>And since this is the very first Beer'o'Meter to be made, I had to go and put a 1 on the serial-number space on the back of the board. I then tried to sign my name in the box, made a hash of it, so scribbled in the gap <img src="http://blog.digital-scurf.org/./smileys/smile.png" alt=":-)" /></p> <p><a href="http://blog.digital-scurf.org/./posts/beerometer/finished-back.jpg"><img src="http://blog.digital-scurf.org/./posts/beerometer/800x572-finished-back.jpg" width="765" height="572" alt="The back of the finished module" class="img" /></a></p> <p>Finally I got to fit all six of my flow meters ready for some testing. I may post again about testing the unit, but for now, here's a big spider of a flow meter for beer:</p> <p><a href="http://blog.digital-scurf.org/./posts/beerometer/spider.jpg"><img src="http://blog.digital-scurf.org/./posts/beerometer/800x572-spider.jpg" width="763" height="572" alt="The Beer'o'Meter spider" class="img" /></a></p> <p>This has been quite a learning experience for me, and I hope in the future to be able to share more of my hardware projects, perhaps from an earlier stage.</p> <p>I have plans for a DAC board, and perhaps some other things.</p> Building an Oscilloscope http://blog.digital-scurf.org/posts/building-an-oscilloscope/ Daniel Silverstone 2016-01-31T17:51:40Z 2016-01-30T18:00:00Z <p>I recently ordered some PCBs from <a href="http://www.elecrow.com/">Elecrow</a> for the Vic's beer-measurement system I've been designing with Rob. While on the site, I noticed that they have a single-channel digital oscilloscope kit based on an STM32. This is a <a href="http://www.jyetech.com/">JYE Tech</a> <a href="http://www.jyetech.com/Products/LcdScope/e138.php">DSO138</a> which arrives as a PCB whose surface-mount stuff has been fitted, along with a whole bunch of pin-through components for you to solder up the scope yourself. There's a non-trivial number of kinds of components, so first you should prep by splitting them all up and double-checking them all.</p> <p><a href="http://blog.digital-scurf.org/./posts/building-an-oscilloscope/prepping-components.jpg"><img src="http://blog.digital-scurf.org/./posts/building-an-oscilloscope/800x592-prepping-components.jpg" width="789" height="592" alt="Preparing the components" class="img" /></a></p> <p>Once you've done that, the instructions start you off fitting a whole bunch of resistors...</p> <p><a href="http://blog.digital-scurf.org/./posts/building-an-oscilloscope/step-1-resistors.jpg"><img src="http://blog.digital-scurf.org/./posts/building-an-oscilloscope/800x592-step-1-resistors.jpg" width="789" height="592" alt="Step 1, fitting resistors" class="img" /></a></p> <p>Then some diodes, RF chokes, and the 8MHz crystal for the STM32.</p> <p><a href="http://blog.digital-scurf.org/./posts/building-an-oscilloscope/step-2-diodes-and-chokes.jpg"><img src="http://blog.digital-scurf.org/./posts/building-an-oscilloscope/800x592-step-2-diodes-and-chokes.jpg" width="789" height="592" alt="Step 2, fitting diodes, a crystal, and chokes" class="img" /></a></p> <p>The single most-difficult bit for me to solder was the USB socket. Fine pitch leads, coupled with high-thermal-density socket.</p> <p><a href="http://blog.digital-scurf.org/./posts/building-an-oscilloscope/step-3-usb-socket.jpg"><img src="http://blog.digital-scurf.org/./posts/building-an-oscilloscope/800x592-step-3-usb-socket.jpg" width="789" height="592" alt="Step 3, the USB socket" class="img" /></a></p> <p>There is a veritable mountain of ceramic capacitors to fit...</p> <p><a href="http://blog.digital-scurf.org/./posts/building-an-oscilloscope/step-4-ceramic-capacitors.jpg"><img src="http://blog.digital-scurf.org/./posts/building-an-oscilloscope/800x592-step-4-ceramic-capacitors.jpg" width="789" height="592" alt="Step 4, all the ceramic capacitors" class="img" /></a></p> <p>And then buttons, inductors, trimming capacitors and much more...</p> <p><a href="http://blog.digital-scurf.org/./posts/building-an-oscilloscope/step-5-buttons-etc.jpg"><img src="http://blog.digital-scurf.org/./posts/building-an-oscilloscope/800x592-step-5-buttons-etc.jpg" width="789" height="592" alt="Step 5, buttons, inductors, trimming capacitors, etc" class="img" /></a></p> <p>THe switches were the next hardest things to solder, after the USB socket...</p> <p><a href="http://blog.digital-scurf.org/./posts/building-an-oscilloscope/step-6-switches-connectors.jpg"><img src="http://blog.digital-scurf.org/./posts/building-an-oscilloscope/800x592-step-6-switches-connectors.jpg" width="789" height="592" alt="Step 6, Switches, connectors, etc" class="img" /></a></p> <p>Finally you have to solder a test loop and close some jumpers before you power-test the board.</p> <p><a href="http://blog.digital-scurf.org/./posts/building-an-oscilloscope/step-7-test-loop-and-jumpers.jpg"><img src="http://blog.digital-scurf.org/./posts/building-an-oscilloscope/800x592-step-7-test-loop-and-jumpers.jpg" width="789" height="592" alt="Step 7, Test loop and jumper soldering" class="img" /></a></p> <p>The last bit of soldering is to solder pins to the LCD panel board...</p> <p><a href="http://blog.digital-scurf.org/./posts/building-an-oscilloscope/step-8-lcd-panel.jpg"><img src="http://blog.digital-scurf.org/./posts/building-an-oscilloscope/800x592-step-8-lcd-panel.jpg" width="789" height="592" alt="Step 8, LCD panel" class="img" /></a></p> <p>Before you finally have a working oscilloscope</p> <p><a href="http://blog.digital-scurf.org/./posts/building-an-oscilloscope/working-scope.jpg"><img src="http://blog.digital-scurf.org/./posts/building-an-oscilloscope/800x592-working-scope.jpg" width="791" height="592" alt="Working oscilloscope!" class="img" /></a></p> <p>I followed the included instructions to trim the scope using the test point and the trimming capacitors, before having a break to write this up for you all. I'd say that it was a fun day because I enjoyed getting a lot of soldering practice (before I have to solder up the beer'o'meter for the pub) and at the end of it I got a working oscilloscope. For 40 USD, I'd recommend this to anyone who fancies a go.</p> A haiku about Haiku http://blog.digital-scurf.org/posts/haiku-haiku/ Daniel Silverstone 2015-11-01T14:59:32Z 2015-11-01T15:00:00Z <p>I know I don't mention a season, and I'm a few hours late for hallowe'en, but here's a haiku about Haiku:</p> <blockquote> <p>A death, once again, <br> The master sighs, and fixes, <br> It rises up, undead.</p> </blockquote> Orchestration, a cry for help http://blog.digital-scurf.org/posts/orchestration-cry-for-help/ Daniel Silverstone 2015-09-08T15:02:12Z 2015-09-08T16:00:00Z <p>Over the past few years, a plethora of <a href="http://en.wikipedia.org/wiki/Orchestration_%28computing%29">orchestration framework</a>s have been exploding onto the scene. Many have been around for quite a while but not all have the same sort of community behind them. For example there's a very interesting option in <a href="https://joeyh.name/">Joey Hess</a>' <a href="https://github.com/joeyh/propellor">Propellor</a> but that is hurt by needing to be able to build Propellor on all the hosts you manage. On the other hand, <a href="https://github.com/ansible/ansible">Ansible</a> is able to operate without installing extra software on your target hosts, but instead it ends up very latency-bound which can cause problems when your managed hosts are "far away".</p> <p>I have considered <a href="http://cfengine.com/community/">CFEngine</a>, <a href="https://www.chef.io/chef/">Chef</a>, <a href="https://github.com/puppetlabs">Puppet</a> and <a href="http://saltstack.com/">Salt</a> in addition to the above mentioned options, but none of them feel quite right to me. I am looking for a way to manage a small number of hosts, at least one of which is not always online (my laptop) and all of which are essentially snowflakes whose sparkleybits I want some reasonable control over.</p> <p>I have a few basic requirements which I worry would be hard to meet -- I want to be able to make changes to my hosts by editing a file and committing/pushing it to a git server. I want to be able to manage a host entirely over <a href="http://www.openssh.org/">SSH</a> from one or more systems, ideally without having to install the orchestration software on the target host, but where if the software is present it will get used to accelerate matters. I don't want to have to install <a href="http://www.ruby-lang.org/">Ruby</a> or <a href="http://php.net/">PHP</a> on any system in order to have orchestration, and some of the systems I wish to manage simply can't compile <a href="http://www.haskell.org/">Haskell</a> stuff sanely. I'm not desperately interested in learning yet more <a href="http://en.wikipedia.org/wiki/Domain-specific_language">DSL</a>s, but I appreciate that it will be necessary, but I really don't want to have to learn more than one <a href="http://en.wikipedia.org/wiki/Domain-specific_language">DSL</a> simply to run one frameworks.</p> <p>I don't want to have to learn strange and confusing combinations of file formats. For example, <a href="https://github.com/ansible/ansible">Ansible</a> quite sensibly uses <a href="http://www.yaml.org/">YAML</a> for its structured data <em>except</em> for its host/group lists. It uses <a href="http://jinja.pocoo.org/">Jinja2</a> for its templating and looping, <em>except</em> for some things which it generates its own looping constructs inside its <a href="http://www.yaml.org/">YAML</a>. I also personally find Ansible's <a href="http://imgur.com/gUgkpTx">sportsball</a> oriented terminology to be confusing, but that might just be me.</p> <p>So what I'm hoping is that someone will be able to point me at a project which combines all the wonderful features of the above, with a need to learn only one DSL and which doesn't <em>require</em> to be installed on the managed host but which can <em>benefit</em> from being so installed, is driven from git, and won't hurt my already overly burdened brain.</p> <p>Dear Lazyweb, pls. kthxbye.</p> Be careful what you ask for http://blog.digital-scurf.org/posts/be-careful-what-you-ask-for/ Daniel Silverstone 2015-07-01T13:28:35Z 2015-07-01T13:30:00Z <pre><code>Date: Wed, 01 Jul 2015 06:13:16 -0000 From: 123-reg &lt;[email protected]&gt; To: [email protected] Subject: Tell us what you think for your chance to win X-Mailer: MIME::Lite 3.027 (F2.74; T1.28; A2.04; B3.13; Q3.13) Tell us what you think of 123-reg! &lt;!-- .style1 {color: #1996d8} --&gt; </code></pre> <p>Well <a href="http://www.123-reg.co.uk/">123-reg</a> mostly I think you don't know how to do email.</p> In defence of curl | sudo bash - http://blog.digital-scurf.org/posts/in-defence-of-curl-pipe-sudo-bash/ Daniel Silverstone 2015-06-11T12:32:41Z 2015-06-10T21:25:00Z <p>Long ago, in days of yore, we assumed that any software worth having would be packaged by the operating system we used. Debian with its enormous pile of software (over 20,000 sources last time I looked) looked to basically contain every piece of free software ever. However as more and more people have come to Linux-based and BSD-based systems, and the proliferation of *NIX-based systems has become even more diverse, it has become harder and harder to ensure that everyone has access to all of the software they might choose to use.</p> <p>Couple that with the rapid development of new projects, who clearly want to get users involved well before the next release cycle of a Linux-based distribution such as Debian, and you end up with this recommendation to bypass the operating system's packaging system and simply <code>curl | sudo bash -</code>.</p> <p>We, the OS-development literati, have come out in droves to say "<em>eww, nasty, don't do that please</em>" and yet we have brought this upon ourselves. Our tendency to invent, and reinvent, at the very basic levels of distributions has resulted in so many operating systems and so many ways to package software (if not in underlying package format then in policy and process) that third party application authors simply cannot keep up. Couple that with the desire of the consumers to not have their chosen platform discounted, and if you provide Debian packages, you end up needing to provide for Fedora, RHEL, SuSE, SLES, CentOS, Mint, Gentoo, Arch, etc.etc; let alone supporting all the various BSDs. This leads to the simple expedience of <code>curl | sudo bash -</code>.</p> <p>Nobody, not even those who are <strong>most vehemently</strong> against this mechanism of installing software, can claim that it is not quick, simple for users, easy to copy/paste out of a web-page, and leaves all the icky complexity of sorting things out up to a script which the computer can run, rather than the nascent user of the software in question. As a result, many varieties of software have ended up using this as a <em>simple</em> installation mechanism, from games to orchestration frameworks - everyone can acknowledge how easy it is to use.</p> <p>Now, some providers are wising up a little and ensuring that the url you are <code>curl</code>ing is at least an <code>https://</code> one. Some even omit the <code>sudo</code> from the copy/paste space and have it in the script, allowing them to display some basic information and prompting the user that this will occur as <em>root</em> before going ahead and elevating. All of these myriad little tweaks to the fundamental idea improve matters but are ultimately just putting lipstick on a fairly sad looking pig.</p> <p>So, what can be done? Well we (again the OS-development literati) got ourselves into this horrendous mess, so it's up to us to get ourselves back out. We're all too entrenched in our chosen packaging methodologies, processes, and policies, to back out of those; yet we're clearly not properly servicing a non-trivial segment of our userbase. We <strong>need</strong> to do better. Not everyone who currently honours a <code>curl | sudo bash -</code> is capable of understanding why it's such a <em>bad idea</em> to do so. Some education may reduce that number but it will <strong>never</strong> eliminate it.</p> <p>For a long time I advocated a switch to <code>wget &amp;&amp; review &amp;&amp; sudo ./script</code> approach instead, but the above comment, about people who don't understand why it might be a bad idea, <em>really</em> applies to show how few of those users would even be capable of starting to review a script they downloaded, let alone able to usefully judge for themselves if it is really safe to run. Instead we need something better, something collaborative, something capable of solving the accessibility issues which led to the <code>curl | sudo bash -</code> revolt in the first place.</p> <hr /> <p>I don't pretend to know what that solution might be, and I don't pretend to think I might be the one to come up with it, but I can hilight a few things I think we'll need to solve to get there:</p> <ol> <li>Any solution to this problem must be as easy as <code>curl | sudo bash -</code> or easier. This might mean a particular URI format which can have os-specific ways to handle standardised inputs, or it might mean a pervasive tool which does something like that.</li> <li>Any solution must do its best to securely acquire the content the user actually <em>wanted</em>. This means things like validating SSL certificates, presenting information to the user which a <strong>layman</strong> stands a chance of evaluating to decide if the content is likely to be what they <em>wanted</em>, and then acting smoothly and cleanly to get that content onto the user's system.</li> <li>Any solution should not introduce complex file formats or reliance on any particular implementation of a tool. Ideally it would be as easy to implement the solution on FreeBSD in shell, or on Ubuntu as whizzy 3D GUIs written in Haskell. (<em>modulo the pain of working in shell of course</em>)</li> <li>The solution must be arrived at in a multi-partisan way. For such a mechanism to be as usefully pervasive as <code>curl | sudo bash -</code> as many platforms as possible need to get involved. This means not only Debian, Ubuntu, Fedora and SuSE; but also Arch, FreeBSD, NetBSD, CentOS etc. Maybe even the OpenSolaris/Illumos people need to get involved.</li> </ol> <p>Given the above, no solution can be "just get all the apps developers to learn how to package software for all the OS distributions they want their app to run on" since that way madness lies.</p> <p>I'm sure there are other minor, and major, requirements on any useful solution but the simple fact of the matter is that until and unless we have something which at <em>least</em> meets the above, we will never be rid of <code>curl | sudo bash -</code> :- just like we can never seem to be rid of that one odd person at the party, noone knows who invited them, and noone wants to tell them to leave because they do fill a needed role, but noone really seems to like.</p> <p>Until then, let's suck it up and while we might not like it, let's just let people keep on <code>curl | sudo bash -</code>ing until someone gets hurt.</p> <hr /> <p><em>P.S. I <strong>hate</strong> <code>curl | sudo bash -</code> for the record.</em></p> Sometimes recruiters really miss the point... http://blog.digital-scurf.org/posts/recruiter-missing-the-point/ Daniel Silverstone 2015-06-09T15:11:23Z 2015-06-09T14:00:00Z <p>I get quite a bit of recruitment spam, especially via my <a href="https://www.linkedin.com/profile/view?id=676810">LinkedIn profile</a>, but today's Twitter-madness (recruiter scraped my twitter and then contacted me) really took the biscuit. I include my response (stripped of identifying marks) for your amusement:</p> <pre><code>On Tue, Jun 09, 2015 at 10:30:35 +0000, Silly Recruiter wrote: &gt; I have come across your profile on various social media platforms today and &gt; after looking through them I feel you are a good fit for a permanent Java &gt; Developer Role I have available. Given that you followed me on Twitter I'm assuming you found a tweet or two in which I mention how much I hate Java? &gt; I can see you are currently working at Codethink and was wondering if you &gt; were considering a change of role? I am not. &gt; The role on offer is working as a Java Developer for a company based in &gt; Manchester. You will be maintaining and enhancing the company's core websites &gt; whilst using the technologies Java, JavaScript, JSP, Struts, Hibernate XML &gt; and Grails. This sounds like one of my worst nightmares. &gt; Are you interested in hearing more about the role? Please feel free to call &gt; or email me to discuss it further. Thanks, but no. &gt; If not, do you know someone that is interested? We offer a £500 referral fee &gt; for any candidate that is successful. I wouldn't inflict that kind of Lovecraftian nightmare of a software stack on anyone I cared about, sorry. D. </code></pre> <p>I then decided to take a look back over my <a href="https://twitter.com/dsilverstone/">Twitter</a> and see if I could find what might have tripped this. There's some discussion of Minecraft modding but nothing which would suggest JavaScript, JSP, Struts, Hibernate XML or Grails.</p> <p>Indeed my <a href="https://twitter.com/dsilverstone/status/606407312102670336">most recent tweet</a> regarding Java could hardly be construed as positive towards it.</p> <p>Sigh.</p> Kimchi Trial 1 - Part 3 - Kimchiguk http://blog.digital-scurf.org/posts/kimchi-trial-1-part-3/ Daniel Silverstone 2015-05-09T20:18:06Z 2015-05-09T19:45:00Z <p>Earlier this week I allowed some of my colleagues at work to try the Kimchi and one of them (James) liked it enough to ask for a tub of it just for himself. Being a lovely person I obliged.</p> <p>My darling Rob decided that what he really wanted was Kimchiguk or Kimchijijae. Being both wonderful and lacking in ingredients, I set to do achieving something.</p> <p>I read a few recipes, worked out that I lacked critical ingredients and so set about simulating Kimchiguk. I grabbed two and a bit cupfuls of kimchi from the box in the fridge, chopped it up more finely, popped it into a pot along with about a pound of cubed pork belly, two teaspoons of hot pepper flakes, two teaspoons of sugar, and two teaspoons of cornflour. I then topped that off with five cups of water, mixed it up, brought it to the boil and simmered it for 30 minutes. Then I cubed some tofu, popped that in and simmered it for another 10 minutes while some rice cooked. Served in a bowl over rice, my approximation of Kimchiguk turned out pretty well. (Note it fed both of us and there was a serving left over.)</p> <p><a href="http://blog.digital-scurf.org/./posts/kimchi-trial-1-part-3/kimchiguk.jpg"><img src="http://blog.digital-scurf.org/./posts/kimchi-trial-1-part-3/800x416-kimchiguk.jpg" width="800" height="416" alt="Kimchiguk - Kimchi soup" class="img" /></a></p> <p>With a do-over, I'd try harder to get pork shoulder (belly is quite fatty) and given the option I'd wait until I had hot pepper paste because the malty fermented sweetness of hot pepper paste is pretty much impossible to emulate otherwise.</p> Kimchi Trial 1 - Part 2 http://blog.digital-scurf.org/posts/kimchi-trial-1-part-2/ Daniel Silverstone 2015-05-09T20:18:06Z 2015-05-05T09:00:00Z <p>Last night we tried the small amount of 'fresh kimchi' from my <a href="http://blog.digital-scurf.org/./posts/kimchi-trial-1-part-1/">epic kimchi making trial</a>.</p> <p>I marinaded some beef strips in a blended paste of onion, garlic, ginger, and sesame oil for a few hours before frying that up, and serving on rice with stir-fried carrots, leek and spring onion. A little fresh kimchi on the side for flavour.</p> <p><a href="http://blog.digital-scurf.org/./posts/kimchi-trial-1-part-2/dinner.jpg"><img src="http://blog.digital-scurf.org/./posts/kimchi-trial-1-part-2/800x600-dinner.jpg" width="800" height="592" alt="Delicious dinner" class="img" /></a></p> <p>I think the Kimchi was a success. Dearest <a href="http://www.rjek.com/">Rob</a> said that it tasted of Kimchi. The flavours were not very well combined and quite clearly underdeveloped, and the pepper flakes were still a little hard. I expect this to resolve over the next few days as it begins to ferment.</p> <p>All in all, experiment going well, expect part 3 when I know how it tastes after fermentation begins.</p>