<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
    <title>mitsake</title>
    <subtitle>a personal site</subtitle>
    <link rel="self" type="application/atom+xml" href="https://www.mitsake.net/atom.xml"/>
    <link rel="alternate" type="text/html" href="https://www.mitsake.net/"/>
    <generator uri="https://www.getzola.org/">Zola</generator>
    <updated>2025-07-05T00:00:00+00:00</updated>
    <id>https://www.mitsake.net/atom.xml</id>
    <entry xml:lang="en">
        <title>Some things I&#x27;ve made</title>
        <published>2025-07-05T00:00:00+00:00</published>
        <updated>2025-07-05T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Zak
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://www.mitsake.net/posts/some-things-ive-made/"/>
        <id>https://www.mitsake.net/posts/some-things-ive-made/</id>
        <content type="html" xml:base="https://www.mitsake.net/posts/some-things-ive-made/">&lt;p&gt;I haven&#x27;t posted anything for a long time now, so here&#x27;s some things I&#x27;ve made over the past five years or so in no particular order.&lt;&#x2F;p&gt;
&lt;span id=&quot;continue-reading&quot;&gt;&lt;&#x2F;span&gt;&lt;h2 id=&quot;rng-pcb-a-circuitpython-random-number-generator&quot;&gt;rng-pcb: A CircuitPython Random Number Generator&lt;&#x2F;h2&gt;
&lt;p&gt;This was built as part of the &lt;a href=&quot;https:&#x2F;&#x2F;boldport.com&#x2F;club&quot;&gt;Boldport Club&#x27;s&lt;&#x2F;a&gt; community PCB swap, which was a really fun project to be part of. I based this board on the &lt;a href=&quot;https:&#x2F;&#x2F;www.adafruit.com&#x2F;product&#x2F;3500&quot;&gt;Adafruit Trinket M0&lt;&#x2F;a&gt;, using a 12 V charge pump to power an avalanche noise generator. It uses a stack of circuit boards as an enclosure, and has two capacitive touch buttons in the front top corners. The firmware is pretty basic, but I think it&#x27;s quite cool to 4096 bits of (probably) true randomness appear on the screen. It was also the first project that I &lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;mitsake&#x2F;rng-pcb&quot;&gt;documented on GitHub&lt;&#x2F;a&gt;, and most people managed to put it together despite me using tiny SOT-523 (1.6 × 1.6 mm including leads) transistors instead of the planned SOT-23 (~ 2.9 × 2.4 mm) ones.&lt;&#x2F;p&gt;
&lt;figure&gt;
&lt;img src=&quot;&#x2F;images&#x2F;some-things&#x2F;rng-pcb.jpg&quot;
     alt=&quot;A circuit board with an 128 × 32 OLED screen mounted in the centre. The screen shows a random pattern of lit and unlit pixels.&quot;
     width=&quot;600&quot;
     height=&quot;290&quot;
     class=&quot;centre&quot;&#x2F;&gt;
&lt;&#x2F;figure&gt;
&lt;h2 id=&quot;kbx-s-nixie-clock&quot;&gt;kbx&#x27;s Nixie Clock&lt;&#x2F;h2&gt;
&lt;p&gt;Another project from the PCB swap, this is probably the largest electronics&#x2F;soldering project I&#x27;ve built. kbx &lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;kbx81&#x2F;TubeClock&quot;&gt;published&lt;&#x2F;a&gt; display boards for most of the commonly-available types of nixie tubes and I went with IN-14 (ИН-14) tubes since they were a good balance of size and cost. Despite a few issues with hand soldering so many surface-mount components, it&#x27;s been powered up and keeping time for seven years now.&lt;&#x2F;p&gt;
&lt;figure&gt;
&lt;img src=&quot;&#x2F;images&#x2F;some-things&#x2F;tubeclock.jpg&quot;
     alt=&quot;A working nixie tube clock on a messy desk&quot;
     width=&quot;600&quot;
     height=&quot;450&quot;
     class=&quot;centre&quot;&#x2F;&gt;
&lt;&#x2F;figure&gt;
&lt;h2 id=&quot;a-breakout-for-the-samd21e-chip&quot;&gt;A breakout for the SAMD21E chip&lt;&#x2F;h2&gt;
&lt;p&gt;I had some of these chips left over from the rng-pcb project and made &lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;mitsake&#x2F;samd21e-breakout&quot;&gt;this&lt;&#x2F;a&gt; to practice reading datasheets and PCB design. My original intent was for this to run a low-impedance crystal without load capacitors as the datasheet describes, but I couldn&#x27;t seem to get this to work; my suspicion is that it&#x27;s to do with the automatic gain control function not being available which I later read about in the errata.&lt;&#x2F;p&gt;
&lt;p&gt;The first boards were made by &lt;a href=&quot;https:&#x2F;&#x2F;oshpark.com&quot;&gt;OSH Park&lt;&#x2F;a&gt; - as always, they were great, but I then received a US$50 voucher from &lt;a href=&quot;https:&#x2F;&#x2F;www.seeedstudio.com&#x2F;fusion_pcb.html&quot;&gt;Seeed Studio&lt;&#x2F;a&gt; to try their Fusion PCB service. They produced the revised board - the only change was to add footprints for load capacitors - and everything seemed to work fine.&lt;&#x2F;p&gt;
&lt;figure&gt;
&lt;img src=&quot;&#x2F;images&#x2F;some-things&#x2F;samd-breakout.jpg&quot;
     alt=&quot;Two circuit boards lying side by side. The left-hand board is face up, showing two rows of through-hole pads and some components such as ICs and capacitors. The right-hand board is face-down with silkscreen text reading &#x27;Breakout for ATSAMD21Exx-A &#x2F; Max 3.3 V supply: 600 mA &#x2F; Input voltage (VUSB pin): 3.7 - 6.0 V&#x27;&quot;
     width=&quot;600&quot;
     height=&quot;220&quot;
     class=&quot;centre&quot;&#x2F;&gt;
&lt;&#x2F;figure&gt;
&lt;h2 id=&quot;sick-60-a-3d-printed-keyboard&quot;&gt;SiCK-60 - a 3D-printed keyboard&lt;&#x2F;h2&gt;
&lt;figure&gt;
&lt;img src=&quot;&#x2F;images&#x2F;some-things&#x2F;sick-60-front.jpg&quot;
     alt=&quot;A small 60% keyboard. It has a black 3D printed case and the keycaps are dark blue, light blue and white in a gradientfrom left-to-right.&quot;
     width=&quot;600&quot;
     height=&quot;252&quot;
     class=&quot;centre&quot;&#x2F;&gt;
&lt;&#x2F;figure&gt;
&lt;p&gt;I got hold of some Cherry MX compatible blue (clicky) switches as part of the Boldport &#x27;travelling box&#x27; community project. As I did&#x27;t have a lot of desk space, &lt;a href=&quot;https:&#x2F;&#x2F;twitter.com&#x2F;FedorSosnin&quot;&gt;Fedor Sosnin&#x27;s&lt;&#x2F;a&gt; &lt;a href=&quot;https:&#x2F;&#x2F;www.thingiverse.com&#x2F;thing:3671408&quot;&gt;SiCK-60&lt;&#x2F;a&gt; keyboard seemed like a good fit. I hand wired it using the procedure outlined by &lt;a href=&quot;https:&#x2F;&#x2F;geekhack.org&#x2F;index.php?topic=87689.0&quot;&gt;cribbet on the GeekHack forums&lt;&#x2F;a&gt; which worked well, though I&#x27;d definitely use solder-through enamelled wire if I were doing another build. Stripping the wire was by far the most tedious bit of the build.&lt;&#x2F;p&gt;
&lt;figure&gt;
&lt;img src=&quot;&#x2F;images&#x2F;some-things&#x2F;sick-60-wiring.jpg&quot;
     alt=&quot;The underside of a keyboard. The columns and rows of wires that connect the keyswitches are visible, as are the diodes&quot;
     width=&quot;600&quot;
     height=&quot;261&quot;
     class=&quot;centre&quot;&#x2F;&gt;
&lt;&#x2F;figure&gt;
&lt;p&gt;The controller is a &lt;a href=&quot;https:&#x2F;&#x2F;shop.pimoroni.com&#x2F;products&#x2F;pga2040&quot;&gt;Pimoroni PGA 2040&lt;&#x2F;a&gt; wired to a micro-USB breakout. To allow firmware updates I drilled a hole and mounted a tactile switch in the bottom soldered between the PGA2040&#x27;s BOOT pin and GND. Since I was using &lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;KMKfw&#x2F;kmk_firmware&quot;&gt;KMK firmware&lt;&#x2F;a&gt;, setup was pretty easy, though writing a valid keymap took a few rounds of trial and error.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;matariki-a-soldering-kit&quot;&gt;Matariki - a soldering kit&lt;&#x2F;h2&gt;
&lt;p&gt;This circuit board was designed for my then-job as a first electronics project for people who wanted to learn to solder. Advice from Māori colleagues helped to get the star positions and names correct and the project ended up being really popular with people of all ages. I was particularly happy when someone who&#x27;d built a kit with their child came back the next week to repair an electric guitar that had a loose connection on the jack. I&#x27;m currently planning a revision to change the coin cell over to 2 × AAA batteries. The version below was put together by my colleague (as one of their first soldering projects!) and you can watch their &lt;a href=&quot;https:&#x2F;&#x2F;www.instagram.com&#x2F;p&#x2F;CQ72cdTL5sx&#x2F;&quot;&gt;video&lt;&#x2F;a&gt; of the process if you like.&lt;&#x2F;p&gt;
&lt;figure&gt;
&lt;img src=&quot;&#x2F;images&#x2F;some-things&#x2F;matariki.jpg&quot;
     alt=&quot;Two pictures side-by-side. They show a matte black circuit board with white text and soldered components. In the right-hand image there are nine lit LEDs in the position of the stars of Matariki.&quot;
     width=&quot;600&quot;
     height=&quot;300&quot;
     class=&quot;centre&quot;&#x2F;&gt;
&lt;figcaption&gt;Images by &lt;a href=&quot;https:&#x2F;&#x2F;citylibrary.pncc.govt.nz&#x2F;locations&#x2F;blueprint&quot;&gt;Blueprint Makerspace&lt;&#x2F;a&gt;.&lt;&#x2F;figcaption&gt;
&lt;&#x2F;figure&gt;
</content>
    </entry>
    <entry xml:lang="en">
        <title>Setting up a small videoconferencing server</title>
        <published>2020-04-05T00:00:00+00:00</published>
        <updated>2020-04-06T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Zak
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://www.mitsake.net/posts/videoconferencing-setup/"/>
        <id>https://www.mitsake.net/posts/videoconferencing-setup/</id>
        <content type="html" xml:base="https://www.mitsake.net/posts/videoconferencing-setup/">&lt;p&gt;&lt;em&gt;Update (6 April 2020): Having just updated my server, it appears that the latest version of Jitsi leads to some issues. I ended up reinstalling using the &lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;jitsi&#x2F;jitsi-meet&#x2F;blob&#x2F;master&#x2F;doc&#x2F;quick-install.md&quot;&gt;quick install guide&lt;&#x2F;a&gt;, which worked without any issues. Best to go with that for now!&lt;&#x2F;em&gt;&lt;&#x2F;p&gt;
&lt;span id=&quot;continue-reading&quot;&gt;&lt;&#x2F;span&gt;
&lt;p&gt;Like a lot of the world, we&#x27;re in &quot;lockdown&quot; over here, with only a few businesses allowed to open. Obviously a lot of people are now working from home, so videoconferencing is now a key tool in everyone&#x27;s arsenal. The defacto option appears to be &lt;a href=&quot;https:&#x2F;&#x2F;zoom.us&#x2F;&quot;&gt;Zoom&lt;&#x2F;a&gt;, but they have a &lt;a href=&quot;https:&#x2F;&#x2F;arstechnica.com&#x2F;information-technology&#x2F;2019&#x2F;07&#x2F;zoom-makes-it-too-easy-for-hackers-to-access-webcams-heres-what-to-do&#x2F;&quot;&gt;fairly sketchy record&lt;&#x2F;a&gt; on user privacy which has left &lt;a href=&quot;https:&#x2F;&#x2F;www.google.com&#x2F;search?q=zoom+privacy&quot;&gt;many&lt;&#x2F;a&gt; &lt;a href=&quot;https:&#x2F;&#x2F;www.wired.co.uk&#x2F;article&#x2F;zoom-privacy-settings&quot;&gt;people&lt;&#x2F;a&gt; &lt;a href=&quot;https:&#x2F;&#x2F;arstechnica.com&#x2F;tech-policy&#x2F;2020&#x2F;03&#x2F;zooms-privacy-problems-are-growing-as-platform-explodes-in-popularity&#x2F;&quot;&gt;questioning&lt;&#x2F;a&gt; whether they ought to be trusted.&lt;&#x2F;p&gt;
&lt;p&gt;Rather than think too hard about whether Zoom was worth using, I decided to try another option - the open source &lt;a href=&quot;https:&#x2F;&#x2F;www.jitsi.org&#x2F;&quot;&gt;Jitsi&lt;&#x2F;a&gt;. It offers many of the same features as Zoom, but since you run the server, you don&#x27;t have to worry about where your audio and video are going. Although they have a &lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;jitsi&#x2F;jitsi-meet&#x2F;blob&#x2F;master&#x2F;doc&#x2F;quick-install.md&quot;&gt;quick install guide&lt;&#x2F;a&gt;, I&#x27;ve been having a few issues with getting them to work. Here are the steps I took to get things running.&lt;&#x2F;p&gt;
&lt;p&gt;To get started, you&#x27;ll need a Linux server with:&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;Root access via ssh, and&lt;&#x2F;li&gt;
&lt;li&gt;A DNS record pointing to it. This isn&#x27;t strictly necessary, but it will make things much easier.&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;p&gt;I used a Nanode from &lt;a href=&quot;https:&#x2F;&#x2F;www.linode.com&#x2F;&quot;&gt;Linode&lt;&#x2F;a&gt;, but the smallest Droplet from &lt;a href=&quot;https:&#x2F;&#x2F;www.digitalocean.com&#x2F;&quot;&gt;Digital Ocean&lt;&#x2F;a&gt; would also be fine, and both have promotions with free credit which would be perfect for a project like this. In terms of OS, I opted for Debian 10 (buster), but the following shouldn&#x27;t be too different for any similar system.&lt;&#x2F;p&gt;
&lt;p&gt;Once you&#x27;re logged in, start by updating everything and installing gpg (for the Jitsi repository) and the nginx webserver. Installing nginx first is the main change I made from the official documentation, but fixed some issues I was seeing where both nginx and the Jitsi module ended up listening on the same port, preventing nginx from starting.&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;bash&quot; style=&quot;background-color:#282a36;color:#f8f8f2;&quot; class=&quot;language-bash &quot;&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span style=&quot;color:#6272a4;&quot;&gt;# apt update &amp;amp;&amp;amp; apt upgrade
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#6272a4;&quot;&gt;# apt install gpg &amp;amp;&amp;amp; nginx
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Set the hostname of the server by running &lt;code&gt;hostnamectl set-hostname subdomain.domain.com&lt;&#x2F;code&gt;, and editing &lt;code&gt;&#x2F;etc&#x2F;hosts&lt;&#x2F;code&gt; so that 127.0.0.1 points to the same name. If you navigate to the domain now, you should see the nginx default page:&lt;&#x2F;p&gt;
&lt;p&gt;&lt;img src=&quot;&#x2F;images&#x2F;nginxdefault.png&quot;
     alt=&quot;A cropped screenshot of the nginx webserver&#x27;s default landing page. It has black text on a white background and is titled &#x27;Welcome to nginx!&#x27;&quot;
     width=&quot;515&quot;
     height=&quot;200&quot;
     class=&quot;centre&quot;&#x2F;&gt;&lt;&#x2F;p&gt;
&lt;p&gt;From here, remove the default site, install the key for the &lt;code&gt;jitsi-stable&lt;&#x2F;code&gt; repository, and then install Jitsi itself.&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;bash&quot; style=&quot;background-color:#282a36;color:#f8f8f2;&quot; class=&quot;language-bash &quot;&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span style=&quot;color:#6272a4;&quot;&gt;# rm &#x2F;etc&#x2F;nginx&#x2F;sites-enabled&#x2F;default
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#6272a4;&quot;&gt;# echo &amp;#39;deb https:&#x2F;&#x2F;download.jitsi.org stable&#x2F;&amp;#39; &amp;gt;&amp;gt; &#x2F;etc&#x2F;apt&#x2F;sources.list.d&#x2F;jitsi-stable.list
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#6272a4;&quot;&gt;# wget -qO -  https:&#x2F;&#x2F;download.jitsi.org&#x2F;jitsi-key.gpg.key | apt-key add -
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#6272a4;&quot;&gt;# apt update &amp;amp;&amp;amp; apt install jitsi-meet
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Visiting the site now should show you the Jitsi landing page:&lt;&#x2F;p&gt;
&lt;p&gt;&lt;img src=&quot;&#x2F;images&#x2F;jitsidefault.png&quot;
     alt=&quot;Screenshot of the Jitsi landing page. It has a box for entering the name of a room to join.&quot;
     width=&quot;525&quot;
     height=&quot;225&quot;
     class=&quot;centre&quot;&#x2F;&gt;&lt;&#x2F;p&gt;
&lt;p&gt;The final step is to use &lt;a href=&quot;https:&#x2F;&#x2F;letsencrypt.org&#x2F;&quot;&gt;Let&#x27;s Encrypt&lt;&#x2F;a&gt; to get a free SSL certificate, install it, and restart nginx. Jitsi provide a script to do this, so to finish off you can simply run it and restart nginx.&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;bash&quot; style=&quot;background-color:#282a36;color:#f8f8f2;&quot; class=&quot;language-bash &quot;&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span style=&quot;color:#6272a4;&quot;&gt;# &#x2F;usr&#x2F;share&#x2F;jitsi-meet&#x2F;scripts&#x2F;install-letsencrypt-cert.sh
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#6272a4;&quot;&gt;# service nginx restart
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;I&#x27;m sure the Jitsi project is going to be changing fairly rapidly given the current pace of things, so I&#x27;ll try to keep this updated.&lt;&#x2F;p&gt;
</content>
    </entry>
    <entry xml:lang="en">
        <title>Moving mitsake to makesite.py</title>
        <published>2020-03-09T00:00:00+00:00</published>
        <updated>2020-03-09T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Zak
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://www.mitsake.net/posts/moving-to-makesite/"/>
        <id>https://www.mitsake.net/posts/moving-to-makesite/</id>
        <content type="html" xml:base="https://www.mitsake.net/posts/moving-to-makesite/">&lt;p&gt;Welcome to the new-look mitsake! Most of the changes are behind the scenes, but I&#x27;ve also played around with the style a bit.&lt;&#x2F;p&gt;
&lt;span id=&quot;continue-reading&quot;&gt;&lt;&#x2F;span&gt;
&lt;p&gt;The biggest change has been shifting from using Jekyll to generate the site to Sunaina Pai&#x27;s &lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;sunainapai&#x2F;makesite&quot;&gt;makesite.py&lt;&#x2F;a&gt;. Over the last while, I&#x27;ve not really done much with Ruby, but I have had written a few scripts in Python and have started using &lt;a href=&quot;https:&#x2F;&#x2F;circuitpython.org&#x2F;&quot;&gt;CircuitPython&lt;&#x2F;a&gt; a fair bit as well. It&#x27;s a great system and has been really easy to customise. I&#x27;ve moved away from automated deployment too - running &lt;code&gt;rsync&lt;&#x2F;code&gt; isn&#x27;t &lt;em&gt;really&lt;&#x2F;em&gt; that much effort.&lt;&#x2F;p&gt;
&lt;p&gt;Design-wise, I&#x27;ve mostly kept the default style with some influence from &lt;a href=&quot;http:&#x2F;&#x2F;bettermotherfuckingwebsite.com&#x2F;&quot;&gt;BetterMotherfuckingWebsite&lt;&#x2F;a&gt; to help readability. I&#x27;ve kept Solarized Dark for code highlighting as it&#x27;s still what I use day-to-day.&lt;&#x2F;p&gt;
&lt;p&gt;Hopefully this year will see a few more posts here; I&#x27;ve completed a couple of projects and should really write them up.&lt;&#x2F;p&gt;
</content>
    </entry>
    <entry xml:lang="en">
        <title>Playaway audiobook teardown</title>
        <published>2019-06-17T00:00:00+00:00</published>
        <updated>2019-06-17T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Zak
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://www.mitsake.net/posts/playaway-audiobook-teardown/"/>
        <id>https://www.mitsake.net/posts/playaway-audiobook-teardown/</id>
        <content type="html" xml:base="https://www.mitsake.net/posts/playaway-audiobook-teardown/">&lt;p&gt;I&#x27;ve been playing with electronics for a few years now, and given my interest in how things work, enjoy reading people&#x27;s commentary as they take apart various devices. I recently found this &lt;a href=&quot;http:&#x2F;&#x2F;www.playaway.com&#x2F;audiobooks&#x2F;&quot;&gt;Playaway&lt;&#x2F;a&gt;  at a second-hand book sale and given it was just $1, decided to see what was inside. I hadn&#x27;t seen one of these before, but they&#x27;re a small digital audio player that comes pre-loaded with a particular audiobook and runs on a single AAA battery. Their website seems to be targeted towards libraries, so they&#x27;re an alternative to digital distribution or sets of CDs.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;a href=&quot;&#x2F;images&#x2F;playaway&#x2F;1-frontlarge.jpg&quot;&gt;&lt;img src=&quot;&#x2F;images&#x2F;playaway&#x2F;1-front.jpg&quot;
     alt=&quot;Front view of the audiobook player&quot;
     width=&quot;189&quot;
     height=&quot;300&quot;
     class=&quot;centre&quot;&#x2F;&gt;&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;p&gt;Judging by their website, this is an earlier model of the player with a simple LCD and buttons for basic functions such as play&#x2F;pause, changing tracks, adjusting volume, and power. The SP and EQ buttons adjust playback speed and equaliser preset respectively. However, this isn&#x27;t particularly interesting, so let&#x27;s get the cover off!&lt;&#x2F;p&gt;
&lt;p&gt;&lt;a href=&quot;&#x2F;images&#x2F;playaway&#x2F;2-pcbfrontlarge.jpg&quot;&gt;&lt;img src=&quot;&#x2F;images&#x2F;playaway&#x2F;2-pcbfront.jpg&quot;
     alt=&quot;Front of audiobook player PCB&quot;
     width=&quot;192&quot;
     height=&quot;300&quot;
     class=&quot;centre&quot;&#x2F;&gt;&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;p&gt;Opening the battery door and levering off the front cover gets us here. The keypad and LCD are held in place by the cover, and the contacts for both are clearly visible. The silkscreen tells us it was made by &lt;a href=&quot;http:&#x2F;&#x2F;www.jeu-tech.com&#x2F;&quot;&gt;j.e. Unit Technology&lt;&#x2F;a&gt; in late 2009, and their website shows they&#x27;re still making hardware for Playaway as well, with some newer products like the Playaway View in their portfolio.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;a href=&quot;&#x2F;images&#x2F;playaway&#x2F;3-pcbbacklarge.jpg&quot;&gt;&lt;img src=&quot;&#x2F;images&#x2F;playaway&#x2F;3-pcbback.jpg&quot;
     alt=&quot;Back of audiobook player PCB&quot;
     width=&quot;218&quot;
     height=&quot;300&quot;
     class=&quot;centre&quot;&#x2F;&gt;&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;p&gt;The back is where the two main ICs are located. The rectangular chip is a 2 Gbit (256 MiB) Hynix flash, and the square IC is a SigmaTel STMP3770. This is a fairly interesting system-on-chip (SoC), designed solely for operating media players and carrying everything you&#x27;d need to make the next iPod killer. The only things needed are storage and passives for peripherals such as the voltage regulator. The Freescale logo on this one indicates that it was made after SigmaTel were bought, but following Freescale&#x27;s merger with NXP it seems that the datasheets have disappeared. Fortunately, their popularity in media players means that the &lt;a href=&quot;https:&#x2F;&#x2F;www.rockbox.org&#x2F;&quot;&gt;Rockbox project&lt;&#x2F;a&gt; has a lot of information on this &lt;a href=&quot;https:&#x2F;&#x2F;www.rockbox.org&#x2F;wiki&#x2F;SigmaTelSTMP3xxx&quot;&gt;family of chips&lt;&#x2F;a&gt;, including an archived datasheet for the &lt;a href=&quot;https:&#x2F;&#x2F;www.rockbox.org&#x2F;wiki&#x2F;pub&#x2F;Main&#x2F;DataSheets&#x2F;STMP3770-ds-1-04.pdf&quot;&gt;3770&lt;&#x2F;a&gt;.&lt;&#x2F;p&gt;
&lt;p&gt;One thing I&#x27;d noticed when I took the back sticker off was holes to access a series of six test points on the PCB. At first I guessed that this would be for debugging, but the datasheet didn&#x27;t show the pins associated with the SWD connector. Looking at where the traces from these pads went made the function fairly obvious though. T5 is connected on four sides to a plane and is continuous with the negative battery terminal, so must be GND. T4 and T6 connect to pins 77 and 78 of the IC, which are USB_DP (D+) and USB_DM (D-) respectively. This meant that T3 had to be the 5 V supply from a USB port, and sure enough it was connected to pin 53 of the 3770 - VDD5V. As far as I can tell, the other two pads aren&#x27;t connected to anything on the STMP3770, though I&#x27;ll go back and have another look.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;a href=&quot;&#x2F;images&#x2F;playaway&#x2F;4-usblarge.jpg&quot;&gt;&lt;img src=&quot;&#x2F;images&#x2F;playaway&#x2F;4-usb.jpg&quot;
     alt=&quot;PCB with jumper wires connected to test points&quot;
     width=&quot;438&quot;
     height=&quot;300&quot;
     class=&quot;centre&quot;&#x2F;&gt;&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;p&gt;I don&#x27;t have any pogo pins (or a way to mount them), so I soldered some jumper wires to the test points. When I connected the player to my computer, I got this:&lt;&#x2F;p&gt;
&lt;p&gt;&lt;img src=&quot;&#x2F;images&#x2F;playaway&#x2F;5-files.png&quot;
     alt=&quot;Screenshot of USB drive containing audiobook files&quot;
     width=&quot;640&quot;
     height=&quot;307&quot;
     class=&quot;centre&quot;&#x2F;&gt;&lt;&#x2F;p&gt;
&lt;p&gt;It took some searching to find out what format these files were actually in. None of the common tools (e.g. VLC and ffmpeg) were able to decode them, which meant it wasn&#x27;t &lt;a href=&quot;https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Adaptive_Multi-Rate_Wideband&quot;&gt;Adaptive Multi-Rate - Wideband&lt;&#x2F;a&gt; (apparently common for audiobooks on Nokia phones). Guessing it was probably related, I tried to find a way to read the newer &lt;a href=&quot;https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Extended_Adaptive_Multi-Rate_%E2%80%93_Wideband&quot;&gt;Extended Adaptive Multi-Rate - Wideband&lt;&#x2F;a&gt; format, eventually findinding a &lt;a href=&quot;https:&#x2F;&#x2F;trac.ffmpeg.org&#x2F;ticket&#x2F;6140&quot;&gt;request for AMR-WB+ support in ffmpeg&lt;&#x2F;a&gt;, which in turn pointed me towards an &lt;a href=&quot;https:&#x2F;&#x2F;portal.3gpp.org&#x2F;desktopmodules&#x2F;Specifications&#x2F;SpecificationDetails.aspx?specificationId=1451&quot;&gt;encoder&#x2F;decoder&lt;&#x2F;a&gt;. You&#x27;ll need Windows (or Wine), but the syntax is very simple: &lt;code&gt;decoder.exe -ff raw -if path\to\encoded\file.awb -of path\to\decoded\file.wav&lt;&#x2F;code&gt; produced a WAVE file of the audio.&lt;&#x2F;p&gt;
</content>
    </entry>
    <entry xml:lang="en">
        <title>Automating Jekyll deployment, take two</title>
        <published>2019-04-22T00:00:00+00:00</published>
        <updated>2019-04-22T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Zak
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://www.mitsake.net/posts/automating-jekyll-deployment-2/"/>
        <id>https://www.mitsake.net/posts/automating-jekyll-deployment-2/</id>
        <content type="html" xml:base="https://www.mitsake.net/posts/automating-jekyll-deployment-2/">&lt;p&gt;Back last year, I &lt;a href=&quot;https:&#x2F;&#x2F;www.mitsake.net&#x2F;posts&#x2F;posting-from-multiple-computers&#x2F;&quot;&gt;posted&lt;&#x2F;a&gt; about how I set up a non-bare git repository on NearlyFreeSpeech so I could work on the site from both my laptop and desktop. This has worked fine, but the fact that it&#x27;s not the &#x27;right&#x27; way to do it hasn&#x27;t sat well with me.&lt;&#x2F;p&gt;
