<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Such geek. Wow.</title><link>https://www.ericlight.com/index.html</link><description>Recent content on Such geek. Wow.</description><generator>Hugo -- gohugo.io</generator><language>en</language><lastBuildDate>Wed, 04 Dec 2024 00:00:00 +1300</lastBuildDate><atom:link href="https://www.ericlight.com/index.xml" rel="self" type="application/rss+xml"/><item><title>Replacing the Tuya components from a Mercator Ikuü light switch</title><link>https://www.ericlight.com/post/replacing-tuya-mercator-ikuu.html</link><pubDate>Wed, 04 Dec 2024 00:00:00 +1300</pubDate><guid>https://www.ericlight.com/post/replacing-tuya-mercator-ikuu.html</guid><description>&lt;img src="https://www.ericlight.com/post/replacing-tuya-mercator-ikuu/esp-12f-installed.jpeg" alt="Featured image of post Replacing the Tuya components from a Mercator Ikuü light switch" /&gt;&lt;h2 id="tldr"&gt;TL;DR
&lt;/h2&gt;&lt;ul&gt;
&lt;li&gt;You can replace the Tuya WB3S with an Espressif ESP-12F (or ESP-12E) and ESPHome.&lt;/li&gt;
&lt;li&gt;You need to pull EN up to 3.3v, &lt;strong&gt;and&lt;/strong&gt; pull GPIO15 down to ground via a 10k resistor.&lt;/li&gt;
&lt;li&gt;If you&amp;rsquo;re on Linux, make sure your user is in the &lt;code&gt;dialout&lt;/code&gt; group to write to the ESP-12.&lt;/li&gt;
&lt;li&gt;Scroll to the end for the YAML.
&lt;ul&gt;
&lt;li&gt;Comment out the appropriate buttons for your model.&lt;/li&gt;
&lt;li&gt;I&amp;rsquo;ve confirmed that SSW01G-WIFI uses button 2, and SSW02G-WIFI uses buttons 1 and 3. Presumably SSW03G-WIFI uses all of them, but I don&amp;rsquo;t have one to confirm.&lt;/li&gt;
&lt;li&gt;Make sure you change &lt;code&gt;light.toggle&lt;/code&gt; into &lt;code&gt;fan.toggle&lt;/code&gt; if you decide to declare a button as a fan, etc.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="the-article"&gt;The article
&lt;/h2&gt;&lt;p&gt;The Mercator Ikuü range of smart devices is another rebranded Tuya line. As a result, controlling the device with Home Assistant was slow due to the calls to the Tuya datacentre — and honestly I just wanted to have devices that are entirely under my control. I started by disassembling the switch and immediately saw the Tuya WB3S on the underside of the top plate.&lt;/p&gt;
&lt;figure&gt;&lt;img src="https://www.ericlight.com/post/replacing-tuya-mercator-ikuu/switch-disassembled.jpeg"
			alt="The disassembled switch: a yellow plastic case with a green circuit board"&gt;&lt;figcaption&gt;
			&lt;p&gt;The switch, opened up. The controlling PCB sits on the underside of the top plate.&lt;/p&gt;
		&lt;/figcaption&gt;
&lt;/figure&gt;

&lt;p&gt;Be careful lifting this PCB out, as there are pins connecting it to the 240v plane — make sure you lift it straight. This set of connecting pins is labelled CN1, and is responsible for connecting the controlling MCU to the 240v relays.&lt;/p&gt;
&lt;p&gt;On the board is the Tuya WB3S, and a Holtek BS813A-1 touch-button sensor (&lt;a class="link" href="https://www.holtek.com.tw/page/vg/BS81xA-x" target="_blank" rel="noopener"
 &gt;https://www.holtek.com.tw/page/vg/BS81xA-x&lt;/a&gt;). It does not appear to contain a TuyaMCU chip. The same board is used for the SSW01G-WIFI, SSW02G-WIFI, and SSW03G-WIFI models — it seems the SSW04G-WIFI is a different board.&lt;/p&gt;
&lt;figure&gt;&lt;img src="https://www.ericlight.com/post/replacing-tuya-mercator-ikuu/holtek-bs813a-pinout.png"
			alt="Pinout diagram of the Holtek BS813A-1 in an 8SOP-A package" width="320"&gt;&lt;figcaption&gt;
			&lt;p&gt;The Holtek BS813A-1 touch sensor pinout.&lt;/p&gt;
		&lt;/figcaption&gt;
&lt;/figure&gt;

&lt;p&gt;The way this Holtek sensor works is, while a touch is sensed by the Key1 leg, it will pull Kout1 down to zero volts. This is momentary and returns to 3.3v once the touch is removed. The MCU listens for the appropriate pin to be pulled low, and triggers a relay in response.&lt;/p&gt;
&lt;figure&gt;&lt;img src="https://www.ericlight.com/post/replacing-tuya-mercator-ikuu/board-cn1-and-wb3s.jpeg"
			alt="The controller PCB, showing the WB3S module and the CN1 header with a red arrow pointing at one end"&gt;&lt;figcaption&gt;
			&lt;p&gt;The controller board. The red arrow marks where I (incorrectly) oriented my CN1 numbering from.&lt;/p&gt;
		&lt;/figcaption&gt;
&lt;/figure&gt;

&lt;p&gt;The red arrow is where I (incorrectly) oriented my CN1 naming from. I&amp;rsquo;ll refer to the CN1 pins in reading order; pins 1-5 on the top row, pins 6-10 on the bottom. After writing this, I realised that this is almost certainly backwards: the bottom-right pin — what I call pin 10 — has a square base, indicating it should have been pin 1. Oh well.&lt;/p&gt;
&lt;p&gt;Here&amp;rsquo;s the pinout of the Tuya WB3S, from &lt;a class="link" href="https://docs.libretiny.eu/boards/wb3s/" target="_blank" rel="noopener"
 &gt;https://docs.libretiny.eu/boards/wb3s/&lt;/a&gt;:&lt;/p&gt;
&lt;figure&gt;&lt;img src="https://www.ericlight.com/post/replacing-tuya-mercator-ikuu/wb3s-pinout.png"
			alt="Pinout diagram of the Tuya WB3S module"&gt;&lt;figcaption&gt;
			&lt;p&gt;The Tuya WB3S pinout, via LibreTiny.&lt;/p&gt;
		&lt;/figcaption&gt;
&lt;/figure&gt;

&lt;p&gt;Note, the grey numbers in the WB3S pinout are simply positions; the pin names are burgundy (i.e., P23 is in position 2). I can see PCB traces at positions 15, 14, 13, 12, 10, 9 (GND), and 8 (3.3v). Positions 17-22 are visibly unsoldered.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;WB3S GND (position 9) goes to CN1 Pins 1 &amp;amp; 2&lt;/li&gt;
&lt;li&gt;WB3S 3.3v (position 8) goes to CN1 Pin 6&lt;/li&gt;
&lt;li&gt;WB3S P6 (position 7) goes to CN1 Pin 7, via resistor R7, and on to LED1&lt;/li&gt;
&lt;li&gt;WB3S P7 (position 10) goes to CN1 pin 9, via resistor R14, and on to LED3&lt;/li&gt;
&lt;li&gt;WB3S P8 (position 14) goes to capacitor C2 and onto CN1 pins 1 &amp;amp; 2&lt;/li&gt;
&lt;li&gt;WB3S P9 (position 13) goes to CN1 pin 8, via resistor R13 and LED2 (empty on this model)&lt;/li&gt;
&lt;li&gt;WB3S P10 (position 15) goes to resistor R2, which is empty on this model&lt;/li&gt;
&lt;li&gt;WB3S P24 (position 6) goes to resistor R11, which goes on to LED4 (plate lighting)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;And the inverse to cross-check myself: on CN1, I can see upper PCB traces at 1, 2, 6, 7 and 8 — plus an underside trace to 9.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;CN1 Pin 1 goes to WB3S GND (position 9)&lt;/li&gt;
&lt;li&gt;CN1 Pin 2 goes to WB3S GND (position 9)&lt;/li&gt;
&lt;li&gt;CN1 Pin 6 goes to WB3S 3.3v (position 8)&lt;/li&gt;
&lt;li&gt;CN1 Pin 7 goes to WB3S P6 (position 7) via resistor R7, which then goes to LED1&lt;/li&gt;
&lt;li&gt;CN1 Pin 8 goes to WB3S P9 (position 13) — this also traces to R13, which is empty on this model, and appears to be for the absent middle switch LED2&lt;/li&gt;
&lt;li&gt;CN1 Pin 9 goes to WB3S P7 (position 10) via resistor R14, and onward to LED3&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;I double-checked this by powering up the WB3S chip and checking the voltage on the pins as I hit the buttons. All seems correct so far. Before I desoldered the WB3S on the board, I connected RX and TX and dumped the Tuya firmware, and decoded this with the OpenBeken flash tool from &lt;a class="link" href="https://github.com/openshwprojects/BK7231GUIFlashTool" target="_blank" rel="noopener"
 &gt;https://github.com/openshwprojects/BK7231GUIFlashTool&lt;/a&gt;. Here are the interpreted results:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Device configuration, as extracted from Tuya:
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;- Button (channel 1) on P24 [pinout position 6]
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;- Relay (channel 2) on P7 [pinout position 10]
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;- Button (channel 2) on P8 [pinout position 14]
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;- Relay (channel 1) on P6 [pinout position 7]
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Device seems to be using WB3S module, which is using BK7231T.
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;And the Tuya section starts, as usual, at 2023424
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;These results didn&amp;rsquo;t align with my original tracing, so it was really lucky I did this. Although I had correctly identified the relays in position 7 &amp;amp; 10, I had misunderstood how the buttons work. It was thanks to this discrepancy that I started testing the levels while touching the touch sensors, and discovered that button-presses cause the voltage to drop on P8 (position 14) and P24 (position 6). This led me to read up on how the Holtek chip works, helping me to understand what&amp;rsquo;s going on here!&lt;/p&gt;
&lt;p&gt;So, indeed we have two buttons and two relays. The buttons are held HIGH while untouched, and momentarily drop to LOW when touch is detected. In turn, these state changes trigger toggles to the relay outputs. I can finally start writing YAML!&lt;/p&gt;
&lt;p&gt;I&amp;rsquo;m replacing this Tuya WB3S with an Espressif ESP12-F, which is largely a perfect drop-in replacement:&lt;/p&gt;
&lt;figure&gt;&lt;img src="https://www.ericlight.com/post/replacing-tuya-mercator-ikuu/esp-12f-pinout.jpeg"
			alt="ESP-12 pinout diagram" width="500"&gt;&lt;figcaption&gt;
			&lt;p&gt;The ESP-12 pinout.&lt;/p&gt;
		&lt;/figcaption&gt;
&lt;/figure&gt;

&lt;p&gt;Translating from the WB3S, it appears:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;P24 (position 6 on the WB3S) maps to GPIO12 on the ESP12&lt;/li&gt;
&lt;li&gt;P7 (position 10 on the WB3S) maps to GPIO15 on the ESP12&lt;/li&gt;
&lt;li&gt;P8 (position 14 on the WB3S) maps to GPIO5 on the ESP12&lt;/li&gt;
&lt;li&gt;P6 (position 7 on the WB3S) maps to GPIO13 on the ESP12&lt;/li&gt;
&lt;li&gt;P10 (position 15 on the WB3S) maps to RX on the ESP12&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Additionally, EN needs to be pulled up to 3.3v, and GPIO15 needs to be pulled down to ground via a 10k resistor.&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;This is my first time programming an ESP12 (my previous ESPHome devices have been ESP32&amp;rsquo;s), and I did find them a little more difficult — I ended up bumping into a permissions problem, and thanks to &lt;a class="link" href="https://community.home-assistant.io/t/solved-flashing-failing-immediately-on-linux/567332" target="_blank" rel="noopener"
 &gt;this post&lt;/a&gt; I was able to resolve the error &lt;code&gt;failed to execute 'open' on 'SerialPort': Failed to open serial port&lt;/code&gt;. The solution was either to add myself to the &lt;code&gt;dialout&lt;/code&gt; group, or set the ACL on &lt;code&gt;ttyUSB0&lt;/code&gt; (only a transient workaround):&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;sudo setfacl -m u:USERNAME:rw /dev/ttyUSB0
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;sudo usermod -aG dialout USERNAME
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Desoldering the SMT WB3S was enough of a challenge that I asked a friend for help, and he did the first couple for me while I waited for a hot plate to arrive from AliExpress. Then I did the third one and only slightly cooked my board.&lt;/p&gt;
&lt;figure&gt;&lt;img src="https://www.ericlight.com/post/replacing-tuya-mercator-ikuu/esp-12f-installed.jpeg"
			alt="The PCB with an ESP-12F soldered in place of the WB3S, with a resistor bodged across two pads"&gt;&lt;figcaption&gt;
			&lt;p&gt;The ESP-12F in place, complete with the 10k pull-down bodge resistor.&lt;/p&gt;
		&lt;/figcaption&gt;
&lt;/figure&gt;

&lt;p&gt;Result! Not only is this 100% locally-controlled and forever disconnected from the Tuya Cloud, but the response time is ridiculously fast now. What used to be 200~2000ms response time (yes really, depending on network congestion), is now closer to 20ms (unmeasurably fast with my zero instruments).&lt;/p&gt;
&lt;h2 id="the-yaml-snippet"&gt;The YAML snippet
&lt;/h2&gt;&lt;p&gt;The YAML for the one-gang, two-gang, and three-gang versions is below. Note this is partial YAML; other important parts such as enabling the API and OTA are left out, but I&amp;rsquo;ll include them below for new folks.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-yaml" data-lang="yaml"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#f92672"&gt;esp8266&lt;/span&gt;:
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;board&lt;/span&gt;: &lt;span style="color:#ae81ff"&gt;esp01_1m&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#f92672"&gt;binary_sensor&lt;/span&gt;:
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#75715e"&gt;# Button 1 - not present on the SSW01G&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; - &lt;span style="color:#f92672"&gt;platform&lt;/span&gt;: &lt;span style="color:#ae81ff"&gt;gpio&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;id&lt;/span&gt;: &lt;span style="color:#ae81ff"&gt;button_1&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;pin&lt;/span&gt;:
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;number&lt;/span&gt;: &lt;span style="color:#ae81ff"&gt;GPIO12&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;inverted&lt;/span&gt;: &lt;span style="color:#66d9ef"&gt;true&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;mode&lt;/span&gt;: &lt;span style="color:#ae81ff"&gt;INPUT_PULLUP&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;on_press&lt;/span&gt;:
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;then&lt;/span&gt;:
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; - &lt;span style="color:#f92672"&gt;light.toggle&lt;/span&gt;: &lt;span style="color:#ae81ff"&gt;switch_1&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;internal&lt;/span&gt;: &lt;span style="color:#66d9ef"&gt;True&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#75715e"&gt;# Button 2 - not present on the SSW02G&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; - &lt;span style="color:#f92672"&gt;platform&lt;/span&gt;: &lt;span style="color:#ae81ff"&gt;gpio&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;id&lt;/span&gt;: &lt;span style="color:#ae81ff"&gt;button_1&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;pin&lt;/span&gt;:
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;number&lt;/span&gt;: &lt;span style="color:#ae81ff"&gt;RX&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;inverted&lt;/span&gt;: &lt;span style="color:#66d9ef"&gt;true&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;mode&lt;/span&gt;: &lt;span style="color:#ae81ff"&gt;INPUT_PULLUP&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;on_press&lt;/span&gt;:
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;then&lt;/span&gt;:
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; - &lt;span style="color:#f92672"&gt;light.toggle&lt;/span&gt;: &lt;span style="color:#ae81ff"&gt;switch_2&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;internal&lt;/span&gt;: &lt;span style="color:#66d9ef"&gt;True&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#75715e"&gt;# Button 3 - not present on the SSW01G&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; - &lt;span style="color:#f92672"&gt;platform&lt;/span&gt;: &lt;span style="color:#ae81ff"&gt;gpio&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;id&lt;/span&gt;: &lt;span style="color:#ae81ff"&gt;button_3&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;pin&lt;/span&gt;:
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;number&lt;/span&gt;: &lt;span style="color:#ae81ff"&gt;GPIO5&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;inverted&lt;/span&gt;: &lt;span style="color:#66d9ef"&gt;true&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;mode&lt;/span&gt;: &lt;span style="color:#ae81ff"&gt;INPUT_PULLUP&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;on_press&lt;/span&gt;:
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;then&lt;/span&gt;:
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; - &lt;span style="color:#f92672"&gt;light.toggle&lt;/span&gt;: &lt;span style="color:#ae81ff"&gt;switch_3&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;internal&lt;/span&gt;: &lt;span style="color:#66d9ef"&gt;True&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#f92672"&gt;output&lt;/span&gt;:
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#75715e"&gt;# Relay 1 - not present on the SSW01G&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; - &lt;span style="color:#f92672"&gt;platform&lt;/span&gt;: &lt;span style="color:#ae81ff"&gt;gpio&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;id&lt;/span&gt;: &lt;span style="color:#ae81ff"&gt;relay_1&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;pin&lt;/span&gt;: &lt;span style="color:#ae81ff"&gt;GPIO13&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#75715e"&gt;# Relay 2 - not present on the SSW02G&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; - &lt;span style="color:#f92672"&gt;platform&lt;/span&gt;: &lt;span style="color:#ae81ff"&gt;gpio&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;id&lt;/span&gt;: &lt;span style="color:#ae81ff"&gt;relay_2&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;pin&lt;/span&gt;: &lt;span style="color:#ae81ff"&gt;GPIO4&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#75715e"&gt;# Relay 3 - not present on the SSW01G&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; - &lt;span style="color:#f92672"&gt;platform&lt;/span&gt;: &lt;span style="color:#ae81ff"&gt;gpio&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;id&lt;/span&gt;: &lt;span style="color:#ae81ff"&gt;relay_3&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;pin&lt;/span&gt;: &lt;span style="color:#ae81ff"&gt;GPIO15&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#75715e"&gt;# Expose the relays as lights and/or fans&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#f92672"&gt;light&lt;/span&gt;:
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#75715e"&gt;# Light 1 - not present on the SSW01G&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; - &lt;span style="color:#f92672"&gt;platform&lt;/span&gt;: &lt;span style="color:#ae81ff"&gt;binary&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;name&lt;/span&gt;: &lt;span style="color:#ae81ff"&gt;Switch 1&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;output&lt;/span&gt;: &lt;span style="color:#ae81ff"&gt;relay_1&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;id&lt;/span&gt;: &lt;span style="color:#ae81ff"&gt;switch_1&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#75715e"&gt;# Light 2 - not present on the SSW02G&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; - &lt;span style="color:#f92672"&gt;platform&lt;/span&gt;: &lt;span style="color:#ae81ff"&gt;binary&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;name&lt;/span&gt;: &lt;span style="color:#ae81ff"&gt;Switch 2&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;output&lt;/span&gt;: &lt;span style="color:#ae81ff"&gt;relay_2&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;id&lt;/span&gt;: &lt;span style="color:#ae81ff"&gt;switch_2&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#75715e"&gt;# Light 3 - not present on the SSW01G&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; - &lt;span style="color:#f92672"&gt;platform&lt;/span&gt;: &lt;span style="color:#ae81ff"&gt;binary&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;name&lt;/span&gt;: &lt;span style="color:#ae81ff"&gt;Switch 3&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;output&lt;/span&gt;: &lt;span style="color:#ae81ff"&gt;relay_3&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;id&lt;/span&gt;: &lt;span style="color:#ae81ff"&gt;switch_3&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#75715e"&gt;# Example of having a fan on button 3 instead - if you do this, you must change&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#75715e"&gt;# the earlier matching button declaration from light.toggle to fan.toggle.&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#f92672"&gt;fan&lt;/span&gt;:
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; - &lt;span style="color:#f92672"&gt;platform&lt;/span&gt;: &lt;span style="color:#ae81ff"&gt;binary&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#75715e"&gt;# Button 3&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;name&lt;/span&gt;: &lt;span style="color:#ae81ff"&gt;Ensuite Fan&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;output&lt;/span&gt;: &lt;span style="color:#ae81ff"&gt;relay_3&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;id&lt;/span&gt;: &lt;span style="color:#ae81ff"&gt;switch_3&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;That&amp;rsquo;s it! Upload that fragment into your normal ESPHome setup, and you should be in business.&lt;/p&gt;
&lt;p&gt;In case you&amp;rsquo;re new to this, below is my standard YAML — this would go at the very top of your YAML code block within your ESPHome device declaration, above the previous stuff. This enables a variety of important bits, plus adds helpful sensors for WiFi info and uptime.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-yaml" data-lang="yaml"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#f92672"&gt;esphome&lt;/span&gt;:
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;name&lt;/span&gt;: &lt;span style="color:#ae81ff"&gt;mercator-ikuu&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;friendly_name&lt;/span&gt;: &lt;span style="color:#e6db74"&gt;&amp;#34;Mercator Ikuu Smart Switch&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#75715e"&gt;# Enable logging&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#f92672"&gt;logger&lt;/span&gt;:
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#75715e"&gt;# Enable Home Assistant API&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#f92672"&gt;api&lt;/span&gt;:
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;encryption&lt;/span&gt;:
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;key&lt;/span&gt;: &lt;span style="color:#75715e"&gt;# for you to fill in&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#75715e"&gt;# Enable over-the-air updates; requires you to have a saved secret&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#f92672"&gt;ota&lt;/span&gt;:
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; - &lt;span style="color:#f92672"&gt;platform&lt;/span&gt;: &lt;span style="color:#ae81ff"&gt;esphome&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;password&lt;/span&gt;: !&lt;span style="color:#ae81ff"&gt;secret ota_password&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#75715e"&gt;# Your wifi connection details; requires you to have saved secrets&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#f92672"&gt;wifi&lt;/span&gt;:
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;ssid&lt;/span&gt;: !&lt;span style="color:#ae81ff"&gt;secret wifi_ssid&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;password&lt;/span&gt;: !&lt;span style="color:#ae81ff"&gt;secret wifi_password&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#75715e"&gt;# Enable open fallback hotspot if wifi connection fails&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;ap&lt;/span&gt;:
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; {}
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#75715e"&gt;# Enables a helpful web portal if wifi connection fails&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#f92672"&gt;captive_portal&lt;/span&gt;:
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#75715e"&gt;# Allows you to browse to the device and have a direct view of what&amp;#39;s happening&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#f92672"&gt;web_server&lt;/span&gt;:
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#75715e"&gt;# Displays wifi signal strength and device uptime&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#f92672"&gt;sensor&lt;/span&gt;:
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; - &lt;span style="color:#f92672"&gt;platform&lt;/span&gt;: &lt;span style="color:#ae81ff"&gt;wifi_signal&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;name&lt;/span&gt;: &lt;span style="color:#ae81ff"&gt;Wifi Signal Strength&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;update_interval&lt;/span&gt;: &lt;span style="color:#ae81ff"&gt;60s&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; - &lt;span style="color:#f92672"&gt;platform&lt;/span&gt;: &lt;span style="color:#ae81ff"&gt;uptime&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;name&lt;/span&gt;: &lt;span style="color:#ae81ff"&gt;Uptime&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#75715e"&gt;# Displays network IP address, connected SSID and BSSID, and MAC&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#f92672"&gt;text_sensor&lt;/span&gt;:
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; - &lt;span style="color:#f92672"&gt;platform&lt;/span&gt;: &lt;span style="color:#ae81ff"&gt;wifi_info&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;ip_address&lt;/span&gt;:
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;name&lt;/span&gt;: &lt;span style="color:#ae81ff"&gt;IP&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;ssid&lt;/span&gt;:
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;name&lt;/span&gt;: &lt;span style="color:#ae81ff"&gt;SSID&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;bssid&lt;/span&gt;:
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;name&lt;/span&gt;: &lt;span style="color:#ae81ff"&gt;BSSID&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;mac_address&lt;/span&gt;:
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;name&lt;/span&gt;: &lt;span style="color:#ae81ff"&gt;MAC&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;</description></item><item><title>task pve-bridge blocked for more than 120 seconds - on Proxmox with MDATP</title><link>https://www.ericlight.com/post/mdfe_bridgebreak.html</link><pubDate>Sun, 13 Mar 2022 00:00:00 +1300</pubDate><guid>https://www.ericlight.com/post/mdfe_bridgebreak.html</guid><description>&lt;img src="https://www.ericlight.com/post/mdfe_bridgebreak/mdatp-bridge1.jpg" alt="Featured image of post task pve-bridge blocked for more than 120 seconds - on Proxmox with MDATP" /&gt;&lt;p&gt;Today I updated and rebooted a bunch of servers - all in a day&amp;rsquo;s work. Everything went fine, until one of the hosts (the big one) didn&amp;rsquo;t boot up again properly.&lt;/p&gt;
&lt;p&gt;I&amp;rsquo;ve got two hosts, both running ProxmoxVE (version 7.1) and Microsoft Defender for Endpoint (version 101.61.69-insiderfast). On reboot, one of the hosts came up fine; the other didn&amp;rsquo;t.&lt;/p&gt;
&lt;p&gt;Long story short, uninstalling mdatp fixed the problem - wild hypothesis, but I suspect it was interfering with either network bridge or interprocess communication.&lt;/p&gt;
&lt;p&gt;The rest of this post is technical info for people who might be able to fix it, and so that this blog post will come up for the other people who inevitably bump into this!&lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;Symptoms - upon boot, the host came up, was apparently able to launch one VM, and recieved a timeout for all subsequent VM&amp;rsquo;s:&lt;/p&gt;
&lt;p&gt;&lt;img alt="A screenshot of the failed VM start actions." class="gallery-image" data-flex-basis="1462px" data-flex-grow="609" height="210" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://www.ericlight.com/post/mdfe_bridgebreak/mdatp-bridge1.jpg" srcset="https://www.ericlight.com/post/mdfe_bridgebreak/mdatp-bridge1_hu_6327a14e3e9952cd.jpg 800w, https://www.ericlight.com/post/mdfe_bridgebreak/mdatp-bridge1.jpg 1280w" width="1280"&gt;&lt;/p&gt;
&lt;p&gt;The lines are truncated, but all those pink lines are showing &lt;code&gt;TASK ERROR: start failed: command '/usr/bin/kvm -id 153 [...]' failed: got timeout&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;I say &amp;lsquo;apparently&amp;rsquo; launched one VM, because I was unable to interact with it - in fact &lt;strong&gt;all&lt;/strong&gt; the launch-on-boot VM&amp;rsquo;s appeared to have booted, except everything about them was non-responsive, including Proxmox stats windows and console.&lt;/p&gt;
&lt;p&gt;Trying to manually interact with the VM&amp;rsquo;s using &lt;code&gt;qm&lt;/code&gt; failed entirely - the console froze, completely unresponsive to either ^C or ^X, until I forcefully disconnected from SSH.&lt;/p&gt;
&lt;p&gt;Checking dmesg revealed a horror story:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-console" data-lang="console"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Mar 13 16:54:36 buckwheat kernel: [ 159.853700] vmbr1: port 1(eth3) entered blocking state
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Mar 13 16:54:36 buckwheat kernel: [ 159.853703] vmbr1: port 1(eth3) entered forwarding state
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Mar 13 16:54:43 buckwheat kernel: [ 166.700586] ixgbe 0000:81:00.1 eth3: NIC Link is Down
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Mar 13 16:54:43 buckwheat kernel: [ 166.701135] vmbr1: port 1(eth3) entered disabled state
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Mar 13 16:54:45 buckwheat kernel: [ 168.294208] ixgbe 0000:81:00.1 eth3: NIC Link is Up 10 Gbps, Flow Control: RX/TX
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Mar 13 16:54:45 buckwheat kernel: [ 168.294343] vmbr1: port 1(eth3) entered blocking state
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Mar 13 16:54:45 buckwheat kernel: [ 168.294349] vmbr1: port 1(eth3) entered forwarding state
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Mar 13 16:54:47 buckwheat pvestatd[5040]: VM 112 qmp command failed - VM 112 qmp command &amp;#39;query-proxmox-support&amp;#39; failed - unable to connect to VM 112 qmp socket - timeout a&amp;gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Mar 13 16:54:50 buckwheat pvestatd[5040]: VM 105 qmp command failed - VM 105 qmp command &amp;#39;query-proxmox-support&amp;#39; failed - unable to connect to VM 105 qmp socket - timeout a&amp;gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Mar 13 16:54:53 buckwheat pvestatd[5040]: VM 115 qmp command failed - VM 115 qmp command &amp;#39;query-proxmox-support&amp;#39; failed - unable to connect to VM 115 qmp socket - timeout a&amp;gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Mar 13 16:54:55 buckwheat pve-guests[11257]: start failed: command &amp;#39;/usr/bin/kvm -id 153 -name Eden -no-shutdown -chardev &amp;#39;socket,id=qmp,path=/var/run/qemu-server/153.qmp,s&amp;gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Mar 13 16:54:56 buckwheat pvesh[5530]: Starting VM 153 failed: start failed: command &amp;#39;/usr/bin/kvm -id 153 -name Eden -no-shutdown -chardev &amp;#39;socket,id=qmp,path=/var/run/qem&amp;gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Mar 13 16:54:56 buckwheat pve-guests[5530]: &amp;lt;root@pam&amp;gt; end task UPID:buckwheat:000015C7:00000710:622D6A6F:startall::root@pam: OK
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Mar 13 16:54:56 buckwheat systemd[1]: Finished PVE guests.
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Mar 13 16:54:56 buckwheat systemd[1]: Reached target Multi-User System.
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Mar 13 16:54:56 buckwheat systemd[1]: Reached target Graphical Interface.
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Mar 13 16:54:56 buckwheat systemd[1]: Starting Update UTMP about System Runlevel Changes...
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Mar 13 16:54:56 buckwheat systemd[1]: systemd-update-utmp-runlevel.service: Succeeded.
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Mar 13 16:54:56 buckwheat systemd[1]: Finished Update UTMP about System Runlevel Changes.
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Mar 13 16:54:56 buckwheat systemd[1]: Startup finished in 4.603s (kernel) + 2min 54.823s (userspace) = 2min 59.427s.
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Mar 13 16:54:56 buckwheat pvestatd[5040]: VM 104 qmp command failed - VM 104 qmp command &amp;#39;query-proxmox-support&amp;#39; failed - unable to connect to VM 104 qmp socket - timeout a&amp;gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Mar 13 16:54:59 buckwheat pvestatd[5040]: VM 153 qmp command failed - VM 153 qmp command &amp;#39;query-proxmox-support&amp;#39; failed - got timeout
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Mar 13 16:54:59 buckwheat pvestatd[5040]: status update time (30.177 seconds)
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Mar 13 16:55:18 buckwheat pvestatd[5040]: VM 104 qmp command failed - VM 104 qmp command &amp;#39;query-proxmox-support&amp;#39; failed - unable to connect to VM 104 qmp socket - timeout a&amp;gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Mar 13 16:55:21 buckwheat pvestatd[5040]: VM 153 qmp command failed - VM 153 qmp command &amp;#39;query-proxmox-support&amp;#39; failed - unable to connect to VM 153 qmp socket - timeout a&amp;gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Mar 13 16:55:24 buckwheat pvestatd[5040]: VM 112 qmp command failed - VM 112 qmp command &amp;#39;query-proxmox-support&amp;#39; failed - unable to connect to VM 112 qmp socket - timeout a&amp;gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Mar 13 16:55:27 buckwheat pvestatd[5040]: VM 105 qmp command failed - VM 105 qmp command &amp;#39;query-proxmox-support&amp;#39; failed - unable to connect to VM 105 qmp socket - timeout a&amp;gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Mar 13 16:55:30 buckwheat pvestatd[5040]: VM 115 qmp command failed - VM 115 qmp command &amp;#39;query-proxmox-support&amp;#39; failed - unable to connect to VM 115 qmp socket - timeout a&amp;gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Mar 13 16:55:30 buckwheat pvestatd[5040]: status update time (30.186 seconds)
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Mar 13 16:55:48 buckwheat pvestatd[5040]: VM 153 qmp command failed - VM 153 qmp command &amp;#39;query-proxmox-support&amp;#39; failed - unable to connect to VM 153 qmp socket - timeout a&amp;gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Mar 13 16:55:51 buckwheat pvestatd[5040]: VM 104 qmp command failed - VM 104 qmp command &amp;#39;query-proxmox-support&amp;#39; failed - unable to connect to VM 104 qmp socket - timeout a&amp;gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Mar 13 16:55:54 buckwheat pvestatd[5040]: VM 115 qmp command failed - VM 115 qmp command &amp;#39;query-proxmox-support&amp;#39; failed - unable to connect to VM 115 qmp socket - timeout a&amp;gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Mar 13 16:55:57 buckwheat pvestatd[5040]: VM 105 qmp command failed - VM 105 qmp command &amp;#39;query-proxmox-support&amp;#39; failed - unable to connect to VM 105 qmp socket - timeout a&amp;gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Mar 13 16:56:00 buckwheat pvestatd[5040]: VM 112 qmp command failed - VM 112 qmp command &amp;#39;query-proxmox-support&amp;#39; failed - unable to connect to VM 112 qmp socket - timeout a&amp;gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Mar 13 16:56:00 buckwheat pvestatd[5040]: status update time (30.191 seconds)
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Mar 13 16:56:00 buckwheat kernel: [ 243.301563] INFO: task wdavdaemon:5583 blocked for more than 120 seconds.
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The wdavdaemon is shown blocking here, but pve-bridge turned up just as frequently in the logs:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-console" data-lang="console"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;root@buckwheat:/var/log# grep blocked syslog
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Mar 13 18:34:14 buckwheat kernel: [ 242.802463] INFO: task wdavdaemon:5740 blocked for more than 120 seconds.
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Mar 13 18:34:14 buckwheat kernel: [ 242.802658] INFO: task wdavdaemon:4899 blocked for more than 120 seconds.
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Mar 13 18:34:14 buckwheat kernel: [ 242.802840] INFO: task pve-bridge:6117 blocked for more than 120 seconds.
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Mar 13 18:34:14 buckwheat kernel: [ 242.802945] INFO: task pve-bridge:7734 blocked for more than 120 seconds.
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Mar 13 18:34:14 buckwheat kernel: [ 242.803057] INFO: task pve-bridge:9120 blocked for more than 120 seconds.
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Mar 13 18:34:14 buckwheat kernel: [ 242.803170] INFO: task pve-bridge:10283 blocked for more than 120 seconds.
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Mar 13 18:36:15 buckwheat kernel: [ 363.631430] INFO: task wdavdaemon:5740 blocked for more than 241 seconds.
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Mar 13 18:36:15 buckwheat kernel: [ 363.631610] INFO: task wdavdaemon:4899 blocked for more than 241 seconds.
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Mar 13 18:36:15 buckwheat kernel: [ 363.631776] INFO: task pve-bridge:6117 blocked for more than 241 seconds.
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Mar 13 18:36:15 buckwheat kernel: [ 363.631872] INFO: task pve-bridge:7734 blocked for more than 241 seconds.
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;So the interesting thing is that another node - foxtail - was also updated to the same version of both Proxmox and mdatp. The only obvious difference I can see are the numbers of VLANs each of them are bridging to:&lt;/p&gt;
&lt;p&gt;This is a list of the bridges now, when they&amp;rsquo;re both working (sorry, Markdown hates tabs; the below should be four tidy columns):&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-console" data-lang="console"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;root@foxtail:/var/log# brctl show
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;bridge name	bridge id		STP enabled	interfaces
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;fwbr101i0	8000.9e7164f22bab	no		fwln101i0
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;							tap101i0
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;vmbr0		8000.c2602668d5f4	no		eno1
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;							fwpr101p0
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;							tap100i0
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;							tap109i0
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;versus&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-console" data-lang="console"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;root@buckwheat:/var/log# brctl show
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;bridge name	bridge id		STP enabled	interfaces
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;fwbr102i0	8000.6	abd66965438	no		fwln102i0
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;							tap102i0
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;fwbr104i0	8000.f60b3f1a3118	no		fwln104i0
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;							tap104i0
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;fwbr105i0	8000.961281d6d5dc	no		fwln105i0
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;							tap105i0
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;vmbr0		8000.90e2bad572a8	no		eth2
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;							tap112i0
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;							tap115i0
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;							tap153i0
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;vmbr0v5		8000.0ea35ee013ba	no		eth2.5
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;							fwpr104p0
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;vmbr0v666	8000.1a23193ccf17	no		eth2.666
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;							fwpr102p0
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;							fwpr105p0
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;vmbr1		8000.90e2bad572a9	no		eth3
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;But when buckwheat was broken, the majority of the bridges were not visible:&lt;/p&gt;
&lt;p&gt;&lt;img alt="A screenshot of the active bridges on each VM host. Buckwheat is missing a lot." class="gallery-image" data-flex-basis="2118px" data-flex-grow="882" height="145" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://www.ericlight.com/post/mdfe_bridgebreak/mdatp-bridge2.jpg" srcset="https://www.ericlight.com/post/mdfe_bridgebreak/mdatp-bridge2_hu_eda51eb7137e999c.jpg 800w, https://www.ericlight.com/post/mdfe_bridgebreak/mdatp-bridge2.jpg 1280w" width="1280"&gt;&lt;/p&gt;
&lt;p&gt;At some point during troubleshooting, I restarted pvedaemon - although the service had started correctly, the restart failed with error: &lt;code&gt;timeout waiting on systemd&lt;/code&gt;.&lt;/p&gt;</description></item><item><title>Goldenhorse - Wake Up Brother bass tab</title><link>https://www.ericlight.com/post/wake_up_brother.html</link><pubDate>Sat, 19 Feb 2022 00:00:00 +1300</pubDate><guid>https://www.ericlight.com/post/wake_up_brother.html</guid><description>&lt;p&gt;I know Goldenhorse didn&amp;rsquo;t get particularly huge, but I always really enjoyed their work. Wake Up Brother is one of those ones that really feels like an achievable song for a small band - it&amp;rsquo;s got solid, driving bass; a groovy bright guitar line; and requires quite a dynamic singer to pull it off.&lt;/p&gt;
&lt;p&gt;Some friends and I are planning to add it to our band&amp;rsquo;s repertoire, but the bassline is a bit too complex for us to transcribe properly. And the song wasn&amp;rsquo;t particularly well-known, so there&amp;rsquo;s really only one public bass tab, and it wasn&amp;rsquo;t really comprehensive enough&amp;hellip; So I turned to Fiverr!&lt;/p&gt;
&lt;p&gt;There are a bunch of folks there who will transcribe bass tab - but one of them stuck out to me, so I decided to work with &lt;a class="link" href="https://www.fiverr.com/georgex0006" target="_blank" rel="noopener"
 &gt;georgex0006&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;I was &lt;em&gt;super&lt;/em&gt; impressed with his speed and quality of work. I never could have nailed the bassline as well as he did, and providing a playalong video as well is 100% awesome.&lt;/p&gt;
&lt;p&gt;I&amp;rsquo;m sharing the bass tab and playalong here, with his permission. If you need someone to do some bass tab for you, please give him your support!&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Tab &amp;amp; score &lt;a class="link" href="https://www.ericlight.com/files/Wake-up-brother.pdf" &gt;PDF Version here&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Playalong &lt;a class="link" href="https://www.ericlight.com/files/Wake-up-brother.mp4" &gt;MP4 Version here&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;And for my personal use (and yours, if you own the album), I purchased a .FLAC of the track which is stored &lt;a class="link" href="https://www.ericlight.com/files/Goldenhorse-WakeUpBrother.flac" &gt;here&lt;/a&gt;. However if you don&amp;rsquo;t already own it, please pay for it yourself first, or listen to it on &lt;a class="link" href="https://www.youtube.com/watch?v=RgFl4CpBX8U" target="_blank" rel="noopener"
 &gt;YouTube&lt;/a&gt; where they can deal with copyright issues.&lt;/p&gt;</description></item><item><title>Seltzer brewing</title><link>https://www.ericlight.com/post/seltzer.html</link><pubDate>Sun, 12 Dec 2021 00:00:00 +1300</pubDate><guid>https://www.ericlight.com/post/seltzer.html</guid><description>&lt;p&gt;I got into brewing seltzer during the spring of 2021, and these are my notes. They&amp;rsquo;re in descending order, so the most-recent are at the top. The notes got progressively less-detailed as time went by, so those looking to actually learn things (e.g. &amp;ldquo;How much yeast nutrient should I use in a seltzer that&amp;rsquo;s 100% dextrose&amp;rdquo;) should read the highlights and then read from bottom-up. :)&lt;/p&gt;
&lt;h1 id="highlights"&gt;Highlights:
&lt;/h1&gt;&lt;ul&gt;
&lt;li&gt;Kveik Voss is fast-fermenting and relatively transparent flavour. Excellent for seltzer&lt;/li&gt;
&lt;li&gt;It does take a couple days post-fining for the yeast scent to diminish&lt;/li&gt;
&lt;li&gt;Recycling yeast is tricky with seltzer due to all the fruit sediment&lt;/li&gt;
&lt;li&gt;With only sugars and fruit flesh, yeast nutrient is essential - about 15 grams seems to do the trick&lt;/li&gt;
&lt;li&gt;One kg of dextrose in 19 litres will raise the ABV by approximately 2.65%&lt;/li&gt;
&lt;li&gt;Don&amp;rsquo;t boil the fruit or you&amp;rsquo;ll get pectin haze; raise it to about 75°C to sterilise it, though&lt;/li&gt;
&lt;li&gt;Table sugar is a perfectly passable sugar; make invert sugar by boiling it with a little citric acid, 20-60 minutes&lt;/li&gt;
&lt;li&gt;Citric acid is &lt;em&gt;amazing&lt;/em&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h1 id="fruit-notes"&gt;Fruit notes:
&lt;/h1&gt;&lt;ul&gt;
&lt;li&gt;Mashing the fruit a little bit is a significant factor in releasing the fruit flavours&lt;/li&gt;
&lt;li&gt;Lychee have quite a prominent character, good to pair with something that can compete&lt;/li&gt;
&lt;li&gt;Mandarins will impart &lt;em&gt;very&lt;/em&gt; little flavour unless you mash them really good pre-ferment&lt;/li&gt;
&lt;li&gt;Jackfruit is almost undetectable, even with two cans; will try blending next time&lt;/li&gt;
&lt;li&gt;Pineapple seems to digest(?) other fruits. The other fruit becomes quickly less-noticable while the pineapple becomes more prominent&lt;/li&gt;
&lt;li&gt;Raspberries create a visually beautiful brew, as do plums&lt;/li&gt;
&lt;li&gt;Passionfruit pulp is pretty disappointing; in brew #7 I used THREE cans, and it was nearly undetectable&lt;/li&gt;
&lt;li&gt;Mango is pretty awful, really - lots of fruit mush, lots of haze, some weird aged-fruit flavour&amp;hellip; avoid imho&lt;/li&gt;
&lt;/ul&gt;
&lt;h1 id="yeast-awakener"&gt;Yeast Awakener
&lt;/h1&gt;&lt;p&gt;To reawaken the yeast from the fridge, I make a mix of:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;A tablespoon of sugar (any variety, often dextrose)&lt;/li&gt;
&lt;li&gt;10 grams chopped raisins OR 2tsp lemon juice&lt;/li&gt;
&lt;li&gt;6 grams Marmite&lt;/li&gt;
&lt;li&gt;Pinch of yeast nutrient&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Once those are dissolved together, I pour in collected yeast from the previous batch.&lt;/p&gt;
&lt;h1 id="other-thoughts"&gt;Other thoughts:
&lt;/h1&gt;&lt;ul&gt;
&lt;li&gt;2022-01-04 - my brews are still coming out very sweet - I&amp;rsquo;m yearning for something with a dryer character. Hard seltzer was featured in an exBEERiment on Brulosophy on the &lt;a class="link" href="https://brulosophy.com/2021/03/22/hard-seltzer-sucrose-vs-dextrose-exbeeriments-results/" target="_blank" rel="noopener"
 &gt;difference between dextrose and sucrose&lt;/a&gt; (it seems table sugar will be fine!), where Phil mentions using the W04 Paramount wine yeast(!), along with 32g of yeast nutrient(!!). Perhaps this will solve my sweet brews? Might also get my water acidity tested to make sure it&amp;rsquo;s at a good pH for the fermentation.&lt;/li&gt;
&lt;li&gt;2022-01-21 - the increased yest nutrient is working out very well; much cleaner and dryer - 25g seems good. Ordered some Fermaid AT today as well to see if a slower release of yeast-available nitrogen (YAN) will support the yeast better&lt;/li&gt;
&lt;/ul&gt;
&lt;hr&gt;
&lt;h1 id="recipes-and-notes"&gt;Recipes and notes
&lt;/h1&gt;&lt;h3 id="brew-11-2022-03-12---brewing-blueberry-and-mandarin-seltzer---large-edition"&gt;Brew #11, 2022-03-12 - brewing: Blueberry and Mandarin Seltzer - large edition
&lt;/h3&gt;&lt;p&gt;&lt;strong&gt;Recipe:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;3kg invert table sugar&lt;/li&gt;
&lt;li&gt;10g Citric acid&lt;/li&gt;
&lt;li&gt;15g+15g Fermaid-AT&lt;/li&gt;
&lt;li&gt;Kveik Voss&lt;/li&gt;
&lt;li&gt;310g tinned mandarins&lt;/li&gt;
&lt;li&gt;1275g tinned blueberries&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Notes:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Decided it was high time to brew a larger batch - this is a 25 litre brew&lt;/li&gt;
&lt;li&gt;The citric acid has been amazing - boosted the quantity in this one to compensate for the larger proportion of fruit&lt;/li&gt;
&lt;li&gt;Dosed 15g of Fermaid-AT at inital brew; will dose another 15g at 3 days&lt;/li&gt;
&lt;li&gt;Looking to try some amylase enzyme to see if I can really dry out the seltzer&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="brew-10-2022-02-20---2022-02-28-blueberry-and-mandarin-seltzer"&gt;Brew #10, 2022-02-20 - 2022-02-28: Blueberry and Mandarin Seltzer
&lt;/h3&gt;&lt;p&gt;&lt;strong&gt;Recipe:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;2kg white table sugar (see notes)&lt;/li&gt;
&lt;li&gt;5g Citric acid&lt;/li&gt;
&lt;li&gt;10g+10g yeast nutrient (Fermaid-AT)&lt;/li&gt;
&lt;li&gt;A fresh Kveik Voss&lt;/li&gt;
&lt;li&gt;310g tinned mandarins&lt;/li&gt;
&lt;li&gt;850g tinned blueberries&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Notes:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;My Fermaid-AT has arrived! It&amp;rsquo;s used at a rate up to 1g/l in low-YAN environments, so used 10g and will add another 10g in 2 days&lt;/li&gt;
&lt;li&gt;Two batches of 10g FermaidAT was pretty good, the Kveik chews that stuff up super-quick, literally over 36 hours&lt;/li&gt;
&lt;li&gt;I really liked this combination so revisiting the double-blueberry and mandarin with a couple tweaks&lt;/li&gt;
&lt;li&gt;The invert sugar experiment seemed to be a success, so 2kg table sugar + 5g citric acid; boil for 20mins&lt;/li&gt;
&lt;li&gt;Easily one of my favourites - possibly &lt;strong&gt;THE&lt;/strong&gt; favourite - so far. 4/5, only minor improvements&lt;/li&gt;
&lt;li&gt;Update, citric acid is &lt;em&gt;amazing&lt;/em&gt;, absolutely brings the zing that I was craving. Still getting sweet brews but much more balanced now&lt;/li&gt;
&lt;li&gt;Next brew will try 15g+10g nutrient&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="brew-9-2022-01-26---2022-02-01-apple-mango-and-guava-seltzer"&gt;Brew #9, 2022-01-26 - 2022-02-01: Apple, Mango, and Guava Seltzer
&lt;/h3&gt;&lt;p&gt;&lt;strong&gt;Recipe:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;2kg white table sugar (see notes)&lt;/li&gt;
&lt;li&gt;4g Citric acid&lt;/li&gt;
&lt;li&gt;23g yeast nutrient&lt;/li&gt;
&lt;li&gt;My weird hybrid yeast now (see notes)&lt;/li&gt;
&lt;li&gt;1kg diced apple&lt;/li&gt;
&lt;li&gt;410g tinned guava&lt;/li&gt;
&lt;li&gt;850g mango pulp&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Notes:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;I ran out of yeast nutrient so only 23g this time&lt;/li&gt;
&lt;li&gt;Overshot water, but had lots more fruit than normal so this is a 24l batch&lt;/li&gt;
&lt;li&gt;Decided to attempt invert sugar instead of dextrose! 2kg table sugar + 4g citric acid; boil for 20mins&lt;/li&gt;
&lt;li&gt;The Kveik Voss + Mangrove Jack&amp;rsquo;s Seltzer yeast is doing the job very nicely&lt;/li&gt;
&lt;li&gt;Initial flavour suggests this might be a goodie.&lt;/li&gt;
&lt;li&gt;Final flavour - meh. 2/5, I wouldn&amp;rsquo;t brew this again. The citric acid seemed to be a good call though.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="brew-8-2022-01-16---2022-01-21-blueberry-and-mandarin-seltzer"&gt;Brew #8, 2022-01-16 - 2022-01-21: Blueberry and Mandarin Seltzer
&lt;/h3&gt;&lt;p&gt;&lt;strong&gt;Recipe:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;1.7kg Dextrose, 300g white sugar&lt;/li&gt;
&lt;li&gt;Kveik Voss plus Mangrove Jacks&amp;rsquo; Seltzer yeast&lt;/li&gt;
&lt;li&gt;25g yeast nutrient&lt;/li&gt;
&lt;li&gt;310g tinned mandarins&lt;/li&gt;
&lt;li&gt;850g tinned blueberries&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Notes:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Previous run went very well (much drier result), so bumped nutrient to 25g!&lt;/li&gt;
&lt;li&gt;Recycled the Kveik Voss + MJ&amp;rsquo;s Seltzer yeast from last batch; seemed pretty okay&lt;/li&gt;
&lt;li&gt;Result - an absolute banger! Really delicious; next time I&amp;rsquo;ll replace the mandarin with something more acidic though&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="brew-7-2022-01-05---2022-01-10-pineapple-passion-seltzer"&gt;Brew #7, 2022-01-05 - 2022-01-10: Pineapple Passion Seltzer
&lt;/h3&gt;&lt;p&gt;&lt;strong&gt;Recipe:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;2kg Dextrose&lt;/li&gt;
&lt;li&gt;Kveik Voss plus Mangrove Jacks&amp;rsquo; Seltzer yeast&lt;/li&gt;
&lt;li&gt;20g yeast nutrient&lt;/li&gt;
&lt;li&gt;420g tinned crushed pineapple&lt;/li&gt;
&lt;li&gt;510g tinned passionfruit pulp&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Notes:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Increased yeast nutrient to 20g this time, will see if it makes a difference. (Update - huge difference!)&lt;/li&gt;
&lt;li&gt;&lt;em&gt;Probably&lt;/em&gt; made a mistake with my yeast. I&amp;rsquo;d started up some Mangrove Jacks&amp;rsquo; seltzer yeast to try&amp;hellip; but then remembered how slow it is, so I pitched some fresh Kviek on top of it. Eek&amp;hellip; I expect the Seltzer yeast to create some off flavours at 36°&lt;/li&gt;
&lt;li&gt;Also made a mistake with the yeast nutrient - I completely forgot it until the fermenter was already in the fridge! Boiled some up and added it in, hopefully it doesn&amp;rsquo;t really need much boiling.&lt;/li&gt;
&lt;li&gt;Result - this one wasn&amp;rsquo;t a winner for me. It was dry like I wanted, but the passionfruit was a big disappointment&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="brew-6-2021-12-28---2022-01-02-plum-pineapple-and-mandarin-seltzer"&gt;Brew #6, 2021-12-28 - 2022-01-02: Plum, Pineapple, and Mandarin Seltzer
&lt;/h3&gt;&lt;p&gt;&lt;strong&gt;Recipe:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;2kg Dextrose&lt;/li&gt;
&lt;li&gt;Kveik Voss yeast&lt;/li&gt;
&lt;li&gt;14g yeast nutrient&lt;/li&gt;
&lt;li&gt;850g tinned Black Doris plums&lt;/li&gt;
&lt;li&gt;420g tinned crushed pineapple&lt;/li&gt;
&lt;li&gt;310g tinned mandarins&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Notes:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Thoroughly crushed the plums and mandarins with the back of a fork this time&lt;/li&gt;
&lt;li&gt;Had real trouble reinvigorating the yeast from the previous brew; might need to order a spare yeast for backup&lt;/li&gt;
&lt;li&gt;10% Brix at start; finished just under 8% Brix&amp;hellip; if this refractometer is accurate, these are very low ABV&lt;/li&gt;
&lt;li&gt;Result - this was absolutely one of my favourites. Great outcome!&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="brew-5-2021-12-21---2021-12-25-pineapple-and-double-raspberry-seltzer"&gt;Brew #5, 2021-12-21 - 2021-12-25: Pineapple and Double Raspberry Seltzer
&lt;/h3&gt;&lt;p&gt;&lt;strong&gt;Recipe:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;2kg Dextrose&lt;/li&gt;
&lt;li&gt;Kveik Voss yeast&lt;/li&gt;
&lt;li&gt;16g yeast nutrient&lt;/li&gt;
&lt;li&gt;850g tinned Raspberries&lt;/li&gt;
&lt;li&gt;420g tinned crushed pineapple&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Notes:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Visually beautiful, great nose, and quite refreshingly delightful to drink.&lt;/li&gt;
&lt;li&gt;The acidity of the raspberry and pineapple combined made this taste much like a kombucha. Weird.&lt;/li&gt;
&lt;li&gt;Failed to take any gravity readings.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="brew-4-2021-12-12---2021-12-17-black-doris-plum-and-pineapple-seltzer"&gt;Brew #4, 2021-12-12 - 2021-12-17: Black Doris Plum and Pineapple Seltzer
&lt;/h3&gt;&lt;p&gt;&lt;strong&gt;Recipe:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;2kg Dextrose&lt;/li&gt;
&lt;li&gt;Kveik Voss yeast&lt;/li&gt;
&lt;li&gt;12g yeast nutrient&lt;/li&gt;
&lt;li&gt;850g tinned Black Doris plums&lt;/li&gt;
&lt;li&gt;850g tinned pineapple (half crushed; half chunks)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Notes:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Initial tasting is very much drier than the others - not sure if this was the acids in the pineapple cutting the sugar, or if the sugar syrup in the cans was way thinner? Either way, this may end up a low percentage.&lt;/li&gt;
&lt;li&gt;Original brix reading looked to be about 7%, suggesting an expected ABV of only 3.6%&lt;/li&gt;
&lt;li&gt;(later): turns out I have no idea how refractometers work. Never mind.&lt;/li&gt;
&lt;li&gt;This recipe came out &lt;em&gt;amazing&lt;/em&gt;, absolutely delicious. Started out with a fairly subtle plum flavour, with the pineapple just becoming perceptible at the end.&lt;/li&gt;
&lt;li&gt;However, during the week the plum flavour diminished and the pineapple flourished. This continued to the point where it was actually really unbalanced; I suspect it was caused by enzymes in the pineapple&amp;hellip; to combat this, next time I&amp;rsquo;ll use only one tin.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="brew-3-2021-12-04---2021-12-10-lychee-and-jackfruit-seltzer"&gt;Brew #3, 2021-12-04 - 2021-12-10: Lychee and Jackfruit Seltzer
&lt;/h3&gt;&lt;p&gt;&lt;strong&gt;Recipe:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;1.2kg Dextrose, plus other assorted sugars to 2kg (approx 5.3%)&lt;/li&gt;
&lt;li&gt;Kveik Voss yeast&lt;/li&gt;
&lt;li&gt;16g yeast nutrient&lt;/li&gt;
&lt;li&gt;850g tinned jackfruit&lt;/li&gt;
&lt;li&gt;560g tinned lychee&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Notes:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Brewing out much quicker now with the increased nutrient&lt;/li&gt;
&lt;li&gt;Lychee is very prominent in finished product. Not overwhelming but definitely star of the show&lt;/li&gt;
&lt;li&gt;Jackfruit brings very little flavour. Next time I might blend it up but worried about post-brew yeast collection&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="brew-3-2021-11-26---2021-12-03-double-raspberry-and-mandarin-seltzer"&gt;Brew #3, 2021-11-26 - 2021-12-03: Double Raspberry and Mandarin Seltzer
&lt;/h3&gt;&lt;p&gt;&lt;strong&gt;Recipe:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;2kg Dextrose (for approx 5.3%)&lt;/li&gt;
&lt;li&gt;Kveik Voss yeast&lt;/li&gt;
&lt;li&gt;16g yeast nutrient&lt;/li&gt;
&lt;li&gt;820g tinned raspberries&lt;/li&gt;
&lt;li&gt;310g tinned mandarins&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Notes:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Doubled the raspberry; reduced the dextrose; tripled the yeast nutrient&lt;/li&gt;
&lt;li&gt;Raspberry far more prominent and yum. Zero impact from mandarin&lt;/li&gt;
&lt;li&gt;Yeast nutrient really helped. Still a bit sweet but far better; probably no need to change&lt;/li&gt;
&lt;li&gt;Adding the dextrose, plus approximate sugar syrup and fruit sugars, suggests a 6% ABV&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="brew-2-2021-11-17-to-2021-11-24-raspberry-and-mandarin-seltzer"&gt;Brew #2, 2021-11-17 to 2021-11-24: Raspberry and Mandarin Seltzer
&lt;/h3&gt;&lt;p&gt;&lt;strong&gt;Recipe:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;2.5kg Dextrose (for approx 6%)&lt;/li&gt;
&lt;li&gt;Kveik Voss yeast&lt;/li&gt;
&lt;li&gt;5g yeast nutrient&lt;/li&gt;
&lt;li&gt;410g tinned raspberries&lt;/li&gt;
&lt;li&gt;310g tinned mandarins&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Method:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Filled keg to 12l line with tap water&lt;/li&gt;
&lt;li&gt;2.5kg Dextrose + 6g nutrient into 3 litres of water. Heated to 80°C&lt;/li&gt;
&lt;li&gt;Took off heat, added tin of raspberries and tin of mandarins, including syrup; mashed up a bit&lt;/li&gt;
&lt;li&gt;Brought temp back up to 75°C, and poured it into 16 litres of room temp water&lt;/li&gt;
&lt;li&gt;Pitched Kveik yeast at 29°C. Total 20 litres ish, fermenting at 32°C&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Notes:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Brew finished on 2021-11-24, exactly a week later&lt;/li&gt;
&lt;li&gt;Kveik ferments much quicker, and very clean; happy&lt;/li&gt;
&lt;li&gt;Mandarin very subtle, raspberry present but light. Still delicious&lt;/li&gt;
&lt;li&gt;Didn&amp;rsquo;t add enough yeast nutrient!! Extremely sweet, but yeast has gone mostly dormant&lt;/li&gt;
&lt;li&gt;Forgot to account for sugars from fruits; happy the yeast went to sleep before I got rocket fuel&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="brew-1-2021-10-25-to-2021-11-12-mangrove-jack"&gt;Brew #1, 2021-10-25 to 2021-11-12: &lt;a class="link" href="https://mangrovejacks.com/products/pineapple-sunset-hard-seltzer" target="_blank" rel="noopener"
 &gt;Mangrove Jack&amp;rsquo;s Pineapple Sunset Hard Seltzer&lt;/a&gt;
&lt;/h3&gt;&lt;p&gt;Brewed as per instructions, but added 12g of &lt;a class="link" href="https://mangrovejacks.com/collections/consumables/products/natural-beer-flavour-boost-passionfruit" target="_blank" rel="noopener"
 &gt;Mangrove Jack&amp;rsquo;s Passionfruit&lt;/a&gt; Beer flavour boost.
Fermented a little slow; took a bit over two weeks to finish&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Tasting notes:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Came out with the same acrid/chemical flavour that many others complain about&lt;/li&gt;
&lt;li&gt;Brewing process super simple, though. Think I can do this myself without a kit&lt;/li&gt;
&lt;/ul&gt;</description></item><item><title>Acronis Cyber Protect and Microsoft Defender on the same Linux system</title><link>https://www.ericlight.com/post/mdfe_acronis.html</link><pubDate>Sun, 07 Nov 2021 00:00:00 +1300</pubDate><guid>https://www.ericlight.com/post/mdfe_acronis.html</guid><description>&lt;p&gt;A few months ago, I &lt;a class="link" href="https://www.ericlight.com/post/mdfe_linux.html" &gt;published what I learned&lt;/a&gt; from playing with the Linux version of &lt;a class="link" href="https://docs.microsoft.com/en-us/microsoft-365/security/defender-endpoint/microsoft-defender-endpoint-linux?view=o365-worldwide" target="_blank" rel="noopener"
 &gt;Microsoft Defender for Endpoint&lt;/a&gt; a few months back. If you&amp;rsquo;re here, you&amp;rsquo;ll have possibly already read my original post. There was a bit of tuning required to get it to behave nicely; just adding some sensible audit logging exclusions.&lt;/p&gt;
&lt;p&gt;Well the Acronis Cyber Protect backup platform has recently been added to the bundle, and it had a few specific requirements, so I&amp;rsquo;ve documented them here.&lt;/p&gt;
&lt;p&gt;There are four Acronis processes which MDATP will spend a lot of time scanning and rescanning. Exclude those from the scanning engine by executing the following commands as root:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;mdatp exclusion process add --path /usr/lib/Acronis/Schedule/schedul2-bin
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;mdatp exclusion process add --path /usr/lib/Acronis/APL/active-protection
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;mdatp exclusion process add --path /opt/acronis/aakore
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;mdatp exclusion process add --path /usr/lib/Acronis/BackupAndRecovery/mms
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;There are also five processes which need to be excluded from auditctl, unless you want your audit logs rotated every ten minutes. Again, these must all be run as root.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;echo -a never,exit -S &lt;span style="color:#ae81ff"&gt;41&lt;/span&gt; -S &lt;span style="color:#ae81ff"&gt;42&lt;/span&gt; -F comm&lt;span style="color:#f92672"&gt;=&lt;/span&gt;&lt;span style="color:#e6db74"&gt;&amp;#34;mms&amp;#34;&lt;/span&gt; -k exclude_acronis &amp;gt;&amp;gt; /etc/audit/rules.d/01-exclusion.rules
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;echo -a never,exit -S &lt;span style="color:#ae81ff"&gt;41&lt;/span&gt; -S &lt;span style="color:#ae81ff"&gt;42&lt;/span&gt; -S &lt;span style="color:#ae81ff"&gt;43&lt;/span&gt; -F comm&lt;span style="color:#f92672"&gt;=&lt;/span&gt;&lt;span style="color:#e6db74"&gt;&amp;#34;adp-agent&amp;#34;&lt;/span&gt; -k exclude_acronis &amp;gt;&amp;gt; /etc/audit/rules.d/01-exclusion.rules
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;echo -a never,exit -S &lt;span style="color:#ae81ff"&gt;41&lt;/span&gt; -S &lt;span style="color:#ae81ff"&gt;42&lt;/span&gt; -S &lt;span style="color:#ae81ff"&gt;43&lt;/span&gt; -S &lt;span style="color:#ae81ff"&gt;288&lt;/span&gt; -F exe&lt;span style="color:#f92672"&gt;=&lt;/span&gt;/usr/lib/Acronis/APL/active-protection -k exclude_acronis &amp;gt;&amp;gt; /etc/audit/rules.d/01-exclusion.rules
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;echo -a never,exit -S &lt;span style="color:#ae81ff"&gt;41&lt;/span&gt; -S &lt;span style="color:#ae81ff"&gt;42&lt;/span&gt; -S &lt;span style="color:#ae81ff"&gt;43&lt;/span&gt; -F exe&lt;span style="color:#f92672"&gt;=&lt;/span&gt;/opt/acronis/bin/updater -k exclude_acronis &amp;gt;&amp;gt; /etc/audit/rules.d/01-exclusion.rules
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;echo -a never,exit -S &lt;span style="color:#ae81ff"&gt;41&lt;/span&gt; -S &lt;span style="color:#ae81ff"&gt;42&lt;/span&gt; -S &lt;span style="color:#ae81ff"&gt;288&lt;/span&gt; -F exe&lt;span style="color:#f92672"&gt;=&lt;/span&gt;/opt/acronis/aakore -k exclude_acronis &amp;gt;&amp;gt; /etc/audit/rules.d/01-exclusion.rules
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Once you&amp;rsquo;ve created the exclusions, you can either reboot or run &lt;code&gt;service auditd restart&lt;/code&gt;. Either way, make sure you run &lt;code&gt;service auditd status&lt;/code&gt; to ensure nothing went wrong with the exclusions.&lt;/p&gt;</description></item><item><title>Microsoft Defender for Endpoint (mdatp) on Debian Sid</title><link>https://www.ericlight.com/post/mdfe_linux.html</link><pubDate>Wed, 07 Jul 2021 00:00:00 +1200</pubDate><guid>https://www.ericlight.com/post/mdfe_linux.html</guid><description>&lt;p&gt;** 2021-08-01 Update: **&lt;/p&gt;
&lt;p&gt;This is a better string to find out what&amp;rsquo;s hitting your audit log: &lt;code&gt;cat /var/log/audit/audit.log* | cut -d ' ' -f26 | sort | uniq -c | sort -n | tail -n 6 | head -n5&lt;/code&gt;&lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;Linux doesn&amp;rsquo;t have many great antivirus options available.&lt;/p&gt;
&lt;p&gt;Don&amp;rsquo;t get me wrong, there are actually a few options nowadays. We&amp;rsquo;ve got the ever-present &lt;a class="link" href="https://www.clamav.net/" target="_blank" rel="noopener"
 &gt;ClamAV&lt;/a&gt;; &lt;a class="link" href="https://www.bitdefender.com" target="_blank" rel="noopener"
 &gt;BitDefender&lt;/a&gt; has a good reputation, but I haven&amp;rsquo;t played with it yet; &lt;a class="link" href="https://www.sophos.com/en-us/support/documentation/sophos-anti-virus-for-linux.aspx?" target="_blank" rel="noopener"
 &gt;Sophos AV&lt;/a&gt; for Linux &lt;em&gt;seems&lt;/em&gt; to be in limbo. &lt;a class="link" href="https://www.eset.com/int/home/antivirus-linux/" target="_blank" rel="noopener"
 &gt;ESET for Linux&lt;/a&gt; exists, as does &lt;a class="link" href="https://techdocs.broadcom.com/us/en/symantec-security-software/endpoint-security-and-management/endpoint-protection/all/getting-up-and-running-on-for-the-first-time-v45150512-d43e1033/installing-clients-with-save-package-v16194723-d21e1502/installing-the-client-for-linux-v95193124-d21e2986.html" target="_blank" rel="noopener"
 &gt;Symantec Endpoint Protection&lt;/a&gt; for Linux. That&amp;rsquo;s a pretty decent range - but they each have some real drawback. Assuming the price is right, you still see compatibility, usability, licensing dramas, or resource drain challenges.&lt;/p&gt;
&lt;p&gt;Most recently, the Linux version of &lt;a class="link" href="https://docs.microsoft.com/en-us/microsoft-365/security/defender-endpoint/microsoft-defender-endpoint-linux?view=o365-worldwide" target="_blank" rel="noopener"
 &gt;Microsoft Defender for Endpoint&lt;/a&gt; entered the playing field. I finally got to play with this and I gotta say&amp;hellip;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Holy shit.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Look, I know we enjoy ragging on Microsoft. They&amp;rsquo;ve demonstrated some awful behaviour over the years, and every action still harkens back to the &amp;ldquo;Embrace, Extend, Extinguish&amp;rdquo; &lt;em&gt;modus operandi&lt;/em&gt;. But they&amp;rsquo;re doing really great work with the Defender/DATP/MDFE/whatever line. Even the basic Defender has been steading climbing the ranks, to the point where virtually &lt;em&gt;all&lt;/em&gt; guidance I&amp;rsquo;ve heard for the last two years is: &amp;ldquo;if you&amp;rsquo;re not going full EDR, just use regulr Defender&amp;rdquo;. It&amp;rsquo;s no SentinelOne or CrowdStrike, but overall Defender just Gets The Job Done.&lt;/p&gt;
&lt;p&gt;So, I was excited to try the Linux version. Long story short, it was a dream. The installation process was &lt;em&gt;streaks ahead&lt;/em&gt; of the competition. Resource usage is generally negligible, adding an average load of around 0.5% CPU, going up to about 16% CPU during a scan. There&amp;rsquo;s a robust health and connectivity test built-in. Basically the whole thing just works, to the same level we&amp;rsquo;ve learned to expect from the Windows version. Oh and this one has &lt;strong&gt;actual documentation&lt;/strong&gt; which seems to be considered optional by some of the competitors. 🙃&lt;/p&gt;
&lt;p&gt;However.&lt;/p&gt;
&lt;p&gt;You may find that mdatp is frantically scanning files that freqently Do Things. Bind9 (named) for example, might be handling hundreds of queries a minute. Each one of them triggers &lt;em&gt;not only&lt;/em&gt; an mdatp scan, but also auditd entries&amp;hellip; which often logs more than once per query. I was finding logs being filled and rotated &lt;strong&gt;every seven minutes&lt;/strong&gt; in some cases&amp;hellip; and then punctuated by auditd yelling &amp;ldquo;my buffer is full, I can&amp;rsquo;t log all these events!&amp;rdquo;.&lt;/p&gt;
&lt;p&gt;So as a result, I&amp;rsquo;ve spent quite a few hours learning how to wrangle auditd around exclusions. Here&amp;rsquo;s what I&amp;rsquo;ve learned:&lt;/p&gt;
&lt;h1 id="you-need-to-lie-to-install-mdfe-on-sid"&gt;You need to lie to install MDFE on Sid
&lt;/h1&gt;&lt;p&gt;Edit &lt;code&gt;/etc/os-release&lt;/code&gt; and change &lt;code&gt;VERSION_ID=&amp;quot;11&amp;quot;&lt;/code&gt; to &lt;code&gt;VERSION_ID=&amp;quot;10&amp;quot;&lt;/code&gt;. After that, you can install MDFE following the regular instructions. Don&amp;rsquo;t forget to change it back later!&lt;/p&gt;
&lt;h1 id="troubleshooting-performance-issues"&gt;Troubleshooting performance issues:
&lt;/h1&gt;&lt;p&gt;&lt;em&gt;See also: &lt;a class="link" href="https://docs.microsoft.com/en-us/microsoft-365/security/defender-endpoint/linux-support-perf?view=o365-worldwide" target="_blank" rel="noopener"
 &gt;https://docs.microsoft.com/en-us/microsoft-365/security/defender-endpoint/linux-support-perf?view=o365-worldwide&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;First step - find the processes that mdatp is spending the most CPU time on:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#75715e"&gt;# Download Microsoft&amp;#39;s parser (only do this once)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;wget -c https://raw.githubusercontent.com/microsoft/mdatp-xplat/master/linux/diagnostic/high_cpu_parser.py
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#75715e"&gt;# Ask Defender to output the stats, and then parse it looking for high CPU:&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;$ mdatp diagnostic real-time-protection-statistics --output json | python high_cpu_parser.py
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#ae81ff"&gt;925&lt;/span&gt; 	mongodb		&lt;span style="color:#ae81ff"&gt;29184&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;37575	pulseaudio	&lt;span style="color:#ae81ff"&gt;47&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;21355	packagekitd	&lt;span style="color:#ae81ff"&gt;30&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;37588	dbus-daemon	&lt;span style="color:#ae81ff"&gt;26&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;37550	sshd		&lt;span style="color:#ae81ff"&gt;25&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&amp;hellip; Yikes, it&amp;rsquo;s probably not necessary to scan MongoDB thirty thousand times! You can exclude a process from mdatp like this: &lt;code&gt;sudo mdatp exclusion process add --path /usr/bin/mongod&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;But that&amp;rsquo;s not all&amp;hellip; even though mdatp is no longer &lt;strong&gt;scanning&lt;/strong&gt; the application, you still have auditd frantically logging &lt;em&gt;every single thing it does&lt;/em&gt;. That&amp;rsquo;s also going to cause periodic slowdowns as the auditd buffer fills up, overflows, panicks, and then purges the stuff it couldn&amp;rsquo;t write down.&lt;/p&gt;
&lt;h2 id="syslogaudit-logging-issues"&gt;Syslog/audit logging issues
&lt;/h2&gt;&lt;p&gt;You can find out if anything is spewing a billion entries into your audit log, by just grepping for the rotation in syslog:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#75715e"&gt;# grep &amp;#39;Audit daemon rotating&amp;#39; /var/log/syslog&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Jul &lt;span style="color:#ae81ff"&gt;6&lt;/span&gt; 01:00:08 spam auditd&lt;span style="color:#f92672"&gt;[&lt;/span&gt;28996&lt;span style="color:#f92672"&gt;]&lt;/span&gt;: Audit daemon rotating log files
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Jul &lt;span style="color:#ae81ff"&gt;6&lt;/span&gt; 04:00:05 spam auditd&lt;span style="color:#f92672"&gt;[&lt;/span&gt;28996&lt;span style="color:#f92672"&gt;]&lt;/span&gt;: Audit daemon rotating log files
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Jul &lt;span style="color:#ae81ff"&gt;6&lt;/span&gt; 06:57:01 spam auditd&lt;span style="color:#f92672"&gt;[&lt;/span&gt;28996&lt;span style="color:#f92672"&gt;]&lt;/span&gt;: Audit daemon rotating log files
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Jul &lt;span style="color:#ae81ff"&gt;6&lt;/span&gt; 09:57:18 spam auditd&lt;span style="color:#f92672"&gt;[&lt;/span&gt;28996&lt;span style="color:#f92672"&gt;]&lt;/span&gt;: Audit daemon rotating log files
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&amp;hellip; Filling up a log file every three hours is &lt;em&gt;weird&lt;/em&gt;, but previously this server was doing it every few minutes. You can see what&amp;rsquo;s causing all the log rotations with:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#75715e"&gt;# cat /var/log/audit/audit.log* | cut -d &amp;#39; &amp;#39; -f26 | sort | uniq -c&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#ae81ff"&gt;138581&lt;/span&gt; 
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#ae81ff"&gt;1&lt;/span&gt; exe&lt;span style="color:#f92672"&gt;=&lt;/span&gt;&lt;span style="color:#e6db74"&gt;&amp;#34;/bin/bash&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#ae81ff"&gt;4&lt;/span&gt; exe&lt;span style="color:#f92672"&gt;=&lt;/span&gt;&lt;span style="color:#e6db74"&gt;&amp;#34;/bin/hostname&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#ae81ff"&gt;2&lt;/span&gt; exe&lt;span style="color:#f92672"&gt;=&lt;/span&gt;&lt;span style="color:#e6db74"&gt;&amp;#34;/bin/nano&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#ae81ff"&gt;684&lt;/span&gt; exe&lt;span style="color:#f92672"&gt;=&lt;/span&gt;&lt;span style="color:#e6db74"&gt;&amp;#34;/lib/systemd/systemd&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#ae81ff"&gt;4754&lt;/span&gt; exe&lt;span style="color:#f92672"&gt;=&lt;/span&gt;&lt;span style="color:#e6db74"&gt;&amp;#34;/lib/systemd/systemd-logind&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#ae81ff"&gt;209&lt;/span&gt; exe&lt;span style="color:#f92672"&gt;=&lt;/span&gt;&lt;span style="color:#e6db74"&gt;&amp;#34;/lib/systemd/systemd-user-runtime-dir&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#ae81ff"&gt;119&lt;/span&gt; exe&lt;span style="color:#f92672"&gt;=&lt;/span&gt;&lt;span style="color:#e6db74"&gt;&amp;#34;/opt/microsoft/mdatp/sbin/osqueryi&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#ae81ff"&gt;9&lt;/span&gt; exe&lt;span style="color:#f92672"&gt;=&lt;/span&gt;&lt;span style="color:#e6db74"&gt;&amp;#34;/usr/bin/apt-get&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#ae81ff"&gt;2133&lt;/span&gt; exe&lt;span style="color:#f92672"&gt;=&lt;/span&gt;&lt;span style="color:#e6db74"&gt;&amp;#34;/usr/bin/dbus-daemon&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#ae81ff"&gt;13212&lt;/span&gt; exe&lt;span style="color:#f92672"&gt;=&lt;/span&gt;&lt;span style="color:#e6db74"&gt;&amp;#34;/usr/bin/perl&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#ae81ff"&gt;10784&lt;/span&gt; exe&lt;span style="color:#f92672"&gt;=&lt;/span&gt;&lt;span style="color:#e6db74"&gt;&amp;#34;/usr/bin/pmxcfs&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#ae81ff"&gt;14&lt;/span&gt; exe&lt;span style="color:#f92672"&gt;=&lt;/span&gt;&lt;span style="color:#e6db74"&gt;&amp;#34;/usr/bin/rrdcached&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#ae81ff"&gt;2&lt;/span&gt; exe&lt;span style="color:#f92672"&gt;=&lt;/span&gt;&lt;span style="color:#e6db74"&gt;&amp;#34;/usr/bin/sort&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#ae81ff"&gt;4&lt;/span&gt; exe&lt;span style="color:#f92672"&gt;=&lt;/span&gt;&lt;span style="color:#e6db74"&gt;&amp;#34;/usr/lib/postfix/sbin/cleanup&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#ae81ff"&gt;880&lt;/span&gt; exe&lt;span style="color:#f92672"&gt;=&lt;/span&gt;&lt;span style="color:#e6db74"&gt;&amp;#34;/usr/lib/postfix/sbin/pickup&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#ae81ff"&gt;175&lt;/span&gt; exe&lt;span style="color:#f92672"&gt;=&lt;/span&gt;&lt;span style="color:#e6db74"&gt;&amp;#34;/usr/lib/postfix/sbin/qmgr&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#ae81ff"&gt;27&lt;/span&gt; exe&lt;span style="color:#f92672"&gt;=&lt;/span&gt;&lt;span style="color:#e6db74"&gt;&amp;#34;/usr/lib/postfix/sbin/smtp&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#ae81ff"&gt;4&lt;/span&gt; exe&lt;span style="color:#f92672"&gt;=&lt;/span&gt;&lt;span style="color:#e6db74"&gt;&amp;#34;/usr/lib/postfix/sbin/trivial-rewrite&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#ae81ff"&gt;16&lt;/span&gt; exe&lt;span style="color:#f92672"&gt;=&lt;/span&gt;&lt;span style="color:#e6db74"&gt;&amp;#34;/usr/sbin/cron&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#ae81ff"&gt;10326&lt;/span&gt; exe&lt;span style="color:#f92672"&gt;=&lt;/span&gt;&lt;span style="color:#e6db74"&gt;&amp;#34;/usr/sbin/ebtables-legacy&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#ae81ff"&gt;10326&lt;/span&gt; exe&lt;span style="color:#f92672"&gt;=&lt;/span&gt;&lt;span style="color:#e6db74"&gt;&amp;#34;/usr/sbin/ebtables-legacy-restore&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#ae81ff"&gt;3&lt;/span&gt; exe&lt;span style="color:#f92672"&gt;=&lt;/span&gt;&lt;span style="color:#e6db74"&gt;&amp;#34;/usr/sbin/postdrop&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#ae81ff"&gt;5&lt;/span&gt; exe&lt;span style="color:#f92672"&gt;=&lt;/span&gt;&lt;span style="color:#e6db74"&gt;&amp;#34;/usr/sbin/qmeventd&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#ae81ff"&gt;2&lt;/span&gt; exe&lt;span style="color:#f92672"&gt;=&lt;/span&gt;&lt;span style="color:#e6db74"&gt;&amp;#34;/usr/sbin/sendmail&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#ae81ff"&gt;56&lt;/span&gt; exe&lt;span style="color:#f92672"&gt;=&lt;/span&gt;&lt;span style="color:#e6db74"&gt;&amp;#34;/usr/sbin/smartd&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#ae81ff"&gt;3255&lt;/span&gt; exe&lt;span style="color:#f92672"&gt;=&lt;/span&gt;&lt;span style="color:#e6db74"&gt;&amp;#34;/usr/sbin/sshd&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The number on the left shows the number of times that binary has had it&amp;rsquo;s activity logged. This should clearly show the problem executables&amp;hellip; today we&amp;rsquo;re looking at &lt;code&gt;perl&lt;/code&gt;, &lt;code&gt;pmxcfs&lt;/code&gt;, and &lt;code&gt;ebtables-legacy&lt;/code&gt;. Once you&amp;rsquo;ve got that, you need to determine which &lt;em&gt;syscalls&lt;/em&gt; are part of regular noise:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#75715e"&gt;# grep /usr/bin/pmxcfs /var/log/audit/audit.log* | cut -d &amp;#39; &amp;#39; -f 4 | sort | uniq -c&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#ae81ff"&gt;10856&lt;/span&gt; 
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#ae81ff"&gt;8142&lt;/span&gt; syscall&lt;span style="color:#f92672"&gt;=&lt;/span&gt;&lt;span style="color:#ae81ff"&gt;263&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#ae81ff"&gt;1357&lt;/span&gt; syscall&lt;span style="color:#f92672"&gt;=&lt;/span&gt;&lt;span style="color:#ae81ff"&gt;43&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#ae81ff"&gt;1357&lt;/span&gt; syscall&lt;span style="color:#f92672"&gt;=&lt;/span&gt;&lt;span style="color:#ae81ff"&gt;84&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Referring to &lt;a class="link" href="https://blog.rchapman.org/posts/Linux_System_Call_Table_for_x86_64/" target="_blank" rel="noopener"
 &gt;this document&lt;/a&gt;, we can see these syscalls are sys_accept, sys_rmdir, and sys_unlinkat. Since pmxcfs is the ProxmoxVS Cluster File System, these are frankly all pretty normal syscalls for it to make. Let&amp;rsquo;s ignore them.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;echo -a never,exit -S 43 -S 84 -S 263 -F exe=/usr/bin/pmxcfs -k exclude_PVE_internals &amp;gt;&amp;gt; /etc/audit/rules.d/01-exclusion.rules&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;^ Gotta do that as root, btw, or just append the line however you see fit. Once you&amp;rsquo;ve added exclusions for all of your high-noise entires, run &lt;code&gt;service auditd restart&lt;/code&gt; and then &lt;code&gt;service auditd status&lt;/code&gt; to make sure it worked properly.&lt;/p&gt;
&lt;p&gt;On my Zentyal box I had to add a bunch of entries to exclude logging of certain high-noise things. For example, DNS query resolution (via named) and Samba activity:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;cat /etc/audit/rules.d/01-exclusion.rules
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;-a never,exit -S 41 -S 42 -S 49 -S 82 -S 288 -F exe=/usr/sbin/named -k exclude_DNS_queries
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;-a never,exit -S 43 -F exe=/usr/sbin/winbindd -k exclude_Samba
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;-a never,exit -S 41 -S 42 -S 43 -S 87 -F exe=/usr/sbin/smbd -k exclude_Samba
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;-a never,exit -S 41 -S 43 -S 87 -F exe=/usr/sbin/samba -k exclude_Samba
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;strong&gt;A word of warning:&lt;/strong&gt; Don&amp;rsquo;t just ignore everything willy-nilly. The audit logging system &lt;em&gt;exists&lt;/em&gt; so you can track activity on the system - blithely sending 100% of the log entries to the bin will undermine what the audit sytem exists for!&lt;/p&gt;
&lt;p&gt;&amp;hellip; That&amp;rsquo;s all I&amp;rsquo;ve got so far. I&amp;rsquo;ll keep updating this if I bump into anything new!&lt;/p&gt;</description></item><item><title>Recipe: Bangin' Satay</title><link>https://www.ericlight.com/post/satay.html</link><pubDate>Mon, 24 May 2021 00:00:00 +1200</pubDate><guid>https://www.ericlight.com/post/satay.html</guid><description>&lt;img src="https://www.ericlight.com/post/satay/satay.jpg" alt="Featured image of post Recipe: Bangin' Satay" /&gt;&lt;p&gt;Had a hankering for a Satay Chicken tonight and kinda whipped something up based on a couple different things. This is more of a saucy satay, not a dry skewer-type. This takes a bit of juggling; I had three elements on the stove, and a few stages. Worth it, tho.&lt;/p&gt;
&lt;p&gt;I&amp;rsquo;ve broken this into stages: the sauce, the veggies, and the noodles. For the benefit of shopping lists (and Whisk!) I&amp;rsquo;ve provided an awful monolithic pile of ingredients up-front. Yay.&lt;/p&gt;
&lt;h2 id="ingredients"&gt;Ingredients
&lt;/h2&gt;&lt;ul&gt;
&lt;li&gt;2 large chicken breasts&lt;/li&gt;
&lt;li&gt;2 Tbsp fish sauce&lt;/li&gt;
&lt;li&gt;2 tsp ground Cumin seeds&lt;/li&gt;
&lt;li&gt;2 tsp ground Coriander seeds&lt;/li&gt;
&lt;li&gt;2 tsp Paprika&lt;/li&gt;
&lt;li&gt;2 tsp Turmeric&lt;/li&gt;
&lt;li&gt;3 tsp Curry powder&lt;/li&gt;
&lt;li&gt;3 small chillies&lt;/li&gt;
&lt;li&gt;2 onions&lt;/li&gt;
&lt;li&gt;5 cloves garlic&lt;/li&gt;
&lt;li&gt;1 thumb ginger&lt;/li&gt;
&lt;li&gt;2 bay leaves or kaffir lime leaves&lt;/li&gt;
&lt;li&gt;2 shoots lemongrass&lt;/li&gt;
&lt;li&gt;1 400g can coconut cream&lt;/li&gt;
&lt;li&gt;0.5 cup Peanut butter&lt;/li&gt;
&lt;li&gt;1 capsicum&lt;/li&gt;
&lt;li&gt;1.5c mung bean sprouts (for optional veggie side)&lt;/li&gt;
&lt;li&gt;2 spring onions or garlic shoots (for optional veggie side)&lt;/li&gt;
&lt;li&gt;1 capsicum, any colour (for optional veggie side)&lt;/li&gt;
&lt;li&gt;2 Tbsp dried shrimp (for optional veggie side)&lt;/li&gt;
&lt;li&gt;2 Tbsp dried shallots (for optional veggie side)&lt;/li&gt;
&lt;li&gt;2 Tbsp peanuts, roughly chopped (for optional veggie side)&lt;/li&gt;
&lt;li&gt;Soy sauce&lt;/li&gt;
&lt;li&gt;Sesame oil&lt;/li&gt;
&lt;li&gt;Egg noodles&lt;/li&gt;
&lt;li&gt;Cayenne pepper or other chilli, to taste&lt;/li&gt;
&lt;li&gt;Lime juice, to taste&lt;/li&gt;
&lt;li&gt;Salt, to taste&lt;/li&gt;
&lt;li&gt;Sugar, to taste&lt;/li&gt;
&lt;li&gt;MSG, to taste (substitute chicken stock if you want)&lt;/li&gt;
&lt;li&gt;Chicken stock, to taste&lt;/li&gt;
&lt;li&gt;Vegetable oil&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="method"&gt;Method
&lt;/h2&gt;&lt;ol&gt;
&lt;li&gt;Slice your chicken into reasonably chompy pieces. Maybe 1cm thick, and small enough to fit in your mouth.&lt;/li&gt;
&lt;li&gt;Put the chicken in a bowl, pour in the fish sauce. Give it a stir, and leave it to soak.&lt;/li&gt;
&lt;li&gt;Dice the onion, and get it in the frypan over medium heat, with only &lt;em&gt;just-enough&lt;/em&gt; oil.&lt;/li&gt;
&lt;li&gt;While the onion cooks, prepare your spices in a small bowl: cumin, coriander, paprika, turmeric, curry powder.&lt;/li&gt;
&lt;li&gt;The onion is still cooking, so chop up your garlic, ginger, and chillies. Give the lemongrass a good thump too.&lt;/li&gt;
&lt;li&gt;Get a second frypan onto your hottest element, and get it very hot. Start browning your chicken. Do this in HOT but &lt;em&gt;small&lt;/em&gt; batches so it doesn&amp;rsquo;t steam.&lt;/li&gt;
&lt;li&gt;Take the onion out of the first fry pan, and add another good tablespoon of oil.&lt;/li&gt;
&lt;li&gt;When the oil is hot, tip in your bowl of spices. These are already ground, so they&amp;rsquo;re gonna burn &lt;em&gt;fast&lt;/em&gt; - keep them moving, try not to let them smoke.&lt;/li&gt;
&lt;li&gt;As soon as the spices are fried off (30~45 seconds), &lt;strong&gt;quickly&lt;/strong&gt; throw your onion back in. Give it a stir, then tip in the garlic, ginger, and chilli. Crank the heat up!&lt;/li&gt;
&lt;li&gt;Add peanut butter, peanuts, bay leaves, lemongrass, and the juice of half a lime. When the peanut butter is melted, add coconut cream and stir.&lt;/li&gt;
&lt;li&gt;Start adding your chicken to the sauce whenever it&amp;rsquo;s ready. After all the chicken is added, reduce heat to a simmer. Try to remember to stir it sometimes.&lt;/li&gt;
&lt;li&gt;Time to give it a taste! It&amp;rsquo;ll be bland - this is tuning time. I added a tablespoon of sugar, a teaspoon of MSG, a few grinds of salt, more lime juice, and a teaspoon of dry chicken stock.&lt;/li&gt;
&lt;li&gt;Once you&amp;rsquo;ve struck the balance of sour/sweet/savoury/salty/spicy that you&amp;rsquo;re looking for, leave it simmer for another 20 minutes or so.&lt;/li&gt;
&lt;li&gt;Prep some veggies for a side. I used mung beans, garlic shoots, and a capsicum. Chop these up.&lt;/li&gt;
&lt;li&gt;In yEt AnOtHeR pOt, bring a bunch of water to a rolling boil (say 1.5 litres). Get your egg noodles in, and cook according to the packet (often 6mins).&lt;/li&gt;
&lt;li&gt;Remember that frypan you fried the chicken in? Get that going again. When hot, throw in your side-veggies, along with some soy sauce and MSG.&lt;/li&gt;
&lt;li&gt;Strain the water out of your egg noodles, and start them frying with some oil and soy sauce.&lt;/li&gt;
&lt;li&gt;Toss the fried shrimp, fried shallots, and extra peanuts into your nearly-cooked side veggies. Give it a taste, add salt/lime juice/MSG to make it yummy.&lt;/li&gt;
&lt;li&gt;QUICK, YOUR NOODLES ARE STICKING TO THE PAN! Turf those out into serving bowls. Spoon the tasty veggies onto half, and your chicken satay onto the other half.&lt;/li&gt;
&lt;li&gt;Tell someone else they&amp;rsquo;re on kitchen cleanup duty, and sit down to enjoy!&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;img alt="Action shot! My bowl of noodles, showing the fried veggies and satay chicken" class="gallery-image" data-flex-basis="237px" data-flex-grow="98" data-title-escaped="Delicious." height="3496" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://www.ericlight.com/post/satay/satay.jpg" srcset="https://www.ericlight.com/post/satay/satay_hu_36b4528e9c3858d3.jpg 800w, https://www.ericlight.com/post/satay/satay_hu_586993eb258b758c.jpg 1600w, https://www.ericlight.com/post/satay/satay_hu_7f719d577c3b370d.jpg 2400w, https://www.ericlight.com/post/satay/satay.jpg 3456w" title="Delicious." width="3456"&gt;&lt;/p&gt;</description></item><item><title>Configuring a custom SSL certificate in Zentyal</title><link>https://www.ericlight.com/post/zentyal_ssl.html</link><pubDate>Sun, 25 Apr 2021 00:00:00 +1200</pubDate><guid>https://www.ericlight.com/post/zentyal_ssl.html</guid><description>&lt;p&gt;Zuper-quick post for when this bites me again in the future!&lt;/p&gt;
&lt;p&gt;Tonight I upgraded from Zentyal 6.2 to Zentyal 7.0. Smooth as butter, everything went great.&lt;/p&gt;
&lt;p&gt;Until I logged in, and my shiny Actual Paid Money SSL certificate had vanished, replaced by a self-signed commoner&amp;rsquo;s certificate. Piffle.&lt;/p&gt;
&lt;p&gt;Instructions for installing a custom SSL certificate in Zentyal are actually kinda shaky, so here you go:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;cd /var/lib/zentyal/conf/ssl/
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;mkdir old
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;mv * old
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;nano ssl.key
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;nano ssl.cert
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;cat ssl.cert ssl.key &amp;gt; ssl.pem
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;chmod &lt;span style="color:#ae81ff"&gt;0400&lt;/span&gt; ssl*
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;That&amp;rsquo;s it! Your Private Key lives in &lt;code&gt;ssl.key&lt;/code&gt;, and your SSL certificate lives in &lt;code&gt;ssl.cert&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Reboot, and job done.&lt;/p&gt;</description></item><item><title>Blocking bad extensions and extortion with iRedMail</title><link>https://www.ericlight.com/post/iredmail.html</link><pubDate>Mon, 12 Apr 2021 00:00:00 +1200</pubDate><guid>https://www.ericlight.com/post/iredmail.html</guid><description>&lt;p&gt;Turns out this is my third Amavis article. I guess it&amp;rsquo;s just one of those systems.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Heads up, if you&amp;rsquo;re trying to do this, make sure you also read &lt;a class="link" href="https://www.ericlight.com/post/amavis2.html" &gt;my other article&lt;/a&gt; about the &amp;ldquo;banned_files_lover&amp;rdquo; thing.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Today I&amp;rsquo;m on a mission to:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Drop all incoming Office &amp;lsquo;97 files (they&amp;rsquo;re predominantly malicious these days)&lt;/li&gt;
&lt;li&gt;Drop all incoming Macro-enabled Office 2007+ files (there aren&amp;rsquo;t legitimate reasons to receive these &lt;em&gt;in my scenario&lt;/em&gt;)&lt;/li&gt;
&lt;li&gt;Drop any emails containing a .onion address&lt;/li&gt;
&lt;li&gt;Drop any emails containing a bitcoin wallet&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id="dropping-attachments"&gt;Dropping Attachments
&lt;/h2&gt;&lt;p&gt;The attachment block is easily handled by Amavis. In iRedMail on Debian, the configuration file is found at &lt;code&gt;/etc/amavis/conf.d/50-user&lt;/code&gt;. Open your config file, and scroll down to the section where the &lt;code&gt;$banned_filename_re&lt;/code&gt; variable is set. Insert the following line:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; qr&amp;#39;.\.(doc|dot|docm|docb|xls|xlm|xlt|xlsm|xlsb|
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; xla|xlam|ppt|pps|pptm|potm|ppam|ppsm|sldm)$&amp;#39;i, # Office &amp;#39;97-2003 and Macro-enabled files
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; qr&amp;#39;.\.(adn|accdb|accdr|accdt|accda|mdw|accde|mam|maq|mar|mat|
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; maf|laccdb|ade|adp|mdb|cdb|mda|mdn|mdt|mdf|mde|ldb)$&amp;#39;i, # Microsoft Access files
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; qr&amp;#39;^\.pub$&amp;#39;, # Microsoft Publisher files
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;That will block all core Office &amp;lsquo;97-2003 files, as well as all Macro-enabled Office 2007-365 files.&lt;/p&gt;
&lt;p&gt;By default, this will &lt;strong&gt;silently&lt;/strong&gt; reject mails containing these attachments. If you want senders to receive a bounce message, search for the &lt;code&gt;$final_banned_destiny&lt;/code&gt; variable and make sure it&amp;rsquo;s set to &lt;code&gt;D_BOUNCE&lt;/code&gt;.&lt;/p&gt;
&lt;h2 id="dropping-onion-and-btc"&gt;Dropping .onion and BTC
&lt;/h2&gt;&lt;p&gt;This part happens in Postfix, and it&amp;rsquo;s more-super-easy than the last bit. To configure Postfix&amp;rsquo;s body checks, edit &lt;code&gt;/etc/postfix/body_checks.pcre&lt;/code&gt;. I simply added the following:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;/(\w+\.onion)/ REJECT This mail server does not accept references to .onion addresses (${1})
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;/(\b(bc1|[13])[a-zA-HJ-NP-Z0-9]{25,39})/ DISCARD Bitcoin wallet detected (${1})
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;I used the REJECT directive for testing, but to be honest I don&amp;rsquo;t want to send bounces back to these people, so I changed to DISCARD after it was working. You can see the difference above.&lt;/p&gt;
&lt;p&gt;The text after the REJECT directive is returned to the sender, and the text after the DISCARD directive is logged. The variable &lt;code&gt;${1}&lt;/code&gt; contains the detected string, and is appended to the response message.&lt;/p&gt;
&lt;p&gt;That&amp;rsquo;s the end! Safety. Yes.&lt;/p&gt;
&lt;h1 id="acknowledgements"&gt;Acknowledgements
&lt;/h1&gt;&lt;p&gt;Thanks to Brad and Hamish for this post - Brad for the regex, Hamish for the idea, and both of them for the review!&lt;/p&gt;</description></item><item><title>Using Caddy to enable MTA-STS</title><link>https://www.ericlight.com/post/caddy-mta-sts.html</link><pubDate>Tue, 19 Jan 2021 00:00:00 +1300</pubDate><guid>https://www.ericlight.com/post/caddy-mta-sts.html</guid><description>&lt;p&gt;About 7 months ago, I left Nginx and &lt;a class="link" href="https://www.ericlight.com/post/caddy.html" &gt;moved to Caddy&lt;/a&gt;. I&amp;rsquo;ve found it super easy, and have now experienced using it as a reverse proxy, a static site server (this one!), as well as a hosting a &lt;a class="link" href="https://shrug.ericlight.com" target="_blank" rel="noopener"
 &gt;handy place&lt;/a&gt; for me to copy my favourite &lt;a class="link" href="http://kaomoji.ru" target="_blank" rel="noopener"
 &gt;Kaomoji&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;&lt;strong&gt;Update 2021-01-20&lt;/strong&gt;&lt;/em&gt;: I had a bug! By default, Caddy serves this without a Content-Type header. However, the &lt;a class="link" href="https://tools.ietf.org/html/rfc8461#section-3.2" target="_blank" rel="noopener"
 &gt;RFC&lt;/a&gt; specifies that the response should be explicitly &lt;code&gt;Content-Type &amp;quot;text/plain&amp;quot;&lt;/code&gt;. Thanks to &lt;a class="link" href="https://github.com/klausenbusk/" target="_blank" rel="noopener"
 &gt;klausenbusk&lt;/a&gt; for letting me know!&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Note: the Caddyfile fragment to generate &lt;a class="link" href="https://shrug.ericlight.com" target="_blank" rel="noopener"
 &gt;https://shrug.ericlight.com&lt;/a&gt; looks like this:&lt;/em&gt;&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;shrug.ericlight.com { respond &amp;#34;&amp;lt;meta charset=&amp;#39;UTF-8&amp;#39;&amp;gt;¯\_(ツ)_/¯&amp;#34; }
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Anyway, once I&amp;rsquo;d used Caddy&amp;rsquo;s &lt;code&gt;respond&lt;/code&gt; directive, it was a simple step to take it forward and use it to serve my handy-dandy MTA-STS policy file!&lt;/p&gt;
&lt;p&gt;Simply add this new Server block to your Caddyfile:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;mta-sts.ericlight.com {
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;respond &amp;#34;version: STSv1
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;mode: testing
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;mx: in1-smtp.messagingengine.com
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;mx: in2-smtp.messagingengine.com
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;max_age: 86401&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;header Content-Type &amp;#34;text/plain; charset=utf-8&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;}
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This simple Server block will get you a shiny HTTPS certificate, redirect any HTTP visitors to HTTPS, and will provide enquirers with your MTA policy file. &lt;em&gt;(Obviously, replace my domain name and MX entries with your own.)&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Sharp observers will notice that the MTA-STS policy file should be hosted at &lt;code&gt;https://mta-sts.ericlight.com/.well-known/mta-sts.txt&lt;/code&gt;&amp;hellip; but that&amp;rsquo;s the elegance of the Respond directive in Caddy: &lt;em&gt;wherever&lt;/em&gt; you go at &lt;code&gt;mta-sts.ericlight.com&lt;/code&gt;, you get exactly that response!&lt;/p&gt;
&lt;p&gt;Example: &lt;a class="link" href="https://mta-sts.ericlight.com/my/hovercraft/is/full/of/eels.txt" target="_blank" rel="noopener"
 &gt;https://mta-sts.ericlight.com/my/hovercraft/is/full/of/eels.txt&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Okay, that was easy&amp;hellip; the next part is just creating your &lt;em&gt;&lt;strong&gt;three&lt;/strong&gt;&lt;/em&gt; DNS records:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Record #1:&lt;/strong&gt; An A record for &lt;code&gt;mta-sts.ericlight.com&lt;/code&gt;, pointing to your Caddy server.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Record #2:&lt;/strong&gt; A TXT record at &lt;code&gt;_mta-sts.ericlight.com&lt;/code&gt;, reading &lt;code&gt;v=STSv1; id=20210112&lt;/code&gt;. (Note the underscore! Also, the ID can be anything.)&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Record #3:&lt;/strong&gt; A TXT record at &lt;code&gt;_smtp._tls.ericlight.com&lt;/code&gt;, reading &lt;code&gt;v=TLSRPTv1; rua=mailto:tls-reports@targetdomain.com&lt;/code&gt;. (update that email address)&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&amp;hellip; There you go! Now you have a shiny new MTA-STS policy, and your Reporting email target (configured in DNS Record #3) will start reciving daily reports from sending mail servers, letting you know if your policy is working correctly.&lt;/p&gt;
&lt;p&gt;Eventually (once you&amp;rsquo;re sure it&amp;rsquo;s all configured properly), you should change your &lt;code&gt;testing&lt;/code&gt; policy to &lt;code&gt;enforce&lt;/code&gt;. When you do this, &lt;strong&gt;make sure you update the ID in your TXT Record!&lt;/strong&gt; This is how sending mail servers know that there has been a policy update.&lt;/p&gt;
&lt;p&gt;Enjoy!&lt;/p&gt;</description></item><item><title>Getting TrueNAS (FreeNAS 12) to work with an APC NMC2 UPS (AP9631)</title><link>https://www.ericlight.com/post/apc_truenas.html</link><pubDate>Thu, 14 Jan 2021 00:00:00 +1300</pubDate><guid>https://www.ericlight.com/post/apc_truenas.html</guid><description>&lt;p&gt;TrueNAS, and FreeNAS before it, has supported UPS via the NUT software package since forever. But most people using it seem to be using USB-connected UPS devices. I don&amp;rsquo;t have one of these. I&amp;rsquo;m dealing with an IPv4-based APC ups, specifically the Smart-UPS X 1500 (SMX1500RMI2UNC), with an AP9631 NMC2 card.&lt;/p&gt;
&lt;p&gt;You&amp;rsquo;re probably here because you&amp;rsquo;re in the same boat: trying to set up a non-USB or Ethernet-based UPS under FreeNAS/TrueNAS, and you can&amp;rsquo;t. You&amp;rsquo;ve noticed the TrueNAS console &lt;em&gt;will not shut up&lt;/em&gt; about errors which read something like:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;nut plugin: nut_connect: upscli_connect (localhost, 3493) failed: Connection failure: Connection refused&lt;/code&gt;. (Or perhaps port 161)&lt;/p&gt;
&lt;p&gt;&lt;em&gt;&amp;ldquo;But why?&amp;rdquo;&lt;/em&gt;, you say. &lt;em&gt;&amp;ldquo;I&amp;rsquo;ve given TrueNAS my UPS hostname, why is it always trying to talk to localhost? And what is this port 3493, when SNMP is 161?&amp;rdquo;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;What&amp;rsquo;s happening is that &lt;code&gt;upscli&lt;/code&gt; is trying to talk to the &lt;code&gt;upsd&lt;/code&gt; damon &lt;em&gt;on your TrueNAS server&lt;/em&gt;, which is expected to listen on port 3493 - it&amp;rsquo;s &lt;strong&gt;upsd&lt;/strong&gt; which then does the talky with the SNMP driver, which in turn does the talky with the UPS. This is why the TrueNAS console logs look like it&amp;rsquo;s just shouting at itself.&lt;/p&gt;
&lt;p&gt;Okay, let&amp;rsquo;s get into it:&lt;/p&gt;
&lt;h2 id="ups-configuration"&gt;UPS Configuration
&lt;/h2&gt;&lt;p&gt;First, you need to enable SNMP on your AP9631. This was pretty straightforward, but remember that you need to go:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Configuration -&amp;gt; Network -&amp;gt; SNMPv1 -&amp;gt; Access -&amp;gt; &lt;strong&gt;Enable&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Configuration -&amp;gt; Netowrk -&amp;gt; SNMPv1 -&amp;gt; Access Control, and make sure the &lt;code&gt;public&lt;/code&gt; community is set to be accessible from 0.0.0.0&lt;/li&gt;
&lt;li&gt;Reboot your NMC2 card.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;This configuration should work with the defaults that the NUT SNMP driver expects - I suggest you get it working like this for now, then tweak to SNMPv3 once you have a confirmed-working connection.&lt;/p&gt;
&lt;h2 id="truenas-configuration"&gt;TrueNAS Configuration
&lt;/h2&gt;&lt;p&gt;Your UPS configuration menu is under TrueNAS -&amp;gt; Services -&amp;gt; UPS. Configure your TrueNAS UPS section like so:&lt;/p&gt;
&lt;h3 id="general-options-section"&gt;General Options section:
&lt;/h3&gt;&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Identifier:&lt;/strong&gt; Up to you, but do yourself a favour and make it &lt;code&gt;ups&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;UPS Mode:&lt;/strong&gt; Master&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Driver:&lt;/strong&gt; &amp;ldquo;Various ups 3 (various) SNMP - RFC 1628 (snmp-ups, experimental)&amp;rdquo; &amp;ndash; once you save, this will simply display as &lt;code&gt;snmp-ups$(various)&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Port or Hostname:&lt;/strong&gt; The hostname of the ups, hopefully something simple like &lt;code&gt;ups.mydomain.local&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="monitor-section"&gt;Monitor section:
&lt;/h3&gt;&lt;p&gt;Leave the Monitor User, Monitor Password, Extra users, and Remote Monitor all blank/default for now - you can change them once the UPS is talking to you. Note I don&amp;rsquo;t believe it&amp;rsquo;s important to change the Monitor Password under this configuration, as &lt;code&gt;upsd&lt;/code&gt; only listens on the loopback address.&lt;/p&gt;
&lt;h3 id="shutdown-and-email-sections"&gt;Shutdown and Email sections
&lt;/h3&gt;&lt;p&gt;I shall leave in your capable hands.&lt;/p&gt;
&lt;h3 id="other-options"&gt;Other Options:
&lt;/h3&gt;&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Auxiliary Parameters (ups.conf):&lt;/strong&gt; This is where you override the SNMP defaults, if desired. By default, NUT will use SNMPv1 and the &amp;lsquo;public&amp;rsquo; community. &lt;a class="link" href="https://networkupstools.org/docs/man/snmp-ups.htm" target="_blank" rel="noopener"
 &gt;See here for all config options&lt;/a&gt; availble for the SNMP driver. You could do something like this, if you want:&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-ini" data-lang="ini"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#a6e22e"&gt;community&lt;/span&gt;&lt;span style="color:#f92672"&gt;=&lt;/span&gt;&lt;span style="color:#e6db74"&gt;yaysecurity&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#a6e22e"&gt;snmp_version&lt;/span&gt;&lt;span style="color:#f92672"&gt;=&lt;/span&gt;&lt;span style="color:#e6db74"&gt;3&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#a6e22e"&gt;privProtocol&lt;/span&gt;&lt;span style="color:#f92672"&gt;=&lt;/span&gt;&lt;span style="color:#e6db74"&gt;AES&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Auxiliary Parameters (upsd.conf):&lt;/strong&gt; &lt;code&gt;LISTEN 127.0.0.1 3493&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;That last line was the magic - this is the bit that makes upsd &lt;em&gt;not only&lt;/em&gt; listen on port 161 (whyyyy), but &lt;em&gt;also&lt;/em&gt; listen on 3493, which is where the rest of the UPS subsystem expects to find UPS data!&lt;/p&gt;
&lt;h1 id="other-interesting-tidbits"&gt;Other interesting tidbits:
&lt;/h1&gt;&lt;ul&gt;
&lt;li&gt;Running &lt;code&gt;upsc -l&lt;/code&gt; should list all UPS instances configured on your server. Since I&amp;rsquo;ve got one, called &amp;lsquo;ups&amp;rsquo;, I see:&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;# upsc -l
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;ups
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;ul&gt;
&lt;li&gt;If &lt;code&gt;upsc -l&lt;/code&gt; gives you a Connection Refused error, check &lt;code&gt;/usr/local/etc/nut/upsd.conf&lt;/code&gt; to make sure it&amp;rsquo;s listening on 3493. If not, add your auxiliary parameter in TrueNAS and restart the service.&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;# upsc ups
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Error: Connection failure: Connection refused
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;# cat /usr/local/etc/nut/upsd.conf
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;LISTEN 127.0.0.1 161
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;LISTEN ::1 161
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;# sockstat -4 -l | grep upsd
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;uucp upsd 99934 6 tcp4 127.0.0.1:161 *:*
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;em&gt;Above: upsd is definitely not listening on the expected port&lt;/em&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;NUT Config files&lt;/strong&gt;: These live under &lt;code&gt;/usr/local/etc/nut/&lt;/code&gt;. The folder is deleted and recreated every time you edit something in the TrueNAS GUI, so if you&amp;rsquo;re in that folder and change something in the GUI, you&amp;rsquo;ll need to do the whole &lt;code&gt;cd /usr/local/etc/nut&lt;/code&gt; again. No you can&amp;rsquo;t do &lt;code&gt;cd ../nut&lt;/code&gt;, because the whole inode is gone, so the OS doesn&amp;rsquo;t know where you are anymore.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Testing your UPS&lt;/strong&gt;: Once &lt;code&gt;upsd&lt;/code&gt; is listening on 3493, you should be able to run &lt;code&gt;upsc ups&lt;/code&gt;, and it will query your UPS for data. Note that &amp;ldquo;ups&amp;rdquo; is your UPS identifier from the &amp;ldquo;General Options&amp;rdquo; section, also found as the first line of &lt;code&gt;/usr/local/etc/nut/ups.conf&lt;/code&gt;:&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;# cat /usr/local/etc/nut/ups.conf
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;[ups]
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; driver = snmp-ups
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; port = ups.mydomain.local
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; desc = 
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; pollfreq = 15
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;# upsc ups
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;ambient.humidity: 0.00
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;ambient.temperature: 23.0
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;battery.charge: 100.00
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;battery.date: 05/15/2017
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;battery.packs: 0.00
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;battery.runtime: 1221.00
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;battery.runtime.low: 600
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;battery.voltage: 54.50
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;device.mfr: APC
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;device.model: Smart-UPS X 1500
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;[...]
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;I think that pretty much covers it. I hope this has been helpful to someone - at very least, I hope it&amp;rsquo;s helpful to future-me!&lt;/p&gt;
&lt;p&gt;It&amp;rsquo;s been a little while since I&amp;rsquo;ve worked with UPS management software. I like to think it&amp;rsquo;s because my day job isn&amp;rsquo;t in infrastructure anymore, but also to be honest the whole UPS scene is fairly ugly. I recall speaking with an electrical engineer from Schneider a while ago, who jokingly said something like &amp;ldquo;creating a new UPS or CNC communications protocol is almost a rite of passage for any new engineer&amp;rdquo;. I can see why&amp;hellip; when you&amp;rsquo;re new, and see something &lt;em&gt;superbly awful&lt;/em&gt;, it&amp;rsquo;s quite compelling to try and fix it! But decades now of dependencies really do add up to be a burden.&lt;/p&gt;</description></item><item><title>The Actual Best Sous Vide Eggs... ™</title><link>https://www.ericlight.com/post/eggs.html</link><pubDate>Mon, 28 Dec 2020 00:00:00 +1300</pubDate><guid>https://www.ericlight.com/post/eggs.html</guid><description>&lt;img src="https://www.ericlight.com/post/eggs/egg.jpg" alt="Featured image of post The Actual Best Sous Vide Eggs... ™" /&gt;&lt;p&gt;Inkbird were having a special in November, so I got a sous vide for Christmas! There are heaps of places with recipes for the best sous vide eggs, most notably the always-outstanding &lt;a class="link" href="https://www.seriouseats.com/2013/10/sous-vide-101-all-about-eggs.html" target="_blank" rel="noopener"
 &gt;Serious Eats&lt;/a&gt;, but also an excellent write-up on &lt;a class="link" href="https://saltpepperskillet.com/recipes/sous-vide-poached-eggs/" target="_blank" rel="noopener"
 &gt;Salt Pepper Skillet&lt;/a&gt;, and of course sous vide manufacturer &lt;a class="link" href="https://anovaculinary.com/quick-guide-to-cooking-sous-vide-eggs-with-anova/" target="_blank" rel="noopener"
 &gt;Anova Culinary&lt;/a&gt; with a somewhat briefer post.&lt;/p&gt;
&lt;p&gt;I submit to you that &lt;em&gt;none of these&lt;/em&gt; are the best sous vide eggs. In my eyes, the best egg has a completely opaque white (not rubbery and not snot), with a semicooked gooey yolk like a cross between honey and custard. Like this one:&lt;/p&gt;
&lt;p&gt;&lt;img alt="My beautiful egg, smooshed on a piece of bread." class="gallery-image" data-flex-basis="180px" data-flex-grow="75" data-title-escaped="Yum." height="4608" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://www.ericlight.com/post/eggs/egg.jpg" srcset="https://www.ericlight.com/post/eggs/egg_hu_476b82f8ab494809.jpg 800w, https://www.ericlight.com/post/eggs/egg_hu_2105d2806ebe5ff3.jpg 1600w, https://www.ericlight.com/post/eggs/egg_hu_5d477215e24fbc0c.jpg 2400w, https://www.ericlight.com/post/eggs/egg.jpg 3456w" title="Yum." width="3456"&gt;&lt;/p&gt;
&lt;p&gt;The closest recipe on the pages I cited is the 13.5 minute egg at 75°C. This is really close, but I found the yolk was a bit overcooked, and the white undercooked. Absolute conundrum.&lt;/p&gt;
&lt;p&gt;My fix? A slightly hotter temperature, and take your eggs straight outta the fridge. I found 76°C (169°F) for the vaunted 13.5 minutes managed to get the outer white to a non-snot texture, while the pre-chilledness of the egg kept the yolk from overcooking.&lt;/p&gt;</description></item><item><title>Logging DNS queries, for both pfSense and Zentyal server</title><link>https://www.ericlight.com/post/zentyal_querylogging.html</link><pubDate>Sun, 06 Dec 2020 00:00:00 +1300</pubDate><guid>https://www.ericlight.com/post/zentyal_querylogging.html</guid><description>&lt;p&gt;Logs of your client DNS queries can be a really good tool for incident response. I&amp;rsquo;ve finally got this implemented but it was much more of a struggle than I expected it to be, so here&amp;rsquo;s my story!&lt;/p&gt;
&lt;p&gt;We&amp;rsquo;ve got a pfSense firewall running as a DNS fowarder, and a &lt;a class="link" href="https://www.zentyal.com" target="_blank" rel="noopener"
 &gt;Zentyal&lt;/a&gt; server running BIND9 as the authoritative local server. The firewall rules block all UDP/53, so all DNS queries go either directly to the firewall, or (more commonly) to the Zentyal server for resolution. This means we have two places that resolve DNS queries which we want to forward off to our syslog server.&lt;/p&gt;
&lt;h2 id="pfsense"&gt;pfSense
&lt;/h2&gt;&lt;p&gt;Unbound is a &lt;em&gt;super&lt;/em&gt; simple DNS forwarder, and the configuration is wonderfully straightforward. It did take me quite a while to figure it out, but in the end it was a simple oversight on my part.&lt;/p&gt;
&lt;p&gt;To get pfSense/Unbound to forward DNS queries to your syslog server, simply open the Services -&amp;gt; DNS Resolver page, click &amp;lsquo;Display Custom options&amp;rsquo;, and add these two lines:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;:::ini
server:
log-queries: yes
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;I spent hours fiddling before I realised I was missing the empty &amp;ldquo;server:&amp;rdquo; directive. -__-&lt;/p&gt;
&lt;p&gt;This will log all DNS queries that Unbound deals with. These logs go to the standard internal pfSense log; if you want them to be replicated off to an external syslog server, go Status -&amp;gt; System Logs -&amp;gt; Settings. Scroll down to the &amp;ldquo;Remote Log Servers&amp;rdquo; section and add your syslog server there. (I&amp;rsquo;m not covering syslog listener config in this particualar post!)&lt;/p&gt;
&lt;h2 id="zentyal"&gt;Zentyal
&lt;/h2&gt;&lt;p&gt;Yeah this one was harder to figure out. Because Zentyal overwrites the config at &lt;em&gt;every damn opportunity&lt;/em&gt;, you can&amp;rsquo;t just edit &lt;code&gt;/etc/bind/named.conf.options&lt;/code&gt;, like what you find in &lt;a class="link" href="https://www.thegeekdiary.com/how-to-enable-bind-query-logging-to-find-out-whos-querying-a-name-server/" target="_blank" rel="noopener"
 &gt;most articles&lt;/a&gt;&amp;hellip; it may work for a moment, but it&amp;rsquo;ll be overwritten.&lt;/p&gt;
&lt;p&gt;The real answer to editing Zentyal&amp;rsquo;s config files is outlined at &lt;a class="link" href="https://doc.zentyal.org/en/appendix-c.html#stubs" target="_blank" rel="noopener"
 &gt;https://doc.zentyal.org/en/appendix-c.html#stubs&lt;/a&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;:::bash
cp /usr/share/zentyal/stubs/dns/named.conf.options.mas /etc/zentyal/stubs/dns/named.conf.options.mas
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Once you&amp;rsquo;ve copied the stub into a place where it won&amp;rsquo;t be clobbered, edit it and zoom right down to the bottom line, which looks like:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;:::ini
logging { category lame-servers { null; }; };
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This is the line you need to replace. Now, you can go as ham as you want here. I&amp;rsquo;ve actually used the sample provided by ISC themselves, which you can find at &lt;a class="link" href="https://kb.isc.org/docs/aa-01526" target="_blank" rel="noopener"
 &gt;https://kb.isc.org/docs/aa-01526&lt;/a&gt;. However, that&amp;rsquo;s really robust and possibly more than you may need. A bare minimum would probably look like:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;:::ini
logging { 
 channel queries_log {
 syslog named;
 print-time yes;
 print-category yes;
 print-severity yes;
 severity info;
 };
};
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Note - when I tried to use the ISC sample wholesale, I needed to change a couple small things:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Changed all &lt;code&gt;/var/named/log&lt;/code&gt; output destinations to &lt;code&gt;/var/log/named&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;The lines for &lt;code&gt;category zoneload&lt;/code&gt; and &lt;code&gt;category trust-anchor-telemetry&lt;/code&gt; need to be removed for Zentyal 6.2&amp;rsquo;s version of BIND9&lt;/li&gt;
&lt;li&gt;I needed to create &lt;code&gt;/var/log/named&lt;/code&gt;, and make sure it was writeable by the bind user&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;I think that covers it, I hope this helps someone! I&amp;rsquo;ve actually even taken the time today to create a &lt;a class="link" href="https://github.com/zentyal/zentyal/pull/2005" target="_blank" rel="noopener"
 &gt;Pull Request&lt;/a&gt; in the Zentyal GitHub, we&amp;rsquo;ll see if it ends up getting merged!&lt;/p&gt;</description></item><item><title>Daaaaaal!</title><link>https://www.ericlight.com/post/daal.html</link><pubDate>Tue, 24 Nov 2020 00:00:00 +1300</pubDate><guid>https://www.ericlight.com/post/daal.html</guid><description>&lt;img src="https://www.ericlight.com/post/daal/daal-india.jpg" alt="Featured image of post Daaaaaal!" /&gt;&lt;p&gt;I&amp;rsquo;ve loved daal (or dal or dahl or dhal etc) since my trip to India in 2019&amp;hellip; Ugh, that seems so interminably long ago now, in the final weeks of the long decade of 2020. Anyway.&lt;/p&gt;
&lt;p&gt;&lt;img alt="A dark, brown-green daal makhani, with swirls of cream visible." class="gallery-image" data-flex-basis="223px" data-flex-grow="93" data-title-escaped="Daal makhani in Varanasi." height="858" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://www.ericlight.com/post/daal/daal-india.jpg" title="Daal makhani in Varanasi." width="800"&gt;&lt;/p&gt;
&lt;p&gt;So there&amp;rsquo;s this recipe I&amp;rsquo;ve followed a handful of times. I like it, it&amp;rsquo;s similar to what I enjoyed while travelling through Jaipur, but it doesn&amp;rsquo;t really &lt;em&gt;kick&lt;/em&gt; the same way that the food in India did, so I always find myself tweaking it. The base recipe came from &lt;a class="link" href="https://thewanderlustkitchen.com/indian-red-lentil-dal/" target="_blank" rel="noopener"
 &gt;https://thewanderlustkitchen.com/indian-red-lentil-dal/&lt;/a&gt; &amp;hellip; and then I looked up a specifically Rajasthani daal recipe and found &lt;a class="link" href="https://www.archanaskitchen.com/rajasthani-dal-recipe" target="_blank" rel="noopener"
 &gt;this one&lt;/a&gt; which is super similar. The place I&amp;rsquo;ve settled is in the middle of the two.&lt;/p&gt;
&lt;h1 id="ingredients-and-method-jumbled-into-one"&gt;Ingredients and Method, jumbled into one
&lt;/h1&gt;&lt;h3 id="step-one-the-pot"&gt;Step One (the pot)
&lt;/h3&gt;&lt;ul&gt;
&lt;li&gt;3/4 cup Red Lentils - rinsed&lt;/li&gt;
&lt;li&gt;1/4 cup Green Lentils - rinsed&lt;/li&gt;
&lt;li&gt;3 cups water (not boiling, just room temp)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;After rinsing, put the lentils and water in a medium pot over medium heat. Let them simmer while you prep the rest.&lt;/p&gt;
&lt;h3 id="step-two-the-fry-pan"&gt;Step Two (the fry pan)
&lt;/h3&gt;&lt;ul&gt;
&lt;li&gt;1.5 tsp Cumin seeds&lt;/li&gt;
&lt;li&gt;1 Cinnamon stick&lt;/li&gt;
&lt;li&gt;1 Tbsp butter or ghee&lt;/li&gt;
&lt;li&gt;1 Tbsp oil&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Put these into a medium fry pan; don&amp;rsquo;t turn it on yet.&lt;/p&gt;
&lt;h3 id="step-three-the-base-spices"&gt;Step Three (the base spices)
&lt;/h3&gt;&lt;ul&gt;
&lt;li&gt;6 cloves of garlic, chopped&lt;/li&gt;
&lt;li&gt;1.5 Tbsp of ginger, I just used the crushed stuff&lt;/li&gt;
&lt;li&gt;1 large onion, diced. Use different types of onion if you&amp;rsquo;re feeling ✧･ﾟ: &lt;em&gt;✧･ﾟ:&lt;/em&gt; &lt;em&gt;faaancy&lt;/em&gt; &lt;em&gt;:･ﾟ✧&lt;/em&gt;:･ﾟ✧&lt;/li&gt;
&lt;li&gt;2 green chilies. Dump the seeds and chop them up.&lt;/li&gt;
&lt;li&gt;If you don&amp;rsquo;t have chilies, drop in 2 Tbsp of Salsa Picante instead, for that capsicum-type flavour.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Prep the above, and put them all into a small bowl.&lt;/p&gt;
&lt;h3 id="step-four-get-your-heat-on"&gt;Step Four (get your heat on)
&lt;/h3&gt;&lt;p&gt;At this point, turn the frypan on to medium heat. Let the cumin and cinnamon sizzle in the oil for about a minute, until the scent starts to pop.&lt;/p&gt;
&lt;p&gt;Just before it starts to smoke, throw in the contents of your small bowl from Step Three, give it a stir, and crank the heat up to eleven.&lt;/p&gt;
&lt;h3 id="step-five-getting-serious-now"&gt;Step Five (getting serious now)
&lt;/h3&gt;&lt;ul&gt;
&lt;li&gt;1 tsp turmeric&lt;/li&gt;
&lt;li&gt;1 tsp paprika&lt;/li&gt;
&lt;li&gt;2/3 tsp cardamom (either ground, or smash the seeds in a pestle)&lt;/li&gt;
&lt;li&gt;1/2 tsp red chilli powder&lt;/li&gt;
&lt;li&gt;2 bay leaves&lt;/li&gt;
&lt;li&gt;1 tomato, diced&lt;/li&gt;
&lt;li&gt;Spinach! I used about a cup worth of the frozen chopped stuff (defrosted first, of course)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Give your frypan a stir every couple of minutes. By the time you&amp;rsquo;ve finished chopping the tomato and getting the rest of this together, the onions should be transparent and the whole thing should be smelling amazing.&lt;/p&gt;
&lt;p&gt;Add all these ingredients to the frypan and give it another stir. Stir up the lentils as well, they should have been simmering for a few minutes by now!&lt;/p&gt;
&lt;h3 id="step-six-tune-those-flavours"&gt;Step Six (tune those flavours)
&lt;/h3&gt;&lt;p&gt;This last part really comes down to personal tastes, but here&amp;rsquo;s my go:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;1/2 tsp salt&lt;/li&gt;
&lt;li&gt;1/2 tsp Aromat or MSG&lt;/li&gt;
&lt;li&gt;1 tsp Vegeta vegetable stock&lt;/li&gt;
&lt;li&gt;1 tsp dried coriander&lt;/li&gt;
&lt;li&gt;The juice of one lemon&lt;/li&gt;
&lt;li&gt;1 cup of coconut cream, regular cream, or yoghurt&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Once the lentils have thickened up, mix in all the above, and then stir in the now-cooked contents of your frypan. That&amp;rsquo;s it, your daal is assembled! Taste and tweak as desired, and then serve on rice.&lt;/p&gt;
&lt;p&gt;&lt;img alt="My daal, in the pot at home. Much more yellow cast than the makhani style above." class="gallery-image" data-flex-basis="180px" data-flex-grow="75" data-title-escaped="The end result." height="800" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://www.ericlight.com/post/daal/daal-home.jpg" title="The end result." width="600"&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Enjoy!&lt;/em&gt;&lt;/p&gt;</description></item><item><title>iRedMail, SpamAssassin, and Lynis</title><link>https://www.ericlight.com/post/iredmail-lynis.html</link><pubDate>Mon, 02 Nov 2020 00:00:00 +1300</pubDate><guid>https://www.ericlight.com/post/iredmail-lynis.html</guid><description>&lt;p&gt;I really like iRedMail, and I also really like Lynis.&lt;/p&gt;
&lt;p&gt;However, they don&amp;rsquo;t exactly like &lt;em&gt;each other&lt;/em&gt;&amp;hellip; or, more accurately, some of Lynis&amp;rsquo; recommendations can cause a couple iRedMail components to fail. Today we&amp;rsquo;re talking about SpamAsassin.&lt;/p&gt;
&lt;p&gt;One of the suggestions from Lynis is to turn off the &amp;rsquo;execute&amp;rsquo; bit on compilers for users who aren&amp;rsquo;t either the owner or in the owner group (the &amp;lsquo;other&amp;rsquo; execute bit). For example:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;:::bash
root@server:/# chmod o-x /usr/bin/as
root@server:/# chmod o-x /usr/bin/gcc
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Easy peasy! But once you do this, you might start getting the following in your daily iRedMail Cron reports:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;:::text
/etc/cron.daily/spamassassin:
/bin/sh: 1: x86_64-linux-gnu-gcc: Permission denied
make: *** [Makefile:346: body_0.o] Error 126
command 'make PREFIX=/tmp/.spamassassin23046Zmmrr9tmp/ignored INSTALLSITEARCH=/var/lib/spamassassin/compiled/5.028/3.004002 &amp;gt;&amp;gt;/tmp/.spamassassin23046Zmmrr9tmp/log' failed: exit 2
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;There are probably a bunch of ways to fix this. My way, I&amp;rsquo;m sure, is not the best way&amp;hellip; however it was quick and easy, and it worked.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;:::bash
root@server:/# chgrp debian-spamd /usr/bin/as
root@server:/# chgrp debian-spamd /usr/bin/gcc
root@server:/# runuser -l debian-spamd -c sa-compile
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Look ma, no more errors!&lt;/p&gt;
&lt;p&gt;This solution really &lt;em&gt;only&lt;/em&gt; works for me because debian-spamd is the only non-root user that calls these compilers. If I had another user which needed to call them, I&amp;rsquo;d have to come up with a better fix. But for a standalone iRedMail server, this does the trick!&lt;/p&gt;</description></item><item><title>iRedMail: Daily user unknown entries from backup_sogo.sh</title><link>https://www.ericlight.com/post/sogo-unknown.html</link><pubDate>Sun, 01 Nov 2020 00:00:00 +1300</pubDate><guid>https://www.ericlight.com/post/sogo-unknown.html</guid><description>&lt;p&gt;If you&amp;rsquo;ve been running iRedMail for a while, eventually you&amp;rsquo;ll probably start seeing &amp;lsquo;user unknown&amp;rsquo; events in your daily logs:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;:::text
* Backup all users' data under /var/vmail/backup/sogo/2020/11/01
&amp;lt;0x0x5574a64c36b0[SOGoCache]&amp;gt; Cache cleanup interval set every 300.000000 seconds
&amp;lt;0x0x5574a64c36b0[SOGoCache]&amp;gt; Using host(s) '127.0.0.1' as server(s)
2020-11-01 09:29:12.784 sogo-tool[29749:29749] user 'abdulm' unknown
2020-11-01 09:29:12.786 sogo-tool[29749:29749] user 'bent' unknown
2020-11-01 09:29:12.786 sogo-tool[29749:29749] user 'brettr' unknown
2020-11-01 09:29:12.786 sogo-tool[29749:29749] user 'catalinar' unknown
2020-11-01 09:29:12.787 sogo-tool[29749:29749] user 'clinth' unknown
2020-11-01 09:29:12.787 sogo-tool[29749:29749] user 'danield' unknown
2020-11-01 09:29:12.787 sogo-tool[29749:29749] user 'dannyn' unknown
2020-11-01 09:29:12.788 sogo-tool[29749:29749] user 'darcyk' unknown
2020-11-01 09:29:12.788 sogo-tool[29749:29749] user 'davidl' unknown
* Compress backup files.
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This is because removal of an iRedMail user doesn&amp;rsquo;t remove the corresponding SOGo user data. You can take care of this with &lt;code&gt;sogo-tool&lt;/code&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;:::bash
root@server:/# sogo-tool remove abdulm@&amp;lt;domain.xyz&amp;gt; bent@&amp;lt;domain.xyz&amp;gt; brettr@&amp;lt;domain.xyz&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&amp;hellip; etc. Once you&amp;rsquo;re done, run the backup again to make sure you&amp;rsquo;ve got them all:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;:::bash
root@server:/# /bin/bash /var/vmail/backup/backup_sogo.sh
* Backup all users data under /var/vmail/backup/sogo/2020/11/01
&amp;lt;0x0x563fd0e2b6b0[SOGoCache]&amp;gt; Cache cleanup interval set every 300.000000 seconds
&amp;lt;0x0x563fd0e2b6b0[SOGoCache]&amp;gt; Using host(s) '127.0.0.1' as server(s)
* Compress backup files.
&lt;/code&gt;&lt;/pre&gt;</description></item><item><title>Your mate Eric, and his journey through depression</title><link>https://www.ericlight.com/post/depression.html</link><pubDate>Thu, 08 Oct 2020 00:00:00 +1300</pubDate><guid>https://www.ericlight.com/post/depression.html</guid><description>&lt;img src="https://www.ericlight.com/post/depression/mhaw.jpg" alt="Featured image of post Your mate Eric, and his journey through depression" /&gt;&lt;p&gt;A couple of months ago, the team at my day job asked me to write something for &lt;a class="link" href="https://www.mhaw.nz/" target="_blank" rel="noopener"
 &gt;Mental Health Awareness Week&lt;/a&gt;, so today I&amp;rsquo;m sharing some of my personal experiences around depression. It&amp;rsquo;s one of my longer articles, but the key message I want you to hear is: If you&amp;rsquo;re struggling, speak with someone. Seriously, just lean over to your mate now and say &amp;ldquo;Hey, did you see that article from Eric today?&amp;rdquo; – that&amp;rsquo;s all it takes to start a conversation, and believe me: sharing your feelings is a solid way to start getting on top of them.&lt;/p&gt;
&lt;p&gt;&lt;img alt="Mental Health Awareness Week banner" class="gallery-image" data-flex-basis="547px" data-flex-grow="228" height="307" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://www.ericlight.com/post/depression/mhaw.jpg" width="700"&gt;&lt;/p&gt;
&lt;p&gt;The year was 2011, maybe February, about 10pm&amp;hellip; the kids were in bed, school lunches packed, teeth brushed. It was a normal part of a normal bedtime routine for the whole household. I don&amp;rsquo;t particularly recall anything &lt;em&gt;happening&lt;/em&gt;&amp;hellip; but I remember looking at my wife and saying, &amp;ldquo;&lt;em&gt;Shit&amp;hellip; I think I&amp;rsquo;m depressed&lt;/em&gt;&amp;rdquo;. In the morning I phoned my doc (that was the hardest part) who started me on &lt;a class="link" href="https://www.healthnavigator.org.nz/medicines/s/ssri-antidepressants/" target="_blank" rel="noopener"
 &gt;Fluoxetine&lt;/a&gt; - the medication that supported me throughout my recovery. Making that phone call the first step in a long journey, but it cemented my realisation that I was struggling, and that I needed help.&lt;/p&gt;
&lt;p&gt;The &lt;a class="link" href="https://www.mentalhealth.org.nz/" target="_blank" rel="noopener"
 &gt;New Zealand Mental Health Foundation&lt;/a&gt; says that one in six New Zealand adults have been &lt;em&gt;diagnosed&lt;/em&gt; with a common mental disorder (depression, anxiety, bipolar) at some time in their lives. And behind every diagnosis, there are a host of other staunch people who have struggled and pushed to battle through it silently, sometimes with heart-breaking results. (Rest easy, Deano 💔). According to the World Health Organization (&lt;a class="link" href="https://www.health.govt.nz/our-work/mental-health-and-addictions/mental-health" target="_blank" rel="noopener"
 &gt;via health.govt.nz&lt;/a&gt;), mental illness accounts for 15% of the total burden of disease in the developed world, with depression set to become the second leading cause of disability in the world by *&lt;em&gt;checks watch&lt;/em&gt;* &amp;hellip; 2020.&lt;/p&gt;
&lt;p&gt;&lt;img alt="Yikes dot png" class="gallery-image" data-flex-basis="554px" data-flex-grow="231" height="129" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://www.ericlight.com/post/depression/yikes.png" width="298"&gt;&lt;/p&gt;
&lt;p&gt;Realising I was depressed came as quite a shock to me. I&amp;rsquo;ve always been the dude who has a smile on his face, laughs at every opportunity, and gets &lt;a class="link" href="https://www.adventurealan.com/" target="_blank" rel="noopener"
 &gt;super&lt;/a&gt; &lt;a class="link" href="https://www.xkcd.com/" target="_blank" rel="noopener"
 &gt;enthusiastic&lt;/a&gt; &lt;a class="link" href="https://www.laroma.co.nz/" target="_blank" rel="noopener"
 &gt;about&lt;/a&gt; &lt;a class="link" href="https://www.soba.org.nz/" target="_blank" rel="noopener"
 &gt;super&lt;/a&gt; &lt;a class="link" href="https://sharpologist.com/" target="_blank" rel="noopener"
 &gt;niche&lt;/a&gt; &lt;a class="link" href="https://www.ericlight.com/" target="_blank" rel="noopener"
 &gt;things&lt;/a&gt;. I was running a reasonably successful business at the time, really enjoyed my work and my colleagues, had a thriving family&amp;hellip; It didn&amp;rsquo;t make a whole lot of sense to me. Things were looking good!&lt;/p&gt;
&lt;p&gt;&lt;img alt="‘Stonks’ meme, happy man, stocks go up" class="gallery-image" data-flex-basis="320px" data-flex-grow="133" height="300" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://www.ericlight.com/post/depression/stonks.png" width="400"&gt;&lt;/p&gt;
&lt;p&gt;In retrospect, all of that was true, but it&amp;rsquo;s only part of the picture. I was exhausted, working at least 60 hours a week, I rarely had real (uninterrupted) time to spend with my family, and there was a huge mental burden knowing that 16 individual lives were reliant on the income that the company created&amp;hellip; a company which, though financially &amp;ldquo;fine&amp;rdquo;, was never financially &amp;ldquo;flourishing&amp;rdquo;. I&amp;rsquo;d lost touch with friends, stopped exercising, and wasn&amp;rsquo;t engaging in anything I truly loved. Things were not looking good.&lt;/p&gt;
&lt;p&gt;&lt;img alt="‘Not stonks’ meme, sad man, stocks go down" class="gallery-image" data-flex-basis="400px" data-flex-grow="166" height="240" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://www.ericlight.com/post/depression/not_stonks.jpg" width="400"&gt;&lt;/p&gt;
&lt;p&gt;Depression was not what I expected. People talk about the &amp;ldquo;black dog&amp;rdquo; of depression, and I guess I expected it to be &amp;ldquo;feeling sad all the time&amp;rdquo;. I rarely felt sad; I just felt numb and disengaged, and it felt like my head was full of mud. Instead of heading off on my mountain bike or making plans for after work, I&amp;rsquo;d rather sit on the couch and scroll through social media until bedtime arrived. But when I did end up in a social situation, I could easily engage and laugh and chat – enough that nobody suspected how I was feeling. Years later, when I was sharing my experiences with a friend, I described it as &amp;ldquo;the shine had gone off everything&amp;rdquo;. Disinterested, disengaged, foggy-brained, and no motivation to change any of it. (big note: this is how I felt it, but folks experience depression differently)&lt;/p&gt;
&lt;p&gt;What helped me through? Firstly, medication. Antidepressants usually take a full two weeks to kick in, but before long I realised that the general foggy/muddiness of my brain was starting to lift. I could mentally take things in again, and I was a little less detached&amp;hellip; enough that I could turn up somewhere voluntarily. Once I was able to actively engage a little, I started exercising a bit. We all know that exercise is a strong antidepressant, but I needed help &lt;em&gt;in order to do that&lt;/em&gt;. And the third thing that helped – once I&amp;rsquo;d been on meds and exercising for a couple months, I had the capacity to visit friends, share stories, and make regular commitments. My mate Russell and I would catch up every Friday at 5pm, cook dinner for our combined families, and then spend hours talking, playing guitar, singing, and just generally enjoying friendship. That connectedness is what I finally needed to recover from depression.&lt;/p&gt;
&lt;p&gt;Important note: Everyone is different, and that difference is rarely more pronounced than in mental health. For example, the medication that worked for me may not work for everyone, and medication often doesn&amp;rsquo;t work alone. Friends of mine have tried three or four different types of antidepressants before finding one that helped, and counselling often plays a critical role in recovery.&lt;/p&gt;
&lt;p&gt;&lt;img alt="Eric and Russell, playing guitars at a picnic table while out camping" class="gallery-image" data-flex-basis="320px" data-flex-grow="133" data-title-escaped="Ol&amp;amp;rsquo; Rusty and I, glamping at Athenree Campground, in 2011" height="450" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://www.ericlight.com/post/depression/russ.jpg" title="Ol&amp;rsquo; Rusty and I, glamping at Athenree Campground, in 2011" width="600"&gt;&lt;/p&gt;
&lt;p&gt;Connectedness with community and friends is one of our most powerful contributors to happiness and that sense of fulfilment we yearn for. Humans are very social creatures, and it&amp;rsquo;s essential to our wellbeing to engage and bring value to our social circle. We all need to put time into our friendships, our community, and our passions – neglecting these can bring a much greater cost than we expect, and it&amp;rsquo;s hard to dig yourself out once you&amp;rsquo;re in that hole. In fact – your friends and community are critical to pulling you out, which is why opening up and talking about it is so important. We can&amp;rsquo;t help if we don&amp;rsquo;t know.&lt;/p&gt;
&lt;p&gt;To finish up this article, I thought I&amp;rsquo;d share a couple of resources. I went through my depression at the same time as Hyperbole-and-a-Half author Allie, who has a comical story &lt;a class="link" href="http://hyperboleandahalf.blogspot.com/2011/10/adventures-in-depression.html" target="_blank" rel="noopener"
 &gt;here&lt;/a&gt;. A less-silly comic was drawn up by artist Colleen Butters &lt;a class="link" href="https://solar-citrus.tumblr.com/post/98583201090/you-would-be-surprised-with-how-many-people-in" target="_blank" rel="noopener"
 &gt;here&lt;/a&gt;, which I also recommend. &lt;a class="link" href="https://thelostconnections.com/" target="_blank" rel="noopener"
 &gt;Lost Connections&lt;/a&gt; by Johann Hari is an excellent book, bringing together research from the last fifty years, with a focus on social connectivity. And if someone reaches out to you for support, there are some resources on how best to help at the &lt;a class="link" href="https://www.mentalhealth.org.nz/get-help/in-crisis/worried-about-someone/" target="_blank" rel="noopener"
 &gt;Mental Health Foundation&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Oh, getting back to the beginning of the story. Of course, my wife replied &amp;ldquo;Yeah, &lt;em&gt;duh&lt;/em&gt;, I&amp;rsquo;ve been trying to tell you that for months.&amp;rdquo; ¯\_(ツ)\_/¯&lt;/p&gt;</description></item><item><title>Make the Flex theme center images</title><link>https://www.ericlight.com/post/flex.html</link><pubDate>Wed, 07 Oct 2020 00:00:00 +1300</pubDate><guid>https://www.ericlight.com/post/flex.html</guid><description>&lt;p&gt;Previously I&amp;rsquo;ve been frustrated that the CSS in the &lt;a class="link" href="https://www.getpelican.com" target="_blank" rel="noopener"
 &gt;Pelican&lt;/a&gt; &lt;a class="link" href="https://github.com/alexandrevicenzi/Flex" target="_blank" rel="noopener"
 &gt;Flex theme&lt;/a&gt; doesn&amp;rsquo;t centre images. However, I&amp;rsquo;m only one user with one use-case, so I haven&amp;rsquo;t raised a pull request.&lt;/p&gt;
&lt;p&gt;Instead, I&amp;rsquo;ve finally gotten around to creating a quick-and-dirty sed string to fix the minified CSS file:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;sed -i 's/}img{max-width:100%}/}img{max-width:100%;margin-left:auto;margin-right:auto;display:block}/' style.min.css
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;I also like my caption text to be italicised and centered, so I extended this a little:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;sed -i 's/}img{max-width:100%}/}img{max-width:100%;margin-left:auto;margin-right:auto;display:block}figcaption{font-style:italic;text-align:center}' style.min.css
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Run either of those in &lt;code&gt;./Flex/static/stylesheet&lt;/code&gt;. It&amp;rsquo;ll modify just the img class in the CSS and suddenly all your images will center unless you tell them not to!&lt;/p&gt;</description></item><item><title>Kate Bush - Army Dreamers guitar tab</title><link>https://www.ericlight.com/post/army_dreamers.html</link><pubDate>Sun, 30 Aug 2020 00:00:00 +1200</pubDate><guid>https://www.ericlight.com/post/army_dreamers.html</guid><description>&lt;p&gt;Some friends and I have been working on our own version of &lt;a class="link" href="https://www.youtube.com/watch?v=QOZDKlpybZE" target="_blank" rel="noopener"
 &gt;Army Dreamers, by Kate Bush&lt;/a&gt;. The original version is replete with instruments, including a prominent Mandolin, some background violins, a synth of some sort, and even the sound of a rifle being racked. Since we&amp;rsquo;re two guitarists, a bassist, and a singer, there&amp;rsquo;s &lt;em&gt;quite a bit&lt;/em&gt; of arranging to do to make it work.&lt;/p&gt;
&lt;p&gt;Although there&amp;rsquo;s plenty of tab around for the &lt;em&gt;mandolin&lt;/em&gt; part, that&amp;rsquo;s only a few notes, with the violin part kicking in immediately afterwards. I wanted to cover both.&lt;/p&gt;
&lt;p&gt;There are four separate phases in it, which I&amp;rsquo;ve made up some unimaginative names for:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The slide phrase&lt;/li&gt;
&lt;li&gt;The downwards walk&lt;/li&gt;
&lt;li&gt;The upwards walk&lt;/li&gt;
&lt;li&gt;The violin phrase&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The bar structure runs like this:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Slide phrase + violin phrase&lt;/li&gt;
&lt;li&gt;Downwards walk + violin phrase&lt;/li&gt;
&lt;li&gt;Slide phrase + violin phrase&lt;/li&gt;
&lt;li&gt;Upwards walk + violin phrase&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;That structure is then repeated for the entire song. As you can see, the violin phrase is actually dominant, being played at the end of every bar.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;:::text
 The slide phrase The violin phrase Downwards walk phrase Violin phrase again
e|--17/14-14----17/9-9-----9h10p9------------------10----9----10--------------9h10p9----------------|
B|----------------------------------10--------------------------------7----------------10-----------|
G|---------------------------------------9--------------------------------------------------9-------|
D|-------------------------------------------9--------------------------------------------------9---|
A|--------------------------------------------------------------------------------------------------|
E|--------------------------------------------------------------------------------------------------|



 The slide phrase The violin phrase The upwards walk phrase Violin phrase again 
e|--17/14-14----17/9-9-----9h10p9----------------------------7----9-----------9h10p9----------------|
B|----------------------------------10-------------7----8------------------------------10-----------|
G|---------------------------------------9--------------------------------------------------9-------|
D|-------------------------------------------9--------------------------------------------------9---|
A|--------------------------------------------------------------------------------------------------|
E|--------------------------------------------------------------------------------------------------|
&lt;/code&gt;&lt;/pre&gt;</description></item><item><title>Ham and Pea Soup</title><link>https://www.ericlight.com/post/pea_ham_soup.html</link><pubDate>Sun, 09 Aug 2020 00:00:00 +1200</pubDate><guid>https://www.ericlight.com/post/pea_ham_soup.html</guid><description>&lt;p&gt;I&amp;rsquo;ve never made Ham and Pea soup before today. I remember my mum making it when I was younger, but it was never really my thing. But tonight just seemed the right combination of a rainy, chilly, wintery evening&amp;hellip; and we had some leftover &lt;a class="link" href="https://www.ericlight.com/post/cornbread.html" &gt;jalapeño cornbread&lt;/a&gt;!&lt;/p&gt;
&lt;p&gt;Well, it was so good I completely forgot to even take photos. I did it all in our pressure cooker, so the meal was ready in about half an hour. Here&amp;rsquo;s what I did:&lt;/p&gt;
&lt;h1 id="ingredients"&gt;Ingredients
&lt;/h1&gt;&lt;h3 id="primary-aromatics"&gt;Primary Aromatics
&lt;/h3&gt;&lt;ul&gt;
&lt;li&gt;2 tablespoons butter&lt;/li&gt;
&lt;li&gt;5 cloves garlic, chopped&lt;/li&gt;
&lt;li&gt;1 onion, diced&lt;/li&gt;
&lt;li&gt;1 shallot, diced (or just use a bigger onion)&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="secondary-aromatics"&gt;Secondary Aromatics
&lt;/h3&gt;&lt;ul&gt;
&lt;li&gt;2 carrots, chopped about 1cm square ish&lt;/li&gt;
&lt;li&gt;2 celery sticks, chopped about 1cm square ish&lt;/li&gt;
&lt;li&gt;2 bay leaves&lt;/li&gt;
&lt;li&gt;decent pinch of dried parsley&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="body"&gt;Body
&lt;/h3&gt;&lt;ul&gt;
&lt;li&gt;a bacon hock, circa 800g&lt;/li&gt;
&lt;li&gt;500g bag of dried split peas&lt;/li&gt;
&lt;li&gt;1/2c red lentils&lt;/li&gt;
&lt;li&gt;2.5tsp Vegeta vegetable stock powder&lt;/li&gt;
&lt;li&gt;about 6 cups boiling water&lt;/li&gt;
&lt;/ul&gt;
&lt;h1 id="method"&gt;Method
&lt;/h1&gt;&lt;ol&gt;
&lt;li&gt;Start by putting the peas in the pressure cooker pot, and soaking them in fairly hot water. Then start your prep.&lt;/li&gt;
&lt;li&gt;Once the veggies are prepped, drain the peas and set them aside. Rinse the pot, and put it on the stovetop on high.&lt;/li&gt;
&lt;li&gt;Add your primary aromatics and fry for 5 minutes, then add the secondary aromatics and fry another 10 minutes.&lt;/li&gt;
&lt;li&gt;Remove from stovetop, and put the inner into the pressure cooker body.&lt;/li&gt;
&lt;li&gt;Add the peas and lentils to the pot, sprinkle in the vegetable stock, and mix it all together.&lt;/li&gt;
&lt;li&gt;Create a depression in the mix, and place the bacon hock in, so it&amp;rsquo;s as low in the pot as possible.&lt;/li&gt;
&lt;li&gt;Fill with boiling water until covered, and try to stir it a bit without lifting the hock too much.&lt;/li&gt;
&lt;li&gt;Put on lid, and pressure cook for 30 minutes.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;That&amp;rsquo;s about it! After that it was just a matter of chopping the meat off the hock, stirring it in, and potentially adding a little more water.&lt;/p&gt;
&lt;p&gt;It would have been far easier to use a boneless lump of ham instead of the boney bacon hock. If you do this, add some extra stock powder to compensate for the missing salt.&lt;/p&gt;
&lt;p&gt;Credit: The recipe above is based on &lt;a class="link" href="https://www.allrecipes.com/recipe/219170/ham-and-split-pea-soup-recipe-a-great-soup/" target="_blank" rel="noopener"
 &gt;https://www.allrecipes.com/recipe/219170/ham-and-split-pea-soup-recipe-a-great-soup/&lt;/a&gt;, with a good few tweaks of my own.&lt;/p&gt;</description></item><item><title>Delicious Cornbread</title><link>https://www.ericlight.com/post/cornbread.html</link><pubDate>Sun, 26 Jul 2020 00:00:00 +1200</pubDate><guid>https://www.ericlight.com/post/cornbread.html</guid><description>&lt;img src="https://www.ericlight.com/post/cornbread/cornbread.jpg" alt="Featured image of post Delicious Cornbread" /&gt;&lt;p&gt;I remember celebrating Christmas with family in New Mexico when I was a kid. I was fairly young, but I think it must have been at the &lt;a class="link" href="https://en.wikipedia.org/wiki/Christmas_in_Mexico#Feast_of_the_Virgin_of_Guadalupe" target="_blank" rel="noopener"
 &gt;Feast of the Virgin of Guadalupe&lt;/a&gt;. One of the most delicious treats I recall from the Feast was real Mexican cornbread.&lt;/p&gt;
&lt;p&gt;Now, every few years I&amp;rsquo;ll head into &lt;a class="link" href="https://www.gilmours.co.nz/" target="_blank" rel="noopener"
 &gt;Gilmours&lt;/a&gt; and yoink a three-kilo bag of cornmeal. I don&amp;rsquo;t make this often, but we do all love it, and one batch usually makes enough for multiple households.&lt;/p&gt;
&lt;p&gt;&lt;img alt="A cast-iron skillet, hot from the oven, cradling a golden-brown cornbread." class="gallery-image" data-flex-basis="319px" data-flex-grow="133" data-title-escaped="It really comes out this beautiful every time." height="2117" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://www.ericlight.com/post/cornbread/cornbread.jpg" srcset="https://www.ericlight.com/post/cornbread/cornbread_hu_32aeee42aa8b36c5.jpg 800w, https://www.ericlight.com/post/cornbread/cornbread_hu_3b934234c19a6fde.jpg 1600w, https://www.ericlight.com/post/cornbread/cornbread_hu_e03490ca3492bd5a.jpg 2400w, https://www.ericlight.com/post/cornbread/cornbread.jpg 2822w" title="It really comes out this beautiful every time." width="2822"&gt;&lt;/p&gt;
&lt;p&gt;I always cook this in a cast-iron skillet, because it allows me to fry off the butter a bit first - this adds a nice roasty nutty flavour.&lt;/p&gt;
&lt;h1 id="ingredients"&gt;Ingredients
&lt;/h1&gt;&lt;h3 id="delicious-fat"&gt;Delicious fat
&lt;/h3&gt;&lt;ul&gt;
&lt;li&gt;120g (half a cup) of butter&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="dry-ingredients"&gt;Dry ingredients
&lt;/h3&gt;&lt;ul&gt;
&lt;li&gt;1.5 cups cornmeal&lt;/li&gt;
&lt;li&gt;1.5 cups other flour (mix &amp;amp; match anything to add up to 1.5c; just avoid self-raising)&lt;/li&gt;
&lt;li&gt;2.5 tsp baking powder&lt;/li&gt;
&lt;li&gt;2 tsp salt&lt;/li&gt;
&lt;li&gt;1 cup brown sugar&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The &amp;lsquo;other flour&amp;rsquo; component is super flexible - as long as it&amp;rsquo;s dry dust, it hardly seems to matter what you use. Rice flour could make this gluten free, or wholemeal to make it gut-friendly, or tapoica flour if you just &amp;hellip; need to use up some random tapioca flour you bought over lockdown for some reason.&lt;/p&gt;
&lt;p&gt;In fact, the cornbread in the oven &lt;em&gt;right now&lt;/em&gt; has some psyllium husk, to try and keep the moisture locked in. (Update: the psyllium was &lt;strong&gt;awesome&lt;/strong&gt;! Substituted 1Tbsp for random flour.)&lt;/p&gt;
&lt;h3 id="wet-ingredients"&gt;Wet ingredients
&lt;/h3&gt;&lt;ul&gt;
&lt;li&gt;3 eggs, room temperature&lt;/li&gt;
&lt;li&gt;1.5 cups milk, room temperature&lt;/li&gt;
&lt;/ul&gt;
&lt;h1 id="method"&gt;Method
&lt;/h1&gt;&lt;ol&gt;
&lt;li&gt;You forgot to warm up your eggs and milk, so pop your milk into the microwave for a minute, and stick the eggs in a bowl of warm water.&lt;/li&gt;
&lt;li&gt;Turn your oven to 180°C, then pop the butter in your skillet and get it melting over low heat.&lt;/li&gt;
&lt;li&gt;Mix your dry ingredients in a mixing bowl. In different (larger) mixing bowl, whisk together the eggs and milk.&lt;/li&gt;
&lt;li&gt;Add the dry ingredients to the wet ones, folding gently. Now you can just dust the flour out of that bowl and put it away! (&lt;em&gt;Life haxx&lt;/em&gt;)&lt;/li&gt;
&lt;li&gt;Your butter should be a nice nutty brown by now; carefully pour it into your batter - keep just a tiny bit in the pan for non-stickness.&lt;/li&gt;
&lt;li&gt;Give everything a gentle stir, and pour the batter into the skillet.&lt;/li&gt;
&lt;li&gt;Into the oven it goes! Cook until a toothpick comes out clean, approx 20~30 minutes.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;img alt="Steaming-hot, soft cornbread, slumbering contentedly on a chopping board. A lazy dollop of butter melts upon the brown crust. In the distance, trumpets." class="gallery-image" data-flex-basis="319px" data-flex-grow="133" data-title-escaped="Yum." height="2117" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://www.ericlight.com/post/cornbread/cornbread-action.jpg" srcset="https://www.ericlight.com/post/cornbread/cornbread-action_hu_7fa1d887b46fb74f.jpg 800w, https://www.ericlight.com/post/cornbread/cornbread-action_hu_e5684547153dff52.jpg 1600w, https://www.ericlight.com/post/cornbread/cornbread-action_hu_cce8cc2523cbf0e7.jpg 2400w, https://www.ericlight.com/post/cornbread/cornbread-action.jpg 2822w" title="Yum." width="2822"&gt;&lt;/p&gt;
&lt;h1 id="jalapeño-update"&gt;Jalapeño Update
&lt;/h1&gt;&lt;p&gt;Today I tried some jalapeño and cheese in the cornbread. It was easily the best cornbread I&amp;rsquo;ve made so far!&lt;/p&gt;
&lt;p&gt;As above, except with the following modifications:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Increase salt to 2.5tsp&lt;/li&gt;
&lt;li&gt;Reduce sugar to a half cup&lt;/li&gt;
&lt;li&gt;2~2.5 cups of grated cheese&lt;/li&gt;
&lt;li&gt;About 1/3 cup of chopped jalapeño&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The cheese and jalapeño go into the batter after the butter is mixed in - just before you pour it into the skillet.&lt;/p&gt;
&lt;p&gt;Today&amp;rsquo;s cheese was about 1.5 cups of grated Colby, and another half cup of grated parmesan to add a bit of sharpness. It wasn&amp;rsquo;t &lt;em&gt;quite&lt;/em&gt; enough, so next time I&amp;rsquo;ll either increase the proprtion of parmesan to 2/3c, or use a slightly sharper base cheese.&lt;/p&gt;
&lt;p&gt;&lt;img alt="The jalapeño and cheese on the chopping board, ready to be introduced to the batter" class="gallery-image" data-flex-basis="408px" data-flex-grow="170" data-title-escaped="The cheese and jalapeño ready for the pan!" height="2268" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://www.ericlight.com/post/cornbread/cornbread-cheese.jpg" srcset="https://www.ericlight.com/post/cornbread/cornbread-cheese_hu_dae0dc417fe65af5.jpg 800w, https://www.ericlight.com/post/cornbread/cornbread-cheese_hu_40bf56b765034ef4.jpg 1600w, https://www.ericlight.com/post/cornbread/cornbread-cheese_hu_41f5bdbc9cc14ade.jpg 2400w, https://www.ericlight.com/post/cornbread/cornbread-cheese.jpg 3864w" title="The cheese and jalapeño ready for the pan!" width="3864"&gt;&lt;/p&gt;
&lt;p&gt;Credit: The recipe above is almost entirely from &lt;a class="link" href="https://cookieandkate.com/honey-butter-cornbread-recipe/" target="_blank" rel="noopener"
 &gt;https://cookieandkate.com/honey-butter-cornbread-recipe/&lt;/a&gt;, however I&amp;rsquo;ve made a few small tweaks.&lt;/p&gt;</description></item><item><title>I made Salmon Gravlax!</title><link>https://www.ericlight.com/post/salmon_gravlax.html</link><pubDate>Sat, 11 Jul 2020 00:00:00 +1200</pubDate><guid>https://www.ericlight.com/post/salmon_gravlax.html</guid><description>&lt;img src="https://www.ericlight.com/post/salmon_gravlax/gravlax-boat.jpg" alt="Featured image of post I made Salmon Gravlax!" /&gt;&lt;p&gt;I joined some friends last weekend for a belated World Whisky Day celebration. The entry fee was, of course, a bottle of whisky (this year the theme was different finishing casks)&amp;hellip; but we also each bring some delicious morsel that piques our interest.&lt;/p&gt;
&lt;p&gt;This year, as I was bringing &lt;a class="link" href="https://www.glenmorangie.com/en-gb/our-whiskies/the-lasanta" target="_blank" rel="noopener"
 &gt;Glenmorangie&amp;rsquo;s The Lasanta&lt;/a&gt; (aged in Oloroso and Pedro Ximénez sherry casks), I decided my amuse-bouche would be sherry-based.&lt;/p&gt;
&lt;p&gt;My treat was dried prunes, soaked in a dry sherry, then sprinkled with a pinch of salt, and eaten with a tamari-roasted almond. They were quite delicious - you only want to soak them for 5 hours or so though, they do go mushy. The salt is critically important; I&amp;rsquo;m not sure about the tamari, plain almonds may have been just as good.&lt;/p&gt;
&lt;p&gt;Anyway, although my treat was great, it paled in comparison to one of the other treats - an amazing fresh salmon gravlax. I&amp;rsquo;d never heard of gravlax before, but it&amp;rsquo;s actually just a method of curing salmon - sit it in a casing of sugar, salt, and dill for a couple days and it&amp;rsquo;s done! Of course, I had to try it.&lt;/p&gt;
&lt;p&gt;&lt;img alt="My hand, holding a slice of gravlax salmon which was way too thick." class="gallery-image" data-flex-basis="252px" data-flex-grow="105" data-title-escaped="My first introduction to salmon gravlax." height="2877" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://www.ericlight.com/post/salmon_gravlax/gravlax-boat.jpg" srcset="https://www.ericlight.com/post/salmon_gravlax/gravlax-boat_hu_780415d6844c2c3e.jpg 800w, https://www.ericlight.com/post/salmon_gravlax/gravlax-boat_hu_8357db78a5dba006.jpg 1600w, https://www.ericlight.com/post/salmon_gravlax/gravlax-boat_hu_6b3177e85459c6dd.jpg 2400w, https://www.ericlight.com/post/salmon_gravlax/gravlax-boat.jpg 3024w" title="My first introduction to salmon gravlax." width="3024"&gt;&lt;/p&gt;
&lt;p&gt;The recipe below has a couple tweaks, and it&amp;rsquo;s taken almost entirely from &lt;a class="link" href="https://www.recipetineats.com/cured-salmon-gravlax/" target="_blank" rel="noopener"
 &gt;https://www.recipetineats.com/cured-salmon-gravlax/&lt;/a&gt;.&lt;/p&gt;
&lt;h1 id="comments"&gt;Comments
&lt;/h1&gt;&lt;ul&gt;
&lt;li&gt;For the salmon, skin on or off doesn&amp;rsquo;t matter. I did mine skin-on, and it&amp;rsquo;s a little annoying - next time I&amp;rsquo;ll take it off.&lt;/li&gt;
&lt;li&gt;The larger the salt granules, the better. I used &lt;a class="link" href="https://mrsrogers.co.nz/product/himalayan-pink-salt-bag/" target="_blank" rel="noopener"
 &gt;this Himalayan rock salt&lt;/a&gt;. Avoid iodised salt, apparently.&lt;/li&gt;
&lt;li&gt;Prefer bigger sugar granules, too - probably not coffee crystals, but raw sugar worked really nicely. Avoid icing sugar or caster sugar.&lt;/li&gt;
&lt;li&gt;Use peppercorns if you can; they&amp;rsquo;re fresher than pre-ground. If using pre-ground, add a bit extra. I used &lt;a class="link" href="https://mrsrogers.co.nz/product/gourmet-peppercorns-bag/" target="_blank" rel="noopener"
 &gt;these ones&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Curing time is tricky. I did mine for 86 hours and it was definitely a hard-cure, but was still really good. I imagine the whisky weekend version had only been a 48-hour cure.&lt;/li&gt;
&lt;/ul&gt;
&lt;h1 id="ingredients"&gt;Ingredients
&lt;/h1&gt;&lt;ul&gt;
&lt;li&gt;Salmon (de-boned)&lt;/li&gt;
&lt;li&gt;Salt &amp;amp; Sugar (ratio below)&lt;/li&gt;
&lt;li&gt;Pepper (about 2tsp per 500g salmon)&lt;/li&gt;
&lt;li&gt;Dill (optional - about 25g per 500g salmon)&lt;/li&gt;
&lt;li&gt;Coriander seeds (optional - about 2tsp per 500g salmon)&lt;/li&gt;
&lt;li&gt;Grated lemon rind (optional - about a lemon&amp;rsquo;s worth per 500g salmon)&lt;/li&gt;
&lt;/ul&gt;
&lt;h1 id="method"&gt;Method
&lt;/h1&gt;&lt;ol&gt;
&lt;li&gt;Bruise your dill, crush your peppercorns, whack your coriander seeds, and grate your lemon rind&lt;/li&gt;
&lt;li&gt;Mix your cure. I used a recipe of 4:1:1 (fish:sugar:salt), but next time I&amp;rsquo;m doing 5:1:1.&lt;/li&gt;
&lt;li&gt;Once your cure is mixed, fold in your spices and aromatics.&lt;/li&gt;
&lt;li&gt;Spread out half of your cure, lay the salmon on top, and then spread the rest of the cure on top.&lt;/li&gt;
&lt;li&gt;Bag it up! I used a vacuum sealer, but a sandwich bag or some plastic wrap will do the trick.&lt;/li&gt;
&lt;li&gt;Pop it in the fridge with a weight on it (people recommend a plate).&lt;/li&gt;
&lt;li&gt;Flip it over every 12-24 hours. Be careful - a lot of liquid will come out during the curing process!&lt;/li&gt;
&lt;li&gt;Once you&amp;rsquo;ve cured it for 24-72+ hours, pull it out and gently rinse off all the clumps of dill/pepper/salt etc.&lt;/li&gt;
&lt;li&gt;Wrap it in a paper towel to dry it off, then leave it unwrapped in the fridge for a few hours to finish drying out.&lt;/li&gt;
&lt;li&gt;Enjoy! Slice it with a nice sharp knife. I&amp;rsquo;m told it should be sliced &amp;ldquo;thin enough to read a newspaper through&amp;rdquo;.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;img alt="A slice of salmon, so covered in salt, sugar, and dill that the fish itself is invisible. Ready to be bagged." class="gallery-image" data-flex-basis="286px" data-flex-grow="119" data-title-escaped="All ready to go into the vacuum sealer" height="1717" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://www.ericlight.com/post/salmon_gravlax/gravlax-salted.jpg" srcset="https://www.ericlight.com/post/salmon_gravlax/gravlax-salted_hu_1826cb20f6bebcbf.jpg 800w, https://www.ericlight.com/post/salmon_gravlax/gravlax-salted_hu_cd1e5d73f8c28ce.jpg 1600w, https://www.ericlight.com/post/salmon_gravlax/gravlax-salted.jpg 2048w" title="All ready to go into the vacuum sealer" width="2048"&gt;&lt;/p&gt;
&lt;h1 id="other-thoughts"&gt;Other thoughts
&lt;/h1&gt;&lt;ul&gt;
&lt;li&gt;I&amp;rsquo;ve seen recipes that use aquavit&amp;hellip; So next time I&amp;rsquo;m actually going to try a few tablespoons of gin!&lt;/li&gt;
&lt;li&gt;The 4:1:1 ratio wasn&amp;rsquo;t bad - it&amp;rsquo;s just that I ended up pouring out lots of big chunks of salt, so I think it was unnecessary wastage.&lt;/li&gt;
&lt;li&gt;I&amp;rsquo;ve didn&amp;rsquo;t try coriander in this batch, but I&amp;rsquo;m super-keen to try it in the next one. I&amp;rsquo;ve also seen recipes use juniper berries, which is what made me think of the gin.&lt;/li&gt;
&lt;li&gt;What to eat with gravlax? We had it on a platter that also contained seed crackers, a couple cheeses, fruit paste, salami, capers, and pickled gherkins. The capers were great.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img alt="Action shot! Thinly-sliced salmon gravlax, whisky-cured pickled gherkins, avocado toast, and mulled wine." class="gallery-image" data-flex-basis="393px" data-flex-grow="163" data-title-escaped="Things got way too fancy, with the gravlax, some avocado toast, and mulled wine." height="2212" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://www.ericlight.com/post/salmon_gravlax/gravlax-action.jpg" srcset="https://www.ericlight.com/post/salmon_gravlax/gravlax-action_hu_4dcb769bd07294a1.jpg 800w, https://www.ericlight.com/post/salmon_gravlax/gravlax-action_hu_3081233f059ba3e7.jpg 1600w, https://www.ericlight.com/post/salmon_gravlax/gravlax-action_hu_b0edf253a2a06aea.jpg 2400w, https://www.ericlight.com/post/salmon_gravlax/gravlax-action.jpg 3624w" title="Things got way too fancy, with the gravlax, some avocado toast, and mulled wine." width="3624"&gt;&lt;/p&gt;</description></item><item><title>My mountain</title><link>https://www.ericlight.com/post/mountain.html</link><pubDate>Sat, 06 Jun 2020 00:00:00 +1200</pubDate><guid>https://www.ericlight.com/post/mountain.html</guid><description>&lt;img src="https://www.ericlight.com/post/mountain/tongariro.jpg" alt="Featured image of post My mountain" /&gt;&lt;p&gt;&lt;img alt="Landscape photography of Mount Tongariro and Mount Ngauruhoe, covered in white snow" class="gallery-image" data-flex-basis="599px" data-flex-grow="249" height="600" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://www.ericlight.com/post/mountain/tongariro.jpg" srcset="https://www.ericlight.com/post/mountain/tongariro_hu_eb3ed8b23a5accf6.jpg 800w, https://www.ericlight.com/post/mountain/tongariro.jpg 1499w" width="1499"&gt;&lt;/p&gt;
&lt;p&gt;I got a tattoo a couple years ago, which is a sketch outline of Mount Tongariro and Mount Ngauruhoe, in the Central Plateau of New Zealand.&lt;/p&gt;
&lt;p&gt;The photo that the tattoo, which the tattoo was based on, was just the result of a Google search. I&amp;rsquo;ve tried to find it many times since I actually got the tattoo - at very least just so I could give credit to the photographer. However, to no avail.&lt;/p&gt;
&lt;p&gt;The other day I happily found a copy of the photo, and went to Google&amp;rsquo;s Reverse Image Search to figure out where it had come from! The answer is&amp;hellip;&lt;/p&gt;
&lt;p&gt;&amp;hellip; nowhere. Whoever posted the image way-back-when appears to have taken the photo down. The Mighty Goog can&amp;rsquo;t find it anywhere.&lt;/p&gt;
&lt;p&gt;So, here we are I guess. I&amp;rsquo;m uploading the photo here so I don&amp;rsquo;t lose it again. If you took this photo, or if you know who did, please contact me!&lt;/p&gt;</description></item><item><title>ZFS zpool vanishing after upgrading ProxmoxVE 5.4 to 6.2</title><link>https://www.ericlight.com/post/zfs_vanish.html</link><pubDate>Sat, 23 May 2020 00:00:00 +1200</pubDate><guid>https://www.ericlight.com/post/zfs_vanish.html</guid><description>&lt;img src="https://www.ericlight.com/post/zfs_vanish/lost_zpool.png" alt="Featured image of post ZFS zpool vanishing after upgrading ProxmoxVE 5.4 to 6.2" /&gt;&lt;p&gt;Performing a major version upgrade is never pleasant. I&amp;rsquo;ve been using ProxmoxVE for about ten years now though, and it&amp;rsquo;s consistently done a fantastic job. Since it&amp;rsquo;s based on Debian, all the upgrades are done with a simple &lt;code&gt;apt update &amp;amp;&amp;amp; apt upgrade&lt;/code&gt;, with a variety of steps in the middle to point to new repositories, etc. Nothing out of the ordinary, nothing scary.&lt;/p&gt;
&lt;p&gt;So I&amp;rsquo;ve got two servers - one is an old one, with only a couple testing VM&amp;rsquo;s residing on it. I go ahead and work through the &lt;a class="link" href="https://pve.proxmox.com/wiki/Upgrade_from_5.x_to_6.0" target="_blank" rel="noopener"
 &gt;5.x to 6.x upgrade guide&lt;/a&gt;, and everything Just Works. No problem with that one.&lt;/p&gt;
&lt;p&gt;When I moved onto the other server I had a couple different things I noticed. For example, when trying to upgrade Corosync 2.x to 3.x (a prerequisite for the OS upgrade), I noticed it was trying to uninstall things like &lt;code&gt;corosync-pve&lt;/code&gt;, which &lt;em&gt;really&lt;/em&gt; didn&amp;rsquo;t seem right.&lt;/p&gt;
&lt;p&gt;After comparing &lt;code&gt;dpkg -l&lt;/code&gt; contents between the two servers, I learned that &lt;code&gt;corosync-pve&lt;/code&gt; is actually just a transitional package - completely replaced by the new &lt;code&gt;corosync&lt;/code&gt; package in version 3. And although the server was trying to uninstall &lt;code&gt;corosync-pve&lt;/code&gt;, it was then immediately installing &lt;code&gt;corosync&lt;/code&gt;&amp;hellip; so no problem.&lt;/p&gt;
&lt;p&gt;Things continued to be mildly alarming during the upgrade itself, but not actually toooo bad, as all the removed packages were being replaced. This one, for example:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;dpkg: pve-libspice-server1: dependency problems, but removing anyway as you requested:
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; pve-qemu-kvm depends on pve-libspice-server1 (&amp;gt;= 0.12.5-1); however:
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; Package pve-libspice-server1 is to be removed.
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; spiceterm depends on libspice-server1 (&amp;gt;= 0.12.2); however:
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; Package libspice-server1 is not installed.
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; Package pve-libspice-server1 which provides libspice-server1 is to be removed.
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;(Reading database ... 65255 files and directories currently installed.)
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Removing pve-libspice-server1 (0.14.1-2) ...
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&amp;hellip; was replaced with &lt;code&gt;spiceterm&lt;/code&gt;. No worries.&lt;/p&gt;
&lt;p&gt;However things went &lt;em&gt;sharply downhill&lt;/em&gt; following reboot. All of my VM images were missing! I had a ZFS zpool that should have been at &lt;code&gt;/VM_Local_zpool&lt;/code&gt; - that folder &lt;em&gt;existed&lt;/em&gt;, and contained an &lt;code&gt;./images&lt;/code&gt; folder, but that was completely empty.&lt;/p&gt;
&lt;p&gt;I quickly checked the storage information in Proxmox, and the result was&amp;hellip; &lt;strong&gt;not good&lt;/strong&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img alt="My storage usage - consistently at about 1.2 terabytes, and then suddenly… zero." class="gallery-image" data-flex-basis="428px" data-flex-grow="178" height="298" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://www.ericlight.com/post/zfs_vanish/lost_zpool.png" width="532"&gt;&lt;/p&gt;
&lt;p&gt;&amp;hellip; Really, not good. :-|&lt;/p&gt;
&lt;p&gt;So I SSH&amp;rsquo;ed into the server and had a quick look at my list of ZFS stores, and discovered that my dataset was entirely absent:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;# zfs list
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;NAME USED AVAIL REFER MOUNTPOINT
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;rpool 83.8G 23.8G 96K /rpool
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;rpool/ROOT 3.65G 23.8G 96K /rpool/ROOT
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;rpool/ROOT/pve-1 3.65G 23.8G 3.65G /
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;rpool/data 71.6G 23.8G 71.6G /rpool/data
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;rpool/swap 8.50G 25.4G 6.85G -
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;# zpool list
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;NAME SIZE ALLOC FREE CKPOINT EXPANDSZ FRAG CAP DEDUP HEALTH ALTROOT
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;rpool 111G 82.1G 28.9G - - 66% 73% 1.00x ONLINE -
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;A bit of Googling led me to the &lt;code&gt;zfs import&lt;/code&gt; command, which resulted in the first piece of good news of the night:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;# zpool import
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; pool: VM_Local_zpool
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; id: 6614373363984244305
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; state: ONLINE
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; status: Some supported features are not enabled on the pool.
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; action: The pool can be imported using its name or numeric identifier, though
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;	some features will not be available without an explicit &amp;#39;zpool upgrade&amp;#39;.
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; config:
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;	VM_Local_zpool ONLINE
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;	 mirror-0 ONLINE
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;	 wwn-0x50014ee0aeee96ef ONLINE
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;	 wwn-0x50014ee05998ee25 ONLINE
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;It exists! And it&amp;rsquo;s &amp;hellip; online? But where? I don&amp;rsquo;t get it. I went ahead and tried importing it, but got a &amp;ldquo;directory not empty&amp;rdquo; error:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;# zpool import VM_Local_zpool 
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;cannot mount &amp;#39;/VM_Local_zpool&amp;#39;: directory is not empty
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Now, &lt;em&gt;&lt;strong&gt;if&lt;/strong&gt; I&amp;rsquo;d been paying attention&lt;/em&gt; there, I would have realised that &lt;code&gt;zpool list&lt;/code&gt; now contained my VM_Local_zpool:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;# zfs list
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;NAME USED AVAIL REFER MOUNTPOINT
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;VM_Local_zpool 1.16T 611G 1.16T /VM_Local_zpool
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;rpool 83.8G 23.8G 96K /rpool
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;rpool/ROOT 3.65G 23.8G 96K /rpool/ROOT
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;rpool/ROOT/pve-1 3.65G 23.8G 3.65G /
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;rpool/data 71.6G 23.8G 71.6G /rpool/data
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;rpool/swap 8.50G 25.4G 6.85G -
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;From this point, all I had to do was empty /VM_Local_zpool, and try to remount the zpool. But there&amp;rsquo;s a second trick here.&lt;/p&gt;
&lt;p&gt;ProxmoxVE has a pretty clear idea of How Storage Should Look, so every time it scans a storage device, is makes sure there&amp;rsquo;s an &lt;code&gt;./images&lt;/code&gt; folder in any storage enabled for VM Images. It also makes sure there&amp;rsquo;s a &lt;code&gt;./dump&lt;/code&gt; folder on any storage enabled as a backup target, and a &lt;code&gt;./template&lt;/code&gt; folder on any storage enabled for ISO images. (Reference: &lt;a class="link" href="https://pve.proxmox.com/wiki/Storage:_Directory" target="_blank" rel="noopener"
 &gt;https://pve.proxmox.com/wiki/Storage:_Directory&lt;/a&gt;)&lt;/p&gt;
&lt;p&gt;So, when I removed that /VM_Local_zpool/images folder, Proxmox just&amp;hellip; went ahead and recreated it almost immediately, so I still couldn&amp;rsquo;t mount the zpool there.&lt;/p&gt;
&lt;p&gt;In the end, I managed to get my zpool remounted by pairing the &lt;code&gt;rmdir&lt;/code&gt; and &lt;code&gt;mount&lt;/code&gt; commands together on the same line:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;# rmdir /VM_Local_zpool/images/
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;# zfs mount VM_Local_zpool
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;cannot mount &amp;#39;/VM_Local_zpool&amp;#39;: directory is not empty
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;# rmdir /VM_Local_zpool/images/ &amp;amp;&amp;amp; zfs mount VM_Local_zpool
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;# cd VM_Local_zpool/
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;/VM_Local_zpool# ls
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;backup	images
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&amp;hellip; and there we go! My mount point, and all my VM images, are back unscathed!&lt;/p&gt;
&lt;p&gt;And just for future reference - I saw a post on the FreeNAS forums that I should the status of the zfs-import-cache service, and enable it if it wasn&amp;rsquo;t started by default&amp;hellip; however it was fine:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;# systemctl status zfs-import-cache.service
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;● zfs-import-cache.service - Import ZFS pools by cache file
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; Loaded: loaded (/lib/systemd/system/zfs-import-cache.service; enabled; vendor preset: enabled)
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; Active: active (exited) since Sat 2020-05-23 20:46:54 NZST; 3min 26s ago
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; Docs: man:zpool(8)
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; Process: 1819 ExecStart=/sbin/zpool import -c /etc/zfs/zpool.cache -aN (code=exited, status=0/SUCCESS)
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; Main PID: 1819 (code=exited, status=0/SUCCESS)
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;May 23 20:46:54 ~ systemd[1]: Starting Import ZFS pools by cache file...
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;May 23 20:46:54 ~ zpool[1819]: no pools available to import
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;May 23 20:46:54 ~ systemd[1]: Started Import ZFS pools by cache file.
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;</description></item><item><title>Why are all Split-Tunnel VPN diagrams so ugly?</title><link>https://www.ericlight.com/post/split-tunnel-image.html</link><pubDate>Thu, 21 May 2020 00:00:00 +1200</pubDate><guid>https://www.ericlight.com/post/split-tunnel-image.html</guid><description>&lt;img src="https://www.ericlight.com/post/split-tunnel-image/split_tunnel_yes.jpg" alt="Featured image of post Why are all Split-Tunnel VPN diagrams so ugly?" /&gt;&lt;p&gt;Right.&lt;/p&gt;
&lt;p&gt;Today I needed to find a diagram of the traffic flow for a split-tunnel VPN. Nothing fancy, just a real simple user-facing diagram to form part of an article.&lt;/p&gt;
&lt;p&gt;And friends, there was &lt;em&gt;nothing&lt;/em&gt;. Nothing at all. I found proper technical ones from &lt;a class="link" href="https://documentation.meraki.com/@api/deki/files/721/c6ddeaa8-5df4-4e5e-b542-c52766568816?revision=1" target="_blank" rel="noopener"
 &gt;Cisco Meraki&lt;/a&gt;; fancy Office365 ones, depicting an &lt;a class="link" href="https://docs.microsoft.com/en-us/office365/enterprise/media/vpn-split-tunneling/vpn-model-2.png" target="_blank" rel="noopener"
 &gt;ExpressRoute to O365&lt;/a&gt; and tunnelling everything &lt;em&gt;else&lt;/em&gt; through the VPN; and another Office365 tunnel with &lt;a class="link" href="https://docs.microsoft.com/en-us/office365/enterprise/media/vpn-split-tunneling/vpn-model-5.png" target="_blank" rel="noopener"
 &gt;ExpressRoute and a split-tunnel&lt;/a&gt; for the rest of the traffic.&lt;/p&gt;
&lt;p&gt;Pretty much the closest I came to my needs was this atrocity, via &lt;a class="link" href="http://blog.soundtraining.net/2013/03/how-to-configure-split-tunneling-on.html" target="_blank" rel="noopener"
 &gt;http://blog.soundtraining.net/2013/03/how-to-configure-split-tunneling-on.html&lt;/a&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img alt="An accurate, but not aesthetic, diagram of how split tunnels work." class="gallery-image" data-flex-basis="158px" data-flex-grow="66" data-title-escaped="Although accurate and functional, this is not a pleasant sight." height="1600" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://www.ericlight.com/post/split-tunnel-image/split_tunnel_yes.jpg" srcset="https://www.ericlight.com/post/split-tunnel-image/split_tunnel_yes_hu_cb0dc953174bedbc.jpg 800w, https://www.ericlight.com/post/split-tunnel-image/split_tunnel_yes.jpg 1059w" title="Although accurate and functional, this is not a pleasant sight." width="1059"&gt;&lt;/p&gt;
&lt;p&gt;So I went over to &lt;a class="link" href="https://www.draw.io" target="_blank" rel="noopener"
 &gt;https://www.draw.io&lt;/a&gt; and whipped up something a bit prettier. This isn&amp;rsquo;t marvelous, but it&amp;rsquo;s way better than I could find anywhere else:&lt;/p&gt;
&lt;p&gt;&lt;img alt="A slightly more pleasant diagram of how split tunnels work." class="gallery-image" data-flex-basis="382px" data-flex-grow="159" height="301" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://www.ericlight.com/post/split-tunnel-image/split_tunnel_better.png" width="480"&gt;&lt;/p&gt;
&lt;p&gt;In retrospect, I could have done better - I really should have had the corporate tunnel going &lt;strong&gt;through&lt;/strong&gt; the cloud of the internet. However this works for ne.&lt;/p&gt;
&lt;p&gt;If you&amp;rsquo;d like to use this, feel free. You can even use &lt;a class="link" href="https://app.diagrams.net/?lightbox=1&amp;amp;highlight=0000ff&amp;amp;edit=_blank&amp;amp;layers=1&amp;amp;nav=1&amp;amp;title=VPN%20Split%20Tunnel%282%29.drawio#R7Vddb5swFP01PCbCfCV5XJKmU9VKrSp1W1%2BQAzdgxWBkTCD99TPFTiCwtZMSdZWqRMI%2B9%2Foa33Nscw17kVTXHGfxHQuBGpYZVoa9NCwLOZZl1H8z3DeIN7MbIOIkbCDzCDySF1AjNVqQEHKFNZBgjAqSdcGApSkEooNhzlnZddswGnaADEfQAx4DTPvoDxKKWKGe6xwN34FEsZ4aebPGkmDtrZaSxzhkZSusfWXYC86YaFpJtQBaZ6%2BbmNUfrIc345CK9wy4dZ9vls8%2F4e7p9uEO3QTldTQaKTZ2mBZqxeplxV6nIGMkFcCvdnKeOpvIsOeHtZiyE%2BI8hlB1YpFQ7SQ428KCUcYlkrJUBpxvCKUaMizbNeufxCleA71nORGEpdIWQD2pNOyACyIJuT1xWDMhWNJy%2BEZJVBsEyyTKCkFJKmfXuqgnwcrlEFyuI6uXmVRRrd8x22xIAOMQdvKRj0vGt7nAzYzzfsIVB%2FUbQHXKrNwTwBIQfC9dlNX2lBjUdrBnql8exaV3SNySlXbDSs7RIfKRcNlQnP8D%2F84F%2Bf%2BvKM2By6i5evobzJO%2BGlerqWOaPem2LWcQgTc9EcG0LwJkeX0VIHQpGUy%2BjoFBzQQFJ2I%2FpizY%2BiURsb%2BFva9hf%2F2arXNIwnVOz4VpTxL66GgrYuJcSBCzzy%2BIQeqHVfJeQQSUFWE%2Bzoo1JYH%2F2jsP%2F84MdfiXX079I2EyIABkowspQJ81n1kCF7xHRCFHU18uBDdszDnTXwrLEZqe6a5wJt2DwXH6d4U7G9DFpW4KhL5k8fGy8NDHyYK%2F4EfysCrTnefSp8p9iX%2FxkfW2KnTmNhSqb3VpJlMBaaiay4DiPCdBVxDSrssuNG36qkZ0x7b1t1wKzCMQb99wEHYKwH7G2xkdOIA1xoFKmnfdsnEozWqG%2B3qPtPa55XQJNb1uiJwVPAA1ql3lnQaadAPZ7kmgJjG9QK%2BsH5Y9JATZPRarjfux5revfgM%3D" target="_blank" rel="noopener"
 &gt;this fancy URL&lt;/a&gt; to open the drawing as an editable vector graphic at &lt;a class="link" href="https://www.draw.io" target="_blank" rel="noopener"
 &gt;Draw.io&lt;/a&gt; directly!&lt;/p&gt;</description></item><item><title>Roundcube not loading email contents</title><link>https://www.ericlight.com/post/roundcube_not_loading.html</link><pubDate>Mon, 11 May 2020 00:00:00 +1200</pubDate><guid>https://www.ericlight.com/post/roundcube_not_loading.html</guid><description>&lt;img src="https://www.ericlight.com/post/roundcube_not_loading/roundcube.png" alt="Featured image of post Roundcube not loading email contents" /&gt;&lt;p&gt;Here&amp;rsquo;s another quick one! I had a &lt;a class="link" href="https://roundcube.net" target="_blank" rel="noopener"
 &gt;Roundcube&lt;/a&gt; instance, chugging along fine.&lt;/p&gt;
&lt;p&gt;Then one day it just stopped loading emails! Everything else was all fine - no problems with login etc, but trying to preview an email just game me a sadfaec. Chrome couldn&amp;rsquo;t load the contents, and told me that the server had refused to connect:&lt;/p&gt;
&lt;p&gt;&lt;img alt="Roundcube webmail - everything looks perfect, except there’s a error loading the preview of the selected email." class="gallery-image" data-flex-basis="362px" data-flex-grow="150" height="848" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://www.ericlight.com/post/roundcube_not_loading/roundcube.png" srcset="https://www.ericlight.com/post/roundcube_not_loading/roundcube_hu_eeb548b72052d79.png 800w, https://www.ericlight.com/post/roundcube_not_loading/roundcube.png 1280w" width="1280"&gt;&lt;/p&gt;
&lt;p&gt;So of course, I can&amp;rsquo;t just let this go - being able to see the contents of the emails is relatively important! But what the heck was causing it?&lt;/p&gt;
&lt;p&gt;I spent some time in Chrome&amp;rsquo;s developer tools and console, as well as time grepping and tailing log files&amp;hellip; this would have all been fixed much earlier if I were running Firefox I think, as it&amp;rsquo;s a bit more explicit with errors.&lt;/p&gt;
&lt;p&gt;So, what was the fix? It was nothing to do with Roundcube, routing, firewalls, or reverse proxies. (Seriously, I checked all of these&amp;hellip;)&lt;/p&gt;
&lt;p&gt;The problem is that, last week, I&amp;rsquo;d modified the HTTP Headers on the reverse proxy to include:&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt; X-Frame-Options (&amp;#34;DENY&amp;#34;)
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;&amp;hellip; no good. It all came right when I changed the X-Frame-Options directive to &amp;ldquo;SAMEORIGIN&amp;rdquo;. Suddenly, all fixed.&lt;/p&gt;
&lt;p&gt;Sheesh!&lt;/p&gt;</description></item><item><title>Renaming a computer object in Active Directory</title><link>https://www.ericlight.com/post/renaming_computer_ad.html</link><pubDate>Sat, 09 May 2020 00:00:00 +1200</pubDate><guid>https://www.ericlight.com/post/renaming_computer_ad.html</guid><description>&lt;p&gt;Quick post tonight.&lt;/p&gt;
&lt;p&gt;You can&amp;rsquo;t rename a computer object in Active Directory Users and Computers. Even if you change the hostname, the domain object will still have the original distinguishedName from the old device.&lt;/p&gt;
&lt;p&gt;However&amp;hellip; you can do it in ADSIEdit! Just open &lt;code&gt;ADSIEdit&lt;/code&gt;, navigate to the AD container that holds your misnamed object, right click on it, and Rename.&lt;/p&gt;
&lt;p&gt;I&amp;rsquo;ve just done it with a couple test computers on a domain and both worked completely smoothly. I don&amp;rsquo;t know if this would be safe if the renamed computer were off-site.&lt;/p&gt;</description></item><item><title>WireGuard on Windows - Part 2</title><link>https://www.ericlight.com/post/wireguard_windows2.html</link><pubDate>Fri, 08 May 2020 00:00:00 +1200</pubDate><guid>https://www.ericlight.com/post/wireguard_windows2.html</guid><description>&lt;p&gt;A few days ago I spun up a &lt;a class="link" href="https://www.ericlight.com/post/windows_dev_vm.html" &gt;Windows Dev VM&lt;/a&gt; to have a play with &lt;a class="link" href="https://www.wireguard.com/install/" target="_blank" rel="noopener"
 &gt;WireGuard for Windows&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;I didn&amp;rsquo;t really have a clear goal in mind when I started playing with this - part of it was in trying to create and launch a tunnel without using the GUI. Mostly I was just trying to learn more about a new implementation of a tool that I really like.&lt;/p&gt;
&lt;p&gt;If you read my &lt;a class="link" href="https://www.ericlight.com/post/wireguard_windows.html" &gt;previous article&lt;/a&gt;, you&amp;rsquo;ll recall that I started off trying to do this with just &lt;code&gt;wireguard.exe&lt;/code&gt;. Here are some things I&amp;rsquo;ve discovered:&lt;/p&gt;
&lt;h3 id="wireguardexe-does-a-whole-lot-of-stuff"&gt;wireguard.exe does a &lt;em&gt;whole lot&lt;/em&gt; of stuff
&lt;/h3&gt;&lt;p&gt;Wireguard.exe isn&amp;rsquo;t just a GUI, which I originally thought it was. It&amp;rsquo;s also the piece of software that shouts out to &lt;a class="link" href="https://www.wintun.net/" target="_blank" rel="noopener"
 &gt;WinTun&lt;/a&gt; to create the interface, as well as the utility that reads the &amp;rsquo;extended&amp;rsquo; attributes in your .conf file (e.g. the stuff that wg-quick takes care of), as well as the utility that &lt;a class="link" href="https://github.com/WireGuard/wireguard-windows/blob/master/tunnel/addressconfig.go" target="_blank" rel="noopener"
 &gt;sets up your routes, DNS&lt;/a&gt;, etc, etc, etc.&lt;/p&gt;
&lt;h3 id="wireguardexe-doesnt-create-privatepublic-keypairs"&gt;wireguard.exe doesn&amp;rsquo;t create private/public keypairs
&lt;/h3&gt;&lt;p&gt;&amp;hellip; To do this, you instead need to use wg.exe, which is installed under your System32 folder (so it&amp;rsquo;s in your path, so it&amp;rsquo;s accessible anywhere):&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;PS C:\&amp;gt; wg genkey | tee $ENV:APPDATA\WireGuard.priv | wg pubkey &amp;gt; $ENV:APPDATA\WireGuard.pub
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;I did &lt;a class="link" href="https://www.ericlight.com/post/wireguard_windows.html" &gt;figure this out the other day&lt;/a&gt;, but I&amp;rsquo;m reiterating here.&lt;/p&gt;
&lt;h3 id="wgexe-can-read-conf-files--but-you-dont-really-want-it-to"&gt;wg.exe can read .conf files &amp;ndash; but you don&amp;rsquo;t really want it to
&lt;/h3&gt;&lt;p&gt;Last time, I was having trouble reading a .conf file from wg.exe:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;PS C:\Users&amp;gt; wg setconf wg0 .\wg0.conf
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Line unrecognized: ` ■[&amp;#39;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Configuration parsing error
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;I&amp;rsquo;m not entirely sure what this was - I&amp;rsquo;ve since been able to read in a .conf file perfectly fine (for the record this is UTF-8 with Windows CRLF line-endings).&lt;/p&gt;
&lt;p&gt;However &amp;hellip; my breakthrough kinda sucks.&lt;/p&gt;
&lt;p&gt;Wireguard for Windows stores it&amp;rsquo;s config files in the Windows DPAPI-encrypted vault. This is &lt;strong&gt;&lt;em&gt;vastly&lt;/em&gt;&lt;/strong&gt; better than just bunging a file in &lt;code&gt;C:\Users\Blah&lt;/code&gt; and hoping for the best. Maybe it&amp;rsquo;s not perfect - I don&amp;rsquo;t know much about DPAPI - but it&amp;rsquo;s a far cry better than nothing.&lt;/p&gt;
&lt;p&gt;When you use wireguard.exe to import a tunnel from a .conf file, it will read it in, sanity-check it (mine failed because I accidentally hit the keyboard during copy/pasta, so it rejected the Base64 encoding), and then safely store it away in the DPAPI storage. You can then delete your original .conf file. Just do this, it&amp;rsquo;s better.&lt;/p&gt;
&lt;h3 id="you-need-both-wireguardexe-and-wgexe"&gt;You need &lt;strong&gt;both&lt;/strong&gt; wireguard.exe and wg.exe
&lt;/h3&gt;&lt;p&gt;OK so here&amp;rsquo;s the bit that I only fully realised tonight: wireguard.exe is like wg-quick, but it also provides the interface into the &lt;a class="link" href="https://github.com/WireGuard/wireguard-windows/blob/master/tunnel/service.go" target="_blank" rel="noopener"
 &gt;Windows network stack&lt;/a&gt; and the &lt;a class="link" href="https://github.com/WireGuard/wireguard-windows/blob/master/conf/store.go" target="_blank" rel="noopener"
 &gt;Windows DPAPI storage&lt;/a&gt; of your sensitive conf files. You can&amp;rsquo;t even run &lt;code&gt;wg set&lt;/code&gt; without it, because wireguard.exe &lt;a class="link" href="https://github.com/WireGuard/wireguard-windows/blob/master/manager/ipc_server.go" target="_blank" rel="noopener"
 &gt;is even responsible for creating the IPC Server&lt;/a&gt; that interfaces with WinTun.&lt;/p&gt;
&lt;p&gt;Honestly the Windows world is so much more complicated than the Linux world*. 🙄&lt;/p&gt;
&lt;p&gt;(* some caveats apply)&lt;/p&gt;
&lt;h2 id="conclusion"&gt;Conclusion
&lt;/h2&gt;&lt;p&gt;What&amp;rsquo;s my plan now?&lt;/p&gt;
&lt;p&gt;I&amp;rsquo;m going to make a thing that:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Installs wireguard.msi silently&lt;/li&gt;
&lt;li&gt;Uses wg.exe to create a private/public keypair&lt;/li&gt;
&lt;li&gt;Uses that keypair to create a temporary .conf file&lt;/li&gt;
&lt;li&gt;Uses wireguard.exe to import that .conf file from some predetermined location&lt;/li&gt;
&lt;li&gt;Deletes the .conf file (probably using &lt;a class="link" href="https://support.microsoft.com/en-nz/help/814599/how-to-use-cipher-exe-to-overwrite-deleted-data-in-windows-server-2003" target="_blank" rel="noopener"
 &gt;cipher.exe&lt;/a&gt; to scrub it)&lt;/li&gt;
&lt;li&gt;Uses wireguard.exe to install the tunnel so it opens automatically on login&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;I&amp;rsquo;m hoping that this will create us something like an always-on-VPN connection that can be deployed easily by an IT support person, and require no end-user interaction.&lt;/p&gt;</description></item><item><title>Getting WireGuard on Windows - quietly</title><link>https://www.ericlight.com/post/wireguard_windows.html</link><pubDate>Mon, 27 Apr 2020 00:00:00 +1200</pubDate><guid>https://www.ericlight.com/post/wireguard_windows.html</guid><description>&lt;img src="https://www.ericlight.com/post/wireguard_windows/WireGuard_launch.png" alt="Featured image of post Getting WireGuard on Windows - quietly" /&gt;&lt;p&gt;So, I mentioned in my post &lt;a class="link" href="https://www.ericlight.com/post/windows_dev_vm.html" &gt;yesterday&lt;/a&gt; that I&amp;rsquo;m trying to get a bit of a quiet installer for WireGuard on Windows. Not that the current one is &lt;em&gt;noisy&lt;/em&gt;, but I have a really simple use-case that I want to meet.&lt;/p&gt;
&lt;p&gt;I spent some time seeing if I could just extract &lt;code&gt;WireGuard.exe&lt;/code&gt; and run that. Nope, of course - it requires &lt;a class="link" href="https://www.wintun.net/" target="_blank" rel="noopener"
 &gt;WinTun&lt;/a&gt; to be installed to facilitate the Layer 3 tunneling.&lt;/p&gt;
&lt;p&gt;Next I played with the idea of just deploying WinTun directly, without installing the WireGuard package itself. I can only assume that this would have been &lt;em&gt;super easy&lt;/em&gt; if I&amp;rsquo;d ever built a proper MSI installer before, but in the end it was just way easier to:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;WireGuard-amd64-0.1.0.msi /q
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&amp;hellip; It was still worth the tangential digging, but who would have ever guessed that &lt;a class="link" href="https://www.zx2c4.com/" target="_blank" rel="noopener"
 &gt;Jason Donenfeld&lt;/a&gt; would have already done things the best way. ¯\_(ツ)_/¯ &amp;lt;/s&amp;gt;&lt;/p&gt;
&lt;p&gt;Note you&amp;rsquo;ve got to run the above in an elevated command prompt, since it&amp;rsquo;s installing drivers. However, the installation is still not quiet - after install, it pops up the WireGuard GUI window!&lt;/p&gt;
&lt;p&gt;&lt;img alt="After running the installer with the ‘Quiet’ parameter, the WireGuard GUI still opens" class="gallery-image" data-flex-basis="320px" data-flex-grow="133" height="830" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://www.ericlight.com/post/wireguard_windows/WireGuard_launch.png" srcset="https://www.ericlight.com/post/wireguard_windows/WireGuard_launch_hu_359e0a7ca5787395.png 800w, https://www.ericlight.com/post/wireguard_windows/WireGuard_launch.png 1109w" width="1109"&gt;&lt;/p&gt;
&lt;p&gt;&amp;ldquo;That&amp;rsquo;s annoying,&amp;rdquo; I think to myself, &amp;ldquo;can I stop that?&amp;rdquo; To the &lt;a class="link" href="https://github.com/WireGuard/WireGuard-windows/blob/master/installer/WireGuard.wxs" target="_blank" rel="noopener"
 &gt;installer source code&lt;/a&gt;!&lt;/p&gt;
&lt;p&gt;OwO &amp;hellip; Hwat&amp;rsquo;s this?&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-xml" data-lang="xml"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#75715e"&gt;&amp;lt;!--
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#75715e"&gt; Launch WireGuard.exe after setup complete
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#75715e"&gt; --&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;&amp;lt;CustomAction&lt;/span&gt; &lt;span style="color:#a6e22e"&gt;Id=&lt;/span&gt;&lt;span style="color:#e6db74"&gt;&amp;#34;LaunchApplication&amp;#34;&lt;/span&gt; &lt;span style="color:#a6e22e"&gt;HideTarget=&lt;/span&gt;&lt;span style="color:#e6db74"&gt;&amp;#34;yes&amp;#34;&lt;/span&gt; &lt;span style="color:#a6e22e"&gt;Impersonate=&lt;/span&gt;&lt;span style="color:#e6db74"&gt;&amp;#34;no&amp;#34;&lt;/span&gt; &lt;span style="color:#a6e22e"&gt;Execute=&lt;/span&gt;&lt;span style="color:#e6db74"&gt;&amp;#34;deferred&amp;#34;&lt;/span&gt; &lt;span style="color:#a6e22e"&gt;FileKey=&lt;/span&gt;&lt;span style="color:#e6db74"&gt;&amp;#34;WireGuard.exe&amp;#34;&lt;/span&gt; &lt;span style="color:#a6e22e"&gt;ExeCommand=&lt;/span&gt;&lt;span style="color:#e6db74"&gt;&amp;#34;&amp;#34;&lt;/span&gt; &lt;span style="color:#a6e22e"&gt;Return=&lt;/span&gt;&lt;span style="color:#e6db74"&gt;&amp;#34;asyncNoWait&amp;#34;&lt;/span&gt; &lt;span style="color:#f92672"&gt;/&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;&amp;lt;InstallExecuteSequence&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;&amp;lt;Custom&lt;/span&gt; &lt;span style="color:#a6e22e"&gt;Action=&lt;/span&gt;&lt;span style="color:#e6db74"&gt;&amp;#34;LaunchApplication&amp;#34;&lt;/span&gt; &lt;span style="color:#a6e22e"&gt;Before=&lt;/span&gt;&lt;span style="color:#e6db74"&gt;&amp;#34;InstallFinalize&amp;#34;&lt;/span&gt;&lt;span style="color:#f92672"&gt;&amp;gt;&lt;/span&gt;(&amp;amp;amp;WireGuardFeature = 3) AND NOT DO_NOT_LAUNCH&lt;span style="color:#f92672"&gt;&amp;lt;/Custom&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;&amp;lt;/InstallExecuteSequence&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;It appears that we can pass through an environment variable to stop the installer from launching the GUI after install!&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-ps1" data-lang="ps1"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; .\WireGuard-amd64-&lt;span style="color:#ae81ff"&gt;0.1&lt;/span&gt;.0.msi /q DO_NOT_LAUNCH=True
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Aaaand success&amp;hellip; now I&amp;rsquo;ve got WireGuard and WinTun installed, no user interaction, so far completely silent. Next I gotta create a keypair. There aren&amp;rsquo;t any relevant command-line arguments that I can pass to wireguard.exe, so I went on a hunt for a keypair generator.&lt;/p&gt;
&lt;p&gt;&lt;img alt="A list of the few parameters for wireguard.exe - /installmanagerservice, /installtunnelservice, and similar uninstallers. No keygen etc." class="gallery-image" data-flex-basis="488px" data-flex-grow="203" height="304" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://www.ericlight.com/post/wireguard_windows/wireguard_exe_options.png" width="619"&gt;&lt;/p&gt;
&lt;p&gt;I spent an hour or so scratching around various options to find a keypair generator that looked trustworthy. I honestly couldn&amp;rsquo;t find one&amp;hellip; even the one posted on the &lt;a class="link" href="https://github.com/WireGuard/WireGuard-tools/tree/master/contrib/keygen-html" target="_blank" rel="noopener"
 &gt;WireGuard GitHub&lt;/a&gt; includes a caveat from Jason.&lt;/p&gt;
&lt;p&gt;Until I decided to have a closer look at the installer source code&amp;hellip; the very same code I was looking at when I discovered the DO_NOT_LAUNCH property above.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-xml" data-lang="xml"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#f92672"&gt;&amp;lt;Component&lt;/span&gt; &lt;span style="color:#a6e22e"&gt;Directory=&lt;/span&gt;&lt;span style="color:#e6db74"&gt;&amp;#34;System64Folder&amp;#34;&lt;/span&gt; &lt;span style="color:#a6e22e"&gt;Win64=&lt;/span&gt;&lt;span style="color:#e6db74"&gt;&amp;#34;yes&amp;#34;&lt;/span&gt; &lt;span style="color:#a6e22e"&gt;Id=&lt;/span&gt;&lt;span style="color:#e6db74"&gt;&amp;#34;Wg64Executable&amp;#34;&lt;/span&gt; &lt;span style="color:#a6e22e"&gt;Guid=&lt;/span&gt;&lt;span style="color:#e6db74"&gt;&amp;#34;d9b494ec-0959-442c-89ad-6aa175acfd03&amp;#34;&lt;/span&gt;&lt;span style="color:#f92672"&gt;&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;&amp;lt;File&lt;/span&gt; &lt;span style="color:#a6e22e"&gt;Source=&lt;/span&gt;&lt;span style="color:#e6db74"&gt;&amp;#34;..\$(var.WIREGUARD_PLATFORM)\wg.exe&amp;#34;&lt;/span&gt; &lt;span style="color:#a6e22e"&gt;Id=&lt;/span&gt;&lt;span style="color:#e6db74"&gt;&amp;#34;Wg64Executable&amp;#34;&lt;/span&gt; &lt;span style="color:#f92672"&gt;/&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#f92672"&gt;&amp;lt;/Component&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;So &lt;code&gt;C:\Program Files\WireGuard\WireGuard.exe&lt;/code&gt; appears to be just a shell that calls out to &lt;code&gt;C:\Windows\System32\wg.exe&lt;/code&gt;. Oh my god that knowledge would have saved me &lt;strong&gt;hours&lt;/strong&gt;!!&lt;/p&gt;
&lt;p&gt;So&amp;hellip; here&amp;rsquo;s how to generate a WireGuard keypair, in Windows, without the GUI. Since system32 is in the path, you can run this from anywhere. The below will create WireGuard.priv and WireGuard.pub in your AppData folder:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;PS C:\&amp;gt; wg genkey | tee $ENV:APPDATA\WireGuard.priv | wg pubkey &amp;gt; $ENV:APPDATA\WireGuard.pub
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;PS C:\&amp;gt; cat $ENV:APPDATA\WireGuard.*
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;uIGDK+LMDZANniFxrofIpu/hUyezuwCM7qSDVVO+1Gw=
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;85MxGcWutHJsjFggiZ+J4/vsNYDVEa8zYk53DQZCwyE=
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;strong&gt;&lt;em&gt;AWESOME.&lt;/em&gt;&lt;/strong&gt; Next step is to zoink that into a handy-dandy config file. (More accurately, next step is to delete that private key that I&amp;rsquo;ve now posted to the internets)&lt;/p&gt;
&lt;p&gt;Right, so it &lt;em&gt;looks&lt;/em&gt; like I can&amp;rsquo;t just create a text-based wg0.conf file like I do in Linux. When I do, I get this error:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;PS C:\Users&amp;gt; wg setconf wg0 .\wg0.conf
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Line unrecognized: ` ■[&amp;#39;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Configuration parsing error
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;I thought this might be the file encoding, so I tried it in ANSI etc, but then I learned that Wireguard for Windows stores it&amp;rsquo;s config files in &lt;code&gt;C:\Windows\System32\config\systemprofile\AppData\Local\WireGuard\Configurations\&lt;/code&gt; &amp;hellip; and they&amp;rsquo;re not in plain text. They&amp;rsquo;re stored with the Windows Data Protection API (DPAPI), so perhaps that&amp;rsquo;s what wireguard.exe is expecting?&lt;/p&gt;
&lt;p&gt;Either way, I&amp;rsquo;ve been playing with this for quite a long time now, so I&amp;rsquo;m off to take a break for the night or so. Once I figure out how to create a WireGuard config file for an interface I&amp;rsquo;ll post a new article. Hope you enjoyed reading so far!&lt;/p&gt;</description></item><item><title>A pork rub for when you've run out of garlic</title><link>https://www.ericlight.com/post/pork_rub.html</link><pubDate>Sun, 26 Apr 2020 00:00:00 +1200</pubDate><guid>https://www.ericlight.com/post/pork_rub.html</guid><description>&lt;p&gt;I picked up a set of whole pork loins at Pak &amp;rsquo;n Save the other day for like twelve bucks, and being on dinner duty tonight I thought it was time to fire up the smoker. But just last night we&amp;rsquo;d had a Chicken Tikka Masala which cleaned out our garlic stocks &amp;hellip; what to do?&lt;/p&gt;
&lt;p&gt;After a bit of dithering, I made a simple low-garlic rub and it turned out good enough that I&amp;rsquo;m documenting it here!&lt;/p&gt;
&lt;h1 id="outta-garlic-pork-rub"&gt;Outta Garlic Pork Rub
&lt;/h1&gt;&lt;ul&gt;
&lt;li&gt;1 tbsp salt&lt;/li&gt;
&lt;li&gt;2 tbsp brown sugar&lt;/li&gt;
&lt;li&gt;1 tbsp Cajun seasoning mix (this had garlic in it)&lt;/li&gt;
&lt;li&gt;1 tbsp ground cumin&lt;/li&gt;
&lt;li&gt;1 tbsp ground coriander&lt;/li&gt;
&lt;li&gt;1 tbsp smoked paprika&lt;/li&gt;
&lt;li&gt;1/2 tbsp ground ginger&lt;/li&gt;
&lt;li&gt;1/2 tbsp chilli flakes&lt;/li&gt;
&lt;li&gt;1/2 tbsp turmeric&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;I covered a plate in the rub, then on a different board I sprinkled rub all over the tops of the pork, placed them rub-side-down on the plate-o-rub, and covered the remaining surfaces. I still have probably 2 tbsp of rub left, so I must have used 7 tbsp in total.&lt;/p&gt;
&lt;p&gt;Into the fridge for about two hours, and then onto the smoker! I did it over pecan wood until it reached about 60°C, and then boated it in a 50/50 mix of apple juice and ginger beer until it hit an internal temp of 71°C. Then I let it sit for about 30 minutes before we sat down to dinner!&lt;/p&gt;
&lt;p&gt;Reflections:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;I was in a rush this time - no low &amp;amp; slow here. I really want to try it again over much lower heat.&lt;/li&gt;
&lt;li&gt;I think it was a bit overcooked&amp;hellip; 71°C is a bit hot for pork. Next time I&amp;rsquo;ll pull it off at 65°C and let it sit for a bit longer.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Overall, it still got a great score from the rest of the fam (in fact, they&amp;rsquo;re the reason I&amp;rsquo;ve recorded this recipe here)!&lt;/p&gt;</description></item><item><title>Setting up a Windows Dev VM under ProxmoxVE</title><link>https://www.ericlight.com/post/windows_dev_vm.html</link><pubDate>Sun, 26 Apr 2020 00:00:00 +1200</pubDate><guid>https://www.ericlight.com/post/windows_dev_vm.html</guid><description>&lt;p&gt;Righto, I&amp;rsquo;ve been using WireGuard for quite a long time now, but I just had my first foray into WireGuard on Windows. I&amp;rsquo;m trying to roll it into a low-touch VPN deployment sort of thing.&lt;/p&gt;
&lt;p&gt;There will be a post about that soon, but this particular post is about &lt;em&gt;setting up the environment&lt;/em&gt; for me to play with this stuff&amp;hellip; I need a system where I can take snapshots and roll back the drive to a known state. (So I can be sure I&amp;rsquo;m not missing anything that the installer would do).&lt;/p&gt;
&lt;p&gt;I don&amp;rsquo;t have a Windows machine, so I started off by downloading a &lt;a class="link" href="https://developer.microsoft.com/en-us/windows/downloads/virtual-machines/" target="_blank" rel="noopener"
 &gt;Win10 Dev VM from Microsoft&lt;/a&gt;. Since I&amp;rsquo;m running ProxmoxVE, I chose the VMware image, which will come down as a .zip file.&lt;/p&gt;
&lt;p&gt;Download the zip file, and extract it to wherever your VM disk images live (mine is &lt;code&gt;/VM_Local_zpool/&lt;/code&gt;)&amp;hellip; this will save some time when you&amp;rsquo;re importing the disk.&lt;/p&gt;
&lt;p&gt;Next, you simply use the &lt;a class="link" href="https://pve.proxmox.com/pve-docs/qm.1.html" target="_blank" rel="noopener"
 &gt;importovf&lt;/a&gt; function of &lt;code&gt;qm&lt;/code&gt; to import the OVF manifest as a new KVM-based VM in Proxmox!&lt;/p&gt;
&lt;p&gt;&lt;code&gt;~ # qm importovf 103 WinDev2004Eval.ovf VM_Images --format qcow2&lt;/code&gt;
&lt;code&gt;Formatting '/VM_Local_zpool/images/103/vm-103-disk-0.qcow2', fmt=qcow2 size=136365211648 cluster_size=65536 preallocation=metadata lazy_refcounts=off refcount_bits=16&lt;/code&gt;
&lt;code&gt; (100.00/100%)&lt;/code&gt;&lt;br&gt;
&lt;code&gt;~ #&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;That was suspiciously easy&amp;hellip;&lt;/p&gt;
&lt;p&gt;After importing I couldn&amp;rsquo;t launch the VM, but I&amp;rsquo;ve seen this error a dozen times and know who to handle it:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;kvm: -drive file=/VM_Local_zpool/images/103/vm-103-disk-0.qcow2,if=none,id=drive-sata0,format=qcow2,cache=none,aio=native,detect-zeroes=on: file system may not support O_DIRECT&lt;/code&gt;
&lt;code&gt;kvm: -drive file=/VM_Local_zpool/images/103/vm-103-disk-0.qcow2,if=none,id=drive-sata0,format=qcow2,cache=none,aio=native,detect-zeroes=on: Could not open '/VM_Local_zpool/images/103/vm-103-disk-0.qcow2': Invalid argument&lt;/code&gt;
&lt;code&gt;TASK ERROR: start failed: command '/usr/bin/kvm &amp;lt;-- snip --&amp;gt; -machine 'type=pc'' failed: exit code 1&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;If you&amp;rsquo;re here because you googled the above error, your problem is rooted in this particular bit: &lt;code&gt;file system may not support O_DIRECT&lt;/code&gt;. Your problem is that Cache setting on your Hard Disk entry (under VM -&amp;gt; Hardware) is set to &amp;ldquo;Default (No cache)&amp;rdquo;. Set it to Write Back or Write Through and it&amp;rsquo;ll launch fine.&lt;/p&gt;
&lt;p&gt;Okay, so the VM starts with no network card - I went ahead and just added the VMware vmxnet one that Proxmox offers, since that&amp;rsquo;ll already have drivers set up on this VMware image. After that it was a few seconds to join the domain, pop the Computer object into the correct OU, run a gpupdate, and fire up my RDP connection using &lt;a class="link" href="https://www.remmina.org" target="_blank" rel="noopener"
 &gt;Remmina&lt;/a&gt;&amp;hellip; and just like that, I&amp;rsquo;ve got a Windows machine set up to start playing!&lt;/p&gt;
&lt;p&gt;Now that I&amp;rsquo;ve shaved that particular set of yaks, I&amp;rsquo;m ready to start trying to do what I wanted to do earlier this morning. Let&amp;rsquo;s see how tomorrow goes&amp;hellip;&lt;/p&gt;</description></item><item><title>Using Fail2Ban to insta-block malicious hits</title><link>https://www.ericlight.com/post/caddy_fail2ban.html</link><pubDate>Tue, 07 Apr 2020 00:00:00 +1200</pubDate><guid>https://www.ericlight.com/post/caddy_fail2ban.html</guid><description>&lt;p&gt;Okay so a few days ago I &lt;a class="link" href="https://www.ericlight.com/post/caddy.html" &gt;posted&lt;/a&gt; about adopting &lt;a class="link" href="https://www.caddyserver.com" target="_blank" rel="noopener"
 &gt;Caddy&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Of course, anyone who hosts anything knows that accessible services on the internet will start getting hit by scanners within literal moments of being accessible. On the very first night of having my site live on the new VPS, Logwatch informed me of a bunch of attempts to access wp-admin.php. Sigh.&lt;/p&gt;
&lt;p&gt;Well, this entire site is built with my favourite static site generator &lt;a class="link" href="https://www.getpelican.com" target="_blank" rel="noopener"
 &gt;Pelican&lt;/a&gt;. That means I don&amp;rsquo;t have any PHP on my site whatsoever. Why not just&amp;hellip; block anyone that tries to open a PHP page at ericlight.com? &lt;a class="link" href="https://www.fail2ban.org" target="_blank" rel="noopener"
 &gt;Fail2Ban&lt;/a&gt; to the rescue.&lt;/p&gt;
&lt;p&gt;Two things we need: A Fail2Ban filter, and a Fail2Ban jail.&lt;/p&gt;
&lt;h2 id="the-filter"&gt;The Filter
&lt;/h2&gt;&lt;p&gt;&lt;code&gt;nano /etc/fail2ban/filter.d/caddy-php.conf&lt;/code&gt; &lt;em&gt;(note, the name of this file must be the same as the identifier in your &lt;code&gt;jail.local&lt;/code&gt; file)&lt;/em&gt;&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-ini" data-lang="ini"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#66d9ef"&gt;[Definition]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#a6e22e"&gt;failregex&lt;/span&gt; &lt;span style="color:#f92672"&gt;=&lt;/span&gt; &lt;span style="color:#e6db74"&gt;^&amp;lt;HOST&amp;gt;.*\.php(\s|\?.*)HTTP.*$&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#a6e22e"&gt;ignoreregex&lt;/span&gt; &lt;span style="color:#f92672"&gt;=&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&amp;hellip; that will catch anything in your logs such as:&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;nn.nn.nn.nn - - [07/Apr/2020:23:20:39 +1200] &amp;#34;GET /wp-admin.php HTTP/2.0&amp;#34; 404 0
nn.nn.nn.nn - - [06/Apr/2020:10:12:24 +1200] &amp;#34;GET /index.php?s=index/%5Cthink%5Capp/invokefunction&amp;amp;function=call_user_func_array&amp;amp;vars%5B0%5D=phpinfo&amp;amp;vars%5B1%5D%5B%5D=1 HTTP/1.1&amp;#34; 404 0
nn.nn.nn.nn - - [06/Apr/2020:12:51:31 +1200] &amp;#34;GET /wp-login.php HTTP/1.1&amp;#34; 404 0
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id="the-jail"&gt;The Jail
&lt;/h2&gt;&lt;p&gt;&lt;code&gt;nano /etc/fail2ban/jail.local&lt;/code&gt;&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-ini" data-lang="ini"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#66d9ef"&gt;[caddy-php]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#a6e22e"&gt;port&lt;/span&gt; &lt;span style="color:#f92672"&gt;=&lt;/span&gt; &lt;span style="color:#e6db74"&gt;http,https&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#a6e22e"&gt;logpath&lt;/span&gt; &lt;span style="color:#f92672"&gt;=&lt;/span&gt; &lt;span style="color:#e6db74"&gt;/var/log/caddy/access.log&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#a6e22e"&gt;enabled&lt;/span&gt; &lt;span style="color:#f92672"&gt;=&lt;/span&gt; &lt;span style="color:#e6db74"&gt;true&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#a6e22e"&gt;maxretry&lt;/span&gt; &lt;span style="color:#f92672"&gt;=&lt;/span&gt; &lt;span style="color:#e6db74"&gt;1&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Note I used &lt;code&gt;maxretry = 1&lt;/code&gt; there. This means if an IP triggers that filter &lt;em&gt;a single time&lt;/em&gt;, they&amp;rsquo;ll be blocked &lt;strong&gt;immediately&lt;/strong&gt;&amp;hellip; So you probably don&amp;rsquo;t want to do this just willy-nilly.&lt;/p&gt;
&lt;h2 id="the-result"&gt;The Result
&lt;/h2&gt;&lt;p&gt;With those two parts done (and the obligatory &lt;code&gt;service fail2ban reload&lt;/code&gt;, of course), you should find that your web server immediately bans any host that tries to load a .php file from your website!&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code class="language-log" data-lang="log"&gt;# tail -f /var/log/caddy/access.log /var/log/fail2ban.log
==&amp;gt; /var/log/caddy/access.log &amp;lt;==
1xx.1xx.1xx.11 - - [07/Apr/2020:23:25:55 +1200] &amp;#34;GET /arse.php HTTP/1.1&amp;#34; 404 0
1xx.1xx.1xx.6 - - [07/Apr/2020:23:25:57 +1200] &amp;#34;GET /arse.php?1234 HTTP/1.1&amp;#34; 404 0
1xx.2xx.6x.1xx - - [07/Apr/2020:23:26:03 +1200] &amp;#34;GET /blargh.php HTTP/2.0&amp;#34; 404 0

==&amp;gt; /var/log/fail2ban.log &amp;lt;==
2020-04-07 23:25:55,482 fail2ban.filter [452]: INFO [caddy-php] Found 1xx.1xx.1xx.11 - 2020-04-07 23:25:55
2020-04-07 23:25:55,551 fail2ban.actions [452]: NOTICE [caddy-php] Ban 1xx.1xx.1xx.11
2020-04-07 23:25:58,309 fail2ban.filter [452]: INFO [caddy-php] Found 1xx.1xx.1xx.6 - 2020-04-07 23:25:57
2020-04-07 23:25:58,782 fail2ban.actions [452]: NOTICE [caddy-php] Ban 1xx.1xx.1xx.6
2020-04-07 23:26:03,627 fail2ban.filter [452]: INFO [caddy-php] Found 1xx.2xx.6x.1xx - 2020-04-07 23:26:03
2020-04-07 23:26:04,010 fail2ban.actions [452]: NOTICE [caddy-php] Ban 1xx.2xx.6x.1xx
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Great success! You can use the &lt;code&gt;banTime&lt;/code&gt; directive to adjust how long these blocks should last for - I&amp;rsquo;ve got mine set up to block for an hour.&lt;/p&gt;
&lt;h2 id="edit-2020-04-10"&gt;Edit 2020-04-10:
&lt;/h2&gt;&lt;p&gt;Eh I realised that my RegEx missed these lovely things:&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code class="language-log" data-lang="log"&gt;[ip redacted] - - [08/Apr/2020:16:14:10 +1200] &amp;#34;GET /wp-config.php.new HTTP/1.1&amp;#34; 404 0
[ip redacted] - - [08/Apr/2020:16:14:14 +1200] &amp;#34;GET /wp-config.php.old HTTP/1.1&amp;#34; 404 0
[ip redacted] - - [08/Apr/2020:16:14:17 +1200] &amp;#34;GET /wp-config.php.bak HTTP/1.1&amp;#34; 404 0
[ip redacted] - - [08/Apr/2020:16:14:19 +1200] &amp;#34;GET /wp-config.php.backup HTTP/1.1&amp;#34; 404 0
[ip redacted] - - [08/Apr/2020:16:14:22 +1200] &amp;#34;GET /wp-config.php.save HTTP/1.1&amp;#34; 404 0
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;&amp;hellip; so yeah I just changed it to drop anything with &lt;code&gt;.php&lt;/code&gt; in the URL. I&amp;rsquo;ll try to remember not to post any articles with .php in the URL lol.&lt;/p&gt;
&lt;h2 id="credits"&gt;Credits
&lt;/h2&gt;&lt;p&gt;Thanks to Phage and Xyphoid for the help in fine-tuning my rusty RegEx!&lt;/p&gt;</description></item><item><title>Moving to the Caddy web server</title><link>https://www.ericlight.com/post/caddy.html</link><pubDate>Sun, 05 Apr 2020 00:00:00 +1300</pubDate><guid>https://www.ericlight.com/post/caddy.html</guid><description>&lt;p&gt;For the last couple of years I&amp;rsquo;ve been running this site, as well as my friend&amp;rsquo;s site (&lt;a class="link" href="https://www.undertheumbrella.co.nz" target="_blank" rel="noopener"
 &gt;Under The Umbrella&lt;/a&gt;) on &lt;a class="link" href="https://www.nginx.org" target="_blank" rel="noopener"
 &gt;Nginx&lt;/a&gt;. Recently my VPS host decided to do away with their cheapest tier, so instead of doubling my annual cost, I hopped onto &lt;a class="link" href="https://www.lowendbox.com" target="_blank" rel="noopener"
 &gt;https://www.lowendbox.com&lt;/a&gt; and found myself a replacement Cheaps McGee VPS to host this.&lt;/p&gt;
&lt;p&gt;Well, a major change like that is a great time to learn about something new, so I took the opportunity to get started with &lt;a class="link" href="https://www.caddyserver.com" target="_blank" rel="noopener"
 &gt;Caddy&lt;/a&gt;. If you don&amp;rsquo;t already know about Caddy, it&amp;rsquo;s a fast, simple, &lt;em&gt;clean&lt;/em&gt; web server. It&amp;rsquo;s written in Go, so it&amp;rsquo;s both fast and memory safe. And hey, it&amp;rsquo;s super simple.&lt;/p&gt;
&lt;p&gt;I&amp;rsquo;m not going to go into a whole lot of detail about setting up Caddy - there are enough tutorials out there already, and really I got all the info I needed from the website. But here are some particularly notable bits:&lt;/p&gt;
&lt;h1 id="the-caddyfile"&gt;The Caddyfile
&lt;/h1&gt;&lt;p&gt;This lives in &lt;code&gt;/etc/caddy/Caddyfile&lt;/code&gt;:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-ini" data-lang="ini"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#a6e22e"&gt;ericlight.com, www.ericlight.com {&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#a6e22e"&gt;file_server&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#a6e22e"&gt;root * /var/www/ericlight.com&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#a6e22e"&gt;import /etc/caddy/caddy_security.conf&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#a6e22e"&gt;log {&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#a6e22e"&gt;output file /var/log/caddy/access.log&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#a6e22e"&gt;format single_field common_log&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#a6e22e"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#a6e22e"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#a6e22e"&gt;undertheumbrella.co.nz, www.undertheumbrella.co.nz {&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#a6e22e"&gt;file_server&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#a6e22e"&gt;root * /var/www/undertheumbrella.co.nz&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#a6e22e"&gt;import /etc/caddy/caddy_security.conf&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#a6e22e"&gt;log {&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#a6e22e"&gt;output file /var/log/caddy/utu_access.log&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#a6e22e"&gt;format single_field common_log&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#a6e22e"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#a6e22e"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;And, &lt;code&gt;/etc/caddy/caddy_security.conf&lt;/code&gt; contains:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-ini" data-lang="ini"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#a6e22e"&gt;header {&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#a6e22e"&gt;Strict-Transport-Security &amp;#34;max-age&lt;/span&gt;&lt;span style="color:#f92672"&gt;=&lt;/span&gt;&lt;span style="color:#e6db74"&gt;31536000; includeSubDomains; preload&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#e6db74"&gt; X-Xss-Protection &amp;#34;1; mode=block&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#e6db74"&gt; X-Content-Type-Options &amp;#34;nosniff&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#e6db74"&gt; X-Frame-Options &amp;#34;DENY&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#e6db74"&gt; Content-Security-Policy &amp;#34;upgrade-insecure-requests&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#e6db74"&gt; Referrer-Policy &amp;#34;strict-origin-when-cross-origin&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#e6db74"&gt; Cache-Control &amp;#34;public, max-age=15, must-revalidate&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#e6db74"&gt; Feature-Policy &amp;#34;accelerometer &amp;#39;none&amp;#39;; ambient-light-sensor &amp;#39;none&amp;#39;; autoplay &amp;#39;self&amp;#39;; camera &amp;#39;none&amp;#39;; encrypted-media &amp;#39;none&amp;#39;; fullscreen &amp;#39;self&amp;#39;; geolocation &amp;#39;none&amp;#39;; gyroscope &amp;#39;none&amp;#39;; magnetometer &amp;#39;none&amp;#39;; microphone &amp;#39;none&amp;#39;; midi &amp;#39;none&amp;#39;; payment &amp;#39;none&amp;#39;; picture-in-picture *; speaker &amp;#39;none&amp;#39;; sync-xhr &amp;#39;none&amp;#39;; usb &amp;#39;none&amp;#39;; vr &amp;#39;none&amp;#39;&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#a6e22e"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;** Update 2022-01-05:** Previously I&amp;rsquo;d used &lt;code&gt;header / {&lt;/code&gt; above; that should have been simply &lt;code&gt;header {&lt;/code&gt;. Thanks &lt;a class="link" href="https://twitter.com/JoHoffmann8" target="_blank" rel="noopener"
 &gt;@JoHoffmann8&lt;/a&gt; for pointing this out! It&amp;rsquo;s also worth mentioning that Caddy are deprecating the &lt;code&gt;common_log&lt;/code&gt; log format, which makes me sad in one way, but I do get it - the Caddy json log file format is far richer, but I liked the easily-ingested syslog format. ¯\_(ツ)_/¯&lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;Ok so here&amp;rsquo;s the thing. Caddy really seems to implement Python&amp;rsquo;s ethos of &amp;ldquo;Batteries Included&amp;rdquo;. The above contents are enough on their own to:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Host two separate static websites&lt;/li&gt;
&lt;li&gt;Offer two subdomains for each of these websites&lt;/li&gt;
&lt;li&gt;Manage the entire certificate creation and renewal process from &lt;a class="link" href="https://www.letsencrypt.org" target="_blank" rel="noopener"
 &gt;Let&amp;rsquo;s Encrypt&lt;/a&gt; for two sites, plus subdomains.&lt;/li&gt;
&lt;li&gt;Get an A+ rating on both &lt;a class="link" href="https://www.ssllabs.com/ssltest/" target="_blank" rel="noopener"
 &gt;SSL Labs&lt;/a&gt; and &lt;a class="link" href="https://www.securityheaders.io" target="_blank" rel="noopener"
 &gt;SecurityHeaders.io&lt;/a&gt;(!!)&lt;/li&gt;
&lt;li&gt;And, of course, zoink all the logs into separate files under /var/log/caddy&lt;/li&gt;
&lt;/ol&gt;
&lt;h1 id="creating-a-caddy-service-file"&gt;Creating a Caddy Service file
&lt;/h1&gt;&lt;p&gt;&lt;strong&gt;UPDATE 2020-05-07: With the release of Caddy 2.0, it appears a regular &lt;code&gt;dpkg -i caddy.deb&lt;/code&gt; will take care of creating the caddy.service file&lt;/strong&gt;&lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;If you&amp;rsquo;re running Debian, you&amp;rsquo;ll need to create yourself a service file for systemd, so you can get your server to launch Caddy on boot. I got mine from &lt;a class="link" href="https://github.com/caddyserver/dist/tree/master/init" target="_blank" rel="noopener"
 &gt;https://github.com/caddyserver/dist/tree/master/init&lt;/a&gt;:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;/etc/systemd/system/caddy.service&lt;/code&gt;:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-ini" data-lang="ini"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#75715e"&gt;# This service file requires the following:&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#75715e"&gt;#&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#75715e"&gt;# 1) Group named caddy:&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#75715e"&gt;# $ groupadd --system caddy&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#75715e"&gt;#&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#75715e"&gt;# 2) User named caddy, with a writeable home folder:&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#75715e"&gt;# $ useradd --system \&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#75715e"&gt;# --gid caddy \&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#75715e"&gt;# --create-home \&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#75715e"&gt;# --home-dir /var/lib/caddy \&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#75715e"&gt;# --shell /usr/sbin/nologin \&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#75715e"&gt;# --comment &amp;#34;Caddy web server&amp;#34; \&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#75715e"&gt;# caddy&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#75715e"&gt;#&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#75715e"&gt;# 3) Caddyfile at /etc/caddy/Caddyfile that is&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#75715e"&gt;# readable by the caddy user&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#75715e"&gt;#&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#66d9ef"&gt;[Unit]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#a6e22e"&gt;Description&lt;/span&gt;&lt;span style="color:#f92672"&gt;=&lt;/span&gt;&lt;span style="color:#e6db74"&gt;Caddy Web Server&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#a6e22e"&gt;Documentation&lt;/span&gt;&lt;span style="color:#f92672"&gt;=&lt;/span&gt;&lt;span style="color:#e6db74"&gt;https://caddyserver.com/docs/&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#a6e22e"&gt;After&lt;/span&gt;&lt;span style="color:#f92672"&gt;=&lt;/span&gt;&lt;span style="color:#e6db74"&gt;network.target&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#66d9ef"&gt;[Service]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#a6e22e"&gt;User&lt;/span&gt;&lt;span style="color:#f92672"&gt;=&lt;/span&gt;&lt;span style="color:#e6db74"&gt;caddy&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#a6e22e"&gt;Group&lt;/span&gt;&lt;span style="color:#f92672"&gt;=&lt;/span&gt;&lt;span style="color:#e6db74"&gt;caddy&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#a6e22e"&gt;ExecStart&lt;/span&gt;&lt;span style="color:#f92672"&gt;=&lt;/span&gt;&lt;span style="color:#e6db74"&gt;/usr/bin/caddy run --config /etc/caddy/Caddyfile --environ&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#a6e22e"&gt;ExecReload&lt;/span&gt;&lt;span style="color:#f92672"&gt;=&lt;/span&gt;&lt;span style="color:#e6db74"&gt;/usr/bin/caddy reload --config /etc/caddy/Caddyfile&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#a6e22e"&gt;TimeoutStopSec&lt;/span&gt;&lt;span style="color:#f92672"&gt;=&lt;/span&gt;&lt;span style="color:#e6db74"&gt;5s&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#a6e22e"&gt;LimitNOFILE&lt;/span&gt;&lt;span style="color:#f92672"&gt;=&lt;/span&gt;&lt;span style="color:#e6db74"&gt;1048576&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#a6e22e"&gt;LimitNPROC&lt;/span&gt;&lt;span style="color:#f92672"&gt;=&lt;/span&gt;&lt;span style="color:#e6db74"&gt;512&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#a6e22e"&gt;PrivateTmp&lt;/span&gt;&lt;span style="color:#f92672"&gt;=&lt;/span&gt;&lt;span style="color:#e6db74"&gt;true&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#a6e22e"&gt;ProtectSystem&lt;/span&gt;&lt;span style="color:#f92672"&gt;=&lt;/span&gt;&lt;span style="color:#e6db74"&gt;full&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#a6e22e"&gt;AmbientCapabilities&lt;/span&gt;&lt;span style="color:#f92672"&gt;=&lt;/span&gt;&lt;span style="color:#e6db74"&gt;CAP_NET_BIND_SERVICE&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#66d9ef"&gt;[Install]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#a6e22e"&gt;WantedBy&lt;/span&gt;&lt;span style="color:#f92672"&gt;=&lt;/span&gt;&lt;span style="color:#e6db74"&gt;multi-user.target&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h1 id="preventing-scans"&gt;Preventing scans
&lt;/h1&gt;&lt;p&gt;Everything above is already pretty secure - Caddy is really good at making security super easy. On top of that, Caddy is the only service hosted on this box, there&amp;rsquo;s no dynamic code (all raw HTML and CSS, thanks to &lt;a class="link" href="https://getpelican.com" target="_blank" rel="noopener"
 &gt;Pelican&lt;/a&gt;), and the only things listening to the internet are SSH and Caddy itself. But even then, I get tired of seeing hundreds of scan reports every day. &lt;a class="link" href="https://www.fail2ban.org/" target="_blank" rel="noopener"
 &gt;Fail2Ban&lt;/a&gt; to the rescue.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;/etc/fail2ban/filter.d/caddy-4xx.conf&lt;/code&gt;:&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;[Definition]
failregex = ^&amp;lt;HOST&amp;gt;.*&amp;#34;(GET|POST).*&amp;#34; (404|444|403|400) .*$
ignoreregex =
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;&lt;code&gt;/etc/fail2ban/jail.local&lt;/code&gt;:&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;[caddy-4xx]
port = http,https
logpath = /var/log/caddy/access.log
 /var/log/caddy/utu_access.log
enabled = true
banTime = 3600
findTime = 600
maxretry = 5
&lt;/code&gt;&lt;/pre&gt;&lt;h1 id="fin"&gt;Fin!
&lt;/h1&gt;&lt;p&gt;And that&amp;rsquo;s all! I had another tweak or two to my Pelican Makefile, to point rsync to the right server, but overall that was an incredibly simple process. The Caddy team have done a spectacular job.&lt;/p&gt;</description></item><item><title>Lockdown Chicken</title><link>https://www.ericlight.com/post/lockdown-chicken.html</link><pubDate>Sun, 29 Mar 2020 00:00:00 +1300</pubDate><guid>https://www.ericlight.com/post/lockdown-chicken.html</guid><description>&lt;img src="https://www.ericlight.com/post/lockdown-chicken/brine.jpg" alt="Featured image of post Lockdown Chicken" /&gt;&lt;p&gt;It&amp;rsquo;s the first weekend of New Zealand&amp;rsquo;s COVID-19 lockdown, and having already been working from home for a week I decided I&amp;rsquo;d get energetic in the kitchen.&lt;/p&gt;
&lt;p&gt;Last night, with some guidance from my mate Nevyn, I put a couple chickens into a brine. I&amp;rsquo;ve brined before, but this one was &lt;em&gt;super&lt;/em&gt; experimental for me, as usually my brines are just &lt;a class="link" href="https://www.allrecipes.com/recipe/170656/simple-chicken-brine/" target="_blank" rel="noopener"
 &gt;that one top result&lt;/a&gt; on AllRecipes.com, which is about as inspired as plain mayonnaise on pizza.&lt;/p&gt;
&lt;p&gt;Well, holy shit I just finished dinner and it was good enough that it deserves a blog post. The flavour of the brine &lt;em&gt;just&lt;/em&gt; showed through, the post-brine sauces were outstanding, and I did a pumpkin that I&amp;rsquo;ll mention below too!&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id="the-brine"&gt;The Brine
&lt;/h2&gt;&lt;p&gt;A brine is mostly there to ensure you get a super-soft and moist chicken at the end of the cook. For this purpose, only water and salt are really necessary. However you can also use the brining time to subtly introduce some flavours!&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;6 litres warm water&lt;/li&gt;
&lt;li&gt;½ cup salt&lt;/li&gt;
&lt;li&gt;⅓ cup sugar&lt;/li&gt;
&lt;li&gt;4 star anise&lt;/li&gt;
&lt;li&gt;2 cinnamon quills&lt;/li&gt;
&lt;li&gt;12 allspice&lt;/li&gt;
&lt;li&gt;10 cloves&lt;/li&gt;
&lt;li&gt;About two tsp peppercorns&lt;/li&gt;
&lt;li&gt;2 dried Kashmir(?) chillies&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;And, the méthode:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Mix your water, salt, and sugar until completely dissolved.&lt;/li&gt;
&lt;li&gt;Put the spices into a pan on medium heat, and wiggle them around until the aroma really starts. Make sure you don&amp;rsquo;t singe them!&lt;/li&gt;
&lt;li&gt;Add some of your brine to the pan and simmer the spices for five minutes or so, to get that fresh flavour out into the water.&lt;/li&gt;
&lt;li&gt;Tip the whole lot back into your pot of brine, making sure you don&amp;rsquo;t leave any flavour behind. It&amp;rsquo;s ready!&lt;/li&gt;
&lt;li&gt;Pop your chickens in, and leave them overnight. Weight them down with something if needed, and make sure you turn or mix them a couple times.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;img alt="Two chickens in a pot, covered in brine. There are peppercorns, and cinnamon quills floating on top of the water. A star anise and a dried chilli drift languidly." class="gallery-image" data-flex-basis="180px" data-flex-grow="75" data-title-escaped="Check out that beauty" height="2048" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://www.ericlight.com/post/lockdown-chicken/brine.jpg" srcset="https://www.ericlight.com/post/lockdown-chicken/brine_hu_bec1d1e48e9a2a64.jpg 800w, https://www.ericlight.com/post/lockdown-chicken/brine.jpg 1536w" title="Check out that beauty" width="1536"&gt;&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id="the-rub"&gt;The Rub
&lt;/h2&gt;&lt;p&gt;One one of the chickens, I used Leena Spices&amp;rsquo; exquisite &lt;a class="link" href="https://leenaspices.co.nz/products/portuguese-seasoning" target="_blank" rel="noopener"
 &gt;Portuguese Spice Mix&lt;/a&gt; with heaps of crushed garlic and lemon juice. On the other chicken, I decided to make up my own. Here&amp;rsquo;s what I did:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;1 tsp salt&lt;/li&gt;
&lt;li&gt;1 tsp garlic powder&lt;/li&gt;
&lt;li&gt;1 tsp smoked paprika&lt;/li&gt;
&lt;li&gt;2 tsp sugar&lt;/li&gt;
&lt;li&gt;2 tsp Worchestershire sauce&lt;/li&gt;
&lt;li&gt;1 Tbsp oil (adjust as desired for thickness)&lt;/li&gt;
&lt;li&gt;pinch of cayenne pepper&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Just add as much oil as you need to thin the mix out enough to spread on your chicken. Also, add enough cayenne pepper for it to actually be fairly hot; it will cool during cooking. I had mine &amp;ldquo;comfortably warm&amp;rdquo;, but after cooking it was entirely unnoticeable.&lt;/p&gt;
&lt;p&gt;&lt;img alt="A chicken, rubbed with my homemade rub, ready for cooking. It’s quite yellow, probably from the paprika." class="gallery-image" data-flex-basis="320px" data-flex-grow="133" data-title-escaped="Left: My spur-of-the-moment rub; \u2003 Right: Leena Spices&amp;amp;rsquo; Portuguese rub" height="1150" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://www.ericlight.com/post/lockdown-chicken/chicken_rub.jpg" srcset="https://www.ericlight.com/post/lockdown-chicken/chicken_rub_hu_6c2ce71d1805b298.jpg 800w, https://www.ericlight.com/post/lockdown-chicken/chicken_rub.jpg 1536w" title="Left: My spur-of-the-moment rub; \u2003 Right: Leena Spices&amp;rsquo; Portuguese rub" width="1536"&gt;&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id="the-pumpkin"&gt;The Pumpkin
&lt;/h2&gt;&lt;p&gt;This was another spur-of-the-moment thing, but it was absolutely a star of the meal. Real basically:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Cut your pumpkin in half, along the latitude, to make a couple bowls. (e.g. &lt;strong&gt;not&lt;/strong&gt; from stalk to base)&lt;/li&gt;
&lt;li&gt;Scoop out the soft inside bits of the pumpkin and discard.&lt;/li&gt;
&lt;li&gt;Take a knife and score the inside of the pumpkin bowls with cross-cuts, as deeply as you can manage.&lt;/li&gt;
&lt;li&gt;With your finger, just rub about 2 teaspoons of honey around every exposed part of the pumpkin flesh.&lt;/li&gt;
&lt;li&gt;Lay some strips of butter around the rim, with an extra pat of butter in the middle.&lt;/li&gt;
&lt;li&gt;Into the smoker it goes! I think mine was in for about two hours today.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;The honey and butter will melt and flow into the cross-cuts you made in the pumpkin, allowing the flavour to penetrate.&lt;/p&gt;
&lt;p&gt;&lt;img alt="Pre-cooking pumpkin. Cut in half like a couple bowls, honey rubbed all over, and butter slices arranged around the rim and inside." class="gallery-image" data-flex-basis="180px" data-flex-grow="75" data-title-escaped="Left: Pumpkin about to be introduced to the smoker; \u2003 Right: Post-smoker pumpkin&amp;amp;hellip; &amp;lt;strong&amp;gt;delicious&amp;lt;/strong&amp;gt;" height="2048" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://www.ericlight.com/post/lockdown-chicken/pumpkin_butter.jpg" srcset="https://www.ericlight.com/post/lockdown-chicken/pumpkin_butter_hu_98ac73a4c2ff1a85.jpg 800w, https://www.ericlight.com/post/lockdown-chicken/pumpkin_butter.jpg 1536w" title="Left: Pumpkin about to be introduced to the smoker; \u2003 Right: Post-smoker pumpkin&amp;hellip; &lt;strong&gt;delicious&lt;/strong&gt;" width="1536"&gt;&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id="the-end"&gt;The End
&lt;/h2&gt;&lt;p&gt;Here are the finishing photos! It was really a tremendous meal, and we&amp;rsquo;ve got enough left-over to make wraps for everyone tomorrow!&lt;/p&gt;
&lt;p&gt;&lt;img alt="Post-cooked chicken. It’s dark and smokey, still clearly moist. It’s difficult to tell the difference, but one has visible garlic chunks." class="gallery-image" data-flex-basis="180px" data-flex-grow="75" data-title-escaped="Absolutely exquisite. Moist, tender, spicy, complex chicken. Smokey, sweet, soft pumpkin. Sesame carrot, and soft salty potatoes." height="2048" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://www.ericlight.com/post/lockdown-chicken/cooked_chicken.jpg" srcset="https://www.ericlight.com/post/lockdown-chicken/cooked_chicken_hu_e2539014fc803f4b.jpg 800w, https://www.ericlight.com/post/lockdown-chicken/cooked_chicken.jpg 1536w" title="Absolutely exquisite. Moist, tender, spicy, complex chicken. Smokey, sweet, soft pumpkin. Sesame carrot, and soft salty potatoes." width="1536"&gt;&lt;/p&gt;</description></item><item><title>Eric's BBQ sauce</title><link>https://www.ericlight.com/post/bbq-sauce.html</link><pubDate>Sun, 22 Mar 2020 00:00:00 +1300</pubDate><guid>https://www.ericlight.com/post/bbq-sauce.html</guid><description>&lt;img src="https://www.ericlight.com/post/bbq-sauce/adobosauce.jpg" alt="Featured image of post Eric's BBQ sauce" /&gt;&lt;p&gt;Quite a long time ago, I posted my recipe for &lt;a class="link" href="https://www.ericlight.com/post/bbq-beans.html" &gt;smokey BBQ-baked beans&lt;/a&gt;. It&amp;rsquo;s still one of the only recipes I&amp;rsquo;ve seen which starts with dry beans, and includes slow-cooking in a smoker. Most of the recipes I&amp;rsquo;ve found are either for oven baking, or start with a literal can of baked beans (wtf).&lt;/p&gt;
&lt;p&gt;Well I&amp;rsquo;m making baked beans again for the first time in ages, and I&amp;rsquo;ve taken the time to write down my tweaks. This is primarily around my BBQ sauce, hence the title of this post!&lt;/p&gt;
&lt;p&gt;Just a few general reminders about baked beans, and then we&amp;rsquo;ll get into it:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Soak your beans the night before&lt;/li&gt;
&lt;li&gt;Make a barbecue sauce&lt;/li&gt;
&lt;li&gt;Simmer your beans for a bit in a normal pot&lt;/li&gt;
&lt;li&gt;Add your aromatics and BBQ sauce after the beans are simmering&lt;/li&gt;
&lt;li&gt;Cook your beans for a few hours until noms&lt;/li&gt;
&lt;/ol&gt;
&lt;h1 id="the-bbq-sauce-recipe"&gt;The BBQ Sauce recipe
&lt;/h1&gt;&lt;p&gt;OK here&amp;rsquo;s the sauce:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;350ml tomato sauce / ketchup / catsup. I used Watties, which is a fairly sweet ketchup with quite low acid&lt;/li&gt;
&lt;li&gt;200ml brown sugar - the darker the better. You could substitute in some molasses into white sugar if you need&lt;/li&gt;
&lt;li&gt;100ml apple cider vinegar&lt;/li&gt;
&lt;li&gt;80ml Worchestershire sauce&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;That&amp;rsquo;s your base sauce. Put them all together in a pot, and bring to a slow simmer while stirring until it&amp;rsquo;s all mixed and smooth.&lt;/p&gt;
&lt;p&gt;At this point, you want to start tasting and tweaking it to your tastes. Work out your preferred balance between the zest of the apple cider vinegar, the sweetness of the sugar, and the meaty richness of the Worchestershire sauce.&lt;/p&gt;
&lt;p&gt;Once you&amp;rsquo;ve got your balance nailed, expand into the flavours:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;1Tbsp paprika&lt;/li&gt;
&lt;li&gt;1Tbsp English mustard&lt;/li&gt;
&lt;li&gt;3 drops liquid smoke&lt;/li&gt;
&lt;li&gt;1tsp of adobo sauce, if you can find it&lt;/li&gt;
&lt;li&gt;alternatively, some cayenne or chilli powder&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Be careful about your mixing method - take a quarter cup or so of your simmering sauce out, put your tablespoon of paprika into &lt;em&gt;that&lt;/em&gt;, mix it up, and &lt;strong&gt;then&lt;/strong&gt; add it to your pot. Otherwise you&amp;rsquo;ll get chunks of powder that are a pain to mix in.&lt;/p&gt;
&lt;p&gt;Adobo sauce is pretty &amp;hellip; interesting. It turns out, if you have a tin of chipotle peppers, they&amp;rsquo;re almost certainly bathing in adobo sauce. It&amp;rsquo;s also pretty spicy, so you really don&amp;rsquo;t use much, but it adds a whole lot of flavour that is beyond just heat. A teaspoon should be a pretty good starting point though, and you can ramp up from there as needed - it does lose a lot of it&amp;rsquo;s heat while it simmers.&lt;/p&gt;
&lt;p&gt;&lt;img alt="A can of chipotle peppers, opened to show them soaking in rich red-brown adobo sauce" class="gallery-image" data-flex-basis="288px" data-flex-grow="120" data-title-escaped="Adobo sauce&amp;amp;rsquo;s natural habitat is pretty much a can." height="998" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://www.ericlight.com/post/bbq-sauce/adobosauce.jpg" srcset="https://www.ericlight.com/post/bbq-sauce/adobosauce_hu_7dfb598d9d2a608f.jpg 800w, https://www.ericlight.com/post/bbq-sauce/adobosauce.jpg 1200w" title="Adobo sauce&amp;rsquo;s natural habitat is pretty much a can." width="1200"&gt;&lt;/p&gt;</description></item><item><title>Artsy Moose artisan shaving soap review</title><link>https://www.ericlight.com/post/grere.html</link><pubDate>Wed, 18 Mar 2020 00:00:00 +1300</pubDate><guid>https://www.ericlight.com/post/grere.html</guid><description>&lt;p&gt;&lt;em&gt;(Reposting from Facebook - originally written 2020-02-19)&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Tonight I&amp;rsquo;ve got something a bit special for my #shavingPost&amp;hellip; A few weeks ago, I offered to help beta test a new product - a shave soap in a cup - for Grere Coutie of &lt;a class="link" href="https://www.artsymoose.co.nz/" target="_blank" rel="noopener"
 &gt;The Artsy Moose&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;The Artsy Moose is actually a really groovy little artisan handcraft shop, physically located here in Hamilton, but Grere sells most of her work online as well. Primarily focussed on soaps, there are all sorts on offer - from &lt;a class="link" href="https://www.artsymoose.co.nz/shop/product/334634/Activated-Charcoal-Soap/" target="_blank" rel="noopener"
 &gt;activated charcoal&lt;/a&gt; soap, to &lt;a class="link" href="https://www.artsymoose.co.nz/shop/product/344305/Gardeners-Soap-with-Pumice-and-Poppy-Seeds/" target="_blank" rel="noopener"
 &gt;gardeners&lt;/a&gt; soap, to &lt;em&gt;&lt;a class="link" href="https://www.artsymoose.co.nz/shop/product/302441/Tuatara-Beer-Soap/" target="_blank" rel="noopener"
 &gt;BEER&lt;/a&gt;&lt;/em&gt; soap&amp;hellip; even &lt;a class="link" href="https://www.artsymoose.co.nz/shop/product/299826/Dapper-Dog-Handmade-Soap/" target="_blank" rel="noopener"
 &gt;soap for your doggo&lt;/a&gt;!&lt;/p&gt;
&lt;p&gt;I received the cup yesterday and tonight was my opportunity to take it for a spin!&lt;/p&gt;
&lt;p&gt;My setup tonight was my trusty &lt;a class="link" href="https://www.razorock.com/?ourproduct=razors" target="_blank" rel="noopener"
 &gt;RazoRock&lt;/a&gt; Slant, loaded with a Derby Green blade that&amp;rsquo;s a bit worn-in, having just finished it&amp;rsquo;s third shave. I used my synthetic silvertip shaving brush that&amp;rsquo;s been in my rotation for a few years now.&lt;/p&gt;
&lt;p&gt;My regular routine for shaving is to hop in the shower, rinse my face, wash and rinse my hair, wash and rinse my face, and then bust out the shaving gear. This way my stubble has some time to soften up while I&amp;rsquo;m still being nice and efficient.&lt;/p&gt;
&lt;p&gt;The first thing I noticed, of course, was the scent! This is a truly enjoyable scent, a bit reminiscent of sandalwood: elegant, woody, and a little musky. It could be a little bit stronger, but I like my scents quite bold, and it certainly isn&amp;rsquo;t weakly scented.&lt;/p&gt;
&lt;p&gt;So I gave the soap block a brief rinse in warm water, drained it thoroughly, and got my shaving brush in there. After a few moments I had a beautiful white lather and got to work. I did find the lather to be very short-lived; even though I applied it fairly thickly, by the time I finished one side of my face, the other side had thinned enough that I could see skin. On my second pass I REALLY worked the brush and, although the lather came out thicker, it vanished similarly quickly.&lt;/p&gt;
&lt;p&gt;&lt;a class="link" href="https://time.com/5175901/elizabeth-warren-nevertheless-she-persisted-meaning/" target="_blank" rel="noopener"
 &gt;Nevertheless, I persisted&lt;/a&gt; &lt;em&gt;(President Warren, 2020 🙌)&lt;/em&gt;&amp;hellip; The second pass was all good, but by the third pass I was feeling&amp;hellip; Quite exposed to my blade. It just felt like I was lacking all the cushioning I&amp;rsquo;m used to from my regular creams. I didn&amp;rsquo;t let this deter me, and I continued shaving until I achieved my normal closeness of shave.&lt;/p&gt;
&lt;p&gt;Folks I gotta say, I was really expecting to have razor burn when I got out of the shower. Persisting with a regular shave while not feeling the cushioning - and with a quickly-diminishing lather, really had me nervous. HOWEVER, I was surprised to find that nothing dire came to pass! I got out of the shower, did my dental hygiene routine, and by then I&amp;rsquo;m usually feeling a growing burn if my shave was off. But&amp;hellip; No burn, no nicks, no cuts. I probably didn&amp;rsquo;t even need aftershave.&lt;/p&gt;
&lt;p&gt;But, like, I USED aftershave anyway, of course. &lt;a class="link" href="https://theninenine.com/quotes/quote/4241/" target="_blank" rel="noopener"
 &gt;I&amp;rsquo;m not an animal&lt;/a&gt;. Interestingly, my aftershave did burn a little today, which is not normal. I don&amp;rsquo;t think it got along well with the shave soap, perhaps.&lt;/p&gt;
&lt;p&gt;Overall score for the first round:
Scent, five stars
Cushion, two stars
Lather, two stars
Shave quality, four stars
Face happiness&amp;hellip; Actually a full 4.5 stars!&lt;/p&gt;
&lt;p&gt;Next shave, I&amp;rsquo;m going to try my actual badger hair brush, as the lather may have been affected by the synthetic hair. I&amp;rsquo;ll also try a new (corked) blade and a different aftershave, to compare results. I&amp;rsquo;m also going to get reports from the rest of the family to see how it works with their shaving routines.&lt;/p&gt;
&lt;p&gt;And that&amp;rsquo;s not all! I&amp;rsquo;m sure that Grere will be modifying the recipe in response to this review, and I think it&amp;rsquo;ll only get better as we work through!&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;[Update 2020-03-18]&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;I&amp;rsquo;ve used this shaving soap quite a few times now! I still find the same - the lather vanishes very quickly, and it still feels very thin&amp;hellip; but it still gives actually a superb shave and I&amp;rsquo;ve never given myself any nicks or cuts while using it. I haven&amp;rsquo;t managed to convince anyone else to try it, but I&amp;rsquo;m happy it&amp;rsquo;s in my collection.&lt;/p&gt;
&lt;p&gt;I sent this review onto Grere, and as expected, she knew exactly what to tweak:&lt;/p&gt;
&lt;p&gt;&lt;em&gt;&amp;ldquo;It sounds like the recipe could do with more stearic acid, this should provide the more stable later and cushioning that you prefer. I will whip up another batch for you to compare at some stage. However, stearic acid is derived from palm oil, which I don&amp;rsquo;t use in my soap - so i&amp;rsquo;ll see if I can try and alternative.&amp;rdquo;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;So, there you go! I&amp;rsquo;ll be sure to update this post in the future, but for now, this single shave soap is going to last me at least a year. 🙂&lt;/p&gt;</description></item><item><title>Where does mass come from?</title><link>https://www.ericlight.com/post/mass.html</link><pubDate>Wed, 18 Mar 2020 00:00:00 +1300</pubDate><guid>https://www.ericlight.com/post/mass.html</guid><description>&lt;img src="https://www.ericlight.com/post/mass/donlincoln.jpg" alt="Featured image of post Where does mass come from?" /&gt;&lt;p&gt;I’m a bit over halfway through a brilliant set of particle physics lectures by &lt;a class="link" href="https://en.wikipedia.org/wiki/Don_Lincoln" target="_blank" rel="noopener"
 &gt;Don Lincoln&lt;/a&gt;, called &lt;a class="link" href="https://www.thegreatcourses.com/courses/the-theory-of-everything-the-quest-to-explain-all-reality.html" target="_blank" rel="noopener"
 &gt;The Theory of Everything: The Quest to Explain All Reality&lt;/a&gt;. Don has spent many years as an experimental particle physicist, and has worked with particle accelerators at both at Fermilab and at CERN. You may remember him from his co-discovery of the top quark in 1995, or from his membership on the CERN team when they discovered the Higgs boson in 2012. Or heck you might have seen one of his TED talks. Either way you have this set of lectures, Don Lincoln, and Don’s moustache to thank for today’s episode.&lt;/p&gt;
&lt;p&gt;&lt;img alt="A profile photo of Don Lincoln himself, sporting a moustache" class="gallery-image" data-flex-basis="240px" data-flex-grow="100" data-title-escaped="Thanks, Don&amp;amp;rsquo;s moustache!" height="225" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://www.ericlight.com/post/mass/donlincoln.jpg" title="Thanks, Don&amp;rsquo;s moustache!" width="225"&gt;&lt;/p&gt;
&lt;p&gt;This fascinating (to me) lecture series takes us on a journey through the four known forces of the universe – the strong nuclear force, the weak nuclear force, the electromagnetic force, and the gravitational force. I’ve spent literally hundreds of hours reading on this esoterica (&lt;em&gt;glares pre-emptively at autocorrect&lt;/em&gt;), and I know it’s a baffling area, so I’m really just going to skirt around the edges of this. But one particularly outstanding part really got my interest, and I think I can write it in an understandable form here. Wish me luck… ☘️&lt;/p&gt;
&lt;p&gt;This post is on the topic of mass. To start looking at this we go down to the foundations of matter – let’s take a quick journey through mass:&lt;/p&gt;
&lt;p&gt;&lt;img alt="Pope Francis giving mass in front of a large congregation" class="gallery-image" data-flex-basis="435px" data-flex-grow="181" data-title-escaped="Sorry, wrong door." height="256" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://www.ericlight.com/post/mass/popemass.jpg" title="Sorry, wrong door." width="465"&gt;&lt;/p&gt;
&lt;h2 id="what-are-things"&gt;What are things?
&lt;/h2&gt;&lt;p&gt;To get us started, I’ve put the below into a bulleted list – every level is the next step down in matter:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;You, a standard human being, are made up of &lt;strong&gt;molecules&lt;/strong&gt; (mostly water), along with a collection of bad ideas and faulty memories. I’m not judging.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Those molecules in your body are made up of &lt;strong&gt;atoms&lt;/strong&gt; – mostly carbon, hydrogen, and oxygen.&lt;br&gt;
Let’s look closer at &lt;strong&gt;hydrogen&lt;/strong&gt;. &lt;em&gt;*squints*&lt;/em&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;A &lt;strong&gt;hydrogen atom&lt;/strong&gt; is the simplest atom. It has the atomic number of 1, meaning its nucleus has only a single &lt;strong&gt;proton&lt;/strong&gt;, which is balanced by a single &lt;strong&gt;electron&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Side-note: Hydrogen is a little special because it doesn’t have a neutron in its nucleus. In contrast, heavy hydrogen – known as deuterium – has a proton, an electron, and a neutron.&lt;/em&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;A proton is, in turn, made up of three &lt;strong&gt;quarks&lt;/strong&gt;, and weighs roughly 938 MeV/&lt;em&gt;c&lt;/em&gt;&lt;sup&gt;2&lt;/sup&gt;. (that’s megaelectronvolts… more below)&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;An &lt;strong&gt;up quark&lt;/strong&gt; (carrying a positive electric charge of “plus two-thirds”) has a mass of roughly 2.3 MeV/&lt;em&gt;c&lt;/em&gt;&lt;sup&gt;2&lt;/sup&gt; (ignore that part)&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;The &lt;strong&gt;down quark&lt;/strong&gt; (carrying a negative electric charge of “minus one-third”) has a mass of roughly 4.8 MeV/&lt;em&gt;c&lt;/em&gt;&lt;sup&gt;2&lt;/sup&gt; (ignore that too, the fun bit is coming)&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;em&gt;(Quarks appear to be made up of &lt;strong&gt;strings&lt;/strong&gt;, but that’s too deep for this article. Extra credit: String theory, superstring theory, and M theory)&lt;/em&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Holding the quarks together are the &lt;strong&gt;Gluons&lt;/strong&gt;, which are the particles which mediate the strong nuclear force. These are massless*-ish*, coming in at &lt;em&gt;almost&lt;/em&gt; exactly 0 MeV/&lt;em&gt;c&lt;/em&gt;&lt;sup&gt;2&lt;/sup&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;A proton is made of &lt;strong&gt;two up quarks and a down quark&lt;/strong&gt;, which gives it a total electric charge of +1. (four-thirds from the up quarks, minus a third from down quark)&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;The &lt;strong&gt;electron&lt;/strong&gt; is not made up of quarks – it appears to be a primary particle (specifically, a &lt;em&gt;lepton&lt;/em&gt;) that cannot be subdivided. It has an electric charge of -1, and a mass of about 0.5 MeV/&lt;em&gt;c&lt;/em&gt;&lt;sup&gt;2&lt;/sup&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="whats-a-mev-and-has-it-been-approved-by-the-fda"&gt;What’s a MeV, and has it been approved by the FDA?
&lt;/h2&gt;&lt;p&gt;Okay, so you’ve probably never seen mass described in MeV/&lt;em&gt;c&lt;/em&gt;&lt;sup&gt;2&lt;/sup&gt; before. That’s because people live in the world of Relatively Big Things™, so we generally think of mass as what you might measure on a set of bathroom scales (also known as m’ass). But when you’re looking at particle physics, things get &lt;strong&gt;&lt;em&gt;way&lt;/em&gt;&lt;/strong&gt; fuzzier&amp;hellip; SO fuzzy, in fact, that we don’t weigh things in grams – we weigh them in energy! Specifically, in electron-volts.&lt;/p&gt;
&lt;p&gt;For example, a proton weighs 938 million electron-volts (/&lt;em&gt;c&lt;/em&gt;&lt;sup&gt;2&lt;/sup&gt;), and an electron weighs about 500,000 electron-volts. CBut… how does *that* work? How on earth do we measure mass in energy? You wouldn’t say &amp;ldquo;this glass weighs 500 calories&amp;rdquo;, would you?&lt;/p&gt;
&lt;p&gt;&lt;img alt="Fry, from the animation Futurama, squinting in deep suspicion" class="gallery-image" data-flex-basis="424px" data-flex-grow="176" data-title-escaped="&amp;amp;hellip;WOULD YOU?" height="159" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://www.ericlight.com/post/mass/frysquint.png" title="&amp;hellip;WOULD YOU?" width="281"&gt;&lt;/p&gt;
&lt;p&gt;HECK YEAH, you would! It’s the formula most deeply burned into your brain from high school: &lt;em&gt;E=mc&lt;sup&gt;2&lt;/sup&gt;&lt;/em&gt;. Energy (in joules) = Mass (in kilograms) * the speed of light (in metres per second) squared. Einstein’s been saying it for over a hundred years… mass is energy, and energy is mass! And mass contains a &lt;em&gt;&lt;strong&gt;whole honkin&amp;rsquo; bunch&lt;/strong&gt;&lt;/em&gt; of energy. So much energy that a single gram of matter – about the mass of a business card – looks something like this:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Energy (joules) = 1 gram * speed of light^2
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Energy (joules) = 0.001 * 300000000 * 300000000
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Energy of 1 gram of matter = 9,000,000,000,000,000 joules
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&amp;hellip; or about 2,151,051,625,239 calories.&lt;/p&gt;
&lt;p&gt;&lt;img alt="A photo of someone holding a business card. The business card simply reads ‘Wow’, in quotation marks, with a picture of Owen Wilson. It is very droll." class="gallery-image" data-flex-basis="441px" data-flex-grow="183" data-title-escaped="That’s a lot of calories for a piece of cardboard. Probably better off eating pizza." height="236" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://www.ericlight.com/post/mass/wowmass.png" title="That’s a lot of calories for a piece of cardboard. Probably better off eating pizza." width="434"&gt;&lt;/p&gt;
&lt;p&gt;So yep, you can definitely weigh things in energy &amp;hellip; and because subatomic particles are so small, energy is a totally sensible measure to use. So let’s get back to the world of the extra-tiny.&lt;/p&gt;
&lt;h2 id="those-numbers-look-fishy"&gt;Those numbers look fishy&amp;hellip;
&lt;/h2&gt;&lt;p&gt;Yes, those numbers are weird. And I’m not talking about my equations above, I’m talking about the mass of an atom. Check it out again:&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Proton = 2x up quarks + 1x down quark = 938 MeV/c&lt;sup&gt;2&lt;/sup&gt;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;But the two up quarks only bring 4.6 MeV/&lt;em&gt;c&lt;/em&gt;&lt;sup&gt;2&lt;/sup&gt; to the party, and that down quark is only 4.8 MeV/&lt;em&gt;c&lt;/em&gt;&lt;sup&gt;2&lt;/sup&gt;, adding up to a mere 9.4 MeV/&lt;em&gt;c&lt;/em&gt;&lt;sup&gt;2&lt;/sup&gt;. In fact, when you put together the mass of all the components of a proton, you still only see about 2% of the mass of the proton. So… where’s all that other mass coming from?&lt;/p&gt;
&lt;p&gt;Well, okay. Those quarks aren’t just sitting stationary – they’re moving around at nearly the speed of light, within an incredibly tiny area. In fact, these quarks are fizzing around in an area approximately one-quadrillionth of a meter.&lt;/p&gt;
&lt;p&gt;And here’s the whole idea that got me writing this post:&lt;/p&gt;
&lt;p&gt;Our quarks, zooming around near the speed of light, and confined within such an incredibly tiny area… Well heck, that’s a whole lot of energy.&lt;/p&gt;
&lt;p&gt;And what is energy?&lt;/p&gt;
&lt;p&gt;&lt;big&gt;&lt;em&gt;It&amp;rsquo;s &lt;strong&gt;mass&lt;/strong&gt;&lt;/em&gt;&lt;/big&gt;.&lt;/p&gt;
&lt;p&gt;And &lt;strong&gt;that&lt;/strong&gt; is where most of the mass of an atom comes from. From this &lt;em&gt;kinetic&lt;/em&gt; energy, found within in the quantum foam, and expressing itself in our universe as mass.&lt;/p&gt;
&lt;p&gt;&lt;img alt="An artist’s depection of three quarks, swirling around in an energy field, and held together by gluons – forming a proton" class="gallery-image" data-flex-basis="354px" data-flex-grow="147" data-title-escaped="Big or small, the universe is full of astounding beauty." height="250" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://www.ericlight.com/post/mass/protoninnards.jpg" title="Big or small, the universe is full of astounding beauty." width="369"&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;fin.&lt;/em&gt;&lt;/p&gt;</description></item><item><title>Fail2Ban+Nginx (blocking repeated 404's, etc)</title><link>https://www.ericlight.com/post/fail2ban-nginx.html</link><pubDate>Mon, 16 Mar 2020 00:00:00 +1300</pubDate><guid>https://www.ericlight.com/post/fail2ban-nginx.html</guid><description>&lt;p&gt;After hosting a &lt;a class="link" href="https://www.iredmail.org" target="_blank" rel="noopener"
 &gt;mail server&lt;/a&gt; for a few years, I&amp;rsquo;ve gotten tired of seeing alllll the 404 attempts in my daily logwatch. Fail2Ban can help here really well, and it turns out to be really easy.&lt;/p&gt;
&lt;p&gt;Start with &lt;code&gt;nano /etc/fail2ban/filter.d/nginx-4xx.conf&lt;/code&gt; (I&amp;rsquo;m counting on your running Debian and having things in default locations here), and enter the following:&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;[Definition]
failregex = ^&amp;lt;HOST&amp;gt;.*&amp;#34;(GET|POST).*&amp;#34; (404|444|403|400) .*$
ignoreregex =
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;&lt;em&gt;Note: Make sure you use a capital &amp;lsquo;D&amp;rsquo; in Definition there.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Now, edit your /etc/fail2ban/jail.conf, and add these lines:&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;[nginx-4xx]
enabled = true
port = http,https
logpath = /var/log/nginx/access.log
maxretry = 3
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Of course, modify your maxretry as desired. Refresh your Fail2Ban rules with &lt;code&gt;service fail2ban restart&lt;/code&gt;, and it should now be on the lookout for repeated 4xx errors.&lt;/p&gt;
&lt;p&gt;You can confirm it&amp;rsquo;s working with: &lt;code&gt;fail2ban-client status nginx-4xx&lt;/code&gt;:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Status for the jail: nginx-4xx
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;|- Filter
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;| |- Currently failed:	2
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;| |- Total failed:	9
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;| `- File list:	/var/log/nginx/access.log
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;`- Actions
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; |- Currently banned:	2
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; |- Total banned:	2
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; `- Banned IP list: 123.232.123.101 123.232.123.102
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;em&gt;Success!&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Worth mentioning&amp;hellip; for the first while I thought it wasn&amp;rsquo;t working, but I realised I was trying to trigger the rule from on the same LAN, and &amp;hellip;&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;[DEFAULT]
# time is in seconds. 3600 = 1 hour, 86400 = 24 hours (1 day)
findtime = 3600
bantime = 3600
maxretry = 5
ignoreip = 127.0.0.1 127.0.0.0/8 10.0.0.0/8 172.16.0.0/12 192.168.0.0/16
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;&amp;hellip; I was hitting it from within the ignoreip range. 😬&lt;/p&gt;
&lt;p&gt;And of course, I can&amp;rsquo;t finish off a blog without giving credit where it&amp;rsquo;s due. I got this all from GitHub user AysadKozanoglu, here: &lt;a class="link" href="https://gist.github.com/AysadKozanoglu/1335735272fb3b00a03bd3eea22af818" target="_blank" rel="noopener"
 &gt;https://gist.github.com/AysadKozanoglu/1335735272fb3b00a03bd3eea22af818&lt;/a&gt;&lt;/p&gt;</description></item><item><title>sa-compile failing during upgrade</title><link>https://www.ericlight.com/post/sa-compile.html</link><pubDate>Sun, 15 Mar 2020 00:00:00 +1300</pubDate><guid>https://www.ericlight.com/post/sa-compile.html</guid><description>&lt;p&gt;I just spent an hour troubleshooting the most ridiculous thing. I guess to help people search, I&amp;rsquo;d describe this as &amp;ldquo;dpkg failing at sa-compile in Debian 10&amp;rdquo; but that&amp;rsquo;s really not a good picture of what&amp;rsquo;s happening here&amp;hellip;&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Setting up sa-compile &lt;span style="color:#f92672"&gt;(&lt;/span&gt;3.4.2-1~deb9u3&lt;span style="color:#f92672"&gt;)&lt;/span&gt; ...
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Running sa-compile &lt;span style="color:#f92672"&gt;(&lt;/span&gt;may take a long time&lt;span style="color:#f92672"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;/bin/sh: 1: x86_64-linux-gnu-gcc: Permission denied
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;make: *** &lt;span style="color:#f92672"&gt;[&lt;/span&gt;body_0.o&lt;span style="color:#f92672"&gt;]&lt;/span&gt; Error &lt;span style="color:#ae81ff"&gt;126&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;command &lt;span style="color:#e6db74"&gt;&amp;#39;make PREFIX=/tmp/.spamassassin22062Ifq5yDtmp/ignored INSTALLSITEARCH=/var/lib/spamassassin/compiled/5.024/3.004002 &amp;gt;&amp;gt;/tmp/.spamassassin22062Ifq5yDtmp/log&amp;#39;&lt;/span&gt; failed: exit &lt;span style="color:#ae81ff"&gt;2&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;dpkg: error processing package sa-compile &lt;span style="color:#f92672"&gt;(&lt;/span&gt;--configure&lt;span style="color:#f92672"&gt;)&lt;/span&gt;:
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;subprocess installed post-installation script returned error exit status &lt;span style="color:#ae81ff"&gt;25&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&amp;lt;-- snip --&amp;gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Errors were encountered &lt;span style="color:#66d9ef"&gt;while&lt;/span&gt; processing:
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; sa-compile
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;E: Sub-process /usr/bin/dpkg returned an error code &lt;span style="color:#f92672"&gt;(&lt;/span&gt;1&lt;span style="color:#f92672"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;In my defence, it seemed similar to a recurring issue I&amp;rsquo;ve had on this server in the past, (which I now promise to address in a separate post). That&amp;rsquo;s why I ended up on a red herring hunt.&lt;/p&gt;
&lt;p&gt;Anyway, I spent a bunch of time trying to troubleshoot dpkg and Python, before realising that a few months ago I&amp;rsquo;d installed &lt;a class="link" href="https://cisofy.com/lynis" target="_blank" rel="noopener"
 &gt;Lynis&lt;/a&gt; and worked through a bunch of the hardening recommendations.&lt;/p&gt;
&lt;p&gt;&amp;hellip; One of which is restricting the execute permissions on /usr/bin/gcc. Which is a symlink to /usr/bin/gcc-6. Which is a symlink to x86_64-linux-gnu-gcc-6.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;root@x:/usr/bin# ls -l x86_64-linux-gnu-gcc-6
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;-rw-r--r-- &lt;span style="color:#ae81ff"&gt;1&lt;/span&gt; root root &lt;span style="color:#ae81ff"&gt;949016&lt;/span&gt; Feb &lt;span style="color:#ae81ff"&gt;15&lt;/span&gt; &lt;span style="color:#ae81ff"&gt;2018&lt;/span&gt; x86_64-linux-gnu-gcc-6
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Yes. I was experiencing problems compiling things because I&amp;rsquo;d removed execute permissions for all users on the compiler I needed, and I&amp;rsquo;d spent an hour ignoring the &amp;ldquo;Permission denied&amp;rdquo; error that told me where to look.&lt;/p&gt;
&lt;p&gt;Fixed with a simple &lt;code&gt;chmod 744 /usr/bin/x86_64-linux-gnu-gcc-6&lt;/code&gt;.&lt;/p&gt;</description></item><item><title>FreeNAS finally supports ECC crypto!</title><link>https://www.ericlight.com/post/freenas_ecc.html</link><pubDate>Sun, 02 Feb 2020 00:00:00 +1300</pubDate><guid>https://www.ericlight.com/post/freenas_ecc.html</guid><description>&lt;p&gt;Woo! &lt;a class="link" href="https://www.freenas.org" target="_blank" rel="noopener"
 &gt;FreeNAS&lt;/a&gt; finally supports ECC crypto for it&amp;rsquo;s SSL certificates in 11.3!&lt;/p&gt;
&lt;p&gt;I &lt;a class="link" href="https://redmine.ixsystems.com/issues/27665" target="_blank" rel="noopener"
 &gt;reported this as a bug&lt;/a&gt; almost exactly two years ago, and kept having to do nasty workarounds to make it work every time I installed an update. Very happy that it&amp;rsquo;s finally sorted and I can use my proper shiny elliptic curve SSL setup! :)&lt;/p&gt;</description></item><item><title>Fortinet SSL VPN Certificate extensions</title><link>https://www.ericlight.com/post/fortinet-ssl.html</link><pubDate>Sun, 19 Jan 2020 00:00:00 +1300</pubDate><guid>https://www.ericlight.com/post/fortinet-ssl.html</guid><description>&lt;p&gt;If you&amp;rsquo;re setting up a new SSL VPN with certificate authentication, and if you already have an internal PKI, you&amp;rsquo;re probably considering using your internal certification authority to create the SSL keys and certificates for your VPN clients. Awesome! This is a great and easy way to do this job.&lt;/p&gt;
&lt;p&gt;But there&amp;rsquo;s a dearth of information on the Interwebs regarding what Extended Key Usages you need to have enabled in your Certificate Template for these. There are a heap available, including Email Signing, Timestamping, Code Signing, IPSec SSL things (about 8 of these), and way more options.&lt;/p&gt;
&lt;p&gt;Well, your search can end now. There&amp;rsquo;s only one Extended Key Usage option required for SSL certificate authentication with the Fortinet FortiClient VPN:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;em&gt;Client Authentication&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;That&amp;rsquo;s it. That&amp;rsquo;s the post.&lt;/p&gt;</description></item><item><title>What's so weird about lightspeed, anyway?</title><link>https://www.ericlight.com/post/lightspeed.html</link><pubDate>Thu, 16 Jan 2020 00:00:00 +1300</pubDate><guid>https://www.ericlight.com/post/lightspeed.html</guid><description>&lt;p&gt;Have you ever experienced that thing where you&amp;rsquo;re in your car, stopped at a traffic light - you suddenly get the sensation that you&amp;rsquo;re rolling backward, so you slam on your brake&amp;hellip; but you already had your brake on, and you weren&amp;rsquo;t moving! It was the car beside you rolling &lt;em&gt;forward&lt;/em&gt;, but your brain misinterpreted it as your own - backwards - motion.&lt;/p&gt;
&lt;p&gt;So, another mental image: imagine that you find yourself suddenly transported to a quiet, peaceful mountaintop. There&amp;rsquo;s a monastery here, and Monks are quietly meditating. There is no sound, no wind, just silence and calm. You would probably say you&amp;rsquo;re standing perfectly still.&lt;/p&gt;
&lt;p&gt;Now, remembering that perception of stillness, think about the example in &lt;a class="link" href="https://twitter.com/KevinPaulGregg/status/1213614627583455233" target="_blank" rel="noopener"
 &gt;this tweet&lt;/a&gt;:&lt;/p&gt;

 &lt;blockquote&gt;
 &lt;p&gt;Take a kid &amp;amp; explain to him the true fact that the Sun is so far away that it would take a car going 100 mph a 100 years non-stop to get there. And then tell him to picture that same distance BEYOND the Sun! And then tell him that he and you were at that very spot 6 months ago.&lt;/p&gt;
&lt;p&gt;&amp;ndash; @KevinPaulGregg&lt;/p&gt;

 &lt;/blockquote&gt;
&lt;p&gt;&amp;hellip; your peaceful mountaintop really wasn&amp;rsquo;t that still &lt;em&gt;at all&lt;/em&gt;. In fact, it was hurtling through the galaxy at &amp;hellip; (&lt;em&gt;cough&lt;/em&gt;) &amp;hellip; an astronomical rate. And on top of that, it&amp;rsquo;s spinning wildly: at the equator, the earth&amp;rsquo;s surface is moving at almost 1700km/h.&lt;/p&gt;
&lt;p&gt;This speaks to the very basis of an important question: &lt;em&gt;What &lt;strong&gt;is&lt;/strong&gt; speed?&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Over 400 years ago, Galileo Galilei&amp;rsquo;s Principle of Relativity (not to be confused with Einstein&amp;rsquo;s Theory of Relativity) emphasised that the concept of speed &lt;strong&gt;requires&lt;/strong&gt; a frame of reference. That is, speed is &lt;em&gt;always&lt;/em&gt; relative to something else. If you&amp;rsquo;re driving at 100km/h, that speed is relative to the road under your tyres - but compared to a motorbike passing you at 120km/hr, you&amp;rsquo;re moving &lt;em&gt;backwards&lt;/em&gt;. Or &amp;hellip; from a different perspective, you&amp;rsquo;re sitting still, and the motorbike is only travelling at 20km/hr. And no matter how fast you&amp;rsquo;re driving, your steering wheel isn&amp;rsquo;t really moving relative to you.&lt;/p&gt;
&lt;p&gt;OK I think I&amp;rsquo;ve explained that point to death now. Speed is always measured between &lt;strong&gt;two&lt;/strong&gt; points in space. But here&amp;rsquo;s the interesting bit.&lt;/p&gt;
&lt;p&gt;&lt;a class="link" href="https://en.wikipedia.org/wiki/Maxwell%27s_equations" target="_blank" rel="noopener"
 &gt;Maxwell&amp;rsquo;s Equations&lt;/a&gt;, published in the 1860&amp;rsquo;s, can be used to calculate the speed of light - exactly 299,793,458 metres per second in a vacuum. But there&amp;rsquo;s something missing: that all-important frame of reference; the OTHER point in space to measure the speed against. What&amp;rsquo;s going on there? Lots of theories and experiments were floated to figure out where this missing factor was, but everything was shown to be incorrect&amp;hellip; that is, until Einstein looked at the problem.&lt;/p&gt;
&lt;p&gt;Einstein - in typical Einstein fashion - simply looked and said, &amp;ldquo;if the speed of light doesn&amp;rsquo;t have a frame of reference, that must mean that the speed of light is the same in &lt;strong&gt;any&lt;/strong&gt; frame of reference&amp;rdquo;. That is, if you shine a torch forward, the light is travelling away from you at 300,000km/s. If you keep the torch on and hop into a speeding car, the light is &lt;em&gt;still&lt;/em&gt; travelling away from you at 300,000km/s. If you turn around and point the torch out the rear window, the light is travelling away from you at 300,000km/s&amp;hellip; and towards someone else, &lt;em&gt;still&lt;/em&gt; at 300,000km/s. So &lt;em&gt;what&amp;rsquo;s happened to the speed of your car??&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Okay, so the speed of light is weird. But the &lt;strong&gt;weirdest&lt;/strong&gt; part is what happens when you look at what that means. Let&amp;rsquo;s go back to my earlier question &amp;ndash; &lt;em&gt;what is speed&lt;/em&gt;? In one way, this is easy: speed is simply the distance travelled over a certain duration. But take a closer look at what those words mean: distance refers to space; duration refers to time. So, speed is the rate of movement through spacetime. Fine, semantics, whatever.&lt;/p&gt;
&lt;p&gt;But these semantics matter. Because what we&amp;rsquo;re seeing here isn&amp;rsquo;t just &lt;em&gt;light&lt;/em&gt; being weird: now we&amp;rsquo;re actually seeing &lt;strong&gt;space and time&lt;/strong&gt; moving weirdly - dancing around themselves in a big conspiracy to force the speed of light to be 300,000km/s, no matter what your frame of reference is.&lt;/p&gt;
&lt;p&gt;It&amp;rsquo;s time to wrap up this episode - mostly because I&amp;rsquo;ve reached the limits of my knowledge. Earlier in this article, I asked &amp;ldquo;what&amp;rsquo;s happened to the speed of your car&amp;rdquo; and, frankly, I have no idea. When it comes to the warping of spacetime I get really confused. If you&amp;rsquo;re travelling in a train at 200,000km/s, and point a powerful laser in the direction of travel, that laser&amp;rsquo;s light is going 300,000km/s relative to you. But &amp;hellip; then we get silly business, like Lorentz contraction squishing the length in the direction of travel, time dilation starts messing with things, and we get space bending. So to the outside observer, the laser is going &amp;hellip; 300,000km/s. ¯\_(ツ)_/¯&lt;/p&gt;

 &lt;blockquote&gt;
 &lt;p&gt;&amp;ldquo;People assume that time is a strict progression of cause to effect, but actually — from a non-linear, non-subjective viewpoint — it&amp;rsquo;s more like a big ball of wibbly-wobbly&amp;hellip; timey-wimey&amp;hellip; stuff.&amp;rdquo;&lt;/p&gt;
&lt;p&gt;&amp;ndash; The Tenth Doctor, Doctor Who, &amp;ldquo;Blink&amp;rdquo;&lt;/p&gt;

 &lt;/blockquote&gt;</description></item><item><title>The tension between classical and relativistic mechanics</title><link>https://www.ericlight.com/post/mechanical_tension.html</link><pubDate>Thu, 09 Jan 2020 00:00:00 +1300</pubDate><guid>https://www.ericlight.com/post/mechanical_tension.html</guid><description>&lt;p&gt;When I was considering writing my post on time dilation, I expected precisely zero feedback&amp;hellip; just on the basis that nobody would read it. I&amp;rsquo;m really pleased with the feedback I actually got, and you&amp;rsquo;ve all spurred me to write another post on the topic. So today, I&amp;rsquo;m going to give you a brief glimpse into what caused all this ruckus: Einstein&amp;rsquo;s general theory of relativity.&lt;/p&gt;
&lt;p&gt;If you remember, Einstein first came up with the special theory of relativity in 1905, and it took another ten years to get to the general theory of relativity. This alone should show you that the jump from the special theory to the general theory was a major leap - but let&amp;rsquo;s step back and see what this is all about.&lt;/p&gt;
&lt;p&gt;Our very good childhood friend, Isaac Newton, published his &lt;em&gt;Prinicpia&lt;/em&gt; in &lt;strong&gt;SIXTEEN EIGHTY SEVEN&lt;/strong&gt;, which is&amp;hellip; like&amp;hellip; aaaaages ago. With this, he laid the foundation of &amp;ldquo;classical mechanics&amp;rdquo;, which are the physical concepts and mathematical methods that describe the motion of objects under a variety of forces.&lt;/p&gt;
&lt;p&gt;Classical mechanics worked well - &lt;em&gt;really&lt;/em&gt; well. There were tweaks here and there there over the &lt;del&gt;&lt;em&gt;centuries&lt;/em&gt;&lt;/del&gt;, but overall, classical (or &amp;ldquo;Newtonian&amp;rdquo;) physics had things pretty much nailed&amp;hellip; That is, until we started thinking about things that were really heavy, really small, or really fast&amp;hellip; at that point, classical mechanics started to fray at the edges.&lt;/p&gt;
&lt;p&gt;One of the earliest recognised failures of classical mechanics was the &amp;ldquo;precession of the perihelion of Mercury&amp;rdquo;. Don&amp;rsquo;t worry what those words mean; basically, Mercury&amp;rsquo;s orbit didn&amp;rsquo;t behave quite the way that classical mechanics said it should. The effect is suuuuper tiny: classical mechanics says that Mercury&amp;rsquo;s orbit should change by 5557 arcseconds per century, but in reality it changes by 5600 arcseconds per century&amp;hellip; a difference of 43 arcseconds.&lt;/p&gt;
&lt;p&gt;How big is 43 arcseconds? It&amp;rsquo;s about two-thirds of one degree. If you stand on a flat field and imagine a soccer ball on the ground, a kilometer away, the angle drawn from the ground under your feet to the top of that soccer ball is bigger than the 43 arcsecond discrepancy.&lt;/p&gt;
&lt;p&gt;&amp;hellip; I&amp;rsquo;m gonna say that again in case you missed it: that was &lt;strong&gt;per century&lt;/strong&gt;. Less than a kilometre-away-soccer-ball every hundred years. Yikes.&lt;/p&gt;
&lt;p&gt;Where did this discrepancy come from? It all started from a very fair assumpiton of Isaac Newton&amp;rsquo;s: he perched his calculations on the basis that things were consistent. Well, the universe Does Not Roll That Way™. Space warps; time stretches; light falls into gravity wells. But because these effects aren&amp;rsquo;t really visible in our day-to-day life, it took almost two hundred years - and the genius of Einstein - before classical mechanics was overturned by the general theory of relativity in 1915.&lt;/p&gt;
&lt;p&gt;Okay this has become a little long and rambling now, so I&amp;rsquo;m going to take a break and come back to the topic next week! :)&lt;/p&gt;</description></item><item><title>Zentyal 6.0 to 6.1 upgrade getting stuck</title><link>https://www.ericlight.com/post/zentyal_dns.html</link><pubDate>Tue, 17 Dec 2019 00:00:00 +1300</pubDate><guid>https://www.ericlight.com/post/zentyal_dns.html</guid><description>&lt;p&gt;So I faced a little challenge with a &lt;a class="link" href="https://www.zentyal.com" target="_blank" rel="noopener"
 &gt;Zentyal&lt;/a&gt; server the other day. I was upgrading from ye olde 6.0 to 6.1, when everything just stopped. I let it sit in the corner for about an hour or so, but it never picked up the thread. All the services were still live, so I logged in to have a look.&lt;/p&gt;
&lt;p&gt;(Note, my DNS server is named RIMU; yours may be something else!)&lt;/p&gt;
&lt;p&gt;Running &lt;code&gt;ps aux&lt;/code&gt;, I discovered this line:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;:::bash
sh -c /usr/bin/sudo -p sudo: /var/lib/zentyal/tmp/x2M7gkZVvm.cmd 2&amp;gt; /var/lib/zentyal/tmp/stderr
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;So, I had a quick look at the contents of that stderr file:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;:::bash
# cat /var/lib/zentyal/tmp/stderr 
Password has expired
dns-RIMU@ad.ericlight.com's Password: 
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;And what does that temp .cmd file contain?&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;:::bash
# cat /var/lib/zentyal/tmp/x2M7gkZVvm.cmd 
kinit -k -t /var/lib/samba/private/dns.keytab dns-RIMU
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Running that kinit command indeed prompts for a password reset, but the interesting thing is that samba-tool shows me this password shouldn&amp;rsquo;t expire:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;:::bash
# pdbedit -u dns-RIMU -v | grep change
Password can change: Wed, 31 Oct 2018 21:47:30 NZDT
Password must change: never
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&amp;hellip; &lt;em&gt;riiiiiiight&lt;/em&gt;, that&amp;rsquo;s a bit interesting. And yet I&amp;rsquo;m still being prompted to set a new password. I used samba-tool to remind samba that this password shouldn&amp;rsquo;t expire:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;:::bash
# samba-tool user setexpiry dns-RIMU --noexpiry
Expiry for user 'dns-RIMU' disabled.
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;And now&amp;hellip;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;:::bash
# pdbedit -u dns-RIMU -v | grep -i change
Password can change: Wed, 31 Oct 2018 21:47:30 NZDT
Password must change: Tue, 19 Jan 2038 16:14:07 NZDT
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Now I can run kinit against dns-RIMU perfectly fine, and indeed the Zentyal upgrade succeeded!&lt;/p&gt;</description></item><item><title>StarCraft Remastered broken under Wine</title><link>https://www.ericlight.com/post/starcraftwine.html</link><pubDate>Mon, 09 Dec 2019 00:00:00 +1300</pubDate><guid>https://www.ericlight.com/post/starcraftwine.html</guid><description>&lt;p&gt;I know this post is only going to be relevant for a couple of weeks, but today I tried to launch StarCraft Remastered under WINE and it crashed.&lt;/p&gt;
&lt;p&gt;Pertinent info:
StarCraft Version 1.23.2.6926
WINE version 4.20-staging
Battle.Net version 1.18.0.11698&lt;/p&gt;
&lt;p&gt;Fix was to open the Battle.Net settings -&amp;gt; Game Settings -&amp;gt; &amp;ldquo;Launch 32-bit client (instead of 64-bit)&amp;rdquo;&lt;/p&gt;
&lt;p&gt;Apparently the 64-bit version has become the default sometime since I last played it (October?!): &lt;a class="link" href="https://us.forums.blizzard.com/en/starcraft/t/enabling-64-bit/458/7" target="_blank" rel="noopener"
 &gt;https://us.forums.blizzard.com/en/starcraft/t/enabling-64-bit/458/7&lt;/a&gt;&lt;/p&gt;</description></item><item><title>Spacetime, and Time Dilation</title><link>https://www.ericlight.com/post/spacetime.html</link><pubDate>Sun, 10 Nov 2019 00:00:00 +1300</pubDate><guid>https://www.ericlight.com/post/spacetime.html</guid><description>&lt;p&gt;I remember reading Stephen Hawking&amp;rsquo;s &lt;em&gt;A Brief History of Time&lt;/em&gt; back when I was about 16 years old - a bit over 20 years ago. I didn&amp;rsquo;t even come close to understanding it then. I re-read it on Audible a year ago and I can report that I still didn&amp;rsquo;t understand it at all. Either way, I&amp;rsquo;ve been interested in physics and spacetime for a huge chunk of my life, and I wish I&amp;rsquo;d spent more time on mathematics when I was younger, because I&amp;rsquo;d have really loved to be a theoretical physicist. I shit you not. The universe just seems to be more predictable than computers.&lt;/p&gt;
&lt;p&gt;Einstein published the special theory of relativity in 1905, and it took him another ten years to bring this into the general theory of relativity (which incorporated gravity) in 1915. The special theory is only &amp;ldquo;special&amp;rdquo; in the sense that it assumes a flat spacetime; it was the &lt;strong&gt;general&lt;/strong&gt; theory which extended relativity to allow for the curvature of spacetime - for example, the curvature caused by massive objects.&lt;/p&gt;
&lt;p&gt;Today I&amp;rsquo;m going to share my understanding of time dilation, based on what I&amp;rsquo;ve learned from Dr Brian Greene, Dr Michio Kaku, and my favourite astrophysicist Marcus Chown. I&amp;rsquo;ll start with a disclaimer: I don&amp;rsquo;t understand any of the calculations behind any of this. I&amp;rsquo;m familiar with some of the &lt;em&gt;words&lt;/em&gt;, and I have a vague grasp of some of the concepts, but I&amp;rsquo;m mostly limited to regurgitating things I&amp;rsquo;ve read and then swearing loudly to distract people from asking questions.&lt;/p&gt;
&lt;p&gt;I&amp;rsquo;m also quite conscious that this is around step three in the age-old progression:&lt;/p&gt;

 &lt;blockquote&gt;
 &lt;p&gt;&lt;em&gt;Primary school&lt;/em&gt;: &amp;ldquo;This is how the weather works.&amp;rdquo;&lt;br&gt;
&lt;em&gt;High school&lt;/em&gt;: &amp;ldquo;That wasn&amp;rsquo;t quite right - &lt;em&gt;this&lt;/em&gt; is how the weather works.&amp;rdquo;&lt;br&gt;
&lt;em&gt;Undergrad&lt;/em&gt;: &amp;ldquo;That wasn&amp;rsquo;t quite right - &lt;em&gt;this&lt;/em&gt; is how the weather works.&amp;rdquo;&lt;br&gt;
&lt;em&gt;Postgrad&lt;/em&gt;: &amp;ldquo;That wasn&amp;rsquo;t quite right - &lt;em&gt;this&lt;/em&gt; is how the weather works.&amp;rdquo;&lt;br&gt;
&lt;em&gt;Doctorate&lt;/em&gt;: &amp;ldquo;Nobody knows how the weather works.&amp;rdquo;&lt;/p&gt;

 &lt;/blockquote&gt;
&lt;p&gt;&amp;hellip; Nevertheless, the actual concept is pretty simply stated, once we get everything laid out. In brief, time dilation is when time appears to slow down for an object, when that object is moving very quickly. There are three important parts to that:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;the slowing of time;&lt;/li&gt;
&lt;li&gt;the fact that it looks &lt;em&gt;to you&lt;/em&gt; as if time has slowed &lt;em&gt;for the object&lt;/em&gt;;&lt;/li&gt;
&lt;li&gt;the object travelling quickly &lt;em&gt;relative to you&lt;/em&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;That means, if your twin travels (around Europe, say) at the speed of light for &amp;ldquo;ten years&amp;rdquo; (your time), &lt;strong&gt;you&lt;/strong&gt; will age ten years, but they will hardly age at all.&lt;/p&gt;
&lt;p&gt;That&amp;rsquo;s pretty weird - why does that happen? We can understand where time dilation comes from by remembering a few things:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;We all know that the universe&amp;rsquo;s speed limit is the speed of light, &lt;em&gt;c&lt;/em&gt;.&lt;/li&gt;
&lt;li&gt;We&amp;rsquo;re all familiar with the three dimensions of motion.&lt;/li&gt;
&lt;li&gt;We&amp;rsquo;ve probably heard someone say &amp;ldquo;time is the fourth dimension&amp;rdquo; (aka &amp;ldquo;Minkowski spacetime&amp;rdquo;).&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Here&amp;rsquo;s the thing about speed limits: they apply whether you&amp;rsquo;re moving in a straight line, or if you&amp;rsquo;re moving on an angle. Imagine a box, a hundred kilometers square. If you travel a hundred kilometers from left-to-right, you will start at one edge of the box, and finish at the other. But if you start at the top-left corner of the box, and travel towards the bottom-right corner of the box, &lt;em&gt;and still travel a hundred kilometers&lt;/em&gt;, you will end up only about 70% of the way to your destination&amp;hellip; because some of your motion has been &amp;lsquo;used up&amp;rsquo; travelling in the up/down direction, instead of just the left/right direction.&lt;/p&gt;
&lt;p&gt;Now, here&amp;rsquo;s the thing: you&amp;rsquo;re &lt;strong&gt;always&lt;/strong&gt; travelling at &lt;em&gt;c&lt;/em&gt;. It&amp;rsquo;s just that mostly you&amp;rsquo;re travelling through &lt;u&gt;&lt;em&gt;time&lt;/em&gt;&lt;/u&gt; at the speed of light. Any movement in the other three dimensions will &amp;lsquo;use up&amp;rsquo; your speed through the time dimension (because your total speed can&amp;rsquo;t be faster than &lt;em&gt;c&lt;/em&gt;). Quick examples:&lt;/p&gt;
&lt;p&gt;You, sitting here now reading this:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;Speed in x dimension: 0km per second
Speed in t dimension: 299,793km per second
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;You, 20 years from now, travelling away from Earth at a currently-safe velocity of 3G&amp;rsquo;s (29.42 meters per second):&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;Speed in x dimension: 0.02942km per second
Speed in t dimension: 299,792.97058km per second
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;You, 200 years from now, travelling away from Aldeberan at a somehow-safe-by-then velocity of 300G (2942 meters per second):&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;Speed in x dimension: 29.42km per second
Speed in t dimension: 299,763.58km per second
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;You, never, travelling away from the milky way at 95% of the speed of light:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;Speed in x dimension: 284,803km per second
Speed in t dimension: 14,989km per second
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;So, as you get faster in one dimension, you necessarily &lt;em&gt;must&lt;/em&gt; move more slowly through time! Time dilation comes down to that, plus the hard-to-grasp concept that you&amp;rsquo;re only either accelerating &lt;em&gt;or&lt;/em&gt; stationary in your own frame of reference&amp;hellip; but that&amp;rsquo;s a story for another day.&lt;/p&gt;
&lt;p&gt;That pretty much exhausts everything I know about time dilation&amp;hellip; I hope you enjoyed reading it. Huge thanks to Ellie for finding me a friendly physicist to check over this for me!&lt;/p&gt;
&lt;p&gt;In case you&amp;rsquo;re looking for some good books on the science of the very fast, the very big, the very heavy, and the very small&amp;hellip; Here are some books that I really enjoyed reading:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Brian Greene - The Elegant Universe&lt;/li&gt;
&lt;li&gt;Marcus Chown - Quantum Theory Cannot Hurt You&lt;/li&gt;
&lt;li&gt;Michio Kaku - Einstein&amp;rsquo;s Cosmos&lt;/li&gt;
&lt;/ul&gt;</description></item><item><title>Inside the Check Point 1180</title><link>https://www.ericlight.com/post/cp1180.html</link><pubDate>Sun, 28 Apr 2019 00:00:00 +1200</pubDate><guid>https://www.ericlight.com/post/cp1180.html</guid><description>&lt;p&gt;I&amp;rsquo;ve got a spare Check Point 1180 here, and I&amp;rsquo;m fiddling around with it a bit. Learnings so far:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Platform: ARM&lt;/li&gt;
&lt;li&gt;CPU / RAM: &lt;a class="link" href="https://community.checkpoint.com/t5/General-Topics/I-have-a-Check-Point-model-L-50-serial-number-1310436119900-and/td-p/32165" target="_blank" rel="noopener"
 &gt;ARM926EJ-S&lt;/a&gt;, 512MB RAM&lt;/li&gt;
&lt;li&gt;System board: Marvell RD-88f6281A LE&lt;/li&gt;
&lt;/ul&gt;</description></item><item><title>When a docking station wrecks your breakfast</title><link>https://www.ericlight.com/post/dell_wd15.html</link><pubDate>Sat, 23 Feb 2019 00:00:00 +1300</pubDate><guid>https://www.ericlight.com/post/dell_wd15.html</guid><description>&lt;img src="https://www.ericlight.com/post/dell_wd15/wd15.png" alt="Featured image of post When a docking station wrecks your breakfast" /&gt;&lt;p&gt;It&amp;rsquo;s been a while since I posted, but we bumped into something completely batshit crazy at work that I just had to share.&lt;/p&gt;
&lt;p&gt;One of my colleagues was setting up a new computer, and was unable to RDP into the new build. He kept getting the error message &amp;ldquo;Your session ended because there was a data encryption error. If this keeps happening, ask your admin or tech support for help.&amp;rdquo;&lt;/p&gt;
&lt;p&gt;&lt;img alt="“Your session ended because there was a data encryption error.”" class="gallery-image" data-flex-basis="428px" data-flex-grow="178" height="1060" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://www.ericlight.com/post/dell_wd15/wd15.png" srcset="https://www.ericlight.com/post/dell_wd15/wd15_hu_a25d5c2ce6feaa93.png 800w, https://www.ericlight.com/post/dell_wd15/wd15_hu_7675c654172ce464.png 1600w, https://www.ericlight.com/post/dell_wd15/wd15.png 1892w" width="1892"&gt;&lt;/p&gt;
&lt;p&gt;We&amp;rsquo;d never experienced this error before, and - although the internet knew about it - there were not very many helpful hits on Google. In fact, all of the reports we found were the result of a bug in Windows 7, and we were only using Windows 10.&lt;/p&gt;
&lt;p&gt;In the end, completely weirdly, my colleague tried a different docking station, and it &lt;em&gt;worked&lt;/em&gt;! This is absolutely the weirdest thing I&amp;rsquo;ve ever seen. Both the working and failing docking station had the most recent firmware applied, and they were both flashed from the same image, so it&amp;rsquo;s not a corrupted download or anything.&lt;/p&gt;
&lt;p&gt;Metadata about this issue: Both machines were Windows 10, 1709 build, with all updates installed. The originator machine was an HP Z240 workstation, and the target machine was a Dell 7390, connected to a Dell WD15 docking station. All three items had received fresh firmware updates and all Windows Updates.&lt;/p&gt;</description></item><item><title>American Crew's Moisturising Shave Cream</title><link>https://www.ericlight.com/post/americancrew_shavecream.html</link><pubDate>Sat, 29 Dec 2018 00:00:00 +1300</pubDate><guid>https://www.ericlight.com/post/americancrew_shavecream.html</guid><description>&lt;p&gt;Yanno &lt;a class="link" href="https://www.ericlight.com/post/proraso_azurlime.html" &gt;how I said&lt;/a&gt; it&amp;rsquo;s hard to find American Crew aftershave? Well my better half went out yesterday and found a place in lil&amp;rsquo;old Te Awamutu that sells their shaving range: &lt;a class="link" href="https://www.teamseven.co.nz" target="_blank" rel="noopener"
 &gt;Team Seven&lt;/a&gt;, beside Viands. She bought me a bottle of my favourite &amp;ldquo;&lt;a class="link" href="https://shop.americancrew.com/post-shave-cooling-lotion" target="_blank" rel="noopener"
 &gt;Post-Shave Cooling Lotion&lt;/a&gt;&amp;rdquo; (oh my god that name), but also got me a tube of their &amp;ldquo;&lt;a class="link" href="https://shop.americancrew.com/moisturizing-shave-cream" target="_blank" rel="noopener"
 &gt;Moisturising Shave Cream&lt;/a&gt;&amp;rdquo; to try. For shiggles.&lt;/p&gt;
&lt;p&gt;Clearly, American Crew are better at chemical formulation than they are at coming up with names. But I digress.&lt;/p&gt;
&lt;p&gt;Whelp I whipped out my trusty DE89, popped in a fresh Derby Extra blade, soaked my shaving brush and gave it a go.&lt;/p&gt;
&lt;p&gt;Firstly - no. This is absolutely not made for a shaving brush. It&amp;rsquo;s hand-application all the way. It&amp;rsquo;s also not really a foam like what I&amp;rsquo;m used to - it&amp;rsquo;s very much a cream style, and it&amp;rsquo;s quite stubborn about remaining a cream, thankyouverymuch. In contrast, my &lt;a class="link" href="https://fineshave.co.nz/products/proraso-sensitive-green-tea-and-oat-shaving-cream-t" target="_blank" rel="noopener"
 &gt;Proraso&lt;/a&gt; or &lt;a class="link" href="https://fineshave.co.nz/products/taylor-of-old-bond-street-shave-cream-sandalwood" target="_blank" rel="noopener"
 &gt;TOBS&lt;/a&gt; creams froth up quite heartily when I whip them with a brush, but this really resisted that.&lt;/p&gt;
&lt;p&gt;Okay so, without making it frothy, it definitely takes more product to shave. I&amp;rsquo;m going to say double, but it might even be more. At about $32 a tube, that is definitely verging out of my price range. 2/10 on price for this.&lt;/p&gt;
&lt;p&gt;The feeling, however, was really divine. There&amp;rsquo;s not a whole lot of scent, but there&amp;rsquo;s significant menthol action going on here, and it really gave me a refreshing zing that dwindled on my face through the shave and rinse. Delight rating 7/10.&lt;/p&gt;
&lt;p&gt;Efficacy - this is hard for me to judge, since I was using a brush and thus really didn&amp;rsquo;t have enough on there for my second pass. So I kinda mucked up my shave, but it was much more my fault than the cream&amp;rsquo;s. Aside from that it left a beautiful coating of light avocado oil and aloe on my skin, meaning even though I under-catered on the product, I didn&amp;rsquo;t entirely munge up my face. For this, I&amp;rsquo;m giving it a decent 7/10 on efficacy. (See update below, though)&lt;/p&gt;
&lt;p&gt;These ratings seem kinda low, but honestly this is going to be my favourite shave cream through the summer, with that nice refreshing menthol coolness. However with the price and sheer quantity needed for a good shave, I expect I&amp;rsquo;ll gravitate back to my Proraso creams once this is gone.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Update 2018-12-31:&lt;/strong&gt; I&amp;rsquo;ve had another shave today without the brush, and just applying the cream directly to my skin. Definitely a better result, but once again I under-catered on the second pass and got myself some irritation happening. It&amp;rsquo;s certainly going to be at least double what I previously used. However once again my face feels actually quite good, and geez the menthol is nice.&lt;/p&gt;
&lt;p&gt;Since I&amp;rsquo;ve under-catered twice now, and both times I&amp;rsquo;ve actually still had a decent shave, I think I need to upgrade this to 8/10 efficacy.&lt;/p&gt;</description></item><item><title>Proraso Azur Lime aftershave balm</title><link>https://www.ericlight.com/post/proraso_azurlime.html</link><pubDate>Fri, 28 Dec 2018 00:00:00 +1300</pubDate><guid>https://www.ericlight.com/post/proraso_azurlime.html</guid><description>&lt;p&gt;Gather around, children, and I&amp;rsquo;ll regale you with a tale of tonight&amp;rsquo;s shaving.&lt;/p&gt;
&lt;p&gt;My go-to razor setup at the moment is my &lt;a class="link" href="https://fineshave.co.nz/products/edwin-jagger-de89-safety-razor-with-barley-handle" target="_blank" rel="noopener"
 &gt;Edwin Jagger DE89&lt;/a&gt;, with &lt;a class="link" href="https://fineshave.co.nz/products/blades-50x-derby-de-razor-blades" target="_blank" rel="noopener"
 &gt;Derby Extra&lt;/a&gt; blades. But that&amp;rsquo;s not new.&lt;/p&gt;
&lt;p&gt;You might remember that my favourite aftershave is American Crew&amp;rsquo;s &amp;ldquo;&lt;a class="link" href="https://shop.americancrew.com/post-shave-cooling-lotion" target="_blank" rel="noopener"
 &gt;Post Shave Cooling Lotion&lt;/a&gt;&amp;rdquo;. I&amp;rsquo;ve been using this almost exclusively for about 5 years now, and I love it. It&amp;rsquo;s wonderfully soothing, and it&amp;rsquo;s a fairly thin balm so it&amp;rsquo;s easy to avoid overly-thick application. It&amp;rsquo;s also not as thin as a milk (such as &amp;ldquo;&lt;a class="link" href="https://www.thegr.com/shop-2/after-shave-balm/the-standard-after-shave-balm-all-natural-and-organic/" target="_blank" rel="noopener"
 &gt;The Standard&lt;/a&gt;&amp;rdquo;, by The Gentlemen&amp;rsquo;s Refinery), which has a tendency to run through your fingers on the way to your face, not entirely unlike&amp;hellip; milk.&lt;/p&gt;
&lt;p&gt;Unfortunately American Crew&amp;rsquo;s aftershave can be really difficult to find. So I popped a question to the team at &lt;a class="link" href="https://fineshave.co.nz" target="_blank" rel="noopener"
 &gt;FineShave&lt;/a&gt;, and Frank gave me some insight into what he uses. This spurred me to try the &lt;a class="link" href="https://fineshave.co.nz/collections/aftershave/proraso" target="_blank" rel="noopener"
 &gt;Proraso Aftershave line&lt;/a&gt;, and today I took delivery of a bottle of &lt;a class="link" href="https://fineshave.co.nz/collections/aftershave/products/proraso-after-shave-balm-azur-lime-100ml" target="_blank" rel="noopener"
 &gt;Azur Lime&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;This is a really, really nice aftershave. Again, it&amp;rsquo;s a balm (I don&amp;rsquo;t have any splash-type aftershaves yet). It&amp;rsquo;s a little thicker than the American Crew that I&amp;rsquo;m used to, but still not thick.&lt;/p&gt;
&lt;p&gt;WOW does it cover a lot of distance. I used three, maybe four drops worth and it covered my whole face. This 100ml bottle is going to last forever, but it&amp;rsquo;s still a bit pricey at $35, which makes me give it a 6/10 on the price scale.&lt;/p&gt;
&lt;p&gt;It&amp;rsquo;s a light citrusy scent, with a little bit of mint, and a slightly musky underbelly. It smells nice, but the scent wears off fairly quickly, so probably a 7/10 for scent.&lt;/p&gt;
&lt;p&gt;I also happened to give myself a spectacularly awful shave, which this aftershave has completely addressed - no discomfort or &amp;lsquo;hot areas&amp;rsquo;, and only a little redness in the mirror. I think that&amp;rsquo;s a 10/10 for effectiveness.&lt;/p&gt;
&lt;p&gt;All in all, this is a serious contender for my new favourite, and I expect I&amp;rsquo;ll buy another bottle when it&amp;rsquo;s done! Recommended.&lt;/p&gt;</description></item><item><title>New things I didn't know about WireGuard</title><link>https://www.ericlight.com/post/wg3.html</link><pubDate>Thu, 27 Dec 2018 00:00:00 +1300</pubDate><guid>https://www.ericlight.com/post/wg3.html</guid><description>&lt;p&gt;This is part of my &lt;a class="link" href="https://www.ericlight.com/post/wg0.html" &gt;brief&lt;/a&gt; &lt;a class="link" href="https://www.ericlight.com/post/wg1.html" &gt;series&lt;/a&gt; &lt;a class="link" href="https://www.ericlight.com/post/wg2.html" &gt;on&lt;/a&gt; &lt;a class="link" href="https://wireguard.com/" target="_blank" rel="noopener"
 &gt;WireGuard&lt;/a&gt;. I&amp;rsquo;m pretty enamoured with WireGuard and the way it works, and I&amp;rsquo;ve been using it pretty seamlessly for over a year now. I&amp;rsquo;ve learned a couple things that weren&amp;rsquo;t immediately obvious though, so I&amp;rsquo;m documenting them here.&lt;/p&gt;
&lt;h2 id="easy-provisioning"&gt;Easy Provisioning
&lt;/h2&gt;&lt;p&gt;Samuel Holland mentioned an interesting trinket, in his post at &lt;a class="link" href="https://lists.zx2c4.com/pipermail/WireGuard/2018-December/003703.html" target="_blank" rel="noopener"
 &gt;https://lists.zx2c4.com/pipermail/WireGuard/2018-December/003703.html&lt;/a&gt;:&lt;/p&gt;
&lt;p&gt;&lt;em&gt;&amp;quot;[&amp;hellip;] WireGuard will ignore a peer whose public key matches the interface&amp;rsquo;s private key. So you can distribute a single list of peers everywhere.&amp;quot;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;You can combine this with &lt;code&gt;wg addconf&lt;/code&gt; like this:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Each peer has its own &lt;code&gt;/etc/WireGuard/wg0.conf&lt;/code&gt; file, which only contains it&amp;rsquo;s &lt;code&gt;[Interface]&lt;/code&gt; section&lt;/li&gt;
&lt;li&gt;Each peer also has a shared &lt;code&gt;/etc/WireGuard/peers.conf&lt;/code&gt; file, which contains all the peers&lt;/li&gt;
&lt;li&gt;The &lt;code&gt;wg0.conf&lt;/code&gt; file also has a PostUp hook, calling &lt;code&gt;wg addconf /etc/WireGuard/peers.conf&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;It&amp;rsquo;s up to you to decide how you want to share the peers.conf, be it via a proper orchestration platform, something much more pedestrian like Dropbox, or something kinda wild like Ceph. I dunno, but it&amp;rsquo;s pretty great that you can just wildly fling a peer section around, without worrying whether it&amp;rsquo;s the same as the interface.&lt;/p&gt;
&lt;h2 id="setting-private-key-from-a-file"&gt;Setting Private Key from a file
&lt;/h2&gt;&lt;p&gt;Another piece of learning, courtesy of Samuel Holland, at &lt;a class="link" href="https://lists.zx2c4.com/pipermail/WireGuard/2018-December/003702.html" target="_blank" rel="noopener"
 &gt;https://lists.zx2c4.com/pipermail/WireGuard/2018-December/003702.html&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;You can read in a file as the Private Key by doing something like:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;PostUp = wg set %i private-key /etc/WireGuard/wg0.key&lt;/code&gt;&lt;/p&gt;</description></item><item><title>Tomato Soup</title><link>https://www.ericlight.com/post/tomato_soup.html</link><pubDate>Mon, 07 May 2018 00:00:00 +1200</pubDate><guid>https://www.ericlight.com/post/tomato_soup.html</guid><description>&lt;p&gt;I came home tonight to discover my wife had made probably the most amazing tomato soup I&amp;rsquo;ve ever tasted. She performed this feat with about ten minutes of effort (plus about an hour of simmering), so I decided I needed to note it down.&lt;/p&gt;
&lt;h1 id="ingredients"&gt;Ingredients
&lt;/h1&gt;&lt;ul&gt;
&lt;li&gt;1 Tbsp oil&lt;/li&gt;
&lt;li&gt;1 medium onion, sliced&lt;/li&gt;
&lt;li&gt;1/2 head of garlic, peeled and chopped&lt;/li&gt;
&lt;li&gt;About 4 slices of bacon, diced&lt;/li&gt;
&lt;li&gt;3 cans of chopped tomatoes&lt;/li&gt;
&lt;li&gt;2 tsp of vegetable stock powder&lt;/li&gt;
&lt;li&gt;2 tsp of sugar&lt;/li&gt;
&lt;li&gt;1 cup of water&lt;/li&gt;
&lt;li&gt;Cream&lt;/li&gt;
&lt;li&gt;Parsley for garnish&lt;/li&gt;
&lt;/ul&gt;
&lt;h1 id="method"&gt;Method
&lt;/h1&gt;&lt;ol&gt;
&lt;li&gt;Get yourself a piping-hot frying pan&lt;/li&gt;
&lt;li&gt;Add the oil and the onion; fry until transluscent&lt;/li&gt;
&lt;li&gt;Add the garlic and the bacon; fry until bacon starts to brown&lt;/li&gt;
&lt;li&gt;Add chopped tomatoes, veggie stock, and water; stir&lt;/li&gt;
&lt;li&gt;Simmer for at least 45 minutes; preferrably longer&lt;/li&gt;
&lt;li&gt;Serve with a dollop of cream, and garnish with parsley&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;That&amp;rsquo;s it! It&amp;rsquo;s hands-down delicious.&lt;/p&gt;</description></item><item><title>When AppArmor eats your breakfast</title><link>https://www.ericlight.com/post/zentyal-apparmor.html</link><pubDate>Mon, 19 Mar 2018 00:00:00 +1300</pubDate><guid>https://www.ericlight.com/post/zentyal-apparmor.html</guid><description>&lt;p&gt;I&amp;rsquo;ve knocked heads with AppArmor a few times now. To be quite honest with myself, I think it&amp;rsquo;s primarily because I install it, enable all the plugins, and then forget it&amp;rsquo;s there until there&amp;rsquo;s a problem.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;TL;DR:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;On a fully-updated Zentyal 5.0 system running DHCP, the AppArmor profile in /etc/apparmor.d/usr.sbin.dhcpd &lt;strong&gt;will prevent isc-dhcp-server from restarting itself after an upgrade&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;More search-type words: Zentyal dhcp server doesn&amp;rsquo;t start again after upgrade. isc-dhcp-server graceful shutdown, but no restart.&lt;/p&gt;
&lt;p&gt;This frustration-laden, Google-friendly equivalent of speaking slowly and clearly should illustrate how impossible it was for me to find guidance on this.&lt;/p&gt;
&lt;p&gt;To fix:&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;# aa-complain /etc/apparmor.d/usr.sbin.dhcpd 
&lt;/code&gt;&lt;/pre&gt;&lt;hr&gt;
&lt;p&gt;Okay, now that the TL;DR is finished, here&amp;rsquo;s the rest of the story:&lt;/p&gt;
&lt;p&gt;Unfortunately there&amp;rsquo;s &lt;strong&gt;always&lt;/strong&gt; a problem with AppArmor eventually.&lt;/p&gt;
&lt;p&gt;Even worse, &lt;em&gt;the problem is often silent&lt;/em&gt;. I&amp;rsquo;ll just find that, for example, NONE of my man pages work. Or logrotate will fail. For example, here&amp;rsquo;s what happens when you enable aa-enforce mode on your friendly resident user manual:&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt; $ man
 What manual page do you want?
 $ sudo aa-enforce /etc/apparmor.d/usr.bin.man
 Setting /etc/apparmor.d/usr.bin.man to enforce mode.
 $ man
 $man: can&amp;#39;t open the manpath configuration file /etc/manpath.config
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;If I hadn&amp;rsquo;t enabled &lt;code&gt;aa-enforce&lt;/code&gt; immediately before that, what would &lt;em&gt;you&lt;/em&gt; have done? You would have gone ahead, made sure that manpath.config existed, made sure it wasn&amp;rsquo;t corrupted, maybe tried running &lt;code&gt;man&lt;/code&gt; as root&amp;hellip; maybe even copied a manpath.config file from a known-working computer. But, hidden within &lt;code&gt;dmesg&lt;/code&gt; is our old friend:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;[149929.763064] type=1400 audit(1521449052.257:111): apparmor=&amp;quot;DENIED&amp;quot; operation=&amp;quot;open&amp;quot; profile=&amp;quot;/usr/bin/man&amp;quot; name=&amp;quot;/etc/manpath.config&amp;quot; pid=22633 comm=&amp;quot;man&amp;quot; requested_mask=&amp;quot;r&amp;quot; denied_mask=&amp;quot;r&amp;quot; fsuid=1000 ouid=0&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;And that example is actually better than it used to be - quite a few times in the past four years, I&amp;rsquo;ve received this:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;$ man
$
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&amp;hellip; from a fully-updated Debian system.&lt;/p&gt;
&lt;p&gt;&lt;br/&gt;&lt;br/&gt;
&lt;em&gt;This makes me sad.&lt;/em&gt;
&lt;br/&gt;&lt;br/&gt;&lt;/p&gt;
&lt;p&gt;Or, in one particular case, &lt;em&gt;ISC-DHCP-SERVER&lt;/em&gt; of all things will launch perfectly well, but will fail to restart after a package update, and the first thing I&amp;rsquo;ll notice is &amp;ldquo;o hai all the things is broken halp plz&amp;rdquo;. Something like that.&lt;/p&gt;
&lt;p&gt;When you&amp;rsquo;re troubleshooting DHCP, you&amp;rsquo;ll probably check systemctl, leases table, maybe /var/log &amp;hellip; But when you get around to checking &lt;code&gt;dmesg&lt;/code&gt;, you may notice the root of the problem:&lt;/p&gt;
&lt;p&gt;From dmesg -T:&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;[Sat Mar 17 03:44:28 2016] audit_printk_skb: 18 callbacks suppressed
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Considering the update occurred at 03:44am, this is probably our problem. I can&amp;rsquo;t see &lt;em&gt;for sure&lt;/em&gt;, but I&amp;rsquo;m pretty certain those 18 suppressed callbacks are filled with &amp;ldquo;DENIED&amp;rdquo; log lines.&lt;/p&gt;
&lt;p&gt;The fix is simple:&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;# aa-complain /etc/apparmor.d/usr.sbin.dhcpd 
Setting /etc/apparmor.d/usr.sbin.dhcpd to complain mode.
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;And your isc-dhcp-server should now restart gracefully after it&amp;rsquo;s scheduled upgrades!&lt;/p&gt;</description></item><item><title>Installing PowerChute Network Shutdown on ProxmoxVE</title><link>https://www.ericlight.com/post/pcns_proxmox.html</link><pubDate>Tue, 27 Feb 2018 00:00:00 +1300</pubDate><guid>https://www.ericlight.com/post/pcns_proxmox.html</guid><description>&lt;p&gt;This is going to be one of those posts where I just dump stuff. Power failures are shite, and if your server isn&amp;rsquo;t talking with your UPS, it won&amp;rsquo;t shut down gracefully. This is the story of my trying to get APC&amp;rsquo;s PowerChute Network Shutdown working on a ProxmoxVE 5.1 environment.&lt;/p&gt;
&lt;p&gt;Note I opted out of using either nut or apcupsd, because I had a nice fancy Network Management Card (NMC2 / Schneider AP9631) available. Also, I wanted to shut down more than a single server, so a USB or Serial cable wouldn&amp;rsquo;t do the trick.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Install Java Runtime Environment: &lt;code&gt;apt install openjdk-8-jre&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Download PCNS onto your Proxmox server - &lt;a class="link" href="http://www.apc.com/shop/us/en/categories/power/uninterruptible-power-supply-ups-/ups-management/powerchute-network-shutdown/N-auzzn7" target="_blank" rel="noopener"
 &gt;http://www.apc.com/shop/us/en/categories/power/uninterruptible-power-supply-ups-/ups-management/powerchute-network-shutdown/N-auzzn7&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Extract the download: &lt;code&gt;tar -xvf pcns420Linux-x86-64.tar.gz&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;cd ./Linux_x64&lt;/li&gt;
&lt;li&gt;sudo su&lt;/li&gt;
&lt;li&gt;./install.sh&lt;/li&gt;
&lt;li&gt;When prompted for your Java location, use &lt;code&gt;/usr/lib/jvm/java-8-openjdk-amd64/jre/bin&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;I didn&amp;rsquo;t enable SMTP&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Results in:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt; root@ ~/Linux_x64# ./install.sh 
 ------------------------------------------------------------------
 PowerChute Network Shutdown 4.2.0 for Linux
 Copyright (c) 1999-2016 Schneider Electric.
 All Rights Reserved.
 ------------------------------------------------------------------

 OS=Linux

 Initializing ...

 Press any key to display End User License Agreement
 &amp;lt;--snip--&amp;gt;
 Do you agree to the above license terms? [yes or no]
 yes

 Please enter the installation directory or press enter to install to the default directory (/opt/APC/PowerChute):


 Are you sure you want to install PCNS to /opt/APC/PowerChute [Yes|No]? 
 yes
 PCNS will be installed to /opt/APC/PowerChute

 Please enter java directory if you want to use your system java (example:/usr/local/bin/jre/jre1.8.0_91) or press enter to install the bundled Java:
 /usr/lib/jvm/java-8-openjdk-amd64/jre/bin 

 Checking version of Java ...
 Detected Java Version: 1.8.0.151
 Acceptable version

 openjdk version &amp;quot;1.8.0_151&amp;quot;
 OpenJDK Runtime Environment (build 1.8.0_151-8u151-b12-1~deb9u1-b12)
 OpenJDK 64-Bit Server VM (build 25.151-b12, mixed mode)

 JAVA_DIR=/usr/lib/jvm/java-8-openjdk-amd64/jre/bin/

 Copying the installation files ...
 Extracting PCNS files ...
 PCNS is extracted to /opt/APC/PowerChute
 Configuring startup files ...
 Startup script=/etc/rc.d/init.d/PowerChute
 Updating Linux symbolic link ...
 Configure Firewall
 Configuring uninstall script ...
 Setup the m11.cfg file

 Enable SNMP Support [Yes|No]? 
 no
 SNMP Not Enabled

 PowerChute Network Shutdown, v4.2.0
 Copyright (c) 1999-2016, Schneider Electric. All Rights Reserved.
 Startup completed.


 Installation has completed.
 PowerChute Network Shutdown can be accessed through your browser at https://&amp;lt;your_server_ip_address&amp;gt;:6547
 Please complete the configuration wizard so that PowerChute Network Shutdown can protect your server.
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Once you&amp;rsquo;re finished with that, navigate to the new web portal on your server (second-to-last line in the output above), and complete the setup of your PCNS instance!&lt;/p&gt;
&lt;p&gt;When you&amp;rsquo;re configuring PCNS itself, you&amp;rsquo;ll be prompted for the User Name, Password, and Authentication Phrase for the UPS. These are the user details you use to log into your NMC.&lt;/p&gt;
&lt;p&gt;By default, the Authentication Phrase is &lt;code&gt;admin user phrase&lt;/code&gt;, but you should &lt;em&gt;totally&lt;/em&gt; change this. Assuming you&amp;rsquo;ve updated the firmware on your NMC, you can set the Authentication Phrase at &lt;code&gt;Configuration -&amp;gt; Shutdown&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Setting up your outlet groups and shutdown times are left as an exercise to the reader. :)&lt;/p&gt;</description></item><item><title>Getting rid of the &lt;url&gt;#&lt;slug&gt; format in Flex</title><link>https://www.ericlight.com/post/pelican-urls.html</link><pubDate>Fri, 12 Jan 2018 00:00:00 +1300</pubDate><guid>https://www.ericlight.com/post/pelican-urls.html</guid><description>&lt;p&gt;Back when I was getting this blog set up, I had a &lt;a class="link" href="https://www.ericlight.com/post/pelican-config.html" &gt;short whinge&lt;/a&gt; about the default way that the &lt;a class="link" href="https://github.com/alexandrevicenzi/Flex" target="_blank" rel="noopener"
 &gt;Flex theme&lt;/a&gt; created links to pages.&lt;/p&gt;
&lt;p&gt;Specficially, creating a link to &amp;ldquo;&lt;a class="link" href="https://www.ericlight.com/post/tuna-patties.html" &gt;Tuna Patties&lt;/a&gt;&amp;rdquo; (for example), Flex would append the link with an identical stub, such as &lt;a class="link" href="https://www.ericlight.com/tuna-patties.html#tuna-patties" target="_blank" rel="noopener"
 &gt;https://www.ericlight.com/tuna-patties.html#tuna-patties&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I thought this was silly, so I found a way to fix it, but never bothered submitting a Pull Request to Alexandre because I figured it was intentional.&lt;/p&gt;
&lt;p&gt;Well, it turns out I wasn&amp;rsquo;t the only one. The good &lt;a class="link" href="https://github.com/DmytroLitvinov" target="_blank" rel="noopener"
 &gt;Dmytro Litvinov&lt;/a&gt; thought the same, and he created a &lt;a class="link" href="https://github.com/alexandrevicenzi/Flex/pull/88" target="_blank" rel="noopener"
 &gt;Pull Request&lt;/a&gt; to fix it, almost a whole year ago!&lt;/p&gt;
&lt;p&gt;Now, you can avoid this behaviour by simply adding &lt;code&gt;DISABLE_URL_HASH = True&lt;/code&gt; to your &lt;code&gt;pelicanconf.py&lt;/code&gt;!&lt;/p&gt;</description></item><item><title>Fix Dell Keyboard Backlight under Debian</title><link>https://www.ericlight.com/post/keyboard_backlight.html</link><pubDate>Thu, 11 Jan 2018 00:00:00 +1300</pubDate><guid>https://www.ericlight.com/post/keyboard_backlight.html</guid><description>&lt;p&gt;My personal laptop is an old Dell Latitude E6410. One of the things I actually love about it, is the fact that the keyboard has a backlight.&lt;/p&gt;
&lt;p&gt;However, because Linux, sometimes that backlight just stops working. When this happens, you&amp;rsquo;ll see error messages in dmesg, such as:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;dell_wmi: Unknown key with type 0x0011 and code 0x01e2 pressed
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;If this happens to you, just run this command:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;$ sudo echo 7 &amp;gt; /sys/devices/platform/dell-laptop/leds/dell\:\:kbd_backlight/brightness
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;You can echo a higher number if you want your keyboard brighter, but I found 7 to be more than bright enough.&lt;/p&gt;</description></item><item><title>Smokey BBQ-Baked Beans</title><link>https://www.ericlight.com/post/bbq-beans.html</link><pubDate>Wed, 10 Jan 2018 00:00:00 +1300</pubDate><guid>https://www.ericlight.com/post/bbq-beans.html</guid><description>&lt;img src="https://www.ericlight.com/post/bbq-beans/cooking-beans.jpg" alt="Featured image of post Smokey BBQ-Baked Beans" /&gt;&lt;p&gt;We recently got a &lt;a class="link" href="https://fornetto.com/products/basso-vertical-smoker/" target="_blank" rel="noopener"
 &gt;Fornetto Basso&lt;/a&gt; - it&amp;rsquo;s an 18&amp;quot; bullet smoker/barbecue, advertised with three tiers of deliciousness: two bbq racks, and a rail under the lid for hanging meats for smoking. It also has a large metal water bowl, which goes at the bottom. The water helps to keep the meat moist, and helps regulate the temperature.&lt;/p&gt;
&lt;p&gt;However&amp;hellip; The water bowl &lt;strong&gt;also&lt;/strong&gt; turns out to be my new favourite bean-cooking vessel! It&amp;rsquo;s quite huge (probably about 8 litres) and of course it doesn&amp;rsquo;t consume any of the precious roasting real-estate. Even better, the juices from your cooking meat will drip into the beans, bringing a nice smokey meaty flavour! ❤️&lt;/p&gt;
&lt;p&gt;So anyway, I whipped up a recipe last night, and my awesome wife ran the smoker today while I was at work. I came home to the best baked beans I&amp;rsquo;ve ever tasted.&lt;/p&gt;
&lt;p&gt;The following recipe is plenty for a good 6 people, and should provide some leftovers as well. We used a mix of Apple wood and Cherry wood for smoke.&lt;/p&gt;
&lt;p&gt;&lt;img alt="The beans simmering - it’s all still very liquid, all the beans are still firm and bean-shaped, and chunks of capsicum and onion are recognisable." class="gallery-image" data-flex-basis="400px" data-flex-grow="167" data-title-escaped="Part-way through the cook" height="419" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://www.ericlight.com/post/bbq-beans/cooking-beans.jpg" title="Part-way through the cook" width="700"&gt;&lt;/p&gt;
&lt;h2 id="ingredients"&gt;Ingredients
&lt;/h2&gt;&lt;ul&gt;
&lt;li&gt;1 cup cooked bacon, chopped into about 2cm squares (optional)&lt;/li&gt;
&lt;li&gt;6 cups mixed raw beans*, soaked in clean water overnight and drained&lt;/li&gt;
&lt;li&gt;18 cups water&lt;/li&gt;
&lt;li&gt;2 fairly large onions, diced large&lt;/li&gt;
&lt;li&gt;3 capsicum (any colour), cut to about 2cm squares&lt;/li&gt;
&lt;li&gt;2 Tbsp mustard&lt;/li&gt;
&lt;li&gt;270ml of tomato sauce (I used Watties)&lt;/li&gt;
&lt;li&gt;6 Tbsp dark brown sugar&lt;/li&gt;
&lt;li&gt;8 Tbsp cider vinegar&lt;/li&gt;
&lt;li&gt;4 Tbsp Worchestershire sauce&lt;/li&gt;
&lt;li&gt;1/2 tsp cayenne pepper (possibly a bit less depending on taste)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;em&gt;* I used a mix of about 40% haricot beans, 10% black beans, 30% red kidney beans, and 20% giant lima beans. The black beans were pleasant surprises, but the lima weren&amp;rsquo;t particularly enlightening - get butter beans instead, if you can find them.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Mix all the ingredients together in your bowl (or a tray), pop it in the BBQ, and fire it up! The beans will absorb some of the water, and some of the water will evaporate to keep your meat hydrated. Your beans should be cooked by the time the sauce has thickened down - ours were ready in about 5 hours. Make sure you don&amp;rsquo;t cook them dry!&lt;/p&gt;
&lt;p&gt;Enjoy!&lt;/p&gt;
&lt;p&gt;&lt;img alt="The liquid has thickened into a paste consistency; the beans are way softer, many are mashed and split. The capsicum peeks through in splashes of colour." class="gallery-image" data-flex-basis="251px" data-flex-grow="104" data-title-escaped="Utterly delicious &amp;amp;hellip; although already mostly eaten!" height="667" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://www.ericlight.com/post/bbq-beans/cooked-beans.jpg" title="Utterly delicious &amp;hellip; although already mostly eaten!" width="700"&gt;&lt;/p&gt;</description></item><item><title>Mikrotik RouterOS - incorrect SNMP status for idle WLAN interfaces</title><link>https://www.ericlight.com/post/mikrotik-snmp.html</link><pubDate>Sun, 07 Jan 2018 00:00:00 +1300</pubDate><guid>https://www.ericlight.com/post/mikrotik-snmp.html</guid><description>&lt;p&gt;While trying to monitor the status of one of our wireless access points, I discovered that RouterOS returns an incorrect SNMP status code for the wlan interfaces when there are no clients connected to the interface. This is at least present in RouterOS v6.40.3, on a Mikrotik cAPlite (RBcAPL-2nD).&lt;/p&gt;
&lt;p&gt;Specifically, when the wifi interface is &lt;strong&gt;up&lt;/strong&gt;, but has zero connected clients, the OID returns an SNMP value of 2 (&amp;ldquo;down&amp;rdquo;). This status is incorrect - the interface isn&amp;rsquo;t down, it&amp;rsquo;s merely waiting for an external connection.&lt;/p&gt;
&lt;p&gt;The specific OID is 1.3.6.1.2.1.2.2.1.8.2 (iso.org.dod.internet.mgmt.mib-2.interfaces.ifTable.ifEntry.ifOperStatus - interface #2 in my case)&lt;/p&gt;
&lt;p&gt;The applicable RFC says, &amp;ldquo;&lt;em&gt;When ifAdminStatus changes to the up state, the related ifOperStatus should do one of the following: [&amp;hellip;] Change to the dormant state if and only if the interface is found to be operable, but the interface is waiting for other, external, events to occur before it can transmit or receive packets&lt;/em&gt;&amp;rdquo; (&lt;a class="link" href="https://www.ietf.org/rfc/rfc2863.txt" target="_blank" rel="noopener"
 &gt;https://www.ietf.org/rfc/rfc2863.txt&lt;/a&gt;, section 3.1.13)&lt;/p&gt;
&lt;p&gt;I notice this issue was logged on the forums about 6 years ago, at &lt;a class="link" href="https://forum.mikrotik.com/viewtopic.php?t=51332" target="_blank" rel="noopener"
 &gt;https://forum.mikrotik.com/viewtopic.php?t=51332&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;I&amp;rsquo;ve raised this issue with Mikrotik support, and apparently it&amp;rsquo;s been added to their to-do list, but I&amp;rsquo;m not sure it&amp;rsquo;ll ever be done. In the meantime, we&amp;rsquo;ve just had to disable up/down monitoring of that specific interface, because it&amp;rsquo;s so misleading.&lt;/p&gt;</description></item><item><title>When the problem is DNS: FreeNAS and NFS</title><link>https://www.ericlight.com/post/nfs-dns.html</link><pubDate>Sun, 07 Jan 2018 00:00:00 +1300</pubDate><guid>https://www.ericlight.com/post/nfs-dns.html</guid><description>&lt;p&gt;I discovered a while ago that NFS requires DNS to function correctly: &lt;a class="link" href="https://redmine.ixsystems.com/issues/4983" target="_blank" rel="noopener"
 &gt;https://redmine.ixsystems.com/issues/4983&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;That&amp;rsquo;s somewhat annoying, because when your DNS server goes down (and your backups are stored on your FreeNAS server and accessed over NFS), is precisely the time when you really want your backups to be accessible.&lt;/p&gt;
&lt;p&gt;However, turns out it doesn&amp;rsquo;t &lt;em&gt;aaaaactuallyyyyy&lt;/em&gt; need DNS&amp;hellip; it needs &lt;strong&gt;name resolution&lt;/strong&gt;. Specifically, FreeNAS just needs to be able to resolve it&amp;rsquo;s own hostname. Cue the handy-dandy hosts file.&lt;/p&gt;
&lt;p&gt;Under Network -&amp;gt; Global Configuration -&amp;gt; Host name data base, add your details:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;192.168.88.5 backupserver backupserver.local backupserver.ad.mydomain.com
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;If you have a secondary IP address, duplicate the above line and replace the IP as appropriate.&lt;/p&gt;
&lt;p&gt;Obviously, replace the hostname and your internal domain name with whatever you use. However, be aware that the .local FQDN is &lt;strong&gt;actually&lt;/strong&gt; required, even if you use a different domain name.&lt;/p&gt;</description></item><item><title>Flashing a Samsung S5 G900I back to stock</title><link>https://www.ericlight.com/post/new_heimdall.html</link><pubDate>Tue, 19 Dec 2017 00:00:00 +1300</pubDate><guid>https://www.ericlight.com/post/new_heimdall.html</guid><description>&lt;p&gt;I got a second-hand Samsung Galaxy S5 for my mum yesterday (a G900I model, from Telstra), and I spent some time getting it ready.&lt;/p&gt;
&lt;p&gt;Firstly, I &lt;a class="link" href="https://www.sammobile.com/firmwares/galaxy-s5/SM-G900I/" target="_blank" rel="noopener"
 &gt;downloaded&lt;/a&gt; the most-recent Telstra firmware image. At time of writing, that&amp;rsquo;s G900IDVU1CQJ2. Telstra appears to be the only carrier still releasing stock firmware for this phone, so I downloaded the Telstra version even though we&amp;rsquo;re connecting to Spark New Zealand. This means the phone will at least be running the most up-to-date baseband and modem firmware.&lt;/p&gt;
&lt;p&gt;Note - if you try this, and find that the recent (international) version doesn&amp;rsquo;t work properly with your local carriers, download the older (local) package, and flash the modem.bin and the NON-HLOS.bin packages from the local one instead.&lt;/p&gt;
&lt;p&gt;Flashing the new firmware required a little thinking. I&amp;rsquo;m 99% sure that I did this the hard way, but basically:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Download the newest version of &lt;a class="link" href="https://github.com/Benjamin-Dobell/Heimdall" target="_blank" rel="noopener"
 &gt;Heimdall from Github&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Back last year I had &lt;a class="link" href="https://www.ericlight.com/post/heimdall-nongui.html" &gt;a post&lt;/a&gt; that mentioned editing CMakeLists.txt - ignore that now.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Build the software (assuming you extracted the zip instead of using &lt;code&gt;git clone&lt;/code&gt;), with:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt; cd Heimdall-master
 mkdir build
 cd build
 cmake -DDISABLE_FRONTEND=ON -DCMAKE_BUILD_TYPE=Release .. 
 make
&lt;/code&gt;&lt;/pre&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Once I&amp;rsquo;d built Heimdall, I unzipped the firmware into a convenient place, and I examined the PIT file from the phone:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;./heimdall print-pit
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This descripts the partition table on the phone. In particular, it tells you which files in your firmware package should be uploaded to which partitions. I ended up with the following Heimdall flash line:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;./heimdall flash --APNHLOS NON-HLOS.bin --MODEM modem.bin --SBL1 sbl1.mbn --DBI sdi.mbn --ABOOT aboot.mbn --RPM rpm.mbn --TZ tz.mbn --BOOT boot.img --RECOVERY recovery.img --SYSTEM system.img.ext4 --CACHE cache.img.ext4 --HIDDEN hidden.img.ext4
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;I know I could have only flashed the modem.bin and NON-HLOS.bin files, but I&amp;rsquo;m not sure what I would have missed by skipping all the other partitions.&lt;/p&gt;
&lt;p&gt;After the phone was flashed up to the current Stock firmware, I made sure it booted correctly, and then went ahead and converted the phone to my beloved &lt;a class="link" href="https://www.lineageos.org" target="_blank" rel="noopener"
 &gt;LineageOS&lt;/a&gt;, happy in the knowledge that all the &amp;ldquo;other bits&amp;rdquo; of the firmware were all updated.&lt;/p&gt;</description></item><item><title>Making MindTouch's Dekiwiki work on Debian Stretch</title><link>https://www.ericlight.com/post/dekiwiki.html</link><pubDate>Sun, 17 Sep 2017 00:00:00 +1200</pubDate><guid>https://www.ericlight.com/post/dekiwiki.html</guid><description>&lt;p&gt;We had accumulated a certain amount of technical debt, due to a Wiki solution that was selected a few years ago: Dekiwiki, by MindTouch. Unfortunately a few months after implementation, MindTouch Core (which Dekiwiki builds on) was &lt;a class="link" href="https://mindtouch.com/resources/mindtouch-core-and-platform-this-is-the-end-beautiful-friend" target="_blank" rel="noopener"
 &gt;well-and-truly deprecated&lt;/a&gt; back in 2013.&lt;/p&gt;
&lt;p&gt;It all happened before my time, but it seems as if Dekiwiki came as a pre-built VMware Appliance, based on Debian Etch (&lt;a class="link" href="https://en.wikipedia.org/wiki/Debian_version_history#Debian_4.0_.28Etch.29" target="_blank" rel="noopener"
 &gt;Debian 4.0; released in 2007&lt;/a&gt;). After giving our Dekiwiki environment some serious side-eye for a while, I finally decided to get my hands dirty and try to upgrade it.&lt;/p&gt;
&lt;p&gt;Jedd, over at Jeddi.org, wrote &lt;a class="link" href="https://jeddi.org/b/resurrecting-mindtouch-dekiwiki.html#resurrecting-mindtouch-dekiwiki" target="_blank" rel="noopener"
 &gt;a really helpful post back in 2015&lt;/a&gt; about his experiences updating the ageing version of Debian that the VM is based on. The whole Dekiwiki image is held together by sticky-tape, but that post is really helpful in getting Etch upgraded to Wheezy.&lt;/p&gt;
&lt;p&gt;Here are a couple &lt;strong&gt;additional&lt;/strong&gt; things I&amp;rsquo;ve had to do (please, please look at Jedd&amp;rsquo;s post above - he covers a whole lot that I&amp;rsquo;m not covering here):&lt;/p&gt;
&lt;h2 id="upgrading-etch---lenny"&gt;Upgrading Etch -&amp;gt; Lenny:
&lt;/h2&gt;&lt;p&gt;Follow &lt;a class="link" href="https://jeddi.org/b/resurrecting-mindtouch-dekiwiki.html#resurrecting-mindtouch-dekiwiki" target="_blank" rel="noopener"
 &gt;the guide at Jeddi.org&lt;/a&gt; above to get to Lenny. I can&amp;rsquo;t remember much failing for that upgrade step, but I remember something happened.&lt;/p&gt;
&lt;h2 id="from-lenny---squeeze"&gt;From Lenny -&amp;gt; Squeeze:
&lt;/h2&gt;&lt;p&gt;&lt;strong&gt;DNS Breaks.&lt;/strong&gt; You&amp;rsquo;ll notice that SSH takes aaaages to log into, and other things will start being slow and complaining.&lt;/p&gt;
&lt;p&gt;Resolve this by editing the &amp;lsquo;hosts&amp;rsquo; line in /etc/nsswitch.conf:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;hosts: files dns&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Originally this reads &lt;code&gt;hosts: files mdns4_minimal [NOTFOUND=return] dns mdns4&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Note I&amp;rsquo;m not actually sure this happened between Lenny and Squeeze; it may have been from Squeeze to Wheezy. *shrug*&lt;/p&gt;
&lt;h2 id="from-squeeze---wheezy"&gt;From Squeeze -&amp;gt; Wheezy:
&lt;/h2&gt;&lt;p&gt;&lt;strong&gt;MySQL breaks.&lt;/strong&gt; When visiting the wiki, you&amp;rsquo;ll be informed that it couldn&amp;rsquo;t access the backend, and that the API might be warming up. However, you&amp;rsquo;ll notice that the MySQL service fails to start. When you run &amp;lsquo;mysqld&amp;rsquo; from command line, you&amp;rsquo;ll see it&amp;rsquo;s missing a folder.&lt;/p&gt;
&lt;p&gt;Resolve this by running &lt;code&gt;mkdir /var/lib/mysql-files ; chown mysql:mysql /var/lib/mysql-files&lt;/code&gt;&lt;/p&gt;
&lt;h2 id="from-wheezy---jessie-upgrade-only"&gt;From Wheezy -&amp;gt; Jessie (upgrade-only):
&lt;/h2&gt;&lt;p&gt;&lt;strong&gt;Apache breaks.&lt;/strong&gt; You&amp;rsquo;ll notice Apache starts serving just the contents of /var/www. This is because the Apache config file now looks for *.conf in /etc/apache2/sites-enabled; of course, the dekiwiki config file doesn&amp;rsquo;t have the .conf ending.&lt;/p&gt;
&lt;p&gt;Resolve this by running &lt;code&gt;mv /etc/apache2/sites-enabled/dekiwiki /etc/apache2/sites-enabled/dekiwiki.conf&lt;/code&gt;&lt;/p&gt;
&lt;h2 id="from-wheezy---jessie-dist-upgrade"&gt;From Wheezy -&amp;gt; Jessie (dist-upgrade):
&lt;/h2&gt;&lt;p&gt;&lt;strong&gt;Mono breaks.&lt;/strong&gt; If you upgrade mono, Dekiwiki will fall back into unlicensed mode. The licensing engine will no longer be able to interpret license files correctly. You&amp;rsquo;ll see the error &amp;ldquo;Server license validation failed. The license signature is not valid.&amp;rdquo;&lt;/p&gt;
&lt;p&gt;Resolve this by holding back the mono packages before you run a dist-upgrade:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;apt-mark hold libapache2-mod-mono libmono-2.0-1 libmono-2.0-dev libmono-accessibility2.0-cil libmono-accessibility4.0-cil libmono-bytefx0.7.6.2-cil libmono-c5-1.1-cil libmono-cairo2.0-cil libmono-cairo4.0-cil libmono-cecil-private-cil libmono-codecontracts4.0-cil libmono-compilerservices-symbolwriter4.0-cil libmono-corlib2.0-cil libmono-corlib4.0-cil libmono-cscompmgd8.0-cil libmono-csharp4.0-cil libmono-custommarshalers4.0-cil libmono-data-tds2.0-cil libmono-data-tds4.0-cil libmono-data2.0-cil libmono-db2-1.0-cil libmono-debugger-soft2.0-cil libmono-debugger-soft4.0-cil libmono-dev libmono-firebirdsql1.7-cil libmono-getoptions2.0-cil libmono-http4.0-cil libmono-i18n-cjk4.0-cil libmono-i18n-mideast4.0-cil libmono-i18n-other4.0-cil libmono-i18n-rare4.0-cil libmono-i18n-west2.0-cil libmono-i18n-west4.0-cil libmono-i18n2.0-cil libmono-i18n4.0-all libmono-i18n4.0-cil libmono-ldap2.0-cil libmono-ldap4.0-cil libmono-management2.0-cil libmono-management4.0-cil libmono-messaging-rabbitmq2.0-cil libmono-messaging-rabbitmq4.0-cil libmono-messaging2.0-cil libmono-messaging4.0-cil libmono-microsoft-build-engine4.0-cil libmono-microsoft-build-framework4.0-cil libmono-microsoft-build-tasks-v4.0-4.0-cil libmono-microsoft-build-utilities-v4.0-4.0-cil libmono-microsoft-build2.0-cil libmono-microsoft-csharp4.0-cil libmono-microsoft-visualc10.0-cil libmono-microsoft-web-infrastructure1.0-cil libmono-microsoft8.0-cil libmono-npgsql2.0-cil libmono-npgsql4.0-cil libmono-opensystem-c4.0-cil libmono-oracle2.0-cil libmono-oracle4.0-cil libmono-peapi2.0-cil libmono-peapi4.0-cil libmono-posix2.0-cil libmono-posix4.0-cil libmono-rabbitmq2.0-cil libmono-rabbitmq4.0-cil libmono-relaxng2.0-cil libmono-relaxng4.0-cil libmono-security2.0-cil libmono-security4.0-cil libmono-sharpzip2.6-cil libmono-sharpzip2.84-cil libmono-sharpzip4.84-cil libmono-simd2.0-cil libmono-simd4.0-cil libmono-sqlite2.0-cil libmono-sqlite4.0-cil libmono-system-componentmodel-composition4.0-cil libmono-system-componentmodel-dataannotations4.0-cil libmono-system-configuration-install4.0-cil libmono-system-configuration4.0-cil libmono-system-core4.0-cil libmono-system-data-datasetextensions4.0-cil libmono-system-data-linq2.0-cil libmono-system-data-linq4.0-cil libmono-system-data-services-client4.0-cil libmono-system-data-services4.0-cil libmono-system-data2.0-cil libmono-system-data4.0-cil libmono-system-design4.0-cil libmono-system-drawing-design4.0-cil libmono-system-drawing4.0-cil libmono-system-dynamic4.0-cil libmono-system-enterpriseservices4.0-cil libmono-system-identitymodel-selectors4.0-cil libmono-system-identitymodel4.0-cil libmono-system-ldap2.0-cil libmono-system-ldap4.0-cil libmono-system-management4.0-cil libmono-system-messaging2.0-cil libmono-system-messaging4.0-cil libmono-system-net4.0-cil libmono-system-numerics4.0-cil libmono-system-runtime-caching4.0-cil libmono-system-runtime-durableinstancing4.0-cil libmono-system-runtime-serialization-formatters-soap4.0-cil libmono-system-runtime-serialization4.0-cil libmono-system-runtime2.0-cil libmono-system-runtime4.0-cil libmono-system-security4.0-cil libmono-system-servicemodel-discovery4.0-cil libmono-system-servicemodel-routing4.0-cil libmono-system-servicemodel-web4.0-cil libmono-system-servicemodel4.0-cil libmono-system-serviceprocess4.0-cil libmono-system-transactions4.0-cil libmono-system-web-abstractions4.0-cil libmono-system-web-applicationservices4.0-cil libmono-system-web-dynamicdata4.0-cil libmono-system-web-extensions-design4.0-cil libmono-system-web-extensions4.0-cil libmono-system-web-mvc1.0-cil libmono-system-web-mvc2.0-cil libmono-system-web-routing4.0-cil libmono-system-web-services4.0-cil libmono-system-web2.0-cil libmono-system-web4.0-cil libmono-system-windows-forms-datavisualization4.0-cil libmono-system-windows-forms4.0-cil libmono-system-xaml4.0-cil libmono-system-xml-linq4.0-cil libmono-system-xml4.0-cil libmono-system2.0-cil libmono-system4.0-cil libmono-tasklets2.0-cil libmono-tasklets4.0-cil libmono-wcf3.0-cil libmono-web4.0-cil libmono-webbrowser2.0-cil libmono-webbrowser4.0-cil libmono-webmatrix-data4.0-cil libmono-windowsbase3.0-cil libmono-windowsbase4.0-cil libmono-winforms2.0-cil libmono0 libmono2.0-cil mono-2.0-devel mono-2.0-gac mono-4.0-gac mono-apache-server2 mono-common mono-csharp-shell mono-dmcs mono-gac mono-gmcs mono-mcs mono-runtime mono-utils mono-xbuild&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; Some of these can certainly be unheld. I haven&amp;rsquo;t yet gone through and identified exactly which component is breaking on upgrade. If you put in the effort to determine the culprit, please let me know.&lt;/p&gt;
&lt;p&gt;That&amp;rsquo;s all! You should now have Dekiwiki running on Debian Stretch! I&amp;rsquo;m planning to upgrade it to Debian Buster in the next week or two.&lt;/p&gt;</description></item><item><title>Compiling Heimdall without installing Qt</title><link>https://www.ericlight.com/post/heimdall-nongui.html</link><pubDate>Wed, 13 Sep 2017 00:00:00 +1200</pubDate><guid>https://www.ericlight.com/post/heimdall-nongui.html</guid><description>&lt;img src="https://www.ericlight.com/post/heimdall-nongui/yuck.png" alt="Featured image of post Compiling Heimdall without installing Qt" /&gt;&lt;p&gt;During my recent &lt;a class="link" href="https://www.ericlight.com/post/broken_phone.html" &gt;Wrecked-phone Saga&lt;/a&gt;, I had some trouble flashing my firmware. My phone was broken at the time, so I couldn&amp;rsquo;t enable ADB Debugging - therefore adb wasn&amp;rsquo;t an option. OEM Bootlock was on, so fastboot wasn&amp;rsquo;t an option. My Recovery bootloader was also broken. I thought my phone was bricked.&lt;/p&gt;
&lt;p&gt;That&amp;rsquo;s until I remembered Heimdall.&lt;/p&gt;
&lt;p&gt;&lt;a class="link" href="http://glassechidna.com.au/heimdall/" target="_blank" rel="noopener"
 &gt;Heimdall&lt;/a&gt; is specifically a tool for working with the partitions on Samsung phones - other visitors need not apply. It works a treat for my Samsung Galaxy S5 (kltedv) though.&lt;/p&gt;
&lt;p&gt;Heimdall, however, is &lt;strong&gt;old&lt;/strong&gt;. The version in the Debian Sid repository is 1.4.1, which &lt;a class="link" href="http://metadata.ftp-master.debian.org/changelogs/main/h/heimdall-flash/heimdall-flash_1.4.1-2_changelog" target="_blank" rel="noopener"
 &gt;dates back to 2015&lt;/a&gt;. And when we have old versions, we also have incompatibilites! Such as Heimdall 1.4.1&amp;rsquo;s &lt;a class="link" href="https://github.com/Benjamin-Dobell/Heimdall/issues/209" target="_blank" rel="noopener"
 &gt;incompatibility with newer versions of Samsung devices&lt;/a&gt; &amp;hellip; such as my precious SGS5.&lt;/p&gt;
&lt;p&gt;Happily, Heimdall is open source, so I was able to download and compile a new version that overcomes the problem. And that&amp;rsquo;s how I found myself staring at the screen and looking at this:&lt;/p&gt;
&lt;p&gt;&lt;img alt="Do I really need to install 55 packages to build this?" class="gallery-image" data-flex-basis="568px" data-flex-grow="236" height="595" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://www.ericlight.com/post/heimdall-nongui/yuck.png" srcset="https://www.ericlight.com/post/heimdall-nongui/yuck_hu_5d669859ae154774.png 800w, https://www.ericlight.com/post/heimdall-nongui/yuck.png 1409w" width="1409"&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;That is Yuck.bat&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;I really didn&amp;rsquo;t want to install 55 packages just to build this. The majority of missing packages were required to build the GUI section of the tool, which I didn&amp;rsquo;t want to use anyway. What if I could &amp;hellip; &lt;em&gt;build Heimdall without building the GUI??&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;And of course, that&amp;rsquo;s the title of this article, so here&amp;rsquo;s how to do it!&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;EDIT 2017-12-19: The stuff below is no longer necessary. For better instructions, have a look at my article about &lt;a class="link" href="https://www.ericlight.com/post/new_heimdall.html" &gt;flashing a Samsung G900I back to stock&lt;/a&gt;.&lt;/strong&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Clone the git repository, with &lt;code&gt;git clone https://github.com/Benjamin-Dobell/Heimdall.git&lt;/code&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Edit the CMakeLists.txt file: &lt;code&gt;nano Heimdall/CMakeLists.txt&lt;/code&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Delete the last four lines of CMakeLists.txt:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt; cmake_minimum_required(VERSION 2.8.4)

 set(CMAKE_MODULE_PATH
 ${CMAKE_SOURCE_DIR}/cmake
 ${CMAKE_MODULE_PATH})

 project(Heimdall)

 set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)

 option(DISABLE_FRONTEND &amp;quot;Disable GUI frontend&amp;quot; OFF)

 add_subdirectory(libpit)
 add_subdirectory(heimdall)
&lt;/code&gt;&lt;/pre&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;You&amp;rsquo;re done! Go ahead and build according to the instructions.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;</description></item><item><title>When Encryption Attacks!</title><link>https://www.ericlight.com/post/broken_phone.html</link><pubDate>Tue, 12 Sep 2017 00:00:00 +1200</pubDate><guid>https://www.ericlight.com/post/broken_phone.html</guid><description>&lt;p&gt;So&amp;hellip; I wrecked my phone last night. :-(&lt;/p&gt;
&lt;p&gt;Android&amp;rsquo;s phone encryption feature has been around for aaaages, so I was confident when I started the encryption process last night. Unfortunately, something went wrong, and last night I discovered that everything was toast.&lt;/p&gt;
&lt;p&gt;After a bit of digging, I found someone else with &lt;a class="link" href="https://forum.xda-developers.com/galaxy-s4-sprint/help/phone-encrypted-access-twrp-t3587534" target="_blank" rel="noopener"
 &gt;&lt;strong&gt;exactly&lt;/strong&gt; the same problem&lt;/a&gt;!&lt;/p&gt;

 &lt;blockquote&gt;
 &lt;p&gt;&amp;ldquo;unable to boot into my phone as it sits at the boot screen. When I try to boot into TWRP, it asks for my password. [&amp;hellip;] it appears to decrypt the partition and mount, but then while loading, TWRP shows a continuous stream of:&lt;/p&gt;
&lt;p&gt;&lt;span style="color:red"&gt;E:Error parsing XML file&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;errors until it just restarts.&amp;rdquo;&lt;/p&gt;

 &lt;/blockquote&gt;
&lt;p&gt;Unfortunately, nobody responded to my own personal &lt;a class="link" href="https://xkcd.com/979/" target="_blank" rel="noopener"
 &gt;denvercoder9&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Long story short, I lost everything. But for a while, I thought my &lt;em&gt;entire phone&lt;/em&gt; was bricked. The phone wasn&amp;rsquo;t accessible in either Recovery mode (due to the XML parsing catastrophe) &lt;strong&gt;or&lt;/strong&gt; Download mode - it wasn&amp;rsquo;t accessible either via adb or via fastboot.&lt;/p&gt;
&lt;p&gt;Eventually my mate &lt;a class="link" href="https://keybase.io/rendition" target="_blank" rel="noopener"
 &gt;@rendition&lt;/a&gt; pointed out that I could just boot into Recovery, then cancel the decryption step and wipe my phone from there. That allowed me to start again from a clean slate.&lt;/p&gt;
&lt;p&gt;And I encrypted my phone right away, with no trouble at all!&lt;/p&gt;</description></item><item><title>Firmware update on an APC AP9630 NMC2</title><link>https://www.ericlight.com/post/apc_firmware.html</link><pubDate>Sat, 02 Sep 2017 00:00:00 +1200</pubDate><guid>https://www.ericlight.com/post/apc_firmware.html</guid><description>&lt;p&gt;I&amp;rsquo;ve spent a little while working with the &lt;a class="link" href="http://www.apc.com/shop/us/en/products/UPS-Network-Management-Card-2/P-AP9630" target="_blank" rel="noopener"
 &gt;APC Network Management Cards&lt;/a&gt; now, and firmware updates are a total pain.&lt;/p&gt;
&lt;p&gt;The biggest issue is that the UPS power outlets need to be &lt;strong&gt;powered off&lt;/strong&gt; in order to flash the firmware, otherwise there&amp;rsquo;s a terrifyingly-high chance that the NMC (a ~$700 card) will completely shit itself, and die permanently. Aside from that, I&amp;rsquo;ve never managed to get updates working properly from the web interface.&lt;/p&gt;
&lt;p&gt;Fortunately, the card is hot-pluggable, so if you have a spare UPS hanging around, you can unplug the NMC from each UPS in your fleet, throw it into your spare, and flash the firmware from there. Fast, easy, and simple&amp;hellip; as long as you have that all-important spare.&lt;/p&gt;
&lt;h2 id="download-the-firmware"&gt;Download the Firmware
&lt;/h2&gt;&lt;p&gt;First, download the appropriate firmware for your device. At time of writing, the link for the SmartUPS 6.5.0 NMC firmware &lt;a class="link" href="http://www.apc.com/us/en/tools/download/download.cfm?sw_sku=SFSUMX650&amp;amp;software_id=MFOI-APKQJS&amp;amp;family=98&amp;amp;part_num=AP9630&amp;amp;swfam=&amp;amp;tsk=" target="_blank" rel="noopener"
 &gt;can be found here&lt;/a&gt;, but if it&amp;rsquo;s been a while you should find a new version at &lt;a class="link" href="http://www.apc.com/us/en/tools/download/" target="_blank" rel="noopener"
 &gt;http://www.apc.com/us/en/tools/download/&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;It comes down as an EXE file, but use 7-zip to extract the archive somewhere convenient. You only need the three .bin files:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;apc_hw05_bootmon_108.bin&lt;/li&gt;
&lt;li&gt;apc_hw05_aos_650.bin&lt;/li&gt;
&lt;li&gt;apc_hw05_sumx_650.bin&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="flashing-the-firmware"&gt;Flashing the Firmware
&lt;/h2&gt;&lt;p&gt;Flashing the actual firmware is easy, but you do need to be careful of the order. The bootmon package goes first, then the AOS package, and then the sumx package.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Be aware: the NMC will reboot immediately after each file is uploaded. As a result, you need to reconnect after each upload, and reissue the BIN command.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Make sure you know the username and password (default credentials are apc/apc), and that the FTP server is enabled. Then, go ahead and ftp to the NMC on it&amp;rsquo;s IP address.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;$ ftp
ftp&amp;gt; open x.x.x.x
Connected to x.x.x.x.
Name (eric): apc
Password: apc
230 Login successful.
Remote system type is UNIX.
Using text mode to transfer files.
ftp&amp;gt; bin
Using binary mode to transfer files.
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Make sure you send the &amp;lsquo;bin&amp;rsquo; command. I also use the hash command so I can watch the transfer status, but it&amp;rsquo;s unnecessary.&lt;/p&gt;
&lt;p&gt;Once you&amp;rsquo;ve connected, go ahead and upload the bootmon file:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;ftp&amp;gt; put apc_hw05_bootmon_108.bin
ftp&amp;gt; close
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;It&amp;rsquo;ll only take a few seconds to upload the file, and you won&amp;rsquo;t see any notification from the FTP server. But if you&amp;rsquo;re paying attention to the card itself, you&amp;rsquo;ll see the NMC network connection go down, and then start flashing. This is the NMC installing the new firmware package.&lt;/p&gt;
&lt;p&gt;Once the connection is up again, your FTP session will be broken. Go ahead and reconnect; remember to reissue the BIN command:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;ftp&amp;gt; put apc_hw05_bootmon_108.bin
ftp&amp;gt; close
&amp;lt;...snip...&amp;gt;
ftp&amp;gt; open x.x.x.x
&amp;lt;...snip...&amp;gt;
ftp&amp;gt; bin
Using binary mode to transfer files.
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Now upload the AOS file. When the NMC reboots again, go ahead and repeat the cycle to upload the sumx file.&lt;/p&gt;
&lt;p&gt;Once the NMC reboots for the third time, you should be done!&lt;/p&gt;
&lt;h2 id="thanks"&gt;Thanks
&lt;/h2&gt;&lt;p&gt;Thanks to Angela from APC - she&amp;rsquo;s been around for years, and as far as I can see she&amp;rsquo;s &lt;em&gt;THE&lt;/em&gt; leading customer support person for the entire NMC firmware suite. You can find her post on this process &lt;a class="link" href="http://forums.apc.com/spaces/7/ups-management-devices-powerchute-software/forums/general/3183/firmware-upgrade-for-ap9631-which-order" target="_blank" rel="noopener"
 &gt;here at the APC forums&lt;/a&gt;.&lt;/p&gt;</description></item><item><title>Respecting Amavis' "Banned Extensions" setting</title><link>https://www.ericlight.com/post/amavis2.html</link><pubDate>Sun, 13 Aug 2017 00:00:00 +1200</pubDate><guid>https://www.ericlight.com/post/amavis2.html</guid><description>&lt;p&gt;I&amp;rsquo;ve been dabbling a little bit with &lt;a class="link" href="http://www.iredmail.org" target="_blank" rel="noopener"
 &gt;iRedMail&lt;/a&gt;, mostly just to have a play with a mail server, but also to see what&amp;rsquo;s involved in mail security. iRedMail is a package that &lt;a class="link" href="http://www.iredmail.org/docs/used.components.html" target="_blank" rel="noopener"
 &gt;pulls together&lt;/a&gt; Postfix as an MTA, Dovecot as a POP3 &amp;amp; IMAP server, SOGo for ActiveSync, Roundcube for Webmail, SpamAssassin for spam protection, and ClamAV for virus scanning.&lt;/p&gt;
&lt;p&gt;Okay I have &lt;strong&gt;no idea&lt;/strong&gt; why I have to write this, but apparently it&amp;rsquo;s a thing.&lt;/p&gt;
&lt;p&gt;Amavis has a list of banned file extensions. In Debian, they live in &lt;code&gt;/etc/amavis/conf.d/20-debian_defaults&lt;/code&gt;, and &lt;code&gt;/etc/amavis/conf.d/50-user&lt;/code&gt;, and are set in the &lt;code&gt;$banned_filename_re&lt;/code&gt; variable. THIS MAKES PERFECT SENSE.&lt;/p&gt;
&lt;p&gt;But of course, there&amp;rsquo;s always something that doesn&amp;rsquo;t make sense, and that is the fact that there is a SQL backend (at least in the environment created by iRedMail), and settings in here take precedence over the Amavis config files somehow.&lt;/p&gt;
&lt;p&gt;And even more bizarrely, there exists in this SQL environment, a policy setting entitled &amp;ldquo;&lt;em&gt;&lt;strong&gt;banned_files_lover&lt;/strong&gt;&lt;/em&gt;&amp;rdquo;, which was set to &amp;ldquo;Y&amp;rdquo;. I shit you not. My only hope is that this only defaults to &amp;ldquo;Y&amp;rdquo; for postmaster.&lt;/p&gt;
&lt;p&gt;To fix this, you need to hop into the database, and update the appropriate column in the &lt;code&gt;policy&lt;/code&gt; table:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;$ mariadb
MariaDB [none]&amp;gt; \u amavis
MariaDB [amavisd]&amp;gt; update policy set banned_files_lover=&amp;quot;N&amp;quot;;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;And now, Amavis will obey your file extension filters!&lt;/p&gt;
&lt;p&gt;Thankfully, I found this information at &lt;a class="link" href="http://www.iredmail.org/forum/topic13147-iredmail-support-amavisd-passed-but-setup-at-ddiscard.html" target="_blank" rel="noopener"
 &gt;http://www.iredmail.org/forum/topic13147-iredmail-support-amavisd-passed-but-setup-at-ddiscard.html&lt;/a&gt; &amp;ndash; I never would have found it otherwise!&lt;/p&gt;</description></item><item><title>Tuna Patties</title><link>https://www.ericlight.com/post/tuna-patties.html</link><pubDate>Sun, 13 Aug 2017 00:00:00 +1200</pubDate><guid>https://www.ericlight.com/post/tuna-patties.html</guid><description>&lt;p&gt;What do you do when it&amp;rsquo;s dinner time, and you haven&amp;rsquo;t got any ingredients ready for the meal?&lt;/p&gt;
&lt;p&gt;What if (perhaps as a result of being an ultralight hiker), you also have a huge surplus 500g sachet of tuna?&lt;/p&gt;
&lt;p&gt;Tonight these particular stars aligned, and I ended up making these amazing Tuna Patties: &lt;a class="link" href="http://allrecipes.com.au/recipe/15705/tuna-patties.aspx" target="_blank" rel="noopener"
 &gt;http://allrecipes.com.au/recipe/15705/tuna-patties.aspx&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I did tweak the recipe considerably, though:&lt;/p&gt;
&lt;h2 id="ingredients"&gt;Ingredients:
&lt;/h2&gt;&lt;ul&gt;
&lt;li&gt;2-3 large potatoes, peeled and cubed for mashing&lt;/li&gt;
&lt;li&gt;Optionally, swap one of the potatoes for a kumara or some pumpkin&lt;/li&gt;
&lt;li&gt;500g tuna flakes&lt;/li&gt;
&lt;li&gt;2 carrots, grated and excess juice dabbed out with a paper towel&lt;/li&gt;
&lt;li&gt;A goodly handful of frozen chopped spinach&lt;/li&gt;
&lt;li&gt;1 onion, cubed&lt;/li&gt;
&lt;li&gt;3 garlic cloves, chopped&lt;/li&gt;
&lt;li&gt;1/8th tsp cayenne pepper&lt;/li&gt;
&lt;li&gt;1/2 tsp basil&lt;/li&gt;
&lt;li&gt;1/2 tsp oregano&lt;/li&gt;
&lt;li&gt;1/2 tsp sage&lt;/li&gt;
&lt;li&gt;1 tsp veggie stock powder&lt;/li&gt;
&lt;li&gt;2 eggs&lt;/li&gt;
&lt;li&gt;2 tbsp mustard&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="method"&gt;Method:
&lt;/h2&gt;&lt;ul&gt;
&lt;li&gt;Boil the potatoes in salted water until cooked.&lt;/li&gt;
&lt;li&gt;In another pan, fry the onions for 2 minutes, then add garlic.&lt;/li&gt;
&lt;li&gt;Fry until the onions start to brown, then add herbs, spices, and stock powder.&lt;/li&gt;
&lt;li&gt;Continue to fry for another minute, then remove from heat and let cool.&lt;/li&gt;
&lt;li&gt;When the potatoes are cooked, tip out &lt;strong&gt;all&lt;/strong&gt; the water, and allow remaning water to evaporate.&lt;/li&gt;
&lt;li&gt;Mash the potatoes - they&amp;rsquo;ll seem unpleasantly dry, but that&amp;rsquo;s OK.&lt;/li&gt;
&lt;li&gt;Mix the carrots, mashed potatoes, fried onion and garlic, all together in a bowl.&lt;/li&gt;
&lt;li&gt;In another bowl, mix together the tuna, the eggs, and the mustard.&lt;/li&gt;
&lt;li&gt;Now combine everything together, and give it a good mix.&lt;/li&gt;
&lt;li&gt;Form the mixture into patties and fry in a lightly oiled pan.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;In retrospect, this recipe seems really difficult, but it was actually quite straightforward, and it was totally delicious. Definitely good with a bit of mayo on the patties. Yummo!&lt;/p&gt;</description></item><item><title>Making Amavis work with ESET Antivirus</title><link>https://www.ericlight.com/post/amavis.html</link><pubDate>Sat, 12 Aug 2017 00:00:00 +1200</pubDate><guid>https://www.ericlight.com/post/amavis.html</guid><description>&lt;p&gt;I&amp;rsquo;ve been dabbling a little bit with &lt;a class="link" href="http://www.iredmail.org" target="_blank" rel="noopener"
 &gt;iRedMail&lt;/a&gt;, mostly just to have a play with a mail server, but also to see what&amp;rsquo;s involved in mail security. iRedMail is a package that &lt;a class="link" href="http://www.iredmail.org/docs/used.components.html" target="_blank" rel="noopener"
 &gt;pulls together&lt;/a&gt; Postfix as an MTA, Dovecot as a POP3 &amp;amp; IMAP server, SOGo for ActiveSync, Roundcube for Webmail, SpamAssassin for spam protection, and ClamAV for virus scanning.&lt;/p&gt;
&lt;p&gt;But of course, ClamAV has &lt;a class="link" href="https://www.av-test.org/en/news/news-single-view/linux-16-security-packages-against-windows-and-linux-malware-put-to-the-test/" target="_blank" rel="noopener"
 &gt;shown disappointing performance&lt;/a&gt;, and it would be really nice to use something more&amp;hellip; commercially suitable.&lt;/p&gt;
&lt;p&gt;To tie together mail receipt and scanning, iRedMail uses &lt;a class="link" href="https://www.ijs.si/software/amavisd/" target="_blank" rel="noopener"
 &gt;Amavis&lt;/a&gt; (strictly speaking, &amp;lsquo;amavisd-new&amp;rsquo;). Amavis uses ClamAV by default, but it comes with a bunch of &lt;a class="link" href="https://www.apt-browse.org/browse/ubuntu/trusty/main/all/amavisd-new/1:2.7.1-2ubuntu3/file/etc/amavis/conf.d/15-av_scanners" target="_blank" rel="noopener"
 &gt;configuration blocks&lt;/a&gt; to bring together other antivirus applications.&lt;/p&gt;
&lt;p&gt;But although amavisd-new is stable and still maintained, some parts of it are really old. In particular, many of these av-scanner config blocks are&amp;hellip; uhh&amp;hellip; &amp;ldquo;deprecated&amp;rdquo;. There&amp;rsquo;s one particular entry for ESET that is dated 2002 - things have changed a lot in the last fifteen years. *shudder*&lt;/p&gt;
&lt;p&gt;So, with the help of &lt;a class="link" href="https://www.akadia.com/download/documents/amavisd.conf.txt" target="_blank" rel="noopener"
 &gt;some documentation&lt;/a&gt;, I managed to piece together a code block that works:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;['ESET File Security for Linux',
 ['/opt/eset/esets/sbin/esets_scan','esets_scan'],
 '--subdir --unsafe --unwanted --clean-mode=strict {}',
 [0,10,100],[1,50],
 qr/threat=&amp;quot;([^&amp;quot;]+)&amp;quot;/m
],
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;That would be the end of the story, except I also had to hunt around to find out the right place to put my beautiful codeblock into. It turns out that Debian&amp;rsquo;s Amavis config structure is quite different to the CentOS config that is most-frequently mentioned in the iRedMail forums. I spent a lot of time playing with &lt;code&gt;/etc/amavis/conf.d/15-av_scanners&lt;/code&gt;, and nothing seemed to work. Eventually I found out that Debian features a &lt;code&gt;/etc/amavis/conf.d/50-users&lt;/code&gt; file that overwrites the settings from &lt;code&gt;15-av_scanners&lt;/code&gt;. Finally I had progress!&lt;/p&gt;
&lt;p&gt;Somewhere around line 154 in &lt;code&gt;/etc/amavis/conf.d/50-users&lt;/code&gt;, you&amp;rsquo;ll find an &lt;code&gt;@av_scanners&lt;/code&gt; codeblock. I deleted the ClamAV section in there, and replaced it with the ESET codeblock above. I left the ClamAV settings in the &lt;code&gt;@av_scanners_backup&lt;/code&gt; section, because Amavis will fall back to that if ESET fails.&lt;/p&gt;
&lt;p&gt;That seems to be all! At least, it works with the &lt;a class="link" href="http://www.eicar.org/" target="_blank" rel="noopener"
 &gt;EICAR anti-malware test file&lt;/a&gt;.&lt;/p&gt;</description></item><item><title>RingZer0team CTF - Challenges 86, 87, and 88</title><link>https://www.ericlight.com/post/r0-86.html</link><pubDate>Thu, 13 Jul 2017 00:00:00 +1200</pubDate><guid>https://www.ericlight.com/post/r0-86.html</guid><description>&lt;p&gt;There are a bunch of fantastic Capture The Flag security challenges on &lt;a class="link" href="https://www.ringzer0team.com" target="_blank" rel="noopener"
 &gt;RingZer0Team.com&lt;/a&gt;. I&amp;rsquo;ve been working through some of these for a wee while now, and with the &lt;a class="link" href="https://www.cybersecuritychallenge.org.nz/" target="_blank" rel="noopener"
 &gt;New Zealand Cyber Security Challenge&lt;/a&gt; coming up again soon, I thought I&amp;rsquo;d get back into some of them.&lt;/p&gt;
&lt;p&gt;Challenge 86 (&amp;ldquo;1/3 Do not waste the environment&amp;rdquo;, under the Forsensic Challenges) is one of a series of challenges where you need to dig through some provided data to find the flag.&lt;/p&gt;
&lt;p&gt;I started by downloading the &amp;lsquo;forensic bundle&amp;rsquo;, which was just a large zip file. The first challenge was to figure out the contents of that zip file. The file name was just a jumble of characters, and there was no extension. Running &lt;code&gt;file&lt;/code&gt; on it just returned the file type &amp;ldquo;Data&amp;rdquo;&amp;hellip; not very enlightening, but &lt;code&gt;head&lt;/code&gt; uncovered the string &amp;ldquo;VBOX&amp;rdquo; in the file&amp;hellip; okay, it&amp;rsquo;s VirtualBox file.&lt;/p&gt;
&lt;p&gt;Because I didn&amp;rsquo;t have Virtualbox installed, I spent a bit of time digging through the actual Vbox file itself, trying to see if there&amp;rsquo;s a flag already in there. I used &lt;code&gt;strings | egrep -i flag-....&lt;/code&gt;, to try to find any flags embedded in the file itself. I didn&amp;rsquo;t find any flags, but I did discover that the computer name itself is &amp;ldquo;FLAG-PC&amp;rdquo;. Very clever. :-|&lt;/p&gt;
&lt;h3 id="update-many-hours-later"&gt;Update, many hours later:
&lt;/h3&gt;&lt;p&gt;Okay this totally cooked my bacon. After hours of playing with VirtualBox and playing with files, I finally gave up and Googled the name of the downloaded file.&lt;/p&gt;
&lt;p&gt;Turns out I was &lt;em&gt;REALLY&lt;/em&gt; close. The flag IS embedded in the actual file itself, but the format is different for the first time. The correct grep string would have been &lt;code&gt;egrep -i '.?f.?l.?a.?g.?-'&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Real frustrated by how close I was, I&amp;rsquo;ll have to expand my searches in the future. Hat-tip to &lt;a class="link" href="https://twitter.com/professormahi" target="_blank" rel="noopener"
 &gt;@professormahi&lt;/a&gt; and his &lt;a class="link" href="https://github.com/professormahi/CTF/tree/master/ringzer0team/Forensics/1-3%20Do%20not%20waste%20the%20enviroment" target="_blank" rel="noopener"
 &gt;GitHub&lt;/a&gt; page.&lt;/p&gt;
&lt;p&gt;Once I understood that, I also discovered the flag for challenge 87 (&amp;ldquo;2/3 Did you see my desktop?&amp;rdquo;), in the same manner.&lt;/p&gt;
&lt;p&gt;I haven&amp;rsquo;t managed to get the flag for Challenge 88 (&amp;ldquo;3/3 Suspicious Account Password&amp;rdquo;) yet, but I do know what it is. I can see (by grepping for &amp;ldquo;Visited&amp;rdquo;) a bunch of visits to &lt;a class="link" href="http://www.forensicswiki.org/wiki/Tools:Memory_Imaging" target="_blank" rel="noopener"
 &gt;http://www.forensicswiki.org/wiki/Tools:Memory_Imaging&lt;/a&gt;&amp;hellip; this thing is a memory dump. That explains now why it doesn&amp;rsquo;t work as a VirtualBox disk.&lt;/p&gt;
&lt;p&gt;Next time I sit down here, I&amp;rsquo;ll find visit Forensics Wiki, and start digging through the memory dump for the passwords.&lt;/p&gt;
&lt;h3 id="update-two"&gt;Update two
&lt;/h3&gt;&lt;p&gt;I decided not to put this up as a separate post, because once I knew what I was looking at, it was pretty easy. Again though, I relied on @professormahi&amp;rsquo;s work - but now thanks to him I have a little bit of experience with &lt;a class="link" href="https://www.volatilityfoundation.org/" target="_blank" rel="noopener"
 &gt;Volatility&lt;/a&gt;!&lt;/p&gt;
&lt;p&gt;First, we get Volatility to scan the image and see what it&amp;rsquo;s dealing with:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;$ volatility -f vm.vmdk imageinfo
Volatility Foundation Volatility Framework 2.6
INFO : volatility.debug : Determining profile based on KDBG search...
 Suggested Profile(s) : Win7SP1x86_23418, Win7SP0x86, Win7SP1x86
 AS Layer1 : IA32PagedMemory (Kernel AS)
 AS Layer2 : FileAddressSpace (/home/eric/Downloads/86/vm.vmdk)
 PAE type : No PAE
 DTB : 0x185000L
 KDBG : 0x82920be8L
 Number of Processors : 1
 Image Type (Service Pack) : 0
 KPCR for CPU 0 : 0x82921c00L
 KUSER_SHARED_DATA : 0xffdf0000L
 Image date and time : 2014-03-09 20:57:55 UTC+0000
 Image local date and time : 2014-03-09 13:57:55 -0700
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Now, knowing the profile that we need to use, we can use it to just&amp;hellip; dump the password table:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;$ volatility -f vm.vmdk --profile Win7SP1x86 hashdump
Volatility Foundation Volatility Framework 2.6
Administrator:500:aad3b435b51404eeaad3b435b51404ee:31d6cfe0d16ae931b73c59d7e0c089c0:::
Guest:501:aad3b435b51404eeaad3b435b51404ee:31d6cfe0d16ae931b73c59d7e0c089c0:::
flag:1000:aad3b435b51404eeaad3b435b51404ee:3008c87294511142799dca1191e69a0f:::
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;And then, we grab that NTLM hash and pop it into an online NTLM decryptor service, and we&amp;rsquo;re away!&lt;/p&gt;</description></item><item><title>Staying Secure in Business</title><link>https://www.ericlight.com/post/hygiene.html</link><pubDate>Wed, 28 Jun 2017 00:00:00 +1200</pubDate><guid>https://www.ericlight.com/post/hygiene.html</guid><description>&lt;p&gt;A friend asked a question today on Facebook. I started writing a reply, and it turned into a 700-word essay. Hate it when that happens&amp;hellip;&lt;/p&gt;
&lt;p&gt;The question was:&lt;/p&gt;
&lt;h4 id="heading"&gt;&lt;em&gt;&amp;ldquo;If large multi-international companies are getting hacked in Europe who have millions if not billions of $$ and capacity to protect their IT systems - how can small/micro businesses protect their IT platforms and systems?&amp;rdquo;&lt;/em&gt;
&lt;/h4&gt;&lt;p&gt;Firstly - nobody is safe from an APT (&amp;ldquo;Advanced Persistent Threat&amp;rdquo;). The recent &lt;a class="link" href="https://twitter.com/search?q=NotPetya" target="_blank" rel="noopener"
 &gt;NotPetya&lt;/a&gt; outbreak was an APT - malicious actors hacked a Ukrainian firm that produced accounting software, and &lt;a class="link" href="https://medium.com/@thegrugq/pnyetya-yet-another-ransomware-outbreak-59afd1ee89d4" target="_blank" rel="noopener"
 &gt;used their software&amp;rsquo;s update facility&lt;/a&gt; to literally deliver malicious code specifically to the users of this particular software package (&amp;ldquo;M.E. Doc&amp;rdquo;). Nothing&amp;rsquo;s keeping folks safe from that level of sophistication.&lt;/p&gt;
&lt;p&gt;However, the exploit by which NotPetya &lt;em&gt;spreads&lt;/em&gt; was &lt;a class="link" href="https://technet.microsoft.com/en-us/library/security/ms17-010.aspx" target="_blank" rel="noopener"
 &gt;actually patched by Microsoft&lt;/a&gt; in &lt;strong&gt;March&lt;/strong&gt;. If people had updated their internet-connected devices, this virus would have been limited to only users of M.E. Doc.&lt;/p&gt;
&lt;p&gt;Aside from that though, there&amp;rsquo;s actually a disappointingly simple answer to this. Security is actually relatively within reach, if we all follow these simple steps:&lt;/p&gt;
&lt;h3 id="1--update-everything-at-every-opportunity"&gt;1) Update. Everything. At every opportunity.
&lt;/h3&gt;&lt;p&gt;That includes Windows Updates, but also &lt;a class="link" href="http://cve.mitre.org/cgi-bin/cvekey.cgi?keyword=adobe&amp;#43;reader" target="_blank" rel="noopener"
 &gt;Adobe Reader&lt;/a&gt; (annoying!), &lt;a class="link" href="http://cve.mitre.org/cgi-bin/cvekey.cgi?keyword=java" target="_blank" rel="noopener"
 &gt;Java&lt;/a&gt; (double annoying!), &lt;a class="link" href="https://twitter.com/taviso/status/860679110728622080" target="_blank" rel="noopener"
 &gt;anti-virus engines&lt;/a&gt;, etc. This is absolutely the top priority, and the cybersecurity industry has been trotting this line out for years, but people just don&amp;rsquo;t. Because annoying.&lt;/p&gt;
&lt;p&gt;Real life incident: June 22, 2017 - Honda falls prey to the WannaCry worm, 37 days after release (four months after the patch was released), due to poor patching hygiene.&lt;/p&gt;
&lt;p&gt;See &lt;a class="link" href="http://thehackernews.com/2017/06/honda-wannacry-attack.html" target="_blank" rel="noopener"
 &gt;http://thehackernews.com/2017/06/honda-wannacry-attack.html&lt;/a&gt;&lt;/p&gt;
&lt;h3 id="2--backup-everything-important"&gt;2) Backup everything important.
&lt;/h3&gt;&lt;p&gt;The more important it is, the more places you should keep it. You should have at least three copies of every important file. THIS IS ANNOYING, but if you don&amp;rsquo;t do it, data loss will hit you. Something like &lt;a class="link" href="https://www.crashplan.com" target="_blank" rel="noopener"
 &gt;Crashplan&lt;/a&gt; (a low-cost service that sends backups to the cloud), plus a regular (weekly?) copy to a read-only media (e.g. a DVD), should be enough for a small business.&lt;/p&gt;
&lt;p&gt;Real life incident: Feb 1, 2017 - GitLabs suffers a major outage after data was accidentally deleted, followed by a sequence of discoveries that none of their five layers of backup or replication techniques “are working reliably or set up in the first place”.&lt;/p&gt;
&lt;p&gt;See &lt;a class="link" href="https://techcrunch.com/2017/02/01/gitlab-suffers-major-backup-failure-after-data-deletion-incident/" target="_blank" rel="noopener"
 &gt;https://techcrunch.com/2017/02/01/gitlab-suffers-major-backup-failure-after-data-deletion-incident/&lt;/a&gt;&lt;/p&gt;
&lt;h3 id="3--use-next-generation-anti-virus-software"&gt;3) Use next-generation anti-virus software.
&lt;/h3&gt;&lt;p&gt;Many of the AV products these days include very clever ways of analysing the behaviour of unknown software, and literally just rolling back all the changes if the AV decides it&amp;rsquo;s not trustworthy. &lt;a class="link" href="https://www.webroot.com" target="_blank" rel="noopener"
 &gt;Webroot&lt;/a&gt; is a good example of this, at a very affordable price.&lt;/p&gt;
&lt;p&gt;Real life incident: April 23, 2017 - the Adylkuzz virus started quietly spreading around the internet, and setting up Monero cryptocurrency mining operations on infected PC&amp;rsquo;s. Because the payload wasn&amp;rsquo;t destructive, it flew under the radar and was missed by many antiviruses for weeks.&lt;/p&gt;
&lt;p&gt;See &lt;a class="link" href="https://www.proofpoint.com/us/threat-insight/post/adylkuzz-cryptocurrency-mining-malware-spreading-for-weeks-via-eternalblue-doublepulsar" target="_blank" rel="noopener"
 &gt;https://www.proofpoint.com/us/threat-insight/post/adylkuzz-cryptocurrency-mining-malware-spreading-for-weeks-via-eternalblue-doublepulsar&lt;/a&gt;&lt;/p&gt;
&lt;h3 id="4--be-alert-cautious-and-sufficiently-paranoid"&gt;4) Be alert, cautious, and sufficiently paranoid.
&lt;/h3&gt;&lt;p&gt;The last - and hardest - step is to maintain a healthy sense of distrust; sometimes referred to as &amp;ldquo;&lt;a class="link" href="https://pthree.org/2013/10/04/sufficient-paranoia/" target="_blank" rel="noopener"
 &gt;sufficient paranoia&lt;/a&gt;&amp;rdquo;. When you receive an email, ask yourself: is this email in-character for this person? Is the spelling what I&amp;rsquo;d expect? Is it appropriate? Is it asking me to take an action (even if that action is just opening a file)? If so, is it expected, or is it out of the blue? If it&amp;rsquo;s out of the blue, why? What&amp;rsquo;s the story behind that?&lt;/p&gt;
&lt;p&gt;Real life incident: Sept 30, 2011 - I received an email from a lady I&amp;rsquo;d once interviewed for a job. It was a distraught email saying she was stuck in Wales, had been mugged, lost all her money, and needed a brief loan until she got home. I wrote her an email (not a reply), telling her email had been hacked; lo and behold, I got a reply! &amp;ldquo;It&amp;rsquo;s me&amp;hellip; this is for real, i have checked with the consulate but there is nothing really working out, most important is i don&amp;rsquo;t have enough money on please, please i need you to loan me some, i can pay you back once i get home.&amp;rdquo;&lt;/p&gt;
&lt;p&gt;I ended up finding her cellphone number and sending her a message - she was at home, safe and sound.&lt;/p&gt;
&lt;p&gt;See &lt;a class="link" href="https://blog.malwarebytes.com/cybercrime/2014/08/email-hijack-leads-to-i-was-robbed-send-me-money-scam/" target="_blank" rel="noopener"
 &gt;https://blog.malwarebytes.com/cybercrime/2014/08/email-hijack-leads-to-i-was-robbed-send-me-money-scam/&lt;/a&gt; &amp;ndash; this was exactly the wording I received.&lt;/p&gt;
&lt;h3 id="geez-that-was-a-long-facebook-post-eric"&gt;Geez, that was a long Facebook post Eric.
&lt;/h3&gt;&lt;p&gt;It really was, and a few minutes afterwards, this tweet came to my attention:&lt;/p&gt;
&lt;p&gt;&lt;a class="link" href="https://twitter.com/josephfcox/status/879982828418719744" target="_blank" rel="noopener"
 &gt;https://twitter.com/josephfcox/status/879982828418719744&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;It&amp;rsquo;s fun to laugh, but it&amp;rsquo;s a good reminder that there&amp;rsquo;s always going to be a weakness. You need to structure your business disaster recovery in a way that you can quickly and efficiently deal with a complete wipe-out like this.&lt;/p&gt;
&lt;h3 id="and-were-done"&gt;And we&amp;rsquo;re done.
&lt;/h3&gt;&lt;p&gt;So, to summarise this essay, you need to:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Always install updates&lt;/li&gt;
&lt;li&gt;Always take backups&lt;/li&gt;
&lt;li&gt;Use AV software with full journaling and rollback capabilities&lt;/li&gt;
&lt;li&gt;Practice sufficient paranoia&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;With these four steps, you will be as safe as the biggest corporate. (roughly speaking)&lt;/p&gt;</description></item><item><title>RingZer0team CTF - Challenge 44</title><link>https://www.ericlight.com/post/r0-44.html</link><pubDate>Sat, 24 Jun 2017 00:00:00 +1200</pubDate><guid>https://www.ericlight.com/post/r0-44.html</guid><description>&lt;p&gt;There are a bunch of fantastic Capture The Flag security challenges on &lt;a class="link" href="https://www.ringzer0team.com" target="_blank" rel="noopener"
 &gt;RingZer0Team.com&lt;/a&gt;. I&amp;rsquo;ve been working through some of these for a wee while now, and with the &lt;a class="link" href="https://www.cybersecuritychallenge.org.nz/" target="_blank" rel="noopener"
 &gt;New Zealand Cyber Security Challenge&lt;/a&gt; coming up again soon, I thought I&amp;rsquo;d get back into some of them.&lt;/p&gt;
&lt;p&gt;Challenge 56 (&amp;ldquo;Hey Chuck where is the flag?&amp;rdquo;, under the Forensic Challenges) started by only offering a .pcap file. I downloaded Wireshark and had a quick dig. The packet capture consisted of a brief browse of a &amp;ldquo;Chuck Norris Facts&amp;rdquo; website.&lt;/p&gt;
&lt;p&gt;After quickly flicking through the pcap itself looking for low-hanging fruit, I used File -&amp;gt; Export Objects -&amp;gt; HTTP. This takes all the HTTP traffic, recombines the packets into files, and saves them.&lt;/p&gt;
&lt;p&gt;Once I&amp;rsquo;d done that, I opened up the files and had a quick flick through. I checked the images for metadata etc but didn&amp;rsquo;t find anything. However I did fine a picture of Chuck Norris, appearing to urge the reader to keep searching files &amp;ndash; in French.&lt;/p&gt;
&lt;p&gt;When I didn&amp;rsquo;t find anything super-obvious in the image contents, I hopped into Bash and just ran &lt;code&gt;grep -i flag *&lt;/code&gt;. It quickly returned the flag, stored in a php file!&lt;/p&gt;
&lt;p&gt;Nice and easy hunt, great way to finish the day.&lt;/p&gt;</description></item><item><title>RingZer0team CTF - Challenge 65</title><link>https://www.ericlight.com/post/r0-65.html</link><pubDate>Sat, 24 Jun 2017 00:00:00 +1200</pubDate><guid>https://www.ericlight.com/post/r0-65.html</guid><description>&lt;p&gt;This is a continuation of my series on &lt;a class="link" href="https://www.ringzer0team.com" target="_blank" rel="noopener"
 &gt;RingZer0Team.com&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Challenge 65 (&amp;ldquo;Hide my ass in my home&amp;rdquo;, under the Forensic challenges) is a nice quick little forensic challenge. You get to download a .tar file, and do a bit of digging to uncover the flag.&lt;/p&gt;
&lt;p&gt;This was a nice easy few minutes. After downloading the archive, I discovered a few files inside - including a &lt;em&gt;particularly groovy&lt;/em&gt; electronica swing track, which I&amp;rsquo;m listening to again right now. Yeaaaaahhhhh.&lt;/p&gt;
&lt;p&gt;Apart from a groovy mp3, the archive contains some dot-files such as .bash_history, a .jpg picture, an index.html, and some other bits.&lt;/p&gt;
&lt;p&gt;I found the Flag in one of the dot-files; specifically, it was inside a Vim swap file that seemed to be leftover from a power failure or similar.&lt;/p&gt;</description></item><item><title>WireGuard - Part Three (Troubleshooting)</title><link>https://www.ericlight.com/post/wg2.html</link><pubDate>Mon, 12 Jun 2017 00:00:00 +1200</pubDate><guid>https://www.ericlight.com/post/wg2.html</guid><description>&lt;p&gt;This is part of my &lt;a class="link" href="https://www.ericlight.com/post/wg0.html" &gt;brief&lt;/a&gt; &lt;a class="link" href="https://www.ericlight.com/post/wg1.html" &gt;series&lt;/a&gt; on &lt;a class="link" href="https://wireguard.com/" target="_blank" rel="noopener"
 &gt;WireGuard&lt;/a&gt;. I&amp;rsquo;m pretty enamoured with WireGuard and the way it works, but there were a couple slightly curly bits that I needed to get my head around. This troubleshooting guide is a rough dump of the issues I had, and how I fixed them.&lt;/p&gt;
&lt;h2 id="gotten-stuck"&gt;Gotten Stuck?
&lt;/h2&gt;&lt;p&gt;At this stage, there are actually a few ways that this can go wrong, even though we haven&amp;rsquo;t done much. Think through all the bits:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Installed WireGuard at both ends&lt;/li&gt;
&lt;li&gt;Set up your NAT rule on the remote side&lt;/li&gt;
&lt;li&gt;Created a private and public key on each side&lt;/li&gt;
&lt;li&gt;Put each public key in the opposite side&amp;rsquo;s [Peer] config&lt;/li&gt;
&lt;li&gt;Put a suitable IP address on each side&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="troubleshooting"&gt;Troubleshooting
&lt;/h2&gt;&lt;p&gt;There are, actually, a myriad of ways this can fail:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Broken routing on the client PC&lt;/li&gt;
&lt;li&gt;Broken NAT on the remote router&lt;/li&gt;
&lt;li&gt;Broken routing on the remote PC&lt;/li&gt;
&lt;li&gt;Broken wg0 configuration on one side&lt;/li&gt;
&lt;li&gt;Lack of TCP forwarding on the remote computer&lt;/li&gt;
&lt;li&gt;Lack of Proxy ARP on the remote computer&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;If you can&amp;rsquo;t ping the remote server yet, don&amp;rsquo;t panic. Run tcpdump to find out what you&amp;rsquo;re missing.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;On the remote server: &lt;code&gt;tcpdump -i wg0&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;On your local machine: &lt;code&gt;ping -c1 10.20.40.1&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;That will tell you whether your packets are reaching the remote server, or if they&amp;rsquo;re not getting through the tunnel.&lt;/p&gt;
&lt;p&gt;If they&amp;rsquo;re not making it through the tunnel at all, you&amp;rsquo;ll probably be seeing error messages in the ping. For example:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;PING 10.20.10.1 (10.20.10.1) 56(84) bytes of data.
From 10.20.40.2 icmp_seq=1 Destination Host Unreachable
ping: sendmsg: Required key not available
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;That&amp;rsquo;s the error message I got when I set AllowedIPs too strictly. Because I was trying to ping something that was &lt;strong&gt;routable&lt;/strong&gt;, but wasn&amp;rsquo;t within the AllowedIPs range, there was no applicable key for the packet.&lt;/p&gt;
&lt;h2 id="thanks"&gt;Thanks
&lt;/h2&gt;&lt;p&gt;Huge gratitude to &lt;a class="link" href="https://www.zx2c4.com/" target="_blank" rel="noopener"
 &gt;Jason Donenfeld&lt;/a&gt; (aka zx2c4) for spending his time not only reading this post, but also for sending me some fantastic feedback! I&amp;rsquo;d made some bungles in my original post on this topic, and he vastly helped my understanding.&lt;/p&gt;
&lt;p&gt;Also, huge gratitude to another Jason (&lt;a class="link" href="https://keybase.io/rendition" target="_blank" rel="noopener"
 &gt;@rendition&lt;/a&gt;) who has helped me develop from a junior network admin into a &amp;hellip; &amp;lsquo;moderate&amp;rsquo; network admin. I&amp;rsquo;ve learned more in the last year than I ever thought possible. He&amp;rsquo;s taught me nearly everything I know about managed networking, reviewed this post for me, and is actually the guy who introduced me to WireGuard originally!&lt;/p&gt;</description></item><item><title>WireGuard - Part Two (VPN routing)</title><link>https://www.ericlight.com/post/wg1.html</link><pubDate>Sun, 11 Jun 2017 00:00:00 +1200</pubDate><guid>https://www.ericlight.com/post/wg1.html</guid><description>&lt;p&gt;This is a continuation of my brief series on the new &lt;a class="link" href="https://wireguard.com/" target="_blank" rel="noopener"
 &gt;WireGuard&lt;/a&gt; VPN. &lt;a class="link" href="https://www.ericlight.com/post/wg0.html" &gt;Part One&lt;/a&gt; was about the simple building-blocks to get WireGuard working between two endpoints. Now that we&amp;rsquo;ve got a couple machines able to ping each other by IP address, we can carry on a bit deeper into the inter-LAN routing stuff.&lt;/p&gt;
&lt;p&gt;Extending on from the IP addresses in Part One, instead of JUST connecting to the remote machine, I want to actually have access to everything &lt;em&gt;on the whole 10.20.0.0/16 network&lt;/em&gt;; even the non-WireGuard devices. I want it to be like I&amp;rsquo;m there on-site. The idea here is roughly:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Remote machine:&lt;/strong&gt; wg0: 10.20.40.1 (behind public IP 163.172.161.0)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Local machine:&lt;/strong&gt; wg0: 10.20.40.2 (with eth0 on 192.168.88.207)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Machines on remote LAN:&lt;/strong&gt; 10.20.0.0/16&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Remote LAN Watchguard range:&lt;/strong&gt; 10.20.40.0/16 &amp;ndash; note this is within the remote 10.20.0.0/16 range&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;From my local machine, with minimal interaction, I want to be able to ping something like 10.20.&lt;strong&gt;10.30&lt;/strong&gt;, and get a response.&lt;/p&gt;
&lt;p&gt;Happily, now that the two endpoints are talking with each other, there&amp;rsquo;s really not much that has to happen to get things working the way I want.&lt;/p&gt;
&lt;h2 id="remote-config"&gt;Remote Config
&lt;/h2&gt;&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Many Linux distros disable IPv4 packet forwarding by default. But in this case, we very much want this enabled. Edit your &lt;code&gt;/etc/sysctl.conf&lt;/code&gt; file, and look for the line: &lt;code&gt;net.ipv4.ip_forward&lt;/code&gt;, and set the value to 1. You may need to add this line manually, or uncomment it.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;You&amp;rsquo;ll also need to enable ProxyARP. This is another kernel setting that&amp;rsquo;s usually disabled, so edit &lt;code&gt;/etc/sysctl.conf&lt;/code&gt;, and add the following line: &lt;code&gt;net.ipv4.conf.all.proxy_arp = 1&lt;/code&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Reload your kernel settings. A reboot will do the trick, or you could just run &lt;code&gt;sudo sysctl -p /etc/sysctl.conf&lt;/code&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="starting-wireguard-on-boot"&gt;Starting WireGuard on Boot
&lt;/h2&gt;&lt;p&gt;There are a variety options to do this, and if you&amp;rsquo;re a seasoned sysadmin you probably already have a favourite way.&lt;/p&gt;
&lt;p&gt;One option is to add &lt;code&gt;post-up wg-quick up wg0&lt;/code&gt; to the tail of your eth0 block (or appropriate interface) in /etc/network/interfaces.&lt;/p&gt;
&lt;p&gt;A second option (for systemd users) is to simply run &lt;code&gt;systemctl enable wg-quick@wg0&lt;/code&gt;. This will tell systemd to bring the wg0 interface up once a network connection is established.&lt;/p&gt;
&lt;p&gt;I only do this on the remote machine, because I don&amp;rsquo;t want my local machine to be forever spinning up it&amp;rsquo;s WireGuard connection; however I always want the remote machine listening for my packets. That said, there&amp;rsquo;s probably no reason to avoid this; I just haven&amp;rsquo;t done it yet.&lt;/p&gt;
&lt;h2 id="local-config"&gt;Local Config
&lt;/h2&gt;&lt;p&gt;Here&amp;rsquo;s the really cool bit. Since your remote machine is now set up to perform IPv4 forwaring and ProxyARP, the only thing you need to change on the local side is a single number. Or rather, a couple numbers.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;In your &lt;code&gt;/etc/WireGuard/wg0.conf&lt;/code&gt; file, just expand the network range of your interface to include the entire remote LAN:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt; [Interface]
 ...
 Address = 10.20.40.2/16

 [Peer]
 ...
 AllowedIPs = 10.20.0.0/16
&lt;/code&gt;&lt;/pre&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Now reload your WireGuard config, either by rebooting, or running &lt;code&gt;sudo wg-quick down wg0 &amp;amp;&amp;amp; sudo wg-quick up wg0&lt;/code&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;That&amp;rsquo;s all! When you make the above changes, wg-quick will modify your routing table so that &lt;strong&gt;any IP within 10.20.x.y&lt;/strong&gt; will be sent over the wg0 interface. The remote host will dutifully forward the packet out into the rest of the network, and ProxyARP will take care of the rest:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;$ ping -c1 10.20.10.31
PING 10.20.10.31 (10.20.10.31) 56(84) bytes of data.
64 bytes from 10.20.10.31: icmp_seq=1 ttl=63 time=91.8 ms
&lt;/code&gt;&lt;/pre&gt;
&lt;h2 id="troubleshooting"&gt;Troubleshooting
&lt;/h2&gt;&lt;p&gt;Okay so by now there&amp;rsquo;s a really good chance that you&amp;rsquo;ve bumped into trouble. I&amp;rsquo;ve started on a basic &lt;a class="link" href="https://www.ericlight.com/post/wg2.html" &gt;WireGuard troubleshooting guide&lt;/a&gt;, but it only covers the issues that I bumped into. If you&amp;rsquo;re still stuck after reading through that, ask a question on the WireGuard Mailing List, or reach out via IRC (#WireGuard on Freenode) - this is all on &lt;a class="link" href="https://www.wireguard.com/#contact-the-team" target="_blank" rel="noopener"
 &gt;the WireGuard website&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id="wrap-up"&gt;Wrap-up
&lt;/h2&gt;&lt;p&gt;That should be all! When you reboot the remote server (I specify reboot, because you want to test that your solution can survive an outage at the remote site), you should be able to ping other things in the remote LAN without any additional interaction. I still manually run &lt;code&gt;wg-quick up wg0&lt;/code&gt; on my local laptop, because I don&amp;rsquo;t want to be connected remotely &lt;em&gt;all&lt;/em&gt; the time.&lt;/p&gt;
&lt;h2 id="thanks"&gt;Thanks
&lt;/h2&gt;&lt;p&gt;Huge gratitude to &lt;a class="link" href="https://www.zx2c4.com/" target="_blank" rel="noopener"
 &gt;Jason Donenfeld&lt;/a&gt; (aka zx2c4) for spending his time not only reading this post, but also for sending me some fantastic feedback! I&amp;rsquo;d made some bungles in my original post on this topic, and he vastly helped my understanding.&lt;/p&gt;
&lt;p&gt;If you do end up using WireGuard, &lt;em&gt;go forth and &lt;a class="link" href="https://www.wireguard.com/#donations" target="_blank" rel="noopener"
 &gt;donate&lt;/a&gt;&lt;/em&gt;! Seriously, &lt;strong&gt;at very least&lt;/strong&gt;, send Jason the cost of a local cup of coffee or a beer for his efforts.&lt;/p&gt;
&lt;p&gt;Also, huge gratitude to another Jason (&lt;a class="link" href="https://keybase.io/rendition" target="_blank" rel="noopener"
 &gt;@rendition&lt;/a&gt;) who has helped me develop from a junior network admin into a &amp;hellip; &amp;lsquo;moderate&amp;rsquo; network admin. I&amp;rsquo;ve learned more in the last year than I ever thought possible. He&amp;rsquo;s taught me nearly everything I know about managed networking, reviewed this post for me, and is actually the guy who introduced me to WireGuard originally!&lt;/p&gt;</description></item><item><title>WireGuard - Part One (Installation)</title><link>https://www.ericlight.com/post/wg0.html</link><pubDate>Sat, 03 Jun 2017 00:00:00 +1200</pubDate><guid>https://www.ericlight.com/post/wg0.html</guid><description>&lt;p&gt;&lt;a class="link" href="https://wireguard.com/" target="_blank" rel="noopener"
 &gt;WireGuard&lt;/a&gt; is the most excellent VPN stack around. It&amp;rsquo;s &lt;em&gt;really&lt;/em&gt; fast, the concept of Cryptokey Routing is awesome, and I love the speed and simplicity benefits that come from opionionated cryptography. The protocol is so simple - expressed in a mere 4k lines of code - that it&amp;rsquo;s auditable by anyone.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;But.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;With my initial naive approach, I found myself using HTTPS, over ports forwarded over SSH tunnels, connected over WireGuard. Although it was straightforward to get WireGuard working between two endpoints, I ended up in nested-crypto hell.&lt;/p&gt;
&lt;p&gt;So, this brief series is about making WireGuard work as a VPN onto a different site. We&amp;rsquo;ll start by making it work between two endpoints, and &lt;a class="link" href="https://www.ericlight.com/post/wg1.html" &gt;we&amp;rsquo;ll go forward from there&lt;/a&gt;. My end goal is to have access to all the resources on a remote site, just by running &lt;code&gt;wg-quick up wg0&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;The endpoints I&amp;rsquo;m going to set up are at:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Remote machine:&lt;/strong&gt; wg0: 10.20.40.1 (behind public IP 163.172.161.0)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Local machine:&lt;/strong&gt; wg0: 10.20.40.2&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="nat-setup"&gt;NAT Setup
&lt;/h2&gt;&lt;p&gt;Chances are, your remote endpoint is behind a firewall of some sort. Pick a high port, and configure your firewall to forward UDP packets on that port through to your remote WireGuard endpoint. You don&amp;rsquo;t need to do this on your local side, because reply traffic from the remote side will generally be handled by the stateful session part of your firewall.&lt;/p&gt;
&lt;p&gt;Many routers and firewalls offer port address translation (also known as PAT) as part of port forwarding or NAT. This is when a packet hits the firewall on (say) port 57432, and the firewall puts it on the LAN to port 22, for example. You don&amp;rsquo;t want this. I think it&amp;rsquo;s possible with WireGuard, but it adds complexity without benefit.&lt;/p&gt;
&lt;h2 id="config---remote-site"&gt;Config - Remote Site
&lt;/h2&gt;&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://www.wireguard.com/install/" target="_blank" rel="noopener"
 &gt;Install WireGuard&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Generate your keys. The following will create a public key and a stub config in /etc/WireGuard/:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt; cd /etc/WireGuard
 umask 077
 printf &amp;quot;[Interface]\nPrivateKey = &amp;quot; &amp;gt; wg0.conf
 wg genkey | tee -a wg0.conf | wg pubkey &amp;gt; publickey
&lt;/code&gt;&lt;/pre&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Edit your config to match:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt; [Interface]
 PrivateKey = WhAt3v3R= (this is the private key generated on this machine)
 ListenPort = 12345 (this is the UDP port you've forwarded from your firewall)
 Address = 10.20.40.1/24 (this will be the IP given to the wg0 interface)

 [Peer]
 PublicKey = (leave this blank for now; you'll paste in your local public key here soon)
 AllowedIPs = 10.20.40.0/24 (this is the range of WireGuard IP addresses that this Peer's key can be used from)
&lt;/code&gt;&lt;/pre&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;That should be all you need to configure on the remote side for now. Save your wg0.conf file, and bring the interface up:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt; wg-quick up wg0
 ping -c1 10.20.40.1
&lt;/code&gt;&lt;/pre&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;You should see a bunch of actions performed by wg-quick, and a reply packet from your ping. Now onto the local side.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="config---local-machine"&gt;Config - Local Machine
&lt;/h2&gt;&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Install WireGuard and generate your keys, as per the first two steps above.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Edit your configuration again:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt; [Interface]
 PrivateKey = WhAt3v3R+PaRt-tw0= (this is the private key generated on this machine)
 ListenPort = 12345 (this is the UDP port again; I don't think they have to be the same)
 Address = 10.20.40.2/24 (note - different IP address, but in the same range)

 [Peer]
 PublicKey = ?????????? (copy the public key from the REMOTE server here)
 Endpoint = 163.172.161.0:12345 (enter the PUBLIC IP address of the remote site, plus the forwarded port)
 AllowedIPs = 10.20.40.0/24 (specifying that packets using this key must come from within 10.20.40.x)
&lt;/code&gt;&lt;/pre&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Now that you&amp;rsquo;ve got a local public key, take a second to paste it into the Peer public key section on the remote server.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Once you&amp;rsquo;re finished you should be able to bring the interface up and ping it:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt; wg-quick up wg0
 ping -c1 10.20.40.2
&lt;/code&gt;&lt;/pre&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&amp;hellip; and you should even be able to ping the remote server as well:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt; ping -c1 10.20.40.1
&lt;/code&gt;&lt;/pre&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="gotten-stuck"&gt;Gotten Stuck?
&lt;/h2&gt;&lt;p&gt;At this stage, there are actually a few ways that this can go wrong, even though we haven&amp;rsquo;t done much. Here&amp;rsquo;s a quick summary of everything we&amp;rsquo;ve done:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Installed WireGuard at both ends&lt;/li&gt;
&lt;li&gt;Set up your NAT rule on the remote side&lt;/li&gt;
&lt;li&gt;Created a private and public key on each side&lt;/li&gt;
&lt;li&gt;Put each public key in the opposite side&amp;rsquo;s [Peer] config&lt;/li&gt;
&lt;li&gt;Put a suitable IP address on each side&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;If you&amp;rsquo;ve nailed each of those and you&amp;rsquo;re still having trouble, you can have a quick look at the brief Troubleshooting guide I&amp;rsquo;ve put together as &lt;a class="link" href="https://www.ericlight.com/post/wg2.html" &gt;Part Three&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id="onto-part-two"&gt;Onto Part Two
&lt;/h2&gt;&lt;p&gt;That should be all you need to get WireGuard working between two machines on two different sites. So far we haven&amp;rsquo;t done anything either interesting or uncommon - this is all the basic stuff you&amp;rsquo;ll find on the &lt;a class="link" href="https://www.wireguard.com/quickstart/" target="_blank" rel="noopener"
 &gt;WireGuard Quick Start&lt;/a&gt; page, although expressed slightly differently. &lt;a class="link" href="https://www.ericlight.com/post/wg1.html" &gt;The next article&lt;/a&gt; will be a bit more about intra-site routing.&lt;/p&gt;
&lt;h2 id="thanks"&gt;Thanks
&lt;/h2&gt;&lt;p&gt;Huge gratitude to &lt;a class="link" href="https://www.zx2c4.com/" target="_blank" rel="noopener"
 &gt;Jason Donenfeld&lt;/a&gt; (aka zx2c4) for spending his time not only reading this post, but also for sending me some fantastic feedback! I&amp;rsquo;d made some bungles in my original post on this topic, and he vastly helped my understanding.&lt;/p&gt;
&lt;p&gt;If you do end up using WireGuard, &lt;em&gt;go forth and &lt;a class="link" href="https://www.wireguard.com/#donations" target="_blank" rel="noopener"
 &gt;donate&lt;/a&gt;&lt;/em&gt;! Seriously, &lt;strong&gt;at very least&lt;/strong&gt;, send Jason the cost of a local cup of coffee or a beer for his efforts.&lt;/p&gt;
&lt;p&gt;Also, huge gratitude to another Jason (&lt;a class="link" href="https://keybase.io/rendition" target="_blank" rel="noopener"
 &gt;@rendition&lt;/a&gt;) who has helped me develop from a junior network admin into a &amp;hellip; &amp;lsquo;moderate&amp;rsquo; network admin. I&amp;rsquo;ve learned more in the last year than I ever thought possible. He&amp;rsquo;s taught me nearly everything I know about managed networking, reviewed this post for me, and is actually the guy who introduced me to WireGuard originally!&lt;/p&gt;</description></item><item><title>Pan-fried Spicy Miso Chicken</title><link>https://www.ericlight.com/post/miso-chicken.html</link><pubDate>Mon, 29 May 2017 00:00:00 +1200</pubDate><guid>https://www.ericlight.com/post/miso-chicken.html</guid><description>&lt;p&gt;Jeez I just discovered I&amp;rsquo;ve only posted a single recipe on this. Time to change that.&lt;/p&gt;
&lt;p&gt;Chicken for dinner tonight. I was feeling a little adventurous, and definitely wanted some miso involved, but also felt like cayenne pepper and shallow-fried chicken strips. Here&amp;rsquo;s the result! This went really well on a base of bulgur wheat, and with a side of stir fried veggies.&lt;/p&gt;
&lt;h2 id="ingredients"&gt;Ingredients
&lt;/h2&gt;&lt;ul&gt;
&lt;li&gt;Two chicken breasts, skinless&lt;/li&gt;
&lt;li&gt;2 tsp miso paste&lt;/li&gt;
&lt;li&gt;2/3 cup plain flour&lt;/li&gt;
&lt;li&gt;2 tsp celery salt&lt;/li&gt;
&lt;li&gt;1 1/2 tsp onion powder&lt;/li&gt;
&lt;li&gt;2 tsp smoked paprika&lt;/li&gt;
&lt;li&gt;1 tsp chicken stock powder&lt;/li&gt;
&lt;li&gt;1/8 tsp cayenne pepper&lt;/li&gt;
&lt;li&gt;1/2 tsp black pepper&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="method"&gt;Method
&lt;/h2&gt;&lt;ul&gt;
&lt;li&gt;Cut the chicken into strips, sized similarly to your two thumbs together.&lt;/li&gt;
&lt;li&gt;Sift all the dry ingredients into a bowl, and stir or shake until mixed.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Taste your flour coating!!&lt;/strong&gt; Make sure it&amp;rsquo;s delicious, and make sure it&amp;rsquo;s spicy enough.&lt;/li&gt;
&lt;li&gt;Mix your miso paste with a little hot water until smooth. &lt;strong&gt;It should be quite thick&lt;/strong&gt;, you don&amp;rsquo;t want it dripping off.&lt;/li&gt;
&lt;li&gt;Coat all the chicken in the miso paste.&lt;/li&gt;
&lt;li&gt;Roll the chicken strips in the flour until thoroughly coated.&lt;/li&gt;
&lt;li&gt;Pan-fry in a very hot pan, for about 2 minutes per side.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Enjoy!&lt;/p&gt;</description></item><item><title>RingZer0team CTF - Linux Sysadmin challenges</title><link>https://www.ericlight.com/post/r0-sysadmin.html</link><pubDate>Sun, 28 May 2017 00:00:00 +1200</pubDate><guid>https://www.ericlight.com/post/r0-sysadmin.html</guid><description>&lt;p&gt;There are a bunch of fantastic Capture The Flag security challenges on &lt;a class="link" href="https://www.ringzer0team.com" target="_blank" rel="noopener"
 &gt;RingZer0Team.com&lt;/a&gt;. I&amp;rsquo;ve been working through some of these for a wee while now, and with the &lt;a class="link" href="https://www.cybersecuritychallenge.org.nz/" target="_blank" rel="noopener"
 &gt;New Zealand Cyber Security Challenge&lt;/a&gt; coming up again soon, I thought I&amp;rsquo;d get back into some of them.&lt;/p&gt;
&lt;p&gt;The Sysadmin Linux series of challenges is where you&amp;rsquo;re trying to breach the security of a Linux system. I actually finished most of these last year, but I wanted to finish my last two. Of course, to get to the last two stages, you need to use the flags from the &lt;em&gt;previous&lt;/em&gt; stages. So I&amp;rsquo;m revisiting them.&lt;/p&gt;
&lt;h2 id="level-1---morpheus---trinity"&gt;Level 1 - Morpheus -&amp;gt; Trinity
&lt;/h2&gt;&lt;p&gt;We start by SSH&amp;rsquo;ing into a particular user account on the ringzer0team server:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;You have mail.
Last login: Thu Apr 27 02:52:40 2017 from &amp;lt;somewhere&amp;gt;
morpheus@forensics:~$ 
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;There&amp;rsquo;s only one file in the home folder, and I can&amp;rsquo;t read it. There&amp;rsquo;s a /home/trinity folder with full read access, but also nothing legible.&lt;/p&gt;
&lt;p&gt;The flag for level 1 is found by running ps aux, which reveals what appears to be Trinity&amp;rsquo;s password:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;root 3241 0.0 0.0 4188 572 ? S Jan14 1:44 /bin/sh /root/backup.sh -u trinity -p Flag-&amp;lt;redacted&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;h2 id="level-2---morpheus---architect"&gt;Level 2 - Morpheus -&amp;gt; Architect
&lt;/h2&gt;&lt;p&gt;Aha, and the flag for level two is in /etc/fstab, which contains what appears to be The Architect&amp;rsquo;s password, in base64:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;/dev/sr0 /media/cdrom0 udf,iso9660 user,noauto 0 0
/dev/fd0 /media/floppy0 auto rw,user,noauto 0 0
#//TheMAtrix/phone /media/Matrix cifs username=architect,password=$(base64 -d &amp;quot;&amp;lt;redacted&amp;gt;&amp;quot;),iocharset=utf8,sec=ntlm 0 0
&lt;/code&gt;&lt;/pre&gt;
&lt;h2 id="level-3---the-architect"&gt;Level 3 - The Architect
&lt;/h2&gt;&lt;p&gt;Level 3 requires you to log on as architect, using the password we discovered earlier. The only clue is &amp;ldquo;dig for password&amp;rdquo;.&lt;/p&gt;
&lt;p&gt;This bit got a bit harder. There are a couple possible hints in architect&amp;rsquo;s mail file, including a bunch of attempts to mount a cifs volume, and reference to a file in /backup/.&lt;/p&gt;
&lt;p&gt;Digging through the files in /backup left me at a loss. There are references to /tmp/Gathering.py, but that&amp;rsquo;s a challenge for later (cypher&amp;rsquo;s challenge). After some digging I located /var/tmp/.swl, which contained some MySQL credentials!&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;mysql&amp;gt; show tables;
+----------------+
| Tables_in_arch |
+----------------+
| arch |
| flag |
+----------------+
2 rows in set (0.00 sec)

mysql&amp;gt; select * from arch;
+------+-----------------------+
| id | arch |
+------+-----------------------+
| 1 | The one |
| 1 | The null one |
| 1 | The mother of the one |
| 1 | The father of the one |
| 1 | The flag of the one |
| 1 | The null one |
+------+-----------------------+
6 rows in set (0.00 sec) 

mysql&amp;gt; select * from flag;
+---------------------------------+
| flag |
+---------------------------------+
| FLAG-&amp;lt;redacted&amp;gt; |
+---------------------------------+
1 row in set (0.00 sec)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Yasss after a solid hour of digging, I&amp;rsquo;ve found the flag for the third level!&lt;/p&gt;
&lt;h2 id="level-four---morpheus---oracle"&gt;Level Four - Morpheus -&amp;gt; Oracle
&lt;/h2&gt;&lt;p&gt;Again we&amp;rsquo;re logging on as morpheus, but this time the goal is to access the oracle account.&lt;/p&gt;
&lt;p&gt;Lots of tasty stuff under /var/tmp/.viminfo, now that I&amp;rsquo;ve found it. References to files in /backup/, to /tmp/Gathering.py, /tmp/mail_cypher&lt;/p&gt;
&lt;p&gt;Don&amp;rsquo;t make the mistake of trying to cat .swo; it&amp;rsquo;ll eat your console session.&lt;/p&gt;
&lt;p&gt;Found this interesting thing in mail, but it&amp;rsquo;s not helpful: &lt;code&gt;forensics.localdomain : Apr 14 21:14:33 : morpheus : user NOT in sudoers ; TTY=pts/4 ; PWD=/home/trinity ; USER=root ; COMMAND=/usr/sbin/usermod -aG neo morpheus&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;In one of the /backup files, I found the remains of an SSH key, and it worked! Access to the oracle account achieved. In the home folder, we&amp;rsquo;ve got a handy-dandy Base64-encoded flag in flag.txt.&lt;/p&gt;
&lt;h2 id="level-five---oracle-encrypted-file"&gt;Level Five - Oracle Encrypted File
&lt;/h2&gt;&lt;p&gt;There&amp;rsquo;s a file in the oracle home folder named encflag.txt.enc:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;U2FsdGVkX1+dCl4WEHNJKBqA8a4fQeheOgA7oiNmjwlJQvGaQAgqcIsGRIcbdHKF
heSs51JRSEmOLqVyGvoxDA--
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Decoding the base64 returns a binary blob, prefixed with the string &amp;ldquo;Salted&amp;rdquo;. This is one of the levels that I never completed originally, so maybe it&amp;rsquo;s time to give it another crack.&lt;/p&gt;
&lt;p&gt;A quick google of &amp;ldquo;salted base64&amp;rdquo; reveals an &lt;a class="link" href="https://security.stackexchange.com/a/124333" target="_blank" rel="noopener"
 &gt;interesting comment on StackExchange&lt;/a&gt;. Apparently I&amp;rsquo;m looking at a file encrypted with the OpenSSL &amp;rsquo;enc&amp;rsquo; command, so I first copy the file to my own computer to work.&lt;/p&gt;
&lt;p&gt;I discover that the command &lt;code&gt;openssl enc -in testfile -d -a&lt;/code&gt; will un-base64 it, then load the file in. I need to pass it a password to decrypt with though, so now I need to find that.&lt;/p&gt;
&lt;p&gt;Oh my god I just did &lt;code&gt;cat .*&lt;/code&gt; in the oracle home folder and literally found an alias that reads and decrypts the file. I can&amp;rsquo;t believe that took me almost an hour.&lt;/p&gt;
&lt;p&gt;There are no words.&lt;/p&gt;
&lt;h2 id="level-six---trinity---neo"&gt;Level Six - Trinity -&amp;gt; Neo
&lt;/h2&gt;&lt;p&gt;Okay getting serious now. Using Trinity&amp;rsquo;s account, I need to find the password for the neo account.&lt;/p&gt;
&lt;p&gt;It&amp;rsquo;s a bit noisy on login:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;You have mail.
Last login: Tue Apr 25 16:29:29 2017 from &amp;lt;le blah&amp;gt;
-bash: hello: command not found
Sup Neo!
ls: cannot open directory /home/neo: Permission denied
cat: phonebook: Permission denied
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;A vague tickle in my memory prompted me to run sudo -l right off the bat. Rewarded with:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;User trinity may run the following commands on this host:
 (neo) /bin/cat /home/trinity/*
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;So of course I immediately run &lt;code&gt;sudo -u neo /bin/cat /home/trinity/*&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;This gives us a &amp;lsquo;phone book&amp;rsquo; containing:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;The Oracle 1800-133-7133
Persephone 345-555-1244





copy made by Cypher copy utility on /home/neo/phonebook
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Trinity&amp;rsquo;s .bashrc contains a bit of kruft:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;hello neo
echo &amp;quot;Sup Neo!&amp;quot;
$(ls -lart /home/neo)
cat phonebook
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Really not useful. I remember finding Trinity&amp;rsquo;s password with &lt;code&gt;ps aux&lt;/code&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;root 3241 0.0 0.0 4188 572 ? S Jan14 1:47 /bin/sh /root/backup.sh -u trinity -p Flag-08grILsn3ekqhDK7cKBV6ka8B
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;It looks a little bit like a MySQL connection string, so I try that but no dice. Nothing under /var/tmp this time, and grep doesn&amp;rsquo;t find anything useful under the /backup goldmine.&lt;/p&gt;
&lt;p&gt;There&amp;rsquo;s some weirdness under /etc/passwd. I don&amp;rsquo;t know what this means, but saving it for later:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;trinity:x:1002:1002:trinity,%,lsdf(940998+(n.~,3):/home/trinity:/bin/bash
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;I looked through the mail file, but nothing jumped out at me there. Also trawled again through /backup, as well as /var/backups. Then /etc and /var. Argh.&lt;/p&gt;
&lt;p&gt;Finally I start looking for Persephone. Nothing helpful, but it reminds me of the last line in the phonebook.&lt;/p&gt;
&lt;p&gt;copy made by Cypher copy utility on /home/neo/phonebook&lt;/p&gt;
&lt;p&gt;And then I remember that the sudo command allows a * at the end of the cat command, which might allow me to do path traversal&amp;hellip;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;sudo -u neo /bin/cat /home/trinity/../neo/phonebook
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Finally, after a whole hour of digging, I&amp;rsquo;m awarded Neo&amp;rsquo;s password!&lt;/p&gt;
&lt;h2 id="level-7---neo-is-not-alone"&gt;Level 7 - Neo is Not Alone
&lt;/h2&gt;&lt;p&gt;I don&amp;rsquo;t know what this clue means, but I bet it has something to do with Persephone. Persephone comes from Greek mythology as one of Zeus&amp;rsquo; daughters, and the goddess of the underworld. Does that help me here? I don&amp;rsquo;t know, it&amp;rsquo;s getting late&amp;hellip;&lt;/p&gt;
&lt;p&gt;I run &lt;code&gt;cat .*&lt;/code&gt; in Neo&amp;rsquo;s home directory to see if there&amp;rsquo;s anything hiding there, but no luck this time. Also nothing for &lt;code&gt;sudo -l&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;There&amp;rsquo;s an unreadable file (owned by root) called &amp;lsquo;result.stat&amp;rsquo;, that&amp;rsquo;s probably related to something. I browse the mail history and see:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;forensics.localdomain : Dec 7 14:08:08 : neo : user NOT in sudoers ; TTY=pts/2 ; PWD=/home/neo ; USER=morpheus ; COMMAND=/home/morpheus/egrep /home/morpheus/../neo/result.stat
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;That could be handy. I do remember an egrep in /home/neo, will have a look. Lots of reference to /bin/monitor, too.&lt;/p&gt;
&lt;p&gt;I&amp;rsquo;m only in the neo group, so nothing to see there.&lt;/p&gt;
&lt;p&gt;Running &lt;code&gt;ps aux | grep neo&lt;/code&gt; shows a heap of /bin/monitor processes started by root, but running under neo. There&amp;rsquo;s also a &amp;ldquo;SCREEN&amp;rdquo; instance there, but running &lt;code&gt;screen -D -RR&lt;/code&gt; doesn&amp;rsquo;t reclaim it, so something&amp;rsquo;s up there. I&amp;rsquo;m pretty sure there&amp;rsquo;s something there in /bin/monitor.&lt;/p&gt;
&lt;p&gt;In all honesty this one had me beat. It was half-past midnight and I was exhausted. I knew that there was something special about /bin/monitor, and I knew there was something special about the fact that it was running as neo. But I took the expedient route and had a quick google. I found the answer at &lt;a class="link" href="http://blog.dornea.nu/2016/10/30/ringzer0-ctf-sysadmin-linux/" target="_blank" rel="noopener"
 &gt;http://blog.dornea.nu/2016/10/30/ringzer0-ctf-sysadmin-linux/&lt;/a&gt; - without this I could have been looking for years. However, as is so often the case, this tutorial was the basis of some great learning for me.&lt;/p&gt;
&lt;p&gt;Because the process is owned by neo, and because /bin/monitor could be &lt;em&gt;read&lt;/em&gt; by neo, it meant I could run a stack trace. &lt;em&gt;I have never done this before&lt;/em&gt; - no false impressions here, I totally relied on that dornea.ru page to tip me off to the usage of strace. But once I knew that, I had the flag.&lt;/p&gt;
&lt;p&gt;I was very well misled by this one, actually. The Persephone comment in the phonebook totally led me down the wrong path, and I spent quite a long time searching for her details on the system. It was the reddest herring possible.&lt;/p&gt;
&lt;h2 id="level-8---morpheus---cypher"&gt;Level 8 - Morpheus -&amp;gt; Cypher
&lt;/h2&gt;&lt;p&gt;Okay it&amp;rsquo;s late now so I&amp;rsquo;m going to try to thrash this one quick. Nothing in &lt;code&gt;ps aux&lt;/code&gt; for cypher. Grepping /backup found a python file and a dump showing a cron job runs this file every minute. The contents of the python file are:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;import os
os.system('ps aux &amp;gt; /tmp/28JNvE05KBltE8S7o2xu')
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;I can&amp;rsquo;t read the output file, but I can edit the python script! This is gonna be easy.&lt;/p&gt;
&lt;p&gt;After a little bit of trial and error, I edited the python script to first list the contents of the /home/cypher folder, and after that, to output the contents of /home/cypher/flag.txt&lt;/p&gt;
&lt;p&gt;It&amp;rsquo;s important to note that the python file is recreated every three minutes when it&amp;rsquo;s run, so you need to redo your changes for every iteration.&lt;/p&gt;
&lt;h1 id="fin"&gt;Fin
&lt;/h1&gt;&lt;p&gt;That&amp;rsquo;s the end! I&amp;rsquo;m quite pleased I&amp;rsquo;ve managed to finish all of the Sysadmin Linux section. Of course that&amp;rsquo;s also scary, because it means I need to break into the other sections. That&amp;rsquo;s OK though&amp;hellip; it&amp;rsquo;s a good time to do it!&lt;/p&gt;</description></item><item><title>RingZer0team CTF - Challenge 148</title><link>https://www.ericlight.com/post/r0-148.html</link><pubDate>Sat, 27 May 2017 00:00:00 +1200</pubDate><guid>https://www.ericlight.com/post/r0-148.html</guid><description>&lt;p&gt;There are a bunch of fantastic Capture The Flag security challenges on &lt;a class="link" href="https://www.ringzer0team.com" target="_blank" rel="noopener"
 &gt;RingZer0Team.com&lt;/a&gt;. I&amp;rsquo;ve been working through some of these for a wee while now, and with the &lt;a class="link" href="https://www.cybersecuritychallenge.org.nz/" target="_blank" rel="noopener"
 &gt;New Zealand Cyber Security Challenge&lt;/a&gt; coming up again soon, I thought I&amp;rsquo;d get back into some of them.&lt;/p&gt;
&lt;p&gt;Challenge 148 (&amp;ldquo;Sysadmin Linux Level 2&amp;rdquo;) is one of a series of challenges where you&amp;rsquo;re trying to breach the security of a Linux system. I actually finished most of these last year, but I wanted to finish my last two. Of course, to get to the last two stages, you need to use the flags from the &lt;em&gt;previous&lt;/em&gt; stages. So I&amp;rsquo;m revisiting them.&lt;/p&gt;
&lt;p&gt;We start by SSH&amp;rsquo;ing into a particular user account on the ringzer0team server:&lt;/p&gt;
&lt;p&gt;You have mail.
Last login: Thu Apr 27 02:52:40 2017 from &lt;somewhere&gt;
morpheus@forensics:~$&lt;/p&gt;
&lt;p&gt;There&amp;rsquo;s only one file in the home folder, and I can&amp;rsquo;t read it. There&amp;rsquo;s a /home/trinity folder with full read access, but also nothing legible.&lt;/p&gt;
&lt;p&gt;Running ps aux reveals what appears to be Trinity&amp;rsquo;s password:&lt;/p&gt;
&lt;p&gt;root 3241 0.0 0.0 4188 572 ? S Jan14 1:44 /bin/sh /root/backup.sh -u trinity -p Flag-&lt;redacted&gt;&lt;/p&gt;
&lt;p&gt;Aha, and /etc/fstab contains what appears to be The Architect&amp;rsquo;s password, in base64:&lt;/p&gt;
&lt;p&gt;/dev/sr0 /media/cdrom0 udf,iso9660 user,noauto 0 0
/dev/fd0 /media/floppy0 auto rw,user,noauto 0 0
#//TheMAtrix/phone /media/Matrix cifs username=architect,password=$(base64 -d &amp;ldquo;&lt;redacted&gt;&amp;rdquo;),iocharset=utf8,sec=ntlm 0 0&lt;/p&gt;
&lt;p&gt;Great! Now I can carry on to my &lt;em&gt;actual&lt;/em&gt; goal, which was to nail challenge 91 (&amp;ldquo;Sysadmin Linux Level 7&amp;rdquo;)!&lt;/p&gt;</description></item><item><title>RingZer0team CTF - Challenge 57</title><link>https://www.ericlight.com/post/r0-57.html</link><pubDate>Fri, 05 May 2017 00:00:00 +1200</pubDate><guid>https://www.ericlight.com/post/r0-57.html</guid><description>&lt;p&gt;This is a continuation of my series on &lt;a class="link" href="https://www.ringzer0team.com" target="_blank" rel="noopener"
 &gt;RingZer0Team.com&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Challenge 57 (&amp;ldquo;Hash Breaker Reloaded&amp;rdquo;, under the Coding Challenges) is one of a series of challenges where you&amp;rsquo;re simply presented with a hash - you need to return the plaintext value to the page within 3 seconds.&lt;/p&gt;
&lt;p&gt;In contrast to &lt;a class="link" href="https://www.ericlight.com/post/r0-56.html" &gt;Challenge 56&lt;/a&gt;, &lt;strong&gt;this&lt;/strong&gt; challenge also includes a salt:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;You have 3 seconds to break this hash
Send the answer back using https://ringzer0team.com/challenges/57/[clear_text]


----- BEGIN HASH -----
ab9507edbb2501b3c02e47c51af0178d68655980
----- END HASH -----

----- BEGIN SALT -----
c2ac9d8d004b4011d0864e76c7ebaaccfd18464bb8ff66bdbf19a703eb95a944
----- END SALT -----
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The hash looks like another SHA-1, but of course the online hash reversers don&amp;rsquo;t have the &lt;em&gt;now-salted&lt;/em&gt; hash in their rainbow tables. I figured that the challenge was a simple continuation of the previous challenge, so I crossed my fingers and guessed the hash was simply a number (from last time), concatenated with the plain-text salt.&lt;/p&gt;
&lt;p&gt;&amp;hellip; And I was lucky! The below code got me the flag:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;#!/usr/bin/python3
from requests import get
from hashlib import sha1
from re import search

url='https://ringzer0team.com/challenges/57'
session=dict(PHPSESSID='&amp;lt;blahblah&amp;gt;')
resp=get(url,cookies=session)
hash=resp.text.split(&amp;quot;-----&amp;quot;)[2].split(&amp;quot;\t&amp;quot;)[2].split(&amp;quot;&amp;lt;&amp;quot;)[0]
salt=resp.text.split(&amp;quot;-----&amp;quot;)[6].split(&amp;quot;\t&amp;quot;)[2].split(&amp;quot;&amp;lt;&amp;quot;)[0]
newhash=''
salt=salt.encode('utf-8')
x=0
while newhash != hash:
		newhash=sha1(str(x).encode('utf-8')+salt).hexdigest()
		print(&amp;quot;%s = %s&amp;quot; % (newhash, x))
		x+=1
	
resp=get(url+'/'+str(x-1),cookies=session)
flag=search(&amp;quot;FLAG-.{24}&amp;quot;,resp.text).group()
print(flag)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;As last time, there&amp;rsquo;s no error handling in that code, so if it runs for more than a few seconds it&amp;rsquo;s probably toast.&lt;/p&gt;</description></item><item><title>RingZer0team CTF - Challenge 56</title><link>https://www.ericlight.com/post/r0-56.html</link><pubDate>Tue, 02 May 2017 00:00:00 +1200</pubDate><guid>https://www.ericlight.com/post/r0-56.html</guid><description>&lt;p&gt;There are a bunch of fantastic Capture The Flag security challenges on &lt;a class="link" href="https://www.ringzer0team.com" target="_blank" rel="noopener"
 &gt;RingZer0Team.com&lt;/a&gt;. I&amp;rsquo;ve been working through some of these for a wee while now, and with the &lt;a class="link" href="https://www.cybersecuritychallenge.org.nz/" target="_blank" rel="noopener"
 &gt;New Zealand Cyber Security Challenge&lt;/a&gt; coming up again soon, I thought I&amp;rsquo;d get back into some of them.&lt;/p&gt;
&lt;p&gt;Challenge 56 (&amp;ldquo;Hash Breaker&amp;rdquo;, under the Coding Challenges) is one of a series of challenges where you&amp;rsquo;re simply presented with a hash - you need to return the plaintext value to the page within 3 seconds.&lt;/p&gt;
&lt;p&gt;Of course, this is impossible to do manually, so it&amp;rsquo;s a programming challenge.&lt;/p&gt;
&lt;p&gt;The hash looks like a simple SHA-1, so I put it into an online hash reverser and discovered it&amp;rsquo;s just a SHA1 hash of a random number. SHA1 is really fast, so this should be simple.&lt;/p&gt;
&lt;p&gt;Here&amp;rsquo;s how I tackled the problem:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;#!python
# It's in Python3, because of reasons
from requests import get
from hashlib import sha1
from re import search
calculated_hash=''
x=0

# Your session cookie needs to go here
session=dict(PHPSESSID='&amp;lt;cookie contents&amp;gt;')

# Load the web page
url='https://ringzer0team.com/challenges/56'
resp=get(url,cookies=session)

# Extract the hash from the page contents
target_hash=resp.text.split(&amp;quot;-----&amp;quot;)[2].split(&amp;quot;\t&amp;quot;)[2].split(&amp;quot;&amp;lt;&amp;quot;)[0]

# Iterate hashes from zero until the calculated hash matches the target hash
while calculated_hash != target_hash:
		calculated_hash=sha1(str(x).encode('utf-8')).hexdigest()
		print(&amp;quot;%s = %s&amp;quot; % (calculated_hash, x))
		x+=1

# If we got here, yay! We found the key. Now submit it back to the site, and print our magic flag
resp=get(url+'/'+str(x-1),cookies=session)
flag=search(&amp;quot;FLAG-.{24}&amp;quot;,resp.text).group()
print(flag)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;There&amp;rsquo;s no error handling in that code, so if it runs for more than a few seconds it&amp;rsquo;s probably toast.&lt;/p&gt;</description></item><item><title>HP Procurve's warn-and-disable</title><link>https://www.ericlight.com/post/hp_stormcontrol.html</link><pubDate>Sun, 30 Apr 2017 00:00:00 +1200</pubDate><guid>https://www.ericlight.com/post/hp_stormcontrol.html</guid><description>&lt;p&gt;Since mid-2016, I&amp;rsquo;ve been working as a Network and Security Administrator. While I&amp;rsquo;d done a fair amount of networking previously, most of my experience had been with either unmanaged switches, or in a pre-built Cisco environment. Stepping into the world of managed networking was new for me, as was stepping into the world of HP Switches.&lt;/p&gt;
&lt;p&gt;We were having recurring issues with a certain business unit looping ports on a switch. We had loop-protect running, but it was only set to disable the port after 5 seconds, and only for 300 seconds. This wasn&amp;rsquo;t long enough (we&amp;rsquo;ve since set it to something more resilient).&lt;/p&gt;
&lt;p&gt;During our attempts to minimise the impact of a network loop, we enabled this setting on our HP Procurve switches:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;fault-finder broadcast-storm action warn-and-disable
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This seems simple enough. The fault-finder module will look for broadcast storms, and when found, will throw a syslog, an SNMP trap, and will disable the offending switch port.&lt;/p&gt;
&lt;p&gt;Don&amp;rsquo;t be fooled. &lt;strong&gt;This will absolutely wreck your breakfast.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;The fault-finder module is a &lt;em&gt;system-wide&lt;/em&gt; setting, which means it applies to uplink ports as well. When a broadcast storm happens, all your distribution switches will see the broadcasts coming from&amp;hellip; their uplink port. So of course, the switches disable their uplink to the rest of the network, neatly segregating themselves away from any services or central management.&lt;/p&gt;
&lt;p&gt;Suffice to say, the next time we had a network loop there was a lot of walking and console cable madness, while we visited each of the distribution switches and manually re-enabled the disabled ports.&lt;/p&gt;
&lt;p&gt;Lesson learned, loop-protect it is. (Until we get STP up campus-wide, of course)&lt;/p&gt;</description></item><item><title>Making Lektor work with grsecurity</title><link>https://www.ericlight.com/post/lektor.html</link><pubDate>Sat, 29 Oct 2016 00:00:00 +1300</pubDate><guid>https://www.ericlight.com/post/lektor.html</guid><description>&lt;p&gt;I started using &lt;a class="link" href="https://grsecurity.net/" target="_blank" rel="noopener"
 &gt;grsecurity&lt;/a&gt; on my servers in 2015, and there&amp;rsquo;s always a bit of &lt;a class="link" href="https://wiki.archlinux.org/index.php/Grsecurity" target="_blank" rel="noopener"
 &gt;tuning&lt;/a&gt; &lt;a class="link" href="http://hardenedlinux.org/system-security/2016/01/10/hardening-your-desktop-linux-mint-with-grsec.html" target="_blank" rel="noopener"
 &gt;required&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;I was recently playing with &lt;a class="link" href="https://www.getlektor.com" target="_blank" rel="noopener"
 &gt;Lektor&lt;/a&gt; (before I swapped to &lt;a class="link" href="https://www.getpelican.com" target="_blank" rel="noopener"
 &gt;Pelican&lt;/a&gt;), and I had a bit of trouble with my grsec kernel. In particular, Lektor and Pelican are both run within a virtualenv Python environment, and grsec eats it like popcorn in two different ways:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;TPE (Trusted Path Execution) throws a wobbly:&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;code&gt;[253241.370019] grsec: From {ssh-origin-ip}: denied untrusted exec (due to file in world-writable directory) of /tmp/#50 by /usr/local/lib/lektor/bin/lektor[lektor:60593] uid/euid:1000/1000 gid/egid:1000/1000, parent /bin/bash[bash:60581] uid/euid:1000/1000 gid/egid:1000/1000&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;This block occurs because the virtualenv violates grsecurity&amp;rsquo;s Trusted Path Execution protection - the Python executable isn&amp;rsquo;t under a trusted path, and the user isn&amp;rsquo;t in the TPE-bypass group.&lt;/p&gt;
&lt;p&gt;To resolve this one, add your user to the TPE group. This will allow the user to execute binaries which aren&amp;rsquo;t in trusted locations:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;code&gt;sudo usermod -aG grsec-tpe $USER&lt;/code&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;ol start="2"&gt;
&lt;li&gt;RWX protection. This is a common problem with Python-based apps, even though Python has an exception (Edit 2020-04-12 - Issue 6 from &lt;a class="link" href="https://github.com/thestinger/paxd/" target="_blank" rel="noopener"
 &gt;https://github.com/thestinger/paxd/&lt;/a&gt; has been deleted) by default.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;code&gt;[ 207.534876] grsec: From {ssh-source-ip}: denied RWX mmap of &amp;lt;anonymous mapping&amp;gt; by /usr/local/lib/lektor/bin/lektor[lektor:534] uid/euid:1000/1000 gid/egid:1000/1000, parent /bin/bash[bash:477] uid/euid:1000/1000 gid/egid:1000/1000&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;First, create your PaX ELF headers, and then disable grsec&amp;rsquo;s MEMPROTECT extension on the included python2 binary, while you enable EMUTRAMP:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;code&gt;sudo paxctl /usr/local/lib/lektor/bin/python2 -c&lt;/code&gt;&lt;br&gt;
&lt;code&gt;sudo paxctl /usr/local/lib/lektor/bin/python2 -Em&lt;/code&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Result!&lt;/p&gt;</description></item><item><title>Broken log times in APC's PCNS Appliance 4.1</title><link>https://www.ericlight.com/post/apc_pcns.html</link><pubDate>Thu, 27 Oct 2016 00:00:00 +1300</pubDate><guid>https://www.ericlight.com/post/apc_pcns.html</guid><description>&lt;p&gt;Schneider Electric&amp;rsquo;s &lt;a class="link" href="http://www.se.com/en/product-range/61933-powerchute-network-shutdown/" target="_blank" rel="noopener"
 &gt;PowerChute Network Shutdown&lt;/a&gt; is a piece of software which communicates with your local UPS, and initiates system shutdown if the UPS battery is unable to continue providing power. This helps to preserve file integrity in the event of a prolonged power failure.&lt;/p&gt;
&lt;p&gt;Previously, you had to install the PCNS client separately on each virtual machine. Since then though, APC have released a &lt;a class="link" href="https://solutionexchange.vmware.com/store/products/apc-powerchute-network-shutdown-v4-1-for-vmware" target="_blank" rel="noopener"
 &gt;PCNS VMware Appliance&lt;/a&gt; which is installed directly into vCenter, and initiates shutdown on all the VMware guests through a single Virtual Machine. This is a much tidier model, so we&amp;rsquo;ve recently embarked on migrating to the PCNS Appliance.&lt;/p&gt;
&lt;p&gt;After installing the PCNS 4.1 appliance and getting everything working, I discovered that the time on all the log files was wrong by a significant margin. I can&amp;rsquo;t remember exactly what the margin was, it could have been say 8 hours or something.&lt;/p&gt;
&lt;p&gt;I did a bit of research and eventually I discovered a spectaularly old question on the APC forums, dating all the way back to 2011:&lt;/p&gt;
&lt;p&gt;&lt;em&gt;&amp;ldquo;I have installed PCNS 2.2.4 into the vMA of an ESXi 4.1 server. It properly communicates with the associated NMC and performs correctly. However, it reports all the activities in Eastern Standard Time. I don&amp;rsquo;t know where it&amp;rsquo;s picking up that time zone and can&amp;rsquo;t find anywhere to change it. In the vSphere client the time shows up correctly. Checking date inside the vMA from the CLI also shows the correct time and timezone. The date and time setting in the NMC is correct and is set to synch with NTP with correct time zone.&amp;rdquo;&lt;/em&gt;&lt;br&gt;
From: &lt;a class="link" href="http://forums.apc.com/spaces/7/ups-management-devices-powerchute-software/forums/general/6809/pcns-2-2-4-esxi-annoyance" target="_blank" rel="noopener"
 &gt;http://forums.apc.com/spaces/7/ups-management-devices-powerchute-software/forums/general/6809/pcns-2-2-4-esxi-annoyance&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;The answers include a broken link to an APC web page about it, but fortunately the poster copied the original post detail, which showed me where to look:&lt;/p&gt;
&lt;p&gt;&lt;em&gt;&amp;ldquo;PCNS uses a standard java function to retrieve the current date from the system when writing events to the log. The Problem on the VIMA is that this function always returns the US date format (PDT).&lt;br&gt;
This is an issue with Java &lt;a class="link" href="http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6456628" target="_blank" rel="noopener"
 &gt;http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6456628&lt;/a&gt;&lt;br&gt;
You can correct the time issue on VIMA by modifying /etc/sysconfig/clock file.&lt;br&gt;
+/etc/sysconfig/clock contains a line ZONE=&amp;ldquo;America/Los_Angeles&amp;rdquo;+&lt;br&gt;
You need to edit the ZONE= to match your region such as ZONE=&amp;ldquo;America/New_York&amp;rdquo;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Sounds great! But when I looked in /etc/sysconfig/clock, I discovered my time zone was already set to &amp;ldquo;Pacific/Auckland&amp;rdquo;.&lt;/p&gt;
&lt;p&gt;However, it also contained the value &amp;ldquo;UTC = False&amp;rdquo;. I changed this to &amp;ldquo;UTC = True&amp;rdquo;, and et voilà! The problem is fixed!&lt;/p&gt;</description></item><item><title>Updating the modem and radio firmware on a Samsung Galaxy 5 (G900I)</title><link>https://www.ericlight.com/post/g900i-update.html</link><pubDate>Thu, 27 Oct 2016 00:00:00 +1300</pubDate><guid>https://www.ericlight.com/post/g900i-update.html</guid><description>&lt;p&gt;A couple months ago, &lt;a class="link" href="http://www.checkpoint.com" target="_blank" rel="noopener"
 &gt;Check Point&lt;/a&gt; revealed their discovery of the &lt;a class="link" href="http://blog.checkpoint.com/2016/08/07/quadrooter/" target="_blank" rel="noopener"
 &gt;Quadrooter vulnerability&lt;/a&gt; affecting the Qualcomm chipsets in oodles of Android phones.&lt;/p&gt;
&lt;p&gt;I use &amp;ndash;CyanogenMod&amp;ndash; &lt;a class="link" href="http://www.lineageos.org" target="_blank" rel="noopener"
 &gt;LineageOS&lt;/a&gt; on a Samsung Galaxy S5, so thankfully I &lt;a class="link" href="https://web.archive.org/web/20161223020015/http://www.cyanogenmod.org/blog/cm-13-0-release-znh5y" target="_blank" rel="noopener"
 &gt;received patches&lt;/a&gt; for three of the four vulnerabilities in only a few days.&lt;/p&gt;
&lt;p&gt;However, that last vulnerability was part of a proprietary binary blob for controlling the Qualcomm LTE chipset, only patchable by Samsung themselves. It took a while for the Samsung updates to roll out, and then I got distracted for a while, but I finally downloaded my firmware. The package I&amp;rsquo;ve used is &amp;ldquo;G900IDVU1CPH3&amp;rdquo;, which seems to be compatible at least with the three NZ-based carriers, as well as all the Australian carriers.&lt;/p&gt;
&lt;p&gt;There are a couple little issues with the firmware upgrade, easily fixed if you know how. I&amp;rsquo;m going to assume you know exactly how to do everything without help. I&amp;rsquo;m sure you&amp;rsquo;re pleased.&lt;/p&gt;
&lt;p&gt;In particular, the version of Heimdall in the Debian Sid repositories (1.4.1-2) doesn&amp;rsquo;t quite work with the SGS5. It appears &lt;a class="link" href="https://www.google.com/search?q=ERROR%3A&amp;#43;Failed&amp;#43;to&amp;#43;send&amp;#43;request&amp;#43;to&amp;#43;end&amp;#43;PIT&amp;#43;file&amp;#43;transfer%21&amp;#43;samsung" target="_blank" rel="noopener"
 &gt;other people&lt;/a&gt; have had similar problems.&lt;/p&gt;
&lt;p&gt;The beginning of fix for me came from &lt;a class="link" href="https://github.com/turboyz" target="_blank" rel="noopener"
 &gt;turboyz&lt;/a&gt; on Github, at the bottom of this post: (Edit 2020-04-12: GitHub Issue 348 from &lt;a class="link" href="https://github.com/Benjamin-Dobell/Heimdall/" target="_blank" rel="noopener"
 &gt;https://github.com/Benjamin-Dobell/Heimdall/&lt;/a&gt; has been deleted); however, he&amp;rsquo;s manually made a couple changes to BridgeManager.cpp, which appear to be no longer necessary. We can simply build it from source:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;sudo apt-get install build-essential cmake zlib1g-dev libusb-1.0-0-dev git
git clone https://github.com/Benjamin-Dobell/Heimdall.git
cd Heimdall

# OPTIONAL: Remove the `if(NOT DISABLE_FRONTEND)` codeblock at the end of Heimdall/CMakeLists.txt
# I believe this just saves time compiling the GUI

mkdir build &amp;amp;&amp;amp; cd build
cmake -DCMAKE_BUILD_TYPE=Release ..
make
cd bin 
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Now you&amp;rsquo;ve got a nice new Heimdall installation, with the approproate updates to allow it to talk nicely to the new Samsung bootloader.&lt;/p&gt;
&lt;p&gt;I copied my new baseband files into the Heimdall/build/bin folder, just to get them all together. The last step is to flash your NON-HLOS.bin and modem.bin files:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;./heimdall flash --APNHLOS NON-HLOS.bin --MODEM modem.bin
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;I happen to have an issue on my phone currently where, even though the modem and LTE drivers have both been successfully installed, and even thought the Quadrooter tester is no longer showing any vulnerabilities, my Baseband version on my phone is still shown as the old one. I haven&amp;rsquo;t been able to figure out why yet, but I don&amp;rsquo;t think I&amp;rsquo;ll worry about it for now. There have been reports that you should first do this with &amp;ndash;no-reboot, wait for the update to complete, then pull your battery, then when you power back on, immediately go &lt;em&gt;back&lt;/em&gt; into download mode and re-flash. Apparently this helps update the recognised Baseband version, but to be honest it didn&amp;rsquo;t help me.&lt;/p&gt;
&lt;p&gt;If you&amp;rsquo;re completely 100% lucky and absolutely nothing goes wrong, you win! You should now have the most recent Samsung modem and LTE chipset drivers available for your phone&amp;hellip; without having to roll back to the stock Samsung firmware.&lt;/p&gt;
&lt;p&gt;Incidentally, if you want to save gigabytes and time downloading said firmware, and if your phone is precisely a Samsung Galaxy S5 (G900I), and if you definitely want firmware G900IDVU1CPH3, I&amp;rsquo;ve extracted the important files (modem.bin and NON-HLOS.bin) and stored them here:&lt;/p&gt;
&lt;p&gt;&lt;a class="link" href="https://www.ericlight.com/files/G900IDVU1CPH3_modem_LTE.zip" target="_blank" rel="noopener"
 &gt;https://www.ericlight.com/files/G900IDVU1CPH3_modem_LTE.zip&lt;/a&gt;&lt;br&gt;
SHA256 hash = a2ab13063583f6e83a3c2d8b79521a59ba103dda30a24bddf9248dd5a25bff3c&lt;/p&gt;
&lt;p&gt;I promise I haven&amp;rsquo;t intentionally backdoored them, but I make no warranties of any sort. They might just be pictures of my foot.&lt;/p&gt;
&lt;p&gt;Good luck!&lt;/p&gt;</description></item><item><title>Using ECDSA certificates with Let's Encrypt</title><link>https://www.ericlight.com/post/ecdsa_lets_encrypt.html</link><pubDate>Thu, 27 Oct 2016 00:00:00 +1300</pubDate><guid>https://www.ericlight.com/post/ecdsa_lets_encrypt.html</guid><description>&lt;p&gt;&lt;a class="link" href="https://www.letsencrypt.org" target="_blank" rel="noopener"
 &gt;Let&amp;rsquo;s Encrypt&lt;/a&gt;&amp;rsquo;s Certbot will generate an RSA key by default. But we want to step into the new and exciting world of elliptic curve cryptography! Unfortunately Certbot doesn&amp;rsquo;t really roll that way, so there are a couple hoops to jump through first.&lt;/p&gt;
&lt;p&gt;A word of caution: this post has been written in retrospect, some time after I actually got ECDSA working. That means there are bound to be squiggly little steps that I&amp;rsquo;ve missed, and I certainly should have provided screenshots or snippets that I&amp;rsquo;ve missed. Sorry.&lt;/p&gt;
&lt;p&gt;This post assumes you&amp;rsquo;ve already installed Certbot. I had a working regular certificate from Certbot before I changed to ECDSA, so if you have problems following this from scratch, I do recommend trying that first.&lt;/p&gt;
&lt;p&gt;For future reference, I&amp;rsquo;m running the latest certbot available in Debian unstable, which is version 0.8.1-3.&lt;/p&gt;
&lt;p&gt;I got most of this information from &lt;a class="link" href="https://scotthelme.co.uk/tag/lets-encrypt/" target="_blank" rel="noopener"
 &gt;Scott Helme&amp;rsquo;s website&lt;/a&gt;, which has been awesome.&lt;/p&gt;
&lt;p&gt;In brief:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Generate yourself an ECDSA private key:&lt;/p&gt;
&lt;p&gt;openssl ecparam -genkey -name secp384r1 | openssl ec -out ec.key&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;You can change the curve that you use, if you feel a bit wiggly about the &lt;a class="link" href="http://blog.cr.yp.to/20140323-ecdsa.html" target="_blank" rel="noopener"
 &gt;controversy around the NSA &amp;amp; NIST&lt;/a&gt; degrading the quality of the curves. I don&amp;rsquo;t feel particularly wiggly about that, myself.&lt;/p&gt;
&lt;ol start="2"&gt;
&lt;li&gt;
&lt;p&gt;Generate a Certificate Signing Request (CSR) with your shiny new key:&lt;/p&gt;
&lt;p&gt;openssl req -new -sha256 -key ec.key -nodes -out ec.csr -outform pem&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;That will give you ec.key (your private key), and ec.csr (your certificate signing request). Time to get Let&amp;rsquo;s Encrypt involved.&lt;/p&gt;
&lt;ol start="3"&gt;
&lt;li&gt;
&lt;p&gt;Create your certificate:&lt;/p&gt;
&lt;p&gt;certbot certonly -w /var/www/html/ -d {your_domain} &amp;ndash;email &amp;ldquo;{your_email}&amp;rdquo; &amp;ndash;csr ./ec.csr &amp;ndash;agree-tos&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;If everything goes perfectly, that should leave you with a new shiny set of certificates &amp;ndash; quite possibly named something clumsy like 0000-cert.pem and 0001-fullchain.pem, or similar. Throw those into your nginx config and give it a test to see if it&amp;rsquo;s working.&lt;/p&gt;
&lt;ol start="4"&gt;
&lt;li&gt;Schedule your certificate renewals:&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;I had particular trouble with the renewal process of ECDSA certificates, because &lt;code&gt;certbot renew&lt;/code&gt; isn&amp;rsquo;t compatible with custom CSR&amp;rsquo;s. You need to run &lt;code&gt;certbot certonly&lt;/code&gt; to pass the &amp;ndash;csr argument, and then you need to deal with the output yourself.&lt;/p&gt;
&lt;p&gt;Even more irksome, the certonly function will fail if you ask it to renew certificates which already exist:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;An unexpected error occurred:
OSError: [Errno 17] File exists: '/etc/letsencrypt/live/{your_domain}/cert_ecdsa.pem'
Please see the logfiles in /var/log/letsencrypt for more details.
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;There doesn&amp;rsquo;t seem to be any way to tell certbot to overwrite the old certificates automatically, so I created a /etc/letsencrypt/temp folder, and wrote up a really yuck cron job for it. If I were working on a production system I&amp;rsquo;d do something better, but this works for my lowly domain:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;# Recreate certs under /etc/letsencrypt/temp
30 2 24 * * certbot certonly -w /var/www/html/ -d {your_domain} --email &amp;quot;{your_email}&amp;quot; --csr /path/to/your/ec.csr --agree-tos --non-interactive --webroot --cert-path /etc/letsencrypt/temp/cert_ecdsa.pem --fullchain-path /etc/letsencrypt/temp/fullchain_ecdsa.pem

# Backup current certs to home dir
31 2 24 * * mv /etc/letsencrypt/live/{your_domain}/cert_ecdsa.pem ~/certbackup/
31 2 24 * * mv /etc/letsencrypt/live/{your_domain}/fullchain_ecdsa.pem ~/certbackup/

# Move new certs to live folder
32 2 24 * * mv /etc/letsencrypt/temp/* /etc/letsencrypt/live/{your_domain}/

# Restart nginx
33 2 24 * * service nginx restart
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;And that&amp;rsquo;s all! It seems to be working so far, but I&amp;rsquo;m sure something is going to fail at some point &amp;ndash; maybe I&amp;rsquo;ll hit my request limit, or the Let&amp;rsquo;s Encrypt service will be down, and I&amp;rsquo;ll lose my certs. If it happens too often I&amp;rsquo;ll come up with a nicer cronjob and update this post.&lt;/p&gt;</description></item><item><title>Tidying up Pelican's URLs with the Flex theme</title><link>https://www.ericlight.com/post/pelican-config.html</link><pubDate>Sun, 23 Oct 2016 00:00:00 +1300</pubDate><guid>https://www.ericlight.com/post/pelican-config.html</guid><description>&lt;p&gt;This is just a brain-dump of tweaks I&amp;rsquo;ve made to my Pelican environment to get tidy URLs. In summary: One theme tweak, one Nginx tweak.&lt;/p&gt;
&lt;h2 id="making-the-flex-theme-drop-the-ugly-urlslug-format"&gt;Making the Flex Theme drop the ugly url#slug format:
&lt;/h2&gt;&lt;p&gt;I&amp;rsquo;ve decided I&amp;rsquo;m going to roll with the &lt;a class="link" href="https://github.com/alexandrevicenzi/Flex" target="_blank" rel="noopener"
 &gt;Flex&lt;/a&gt; theme for a while. I like it, but it had this habit of putting anchors and slugs into my article URLs.&lt;/p&gt;
&lt;p&gt;For example, my first page is known to Pelican as &amp;ldquo;welcome-to-the-internet&amp;rdquo;. However, links to the page were automatically created as &amp;ldquo;welcome-to-the-internet#welcome-to-the-internet&amp;rdquo;. It seems redundant. Also, it says the same thing twice. It repeats itself.&lt;/p&gt;
&lt;p&gt;I discovered the issue in the Flex theme. It&amp;rsquo;s under /templates/index.html, circa lines 7 and 29. Simply change:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;{{ article.url }}#{{ article.slug }} 
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&amp;hellip; to&amp;hellip;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;{{ article.slug }} 
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Fixed!&lt;/p&gt;
&lt;p&gt;I haven&amp;rsquo;t submitted a pull request to Alexandre, because I suspect it&amp;rsquo;s intentional.&lt;/p&gt;
&lt;h2 id="getting-nginx-to-serve-tidy-urls"&gt;Getting Nginx to serve tidy urls:
&lt;/h2&gt;&lt;p&gt;By default, Pelican creates great urls like {server}/Ramblings/welcome-to-the-internet&lt;/p&gt;
&lt;p&gt;This is great, but it CREATES files like /var/www/Ramblings/welcome-to-the-internet.html&lt;/p&gt;
&lt;p&gt;Nginx by default doesn&amp;rsquo;t see &amp;ldquo;welcome-to-the-internet&amp;rdquo; and automatically serve &amp;ldquo;welcome-to-the-internet.html&amp;rdquo;. The lack of a file extention means that the .html file is fundamentally &lt;em&gt;a different file&lt;/em&gt;, so it returns a handy-dandy 404 error instead.&lt;/p&gt;
&lt;p&gt;To fix this, open /etc/nginx/sites-available/yoursite, and find:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;location / {
 try_files $uri $uri/ =404;
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Change it to the following - note I&amp;rsquo;ve added $uri.htm and $uri.html, to inform Nginx that it should try appending .htm or .html onto the end of a uri if it can&amp;rsquo;t find the page:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;location / {
 try_files $uri.htm $uri.html $uri =404;
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;All done, happy tidy URLs!&lt;/p&gt;</description></item><item><title>Alfredo Sauce</title><link>https://www.ericlight.com/post/alfredo.html</link><pubDate>Sat, 22 Oct 2016 00:00:00 +1300</pubDate><guid>https://www.ericlight.com/post/alfredo.html</guid><description>&lt;p&gt;I had the urge to make a homemade alfredo the other night. I found a recipe called &lt;a class="link" href="http://www.food.com/recipe/better-than-olive-garden-alfredo-sauce-141983" target="_blank" rel="noopener"
 &gt;&amp;ldquo;Better than Olive Garden Alfredo Sauce&amp;rdquo;&lt;/a&gt;, which is pretty descriptive, I guess. I made a couple tweaks here and there, though.&lt;/p&gt;
&lt;p&gt;I usually stray wildly from recipies whenever I decide to follow one, but having not made an alfredo sauce before, I largely stuck to the guide. A couple changes I did make, though:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Instead of adding the garlic and cream together, I heated the butter and &lt;em&gt;fried&lt;/em&gt; the garlic to bring out a bit more flavour&lt;/li&gt;
&lt;li&gt;I also fried a goodly dose of smoked bacon along with the garlic. Bacon first, of course, so the garlic doesn&amp;rsquo;t burn&lt;/li&gt;
&lt;li&gt;The recipe reckoned we should use two garlic cloves. Ha! Four, definitely.&lt;/li&gt;
&lt;li&gt;I also added some chopped spring onion and a pinch of cayenne pepper&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;I&amp;rsquo;ve reproduced the origina recipe, along with my changes, here:&lt;/p&gt;
&lt;h2 id="ingredients"&gt;Ingredients
&lt;/h2&gt;&lt;ul&gt;
&lt;li&gt;3 tablespoons butter&lt;/li&gt;
&lt;li&gt;2 tablespoons olive oil&lt;/li&gt;
&lt;li&gt;2 or 3 rashers of bacon, chopped into squares&lt;/li&gt;
&lt;li&gt;4 garlic cloves, minced&lt;/li&gt;
&lt;li&gt;1 chopped spring onion&lt;/li&gt;
&lt;li&gt;2 cups cream&lt;/li&gt;
&lt;li&gt;1⁄4 teaspoon freshly-ground pepper&lt;/li&gt;
&lt;li&gt;1 pinch cayenne pepper&lt;/li&gt;
&lt;li&gt;1⁄2 cup grated parmesan cheese&lt;/li&gt;
&lt;li&gt;3⁄4 cup mozzarella cheese&lt;/li&gt;
&lt;li&gt;1 1/2 supermarket tubes of fettucini pasta&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="method"&gt;Method
&lt;/h2&gt;&lt;p&gt;Melt butter in medium saucepan with olive oil over medium/low heat.&lt;br&gt;
Fry the bacon until until browned.&lt;br&gt;
Add the garlic, fry until the garlic starts to brown.&lt;br&gt;
Add cream and spring onion; bring mixture to a simmer.&lt;br&gt;
Stir often.&lt;br&gt;
Add the Parmesan cheese and simmer sauce for 8-10 minutes or until sauce has thickened and is smooth.&lt;br&gt;
When sauce has thickened add the Mozzarella cheese and stir until smooth. STIR FREQUENTLY.&lt;br&gt;
Add the pepper and cayenne.&lt;br&gt;
While the sauce cooks, boil noodles for 3-5 minutes.&lt;br&gt;
Place pasta on serving plates and spoon sauce over pasta.&lt;/p&gt;
&lt;p&gt;&lt;a class="link" href="http://imgur.com/gallery/pGwVS" target="_blank" rel="noopener"
 &gt;Bone app the teeth!&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;(Alright, most of the reason for this blog post is for me to practice my &lt;a class="link" href="https://daringfireball.net/projects/markdown/syntax" target="_blank" rel="noopener"
 &gt;Markdown&lt;/a&gt; skills)&lt;/p&gt;</description></item><item><title>Welcome to the Internet</title><link>https://www.ericlight.com/post/blog1.html</link><pubDate>Sat, 15 Oct 2016 00:00:00 +1300</pubDate><guid>https://www.ericlight.com/post/blog1.html</guid><description>&lt;p&gt;Well, I&amp;rsquo;m finally here.&lt;/p&gt;
&lt;p&gt;I&amp;rsquo;ve never &lt;em&gt;really&lt;/em&gt; run a blog before&amp;hellip; I did write a bunch of stuff back when I ran Gravity Computing; it just was never really &amp;ldquo;bloggy&amp;rdquo;. That content has now been moved to &lt;a class="link" href="http://www.efficientsoftware.co.nz/blog/" target="_blank" rel="noopener"
 &gt;Efficient Software&lt;/a&gt;, but I&amp;rsquo;ll probably copy my parts back over here when time permits.&lt;/p&gt;
&lt;p&gt;I really have no intention of running a blog, but I &lt;strong&gt;do&lt;/strong&gt; come across interesting and challenging problems &lt;em&gt;all the time&lt;/em&gt;, which I&amp;rsquo;d like to share with people who are, apparently, just like you.&lt;/p&gt;
&lt;p&gt;I&amp;rsquo;ve got a couple things saved up that I want to post about in the next few days, but heck this site could languish for months at a time &amp;ndash; so feel free to add it to your reader, I definitely won&amp;rsquo;t fill your feed.&lt;/p&gt;</description></item></channel></rss>