&lt;p&gt;The issue I was having with a bare repository came down to deleting the temporary clone that was used to build the site. Despite working fine from the command line and via SSH, attempting to remove the temporary clone used to build the site gave  &lt;code&gt;Directory not empty&lt;&#x2F;code&gt; errors, all related to the .git subdirectory. Because the directory wasn&#x27;t completely removed, creating the temporary repository failed when the script next ran.&lt;&#x2F;p&gt;
&lt;p&gt;After converting the repository from &lt;a href=&quot;https:&#x2F;&#x2F;git.wiki.kernel.org&#x2F;index.php&#x2F;GitFaq#How_do_I_make_existing_non-bare_repository_bare.3F&quot;&gt;non-bare to bare&lt;&#x2F;a&gt;, I started with the post-receive hook that I&#x27;d first tried (via &lt;a href=&quot;https:&#x2F;&#x2F;underhilllabs.github.io&#x2F;Web%20Development&#x2F;2012&#x2F;05&#x2F;11&#x2F;jekyll-on-nfsn&#x2F;&quot;&gt;Bart Lantz&lt;&#x2F;a&gt;). This threw the same error, but worked thanks to the multiple &lt;code&gt;rm -rf&lt;&#x2F;code&gt; lines. Experimenting with adding a delay didn&#x27;t seem to change much, but I found a very relevant &lt;a href=&quot;https:&#x2F;&#x2F;stackoverflow.com&#x2F;questions&#x2F;6191842&#x2F;why-does-rm-rf-behave-differently-when-used-in-a-git-post-receive-hook-as-opp&quot;&gt;Stack Overflow&lt;&#x2F;a&gt; question that tackled what was likely the same situation. The second answer gave me the solution: rather than using &lt;code&gt;git clone&lt;&#x2F;code&gt; which creates the .git subdirectory that couldn&#x27;t be removed cleanly, use &lt;code&gt;git archive&lt;&#x2F;code&gt; to export a copy of all the files. This was the key to solving the problem and after a bit of trial and error gave me the final version of my post-receive hook.&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;bash&quot; style=&quot;background-color:#282a36;color:#f8f8f2;&quot; class=&quot;language-bash &quot;&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span style=&quot;color:#6272a4;&quot;&gt;#!&#x2F;bin&#x2F;bash
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#6272a4;&quot;&gt;# set up variables
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffffff;&quot;&gt;REPO_PATH&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ff79c6;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span style=&quot;color:#f1fa8c;&quot;&gt;&#x2F;path&#x2F;to&#x2F;barerepo.git&#x2F;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffffff;&quot;&gt;PUBLIC_WWW&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ff79c6;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span style=&quot;color:#f1fa8c;&quot;&gt;&#x2F;var&#x2F;www
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffffff;&quot;&gt;TMP_CLONE&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ff79c6;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span style=&quot;color:#f1fa8c;&quot;&gt;&#x2F;tmp&#x2F;repo
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#6272a4;&quot;&gt;# archive the repository to the temp directory
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#50fa7b;&quot;&gt;mkdir &lt;&#x2F;span&gt;&lt;span&gt;$&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffffff;&quot;&gt;TMP_CLONE
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#8be9fd;&quot;&gt;cd &lt;&#x2F;span&gt;&lt;span&gt;$&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffffff;&quot;&gt;REPO_PATH
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#50fa7b;&quot;&gt;git&lt;&#x2F;span&gt;&lt;span&gt; archive master &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ff79c6;&quot;&gt;| &lt;&#x2F;span&gt;&lt;span style=&quot;color:#50fa7b;&quot;&gt;tar&lt;&#x2F;span&gt;&lt;span style=&quot;font-style:italic;color:#ffb86c;&quot;&gt; -xf&lt;&#x2F;span&gt;&lt;span&gt; -&lt;&#x2F;span&gt;&lt;span style=&quot;font-style:italic;color:#ffb86c;&quot;&gt; -C &lt;&#x2F;span&gt;&lt;span&gt;$&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffffff;&quot;&gt;TMP_CLONE
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#6272a4;&quot;&gt;# build the site, putting it in the PUBLIC_WWW directory
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#50fa7b;&quot;&gt;jekyll&lt;&#x2F;span&gt;&lt;span&gt; build&lt;&#x2F;span&gt;&lt;span style=&quot;font-style:italic;color:#ffb86c;&quot;&gt; --source &lt;&#x2F;span&gt;&lt;span&gt;$&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffffff;&quot;&gt;TMP_CLONE&lt;&#x2F;span&gt;&lt;span style=&quot;font-style:italic;color:#ffb86c;&quot;&gt; --destination &lt;&#x2F;span&gt;&lt;span&gt;$&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffffff;&quot;&gt;PUBLIC_WWW
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#6272a4;&quot;&gt;# clean up the temp repository
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#50fa7b;&quot;&gt;rm&lt;&#x2F;span&gt;&lt;span style=&quot;font-style:italic;color:#ffb86c;&quot;&gt; -rf &lt;&#x2F;span&gt;&lt;span&gt;$&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffffff;&quot;&gt;TMP_CLONE
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#8be9fd;&quot;&gt;exit
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;I&#x27;m still not positive what causes the original issue, but other reading I&#x27;ve done makes me suspect that the instance of git running on the server during the execution of the post-receive hook is locking access to parts of the .git subdirectory. This would explain why I wasn&#x27;t able to replicate the issue on the command line or when running the script via SSH, as well as why multiple &lt;code&gt;rm&lt;&#x2F;code&gt; lines eventually removed the directory. Either way, using &lt;code&gt;git archive&lt;&#x2F;code&gt; is an ideal workaround and it&#x27;s nice to have learned a little more about git.&lt;&#x2F;p&gt;
</content>
    </entry>
    <entry xml:lang="en">
        <title>Site changes</title>
        <published>2019-04-14T00:00:00+00:00</published>
        <updated>2019-04-21T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Zak
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://www.mitsake.net/posts/site-changes/"/>
        <id>https://www.mitsake.net/posts/site-changes/</id>
        <content type="html" xml:base="https://www.mitsake.net/posts/site-changes/">&lt;p&gt;Apologies to anyone who uses the &lt;a href=&quot;https:&#x2F;&#x2F;www.mitsake.net&#x2F;posts&#x2F;site-changes&#x2F;rss.xml&quot;&gt;RSS feed&lt;&#x2F;a&gt; and has seen posts being republished as I&#x27;ve been making changes to the site. Apart from fixing a few typos and updating the semantic layout, the major change has been a slight update of the colour palette to one that uses the &lt;a href=&quot;https:&#x2F;&#x2F;ethanschoonover.com&#x2F;solarized&#x2F;&quot;&gt;Solarized&lt;&#x2F;a&gt; scheme.&lt;&#x2F;p&gt;
&lt;p&gt;I&#x27;ve had a few projects on the go and will hopefully have something to write about them soon. In the meantime, here&#x27;s a rough list of things I&#x27;ve done:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;New(ish) colour scheme.&lt;&#x2F;li&gt;
&lt;li&gt;Changed article headings to second-level (the site title is now the only top-level header).&lt;&#x2F;li&gt;
&lt;li&gt;Discovered there&#x27;s a &lt;code&gt;&amp;lt;main&amp;gt;&lt;&#x2F;code&gt; element in HTML5, so substituted that in for the &lt;code&gt;&amp;lt;div id=&quot;main&quot;&amp;gt;&lt;&#x2F;code&gt; that I&#x27;ve been using since first starting with CSS somewhere around the year 2000.&lt;&#x2F;li&gt;
&lt;li&gt;Added a link to the RSS feed at the bottom of the home page because most browsers seem to have removed buttons for feeds.&lt;&#x2F;li&gt;
&lt;li&gt;Post archive is now organised by year rather than month.&lt;&#x2F;li&gt;
&lt;li&gt;Got rid of the by tag archive because I&#x27;m bad at tagging and honestly I don&#x27;t post enough here to justify it.&lt;&#x2F;li&gt;
&lt;li&gt;Changed the permalink structure to omit the month of the post, then remembered what &#x27;permalink&#x27; means and reverted it.&lt;&#x2F;li&gt;
&lt;li&gt;Rewrote stylesheet using &lt;a href=&quot;https:&#x2F;&#x2F;sass-lang.com&#x2F;&quot;&gt;Sass&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;em&gt;Updated stylesheet to add line spacing (21 April 2019).&lt;&#x2F;em&gt;&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;Also, if you&#x27;re using the &lt;a href=&quot;https:&#x2F;&#x2F;jekyllrb.com&#x2F;tutorials&#x2F;convert-site-to-jekyll&#x2F;#10-rss-feed&quot;&gt;Jekyll docs&lt;&#x2F;a&gt; to create an RSS feed, you&#x27;ll see this line, used to include a short snippet from the post:&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;handlebars&quot; style=&quot;background-color:#282a36;color:#f8f8f2;&quot; class=&quot;language-handlebars &quot;&gt;&lt;code class=&quot;language-handlebars&quot; data-lang=&quot;handlebars&quot;&gt;&lt;span style=&quot;color:#6be5fd;&quot;&gt;{{ &lt;&#x2F;span&gt;&lt;span style=&quot;font-style:italic;color:#ffb86c;&quot;&gt;post.content&lt;&#x2F;span&gt;&lt;span&gt; | &lt;&#x2F;span&gt;&lt;span style=&quot;font-style:italic;color:#ffb86c;&quot;&gt;escape&lt;&#x2F;span&gt;&lt;span&gt; | &lt;&#x2F;span&gt;&lt;span style=&quot;font-style:italic;color:#ffb86c;&quot;&gt;truncate&lt;&#x2F;span&gt;&lt;span&gt;: &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f1fa8c;&quot;&gt;&amp;#39;400&amp;#39; &lt;&#x2F;span&gt;&lt;span style=&quot;color:#6be5fd;&quot;&gt;}}
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Because the truncate filter comes after the escape filter, the snippet can sometimes be truncated in the middle of an escaped character, e.g. &lt;code&gt;&amp;amp;amp;&lt;&#x2F;code&gt; becomes &lt;code&gt;&amp;amp;am&lt;&#x2F;code&gt; or similar. This might cause undefined behaviour in some feed parsers (when I tested an affected feed, the W3 validator aborted), but it&#x27;s easy to fix by switching the order of the filters so the post is truncated, then escaped.&lt;&#x2F;p&gt;
</content>
    </entry>
    <entry xml:lang="en">
        <title>Unlocking the Siglent SDS1104X-E</title>
        <published>2018-11-11T00:00:00+00:00</published>
        <updated>2018-11-11T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Zak
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://www.mitsake.net/posts/unlocking-siglent-sds-1104x-e/"/>
        <id>https://www.mitsake.net/posts/unlocking-siglent-sds-1104x-e/</id>
        <content type="html" xml:base="https://www.mitsake.net/posts/unlocking-siglent-sds-1104x-e/">&lt;p&gt;As a birthday present, I recently bought myself my first oscilloscope. After researching the various makes and models for a fair while, I eventually decided on the Siglent &lt;a href=&quot;https:&#x2F;&#x2F;www.siglentamerica.com&#x2F;digital-oscilloscopes&#x2F;sds1000x-e-series-super-phosphor-oscilloscopes&#x2F;&quot;&gt;SDS1104X-E&lt;&#x2F;a&gt;. It&#x27;s a four channel model, with 100 MHz bandwidth and options to add a waveform generator and digital input.&lt;&#x2F;p&gt;
&lt;p&gt;Given this is my first &#x27;scope, I started a bit of reading to find out how to best use it. In the process, I came across an &lt;a href=&quot;https:&#x2F;&#x2F;www.eevblog.com&#x2F;forum&#x2F;testgear&#x2F;siglent-sds1204x-e-released-for-domestic-markets-in-china&#x2F;msg1612639&#x2F;#msg1612639&quot;&gt;interesting post&lt;&#x2F;a&gt; on the EEVblog forums indicating that it was possible to &#x27;upgrade&#x27; the 1104X-E to the 200 MHz 1204X-E. This, of course, generated a fair bit of interest, with people eventually coming up with a &lt;a href=&quot;https:&#x2F;&#x2F;www.eevblog.com&#x2F;forum&#x2F;testgear&#x2F;unlocking-siglent-sds1104x-e-step-by-step&#x2F;msg1877477&#x2F;#msg1877477&quot;&gt;method&lt;&#x2F;a&gt; to extract the license keys from the oscilloscope&#x27;s memory.&lt;&#x2F;p&gt;
&lt;p&gt;I didn&#x27;t have a whole lot of luck with this, as I wasn&#x27;t able to get the version of busybox linked in the post to actually save a core dump. In addition, I wasn&#x27;t particularly fond of having to use a modified firmware file from a file sharing site as the first step in the process. After a bit of reading (particularly this &lt;a href=&quot;https:&#x2F;&#x2F;kaarthik.wordpress.com&#x2F;2007&#x2F;12&#x2F;31&#x2F;modifying-cramfs-image&#x2F;&quot;&gt;blog post&lt;&#x2F;a&gt; from 2007 and a post on the &lt;a href=&quot;https:&#x2F;&#x2F;forum.chumby.com&#x2F;viewtopic.php?id=1493&quot;&gt;chumby forum&lt;&#x2F;a&gt;), I managed to come up with a slightly different method.&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;Download SDS1xx4X-E Operating System -V1 from the &lt;a href=&quot;https:&#x2F;&#x2F;www.siglentamerica.com&#x2F;service-and-support&#x2F;firmware-software&#x2F;digital-oscilloscopes&#x2F;#sds1000x-e-series&quot;&gt;Siglent support site&lt;&#x2F;a&gt;.&lt;&#x2F;li&gt;
&lt;li&gt;Extract and mount the &lt;code&gt;rootfs.cramfs&lt;&#x2F;code&gt; file:&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;pre data-lang=&quot;bash&quot; style=&quot;background-color:#282a36;color:#f8f8f2;&quot; class=&quot;language-bash &quot;&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span style=&quot;color:#6272a4;&quot;&gt;# mount -o loop -t cramfs &#x2F;path&#x2F;to&#x2F;rootfs.cramfs ~&#x2F;tmp
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;ul&gt;
&lt;li&gt;As cramfs file systems are read-only, we need to copy the files to a new directory. Make a list of the files in the original file system, copy them to the new directory, then unmount the cramfs file system:&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;pre data-lang=&quot;bash&quot; style=&quot;background-color:#282a36;color:#f8f8f2;&quot; class=&quot;language-bash &quot;&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span style=&quot;color:#50fa7b;&quot;&gt;$&lt;&#x2F;span&gt;&lt;span&gt; find &lt;&#x2F;span&gt;&lt;span style=&quot;color:#bd93f9;&quot;&gt;~&lt;&#x2F;span&gt;&lt;span&gt;&#x2F;tmp &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ff79c6;&quot;&gt;&amp;gt;&lt;&#x2F;span&gt;&lt;span&gt; filelist.txt
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#50fa7b;&quot;&gt;$&lt;&#x2F;span&gt;&lt;span&gt; cat filelist.txt &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ff79c6;&quot;&gt;| &lt;&#x2F;span&gt;&lt;span style=&quot;color:#50fa7b;&quot;&gt;cpio&lt;&#x2F;span&gt;&lt;span style=&quot;font-style:italic;color:#ffb86c;&quot;&gt; -pdm&lt;&#x2F;span&gt;&lt;span&gt; siglentfs-mod&#x2F;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#6272a4;&quot;&gt;# umount ~&#x2F;tmp
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;ul&gt;
&lt;li&gt;The only edit we&#x27;ll make is to the &lt;code&gt;&#x2F;etc&#x2F;shadow&lt;&#x2F;code&gt; file. Open the file using your favourite text editor, which looks like this:&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;pre style=&quot;background-color:#282a36;color:#f8f8f2;&quot;&gt;&lt;code&gt;&lt;span&gt;root:$6$DZO.HiUy$JKaJGKC8ynyAn.7IF64GzC6cGnmJCQgGlqoPQ9QTc7EW8iF&#x2F;8lMD00EtiiS3&#x2F;GpgzN7rvfTbmfnAKzAg66dnu&#x2F;:17177:0:99999:7:::
&lt;&#x2F;span&gt;&lt;span&gt;siglent:$6$tOEDgvF2$A2zA0bgMZ9XU7LTZN5FVGl4iuDUoPGqGG8IrHoTRaPRJzYyIDXQ8lh8.E1PX98HS8UDRBgDdXwRHlWUG5fY4M1:17029:0:99999:7:::
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;ul&gt;
&lt;li&gt;The hash is between the first and second colons in the line starting &lt;code&gt;root&lt;&#x2F;code&gt;. Generate a new password hash, and replace the hash in the shadow file with this new one.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;pre data-lang=&quot;bash&quot; style=&quot;background-color:#282a36;color:#f8f8f2;&quot; class=&quot;language-bash &quot;&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span style=&quot;color:#50fa7b;&quot;&gt;$&lt;&#x2F;span&gt;&lt;span&gt; mkpasswd&lt;&#x2F;span&gt;&lt;span style=&quot;font-style:italic;color:#ffb86c;&quot;&gt; -m&lt;&#x2F;span&gt;&lt;span&gt; sha-512 yourpassword DZO.HiUy
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#50fa7b;&quot;&gt;$&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffffff;&quot;&gt;6&lt;&#x2F;span&gt;&lt;span style=&quot;color:#50fa7b;&quot;&gt;$&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffffff;&quot;&gt;DZO&lt;&#x2F;span&gt;&lt;span style=&quot;color:#50fa7b;&quot;&gt;.HiUy$&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffffff;&quot;&gt;tws7P&lt;&#x2F;span&gt;&lt;span style=&quot;color:#50fa7b;&quot;&gt;&#x2F;jPrYETgX5rZCuyU5nhUTjaP&#x2F;&#x2F;4o5W&#x2F;6Ruq&#x2F;Q95qUb5CLxB&#x2F;i6uBMm7lMl6Y3P1ExXbMk3qPisxH14.H1
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;ul&gt;
&lt;li&gt;Finally, use &lt;code&gt;mkcramfs&lt;&#x2F;code&gt; to compress the filesystem again. Current versions of Ubuntu include &lt;code&gt;mkfs.cramfs&lt;&#x2F;code&gt;, which for some reason the Siglent doesn&#x27;t seem to like. However, mkcramfs can be found as part of the original &lt;a href=&quot;https:&#x2F;&#x2F;sourceforge.net&#x2F;projects&#x2F;cramfs&#x2F;&quot;&gt;cramfs tools&lt;&#x2F;a&gt;. Once you&#x27;ve built them, compress the filesystem:&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;pre data-lang=&quot;bash&quot; style=&quot;background-color:#282a36;color:#f8f8f2;&quot; class=&quot;language-bash &quot;&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span style=&quot;color:#50fa7b;&quot;&gt;$&lt;&#x2F;span&gt;&lt;span&gt; mkcramfs siglentfs-mod&#x2F; rootfs.cramfs
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;ul&gt;
&lt;li&gt;Follow the instructions in the Siglent update file, replacing rootfs.cramfs with the edited version.&lt;&#x2F;li&gt;
&lt;li&gt;You should now be able to telnet to the oscillscope and log in as root with the new password. Plug in a USB drive, dump the contents of memory, and unmount the USB.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;pre data-lang=&quot;bash&quot; style=&quot;background-color:#282a36;color:#f8f8f2;&quot; class=&quot;language-bash &quot;&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span style=&quot;color:#6272a4;&quot;&gt;# cat &#x2F;dev&#x2F;mem &amp;gt; &#x2F;usr&#x2F;bin&#x2F;siglent&#x2F;usr&#x2F;mass_storage&#x2F;U-disk0&#x2F;memdump.bin
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#50fa7b;&quot;&gt;cat:&lt;&#x2F;span&gt;&lt;span&gt; read error: Bad address
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#6272a4;&quot;&gt;# umount &#x2F;usr&#x2F;bin&#x2F;siglent&#x2F;usr&#x2F;mass_storage&#x2F;U-disk0&#x2F;
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;From this point, the steps are the same as those in the &lt;a href=&quot;https:&#x2F;&#x2F;www.eevblog.com&#x2F;forum&#x2F;testgear&#x2F;unlocking-siglent-sds1104x-e-step-by-step&#x2F;msg1877477&#x2F;#msg1877477&quot;&gt;step-by-step&lt;&#x2F;a&gt; post, starting from step 21. Just in case they disappear, this is my interpretation of them:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;Open the memory dump using a hex editor search for the string &#x27;SDS1000X-E&#x27;. It&#x27;ll occur a number of times, you&#x27;re looking for where it appears approximately 25-30 bytes before the scope ID (found by typing SCOPEID? at the web-based SCPI prompt) and the serial number.&lt;&#x2F;li&gt;
&lt;li&gt;After the scope ID appears twice, there will be five 16-character strings made of uppercase characters and digits. The first four are the licenses for 100 Mhz, 200 MHz, 50 MHz, and 70 MHz bandwidths respectively, and the fifth is the currently active bandwidth license.&lt;&#x2F;li&gt;
&lt;li&gt;The &#x27;SDS1000X-E&#x27; string will also appear near the serial number which for me was repeated as well. Following the serial number there will be a 48-character (again, uppercase and digits) string. Separating this into 16-character strings will give you your AWG, WIFI and MSO keys respectively.&lt;&#x2F;li&gt;
&lt;li&gt;The bandwidth licenses need to be activated through the SCPI interface using &lt;code&gt;MCBD &amp;lt;key&amp;gt;&lt;&#x2F;code&gt;, while options can be activated either via the oscillscope&#x27;s menus or using the command &lt;code&gt;LCISL &amp;lt;option&amp;gt; &amp;lt;key&amp;gt;&lt;&#x2F;code&gt;.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;Hopefully these steps help someone else work through the process. Please bear in mind that playing with the firmware of your test equipment carries the potential for Bad Things to happen (up to and including leaving it entirely non-functional), so don&#x27;t say you weren&#x27;t warned.&lt;&#x2F;p&gt;
</content>
    </entry>
    <entry xml:lang="en">
        <title>Getting started with the Pluto SDR</title>
        <published>2018-08-16T00:00:00+00:00</published>
        <updated>2019-04-05T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Zak
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://www.mitsake.net/posts/getting-started-with-pluto/"/>
        <id>https://www.mitsake.net/posts/getting-started-with-pluto/</id>
        <content type="html" xml:base="https://www.mitsake.net/posts/getting-started-with-pluto/">&lt;p&gt;&lt;em&gt;Update (5 April 2019): the myraidrf repositories are now out of date. If you&#x27;re running Ubuntu 18.04, your best bet is to install gnuradio from the default repositories and use the instructions on the &lt;a href=&quot;https:&#x2F;&#x2F;wiki.analog.com&#x2F;resources&#x2F;tools-software&#x2F;linux-software&#x2F;gnuradio&quot;&gt;Analog Devices Wiki&lt;&#x2F;a&gt; to build the gr-iio blocks from source.&lt;&#x2F;em&gt;&lt;&#x2F;p&gt;
&lt;p&gt;I&#x27;ve been interested in Software Defined Radio (SDR) for a while, and after tinkering with an &lt;a href=&quot;https:&#x2F;&#x2F;www.rtl-sdr.com&#x2F;about-rtl-sdr&#x2F;&quot;&gt;RTL-SDR&lt;&#x2F;a&gt; for a while decided to get something with a larger tuning range and transmit capability. Although I was originally planning to buy a &lt;a href=&quot;https:&#x2F;&#x2F;greatscottgadgets.com&#x2F;hackrf&#x2F;&quot;&gt;HackRF One&lt;&#x2F;a&gt; because of the well-established community around it, I ended up going with the Analog Devices &lt;a href=&quot;http:&#x2F;&#x2F;www.analog.com&#x2F;en&#x2F;design-center&#x2F;evaluation-hardware-and-software&#x2F;evaluation-boards-kits&#x2F;ADALM-PLUTO.html&quot;&gt;ADALM-PLUTO&lt;&#x2F;a&gt; as I was able to get it for significantly cheaper (approximately NZ$100 including shipping - the HackRF is easily NZ$500+).&lt;&#x2F;p&gt;
&lt;p&gt;My plan is to work through Michael Ossman&#x27;s &lt;a href=&quot;https:&#x2F;&#x2F;greatscottgadgets.com&#x2F;sdr&#x2F;&quot;&gt;SDR with HackRF&lt;&#x2F;a&gt;, which uses &lt;a href=&quot;https:&#x2F;&#x2F;www.gnuradio.org&#x2F;&quot;&gt;GNU Radio&lt;&#x2F;a&gt;. The &lt;a href=&quot;https:&#x2F;&#x2F;wiki.analog.com&#x2F;resources&#x2F;tools-software&#x2F;linux-software&#x2F;gnuradio&quot;&gt;Analog Devices Wiki&lt;&#x2F;a&gt; recommends using PyBOMBS, but that doesn&#x27;t seem to be working on Ubuntu 18.04 and their alternative, building from source, is something I try to avoid if possible because I almost always make a mistake somewhere. If anyone else is in a similar situation, the &lt;a href=&quot;https:&#x2F;&#x2F;launchpad.net&#x2F;~myriadrf&#x2F;&quot;&gt;myriadrf ppa&lt;&#x2F;a&gt; has all of the packages you need. Since I was also looking to use &lt;a href=&quot;http:&#x2F;&#x2F;gqrx.dk&#x2F;&quot;&gt;Gqrx&lt;&#x2F;a&gt;, the commands below include that as well.&lt;&#x2F;p&gt;
&lt;p&gt;Add the repositories to the package manager:&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;bash&quot; style=&quot;background-color:#282a36;color:#f8f8f2;&quot; class=&quot;language-bash &quot;&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span style=&quot;color:#50fa7b;&quot;&gt;$&lt;&#x2F;span&gt;&lt;span&gt; sudo add-apt-repository ppa:myriadrf&#x2F;drivers
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#50fa7b;&quot;&gt;$&lt;&#x2F;span&gt;&lt;span&gt; sudo add-apt-repository ppa:myriadrf&#x2F;gnuradio
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#50fa7b;&quot;&gt;$&lt;&#x2F;span&gt;&lt;span&gt; sudo add-apt-repository ppa:gqrx&#x2F;gqrx-sdr     &lt;&#x2F;span&gt;&lt;span style=&quot;color:#6272a4;&quot;&gt;# Leave out if you don&amp;#39;t want Gqrx.
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#50fa7b;&quot;&gt;$&lt;&#x2F;span&gt;&lt;span&gt; sudo apt update
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Then you just need to install GNU Radio, the gr-iio drivers and gqrx.&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;bash&quot; style=&quot;background-color:#282a36;color:#f8f8f2;&quot; class=&quot;language-bash &quot;&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span style=&quot;color:#50fa7b;&quot;&gt;$&lt;&#x2F;span&gt;&lt;span&gt; sudo apt install gnuradio gr-iio gqrx-sdr
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;h2 id=&quot;faster-sampling-over-usb&quot;&gt;Faster sampling over USB&lt;&#x2F;h2&gt;
&lt;p&gt;I found a page on the Wiki that compares &lt;a href=&quot;https:&#x2F;&#x2F;wiki.analog.com&#x2F;university&#x2F;tools&#x2F;pluto&#x2F;devs&#x2F;performance&quot;&gt;throughput&lt;&#x2F;a&gt; between the USB and network backends (since the Pluto uses RNDIS to provide a virtual ethernet link). Playing around with a simple GNU Radio FM receiver seemed to give similar results as those on the Wiki, as I was able to push the sample rate to 5.25 MHz over USB without buffer underruns, compared with around 4 MHz over the network interface. I&#x27;m sure there&#x27;s a standard Linux tool to find it, but I used iio_info from the iio_utils package. That gave me a URI in the form of &lt;code&gt;[usb:x.x.x]&lt;&#x2F;code&gt;, which replaced &lt;code&gt;pluto.local&lt;&#x2F;code&gt; in the Device URI field of the PlutoSDR block.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;em&gt;Update (21 August 2018) to add performance improvement.&lt;&#x2F;em&gt;&lt;&#x2F;p&gt;
</content>
    </entry>
    <entry xml:lang="en">
        <title>Posting from multiple computers</title>
        <published>2018-03-05T00:00:00+00:00</published>
        <updated>2018-03-05T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Zak
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://www.mitsake.net/posts/posting-from-multiple-computers/"/>
        <id>https://www.mitsake.net/posts/posting-from-multiple-computers/</id>
        <content type="html" xml:base="https://www.mitsake.net/posts/posting-from-multiple-computers/">&lt;p&gt;One of the issues with my current &lt;a href=&quot;https:&#x2F;&#x2F;jekyllrb.com&#x2F;&quot;&gt;Jekyll&lt;&#x2F;a&gt;&#x2F;&lt;a href=&quot;https:&#x2F;&#x2F;www.nearlyfreespeech.net&#x2F;&quot;&gt;NearlyFreeSpeech.NET&lt;&#x2F;a&gt; setup is that I haven&#x27;t been able to post if I&#x27;m not working on my laptop which has the only copy of the site&#x27;s git repository. That&#x27;s not been a problem previously, but lately I&#x27;ve been working from my desktop a bit more and have a project on that machine that I&#x27;d like to write up. My goal with this little tweak was to migrate the repository to a server, though setting this up has been more useful than I expected.&lt;&#x2F;p&gt;
&lt;p&gt;Git calls a repository that doesn&#x27;t have a local copy of the code a &#x27;bare&#x27; repository, and to make one you just have to run &lt;code&gt;git init --bare site.git&lt;&#x2F;code&gt; on the server. I was wondering why all of the information I could find included the .git extension - it turns out that it&#x27;s a &lt;a href=&quot;https:&#x2F;&#x2F;git-scm.com&#x2F;book&#x2F;en&#x2F;v2&#x2F;Git-on-the-Server-Getting-Git-on-a-Server&quot;&gt;convention&lt;&#x2F;a&gt; for identifying bare repositories.&lt;&#x2F;p&gt;
&lt;p&gt;To migrate this to a server, I used commands I found in the answers to &lt;a href=&quot;https:&#x2F;&#x2F;stackoverflow.com&#x2F;questions&#x2F;8978650&#x2F;how-do-i-move-my-local-git-repository-to-a-remote-git-repository&quot;&gt;this StackOverflow question&lt;&#x2F;a&gt;:&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;bash&quot; style=&quot;background-color:#282a36;color:#f8f8f2;&quot; class=&quot;language-bash &quot;&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span style=&quot;color:#6272a4;&quot;&gt;# I already had an &amp;#39;origin&amp;#39; remote, so I had to remove it first:
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#50fa7b;&quot;&gt;$&lt;&#x2F;span&gt;&lt;span&gt; git remote remove origin
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#6272a4;&quot;&gt;# Begin tracking the new bare repository
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#50fa7b;&quot;&gt;$&lt;&#x2F;span&gt;&lt;span&gt; git remote add origin ssh:&#x2F;&#x2F;server&#x2F;path&#x2F;to&#x2F;site.git&#x2F;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#6272a4;&quot;&gt;# Push the master branch of the local repository to the server
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#50fa7b;&quot;&gt;$&lt;&#x2F;span&gt;&lt;span&gt; git push origin master
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Goal achieved! Running &lt;code&gt;git clone ssh:&#x2F;&#x2F;server&#x2F;path&#x2F;to&#x2F;site.git&#x2F;&lt;&#x2F;code&gt; on my desktop worked as intended.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;automating-deployment&quot;&gt;Automating deployment&lt;&#x2F;h2&gt;
&lt;p&gt;However, while I was looking up how to do this, I found a few posts about automating deployment of Jekyll sites on NFSN using git hooks. My original plan was to use &lt;a href=&quot;https:&#x2F;&#x2F;underhilllabs.github.io&#x2F;Web%20Development&#x2F;2012&#x2F;05&#x2F;11&#x2F;jekyll-on-nfsn&#x2F;&quot;&gt;this method&lt;&#x2F;a&gt; by Bart Lantz, updating it with &lt;a href=&quot;https:&#x2F;&#x2F;www.jessesquires.com&#x2F;blog&#x2F;building-a-site-with-jekyll-on-nfsn&#x2F;&quot;&gt;Jesse Squires&lt;&#x2F;a&gt;&#x27; more recent post. However, I ended up taking a slightly different approach as I didn&#x27;t need to install or update Jekyll (as it&#x27;s already present on NFSN), and cloning&#x2F;deleting the repository each time caused &lt;code&gt;Directory not empty&lt;&#x2F;code&gt; errors, even when using &lt;code&gt;rm -rf&lt;&#x2F;code&gt;. My solution to this was to use a &#x27;normal&#x27; git repository with a working tree, which I could then build from.&lt;&#x2F;p&gt;
&lt;p&gt;Although pushing to a non-bare repository &lt;a href=&quot;http:&#x2F;&#x2F;gitready.com&#x2F;advanced&#x2F;2009&#x2F;02&#x2F;01&#x2F;push-to-only-bare-repositories.html&quot;&gt;isn&#x27;t recommended&lt;&#x2F;a&gt;, git has an &lt;a href=&quot;https:&#x2F;&#x2F;stackoverflow.com&#x2F;questions&#x2F;1764380&#x2F;how-to-push-to-a-non-bare-git-repository&quot;&gt;option&lt;&#x2F;a&gt; for repositories where the working tree needs to be present on the server. The only caveat is that the server&#x27;s working tree has to be kept clean - if you use the server to work on the site, you have to commit all of your changes, then pull them down to the local machine. Since I don&#x27;t work on the server at all, this was perfect for my situation.&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;Create a new repository in &lt;code&gt;&#x2F;home&#x2F;private&#x2F;git&#x2F;site&#x2F;&lt;&#x2F;code&gt; and run &lt;code&gt;git config --local receive.denyCurrentBranch updateInstead&lt;&#x2F;code&gt; - this allows the server to be updated as long as its working tree is clean.&lt;&#x2F;li&gt;
&lt;li&gt;Set the local repository&#x27;s &lt;code&gt;origin&lt;&#x2F;code&gt; to the server address and push it to the server (as outlined above)&lt;&#x2F;li&gt;
&lt;li&gt;Create a bash script called &lt;code&gt;post-receive&lt;&#x2F;code&gt; in &lt;code&gt;&#x2F;home&#x2F;private&#x2F;git&#x2F;site&#x2F;.git&#x2F;hooks&#x2F;&lt;&#x2F;code&gt;:&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;pre data-lang=&quot;bash&quot; style=&quot;background-color:#282a36;color:#f8f8f2;&quot; class=&quot;language-bash &quot;&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span style=&quot;color:#6272a4;&quot;&gt;#!&#x2F;bin&#x2F;bash
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#6272a4;&quot;&gt;# set up variables
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffffff;&quot;&gt;REPO_PATH&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ff79c6;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span style=&quot;color:#f1fa8c;&quot;&gt;$&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffffff;&quot;&gt;HOME&lt;&#x2F;span&gt;&lt;span style=&quot;color:#f1fa8c;&quot;&gt;&#x2F;git&#x2F;site
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffffff;&quot;&gt;PUBLIC_WWW&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ff79c6;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span style=&quot;color:#f1fa8c;&quot;&gt;&#x2F;home&#x2F;public
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#6272a4;&quot;&gt;# build the site, putting it in the PUBLIC_WWW directory
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#50fa7b;&quot;&gt;jekyll&lt;&#x2F;span&gt;&lt;span&gt; build&lt;&#x2F;span&gt;&lt;span style=&quot;font-style:italic;color:#ffb86c;&quot;&gt; --source &lt;&#x2F;span&gt;&lt;span&gt;$&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffffff;&quot;&gt;REPO_PATH&lt;&#x2F;span&gt;&lt;span style=&quot;font-style:italic;color:#ffb86c;&quot;&gt; --destination &lt;&#x2F;span&gt;&lt;span&gt;$&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffffff;&quot;&gt;PUBLIC_WWW
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#8be9fd;&quot;&gt;exit
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;ul&gt;
&lt;li&gt;Make the script executable:&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;pre data-lang=&quot;bash&quot; style=&quot;background-color:#282a36;color:#f8f8f2;&quot; class=&quot;language-bash &quot;&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span style=&quot;color:#50fa7b;&quot;&gt;$&lt;&#x2F;span&gt;&lt;span&gt; chmod ug+x &#x2F;home&#x2F;private&#x2F;git&#x2F;site&#x2F;.git&#x2F;hooks&#x2F;post-receive
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;This script will then run every time the server&#x27;s repository is updated via &lt;code&gt;git push&lt;&#x2F;code&gt;, building the site directly into the &lt;code&gt;&#x2F;home&#x2F;public&lt;&#x2F;code&gt; directory. No need to build the site locally and &lt;code&gt;rsync&lt;&#x2F;code&gt; to the server!&lt;&#x2F;p&gt;
</content>
    </entry>
    <entry xml:lang="en">
        <title>Building a Bus Pirate</title>
        <published>2017-04-17T00:00:00+00:00</published>
        <updated>2017-04-17T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Zak
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://www.mitsake.net/posts/building-a-bus-pirate/"/>
        <id>https://www.mitsake.net/posts/building-a-bus-pirate/</id>
        <content type="html" xml:base="https://www.mitsake.net/posts/building-a-bus-pirate/">&lt;p&gt;Back at the end of January, I entered one of the &lt;a href=&quot;http:&#x2F;&#x2F;dangerousprototypes.com&#x2F;&quot;&gt;Dangerous Prototypes&lt;&#x2F;a&gt; free PCB giveaways, and was lucky enough to win a code. I&#x27;ve thought about getting a &lt;a href=&quot;http:&#x2F;&#x2F;dangerousprototypes.com&#x2F;docs&#x2F;Bus_Pirate&quot;&gt;Bus Pirate&lt;&#x2F;a&gt; for flashing microcontrollers etc., and building one seemed like a good project that would net me something useful at the end. So, here&#x27;s the two-month-long saga of how I ended up with two Bus Pirates.&lt;&#x2F;p&gt;
&lt;p&gt;Obviously, the PCB needed components so while I was waiting for it to arrive from China, I put in an order with &lt;a href=&quot;https:&#x2F;&#x2F;www.digikey.com.au&#x2F;&quot;&gt;Digikey&lt;&#x2F;a&gt; for the parts along with a few extras to get to the AU$60 free shipping point. This took far longer than I thought - while I&#x27;ve ordered components before, this was a bit more of a learning experience. For example, I knew that the same part often comes in different packages, but I didn&#x27;t know that there are often multiple variations of the same package. I also found out that ceramic capacitors have a huge number of possible dielectrics which all have different tolerances over different temperature ranges.&lt;&#x2F;p&gt;
&lt;p&gt;Once the board arrived, I got to soldering. This was the first time I&#x27;d done &lt;a href=&quot;https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Surface-mount_technology#Rectangular_passive_components&quot;&gt;0603&lt;&#x2F;a&gt; (1.6 × 0.8 mm metric) and &lt;a href=&quot;https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Small_Outline_Integrated_Circuit#SSOP&quot;&gt;SSOP&lt;&#x2F;a&gt; packages, but with a lot of flux and some desoldering braid things went ok. Well, until I tried the surface-mount micro-USB connector. The first connector was the victim of too much solder, as it flowed into the socket and made it almost impossible for the jack to get in. After getting some replacement sockets, I tried again, but another failed attempts ended with me destroying the footprint:&lt;&#x2F;p&gt;
&lt;p&gt;&lt;img src=&quot;&#x2F;images&#x2F;buspirate&#x2F;1-mangledbp.jpg&quot;
     alt=&quot;Bus Pirate with damaged USB pads&quot;
     width=&quot;600&quot;
     height=&quot;435&quot;
     class=&quot;centre&quot;&#x2F;&gt;&lt;&#x2F;p&gt;
&lt;p&gt;It was around this time that I decided to see if it was worth salvaging the damaged board, given all of the &#x27;work&#x27; I&#x27;d done on the USB connector. Getting the firmware onto the PIC microcontroller that&#x27;s at the heart of the Bus Pirate requires a programmer, but having only done a little bit of work with AVR chips before, I don&#x27;t have a PICkit and didn&#x27;t want to buy one just for this project. Before ordering the parts, I&#x27;d seen a solution on the &lt;a href=&quot;http:&#x2F;&#x2F;dangerousprototypes.com&#x2F;forum&#x2F;viewtopic.php?f=28&amp;amp;t=3093#p32734&quot;&gt;Dangerous Prototypes forums&lt;&#x2F;a&gt; that used an ATmega and some Windows software (which was later &lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;weblinux&#x2F;ApProg&quot;&gt;updated&lt;&#x2F;a&gt;), but couldn&#x27;t get it to talk to the ATmega. Given may failure to solder the USB jack and flash the firmware, I mentally scrapped the project and bought a Bus Pirate v3.6 from a Polish seller on eBay.&lt;&#x2F;p&gt;
&lt;p&gt;The story should probably have stopped here - after all, I had a working Bus Pirate now - but of course, I couldn&#x27;t resist trying to flash the Bus Pirate I&#x27;d been building, just to see if it worked. This was super-simple, as I just hooked up the two Pirates together and used &lt;a href=&quot;http:&#x2F;&#x2F;dangerousprototypes.com&#x2F;docs&#x2F;Pirate_PIC_Programmer&quot;&gt;picprog&lt;&#x2F;a&gt; to flash the combined bootloader&#x2F;flash image. Since this went perfectly, it seemed a good bet that everything apart from the USB connection was working, so I set about trying to repair this. For my first attempt I tried scraping off the soldermask and attaching thin copper wire to the &#x27;new&#x27; pads, but this left em with the same problem I&#x27;d had with the USB socket. However, in trying this I did (finally!) realise that the socket wasn&#x27;t really necessary since its purpose was to provide a connection to the computer. Drawing from the massive supply of A-to-B cables I had lying around, I soon had a donor cable ready to go, and after carefully scraping away more soldermask was able to attach the wires to the PCB.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;img src=&quot;&#x2F;images&#x2F;buspirate&#x2F;2-fixedbp.jpg&quot;
     alt=&quot;USB socket repaired by soldering a cable to the footprint&quot;
     width=&quot;600&quot;
     height=&quot;300&quot;
     class=&quot;centre&quot;&#x2F;&gt;&lt;&#x2F;p&gt;
&lt;p&gt;Despite all of the abuse I dished out and the less-than-perfect soldering job, the LEDs lit up and when I connected to it, the self-test passed. The next step was to add insulation and strain relief using some &lt;a href=&quot;https:&#x2F;&#x2F;sugru.com&#x2F;&quot;&gt;Sugru&lt;&#x2F;a&gt; that I&#x27;d had in the fridge for a few years. I didn&#x27;t think it&#x27;d still be any good, but it moulded well and cured properly, making a strong connection for the cable and a neat way to lift it a bit off the desk.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;img src=&quot;&#x2F;images&#x2F;buspirate&#x2F;3-finishedbp.jpg&quot;
     alt=&quot;Completed build with Sugru used for strain relief and &#x27;legs&#x27;&quot;
     width=&quot;600&quot;
     height=&quot;300&quot;
     class=&quot;centre&quot;&#x2F;&gt;&lt;&#x2F;p&gt;
&lt;p&gt;So now the only thing I have to work out is what on Earth I can use two Bus Pirates for.&lt;&#x2F;p&gt;
</content>
    </entry>
    <entry xml:lang="en">
        <title>Using Python to read weather forecast data</title>
        <published>2016-04-15T00:00:00+00:00</published>
        <updated>2016-04-15T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Zak
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://www.mitsake.net/posts/python-forecast-data/"/>
        <id>https://www.mitsake.net/posts/python-forecast-data/</id>
        <content type="html" xml:base="https://www.mitsake.net/posts/python-forecast-data/">&lt;p&gt;When the &lt;a href=&quot;https:&#x2F;&#x2F;www.raspberrypi.org&#x2F;products&#x2F;pi-zero&#x2F;&quot;&gt;Raspberry Pi Zero&lt;&#x2F;a&gt; came out last year, my love of small computers meant that I quickly purchased one along with a &lt;a href=&quot;https:&#x2F;&#x2F;shop.pimoroni.com&#x2F;products&#x2F;scroll-phat&#x2F;&quot;&gt;Scroll pHAT&lt;&#x2F;a&gt; despite not having a project in mind. Recently, I realised that the small size and low power requirements meant that it&#x27;d be great for displaying the day&#x27;s weather forecast.&lt;&#x2F;p&gt;
&lt;p&gt;The first task was getting the forecast data. For most countries the most accurate information is likely to come from government-funded weather services, which meant that my choice was the &lt;a href=&quot;http:&#x2F;&#x2F;www.bom.gov.au&#x2F;&quot;&gt;Bureau of Meteorology&lt;&#x2F;a&gt;. Their &lt;a href=&quot;http:&#x2F;&#x2F;www.bom.gov.au&#x2F;catalogue&#x2F;data-feeds.shtml&quot;&gt;Weather Data Services&lt;&#x2F;a&gt; page shows the huge amount of data they have available, but since my display was a 5 x 11 LED matrix and I&#x27;m in a capital city, the &#x27;précis&#x27; forecasts seemed like a good fit. If you&#x27;re elsewhere in Australia, the BoM has &lt;a href=&quot;http:&#x2F;&#x2F;www.bom.gov.au&#x2F;info&#x2F;precis_forecasts.shtml&quot;&gt;7-day forecasts&lt;&#x2F;a&gt; available in XML format. Since the &lt;a href=&quot;ftp:&#x2F;&#x2F;ftp2.bom.gov.au&#x2F;anon&#x2F;gen&#x2F;fwo&#x2F;IDA00100.dat&quot;&gt;data&lt;&#x2F;a&gt; I&#x27;d picked was in plain text format, it was pretty easy to write a script to process it:&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;python&quot; style=&quot;background-color:#282a36;color:#f8f8f2;&quot; class=&quot;language-python &quot;&gt;&lt;code class=&quot;language-python&quot; data-lang=&quot;python&quot;&gt;&lt;span style=&quot;color:#6272a4;&quot;&gt;#! &#x2F;usr&#x2F;bin&#x2F;env python
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ff79c6;&quot;&gt;from &lt;&#x2F;span&gt;&lt;span&gt;ftplib &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ff79c6;&quot;&gt;import &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffffff;&quot;&gt;FTP
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ff79c6;&quot;&gt;from &lt;&#x2F;span&gt;&lt;span&gt;datetime &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ff79c6;&quot;&gt;import &lt;&#x2F;span&gt;&lt;span&gt;datetime
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#6272a4;&quot;&gt;# Create a list for the forecast, and a simple function that appends lines to that list.
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;forecast &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ff79c6;&quot;&gt;= &lt;&#x2F;span&gt;&lt;span&gt;[]
&lt;&#x2F;span&gt;&lt;span style=&quot;font-style:italic;color:#ff79c6;&quot;&gt;def &lt;&#x2F;span&gt;&lt;span style=&quot;color:#50fa7b;&quot;&gt;add_lines&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;font-style:italic;color:#ffb86c;&quot;&gt;next_line&lt;&#x2F;span&gt;&lt;span&gt;):
&lt;&#x2F;span&gt;&lt;span&gt;    forecast&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ff79c6;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color:#50fa7b;&quot;&gt;append&lt;&#x2F;span&gt;&lt;span&gt;(next_line)
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;ftp &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ff79c6;&quot;&gt;= &lt;&#x2F;span&gt;&lt;span style=&quot;color:#50fa7b;&quot;&gt;FTP&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color:#f1fa8c;&quot;&gt;&amp;#39;ftp2.bom.gov.au&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;)    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#6272a4;&quot;&gt;# Create FTP object
&lt;&#x2F;span&gt;&lt;span&gt;ftp&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ff79c6;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color:#50fa7b;&quot;&gt;login&lt;&#x2F;span&gt;&lt;span&gt;() &lt;&#x2F;span&gt;&lt;span style=&quot;color:#6272a4;&quot;&gt;# Log in (anonymously) to the FTP server
&lt;&#x2F;span&gt;&lt;span&gt;line &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ff79c6;&quot;&gt;= &lt;&#x2F;span&gt;&lt;span&gt;ftp&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ff79c6;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color:#50fa7b;&quot;&gt;retrlines&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color:#f1fa8c;&quot;&gt;&amp;quot;RETR anon&#x2F;gen&#x2F;fwo&#x2F;IDA00100.dat&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;, &lt;&#x2F;span&gt;&lt;span style=&quot;font-style:italic;color:#ffb86c;&quot;&gt;callback &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ff79c6;&quot;&gt;= &lt;&#x2F;span&gt;&lt;span&gt;add_lines) &lt;&#x2F;span&gt;&lt;span style=&quot;color:#6272a4;&quot;&gt;# Read each line of the file using the add_lines function
&lt;&#x2F;span&gt;&lt;span&gt;ftp&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ff79c6;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color:#50fa7b;&quot;&gt;quit&lt;&#x2F;span&gt;&lt;span&gt;()  &lt;&#x2F;span&gt;&lt;span style=&quot;color:#6272a4;&quot;&gt;# Quit the server
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#6272a4;&quot;&gt;# Change the number in the square brackets below to choose the capital city:
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#6272a4;&quot;&gt;# 1 = Sydney    2 = Melbourne   3 = Brisbane    4 = Perth
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#6272a4;&quot;&gt;# 5 = Hobart    6 = Canberra    7 = Darwin
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;forecast &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ff79c6;&quot;&gt;= &lt;&#x2F;span&gt;&lt;span&gt;forecast[&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bd93f9;&quot;&gt;4&lt;&#x2F;span&gt;&lt;span&gt;]&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ff79c6;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color:#50fa7b;&quot;&gt;split&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color:#f1fa8c;&quot;&gt;&amp;#39;#&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;)   &lt;&#x2F;span&gt;&lt;span style=&quot;color:#6272a4;&quot;&gt;# Isolate the line containing the city, and split it into fields.
&lt;&#x2F;span&gt;&lt;span&gt;forecastdate &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ff79c6;&quot;&gt;= &lt;&#x2F;span&gt;&lt;span&gt;datetime&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ff79c6;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color:#50fa7b;&quot;&gt;strptime&lt;&#x2F;span&gt;&lt;span&gt;(forecast[&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bd93f9;&quot;&gt;5&lt;&#x2F;span&gt;&lt;span&gt;], &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f1fa8c;&quot;&gt;&amp;#39;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bd93f9;&quot;&gt;%Y%m%d%H%M%S&lt;&#x2F;span&gt;&lt;span style=&quot;color:#f1fa8c;&quot;&gt;&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ff79c6;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color:#50fa7b;&quot;&gt;strftime&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color:#f1fa8c;&quot;&gt;&amp;#39;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bd93f9;&quot;&gt;%d %b&lt;&#x2F;span&gt;&lt;span style=&quot;color:#f1fa8c;&quot;&gt;&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;) &lt;&#x2F;span&gt;&lt;span style=&quot;color:#6272a4;&quot;&gt;# Convert 14-digit date&#x2F;time to date&#x2F;month string.
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;To display the forecast on the pHAT, I used code from one of the &lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;pimoroni&#x2F;scroll-phat&#x2F;blob&#x2F;master&#x2F;examples&#x2F;simple-text-scroll-rotated.py&quot;&gt;examples&lt;&#x2F;a&gt; in the &lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;pimoroni&#x2F;scroll-phat&#x2F;&quot;&gt;GitHub library&lt;&#x2F;a&gt;, and added it to the end of the script:&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;python&quot; style=&quot;background-color:#282a36;color:#f8f8f2;&quot; class=&quot;language-python &quot;&gt;&lt;code class=&quot;language-python&quot; data-lang=&quot;python&quot;&gt;&lt;span style=&quot;color:#6272a4;&quot;&gt;# Additional libraries needed for the pHAT
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ff79c6;&quot;&gt;import &lt;&#x2F;span&gt;&lt;span&gt;sys
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ff79c6;&quot;&gt;import &lt;&#x2F;span&gt;&lt;span&gt;scrollphat
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ff79c6;&quot;&gt;import &lt;&#x2F;span&gt;&lt;span&gt;time
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;scrollphat&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ff79c6;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color:#50fa7b;&quot;&gt;set_brightness&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bd93f9;&quot;&gt;5&lt;&#x2F;span&gt;&lt;span&gt;)    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#6272a4;&quot;&gt;# Chosen by die roll
&lt;&#x2F;span&gt;&lt;span&gt;scrollphat&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ff79c6;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color:#50fa7b;&quot;&gt;set_rotate&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bd93f9;&quot;&gt;True&lt;&#x2F;span&gt;&lt;span&gt;) &lt;&#x2F;span&gt;&lt;span style=&quot;color:#6272a4;&quot;&gt;# My Pi Zero sits upside down (ports facing up)
&lt;&#x2F;span&gt;&lt;span&gt;scrollphat&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ff79c6;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color:#50fa7b;&quot;&gt;write_string&lt;&#x2F;span&gt;&lt;span&gt;(forecastdate &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ff79c6;&quot;&gt;+ &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f1fa8c;&quot;&gt;&amp;quot;: &amp;quot; &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ff79c6;&quot;&gt;+ &lt;&#x2F;span&gt;&lt;span&gt;forecast[&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bd93f9;&quot;&gt;6&lt;&#x2F;span&gt;&lt;span&gt;] &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ff79c6;&quot;&gt;+ &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f1fa8c;&quot;&gt;&amp;quot;. &amp;quot; &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ff79c6;&quot;&gt;+ &lt;&#x2F;span&gt;&lt;span&gt;forecast[&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bd93f9;&quot;&gt;7&lt;&#x2F;span&gt;&lt;span&gt;] &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ff79c6;&quot;&gt;+ &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f1fa8c;&quot;&gt;&amp;quot;    &amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;)    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#6272a4;&quot;&gt;# Write forecast string to the pHAT
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ff79c6;&quot;&gt;while &lt;&#x2F;span&gt;&lt;span style=&quot;color:#bd93f9;&quot;&gt;True&lt;&#x2F;span&gt;&lt;span&gt;:
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ff79c6;&quot;&gt;try&lt;&#x2F;span&gt;&lt;span&gt;:
&lt;&#x2F;span&gt;&lt;span&gt;        scrollphat&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ff79c6;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color:#50fa7b;&quot;&gt;scroll&lt;&#x2F;span&gt;&lt;span&gt;() &lt;&#x2F;span&gt;&lt;span style=&quot;color:#6272a4;&quot;&gt;# Scroll 1 pixel every 0.1 s
&lt;&#x2F;span&gt;&lt;span&gt;        time&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ff79c6;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color:#50fa7b;&quot;&gt;sleep&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bd93f9;&quot;&gt;0.1&lt;&#x2F;span&gt;&lt;span&gt;)
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ff79c6;&quot;&gt;except &lt;&#x2F;span&gt;&lt;span style=&quot;font-style:italic;color:#66d9ef;&quot;&gt;KeyboardInterrupt&lt;&#x2F;span&gt;&lt;span&gt;:   &lt;&#x2F;span&gt;&lt;span style=&quot;color:#6272a4;&quot;&gt;# Clear the screen if CTRL+C is pressed
&lt;&#x2F;span&gt;&lt;span&gt;        scrollphat&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ff79c6;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color:#50fa7b;&quot;&gt;clear&lt;&#x2F;span&gt;&lt;span&gt;()
&lt;&#x2F;span&gt;&lt;span&gt;        sys&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ff79c6;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color:#50fa7b;&quot;&gt;exit&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ff79c6;&quot;&gt;-&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bd93f9;&quot;&gt;1&lt;&#x2F;span&gt;&lt;span&gt;)
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;I think a diffuser in front of the LEDs would aid readability, but currently it looks like this when in action (you can click on the image for an animated GIF of today&#x27;s forecast):&lt;&#x2F;p&gt;
&lt;p&gt;&lt;a href=&quot;&#x2F;images&#x2F;scrollphat.gif&quot;&gt;&lt;img src=&quot;&#x2F;images&#x2F;scrollphat.jpg&quot;
     alt=&quot;Scroll pHAT displaying weather forecast&quot;
     width=&quot;640&quot;
     height=&quot;400&quot;
     class=&quot;centre&quot;&#x2F;&gt;&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;p&gt;Although the script works, having to login to the Pi to run and quit the script means it&#x27;s not likely to get used much as it&#x27;s probably easier just to go to the BoM website. This should be fairly easy to alter as the pHAT communicates with the Pi over I2C, meaning there are plenty of GPIO pins left to add a button. This would make it much more practical as you could push the button and have the script start, scroll the forecast a few times, and then turn the LEDs off. It seems like a simple improvement, though the main obstacle is likely to be accessing the spare GPIO pins on the Pi, as the female header on the Scroll pHAT occupies all of them. I think this addition will be a desoldering&#x2F;rewiring task for some future free time.&lt;&#x2F;p&gt;
</content>
    </entry>
    <entry xml:lang="en">
        <title>Dynamic DNS using the NearlyFreeSpeech.NET API (take two)</title>
        <published>2016-04-13T00:00:00+00:00</published>
        <updated>2021-12-30T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Zak
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://www.mitsake.net/posts/nfsn-and-ddns-take-2/"/>
        <id>https://www.mitsake.net/posts/nfsn-and-ddns-take-2/</id>
        <content type="html" xml:base="https://www.mitsake.net/posts/nfsn-and-ddns-take-2/">&lt;p&gt;A few years ago, I &lt;a href=&quot;https:&#x2F;&#x2F;www.mitsake.net&#x2F;posts&#x2F;ddns-with-nfs-net-and-python&#x2F;&quot;&gt;hacked together&lt;&#x2F;a&gt; a way to updating my DNS record when my home IP changed. The script I wrote has generally been working ok, though recently I started seeing a few more errors than usual. Rather than debug them, I decided to rewrite the script using the more up-to-date &lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;ktdreyer&#x2F;python-nfsn&#x2F;&quot;&gt;python-nfsn&lt;&#x2F;a&gt; and &lt;a href=&quot;http:&#x2F;&#x2F;docs.python-requests.org&#x2F;en&#x2F;master&#x2F;&quot;&gt;Requests&lt;&#x2F;a&gt; libraries.&lt;&#x2F;p&gt;
&lt;p&gt;Both libraries are available via pip, so getting them is super-easy:&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;bash&quot; style=&quot;background-color:#282a36;color:#f8f8f2;&quot; class=&quot;language-bash &quot;&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span style=&quot;color:#50fa7b;&quot;&gt;pip&lt;&#x2F;span&gt;&lt;span&gt; install python-nfsn requests &lt;&#x2F;span&gt;&lt;span style=&quot;color:#6272a4;&quot;&gt;# sudo was required for my particular setup
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;The two new libraries make the script a bit easier to read, particularly the line that gets the current external IP. I&#x27;ve switched to using &lt;a href=&quot;https:&#x2F;&#x2F;www.ipify.org&#x2F;&quot;&gt;ipify&lt;&#x2F;a&gt; to do this, which means a regular expression isn&#x27;t needed anymore.&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;python&quot; style=&quot;background-color:#282a36;color:#f8f8f2;&quot; class=&quot;language-python &quot;&gt;&lt;code class=&quot;language-python&quot; data-lang=&quot;python&quot;&gt;&lt;span style=&quot;color:#6272a4;&quot;&gt;#!&#x2F;usr&#x2F;bin&#x2F;env python
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ff79c6;&quot;&gt;from &lt;&#x2F;span&gt;&lt;span&gt;nfsn &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ff79c6;&quot;&gt;import &lt;&#x2F;span&gt;&lt;span&gt;Nfsn
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ff79c6;&quot;&gt;import &lt;&#x2F;span&gt;&lt;span&gt;requests
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ff79c6;&quot;&gt;from &lt;&#x2F;span&gt;&lt;span&gt;time &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ff79c6;&quot;&gt;import &lt;&#x2F;span&gt;&lt;span&gt;strftime, localtime
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;user &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ff79c6;&quot;&gt;= &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f1fa8c;&quot;&gt;&amp;quot;user&amp;quot; &lt;&#x2F;span&gt;&lt;span style=&quot;color:#6272a4;&quot;&gt;# Your NFSN username (not the one used to ssh into your site)
&lt;&#x2F;span&gt;&lt;span&gt;key &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ff79c6;&quot;&gt;= &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f1fa8c;&quot;&gt;&amp;quot;api_key&amp;quot; &lt;&#x2F;span&gt;&lt;span style=&quot;color:#6272a4;&quot;&gt;# API key (generate one from the Profile tab in the NFSN member interface: click &amp;quot;Actions&amp;quot;, then &amp;quot;Manage API Key&amp;quot;)
&lt;&#x2F;span&gt;&lt;span&gt;domain &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ff79c6;&quot;&gt;= &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f1fa8c;&quot;&gt;&amp;quot;example.com&amp;quot; &lt;&#x2F;span&gt;&lt;span style=&quot;color:#6272a4;&quot;&gt;# Your NFS-hosted domain
&lt;&#x2F;span&gt;&lt;span&gt;subdomain &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ff79c6;&quot;&gt;= &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f1fa8c;&quot;&gt;&amp;quot;subdomain&amp;quot; &lt;&#x2F;span&gt;&lt;span style=&quot;color:#6272a4;&quot;&gt;# The subdomain you&amp;#39;re setting up for dynamic DNS
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;nfsn &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ff79c6;&quot;&gt;= &lt;&#x2F;span&gt;&lt;span style=&quot;color:#50fa7b;&quot;&gt;Nfsn&lt;&#x2F;span&gt;&lt;span&gt;(user, key)  &lt;&#x2F;span&gt;&lt;span style=&quot;color:#6272a4;&quot;&gt;# Create the NFSN API object
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;currentip &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ff79c6;&quot;&gt;= &lt;&#x2F;span&gt;&lt;span&gt;requests&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ff79c6;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color:#50fa7b;&quot;&gt;get&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color:#f1fa8c;&quot;&gt;&amp;#39;http:&#x2F;&#x2F;api.ipify.org&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ff79c6;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span&gt;text
&lt;&#x2F;span&gt;&lt;span&gt;listedip &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ff79c6;&quot;&gt;= &lt;&#x2F;span&gt;&lt;span&gt;nfsn&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ff79c6;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color:#50fa7b;&quot;&gt;dns&lt;&#x2F;span&gt;&lt;span&gt;(domain)&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ff79c6;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color:#50fa7b;&quot;&gt;listRRs&lt;&#x2F;span&gt;&lt;span&gt;(subdomain)[&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bd93f9;&quot;&gt;0&lt;&#x2F;span&gt;&lt;span&gt;][&lt;&#x2F;span&gt;&lt;span style=&quot;color:#f1fa8c;&quot;&gt;&amp;#39;data&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;]
&lt;&#x2F;span&gt;&lt;span&gt;logtime &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ff79c6;&quot;&gt;= &lt;&#x2F;span&gt;&lt;span style=&quot;color:#50fa7b;&quot;&gt;strftime&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color:#f1fa8c;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bd93f9;&quot;&gt;%Y&lt;&#x2F;span&gt;&lt;span style=&quot;color:#f1fa8c;&quot;&gt;-&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bd93f9;&quot;&gt;%m&lt;&#x2F;span&gt;&lt;span style=&quot;color:#f1fa8c;&quot;&gt;-&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bd93f9;&quot;&gt;%d %H%M&lt;&#x2F;span&gt;&lt;span style=&quot;color:#f1fa8c;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;, &lt;&#x2F;span&gt;&lt;span style=&quot;color:#50fa7b;&quot;&gt;localtime&lt;&#x2F;span&gt;&lt;span&gt;())
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ff79c6;&quot;&gt;if &lt;&#x2F;span&gt;&lt;span&gt;currentip &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ff79c6;&quot;&gt;!= &lt;&#x2F;span&gt;&lt;span&gt;listedip:   &lt;&#x2F;span&gt;&lt;span style=&quot;color:#6272a4;&quot;&gt;# Check to see if we need to update the record; if so:
&lt;&#x2F;span&gt;&lt;span&gt;    nfsn&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ff79c6;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color:#50fa7b;&quot;&gt;dns&lt;&#x2F;span&gt;&lt;span&gt;(domain)&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ff79c6;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color:#50fa7b;&quot;&gt;removeRR&lt;&#x2F;span&gt;&lt;span&gt;(subdomain, &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f1fa8c;&quot;&gt;&amp;#39;A&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;, listedip) &lt;&#x2F;span&gt;&lt;span style=&quot;color:#6272a4;&quot;&gt;# a) remove the old entry,
&lt;&#x2F;span&gt;&lt;span&gt;    nfsn&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ff79c6;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color:#50fa7b;&quot;&gt;dns&lt;&#x2F;span&gt;&lt;span&gt;(domain)&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ff79c6;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color:#50fa7b;&quot;&gt;addRR&lt;&#x2F;span&gt;&lt;span&gt;(subdomain, &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f1fa8c;&quot;&gt;&amp;#39;A&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;, currentip)   &lt;&#x2F;span&gt;&lt;span style=&quot;color:#6272a4;&quot;&gt;# b) add a new entry with the new IP
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#8be9fd;&quot;&gt;print &lt;&#x2F;span&gt;&lt;span&gt;(logtime &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ff79c6;&quot;&gt;+ &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f1fa8c;&quot;&gt;&amp;quot; DNS record updated from &amp;quot; &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ff79c6;&quot;&gt;+ &lt;&#x2F;span&gt;&lt;span&gt;listedip &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ff79c6;&quot;&gt;+ &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f1fa8c;&quot;&gt;&amp;quot; to &amp;quot; &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ff79c6;&quot;&gt;+ &lt;&#x2F;span&gt;&lt;span&gt;currentip)
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ff79c6;&quot;&gt;else&lt;&#x2F;span&gt;&lt;span&gt;:
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#8be9fd;&quot;&gt;print &lt;&#x2F;span&gt;&lt;span&gt;(logtime &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ff79c6;&quot;&gt;+ &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f1fa8c;&quot;&gt;&amp;quot; No update required.&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;)
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;After making the script executable and setting it to run every few hours using cron, the script seems to be running well - hopefully it works for someone else out there too.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;em&gt;Update (30 December 2021): A support request is no longer required for generating an NFSN API key. Thanks to Lewis from &lt;a href=&quot;https:&#x2F;&#x2F;www.penwatch.net&#x2F;&quot;&gt;penwatch.net&lt;&#x2F;a&gt; for emailing to let me know.&lt;&#x2F;em&gt;&lt;&#x2F;p&gt;
</content>
    </entry>
    <entry xml:lang="en">
        <title>Exploring sampling error</title>
        <published>2015-11-20T00:00:00+00:00</published>
        <updated>2015-11-20T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Zak
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://www.mitsake.net/posts/sampling-error/"/>
        <id>https://www.mitsake.net/posts/sampling-error/</id>
        <content type="html" xml:base="https://www.mitsake.net/posts/sampling-error/">&lt;p&gt;I&#x27;ve been teaching for nearly a full year now, and to say it&#x27;s been a massive learning curve would be just a &lt;em&gt;bit&lt;&#x2F;em&gt; of an understatement. As is probably pretty normal for a graduate, some of my ideas have worked well, some have been ok and others have fallen completely flat. I figured I might share one of the ideas that worked well, particularly since it took two attempts to get it working.&lt;&#x2F;p&gt;
&lt;p&gt;Since my Year 11 class is into the last section of Unit 2 of the new curriculum, we&#x27;ve been studying mechanical waves. A simple experiment is to measure the speed of sound in air, since it doesn&#x27;t need much equipment or space. In years past the standard was to use a starting pistol as they produce a nice puff of smoke to use as the cue to start timing. Since we didn&#x27;t have a starting pistol (they&#x27;ve been banned for a few years for safety reasons), my first attempt involved exaggerated clapping motions. Coupled with rain, student enthusiasm for this experiment hit a new low and we abandoned the attempt with pretty much nothing gained.&lt;&#x2F;p&gt;
&lt;p&gt;A couple of weeks later, I gave the experiment another shot, this time with the school&#x27;s starting pistol replacement - two pieces of wood, hinged at one end to make a clapper. Combining this with the lab technician&#x27;s trick of using talcum powder on one of the pieces of wood to give a visual cue to replace the smoke gave us a much better starting point for the experiment. I had five students take stopwatches to the end of the 100 m track, and they all attempted to record the time between seeing the powder and hearing the sound. After a few trials, students suggested we try a larger distance to improve accuracy; unfortunately we only managed 111 m thanks to the school&#x27;s small oval. Once all was said and done we had 42 measurements.&lt;&#x2F;p&gt;
&lt;p&gt;We ended up getting an average of 348 ms&lt;sup&gt;-1&lt;&#x2F;sup&gt;, which is very close to the theoretical value of 343 ms&lt;sup&gt;-1&lt;&#x2F;sup&gt; (based on the day&#x27;s temperature from the &lt;a href=&quot;http:&#x2F;&#x2F;www.bom.gov.au&#x2F;&quot; title=&quot;Bureau of Meteorology&quot;&gt;Bureau of Meteorology&lt;&#x2F;a&gt;). The best part of the experiment for me though, was showing the students just how close we got to the calculated value using stopwatches and human reflexes. Despite the big range in speeds (from 119 ms&lt;sup&gt;-1&lt;&#x2F;sup&gt; to 667 ms&lt;sup&gt;-1&lt;&#x2F;sup&gt;), the number of measurements we took overcame the significant sampling error.&lt;&#x2F;p&gt;
&lt;p&gt;The main reason I liked this end result is because it shows the students something they&#x27;ve learned by rote since primary school: repeating experiments makes them more reliable. Although most students know this enough to repeat it - frequently - in assessments, it&#x27;s actually pretty rare to have an experiment that shows this in action. Most motion experiments, for example, vary from predicted values simply because high school physics doesn&#x27;t take into account significant factors such as friction and air resistance. Compared to these issues, measurement error is usually pretty small. Having a simple experiment where students can compare their results with a theoretical value and not have to account for a significant difference between them is, I think, a great teaching tool.&lt;&#x2F;p&gt;
&lt;p&gt;In case you&#x27;re interested in taking a look at the actual results and&#x2F;or using them for your own class, they can be downloaded as a &lt;a href=&quot;&#x2F;assets&#x2F;vsounddata.csv&quot; title=&quot;Download the data file&quot;&gt;CSV file&lt;&#x2F;a&gt;. It&#x27;s only the time and distance data, but could perhaps work well as an investigation where students need to process and interpret secondhand data.&lt;&#x2F;p&gt;
</content>
    </entry>
    <entry xml:lang="en">
        <title>Replacing Google Reader</title>
        <published>2014-11-08T00:00:00+00:00</published>
        <updated>2014-11-08T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Zak
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://www.mitsake.net/posts/replacing-google-reader/"/>
        <id>https://www.mitsake.net/posts/replacing-google-reader/</id>
        <content type="html" xml:base="https://www.mitsake.net/posts/replacing-google-reader/">&lt;p&gt;For years prior to its demise last year, I used &lt;a href=&quot;http:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Google_Reader&quot;&gt;Google Reader&lt;&#x2F;a&gt; as an RSS aggregator - never really using the Reader web app itself, but instead using it to sync between my laptop (using &lt;a href=&quot;http:&#x2F;&#x2F;netnewswireapp.com&#x2F;&quot;&gt;NetNewsWire&lt;&#x2F;a&gt;) and phone (using &lt;a href=&quot;http:&#x2F;&#x2F;reederapp.com&#x2F;ios&#x2F;&quot;&gt;Reeder&lt;&#x2F;a&gt;). It was a nice system that worked well, right up until the point that it was shut down.&lt;&#x2F;p&gt;
&lt;p&gt;I&#x27;ve always intended to switch to one of the alternatives that sprang up (&lt;a href=&quot;http:&#x2F;&#x2F;theoldreader.com&#x2F;&quot;&gt;The Old Reader&lt;&#x2F;a&gt;, &lt;a href=&quot;https:&#x2F;&#x2F;feedly.com&#x2F;&quot;&gt;Feedly&lt;&#x2F;a&gt;, &lt;a href=&quot;https:&#x2F;&#x2F;www.inoreader.com&#x2F;&quot;&gt;InoReader&lt;&#x2F;a&gt; etc.), but never quite got around to it. This meant that my RSS reading was done on my laptop, which in turn meant that if I didn&#x27;t use it for a few days I&#x27;d come back to hundreds of missed articles. I could have probably avoided this with some judicious unsubscribing, but again - never quite got around to it.&lt;&#x2F;p&gt;
&lt;p&gt;I&#x27;m not sure where I first heard about it, but about a month ago I heard about &lt;a href=&quot;http:&#x2F;&#x2F;tt-rss.org&#x2F;&quot;&gt;Tiny Tiny RSS&lt;&#x2F;a&gt;, a free RSS reader that&#x27;s written in PHP. Once you&#x27;ve installed it on a web server, it&#x27;s just a matter of logging in (multiple accounts are supported) and importing your feeds. Since getting a server up and running and then installing TT-RSS was going to be vastly more complex than simply creating an account on of the many sites above, it appealed to me straight away. I originally hosted it here at &lt;a href=&quot;http:&#x2F;&#x2F;www.nearlyfreespeech.net&#x2F;&quot;&gt;NearlyFreeSpeech.NET&lt;&#x2F;a&gt;, but the performance wasn&#x27;t great (my fault, not theirs). After a day or so, I stumbled on Red Hat&#x27;s &lt;a href=&quot;https:&#x2F;&#x2F;www.openshift.com&#x2F;&quot;&gt;OpenShift&lt;&#x2F;a&gt; and decided that their free tier would be perfect for this experiment.&lt;&#x2F;p&gt;
&lt;p&gt;Originally, this post was supposed to be a container for all the tips I picked up - small things like getting the git repositories set up correctly, sorting out feed updates etc. It took a bit of wrangling, but after a little while I had a mostly working setup with just a few small issues. For example, every time the server restarted, the update daemon would also need restarting as I hadn&#x27;t yet made that automatic and because OpenShift doesn&#x27;t allow the PostgreSQL &lt;code&gt;autovacuum&lt;&#x2F;code&gt; command to run correctly, the database tended to grow pretty quickly. It was while I was working out how to fix these things that I found &lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;disconn3ct&#x2F;tiny_tiny_rss-openshift-quickstart&quot;&gt;this GitHub repository&lt;&#x2F;a&gt; which sorts out all of these little quirks. As a result, here&#x27;s a much shorter guide to setting up your own RSS reader:&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;www.openshift.com&#x2F;app&#x2F;account&#x2F;new&quot;&gt;Create an OpenShift account&lt;&#x2F;a&gt;.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;developers.openshift.com&#x2F;en&#x2F;getting-started-client-tools.html&quot;&gt;Install the OpenShift client tools&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;li&gt;Follow disconn3ct&#x27;s great &lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;disconn3ct&#x2F;tiny_tiny_rss-openshift-quickstart&quot;&gt;README&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;p&gt;Once the last step has finished you should be ready to login, create an account and start importing and&#x2F;or subscribing to feeds. Easy!&lt;&#x2F;p&gt;
</content>
    </entry>
    <entry xml:lang="en">
        <title>My top three games</title>
        <published>2014-09-06T00:00:00+00:00</published>
        <updated>2014-09-06T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Zak
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://www.mitsake.net/posts/my-top-three-games/"/>
        <id>https://www.mitsake.net/posts/my-top-three-games/</id>
        <content type="html" xml:base="https://www.mitsake.net/posts/my-top-three-games/">&lt;p&gt;A few months ago, a friend sent the following email around to a few people:&lt;&#x2F;p&gt;
&lt;blockquote&gt;
&lt;p&gt;Didn&#x27;t know it was on, but put my vote in for ABCs good game top 100 games of all time.  I challenge you to pick a better 3 than:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;X-COM: Enemy Unknown (2012)&lt;&#x2F;li&gt;
&lt;li&gt;Planescape Torment&lt;&#x2F;li&gt;
&lt;li&gt;Minecraft&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;blockquote&gt;
&lt;p&gt;This seemed to kick something off, with people offering their three favourite games along with really interesting reasons for their picks. I decided to pitch in too, so here are my top three games and the reasons I picked them.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;total-annihilation&quot;&gt;Total Annihilation&lt;&#x2F;h2&gt;
&lt;p&gt;This game defined high school for me. It did stuff that no other strategy game had ever even thought of and was so far ahead of its time that games now are only just starting to catch up. Some of the things I&#x27;m talking about:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;Choosing battle location. Want to fight in a forest? Be prepared for poor lines of sight and damage from the almost certain bushfire.&lt;&#x2F;li&gt;
&lt;li&gt;Holding higher ground. I don&#x27;t think there have been many games (SupCom and PA are the only ones I can think of) that implemented this in the same way. High ground really mattered - troops trying to take hills can&#x27;t see what&#x27;s on top before they get there and hilarity (as well as a massacre) ensued if you put walls just behind the crest.&lt;&#x2F;li&gt;
&lt;li&gt;Wreckage. The result of an average-sized battle often meant that area was completely impassable for ground troops until cleared.&lt;&#x2F;li&gt;
&lt;li&gt;Ongoing support that added features (and units!) as well as fixing bugs.&lt;&#x2F;li&gt;
&lt;li&gt;The +sing option&lt;&#x2F;li&gt;
&lt;li&gt;Amazing storyline that really set the scene and tone.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;Ok, perhaps that last one is a bit of a lie. &#x27;What started as a battle over the transfer of consciousness from flesh to machines...&#x27; is not one of the greatest lines written for computer games.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;portal&quot;&gt;Portal&lt;&#x2F;h2&gt;
&lt;p&gt;While in my opinion Portal 2 was the superior game with better visuals, sound and plot, the first game had more of an impact on me. Aside from the whole first-person puzzle aspect (which was completely amazing), Portal stands out as the point that single player games went from being &#x27;for gamers&#x27; (i.e. epic stories that required investments of hours to play) to something that everyone could consume as entertainment. The writing was engrossing, immersive, and for the first time I can remember as an adult, genuinely funny. It&#x27;s true that games often used humour before Portal but its release at a time when games were pushing for gritty realism (e.g. the Call of Duty and Battlefield series) really set it apart.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;frozen-synapse&quot;&gt;Frozen Synapse&lt;&#x2F;h2&gt;
&lt;p&gt;I was the last of my friends to pick this game up and will likely be the last to put it down, barring the possibility that when I die someone decides to host a memorial tournament. The most common phrase to describe it is &#x27;chess with guns&#x27;, but for me &#x27;brain crack&#x27; would probably be more accurate. There certainly wasn&#x27;t any game previously (and I kind of hope there isn&#x27;t one in the future) that has grabbed me in the same way FS did - I&#x27;ve played over 500 games, put in countless hours (the 140 hours logged on Steam pales in comparison to the number played off-Steam) and peaked in the top ten. There are very few things for me that come close to the feeling of priming a turn and seeing a &lt;a href=&quot;http:&#x2F;&#x2F;vimeo.com&#x2F;79306807&quot; title=&quot;The Gunfighter on Vimeo&quot;&gt;ballet of death&lt;&#x2F;a&gt; (watch the whole thing) unfold because you managed to predict your opponent&#x27;s plan so perfectly.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;honourable-mentions-yep-way-past-three&quot;&gt;Honourable mentions (yep, way past three)&lt;&#x2F;h2&gt;
&lt;ul&gt;
&lt;li&gt;Mario Kart DS: semi-regular beer and MKDS sessions are one of my fondest uni memories. The release of Mario Kart 8 had me seriously thinking about buying a Wii U just for reliving this.&lt;&#x2F;li&gt;
&lt;li&gt;League of Legends: another uni memory, with a regular group of us meeting up online and playing a few games. Had people not got real jobs, I think there&#x27;s reasonable odds we&#x27;d still be sitting down from 8:30 most nights.&lt;&#x2F;li&gt;
&lt;li&gt;TF2: because this game cemented Valve as one of my favourite games companies. It&#x27;s still being updated; not many games can boast that.&lt;&#x2F;li&gt;
&lt;li&gt;Johann Sebastian Joust: made me realise just how much fun local multiplayer is.&lt;&#x2F;li&gt;
&lt;li&gt;Spaceteam: if you haven&#x27;t played this yet, you should (and you don&#x27;t have any excuse because it&#x27;s free). Similar to Joust, it emphasises why local multiplayer is awesome.&lt;&#x2F;li&gt;
&lt;li&gt;XCOM: Enemy Unknown: I&#x27;m rubbish at completing games. I played this through to the end and would still be playing were it not for the crippling bugs that made the final mission unplayable for me.&lt;&#x2F;li&gt;
&lt;li&gt;Left 4 Dead 2: the best part about this was that it generated the same kinds of awesome stories and in-jokes that tabletop RPGs do (one friend shooting another while he was carrying the last petrol can we needed to complete the mission, simultaneously downing him and setting us all on fire).&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
</content>
    </entry>
    <entry xml:lang="en">
        <title>Playing with a NavSpark and R</title>
        <published>2014-05-26T00:00:00+00:00</published>
        <updated>2014-05-26T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Zak
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://www.mitsake.net/posts/playing-with-a-navspark-and-r/"/>
        <id>https://www.mitsake.net/posts/playing-with-a-navspark-and-r/</id>
        <content type="html" xml:base="https://www.mitsake.net/posts/playing-with-a-navspark-and-r/">&lt;p&gt;Back in January I managed to get in early on the Indiegogo &lt;a href=&quot;https:&#x2F;&#x2F;www.indiegogo.com&#x2F;projects&#x2F;navspark-arduino-compatible-with-gps-gnss-receiver&quot;&gt;campaign&lt;&#x2F;a&gt; for the NavSpark GNSS receiver. For no real reason other than the fact that it was US$17 including shipping, I decided to buy one of the NavSpark-BD boards. Besides being an Arduino-compatible board with built-in GPS, this version is also able to pick up satellites from the Chinese &lt;a href=&quot;http:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Beidou_navigation_satellite_system&quot;&gt;Beidou&lt;&#x2F;a&gt; constellation.&lt;&#x2F;p&gt;
&lt;p&gt;While the modified Arduino client isn&#x27;t available for OS X (according to the &lt;a href=&quot;http:&#x2F;&#x2F;pastebin.com&#x2F;raw.php?i=1f5iXwiT&quot;&gt;FAQ&lt;&#x2F;a&gt;, the LEON3 chip in the NavSpark doesn&#x27;t have an OS X cross-compiler available), I decided to have a look at some of the GPS data just to see what I could pick up. This &lt;a href=&quot;http:&#x2F;&#x2F;apple.stackexchange.com&#x2F;questions&#x2F;32834&#x2F;is-there-an-os-x-terminal-program-that-can-access-serial-ports&quot;&gt;StackExchange answer&lt;&#x2F;a&gt; has been really useful for connecting to serial devices over USB, and the NavSpark uses the PL2303 chip which has an &lt;a href=&quot;http:&#x2F;&#x2F;nozap.me&#x2F;driver&#x2F;osxpl2303&#x2F;index.html&quot;&gt;open-source driver&lt;&#x2F;a&gt; available for OS X.&lt;&#x2F;p&gt;
&lt;p&gt;After installing the driver, I found the NavSpark port using &lt;code&gt;ls &#x2F;dev&#x2F;tty.*&lt;&#x2F;code&gt;. Since the default baud rate is 115200, &lt;code&gt;screen &#x2F;dev&#x2F;tty.NoZAP-PL2303-000012FD 115200&lt;&#x2F;code&gt; started showing the GPS data from the Navspark in NMEA format. There are plenty of places that this format&#x27;s described, but the NavSpark &lt;a href=&quot;http:&#x2F;&#x2F;navspark.mybigcommerce.com&#x2F;resources&#x2F;&quot;&gt;resources page&lt;&#x2F;a&gt; has an easy-to-read &lt;a href=&quot;https:&#x2F;&#x2F;store-lgdi92x.mybigcommerce.com&#x2F;content&#x2F;NMEA_Format_v0.1.pdf&quot;&gt;PDF&lt;&#x2F;a&gt;. Using the lines starting with $--GSV and $--GSA, I decided to see if I could plot where the satellites were using &lt;a href=&quot;http:&#x2F;&#x2F;cran.r-project.org&#x2F;&quot;&gt;R&lt;&#x2F;a&gt;.&lt;&#x2F;p&gt;
&lt;p&gt;After the board had been running for a while I got the following lines:&lt;&#x2F;p&gt;
&lt;pre style=&quot;background-color:#282a36;color:#f8f8f2;&quot;&gt;&lt;code&gt;&lt;span&gt;$GNGSA,A,3,05,07,10,28,26,08,,,,,,,2.7,1.6,2.1*28
&lt;&#x2F;span&gt;&lt;span&gt;$GNGSA,A,3,207,,,,,,,,,,,,2.7,1.6,2.1*18
&lt;&#x2F;span&gt;&lt;span&gt;$GPGSV,4,1,13,30,72,208,33,10,70,316,19,08,70,194,35,07,51,149,30*71
&lt;&#x2F;span&gt;&lt;span&gt;$GPGSV,4,2,13,28,42,006,21,05,36,230,21,13,33,095,12,26,15,240,26*79
&lt;&#x2F;span&gt;&lt;span&gt;$GPGSV,4,3,13,02,14,289,,04,09,326,,03,07,120,,23,06,075,*70
&lt;&#x2F;span&gt;&lt;span&gt;$GPGSV,4,4,13,19,02,105,*45
&lt;&#x2F;span&gt;&lt;span&gt;$BDGSV,2,1,08,209,73,292,,207,71,222,30,210,57,265,,206,55,004,*67
&lt;&#x2F;span&gt;&lt;span&gt;$BDGSV,2,2,08,203,52,348,,201,46,040,,208,02,016,,213,00,272,27*61
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;The third number in each GSV line indicates that there were 13 GPS (GP) and 8 Beidou (BD) satellites visible - not bad considering there were three layers of concrete between the antenna and the sky when I was testing this! As I was just working with the above data, I entered the satellite elevation and azimuth data by hand this time around:&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;r&quot; style=&quot;background-color:#282a36;color:#f8f8f2;&quot; class=&quot;language-r &quot;&gt;&lt;code class=&quot;language-r&quot; data-lang=&quot;r&quot;&gt;&lt;span&gt;azimuth &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ff79c6;&quot;&gt;&amp;lt;- &lt;&#x2F;span&gt;&lt;span style=&quot;color:#8be9fd;&quot;&gt;c&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bd93f9;&quot;&gt;208&lt;&#x2F;span&gt;&lt;span&gt;, &lt;&#x2F;span&gt;&lt;span style=&quot;color:#bd93f9;&quot;&gt;316&lt;&#x2F;span&gt;&lt;span&gt;, &lt;&#x2F;span&gt;&lt;span style=&quot;color:#bd93f9;&quot;&gt;194&lt;&#x2F;span&gt;&lt;span&gt;, &lt;&#x2F;span&gt;&lt;span style=&quot;color:#bd93f9;&quot;&gt;149&lt;&#x2F;span&gt;&lt;span&gt;, &lt;&#x2F;span&gt;&lt;span style=&quot;color:#bd93f9;&quot;&gt;6&lt;&#x2F;span&gt;&lt;span&gt;, &lt;&#x2F;span&gt;&lt;span style=&quot;color:#bd93f9;&quot;&gt;230&lt;&#x2F;span&gt;&lt;span&gt;, &lt;&#x2F;span&gt;&lt;span style=&quot;color:#bd93f9;&quot;&gt;95&lt;&#x2F;span&gt;&lt;span&gt;, &lt;&#x2F;span&gt;&lt;span style=&quot;color:#bd93f9;&quot;&gt;240&lt;&#x2F;span&gt;&lt;span&gt;, &lt;&#x2F;span&gt;&lt;span style=&quot;color:#bd93f9;&quot;&gt;289&lt;&#x2F;span&gt;&lt;span&gt;, &lt;&#x2F;span&gt;&lt;span style=&quot;color:#bd93f9;&quot;&gt;326&lt;&#x2F;span&gt;&lt;span&gt;, &lt;&#x2F;span&gt;&lt;span style=&quot;color:#bd93f9;&quot;&gt;120&lt;&#x2F;span&gt;&lt;span&gt;, &lt;&#x2F;span&gt;&lt;span style=&quot;color:#bd93f9;&quot;&gt;75&lt;&#x2F;span&gt;&lt;span&gt;)
&lt;&#x2F;span&gt;&lt;span&gt;azimuth.bd &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ff79c6;&quot;&gt;&amp;lt;- &lt;&#x2F;span&gt;&lt;span style=&quot;color:#8be9fd;&quot;&gt;c&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bd93f9;&quot;&gt;292&lt;&#x2F;span&gt;&lt;span&gt;, &lt;&#x2F;span&gt;&lt;span style=&quot;color:#bd93f9;&quot;&gt;222&lt;&#x2F;span&gt;&lt;span&gt;, &lt;&#x2F;span&gt;&lt;span style=&quot;color:#bd93f9;&quot;&gt;265&lt;&#x2F;span&gt;&lt;span&gt;, &lt;&#x2F;span&gt;&lt;span style=&quot;color:#bd93f9;&quot;&gt;4&lt;&#x2F;span&gt;&lt;span&gt;, &lt;&#x2F;span&gt;&lt;span style=&quot;color:#bd93f9;&quot;&gt;348&lt;&#x2F;span&gt;&lt;span&gt;, &lt;&#x2F;span&gt;&lt;span style=&quot;color:#bd93f9;&quot;&gt;40&lt;&#x2F;span&gt;&lt;span&gt;, &lt;&#x2F;span&gt;&lt;span style=&quot;color:#bd93f9;&quot;&gt;16&lt;&#x2F;span&gt;&lt;span&gt;, &lt;&#x2F;span&gt;&lt;span style=&quot;color:#bd93f9;&quot;&gt;272&lt;&#x2F;span&gt;&lt;span&gt;)
&lt;&#x2F;span&gt;&lt;span&gt;elevation &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ff79c6;&quot;&gt;&amp;lt;- &lt;&#x2F;span&gt;&lt;span style=&quot;color:#8be9fd;&quot;&gt;c&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bd93f9;&quot;&gt;72&lt;&#x2F;span&gt;&lt;span&gt;, &lt;&#x2F;span&gt;&lt;span style=&quot;color:#bd93f9;&quot;&gt;70&lt;&#x2F;span&gt;&lt;span&gt;, &lt;&#x2F;span&gt;&lt;span style=&quot;color:#bd93f9;&quot;&gt;70&lt;&#x2F;span&gt;&lt;span&gt;, &lt;&#x2F;span&gt;&lt;span style=&quot;color:#bd93f9;&quot;&gt;51&lt;&#x2F;span&gt;&lt;span&gt;, &lt;&#x2F;span&gt;&lt;span style=&quot;color:#bd93f9;&quot;&gt;42&lt;&#x2F;span&gt;&lt;span&gt;, &lt;&#x2F;span&gt;&lt;span style=&quot;color:#bd93f9;&quot;&gt;36&lt;&#x2F;span&gt;&lt;span&gt;, &lt;&#x2F;span&gt;&lt;span style=&quot;color:#bd93f9;&quot;&gt;33&lt;&#x2F;span&gt;&lt;span&gt;, &lt;&#x2F;span&gt;&lt;span style=&quot;color:#bd93f9;&quot;&gt;15&lt;&#x2F;span&gt;&lt;span&gt;, &lt;&#x2F;span&gt;&lt;span style=&quot;color:#bd93f9;&quot;&gt;14&lt;&#x2F;span&gt;&lt;span&gt;, &lt;&#x2F;span&gt;&lt;span style=&quot;color:#bd93f9;&quot;&gt;9&lt;&#x2F;span&gt;&lt;span&gt;, &lt;&#x2F;span&gt;&lt;span style=&quot;color:#bd93f9;&quot;&gt;7&lt;&#x2F;span&gt;&lt;span&gt;, &lt;&#x2F;span&gt;&lt;span style=&quot;color:#bd93f9;&quot;&gt;6&lt;&#x2F;span&gt;&lt;span&gt;)
&lt;&#x2F;span&gt;&lt;span&gt;elevation.bd &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ff79c6;&quot;&gt;&amp;lt;- &lt;&#x2F;span&gt;&lt;span style=&quot;color:#8be9fd;&quot;&gt;c&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bd93f9;&quot;&gt;73&lt;&#x2F;span&gt;&lt;span&gt;, &lt;&#x2F;span&gt;&lt;span style=&quot;color:#bd93f9;&quot;&gt;71&lt;&#x2F;span&gt;&lt;span&gt;, &lt;&#x2F;span&gt;&lt;span style=&quot;color:#bd93f9;&quot;&gt;57&lt;&#x2F;span&gt;&lt;span&gt;, &lt;&#x2F;span&gt;&lt;span style=&quot;color:#bd93f9;&quot;&gt;55&lt;&#x2F;span&gt;&lt;span&gt;, &lt;&#x2F;span&gt;&lt;span style=&quot;color:#bd93f9;&quot;&gt;52&lt;&#x2F;span&gt;&lt;span&gt;, &lt;&#x2F;span&gt;&lt;span style=&quot;color:#bd93f9;&quot;&gt;46&lt;&#x2F;span&gt;&lt;span&gt;, &lt;&#x2F;span&gt;&lt;span style=&quot;color:#bd93f9;&quot;&gt;2&lt;&#x2F;span&gt;&lt;span&gt;, &lt;&#x2F;span&gt;&lt;span style=&quot;color:#bd93f9;&quot;&gt;0&lt;&#x2F;span&gt;&lt;span&gt;)
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;After I&#x27;d grabbed this data, I used &lt;a href=&quot;http:&#x2F;&#x2F;www.inside-r.org&#x2F;packages&#x2F;cran&#x2F;plotrix&#x2F;docs&#x2F;polar.plot&quot;&gt;polar.plot()&lt;&#x2F;a&gt; from the &lt;a href=&quot;http:&#x2F;&#x2F;cran.r-project.org&#x2F;web&#x2F;packages&#x2F;plotrix&#x2F;plotrix.pdf&quot;&gt;plotrix&lt;&#x2F;a&gt; package to visualise the position of the satellites (this satellite location data is from 2014-05-24 at 13:33:59 UTC). I made up two additional vectors (used and used.bd) that contained the numeric values corresponding to open and closed circles. Since these were entered in the order that I&#x27;d entered the azimuth and elevation data, they could be passed to the point.symbols argument to show which satellites were being used to give a fix.&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;r&quot; style=&quot;background-color:#282a36;color:#f8f8f2;&quot; class=&quot;language-r &quot;&gt;&lt;code class=&quot;language-r&quot; data-lang=&quot;r&quot;&gt;&lt;span style=&quot;color:#50fa7b;&quot;&gt;polar.plot&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bd93f9;&quot;&gt;90 &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ff79c6;&quot;&gt;-&lt;&#x2F;span&gt;&lt;span&gt; elevation, azimuth, &lt;&#x2F;span&gt;&lt;span style=&quot;font-style:italic;color:#ffb86c;&quot;&gt;rp.type &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ff79c6;&quot;&gt;= &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f1fa8c;&quot;&gt;&amp;quot;s&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;, &lt;&#x2F;span&gt;&lt;span style=&quot;font-style:italic;color:#ffb86c;&quot;&gt;radial.lim &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ff79c6;&quot;&gt;= &lt;&#x2F;span&gt;&lt;span style=&quot;color:#8be9fd;&quot;&gt;c&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bd93f9;&quot;&gt;0&lt;&#x2F;span&gt;&lt;span&gt;, &lt;&#x2F;span&gt;&lt;span style=&quot;color:#bd93f9;&quot;&gt;90&lt;&#x2F;span&gt;&lt;span&gt;, &lt;&#x2F;span&gt;&lt;span style=&quot;color:#8be9fd;&quot;&gt;seq&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bd93f9;&quot;&gt;0&lt;&#x2F;span&gt;&lt;span&gt;, &lt;&#x2F;span&gt;&lt;span style=&quot;color:#bd93f9;&quot;&gt;90&lt;&#x2F;span&gt;&lt;span&gt;, &lt;&#x2F;span&gt;&lt;span style=&quot;color:#bd93f9;&quot;&gt;15&lt;&#x2F;span&gt;&lt;span&gt;)), &lt;&#x2F;span&gt;&lt;span style=&quot;font-style:italic;color:#ffb86c;&quot;&gt;start &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ff79c6;&quot;&gt;= &lt;&#x2F;span&gt;&lt;span style=&quot;color:#bd93f9;&quot;&gt;90&lt;&#x2F;span&gt;&lt;span&gt;, &lt;&#x2F;span&gt;&lt;span style=&quot;font-style:italic;color:#ffb86c;&quot;&gt;clockwise &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ff79c6;&quot;&gt;= &lt;&#x2F;span&gt;&lt;span style=&quot;color:#bd93f9;&quot;&gt;TRUE&lt;&#x2F;span&gt;&lt;span&gt;, &lt;&#x2F;span&gt;&lt;span style=&quot;font-style:italic;color:#ffb86c;&quot;&gt;show.grid.labels &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ff79c6;&quot;&gt;= &lt;&#x2F;span&gt;&lt;span style=&quot;color:#bd93f9;&quot;&gt;FALSE&lt;&#x2F;span&gt;&lt;span&gt;, &lt;&#x2F;span&gt;&lt;span style=&quot;font-style:italic;color:#ffb86c;&quot;&gt;labels &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ff79c6;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span&gt; compass, &lt;&#x2F;span&gt;&lt;span style=&quot;font-style:italic;color:#ffb86c;&quot;&gt;label.pos &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ff79c6;&quot;&gt;= &lt;&#x2F;span&gt;&lt;span style=&quot;color:#8be9fd;&quot;&gt;seq&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bd93f9;&quot;&gt;0&lt;&#x2F;span&gt;&lt;span&gt;, &lt;&#x2F;span&gt;&lt;span style=&quot;color:#bd93f9;&quot;&gt;337.5&lt;&#x2F;span&gt;&lt;span&gt;, &lt;&#x2F;span&gt;&lt;span style=&quot;color:#bd93f9;&quot;&gt;22.5&lt;&#x2F;span&gt;&lt;span&gt;), &lt;&#x2F;span&gt;&lt;span style=&quot;font-style:italic;color:#ffb86c;&quot;&gt;point.symbols &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ff79c6;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span&gt; used)
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#50fa7b;&quot;&gt;radial.plot&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bd93f9;&quot;&gt;90 &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ff79c6;&quot;&gt;-&lt;&#x2F;span&gt;&lt;span&gt; elevation.bd, azimuth.bd, &lt;&#x2F;span&gt;&lt;span style=&quot;font-style:italic;color:#ffb86c;&quot;&gt;rp.type &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ff79c6;&quot;&gt;= &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f1fa8c;&quot;&gt;&amp;quot;s&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;, &lt;&#x2F;span&gt;&lt;span style=&quot;font-style:italic;color:#ffb86c;&quot;&gt;radial.lim &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ff79c6;&quot;&gt;= &lt;&#x2F;span&gt;&lt;span style=&quot;color:#8be9fd;&quot;&gt;c&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bd93f9;&quot;&gt;0&lt;&#x2F;span&gt;&lt;span&gt;, &lt;&#x2F;span&gt;&lt;span style=&quot;color:#bd93f9;&quot;&gt;90&lt;&#x2F;span&gt;&lt;span&gt;, &lt;&#x2F;span&gt;&lt;span style=&quot;color:#8be9fd;&quot;&gt;seq&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bd93f9;&quot;&gt;0&lt;&#x2F;span&gt;&lt;span&gt;, &lt;&#x2F;span&gt;&lt;span style=&quot;color:#bd93f9;&quot;&gt;90&lt;&#x2F;span&gt;&lt;span&gt;, &lt;&#x2F;span&gt;&lt;span style=&quot;color:#bd93f9;&quot;&gt;15&lt;&#x2F;span&gt;&lt;span&gt;)), &lt;&#x2F;span&gt;&lt;span style=&quot;font-style:italic;color:#ffb86c;&quot;&gt;start &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ff79c6;&quot;&gt;= &lt;&#x2F;span&gt;&lt;span style=&quot;color:#bd93f9;&quot;&gt;90&lt;&#x2F;span&gt;&lt;span&gt;, &lt;&#x2F;span&gt;&lt;span style=&quot;font-style:italic;color:#ffb86c;&quot;&gt;clockwise &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ff79c6;&quot;&gt;= &lt;&#x2F;span&gt;&lt;span style=&quot;color:#bd93f9;&quot;&gt;TRUE&lt;&#x2F;span&gt;&lt;span&gt;, &lt;&#x2F;span&gt;&lt;span style=&quot;font-style:italic;color:#ffb86c;&quot;&gt;add &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ff79c6;&quot;&gt;= &lt;&#x2F;span&gt;&lt;span style=&quot;color:#bd93f9;&quot;&gt;TRUE&lt;&#x2F;span&gt;&lt;span&gt;, &lt;&#x2F;span&gt;&lt;span style=&quot;font-style:italic;color:#ffb86c;&quot;&gt;point.symbols &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ff79c6;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span&gt; used.bd, &lt;&#x2F;span&gt;&lt;span style=&quot;font-style:italic;color:#ffb86c;&quot;&gt;point.col &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ff79c6;&quot;&gt;= &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f1fa8c;&quot;&gt;&amp;quot;red&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;)
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;The end result was this (Beidou satellites in red, GPS in black):&lt;&#x2F;p&gt;
&lt;p&gt;&lt;img src=&quot;&#x2F;images&#x2F;satellites.png&quot;
     alt=&quot;Visualisation of satellites visible to NavSpark&quot;
     width=&quot;480&quot;
     height=&quot;480&quot;
     class=&quot;centre&quot;&#x2F;&gt;&lt;&#x2F;p&gt;
&lt;p&gt;I&#x27;m quite pleased with this for something that came out of my first evening of hacking in quite a long time. With a better set of functions to process the NMEA data coming from the NavSpark, it should be possible to see how the satellites move over time, much as has been done in &lt;a href=&quot;https:&#x2F;&#x2F;gergely.imreh.net&#x2F;blog&#x2F;2014&#x2F;05&#x2F;navspark-beidou&#x2F;&quot;&gt;this post&lt;&#x2F;a&gt; by &lt;a href=&quot;https:&#x2F;&#x2F;plus.google.com&#x2F;+GergelyImreh&#x2F;about&quot;&gt;Gergely Imreh&lt;&#x2F;a&gt;. I&#x27;m hoping to try something like this in the future - perhaps it can be a project for the next long weekend.&lt;&#x2F;p&gt;
</content>
    </entry>
    <entry xml:lang="en">
        <title>Building a quadcopter</title>
        <published>2014-01-25T00:00:00+00:00</published>
        <updated>2014-01-25T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Zak
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://www.mitsake.net/posts/building-a-quadcopter/"/>
        <id>https://www.mitsake.net/posts/building-a-quadcopter/</id>
        <content type="html" xml:base="https://www.mitsake.net/posts/building-a-quadcopter/">&lt;p&gt;One of my Christmas gifts, both from others and myself, was equipment for a quadcopter. I ended up choosing the popular Flamewheel F450 kit from DJI, mostly because their parts are available locally and I anticipated (correctly, it turns out) a few crashes as I was learning to fly something bigger than my &lt;a href=&quot;http:&#x2F;&#x2F;www.bitcraze.se&#x2F;crazyflie&#x2F;&quot;&gt;Crazyflie&lt;&#x2F;a&gt;. In the end, the complete list of things I needed to get flying:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;http:&#x2F;&#x2F;www.perthrc.com.au&#x2F;nazam-litegps-combof450-arf-kit.html&quot;&gt;DJI Flamewheel F450 kit&lt;&#x2F;a&gt; with motors, ESCs and NAZA-M Lite flight controller&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a href=&quot;http:&#x2F;&#x2F;www.perthrc.com.au&#x2F;8j-8ch-fhss-inc-r2008sb-rx-mode.html&quot;&gt;Futaba T8J transmitter&lt;&#x2F;a&gt; (including a receiver)&lt;&#x2F;li&gt;
&lt;li&gt;Turnigy nano-tech LiPo batteries (2 x &lt;a href=&quot;http:&#x2F;&#x2F;www.hobbyking.com&#x2F;hobbyking&#x2F;store&#x2F;uh_viewItem.asp?idProduct=35472&quot;&gt;2650 mAh&lt;&#x2F;a&gt;, 1 x &lt;a href=&quot;http:&#x2F;&#x2F;www.hobbyking.com&#x2F;hobbyking&#x2F;store&#x2F;uh_viewItem.asp?idProduct=35506&quot;&gt;4000 mAh&lt;&#x2F;a&gt;) &amp;amp; LiFePO4 &lt;a href=&quot;http:&#x2F;&#x2F;www.hobbyking.com&#x2F;hobbyking&#x2F;store&#x2F;uh_viewItem.asp?idProduct=35565&quot;&gt;transmitter battery&lt;&#x2F;a&gt;.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a href=&quot;http:&#x2F;&#x2F;www.hobbyking.com&#x2F;hobbyking&#x2F;store&#x2F;uh_viewItem.asp?idProduct=15042&quot;&gt;Accucel-6 battery charger&lt;&#x2F;a&gt; &amp;amp; 12 V power supply&lt;&#x2F;li&gt;
&lt;li&gt;Various plugs, connectors and wires (including many I didn&#x27;t need in the end)&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;The kit was easy to put together but still took me about a day to finish. The main time sink turned out to be changing over the battery connectors -  my little soldering iron struggled a fair bit with the huge 12- and 10-gauge discharge leads. I was really happy with the final result and with the help of a &lt;a href=&quot;https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=aflee6HG4l4&quot; title=&quot;DJI Naza Futaba T8J S-bus setup&quot;&gt;video&lt;&#x2F;a&gt;, setting up the flight controller was super-easy.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;img src=&quot;&#x2F;images&#x2F;quadcopter&#x2F;quad.jpg&quot;
     alt=&quot;Assembled DJI F450 quadcopter&quot;
     width=&quot;640&quot;
     height=&quot;400&quot;
     class=&quot;centre&quot;&#x2F;&gt;&lt;&#x2F;p&gt;
&lt;p&gt;After a successful maiden flight, I borrowed an old GoPro HD and tried filming from the air. This worked pretty well apart from a bit of vibration in the videos which turned out to be because I hadn&#x27;t tightened the prop nuts sufficiently. This came to light when one of the props came off 20 m above an oval and it took another similar crash for me to hit on the obvious solution: nylon locking nuts. The nyloc nuts have been great and the damage from both crashes (a crack in the bottom plate and broken prop) was easily fixed.&lt;&#x2F;p&gt;
&lt;p&gt;My next move was to add some navigation lights in the form of &lt;a href=&quot;http:&#x2F;&#x2F;www.hobbyking.com&#x2F;hobbyking&#x2F;store&#x2F;uh_viewItem.asp?idProduct=24533&quot;&gt;white&lt;&#x2F;a&gt; and &lt;a href=&quot;http:&#x2F;&#x2F;www.hobbyking.com&#x2F;hobbyking&#x2F;store&#x2F;uh_viewItem.asp?idProduct=29820&quot;&gt;red&lt;&#x2F;a&gt; LED strips. These are all wired in a continuous strip and can be switched on and off from the transmitter with a &lt;a href=&quot;http:&#x2F;&#x2F;www.dimensionengineering.com&#x2F;products&#x2F;picoswitch&quot;&gt;PicoSwitch&lt;&#x2F;a&gt; attached to channel eight of the receiver.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;img src=&quot;&#x2F;images&#x2F;quadcopter&#x2F;navlights.jpg&quot;
     alt=&quot;F450 with navigation lights added&quot;
     width=&quot;640&quot;
     height=&quot;400&quot;
     class=&quot;centre&quot;&#x2F;&gt;&lt;&#x2F;p&gt;
&lt;p&gt;I was originally planning to get a new-model GoPro for recording video but after some research found the &lt;a href=&quot;http:&#x2F;&#x2F;www.chucklohr.com&#x2F;808&#x2F;mobius&#x2F;&quot;&gt;Mobius ActionCam&lt;&#x2F;a&gt;. It&#x27;s made by the same people that make the common &lt;a href=&quot;http:&#x2F;&#x2F;www.chucklohr.com&#x2F;808&#x2F;index.shtml&quot;&gt;808 keychain cameras&lt;&#x2F;a&gt; and has become popular with RC flyers due to its balance of cost (US$70 shipped), weight (40 g) and quality. I did have the Mobius mounted under the base plate using &lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;dbaldwin&#x2F;garagepilots&quot;&gt;these&lt;&#x2F;a&gt; 3D-printed leg extensions, but I&#x27;ll need to reprint them and pay a bit more attention to the amount and pattern of the fill as a couple of hard landings this morning caused them all to break in the same place. The pictures below are taken from some videos I&#x27;ve recorded - click through for full-size versions.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;a href=&quot;&#x2F;images&#x2F;quadcopter&#x2F;uwadusklarge.png&quot;&gt;&lt;img src=&quot;&#x2F;images&#x2F;quadcopter&#x2F;uwadusk.jpg&quot;
     alt=&quot;View of Perth from UWA at dusk&quot;
     width=&quot;640&quot;
     height=&quot;360&quot;
     class=&quot;centre&quot;&#x2F;&gt;&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;p&gt;This was taken during a twilight flight while I was still testing the camera and attaching it to the battery with an elastic band. The automatic white balance had a fair bit of issue with the contrast between the dark ground and sky, though the camera can be &lt;a href=&quot;http:&#x2F;&#x2F;www.rcgroups.com&#x2F;forums&#x2F;showpost.php?p=25170908&amp;amp;postcount=3&quot;&gt;configured&lt;&#x2F;a&gt; with a fixed white balance setting which should improve it.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;a href=&quot;&#x2F;images&#x2F;quadcopter&#x2F;davisovallarge.png&quot;&gt;&lt;img src=&quot;&#x2F;images&#x2F;quadcopter&#x2F;davisoval.jpg&quot;
     alt=&quot;View from above Davis Oval in Mosman Park&quot;
     width=&quot;640&quot;
     height=&quot;360&quot;
     class=&quot;centre&quot;&#x2F;&gt;&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;p&gt;Mounting underneath with Velcro means the props aren&#x27;t right in the centre of the frame. There&#x27;s a bit of vibration apparent in the video, but hopefully I can fix this by balancing the props and adding a bit more cushioning.&lt;&#x2F;p&gt;
&lt;p&gt;One thing I added to my setup was the ability to activate the flight controller&#x27;s failsafe using one of the transmitter switches rather than having to switch off the transmitter. While there were a couple of videos on setting this up, all of them seemed to only work if the flight mode switch was in a specific location - not ideal for an emergency situation. To get around this, I used an offset mix on the flight mode channel (channel seven in my case) which shifted that channel by 50 units when triggered. Checking this with the DJI software indicated that it worked regardless of flight mode, and a field test was also successful. If you&#x27;re looking for something similar, the steps I used were:&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;Set up a programmable mix, with the master as &#x27;OFS&#x27; (offset) and the channel you&#x27;re using to change flight mode as the slave&lt;&#x2F;li&gt;
&lt;li&gt;Assign a switch and position - I used switch G in the down position&lt;&#x2F;li&gt;
&lt;li&gt;Check that the mix is enabled (i.e. not set to &#x27;INH&#x27;, which I only found out stands for &#x27;inhibit&#x27; a little while ago)&lt;&#x2F;li&gt;
&lt;li&gt;Set the rate to around -50%. It&#x27;s a good idea to have the Naza hooked up to the DJI Assistant software while you&#x27;re doing this. Check that the failsafe switch works regardless of flight mode and if it does, you&#x27;re good to go!&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
</content>
    </entry>
    <entry xml:lang="en">
        <title>Bluetooth and VirtualBox on an OS X host</title>
        <published>2013-11-12T00:00:00+00:00</published>
        <updated>2013-11-12T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Zak
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://www.mitsake.net/posts/bluetooth-and-virtualbox-on-an-os-x-host/"/>
        <id>https://www.mitsake.net/posts/bluetooth-and-virtualbox-on-an-os-x-host/</id>
        <content type="html" xml:base="https://www.mitsake.net/posts/bluetooth-and-virtualbox-on-an-os-x-host/">&lt;p&gt;I&#x27;ve recently been playing around with the &lt;a href=&quot;http:&#x2F;&#x2F;www.bitcraze.se&#x2F;crazyflie&#x2F;&quot; title=&quot;Crazyflie&quot;&gt;Crazyflie&lt;&#x2F;a&gt; nano quadcopter, using the Ubuntu-based &lt;a href=&quot;http:&#x2F;&#x2F;wiki.bitcraze.se&#x2F;projects:virtualmachine:index&quot; title=&quot;Bitcraze VM&quot;&gt;Bitcraze VM&lt;&#x2F;a&gt; to run the radio and Python client. I&#x27;ve been using a PS3 controller attached via USB, but recently decided to connect via Bluetooth so I didn&#x27;t have to be tethered to my laptop while flying. Unfortunately, simply turning off Bluetooth in OS X doesn&#x27;t allow the guest machine to take control of the Bluetooth adapter.&lt;&#x2F;p&gt;
&lt;p&gt;Fortunately, &lt;a href=&quot;https:&#x2F;&#x2F;www.virtualbox.org&#x2F;ticket&#x2F;2372#comment:17&quot; title=&quot;Post by Billy in VirtualBox ticket #2372&quot;&gt;this post&lt;&#x2F;a&gt; gives the commands for unloading the Bluetooth daemon and kernel extensions which in turn allows the guest operating system to use the Bluetooth device. The only hiccup I found was with the last command - in Mountain Lion, the &lt;code&gt;kextunload -b com.apple.iokit.BroadcomBluetoothHCIControllerUSBTransport&lt;&#x2F;code&gt; command didn&#x27;t work. Stealing the &lt;code&gt;kextstat| grep -i bluet&lt;&#x2F;code&gt; command from the &lt;a href=&quot;https:&#x2F;&#x2F;www.virtualbox.org&#x2F;ticket&#x2F;2372#comment:19&quot; title=&quot;Post by ArthurG in VirtualBox ticket #2372&quot;&gt;next post&lt;&#x2F;a&gt; down showed up the following extensions:&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;bash&quot; style=&quot;background-color:#282a36;color:#f8f8f2;&quot; class=&quot;language-bash &quot;&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span style=&quot;color:#50fa7b;&quot;&gt;com.apple.iokit.IOBluetoothFamily
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#50fa7b;&quot;&gt;com.apple.iokit.IOBluetoothSerialManager
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#50fa7b;&quot;&gt;com.apple.iokit.IOBluetoothHostControllerUSBTransport
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#50fa7b;&quot;&gt;com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Considering how close the last line was to the one in the post, I took a guess and it worked! So, to enable Bluetooth on a guest OS with a Mountain Lion or Mavericks host (I&#x27;ve since upgraded, but the commands still work), you need to run:&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;bash&quot; style=&quot;background-color:#282a36;color:#f8f8f2;&quot; class=&quot;language-bash &quot;&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span style=&quot;color:#50fa7b;&quot;&gt;$&lt;&#x2F;span&gt;&lt;span&gt; sudo launchctl unload &#x2F;System&#x2F;Library&#x2F;LaunchDaemons&#x2F;com.apple.blued.plist
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#50fa7b;&quot;&gt;$&lt;&#x2F;span&gt;&lt;span&gt; sudo kextunload&lt;&#x2F;span&gt;&lt;span style=&quot;font-style:italic;color:#ffb86c;&quot;&gt; -b&lt;&#x2F;span&gt;&lt;span&gt; com.apple.iokit.IOBluetoothSerialManager
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#50fa7b;&quot;&gt;$&lt;&#x2F;span&gt;&lt;span&gt; sudo kextunload&lt;&#x2F;span&gt;&lt;span style=&quot;font-style:italic;color:#ffb86c;&quot;&gt; -b&lt;&#x2F;span&gt;&lt;span&gt; com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;And then to re-enable Bluetooth within OS X:&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;bash&quot; style=&quot;background-color:#282a36;color:#f8f8f2;&quot; class=&quot;language-bash &quot;&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span style=&quot;color:#50fa7b;&quot;&gt;$&lt;&#x2F;span&gt;&lt;span&gt; sudo launchctl load &#x2F;System&#x2F;Library&#x2F;LaunchDaemons&#x2F;com.apple.blued.plist
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#50fa7b;&quot;&gt;$&lt;&#x2F;span&gt;&lt;span&gt; sudo kextload&lt;&#x2F;span&gt;&lt;span style=&quot;font-style:italic;color:#ffb86c;&quot;&gt; -b&lt;&#x2F;span&gt;&lt;span&gt; com.apple.iokit.IOBluetoothSerialManager
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#50fa7b;&quot;&gt;$&lt;&#x2F;span&gt;&lt;span&gt; sudo kextload&lt;&#x2F;span&gt;&lt;span style=&quot;font-style:italic;color:#ffb86c;&quot;&gt; -b&lt;&#x2F;span&gt;&lt;span&gt; com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
</content>
    </entry>
    <entry xml:lang="en">
        <title>Melatonin in Australia</title>
        <published>2013-08-18T00:00:00+00:00</published>
        <updated>2013-08-18T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Zak
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://www.mitsake.net/posts/melatonin-in-australia/"/>
        <id>https://www.mitsake.net/posts/melatonin-in-australia/</id>
        <content type="html" xml:base="https://www.mitsake.net/posts/melatonin-in-australia/">&lt;p&gt;A few months ago, one of my co-workers set off on a much-anticipated travel adventure. Like most trips out of Australia, there was a long flight involved (this one was to the US, so longer than most), and with that, jetlag. There are probably thousands of products that claim to help prevent or relieve jetlag, but one that&#x27;s become quite popular is melatonin.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;a href=&quot;http:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Melatonin&quot; title=&quot;Melatonin @ Wikipedia&quot;&gt;Melatonin&lt;&#x2F;a&gt; is a hormone that has gained favour with travellers due to the key role it plays in circadian rhythms - melatonin production tends to increase during the evening, peak during the night before falling as morning comes. The theory goes that melatonin in tablet form will perform the same role as endogenous (natural) melatonin, helping you to sleep and therefore set your body clock to the new timezone more quickly.&lt;&#x2F;p&gt;
&lt;p&gt;A &lt;a href=&quot;http:&#x2F;&#x2F;www.ncbi.nlm.nih.gov&#x2F;pubmed&#x2F;12076414&quot; title=&quot;Melatonin for the prevention and treatment of jet lag.&quot;&gt;review&lt;&#x2F;a&gt; of studies that tested the use of melatonin for jet lag supports the idea that it may be helpful if taken around bedtime once at the destination for a few days. The only catch is that unlike in the States, melatonin listed under &lt;a href=&quot;http:&#x2F;&#x2F;www.comlaw.gov.au&#x2F;Details&#x2F;F2012L01200&quot; title=&quot;Poisons Standard 2012&quot;&gt;Schedule 4&lt;&#x2F;a&gt; in Australia, meaning it&#x27;s a prescription-only medicine. Which makes it seem a bit odd that you can find something like &lt;a href=&quot;http:&#x2F;&#x2F;www.bioglan.com.au&#x2F;common-needs&#x2F;homeopathics&#x2F;melatonin-90s&#x2F;melatonin-90s.html&quot; title=&quot;Homeopathic Melatonin&quot;&gt;this&lt;&#x2F;a&gt; on the shelves of your pharmacy or supermarket:&lt;&#x2F;p&gt;
&lt;p&gt;&lt;img src=&quot;&#x2F;images&#x2F;melatonin.png&quot;
     alt=&quot;Homeopathic melatonin&quot;
     width=&quot;220&quot;
     height=&quot;350&quot;
     class=&quot;centre&quot;&#x2F;&gt;&lt;&#x2F;p&gt;
&lt;p&gt;It turns out that at least one vitamin manufacturer produces homeopathic melatonin tablets that are allowed to be sold in Australia. Homeopathic remedies are a bit odd like this - although they don&#x27;t contain a detectable amount of melatonin, you&#x27;re still allowed to include the name on the label. In the case of this supplement, the homeopathic strength is  listed as &#x27;6X&#x27;, which means a dilution factor of &lt;a href=&quot;http:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Homeopathic_dilutions&quot; title=&quot;Homeopathic dilutions @ Wikipedia&quot;&gt;one million&lt;&#x2F;a&gt;. Assuming an original dose of 3 mg (which &lt;a href=&quot;http:&#x2F;&#x2F;www.chemistwarehouse.com.au&#x2F;product.asp?id=31051&quot; title=&quot;Bioglan Melatonin Tablets&quot;&gt;this pharmacy&lt;&#x2F;a&gt; lists), this would mean that you&#x27;d need somewhere in the region of 166 000 tablets to get to even the lowest effective therapeutic dose (0.5 mg).&lt;&#x2F;p&gt;
&lt;p&gt;Maybe I&#x27;m just a cynic, but my immediate thought is that the availability of homeopathic melatonin is linked to the wider availability of information via the internet. Melatonin is mentioned in just about every article when you search along the lines of &#x27;avoiding jetlag&#x27; because it&#x27;s available over-the-counter in the US. Even a couple of articles from Australian sources fail to mention the prescription-only status of melatonin here, so it&#x27;s not too far-fetched that people would go looking for it on pharmacy shelves. I wouldn&#x27;t say it&#x27;s deceptive as there&#x27;s the fairly obvious &#x27;Homeopathic&#x27; logo on the bottle, but it&#x27;s interesting to wonder how many have been sold on the back of an internet research session.&lt;&#x2F;p&gt;
</content>
    </entry>
    <entry xml:lang="en">
        <title>WAHCKon highlights</title>
        <published>2013-05-12T00:00:00+00:00</published>
        <updated>2013-05-12T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Zak
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://www.mitsake.net/posts/wahckon-highlights/"/>
        <id>https://www.mitsake.net/posts/wahckon-highlights/</id>
        <content type="html" xml:base="https://www.mitsake.net/posts/wahckon-highlights/">&lt;p&gt;A few weeks ago I bought a ticket to the inaugural &lt;a href=&quot;http:&#x2F;&#x2F;www.wahckon.org.au&#x2F;&quot; title=&quot;WAHCKon 2013&quot;&gt;WAHCKon&lt;&#x2F;a&gt; which was held at ECU Joondalup over last weekend. It was a great event, with some interesting talks and a general &#x27;good vibe&#x27; over both days. Mostly so I don&#x27;t forget some of the cool things I heard about, I thought I&#x27;d quickly mention a few of the &lt;a href=&quot;http:&#x2F;&#x2F;www.wahckon.org.au&#x2F;talks.html&quot; title=&quot;WAHCKon talks&quot;&gt;talks&lt;&#x2F;a&gt; that I particularly enjoyed.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;img src=&quot;&#x2F;images&#x2F;wahckon_badge.jpg&quot;
     alt=&quot;The WHACKon lanyard and badge&quot;
     width=&quot;640&quot;
     height=&quot;360&quot;
     class=&quot;centre&quot;&#x2F;&gt;&lt;&#x2F;p&gt;
&lt;h2 id=&quot;a-small-chain-of-security-bugs-gone-astray&quot;&gt;A Small Chain of Security Bugs Gone Astray&lt;&#x2F;h2&gt;
&lt;p&gt;Like most people, I&#x27;ve heard about cross-site scripting attacks before but never really understood how they worked or why they&#x27;re a factor in so many site hacks. The underlying story was about a couple of bugs in the open-source portfolio system &lt;a href=&quot;https:&#x2F;&#x2F;mahara.org&#x2F;&quot; title=&quot;Mahara&quot;&gt;Mahara&lt;&#x2F;a&gt; which allowed an attacker to cascade from a simple piece of Javascript into full-blown shell access on the server. I also managed to have a chat with Hugh during a break - I&#x27;d be interested to hear some of the other talks he&#x27;s given.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;watering-hole-exploitation&quot;&gt;Watering Hole Exploitation&lt;&#x2F;h2&gt;
&lt;p&gt;As with the first talk, this was a deeper look into how small vulnerabilities can cascade into serious issues for hacked targets. The focus of the talk was the idea of a &#x27;watering hole&#x27; - a place that users located in the target organisation are likely to visit. If you&#x27;re able to compromise or impersonate the watering hole, you can gain user-level access to an internal network and start elevating the access you have from that point. A lot of the methods used seemed similar to those that &lt;a href=&quot;http:&#x2F;&#x2F;www.mandiant.com&#x2F;&quot; title=&quot;Mandiant&quot;&gt;Mandiant&lt;&#x2F;a&gt; described in their report on the Chinese military&#x27;s hacking group &lt;a href=&quot;http:&#x2F;&#x2F;intelreport.mandiant.com&#x2F;&quot; title=&quot;Mandiant&amp;#39;s report on APT1&quot;&gt;APT1&lt;&#x2F;a&gt;. The talk made me happy I don&#x27;t have to look after any large networks as one small mistake by a non-admin user can lead to serious problems.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;icann-the-dns-root&quot;&gt;ICANN &amp;amp; the DNS root&lt;&#x2F;h2&gt;
&lt;p&gt;I hadn&#x27;t really been looking forward to this presentation - I know &lt;a href=&quot;http:&#x2F;&#x2F;www.icann.org&#x2F;&quot; title=&quot;Internet Corporation for Assigned Names and Numbers&quot;&gt;ICANN&lt;&#x2F;a&gt; is important to the functioning of the Internet, but it&#x27;s never something I&#x27;ve looked into at all. The two parts of the talk I found most interesting were how many new top-level domains are about to be released and how the DNS root is able to withstand such heavy traffic (it turns out the key is &lt;a href=&quot;http:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Anycast&quot; title=&quot;Anycast @ Wikipedia&quot;&gt;anycast&lt;&#x2F;a&gt;). It&#x27;s amazing that a not-for-profit that has so many different groups involved can make any decision, let alone ones that seem to work pretty well!&lt;&#x2F;p&gt;
&lt;h2 id=&quot;cyberwar-and-the-real-world&quot;&gt;Cyberwar and the Real World&lt;&#x2F;h2&gt;
&lt;p&gt;The &lt;a href=&quot;http:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Stuxnet&quot; title=&quot;Stuxnet @ Wikipedia&quot;&gt;Stuxnet&lt;&#x2F;a&gt; worm has perhaps been the most-publicised piece of malware in recent years, so I&#x27;d heard a fair bit about it before. Some of the in-depth information presented was really fascinating, particularly how precisely targeted the payload was. Even more interesting was the demonstration of how Stuxnet was targeted using a publicly-available &lt;a href=&quot;http:&#x2F;&#x2F;www.president.ir&#x2F;media&#x2F;main&#x2F;28838.jpg&quot; title=&quot;Picture of Mahmoud Ahmadinejad at Natanz&quot;&gt;picture&lt;&#x2F;a&gt; from the Iranian President&#x27;s offical site that showed a number of the computers used to control the centrifuge cascade.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;within-the-groove-how-to-be-a-dick-to-your-arcade&quot;&gt;WithIn the Groove: How To Be A Dick To Your Arcade&lt;&#x2F;h2&gt;
&lt;p&gt;One of my favourite presentations, mostly for the frequent use of #hashtagjokes and Gandalf. The talk itself discussed a method to trick the dancing game &lt;a href=&quot;http:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;In_The_Groove_2&quot; title=&quot;ITG2 @ Wikipedia&quot;&gt;In The Groove 2&lt;&#x2F;a&gt; into running arbitary Lua code to give free credits. Although it&#x27;s an arcade game, players are able to insert USB drives to store profile data and it&#x27;s this that allows the attack - profile files can include Lua code. Although the game uses RSA to sign the profile files (so only signed profiles are trusted) and the private key is encrypted with AES-192, a flaw in the &lt;a href=&quot;http:&#x2F;&#x2F;www.maximintegrated.com&#x2F;datasheet&#x2F;index.mvp&#x2F;id&#x2F;2822&quot; title=&quot;iButton DS1963S by Maxim Integrated&quot;&gt;iButton DS1963S&lt;&#x2F;a&gt; used to calculate the AES key exposes the RSA key. Although it was only an attack on an arcade machine, it was a great demonstration of the fact that a single flaw in the implementation of cryptography can lead to a complete compromise.&lt;&#x2F;p&gt;
&lt;p&gt;I also found a more technical overview of the attack by &lt;a href=&quot;http:&#x2F;&#x2F;immunityinc.com&#x2F;infiltrate&#x2F;archives&#x2F;Arcade_Attacks.pdf&quot; title=&quot;Original talk by Ronald Huizer&quot;&gt;Ronald Huizer&lt;&#x2F;a&gt; who&#x27;s also &lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;spigwitmer&#x2F;ds1963s-utils&quot; title=&quot;Utilities and tools for the DS1963S iButton dongle.&quot;&gt;documented&lt;&#x2F;a&gt; a software attack on the DS1963S. The original fault attack on the dongle was presented by Christian Brandt and is also &lt;a href=&quot;http:&#x2F;&#x2F;cribert.freeforge.net&#x2F;27c3&#x2F;ibsec_eh.pdf&quot; title=&quot;Hacking iButtons by Christian Brandt&quot;&gt;available online&lt;&#x2F;a&gt; if you speak German.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;phreaking-in-a-post-copper-world&quot;&gt;Phreaking in a post copper world&lt;&#x2F;h2&gt;
&lt;p&gt;Before seeing this talk, I had no idea how big VoIP hacking was. It turns out that the cheap international telephony that the Internet has brought in has created more than a few options for those looking for a quick buck. Once you&#x27;ve got hold of someone&#x27;s account credentials, you can use that to make calls at their cost. One option is to call premium phone lines that you control and profit from; those willing to play a long game have apparently set up calling card enterprises built entirely on hacked VoIP accounts.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;hardware-hacking-and-stretching-the-parrot-ardrone-platform-to-the-limit&quot;&gt;Hardware hacking and stretching the Parrot ARDrone platform to the limit&lt;&#x2F;h2&gt;
&lt;p&gt;At work, one of the ways we illustrate how quickly technology progresses is to show students an &lt;a href=&quot;http:&#x2F;&#x2F;ardrone2.parrot.com&#x2F;&quot; title=&quot;AR.Drone quadricopter&quot;&gt;AR.Drone&lt;&#x2F;a&gt; - something that ten years ago would have been government technology is now available for a few hundred dollars at a nearby shop. As part of a final-year university project, these guys created the &lt;a href=&quot;http:&#x2F;&#x2F;intellidrone.org&#x2F;&quot; title=&quot;The IntelliDrone Project&quot;&gt;Intellidrone&lt;&#x2F;a&gt;. Using the original AR.Drone platform they added modifications for GPS, real-time telemetry and payload pick-up&#x2F;drop-off along with a software package to control it all. This is definitely something I&#x27;ll be looking to include in our presentations, though I might leave out the extended-capacity battery hacking.&lt;&#x2F;p&gt;
&lt;p&gt;Another highlight along with these talks was the conference party and lockpicking contest on the Saturday night. Although I&#x27;ve been into lockpicking for a while, this was the first chance I&#x27;ve had to even meet other people that are into it in Perth let alone enter try a competition. I didn&#x27;t perform that well in the end as the five-pin lock that was worth most of the points eluded me. It was great fun and as a bonus I even got to pick my first pair of handcuffs as part of the competition. For a first event the whole conference was amazing and I&#x27;ll certainly be heading to the next one in 2014.&lt;&#x2F;p&gt;
</content>
    </entry>
    <entry xml:lang="en">
        <title>Dynamic DNS with NearlyFreeSpeech.NET and Python</title>
        <published>2012-10-27T00:00:00+00:00</published>
        <updated>2016-04-14T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Zak
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://www.mitsake.net/posts/ddns-with-nfs-net-and-python/"/>
        <id>https://www.mitsake.net/posts/ddns-with-nfs-net-and-python/</id>
        <content type="html" xml:base="https://www.mitsake.net/posts/ddns-with-nfs-net-and-python/">&lt;p&gt;&lt;em&gt;Update (14 April 2016): I&#x27;ve since rewritten this script - you can find the new version in &lt;a href=&quot;https:&#x2F;&#x2F;www.mitsake.net&#x2F;posts&#x2F;nfsn-and-ddns-take-2&#x2F;&quot;&gt;this post&lt;&#x2F;a&gt;.&lt;&#x2F;em&gt;&lt;&#x2F;p&gt;
&lt;p&gt;Since I got it, one of the things I&#x27;ve been looking to do with my &lt;a href=&quot;http:&#x2F;&#x2F;www.raspberrypi.org&#x2F;&quot; title=&quot;Raspberry Pi&quot;&gt;Raspberry Pi&lt;&#x2F;a&gt; is to access it remotely. This is a pretty easy task - give the Pi a static IP and forward the appropriate port on the router. However, my ISP assigns a dynamic IP address and having to check what my IP is before being able to connect is tiresome. On top of that IP addresses aren&#x27;t particularly memorable so assigning a domain or subdomain would make it much easier to use.&lt;&#x2F;p&gt;
&lt;p&gt;If your ISP offers the option, the solution is as simple as requesting a static IP address and assigning the subdomain to that IP. Unfortunately my ISP only gives static addresses to business customers and the extra $30&#x2F;month isn&#x27;t really worth it just for the static address.&lt;&#x2F;p&gt;
&lt;p&gt;Another option is to use a dynamic DNS service. They&#x27;ve been around for ages - I remember using one to run games of Total Annihilation over a 56k modem - but you have to either put up with the domain offered to you or pay a fee for their service. Since I already have DNS provided by &lt;a href=&quot;http:&#x2F;&#x2F;nearlyfreespeech.net&#x2F;&quot; title=&quot;NearlyFreeSpeech.NET&quot;&gt;NearlyFreeSpeech.NET&lt;&#x2F;a&gt; I wondered if I could set up some sort of dynamic DNS through them and promptly stumbled upon a &lt;a href=&quot;https:&#x2F;&#x2F;blog.arrington.me&#x2F;2011&#x2F;nearlyfreespeech-net-as-a-dynamic-dns-provider&#x2F;&quot; title=&quot;NearlyFreeSpeech.NET as a dynamic DNS provider&quot;&gt;post&lt;&#x2F;a&gt; by Joshua Arrington in which he did exactly that using the &lt;a href=&quot;https:&#x2F;&#x2F;members.nearlyfreespeech.net&#x2F;wiki&#x2F;API&#x2F;Introduction&quot; title=&quot;NearlyFreeSpeech.NET API&quot;&gt;NFS.NET API&lt;&#x2F;a&gt; and a script written in PHP.&lt;&#x2F;p&gt;
&lt;p&gt;Although the solution was a good one, there were a couple of things I wanted to change. Firstly, my site is static and switching it to a dynamic site just to implement one thing seemed a bit like overkill. I also preferred the idea of running the script from a machine on my network rather than having to secure a server-side script. Just to make things more difficult for myself, I wanted to avoid installing PHP and instead opted to port the script to Python as it&#x27;s supported out-of-the-box on the &lt;a href=&quot;http:&#x2F;&#x2F;www.raspbian.org&#x2F;&quot; title=&quot;Raspbian&quot;&gt;Raspbian&lt;&#x2F;a&gt; OS. Making this much easier was the fact that the &lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;goncalopp&#x2F;pynfsn&quot; title=&quot;pynfsn GitHub repository&quot;&gt;pynfsn&lt;&#x2F;a&gt; library implements the DNS part of the API.&lt;&#x2F;p&gt;
&lt;p&gt;If you&#x27;re interested in doing the same thing, these are the steps you need to follow:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;Install the pynfsn module:&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;pre data-lang=&quot;bash&quot; style=&quot;background-color:#282a36;color:#f8f8f2;&quot; class=&quot;language-bash &quot;&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span style=&quot;color:#50fa7b;&quot;&gt;$&lt;&#x2F;span&gt;&lt;span&gt; git clone https:&#x2F;&#x2F;github.com&#x2F;goncalopp&#x2F;pynfsn.git
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#50fa7b;&quot;&gt;$&lt;&#x2F;span&gt;&lt;span&gt; cd pynfsn
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#50fa7b;&quot;&gt;$&lt;&#x2F;span&gt;&lt;span&gt; python setup.py install &lt;&#x2F;span&gt;&lt;span style=&quot;color:#6272a4;&quot;&gt;# you may need to run this using sudo
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;ul&gt;
&lt;li&gt;Save the following Python script somewhere on the system you&#x27;re using to update your DNS record. If you&#x27;re planning to use &lt;code&gt;cron&lt;&#x2F;code&gt; to run the script at a regular interval, it&#x27;s a good idea to put it somewhere accessible to all users such as &lt;code&gt;&#x2F;usr&#x2F;local&#x2F;bin&lt;&#x2F;code&gt;. Don&#x27;t forget to set the user, key, domain &amp;amp; subdomin variables for your particular setup.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;pre data-lang=&quot;python&quot; style=&quot;background-color:#282a36;color:#f8f8f2;&quot; class=&quot;language-python &quot;&gt;&lt;code class=&quot;language-python&quot; data-lang=&quot;python&quot;&gt;&lt;span style=&quot;color:#6272a4;&quot;&gt;#! &#x2F;usr&#x2F;bin&#x2F;env python
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ff79c6;&quot;&gt;from &lt;&#x2F;span&gt;&lt;span&gt;pynfsn &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ff79c6;&quot;&gt;import &lt;&#x2F;span&gt;&lt;span&gt;pynfsn
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ff79c6;&quot;&gt;import &lt;&#x2F;span&gt;&lt;span&gt;re
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ff79c6;&quot;&gt;from &lt;&#x2F;span&gt;&lt;span&gt;urllib2 &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ff79c6;&quot;&gt;import &lt;&#x2F;span&gt;&lt;span&gt;urlopen
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ff79c6;&quot;&gt;from &lt;&#x2F;span&gt;&lt;span&gt;time &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ff79c6;&quot;&gt;import &lt;&#x2F;span&gt;&lt;span&gt;strftime, localtime
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;user &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ff79c6;&quot;&gt;= &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f1fa8c;&quot;&gt;&amp;quot;user&amp;quot; &lt;&#x2F;span&gt;&lt;span style=&quot;color:#6272a4;&quot;&gt;# your NFS username (not the one used to ssh into your site)
&lt;&#x2F;span&gt;&lt;span&gt;key &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ff79c6;&quot;&gt;= &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f1fa8c;&quot;&gt;&amp;quot;key&amp;quot; &lt;&#x2F;span&gt;&lt;span style=&quot;color:#6272a4;&quot;&gt;# API key (contact NFS for one)
&lt;&#x2F;span&gt;&lt;span&gt;domain &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ff79c6;&quot;&gt;= &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f1fa8c;&quot;&gt;&amp;quot;domain&amp;quot; &lt;&#x2F;span&gt;&lt;span style=&quot;color:#6272a4;&quot;&gt;# your NFS-hosted domain
&lt;&#x2F;span&gt;&lt;span&gt;subdomain &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ff79c6;&quot;&gt;= &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f1fa8c;&quot;&gt;&amp;quot;subdomain&amp;quot; &lt;&#x2F;span&gt;&lt;span style=&quot;color:#6272a4;&quot;&gt;# the subdomain you&amp;#39;re setting up for dDNS
&lt;&#x2F;span&gt;&lt;span&gt;ttl &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ff79c6;&quot;&gt;= &lt;&#x2F;span&gt;&lt;span style=&quot;color:#bd93f9;&quot;&gt;3600 &lt;&#x2F;span&gt;&lt;span style=&quot;color:#6272a4;&quot;&gt;# this is the default value (one hour)
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;api &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ff79c6;&quot;&gt;= &lt;&#x2F;span&gt;&lt;span&gt;pynfsn&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ff79c6;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color:#50fa7b;&quot;&gt;NFSN&lt;&#x2F;span&gt;&lt;span&gt;(user, key)&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ff79c6;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color:#50fa7b;&quot;&gt;dns&lt;&#x2F;span&gt;&lt;span&gt;(domain)
&lt;&#x2F;span&gt;&lt;span&gt;currentip &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ff79c6;&quot;&gt;= &lt;&#x2F;span&gt;&lt;span&gt;re&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ff79c6;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color:#50fa7b;&quot;&gt;findall&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;font-style:italic;color:#8be9fd;&quot;&gt;r&lt;&#x2F;span&gt;&lt;span style=&quot;color:#f1fa8c;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bd93f9;&quot;&gt;[0-9]&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ff79c6;&quot;&gt;+(?:\.&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bd93f9;&quot;&gt;[0-9]&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ff79c6;&quot;&gt;+){3}&lt;&#x2F;span&gt;&lt;span style=&quot;color:#f1fa8c;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;, &lt;&#x2F;span&gt;&lt;span style=&quot;color:#50fa7b;&quot;&gt;urlopen&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color:#f1fa8c;&quot;&gt;&amp;#39;http:&#x2F;&#x2F;checkip.dyndns.org&#x2F;&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ff79c6;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color:#50fa7b;&quot;&gt;read&lt;&#x2F;span&gt;&lt;span&gt;())[&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bd93f9;&quot;&gt;0&lt;&#x2F;span&gt;&lt;span&gt;]
&lt;&#x2F;span&gt;&lt;span&gt;listedip &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ff79c6;&quot;&gt;= &lt;&#x2F;span&gt;&lt;span&gt;api&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ff79c6;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color:#50fa7b;&quot;&gt;listRRs&lt;&#x2F;span&gt;&lt;span&gt;(subdomain)[&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bd93f9;&quot;&gt;0&lt;&#x2F;span&gt;&lt;span&gt;][&lt;&#x2F;span&gt;&lt;span style=&quot;color:#f1fa8c;&quot;&gt;&amp;#39;data&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;]&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ff79c6;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color:#50fa7b;&quot;&gt;encode&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color:#f1fa8c;&quot;&gt;&amp;#39;ascii&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;, &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f1fa8c;&quot;&gt;&amp;#39;ignore&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;)
&lt;&#x2F;span&gt;&lt;span&gt;logtime &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ff79c6;&quot;&gt;= &lt;&#x2F;span&gt;&lt;span style=&quot;color:#50fa7b;&quot;&gt;strftime&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color:#f1fa8c;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bd93f9;&quot;&gt;%Y&lt;&#x2F;span&gt;&lt;span style=&quot;color:#f1fa8c;&quot;&gt;-&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bd93f9;&quot;&gt;%m&lt;&#x2F;span&gt;&lt;span style=&quot;color:#f1fa8c;&quot;&gt;-&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bd93f9;&quot;&gt;%d %H%M&lt;&#x2F;span&gt;&lt;span style=&quot;color:#f1fa8c;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;, &lt;&#x2F;span&gt;&lt;span style=&quot;color:#50fa7b;&quot;&gt;localtime&lt;&#x2F;span&gt;&lt;span&gt;())
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ff79c6;&quot;&gt;if &lt;&#x2F;span&gt;&lt;span&gt;currentip &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ff79c6;&quot;&gt;!= &lt;&#x2F;span&gt;&lt;span&gt;listedip: &lt;&#x2F;span&gt;&lt;span style=&quot;color:#6272a4;&quot;&gt;# check to see if the ip has changed; if so:
&lt;&#x2F;span&gt;&lt;span&gt;    api&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ff79c6;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color:#50fa7b;&quot;&gt;removeRR&lt;&#x2F;span&gt;&lt;span&gt;(subdomain, &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f1fa8c;&quot;&gt;&amp;#39;A&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;, listedip) &lt;&#x2F;span&gt;&lt;span style=&quot;color:#6272a4;&quot;&gt;# a) remove the old entry, and
&lt;&#x2F;span&gt;&lt;span&gt;    api&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ff79c6;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color:#50fa7b;&quot;&gt;addRR&lt;&#x2F;span&gt;&lt;span&gt;(subdomain, &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f1fa8c;&quot;&gt;&amp;#39;A&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;, currentip, ttl) &lt;&#x2F;span&gt;&lt;span style=&quot;color:#6272a4;&quot;&gt;# b) add a new one
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#8be9fd;&quot;&gt;print &lt;&#x2F;span&gt;&lt;span&gt;(logtime &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ff79c6;&quot;&gt;+ &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f1fa8c;&quot;&gt;&amp;quot; DNS record updated from &amp;quot; &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ff79c6;&quot;&gt;+ &lt;&#x2F;span&gt;&lt;span&gt;listedip &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ff79c6;&quot;&gt;+ &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f1fa8c;&quot;&gt;&amp;quot; to &amp;quot; &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ff79c6;&quot;&gt;+ &lt;&#x2F;span&gt;&lt;span&gt;currentip)
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ff79c6;&quot;&gt;else&lt;&#x2F;span&gt;&lt;span&gt;:
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#8be9fd;&quot;&gt;print &lt;&#x2F;span&gt;&lt;span&gt;(logtime &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ff79c6;&quot;&gt;+ &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f1fa8c;&quot;&gt;&amp;quot; No update required.&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;)
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;ul&gt;
&lt;li&gt;The last step is to set up a &lt;code&gt;cron&lt;&#x2F;code&gt; job for the script. To run the script I picked a user who didn&#x27;t have sudo privileges just in case a mistake with the script made something go horribly wrong. Using &lt;code&gt;sudo crontab -u &amp;lt;user&amp;gt; -e&lt;&#x2F;code&gt;, add a line to the end of the file that indicates how often you&#x27;d like to run the script. I found &lt;a href=&quot;http:&#x2F;&#x2F;docstore.mik.ua&#x2F;orelly&#x2F;linux&#x2F;run&#x2F;ch08_02.htm&quot; title=&quot;Scheduling Jobs Using cron&quot;&gt;this chapter&lt;&#x2F;a&gt; of &lt;a href=&quot;http:&#x2F;&#x2F;docstore.mik.ua&#x2F;orelly&#x2F;linux&#x2F;run&#x2F;index.htm&quot; title=&quot;Running Linux (Third Edition&quot;&gt;Running Linux&lt;&#x2F;a&gt; particularly useful and settled on the following line to run the script once every two hours, redirecting script output and errors to a log file.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;pre data-lang=&quot;bash&quot; style=&quot;background-color:#282a36;color:#f8f8f2;&quot; class=&quot;language-bash &quot;&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span style=&quot;color:#50fa7b;&quot;&gt;0 &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ff79c6;&quot;&gt;*&lt;&#x2F;span&gt;&lt;span&gt;&#x2F;2 &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ff79c6;&quot;&gt;* * *&lt;&#x2F;span&gt;&lt;span&gt; &#x2F;usr&#x2F;local&#x2F;bin&#x2F;nfsddns.py &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ff79c6;&quot;&gt;&amp;gt;&amp;gt;&lt;&#x2F;span&gt;&lt;span&gt; &#x2F;var&#x2F;log&#x2F;nfsddns.log &lt;&#x2F;span&gt;&lt;span style=&quot;color:#bd93f9;&quot;&gt;2&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ff79c6;&quot;&gt;&amp;gt;&amp;amp;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bd93f9;&quot;&gt;1
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;So far, this has been working well for me although the occasional &#x27;Connection reset by peer&#x27; error shows up in the log file. I&#x27;m not entirely sure what&#x27;s causing this; sometimes it happens twice in a row but the next four times the script runs fine. It&#x27;s not a major problem as the script generally runs fine the next time and removing the comparison between the listed and current IPs should stop it completely.&lt;&#x2F;p&gt;
&lt;p&gt;This is the first program I&#x27;ve written in Python, so if you do use it please be aware that there may be security or other issues that I haven&#x27;t picked up. Please let me know if I&#x27;ve missed something obvious!&lt;&#x2F;p&gt;
&lt;p&gt;&lt;em&gt;Update (9 January 2015): Switched the order of the IP address variables in the output as they were back-to-front. Thanks to Paul for spotting it and &lt;a href=&quot;https:&#x2F;&#x2F;twitter.com&#x2F;polm23&#x2F;status&#x2F;553427123881267200&quot;&gt;letting me know&lt;&#x2F;a&gt;.&lt;&#x2F;em&gt;&lt;&#x2F;p&gt;
</content>
    </entry>
    <entry xml:lang="en">
        <title>Safari history tip</title>
        <published>2012-10-24T00:00:00+00:00</published>
        <updated>2012-10-24T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Zak
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://www.mitsake.net/posts/safari-history-tip/"/>
        <id>https://www.mitsake.net/posts/safari-history-tip/</id>
        <content type="html" xml:base="https://www.mitsake.net/posts/safari-history-tip/">&lt;p&gt;I&#x27;ve been noticing for a while that pages that I click on in my Google search results don&#x27;t show up in the history like I expect them to. Rather than showing the titles of the pages they display as Google URLs instead - not particularly useful if you want to retrace your steps.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;img src=&quot;&#x2F;images&#x2F;safarihistory.png&quot;
     alt=&quot;Safari history showing hard-to-read Google URLs&quot;
     width=&quot;491&quot;
     height=&quot;65&quot;
     class=&quot;centre&quot;&#x2F;&gt;&lt;&#x2F;p&gt;
&lt;p&gt;A quick search turned up &lt;a href=&quot;https:&#x2F;&#x2F;discussions.apple.com&#x2F;thread&#x2F;2534734?start=0&amp;amp;tstart=0&quot; title=&quot;Safari History not showing Google Searches&quot;&gt;this discussion&lt;&#x2F;a&gt; on Apple&#x27;s support site where it&#x27;s mentioned that this is a side-effect of Google&#x27;s Instant feature. If you&#x27;d rather have history entries than the ability to see results as you type, you can select the &quot;Never show Instant results&quot; option on your &lt;a href=&quot;http:&#x2F;&#x2F;www.google.com.au&#x2F;preferences?hl=en&quot; title=&quot;Search Settings&quot;&gt;Search Settings&lt;&#x2F;a&gt; page.&lt;&#x2F;p&gt;
</content>
    </entry>
    <entry xml:lang="en">
        <title>Moving a League of Legends installation</title>
        <published>2012-07-22T00:00:00+00:00</published>
        <updated>2012-07-22T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Zak
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://www.mitsake.net/posts/moving-a-lol-install/"/>
        <id>https://www.mitsake.net/posts/moving-a-lol-install/</id>
        <content type="html" xml:base="https://www.mitsake.net/posts/moving-a-lol-install/">&lt;p&gt;Over the weekend I replaced a few parts in my desktop. Since one of the parts I replaced was the motherboard, I also reinstalled Windows to avoid any driver issues. Every other time that I&#x27;ve reinstalled Windows, I&#x27;ve also downloaded and re-installed the &lt;a href=&quot;http:&#x2F;&#x2F;www.leagueoflegends.com&#x2F;&quot; title=&quot;League of Legends&quot;&gt;League of Legends&lt;&#x2F;a&gt; client, reasoning that it didn&#x27;t work after the reinstall because the client hadn&#x27;t been installed correctly.&lt;&#x2F;p&gt;
&lt;p&gt;Turns out that I was wrong and the smart people at &lt;a href=&quot;http:&#x2F;&#x2F;www.riotgames.com&#x2F;&quot; title=&quot;Riot Games&quot;&gt;Riot&lt;&#x2F;a&gt; don&#x27;t use registry entries or anything like that. As long as you have &lt;a href=&quot;http:&#x2F;&#x2F;get.adobe.com&#x2F;air&#x2F;&quot; title=&quot;Adobe Air&quot;&gt;Adobe Air&lt;&#x2F;a&gt; and &lt;a href=&quot;http:&#x2F;&#x2F;www.microsoft.com&#x2F;en-us&#x2F;download&#x2F;details.aspx?id=35&quot; title=&quot;DirectX&quot;&gt;DirectX 9&lt;&#x2F;a&gt; installed, you can simply run &lt;code&gt;lol.launcher.exe&lt;&#x2F;code&gt; in the root LoL directory and everything should work as it did before.&lt;&#x2F;p&gt;
</content>
    </entry>
    <entry xml:lang="en">
        <title>Images in Jekyll</title>
        <published>2012-06-30T00:00:00+00:00</published>
        <updated>2012-06-30T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Zak
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://www.mitsake.net/posts/images-in-jekyll/"/>
        <id>https://www.mitsake.net/posts/images-in-jekyll/</id>
        <content type="html" xml:base="https://www.mitsake.net/posts/images-in-jekyll/">&lt;p&gt;I like using &lt;a href=&quot;http:&#x2F;&#x2F;daringfireball.net&#x2F;projects&#x2F;markdown&#x2F;&quot; title=&quot;Daring Fireball: Markdown&quot;&gt;Markdown&lt;&#x2F;a&gt; to write posts, but one of the problems I have with it is that the image syntax is a bit basic. For example, you can&#x27;t give images a CSS class which is how I position both of the images I&#x27;ve currently got on the site. Using regular &lt;code&gt;&amp;lt;img&amp;gt;&lt;&#x2F;code&gt; tags works but isn&#x27;t particularly neat.&lt;&#x2F;p&gt;
&lt;p&gt;Fortunately, &lt;a href=&quot;http:&#x2F;&#x2F;brandonmathis.com&#x2F;&quot; title=&quot;Brandon Mathis&quot;&gt;Brandon Mathis&lt;&#x2F;a&gt; (the designer of &lt;a href=&quot;http:&#x2F;&#x2F;octopress.org&#x2F;&quot; title=&quot;Octopress&quot;&gt;Octopress&lt;&#x2F;a&gt;) has written a plugin for Jekyll that adds a Liquid image tag. To add the plugin, simply add &lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;imathis&#x2F;octopress&#x2F;blob&#x2F;master&#x2F;plugins&#x2F;image_tag.rb&quot; title=&quot;Code for image tag&quot;&gt;image_tag.rb&lt;&#x2F;a&gt; to your Jekyll &lt;code&gt;_plugins&lt;&#x2F;code&gt; directory. The syntax (below) is straightforward; one thing I&#x27;ve picked up from the &lt;a href=&quot;http:&#x2F;&#x2F;octopress.org&#x2F;docs&#x2F;plugins&#x2F;image-tag&#x2F;&quot; title=&quot;Image Tag - Octopress&quot;&gt;Octopress documentation&lt;&#x2F;a&gt; is that you only need to quote arguments that have spaces in them.&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;handlebars&quot; style=&quot;background-color:#282a36;color:#f8f8f2;&quot; class=&quot;language-handlebars &quot;&gt;&lt;code class=&quot;language-handlebars&quot; data-lang=&quot;handlebars&quot;&gt;&lt;span&gt;{% img class &#x2F;path&#x2F;to&#x2F;image.png width height &amp;#39;title text&amp;#39; &amp;#39;alt text&amp;#39; %}
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;&lt;em&gt;Update (28 January 2018): After six years of using this plugin, I&#x27;ve since moved a method that uses the standard Markdown image &lt;code&gt;![Alt text](link)&lt;&#x2F;code&gt; syntax. Credit to &lt;a href=&quot;https:&#x2F;&#x2F;thornelabs.net&#x2F;2014&#x2F;11&#x2F;30&#x2F;centering-images-with-jekyll-and-markdown.html&quot;&gt;James Thorne&lt;&#x2F;a&gt; for writing it up&lt;&#x2F;em&gt;&lt;&#x2F;p&gt;
</content>
    </entry>
    <entry xml:lang="en">
        <title>Downloading podcasted videos with awk</title>
        <published>2012-06-10T00:00:00+00:00</published>
        <updated>2012-06-10T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Zak
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://www.mitsake.net/posts/podcast-download-with-awk/"/>
        <id>https://www.mitsake.net/posts/podcast-download-with-awk/</id>
        <content type="html" xml:base="https://www.mitsake.net/posts/podcast-download-with-awk/">&lt;p&gt;One of the workshops we run as part of our technology program gives students the chance to create a stop-motion animation using &lt;a href=&quot;http:&#x2F;&#x2F;www.samanimation.com&#x2F;&quot; title=&quot;SAM Animation&quot;&gt;SAM Animation&lt;&#x2F;a&gt; and some modelling clay. Once they&#x27;ve finished taking the photographs, SAM exports a movie which is uploaded to our servers using the Podcast Capture utility. The workflow then adds the title and date to a splash screen at the start of the movie before publishing it to the Podcast Library wiki. I was pretty happy with how this all worked together (particularly given it was my first attempt at anything like it), but one thing was missing - an easy way to download the video files so students could have a copy of their movie.&lt;&#x2F;p&gt;
&lt;p&gt;On the face of it, this should be pretty easy as Podcast Composer offers multiple options in the workflow for publishing the final file. Unfortunately permissions issues between the two computers processing the files plagued attempts to simply export the file into a shared folder. I&#x27;m sure someone that actually knew what they were doing with server administration would have been fine, but it was well beyond my knowledge.&lt;&#x2F;p&gt;
&lt;p&gt;My first attempt to grab the files used Automator and worked pretty well apart from the fact that the videos were given the same 64-character filename as they had on the server (&#x27;export-plugin-quicktime-&lt;a href=&quot;http:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;UUID&quot; title=&quot;Universally unique identifier&quot;&gt;UUID&lt;&#x2F;a&gt;.m4v&#x27;). Having presenters manually rename the files at the end of every workshop wasn&#x27;t really feasible, so I started looking for a way to rename the videos as they were downloaded.&lt;&#x2F;p&gt;
&lt;p&gt;Given that the Podcast Library was able to play the videos, I figured that the HTML source must have links to the actual video files in it somewhere. Sure enough, this turned out to be the case - &lt;code&gt;&amp;lt;span&amp;gt;&lt;&#x2F;code&gt; tags similar to the one below are used to display the &#x27;Play&#x27; button for each video. Handily, the tags also contained the title of the video as well as the path to the video itself.&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;html&quot; style=&quot;background-color:#282a36;color:#f8f8f2;&quot; class=&quot;language-html &quot;&gt;&lt;code class=&quot;language-html&quot; data-lang=&quot;html&quot;&gt;&lt;span&gt;&amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ff79c6;&quot;&gt;span &lt;&#x2F;span&gt;&lt;span style=&quot;color:#50fa7b;&quot;&gt;class&lt;&#x2F;span&gt;&lt;span&gt;=&lt;&#x2F;span&gt;&lt;span style=&quot;color:#f1fa8c;&quot;&gt;&amp;quot;cc-token playbtn&amp;quot; &lt;&#x2F;span&gt;&lt;span style=&quot;color:#50fa7b;&quot;&gt;style&lt;&#x2F;span&gt;&lt;span&gt;=&lt;&#x2F;span&gt;&lt;span style=&quot;color:#f1fa8c;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;font-style:italic;color:#66d9ef;&quot;&gt;min-width&lt;&#x2F;span&gt;&lt;span&gt;: &lt;&#x2F;span&gt;&lt;span style=&quot;color:#bd93f9;&quot;&gt;50&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ff79c6;&quot;&gt;px&lt;&#x2F;span&gt;&lt;span&gt;; &lt;&#x2F;span&gt;&lt;span style=&quot;font-style:italic;color:#66d9ef;&quot;&gt;text-align&lt;&#x2F;span&gt;&lt;span&gt;: &lt;&#x2F;span&gt;&lt;span style=&quot;color:#6be5fd;&quot;&gt;center&lt;&#x2F;span&gt;&lt;span&gt;;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#f1fa8c;&quot;&gt;&amp;quot; &lt;&#x2F;span&gt;&lt;span style=&quot;color:#50fa7b;&quot;&gt;title&lt;&#x2F;span&gt;&lt;span&gt;=&lt;&#x2F;span&gt;&lt;span style=&quot;color:#f1fa8c;&quot;&gt;&amp;quot;Rolling Ball&amp;quot; &lt;&#x2F;span&gt;&lt;span style=&quot;color:#50fa7b;&quot;&gt;assetURL&lt;&#x2F;span&gt;&lt;span&gt;=&lt;&#x2F;span&gt;&lt;span style=&quot;color:#f1fa8c;&quot;&gt;&amp;quot;https:&#x2F;&#x2F;server.local&#x2F;podcastlibrary&#x2F;document&#x2F;uuid&#x2F;7DF98AA3-CCEA-4158-84FA-BC4DEC04DCFF&#x2F;export-plugin-quicktime-E43D860D-31BB-454F-83AD-B2ECFFED9E92.m4v&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;&amp;gt;
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;I&#x27;ve used grep in the past and it seemed like a good starting point given that the tags contained a few unique identifiers such as the &#x27;cc-token playbtn&#x27; CSS class. I&#x27;d also heard about awk, a programming language designed to work with text files. It seemed like a pretty good option, so I had a look at &lt;a href=&quot;http:&#x2F;&#x2F;www.grymoire.com&#x2F;Unix&#x2F;Awk.html&quot; title=&quot;Awk - A Tutorial and Introduction - by Bruce Barnett&quot;&gt;some&lt;&#x2F;a&gt; &lt;a href=&quot;http:&#x2F;&#x2F;www.vectorsite.net&#x2F;tsawk.html&quot; title=&quot;An Awk Primer&quot;&gt;tutorials&lt;&#x2F;a&gt;. This didn&#x27;t go particularly well because awk isn&#x27;t really a command-line tool like grep, it&#x27;s a full programming language. After a number of false starts over a few days, I got the following to work:&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;bash&quot; style=&quot;background-color:#282a36;color:#f8f8f2;&quot; class=&quot;language-bash &quot;&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span style=&quot;color:#50fa7b;&quot;&gt;curl &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f1fa8c;&quot;&gt;&amp;quot;$&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bd93f9;&quot;&gt;@&lt;&#x2F;span&gt;&lt;span style=&quot;color:#f1fa8c;&quot;&gt;&amp;quot; &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ff79c6;&quot;&gt;| &lt;&#x2F;span&gt;&lt;span style=&quot;color:#50fa7b;&quot;&gt;grep&lt;&#x2F;span&gt;&lt;span style=&quot;font-style:italic;color:#ffb86c;&quot;&gt; -o &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f1fa8c;&quot;&gt;&amp;#39;title=&amp;quot;.*&amp;quot; assetURL=&amp;quot;.*&amp;quot;&amp;#39; &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ff79c6;&quot;&gt;| &lt;&#x2F;span&gt;&lt;span style=&quot;color:#50fa7b;&quot;&gt;awk &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f1fa8c;&quot;&gt;&amp;#39;BEGIN { FS =&amp;quot;\&amp;quot;&amp;quot; } ; { system(&amp;quot;curl --insecure --create-dirs -o \&amp;quot;~&#x2F;Desktop&#x2F;Podcasted&#x2F;&amp;quot; $2 &amp;quot;.m4v\&amp;quot; &amp;quot;$4) }&amp;#39;
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;To make this easy for everyone to use, I made an application in Automater with the actions &#x27;Get Current Webpage from Safari&quot; and &#x27;Run Shell Script&#x27;. The curl command downloads the HTML from the Safari page, after which the grep command pulls out the relevant lines from the HTML source and feeds them to awk. The awk command splits the lines up into fields every time it finds a double quotation mark, giving a total of four fields. The second and fourth field of each line are the title and url of the video respectively which are then used in a curl command to download the video.&lt;&#x2F;p&gt;
&lt;p&gt;There are a couple of things I&#x27;d like to fix up but I was so happy that it worked at all, I haven&#x27;t got around to them. Firstly, I&#x27;m pretty sure the grep command is unnecessary and the whole thing could be done with awk. The second is a situation where where this script is likely to fail: if two videos are submitted with the same name. This does happen in our workshops (particularly where the group is given a specific topic to create a video about), but I haven&#x27;t figured out a solution yet.&lt;&#x2F;p&gt;
&lt;p&gt;Although it started off pretty slowly and ended up a bit more hacky than I&#x27;d like, I&#x27;m happy with how this turned out. If nothing else, it gave me a chance to take a look at awk which will definitely be useful in the future.&lt;&#x2F;p&gt;
</content>
    </entry>
    <entry xml:lang="en">
        <title>USB WiFi and sleeping - a quick fix</title>
        <published>2012-05-21T00:00:00+00:00</published>
        <updated>2012-05-21T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Zak
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://www.mitsake.net/posts/usb-wifi-and-sleeping-fix/"/>
        <id>https://www.mitsake.net/posts/usb-wifi-and-sleeping-fix/</id>
        <content type="html" xml:base="https://www.mitsake.net/posts/usb-wifi-and-sleeping-fix/">&lt;p&gt;Whenever my desktop machine running Windows 7 woke from sleep, the USB wireless adapter didn&#x27;t seem to wake up with it. Disabling and re-enabling it in Device Manager got it working again, but I recently discovered a way to stop it happening at all. Under the adapter&#x27;s properties in Device Manager, select the Power Management tab and make sure the option &#x27;Allow the computer to turn off this device to save power&#x27; is turned off. Since I&#x27;ve changed the option I haven&#x27;t seen the issue reappear so thought I&#x27;d share it here.&lt;&#x2F;p&gt;
</content>
    </entry>
    <entry xml:lang="en">
        <title>Headphone repair for beginners</title>
        <published>2012-04-30T00:00:00+00:00</published>
        <updated>2012-04-30T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Zak
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://www.mitsake.net/posts/headphone-repair/"/>
        <id>https://www.mitsake.net/posts/headphone-repair/</id>
        <content type="html" xml:base="https://www.mitsake.net/posts/headphone-repair/">&lt;p&gt;I&#x27;ve had two pairs of headphones lying on my desk awaiting repair for ages and finally got around to doing something about them a few days ago. From the ashes of a pair of Koss KSC-75s that needed a new cable and some Sennheiser PX100s that needed a new jack was born this:&lt;&#x2F;p&gt;
&lt;p&gt;&lt;img src=&quot;&#x2F;images&#x2F;kossheisers_small.jpg&quot;
     alt=&quot;My Kossheiser mash-up headphones&quot;
     width=&quot;300&quot;
     height=&quot;400&quot;
     class=&quot;centre&quot;&#x2F;&gt;&lt;&#x2F;p&gt;
&lt;p&gt;I originally got the idea from &lt;a href=&quot;http:&#x2F;&#x2F;www.head-fi.org&#x2F;t&#x2F;176321&#x2F;my-new-kossheiser-px-75s&quot; title=&quot;My new Kossheiser PX-75s!&quot;&gt;this thread&lt;&#x2F;a&gt; on &lt;a href=&quot;http:&#x2F;&#x2F;www.head-fi.org&#x2F;&quot; title=&quot;Head-Fi.org&quot;&gt;Head-Fi&lt;&#x2F;a&gt; where it&#x27;s apparently a popular mod. The main reason I went for it is because it replaces the Koss earclips (which were just a bit too open to the outside) with a proper headphone band. I followed a similar procedure to one used in &lt;a href=&quot;http:&#x2F;&#x2F;www.head-fi.org&#x2F;t&#x2F;234230&#x2F;introducing-kossheiser-px-75s&quot; title=&quot;Introducing Kossheiser PX 75&amp;#39;s!&quot;&gt;another Head-Fi thread&lt;&#x2F;a&gt;, though rather than drilling &amp;amp; screwing the &#x27;ball&#x27; to the headphones I used superglue.&lt;&#x2F;p&gt;
</content>
    </entry>
    <entry xml:lang="en">
        <title>Archives in Jekyll</title>
        <published>2012-04-06T00:00:00+00:00</published>
        <updated>2012-04-06T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Zak
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://www.mitsake.net/posts/archives-in-jekyll/"/>
        <id>https://www.mitsake.net/posts/archives-in-jekyll/</id>
        <content type="html" xml:base="https://www.mitsake.net/posts/archives-in-jekyll/">&lt;p&gt;After setting up the RSS feed, the next thing I wanted to add to mitsake was a set of &#x27;proper&#x27; archives by both date and tag rather than just the reverse chronological list of posts. Although this wasn&#x27;t as straightforward as setting up RSS, a bit of searching turned up some sites that helped me get everything running.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;tags&quot;&gt;Tags&lt;&#x2F;h2&gt;
&lt;p&gt;Although there&#x27;s built-in support for tags in Jekyll, there isn&#x27;t an easy way to access them via Liquid. Fortunately, the &lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;mojombo&#x2F;jekyll&#x2F;wiki&#x2F;&quot; title=&quot;Jekyll wiki&quot;&gt;Jekyll wiki&lt;&#x2F;a&gt; has links to a number of useful &lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;mojombo&#x2F;jekyll&#x2F;wiki&#x2F;Plugins&quot; title=&quot;Plugins&quot;&gt;plugins&lt;&#x2F;a&gt; including Jose Gonzales&#x27; &lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;josegonzalez&#x2F;josediazgonzalez.com&#x2F;tree&#x2F;master&#x2F;_plugins&quot; title=&quot;Generic Blog Plugins&quot;&gt;Generic Blog Plugins&lt;&#x2F;a&gt;. The one I&#x27;m using is &lt;code&gt;iterator.rb&lt;&#x2F;code&gt;, which gives a new set of template data accessible from &lt;code&gt;site.iterable.tags&lt;&#x2F;code&gt; (as well as &lt;code&gt;site.iterable.categories&lt;&#x2F;code&gt; if you&#x27;re using them instead). Once the plugin was installed, I used Liquid to access the tags along with their names and the posts filed under that tag.&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;handlebars&quot; style=&quot;background-color:#282a36;color:#f8f8f2;&quot; class=&quot;language-handlebars &quot;&gt;&lt;code class=&quot;language-handlebars&quot; data-lang=&quot;handlebars&quot;&gt;&lt;span&gt;{% for tag in site.iterable.tags %}
&lt;&#x2F;span&gt;&lt;span&gt;&amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ff79c6;&quot;&gt;h3&lt;&#x2F;span&gt;&lt;span&gt;&amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#6be5fd;&quot;&gt;{{ &lt;&#x2F;span&gt;&lt;span style=&quot;font-style:italic;color:#ffb86c;&quot;&gt;tag.name &lt;&#x2F;span&gt;&lt;span style=&quot;color:#6be5fd;&quot;&gt;}}&lt;&#x2F;span&gt;&lt;span&gt;&amp;lt;&#x2F;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ff79c6;&quot;&gt;h3&lt;&#x2F;span&gt;&lt;span&gt;&amp;gt;
&lt;&#x2F;span&gt;&lt;span&gt;&amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ff79c6;&quot;&gt;ul&lt;&#x2F;span&gt;&lt;span&gt;&amp;gt;
&lt;&#x2F;span&gt;&lt;span&gt;    {% for post in tag.posts %}
&lt;&#x2F;span&gt;&lt;span&gt;        &amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ff79c6;&quot;&gt;li&lt;&#x2F;span&gt;&lt;span&gt;&amp;gt;&amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ff79c6;&quot;&gt;a &lt;&#x2F;span&gt;&lt;span style=&quot;color:#50fa7b;&quot;&gt;href=&lt;&#x2F;span&gt;&lt;span style=&quot;color:#f1fa8c;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#6be5fd;&quot;&gt;{{ &lt;&#x2F;span&gt;&lt;span style=&quot;font-style:italic;color:#ffb86c;&quot;&gt;post.url &lt;&#x2F;span&gt;&lt;span style=&quot;color:#6be5fd;&quot;&gt;}}&lt;&#x2F;span&gt;&lt;span style=&quot;color:#f1fa8c;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;&amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#6be5fd;&quot;&gt;{{ &lt;&#x2F;span&gt;&lt;span style=&quot;font-style:italic;color:#ffb86c;&quot;&gt;post.title &lt;&#x2F;span&gt;&lt;span style=&quot;color:#6be5fd;&quot;&gt;}}&lt;&#x2F;span&gt;&lt;span&gt;&amp;lt;&#x2F;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ff79c6;&quot;&gt;a&lt;&#x2F;span&gt;&lt;span&gt;&amp;gt;&amp;lt;&#x2F;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ff79c6;&quot;&gt;li&lt;&#x2F;span&gt;&lt;span&gt;&amp;gt;
&lt;&#x2F;span&gt;&lt;span&gt;        &amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ff79c6;&quot;&gt;time&lt;&#x2F;span&gt;&lt;span&gt;&amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#6be5fd;&quot;&gt;{{ &lt;&#x2F;span&gt;&lt;span style=&quot;font-style:italic;color:#ffb86c;&quot;&gt;post.date&lt;&#x2F;span&gt;&lt;span&gt; | &lt;&#x2F;span&gt;&lt;span style=&quot;font-style:italic;color:#ffb86c;&quot;&gt;date&lt;&#x2F;span&gt;&lt;span&gt;: &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f1fa8c;&quot;&gt;&amp;quot;%e %B %Y&amp;quot; &lt;&#x2F;span&gt;&lt;span style=&quot;color:#6be5fd;&quot;&gt;}}&lt;&#x2F;span&gt;&lt;span&gt;&amp;lt;&#x2F;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ff79c6;&quot;&gt;time&lt;&#x2F;span&gt;&lt;span&gt;&amp;gt;
&lt;&#x2F;span&gt;&lt;span&gt;    {% endfor %}
&lt;&#x2F;span&gt;&lt;span&gt;&amp;lt;&#x2F;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ff79c6;&quot;&gt;ul&lt;&#x2F;span&gt;&lt;span&gt;&amp;gt;
&lt;&#x2F;span&gt;&lt;span&gt;{% endfor %}
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;h2 id=&quot;archiving-by-date&quot;&gt;Archiving by date&lt;&#x2F;h2&gt;
&lt;p&gt;Because a list of posts in reverse chronological order can be readily accessed in Jekyll through &lt;code&gt;site.posts&lt;&#x2F;code&gt;, all that&#x27;s needed is to use some clever Liquid markup to process it. I found a good example by &lt;a href=&quot;http:&#x2F;&#x2F;www.mikerowecode.com&#x2F;&quot; title=&quot;mikerowecode&quot;&gt;Mike Rowe&lt;&#x2F;a&gt; he made to group his archives &lt;a href=&quot;http:&#x2F;&#x2F;www.mikerowecode.com&#x2F;2010&#x2F;08&#x2F;jekyll_archives_grouped_by_year.html&quot; title=&quot;Jekyll archives grouped by date&quot;&gt;by year&lt;&#x2F;a&gt; which I adapted slightly to allow my archives to be broken down by month.&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;handlebars&quot; style=&quot;background-color:#282a36;color:#f8f8f2;&quot; class=&quot;language-handlebars &quot;&gt;&lt;code class=&quot;language-handlebars&quot; data-lang=&quot;handlebars&quot;&gt;&lt;span&gt;{% for post in site.posts %}
&lt;&#x2F;span&gt;&lt;span&gt;    {% capture month %}&lt;&#x2F;span&gt;&lt;span style=&quot;color:#6be5fd;&quot;&gt;{{ &lt;&#x2F;span&gt;&lt;span style=&quot;font-style:italic;color:#ffb86c;&quot;&gt;post.date&lt;&#x2F;span&gt;&lt;span&gt; | &lt;&#x2F;span&gt;&lt;span style=&quot;font-style:italic;color:#ffb86c;&quot;&gt;date&lt;&#x2F;span&gt;&lt;span&gt;: &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f1fa8c;&quot;&gt;&amp;#39;%m%Y&amp;#39; &lt;&#x2F;span&gt;&lt;span style=&quot;color:#6be5fd;&quot;&gt;}}&lt;&#x2F;span&gt;&lt;span&gt;{% endcapture %}
&lt;&#x2F;span&gt;&lt;span&gt;    {% capture nmonth %}&lt;&#x2F;span&gt;&lt;span style=&quot;color:#6be5fd;&quot;&gt;{{ &lt;&#x2F;span&gt;&lt;span style=&quot;font-style:italic;color:#ffb86c;&quot;&gt;post.next.date&lt;&#x2F;span&gt;&lt;span&gt; | &lt;&#x2F;span&gt;&lt;span style=&quot;font-style:italic;color:#ffb86c;&quot;&gt;date&lt;&#x2F;span&gt;&lt;span&gt;: &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f1fa8c;&quot;&gt;&amp;#39;%m%Y&amp;#39; &lt;&#x2F;span&gt;&lt;span style=&quot;color:#6be5fd;&quot;&gt;}}&lt;&#x2F;span&gt;&lt;span&gt;{% endcapture %}
&lt;&#x2F;span&gt;&lt;span&gt;        {% if month != nmonth %}
&lt;&#x2F;span&gt;&lt;span&gt;            {% if forloop.index != 1 %}&amp;lt;&#x2F;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ff79c6;&quot;&gt;ul&lt;&#x2F;span&gt;&lt;span&gt;&amp;gt;{% endif %}
&lt;&#x2F;span&gt;&lt;span&gt;            &amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ff79c6;&quot;&gt;h3&lt;&#x2F;span&gt;&lt;span&gt;&amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#6be5fd;&quot;&gt;{{ &lt;&#x2F;span&gt;&lt;span style=&quot;font-style:italic;color:#ffb86c;&quot;&gt;post.date&lt;&#x2F;span&gt;&lt;span&gt; | &lt;&#x2F;span&gt;&lt;span style=&quot;font-style:italic;color:#ffb86c;&quot;&gt;date&lt;&#x2F;span&gt;&lt;span&gt;: &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f1fa8c;&quot;&gt;&amp;#39;%B %Y&amp;#39; &lt;&#x2F;span&gt;&lt;span style=&quot;color:#6be5fd;&quot;&gt;}}&lt;&#x2F;span&gt;&lt;span&gt;&amp;lt;&#x2F;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ff79c6;&quot;&gt;h3&lt;&#x2F;span&gt;&lt;span&gt;&amp;gt;&amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ff79c6;&quot;&gt;ul&lt;&#x2F;span&gt;&lt;span&gt;&amp;gt;
&lt;&#x2F;span&gt;&lt;span&gt;        {% endif %}
&lt;&#x2F;span&gt;&lt;span&gt;    &amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ff79c6;&quot;&gt;li&lt;&#x2F;span&gt;&lt;span&gt;&amp;gt;&amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ff79c6;&quot;&gt;a &lt;&#x2F;span&gt;&lt;span style=&quot;color:#50fa7b;&quot;&gt;href=&lt;&#x2F;span&gt;&lt;span style=&quot;color:#f1fa8c;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#6be5fd;&quot;&gt;{{ &lt;&#x2F;span&gt;&lt;span style=&quot;font-style:italic;color:#ffb86c;&quot;&gt;post.url &lt;&#x2F;span&gt;&lt;span style=&quot;color:#6be5fd;&quot;&gt;}}&lt;&#x2F;span&gt;&lt;span style=&quot;color:#f1fa8c;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;&amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#6be5fd;&quot;&gt;{{ &lt;&#x2F;span&gt;&lt;span style=&quot;font-style:italic;color:#ffb86c;&quot;&gt;post.title &lt;&#x2F;span&gt;&lt;span style=&quot;color:#6be5fd;&quot;&gt;}}&lt;&#x2F;span&gt;&lt;span&gt;&amp;lt;&#x2F;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ff79c6;&quot;&gt;a&lt;&#x2F;span&gt;&lt;span&gt;&amp;gt;&amp;lt;&#x2F;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ff79c6;&quot;&gt;li&lt;&#x2F;span&gt;&lt;span&gt;&amp;gt;
&lt;&#x2F;span&gt;&lt;span&gt;    &amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ff79c6;&quot;&gt;time&lt;&#x2F;span&gt;&lt;span&gt;&amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#6be5fd;&quot;&gt;{{ &lt;&#x2F;span&gt;&lt;span style=&quot;font-style:italic;color:#ffb86c;&quot;&gt;post.date&lt;&#x2F;span&gt;&lt;span&gt; | &lt;&#x2F;span&gt;&lt;span style=&quot;font-style:italic;color:#ffb86c;&quot;&gt;date&lt;&#x2F;span&gt;&lt;span&gt;: &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f1fa8c;&quot;&gt;&amp;quot;%e %B %Y&amp;quot; &lt;&#x2F;span&gt;&lt;span style=&quot;color:#6be5fd;&quot;&gt;}}&lt;&#x2F;span&gt;&lt;span&gt;&amp;lt;&#x2F;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ff79c6;&quot;&gt;time&lt;&#x2F;span&gt;&lt;span&gt;&amp;gt;
&lt;&#x2F;span&gt;&lt;span&gt;{% endfor %}
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;The above code uses the &lt;code&gt;{% capture %}&lt;&#x2F;code&gt; tag to get the month and year of each post and the one that follows it before comparing them. If they&#x27;re different, the month and year are inserted before a link to the post while if they&#x27;re the same, the post is simply added to the list for that month. The only tricky bit I ran into was closing the &lt;code&gt;&amp;lt;ul&amp;gt;&lt;&#x2F;code&gt; tag at the end of each month&#x27;s list. After checking out the &lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;shopify&#x2F;liquid&#x2F;wiki&#x2F;liquid-for-designers&quot; title=&quot;Liquid for Designers&quot;&gt;Liquid documentation&lt;&#x2F;a&gt; my solution was to close the tag before each header, excluding the first by using &lt;code&gt;forloop.index&lt;&#x2F;code&gt;.&lt;&#x2F;p&gt;
&lt;p&gt;That&#x27;s about it! Hopefully this is a useful reference for anyone that&#x27;s looking to make their Jekyll archives a bit more accessible.&lt;&#x2F;p&gt;
</content>
    </entry>
    <entry xml:lang="en">
        <title>Adding RSS to Jekyll</title>
        <published>2012-03-11T00:00:00+00:00</published>
        <updated>2012-03-11T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Zak
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://www.mitsake.net/posts/adding-rss-to-jekyll/"/>
        <id>https://www.mitsake.net/posts/adding-rss-to-jekyll/</id>
        <content type="html" xml:base="https://www.mitsake.net/posts/adding-rss-to-jekyll/">&lt;p&gt;Today I set about the task of adding a RSS feed to the site. I knew this was something that Jekyll supported as there&#x27;s a Liquid tag for each post&#x27;s unique identifier, but I didn&#x27;t expect a Google search to deliver ready-to-use &lt;a href=&quot;http:&#x2F;&#x2F;coyled.com&#x2F;2010&#x2F;07&#x2F;05&#x2F;jekyll-templates-for-atom-rss&#x2F;&quot; title=&quot;Jekyll Templates for Atom, RSS&quot;&gt;templates&lt;&#x2F;a&gt;. After customising the RSS template for my site, the only thing I had to do was add a &lt;code&gt;&amp;lt;link&amp;gt;&lt;&#x2F;code&gt; tag to the default layout.&lt;&#x2F;p&gt;
&lt;p&gt;Many thanks to Dave Coyle at &lt;a href=&quot;http:&#x2F;&#x2F;coyled.com&#x2F;&quot; title=&quot;coyled.com&quot;&gt;coyled.com&lt;&#x2F;a&gt; for making his Atom&#x2F;RSS templates available and saving me a lot of time.&lt;&#x2F;p&gt;
</content>
    </entry>
    <entry xml:lang="en">
        <title>Building mitsake</title>
        <published>2012-02-25T00:00:00+00:00</published>
        <updated>2012-02-25T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Zak
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://www.mitsake.net/posts/building-mitsake/"/>
        <id>https://www.mitsake.net/posts/building-mitsake/</id>
        <content type="html" xml:base="https://www.mitsake.net/posts/building-mitsake/">&lt;p&gt;To start off my posts here I thought I&#x27;d document the process I went through in setting up this site. If nothing else, it&#x27;ll be handy for me to refer to if I need to jog my memory later on.&lt;&#x2F;p&gt;
&lt;p&gt;I&#x27;ve been working on mitsake in some form for a few years but it&#x27;s only now that anything has actually gone online. Procrastination is the main culprit, but I&#x27;ve also been trying to work out what to use to build the site. Over that time I&#x27;ve tried out &lt;a href=&quot;http:&#x2F;&#x2F;jekyllrb.com&#x2F;&quot; title=&quot;Jekyll&quot;&gt;Jekyll&lt;&#x2F;a&gt;, &lt;a href=&quot;http:&#x2F;&#x2F;nestacms.com&#x2F;&quot; title=&quot;Nesta&quot;&gt;Nesta&lt;&#x2F;a&gt; and &lt;a href=&quot;http:&#x2F;&#x2F;octopress.org&#x2F;&quot; title=&quot;Octopress&quot;&gt;Octopress&lt;&#x2F;a&gt; and liked all of them in different ways. Despite this, I eventually decided to go back to Jekyll for a few reasons:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;Given the low-key plan I have for the site, static pages seemed a better fit than something running a dynamic CMS.&lt;&#x2F;li&gt;
&lt;li&gt;I like writing in HTML, CSS and Markdown and since I already know them, designing the site and writing posts didn&#x27;t require me to learn anything else.&lt;&#x2F;li&gt;
&lt;li&gt;I wanted to be able to make a simple design for the site myself. While both Nesta and Octopress have great themes available, I found editing them more difficult than building one from scratch.&lt;&#x2F;li&gt;
&lt;li&gt;I&#x27;ve been interested in learning Ruby for a while. Since Jekyll&#x27;s written in Ruby, extending it gives me a bit of practice.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h2 id=&quot;setting-up-jekyll&quot;&gt;Setting up Jekyll&lt;&#x2F;h2&gt;
&lt;p&gt;&lt;em&gt;Update (16 August 2018): This modification has been obsolete for ages now - Jekyll includes this behaviour &lt;a href=&quot;https:&#x2F;&#x2F;jekyllrb.com&#x2F;docs&#x2F;posts&#x2F;#post-excerpts&quot;&gt;by default&lt;&#x2F;a&gt;.&lt;&#x2F;em&gt;&lt;&#x2F;p&gt;
&lt;p&gt;Rather than write yet another post on how to get started with Jekyll, I thought I&#x27;d just detail the few small things I&#x27;ve done differently. If you are interested in setting up and configuring Jekyll though, there&#x27;s a tonne of articles and other information available in the &lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;mojombo&#x2F;jekyll&#x2F;wiki&quot; title=&quot;Jekyll wiki&quot;&gt;Jekyll documentation&lt;&#x2F;a&gt;. So far I&#x27;ve only made one small addition to the default setup which is the introduction of a &#x27;Read more →&#x27; button for longer posts on the home page. While it did require a plugin, I was fortunate enough to find code for something similar in a &lt;a href=&quot;http:&#x2F;&#x2F;kjetilvalle.com&#x2F;posts&#x2F;2011&#x2F;blogging-with-jekyll.html&quot; title=&quot;Blogging with Jekyll &amp;amp; Git&quot;&gt;post&lt;&#x2F;a&gt; by Kjetil Valle. This is what I put into &lt;code&gt;_plugins&#x2F;preview.rb&lt;&#x2F;code&gt;:&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;ruby&quot; style=&quot;background-color:#282a36;color:#f8f8f2;&quot; class=&quot;language-ruby &quot;&gt;&lt;code class=&quot;language-ruby&quot; data-lang=&quot;ruby&quot;&gt;&lt;span style=&quot;color:#ff79c6;&quot;&gt;module &lt;&#x2F;span&gt;&lt;span style=&quot;color:#8be9fd;&quot;&gt;Liquid
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ff79c6;&quot;&gt;module &lt;&#x2F;span&gt;&lt;span style=&quot;color:#8be9fd;&quot;&gt;ExtendedFilters
&lt;&#x2F;span&gt;&lt;span&gt;        &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ff79c6;&quot;&gt;def &lt;&#x2F;span&gt;&lt;span style=&quot;color:#50fa7b;&quot;&gt;preview&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;font-style:italic;color:#ffb86c;&quot;&gt;text&lt;&#x2F;span&gt;&lt;span&gt;, &lt;&#x2F;span&gt;&lt;span style=&quot;font-style:italic;color:#ffb86c;&quot;&gt;delimiter &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ff79c6;&quot;&gt;= &lt;&#x2F;span&gt;&lt;span style=&quot;color:#f1fa8c;&quot;&gt;&amp;#39;&amp;lt;!-- end preview --&amp;gt;&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;)
&lt;&#x2F;span&gt;&lt;span&gt;            text&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ff79c6;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span&gt;split(delimiter)[&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bd93f9;&quot;&gt;0&lt;&#x2F;span&gt;&lt;span&gt;]
&lt;&#x2F;span&gt;&lt;span&gt;        &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ff79c6;&quot;&gt;end
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ff79c6;&quot;&gt;end
&lt;&#x2F;span&gt;&lt;span style=&quot;font-style:italic;color:#66d9ef;&quot;&gt;Liquid&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ff79c6;&quot;&gt;::&lt;&#x2F;span&gt;&lt;span style=&quot;font-style:italic;color:#66d9ef;&quot;&gt;Template&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ff79c6;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span&gt;register_filter(&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffffff;&quot;&gt;ExtendedFilters&lt;&#x2F;span&gt;&lt;span&gt;)
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ff79c6;&quot;&gt;end
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;This is backed up by some Liquid markup in my site&#x27;s index.html which looks for the HTML comment &lt;code&gt;&amp;lt;!-- end preview --&amp;gt;&lt;&#x2F;code&gt; in the posts that are listed on the home page. If it&#x27;s there, the post is run through the preview filter and cut at the point the comment appears.&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;handlebars&quot; style=&quot;background-color:#282a36;color:#f8f8f2;&quot; class=&quot;language-handlebars &quot;&gt;&lt;code class=&quot;language-handlebars&quot; data-lang=&quot;handlebars&quot;&gt;&lt;span&gt;{% if post.content contains &amp;#39;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#6272a4;&quot;&gt;&amp;lt;!-- end preview --&amp;gt;&lt;&#x2F;span&gt;&lt;span&gt;&amp;#39; %}
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#6be5fd;&quot;&gt;{{ &lt;&#x2F;span&gt;&lt;span style=&quot;font-style:italic;color:#ffb86c;&quot;&gt;post.content&lt;&#x2F;span&gt;&lt;span&gt; | &lt;&#x2F;span&gt;&lt;span style=&quot;font-style:italic;color:#ffb86c;&quot;&gt;preview &lt;&#x2F;span&gt;&lt;span style=&quot;color:#6be5fd;&quot;&gt;}}
&lt;&#x2F;span&gt;&lt;span&gt;    &amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ff79c6;&quot;&gt;p&lt;&#x2F;span&gt;&lt;span&gt;&amp;gt;&amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ff79c6;&quot;&gt;a &lt;&#x2F;span&gt;&lt;span style=&quot;color:#50fa7b;&quot;&gt;href=&lt;&#x2F;span&gt;&lt;span style=&quot;color:#f1fa8c;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#6be5fd;&quot;&gt;{{ &lt;&#x2F;span&gt;&lt;span style=&quot;font-style:italic;color:#ffb86c;&quot;&gt;post.url &lt;&#x2F;span&gt;&lt;span style=&quot;color:#6be5fd;&quot;&gt;}}&lt;&#x2F;span&gt;&lt;span style=&quot;color:#f1fa8c;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;&amp;gt;Read more &lt;&#x2F;span&gt;&lt;span style=&quot;color:#bd93f9;&quot;&gt;&amp;amp;rarr;&lt;&#x2F;span&gt;&lt;span&gt;&amp;lt;&#x2F;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ff79c6;&quot;&gt;a&lt;&#x2F;span&gt;&lt;span&gt;&amp;gt;&amp;lt;&#x2F;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ff79c6;&quot;&gt;p&lt;&#x2F;span&gt;&lt;span&gt;&amp;gt;
&lt;&#x2F;span&gt;&lt;span&gt;{% else %}
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#6be5fd;&quot;&gt;{{ &lt;&#x2F;span&gt;&lt;span style=&quot;font-style:italic;color:#ffb86c;&quot;&gt;post.content &lt;&#x2F;span&gt;&lt;span style=&quot;color:#6be5fd;&quot;&gt;}}
&lt;&#x2F;span&gt;&lt;span&gt;{% endif %}
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;h2 id=&quot;nearlyfreespeech-and-deployment&quot;&gt;NearlyFreeSpeech and deployment&lt;&#x2F;h2&gt;
&lt;p&gt;Like choosing Jekyll, it took me a while before I decided on &lt;a href=&quot;http:&#x2F;&#x2F;www.nearlyfreespeech.net&#x2F;&quot; title=&quot;NearlyFreeSpeech&quot;&gt;NearlyFreeSpeech&lt;&#x2F;a&gt; as my host. Although both &lt;a href=&quot;http:&#x2F;&#x2F;www.heroku.com&#x2F;&quot; title=&quot;Heroku&quot;&gt;Heroku&lt;&#x2F;a&gt; and &lt;a href=&quot;http:&#x2F;&#x2F;pages.github.com&#x2F;&quot; title=&quot;GitHub Pages&quot;&gt;GitHub Pages&lt;&#x2F;a&gt; look like good free options for hosting Jekyll sites, I decided to go with NearlyFreeSpeech as it meant I could do domain registration, DNS and hosting all at the same place. I&#x27;ve also been able to learn a lot as their target market is people who don&#x27;t mind getting hands-on with server administration. Most of the information I&#x27;ve needed has been covered in their extensive FAQ&#x2F;documentation but since most of their setup uses standard Unix&#x2F;Linux command-line tools, there&#x27;s plenty of other places to look too.&lt;&#x2F;p&gt;
&lt;p&gt;Since NearlyFreeSpeech offers SSH, deployment is easy. One option that seems common  on is to host a remote Git repository with a &lt;a href=&quot;http:&#x2F;&#x2F;hayley.ws&#x2F;2010&#x2F;12&#x2F;04&#x2F;getting-jekyll-running.html&quot; title=&quot;getting jekyll running on nearlyfreespeech.net&quot;&gt;post-recieve hook&lt;&#x2F;a&gt; that uses Jekyll to regenerate the site each time a commit is made. Although I&#x27;m planning to use this method in the future, for now I&#x27;m just using rsync over SSH. Although it&#x27;s pretty straightforward, I found &lt;a href=&quot;http:&#x2F;&#x2F;klepas.org&#x2F;jekyll-a-static-site-generator&#x2F;&quot; title=&quot;Jekyll, a static site generator&quot;&gt;this page&lt;&#x2F;a&gt; on Simon Pascal Klein&#x27;s blog quite useful.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;design&quot;&gt;Design&lt;&#x2F;h2&gt;
&lt;p&gt;As with my plan for the site in general, I only had a few goals for the design. I obviously wanted it to be reasonably nice to look at but I also wanted the site to remain readable if someone were to read it without the stylesheet or with a device that doesn&#x27;t use visual stylesheets such as a screen reader. Of course, for 99% of people this isn&#x27;t an issue but I like the idea of keeping the web as accessible as possible. If you&#x27;d like to see what I&#x27;m getting at, you can check out the &lt;a href=&quot;&#x2F;assets&#x2F;building-mitsake-unstyled.html&quot; title=&quot;This post without a stylesheet&quot;&gt;unstyled version&lt;&#x2F;a&gt; of this article.&lt;&#x2F;p&gt;
&lt;p&gt;I think that&#x27;s everything I&#x27;ve set up so far. I do have plans to add extra features such as an RSS feed but I&#x27;ll probably document them as they&#x27;re added.&lt;&#x2F;p&gt;
</content>
    </entry>
    <entry xml:lang="en">
        <title>The first post</title>
        <published>2012-02-19T00:00:00+00:00</published>
        <updated>2012-02-19T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Zak
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://www.mitsake.net/posts/the-first-post/"/>
        <id>https://www.mitsake.net/posts/the-first-post/</id>
        <content type="html" xml:base="https://www.mitsake.net/posts/the-first-post/">&lt;p&gt;As you might guess, this is the first post to my new website. Since this is the first post there&#x27;s not much to it, but most things seem to be functional.&lt;&#x2F;p&gt;
&lt;p&gt;If you&#x27;re interested in the backend, I&#x27;ve built this site using the &lt;a href=&quot;http:&#x2F;&#x2F;jekyllrb.com&#x2F;&quot; title=&quot;Jekyll&quot;&gt;Jekyll&lt;&#x2F;a&gt; static site generator and hosted it using &lt;a href=&quot;http:&#x2F;&#x2F;www.nearlyfreespeech.net&#x2F;&quot; title=&quot;NearlyFreeSpeech&quot;&gt;NearlyFreeSpeech&lt;&#x2F;a&gt;. The main reason I&#x27;ve made mitsake is to learn a little bit more about &lt;a href=&quot;http:&#x2F;&#x2F;www.ruby-lang.org&#x2F;&quot; title=&quot;Ruby&quot;&gt;Ruby&lt;&#x2F;a&gt; and other things like SSH as I build and expand the site. I&#x27;m hoping to document how I&#x27;ve set everything up and the thought process behind the choices I&#x27;ve made in a later post.&lt;&#x2F;p&gt;
&lt;p&gt;The only other functional pages so far are the &lt;a href=&quot;&#x2F;about&#x2F;&quot; title=&quot;About&quot;&gt;about&lt;&#x2F;a&gt; and &lt;a href=&quot;&#x2F;archive&#x2F;&quot; title=&quot;Archive&quot;&gt;archive&lt;&#x2F;a&gt; pages. Please feel free have a look if you&#x27;re looking for a little more content.&lt;&#x2F;p&gt;
</content>
    </entry>
</feed>