<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>Raspberrypi – Yeri Tiete</title>
    <link>https://yeri.be/tag/raspberrypi/</link>
    <description>Yeri Tiete&#39;s blog</description>
    <language>en</language>
    <copyright>© Yeri Tiete</copyright>
    <lastBuildDate>Tue, 24 Oct 2023 22:43:24 +0200</lastBuildDate>
    <atom:link href="https://yeri.be/tag/raspberrypi/index.xml" rel="self" type="application/rss+xml" />
    
    <item>
      <title>RPi kernels in Bookworm</title>
      <link>https://yeri.be/rpi-kernels-in-bookworm/</link>
      <pubDate>Tue, 24 Oct 2023 22:43:24 +0200</pubDate>
      <author>Yeri Tiete</author>
      <guid isPermaLink="true">https://yeri.be/rpi-kernels-in-bookworm/</guid><enclosure url="https://static.yeri.be/2023/10/kernel.jpg" length="0" type="image/jpeg" />
      <description>&lt;p&gt;Raspberry Pi recently &lt;a rel=&#34;noreferrer noopener&#34; href=&#34;https://www.raspberrypi.com/news/bookworm-the-new-version-of-raspberry-pi-os/&#34; target=&#34;_blank&#34;&gt;launched Bookworm&lt;/a&gt;, and with that, a new kernel package. &lt;/p&gt;&#xA;&lt;p&gt;However, due to the massive changes from Bullseye to Bookworm, they are not suggesting a &lt;code&gt;dist-upgrade&lt;/code&gt;. &lt;/p&gt;&#xA;&lt;blockquote class=&#34;wp-block-quote&#34;&gt;&#xA;&lt;p&gt;In the past, we have suggested procedures for updating an existing image to the new version, but always with the caveat that we do not recommend it, and you do this at your own risk.&lt;/p&gt;&#xA;&lt;p&gt;This time, because the changes to the underlying architecture are so significant, we are not suggesting any procedure for upgrading a Bullseye image to Bookworm; any attempt to do this will almost certainly end up with a non-booting desktop and data loss.&lt;/p&gt;</description>
      <content:encoded><![CDATA[<p><img src="https://static.yeri.be/2023/10/kernel.jpg" alt="RPi kernels in Bookworm"></p><p>Raspberry Pi recently <a rel="noreferrer noopener" href="https://www.raspberrypi.com/news/bookworm-the-new-version-of-raspberry-pi-os/" target="_blank">launched Bookworm</a>, and with that, a new kernel package. </p>
<p>However, due to the massive changes from Bullseye to Bookworm, they are not suggesting a <code>dist-upgrade</code>. </p>
<blockquote class="wp-block-quote">
<p>In the past, we have suggested procedures for updating an existing image to the new version, but always with the caveat that we do not recommend it, and you do this at your own risk.</p>
<p>This time, because the changes to the underlying architecture are so significant, we are not suggesting any procedure for upgrading a Bullseye image to Bookworm; any attempt to do this will almost certainly end up with a non-booting desktop and data loss.</p>
<cite><a href="https://www.raspberrypi.com/news/bookworm-the-new-version-of-raspberry-pi-os/" target="_blank" rel="noreferrer noopener">Bookworm — the new version of Raspberry Pi OS</a></cite></blockquote>
<p>But screw that, ain't nobody got time to reinstall all their RPis in the wild (and in all fairness, I've had zero issues updating; just some messing around with kernels -- hence the post)...</p>
<p>As this is not very well documented, and Raspberry Pi, across all their versions, has <a href="https://www.baeldung.com/linux/arm64-armel-armhf-overview" target="_blank" rel="noreferrer noopener">4 different architectures</a>, it's confusing. </p>
<p>There's a quick <a rel="noreferrer noopener" href="https://gist.github.com/jauderho/6b7d42030e264a135450ecc0ba521bd8" target="_blank">dirty guide</a> on how to update from <code>raspberrypi-kernel</code> and <code>raspberrypi-bootloader</code> to <code>linux-image-rpi</code>.</p>
<p>However, it's unclear in terms of which kernel to pick, so here goes:</p>
<ul>
<li>RPi3 (including RPi4) and newer in 64 bit<sup data-fn="0f5f6479-f0ea-4fac-a731-9e31357bd843" class="fn"><a href="#0f5f6479-f0ea-4fac-a731-9e31357bd843" id="0f5f6479-f0ea-4fac-a731-9e31357bd843-link">1</a></sup> (aarch64): <br /><code>apt install -y linux-image-rpi-v8 linux-headers-rpi-v8</code></li>
<li>RPi4 and 400 in 32 bit<sup data-fn="dd6d6631-b7cf-4b99-9f8c-4de4e6f782b3" class="fn"><a href="#dd6d6631-b7cf-4b99-9f8c-4de4e6f782b3" id="dd6d6631-b7cf-4b99-9f8c-4de4e6f782b3-link">2</a></sup>:<br /><code>apt install -y linux-image-rpi-v7l linux-headers-rpi-v7l</code></li>
<li>RPi2 (only 32bit) or 3, 3+, Zero 2 W, Compute Modules 3 and 3+ in 32 bit mode<sup data-fn="4be59b98-e820-4499-875e-ce58820aafeb" class="fn"><a href="#4be59b98-e820-4499-875e-ce58820aafeb" id="4be59b98-e820-4499-875e-ce58820aafeb-link">3</a></sup> (armhf): <br /><code>apt install -y linux-image-rpi-v7 linux-headers-rpi-v7</code></li>
<li>RPi1, Zero, Zero W, Compute Module 1 (armel):<br /><code>apt install -y linux-image-rpi-v6 linux-headers-rpi-v6</code></li>
</ul>
<p>This mostly comes from <a rel="noreferrer noopener" href="https://www.raspberrypi.com/documentation/computers/linux_kernel.html#building-the-kernel" target="_blank">here</a>.</p>
<p>So, in short, this is what worked for me. As I use <a href="https://yeri.be/tag/wireguard">Wireguard</a> as well, I needed to remove the package first to prevent conflicts.</p>
<pre class="wp-block-code"><code>apt remove -y wireguard
apt autoremove -y

dpkg --purge --force-depends raspberrypi-kernel raspberrypi-bootloader
umount /boot
fsck -y /boot
mkdir /boot/firmware
sed -i.bak -e "s#boot#boot/firmware#" /etc/fstab
systemctl daemon-reload
mount /boot/firmware
apt install raspi-firmware -y

# rpi3+ 64bit
#apt install linux-image-rpi-v8 linux-headers-rpi-v8
# rpi4+ 32bit
#apt install linux-image-rpi-v7l linux-headers-rpi-v7l
# rpi2 and rest
#apt install linux-image-rpi-v7 linux-headers-rpi-v7
# rpi1
#apt install linux-image-rpi-v6 linux-headers-rpi-v6

sed -i.bak '$ a\auto_initramfs=1' /boot/firmware/config.txt 

apt install wireguard -y
systemctl enable wg-quick@wg0.service
systemctl start wg-quick@wg0.service

# reboot</code></pre>
<p>When running <code>apt install &lt;kernel&gt;</code> -- do write down the package it'll install. The listed packages are just meta packages and will pull a bunch of other packages that actually hold the important files. Running <code>apt --reinstall</code> on those meta packages, for example, won't actually reinstall the kernel.</p>
<p>To roll back, you can purge those packages and reinstall <code>raspberrypi-kernel raspberrypi-bootloader</code> (be aware of the path changes in <code>/boot</code>). If you made a mistake, just <code>apt install --reinstall -y &lt;all the packages you wrote down&gt;</code> and it should reinstall everything.</p>
]]></content:encoded>
      <category>hardware</category><category>linux</category><category>software</category>
      <category>apt</category><category>kernel</category><category>raspberrypi</category>
    </item>
    
    <item>
      <title>NextDNS and NetworkManager</title>
      <link>https://yeri.be/nextdns-and-networkmanager/</link>
      <pubDate>Fri, 17 Feb 2023 22:40:09 +0100</pubDate>
      <author>Yeri Tiete</author>
      <guid isPermaLink="true">https://yeri.be/nextdns-and-networkmanager/</guid><enclosure url="https://static.yeri.be/2023/02/wifi.jpg" length="0" type="image/jpeg" />
      <description>&lt;p&gt;A while back, I &lt;a href=&#34;https://yeri.be/networkmanager-exit-status-1&#34;&gt;wrote about installing&lt;/a&gt; NetworkManager if &lt;a href=&#34;https://yeri.be/tag/nextdns&#34;&gt;NextDNS&lt;/a&gt; activate fails to work. &lt;/p&gt;&#xA;&lt;p&gt;Only... I realised that for some reason on Raspberry Pi (4), WiFi stopped working with the following errors:&lt;/p&gt;&#xA;&lt;pre class=&#34;wp-block-code&#34;&gt;&lt;code&gt;Feb 17 11:55:02 tyr NetworkManager&amp;#91;449]: &amp;lt;info&amp;gt;  &amp;#91;1676631302.2204] device (wlan0): state change: config -&amp;gt; failed (reason &#39;ssid-not-found&#39;, sys-iface-state: &#39;managed&#39;)&#xA;Feb 17 11:55:02 tyr NetworkManager&amp;#91;449]: &amp;lt;info&amp;gt;  &amp;#91;1676631302.7525] device (wlan0): set-hw-addr: set MAC address to 92:F3:ED:C2:8F:9B (scanning)&#xA;Feb 17 11:55:02 tyr NetworkManager&amp;#91;449]: &amp;lt;warn&amp;gt;  &amp;#91;1676631302.7559] device (wlan0): Activation: failed for connection &#39;superuser.one&#39;&#xA;Feb 17 11:55:02 tyr NetworkManager&amp;#91;449]: &amp;lt;info&amp;gt;  &amp;#91;1676631302.7562] device (wlan0): supplicant interface state: scanning -&amp;gt; disconnected&#xA;Feb 17 11:55:02 tyr NetworkManager&amp;#91;449]: &amp;lt;info&amp;gt;  &amp;#91;1676631302.7562] device (p2p-dev-wlan0): supplicant management interface state: scanning -&amp;gt; disconnected&#xA;Feb 17 11:55:02 tyr NetworkManager&amp;#91;449]: &amp;lt;info&amp;gt;  &amp;#91;1676631302.7577] device (wlan0): supplicant interface state: disconnected -&amp;gt; interface_disabled&#xA;Feb 17 11:55:02 tyr NetworkManager&amp;#91;449]: &amp;lt;info&amp;gt;  &amp;#91;1676631302.7578] device (p2p-dev-wlan0): supplicant management interface state: disconnected -&amp;gt; interface_disabled&#xA;Feb 17 11:55:02 tyr NetworkManager&amp;#91;449]: &amp;lt;info&amp;gt;  &amp;#91;1676631302.7579] device (wlan0): supplicant interface state: interface_disabled -&amp;gt; disconnected&#xA;Feb 17 11:55:02 tyr NetworkManager&amp;#91;449]: &amp;lt;info&amp;gt;  &amp;#91;1676631302.7579] device (p2p-dev-wlan0): supplicant management interface state: interface_disabled -&amp;gt; disconnected&#xA;Feb 17 11:55:02 tyr NetworkManager&amp;#91;449]: &amp;lt;info&amp;gt;  &amp;#91;1676631302.7585] device (wlan0): state change: failed -&amp;gt; disconnected (reason &#39;none&#39;, sys-iface-state: &#39;managed&#39;)&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;The WiFi SSID and password (&lt;code&gt;wpa_supplicant&lt;/code&gt;) never changed, so I wasn&#39;t sure what it was. However, as most Pi&#39;s are wired I didn&#39;t pay much attention, until today.&lt;/p&gt;</description>
      <content:encoded><![CDATA[<p><img src="https://static.yeri.be/2023/02/wifi.jpg" alt="NextDNS and NetworkManager"></p><p>A while back, I <a href="https://yeri.be/networkmanager-exit-status-1">wrote about installing</a> NetworkManager if <a href="https://yeri.be/tag/nextdns">NextDNS</a> activate fails to work. </p>
<p>Only... I realised that for some reason on Raspberry Pi (4), WiFi stopped working with the following errors:</p>
<pre class="wp-block-code"><code>Feb 17 11:55:02 tyr NetworkManager&#91;449]: &lt;info&gt;  &#91;1676631302.2204] device (wlan0): state change: config -&gt; failed (reason 'ssid-not-found', sys-iface-state: 'managed')
Feb 17 11:55:02 tyr NetworkManager&#91;449]: &lt;info&gt;  &#91;1676631302.7525] device (wlan0): set-hw-addr: set MAC address to 92:F3:ED:C2:8F:9B (scanning)
Feb 17 11:55:02 tyr NetworkManager&#91;449]: &lt;warn&gt;  &#91;1676631302.7559] device (wlan0): Activation: failed for connection 'superuser.one'
Feb 17 11:55:02 tyr NetworkManager&#91;449]: &lt;info&gt;  &#91;1676631302.7562] device (wlan0): supplicant interface state: scanning -&gt; disconnected
Feb 17 11:55:02 tyr NetworkManager&#91;449]: &lt;info&gt;  &#91;1676631302.7562] device (p2p-dev-wlan0): supplicant management interface state: scanning -&gt; disconnected
Feb 17 11:55:02 tyr NetworkManager&#91;449]: &lt;info&gt;  &#91;1676631302.7577] device (wlan0): supplicant interface state: disconnected -&gt; interface_disabled
Feb 17 11:55:02 tyr NetworkManager&#91;449]: &lt;info&gt;  &#91;1676631302.7578] device (p2p-dev-wlan0): supplicant management interface state: disconnected -&gt; interface_disabled
Feb 17 11:55:02 tyr NetworkManager&#91;449]: &lt;info&gt;  &#91;1676631302.7579] device (wlan0): supplicant interface state: interface_disabled -&gt; disconnected
Feb 17 11:55:02 tyr NetworkManager&#91;449]: &lt;info&gt;  &#91;1676631302.7579] device (p2p-dev-wlan0): supplicant management interface state: interface_disabled -&gt; disconnected
Feb 17 11:55:02 tyr NetworkManager&#91;449]: &lt;info&gt;  &#91;1676631302.7585] device (wlan0): state change: failed -&gt; disconnected (reason 'none', sys-iface-state: 'managed')</code></pre>
<p>The WiFi SSID and password (<code>wpa_supplicant</code>) never changed, so I wasn't sure what it was. However, as most Pi's are wired I didn't pay much attention, until today.</p>
<p>As I had one RPi where <code>nextdns activate</code> worked fine, without NetworkManager installed, and where WiFi worked, I figured there was something evil about NetworkManager (= breaks my WiFi) and NextDNS not actually needing it... </p>
<p>I reverted my changed from my previous post (and removed some extra stuff that was not needed in my case, YMMV):</p>
<div class="wp-block-comments">
<pre class="wp-block-code"><code>apt purge -y network-manager dnsmasq-base resolvconf modemmanager ppp ; apt install -y powermgmt-base openresolv ; apt autoremove -y</code></pre>
</div>
<pre class="wp-block-verse">The powermgmt-base, and modemmanager, ppp parts are likely not needed, but this is just a copy and paste of what I did.</pre>
<p>Reboot... And WiFi worked again. However, <code>nextdns activate</code> would still throw an error:</p>
<pre class="wp-block-code"><code># nextdns activate
Error: NetworkManager resolver management: exit status 5</code></pre>
<p>Going through <a rel="noreferrer noopener" href="https://github.com/nextdns/nextdns/blob/master/host/dns_linux.go" target="_blank">the source code</a> (yay for open-source) I noticed:</p>
<pre class="wp-block-code"><code>var networkManagerFile = "/etc/NetworkManager/conf.d/nextdns.conf"</code></pre>
<p>That file indeed existed on both RPis that had the <code>activate</code> issue.</p>
<p>I ran the following command...</p>
<pre class="wp-block-code"><code>rm /etc/NetworkManager/conf.d/nextdns.conf</code></pre>
<p>But that still gave the same error. But as I had purged the entire NetworkManager, I didn't need its lingering config files... So, why not rid ourselves of everything:</p>
<pre class="wp-block-code"><code>rm -r /etc/NetworkManager</code></pre>
<p>And tada... Now <code>activate</code> works fine:</p>
<pre class="wp-block-code"><code>tyr ~ # nextdns activate
tyr ~ #</code></pre>
<p>Go figure ¯\_(ツ)_/¯ </p>
]]></content:encoded>
      <category>errors</category><category>linux</category><category>software</category>
      <category>dns</category><category>nextdns</category><category>raspberrypi</category>
    </item>
    
    <item>
      <title>Mounting a whole disk with partitions</title>
      <link>https://yeri.be/mounting-a-whole-disk-with-partitions/</link>
      <pubDate>Tue, 03 Jan 2023 03:02:59 +0100</pubDate>
      <author>Yeri Tiete</author>
      <guid isPermaLink="true">https://yeri.be/mounting-a-whole-disk-with-partitions/</guid><enclosure url="https://static.yeri.be/2023/01/mounting-a-hard-disk.jpg" length="0" type="image/jpeg" />
      <description>&lt;p&gt;I reinstalled one of my RPis (moving from 32 to 64 bit). &lt;/p&gt;&#xA;&lt;p&gt;Before doing the full reinstall, I took a dump (&lt;code&gt;dd&lt;/code&gt;) of my disk. &lt;/p&gt;&#xA;&lt;p&gt;Usually, I create one per partition, but this was the &lt;a href=&#34;https://yeri.be/tag/christmas-card&#34;&gt;Christmas season&lt;/a&gt;, and I was half occupied with feasting and half occupied with entertaining &lt;a rel=&#34;noreferrer noopener&#34; href=&#34;https://ila.tw/&#34; target=&#34;_blank&#34;&gt;Ila&lt;/a&gt;. So, mistakes were made. &lt;/p&gt;&#xA;&lt;p&gt;I ran &lt;code&gt;dd if=/dev/sdb of=backup.img&lt;/code&gt; -- but this means I can&#39;t mount the disk directly, as it&#39;s not a partition:&lt;/p&gt;</description>
      <content:encoded><![CDATA[<p><img src="https://static.yeri.be/2023/01/mounting-a-hard-disk.jpg" alt="Mounting a whole disk with partitions"></p><p>I reinstalled one of my RPis (moving from 32 to 64 bit). </p>
<p>Before doing the full reinstall, I took a dump (<code>dd</code>) of my disk. </p>
<p>Usually, I create one per partition, but this was the <a href="https://yeri.be/tag/christmas-card">Christmas season</a>, and I was half occupied with feasting and half occupied with entertaining <a rel="noreferrer noopener" href="https://ila.tw/" target="_blank">Ila</a>. So, mistakes were made. </p>
<p>I ran <code>dd if=/dev/sdb of=backup.img</code> -- but this means I can't mount the disk directly, as it's not a partition:</p>
<pre class="wp-block-code"><code># mount backup.img /tmp/disk
mount: /tmp/disk: wrong fs type, bad option, bad superblock on /dev/loop0, missing codepage or helper program, or other error.</code></pre>
<p>I should've dd'd /dev/sdb2 instead of the entire disk. </p>
<p>All right, so let's figure out what can be done... First, let's look at the content of the image:</p>
<pre class="wp-block-code"><code># fdisk -l backup.img
Disk backup.img: 111.8 GiB, 120040980480 bytes, 234455040 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x8297a463

Device          Boot  Start      End  Sectors  Size Id Type
backup.img1 *      8192   532479   524288  256M  c W95 FAT32 (LBA)
backup.img2      532480 34078199 33545720   16G 83 Linux</code></pre>
<p>So, we can probably mount starting from sector <code>532480</code>. </p>
<p>We can see that the sector size is 512 (which, I think, is the default for most). So, if we multiply <code>512 * 532480</code> we get <code>272629760</code>.</p>
<p>Now we can mount the disk using the following command:</p>
<pre class="wp-block-code"><code>mount -o loop,offset=272629760 backup.img /tmp/disk</code></pre>
<p>And that should do it. </p>
<p>The 2nd partition (the one with data) is now mounted and accessible under <code>/tmp/disk</code>. </p>
<p>If you need the first partition, the same can be done by running <code>512 * 8192 = 4194304</code>; the following command mounts the boot partition: </p>
<pre class="wp-block-code"><code>mount -o loop,offset=4194304 backup.img /tmp/disk.</code></pre>
]]></content:encoded>
      <category>errors</category><category>linux</category><category>software</category>
      <category>backup</category><category>raspberrypi</category>
    </item>
    
    <item>
      <title>OLED Lego Brick</title>
      <link>https://yeri.be/oled-lego-brick/</link>
      <pubDate>Wed, 28 Dec 2022 14:03:00 +0100</pubDate>
      <author>Yeri Tiete</author>
      <guid isPermaLink="true">https://yeri.be/oled-lego-brick/</guid>
      <description>&lt;div class=&#34;embed-responsive embed-youtube&#34;&gt;&#xA;&#x9;&lt;iframe src=&#34;https://www.youtube-nocookie.com/embed/6wBrOV2FJM8&#34; title=&#34;YouTube video&#34; loading=&#34;lazy&#34; allow=&#34;accelerometer; clipboard-write; encrypted-media; gyroscope; picture-in-picture&#34; allowfullscreen&gt;&lt;/iframe&gt;&#xA;&lt;/div&gt;&#xA;&#xA;&lt;p&gt;Via &lt;a href=&#34;https://hackaday.com/2022/12/20/more-detail-on-that-fantastic-lego-oled-brick/&#34; target=&#34;_blank&#34; rel=&#34;noreferrer noopener&#34;&gt;Hackaday&lt;/a&gt;.&lt;/p&gt;</description>
      <content:encoded><![CDATA[<div class="embed-responsive embed-youtube">
	<iframe src="https://www.youtube-nocookie.com/embed/6wBrOV2FJM8" title="YouTube video" loading="lazy" allow="accelerometer; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
</div>

<p>Via <a href="https://hackaday.com/2022/12/20/more-detail-on-that-fantastic-lego-oled-brick/" target="_blank" rel="noreferrer noopener">Hackaday</a>.</p>
]]></content:encoded>
      <category>hardware</category>
      <category>lego</category><category>raspberrypi</category>
    </item>
    
    <item>
      <title>NetworkManager exit status 1</title>
      <link>https://yeri.be/networkmanager-exit-status-1/</link>
      <pubDate>Mon, 26 Dec 2022 21:19:59 +0100</pubDate>
      <author>Yeri Tiete</author>
      <guid isPermaLink="true">https://yeri.be/networkmanager-exit-status-1/</guid><enclosure url="https://static.yeri.be/2022/12/networkManager.jpg" length="0" type="image/jpeg" />
      <description>&lt;p&gt;Recently reinstalled &lt;a href=&#34;https://yeri.be/tag/nextdns&#34;&gt;NextDNS&lt;/a&gt; on a RPi4 64bit and came across this error:&lt;/p&gt;&#xA;&lt;pre class=&#34;wp-block-code&#34;&gt;&lt;code&gt;# nextdns activate&#xA;Error: NetworkManager resolver management: exit status 1&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;It seems like &lt;a href=&#34;https://nextdns.io/?from=tuts3r6c&#34; target=&#34;_blank&#34; rel=&#34;noreferrer noopener&#34;&gt;NextDNS&lt;/a&gt; was actually running, but just throwing an error when running &lt;code&gt;nextdns activate&lt;/code&gt;. Restarting did seem to work without throwing any error.&lt;/p&gt;&#xA;&lt;p&gt;The logs showed the same error:&lt;/p&gt;&#xA;&lt;pre class=&#34;wp-block-code&#34;&gt;&lt;code&gt;Dec 20 14:06:20 tyr nextdns&amp;#91;5753]: Starting NextDNS 1.38.0/linux on :53&#xA;Dec 20 14:06:20 tyr nextdns&amp;#91;5753]: Listening on TCP/:53&#xA;Dec 20 14:06:20 tyr nextdns&amp;#91;5753]: Starting mDNS discovery&#xA;Dec 20 14:06:20 tyr nextdns&amp;#91;5753]: Listening on UDP/:53&#xA;Dec 20 14:06:21 tyr nextdns&amp;#91;5753]: Connected 45.90.28.0:443 (con=13ms tls=58ms, TCP, TLS13)&#xA;Dec 20 14:06:21 tyr nextdns&amp;#91;5753]: Connected 185.18.148.91:443 (con=12ms tls=28ms, TCP, TLS13)&#xA;Dec 20 14:06:21 tyr nextdns&amp;#91;5753]: Switching endpoint: https://dns.nextdns.io#185.18.148.91,2a04:b80:1:30::2&#xA;Dec 20 14:06:25 tyr nextdns&amp;#91;5753]: Setting up router&#xA;Dec 20 14:06:25 tyr nextdns&amp;#91;5753]: Activating&#xA;Dec 20 14:06:25 tyr nextdns&amp;#91;5753]: Activate: NetworkManager resolver management: exit status 1&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;The solution was (as root):&lt;/p&gt;</description>
      <content:encoded><![CDATA[<p><img src="https://static.yeri.be/2022/12/networkManager.jpg" alt="NetworkManager exit status 1"></p><p>Recently reinstalled <a href="https://yeri.be/tag/nextdns">NextDNS</a> on a RPi4 64bit and came across this error:</p>
<pre class="wp-block-code"><code># nextdns activate
Error: NetworkManager resolver management: exit status 1</code></pre>
<p>It seems like <a href="https://nextdns.io/?from=tuts3r6c" target="_blank" rel="noreferrer noopener">NextDNS</a> was actually running, but just throwing an error when running <code>nextdns activate</code>. Restarting did seem to work without throwing any error.</p>
<p>The logs showed the same error:</p>
<pre class="wp-block-code"><code>Dec 20 14:06:20 tyr nextdns&#91;5753]: Starting NextDNS 1.38.0/linux on :53
Dec 20 14:06:20 tyr nextdns&#91;5753]: Listening on TCP/:53
Dec 20 14:06:20 tyr nextdns&#91;5753]: Starting mDNS discovery
Dec 20 14:06:20 tyr nextdns&#91;5753]: Listening on UDP/:53
Dec 20 14:06:21 tyr nextdns&#91;5753]: Connected 45.90.28.0:443 (con=13ms tls=58ms, TCP, TLS13)
Dec 20 14:06:21 tyr nextdns&#91;5753]: Connected 185.18.148.91:443 (con=12ms tls=28ms, TCP, TLS13)
Dec 20 14:06:21 tyr nextdns&#91;5753]: Switching endpoint: https://dns.nextdns.io#185.18.148.91,2a04:b80:1:30::2
Dec 20 14:06:25 tyr nextdns&#91;5753]: Setting up router
Dec 20 14:06:25 tyr nextdns&#91;5753]: Activating
Dec 20 14:06:25 tyr nextdns&#91;5753]: Activate: NetworkManager resolver management: exit status 1</code></pre>
<p>The solution was (as root):</p>
<pre class="wp-block-code"><code>apt install network-manager resolvconf -y
systemctl enable NetworkManager
systemctl start NetworkManager
nextdns activate</code></pre>
<p>Looks like, instead of <code>resolvconf</code>, <code>openresolv</code> was installed. </p>
<p>First time I heard about <a rel="noreferrer noopener" href="https://wiki.archlinux.org/title/Openresolv" target="_blank">openresolv</a>; usually resolvconf is the default. Not entirely sure if this was the culprit (and NetworkManager not being started) but the errors are now gone. </p>
]]></content:encoded>
      <category>errors</category><category>linux</category><category>software</category>
      <category>dns</category><category>nextdns</category><category>raspberrypi</category>
    </item>
    
    <item>
      <title>Making Bluetooth work on RPi4</title>
      <link>https://yeri.be/making-bluetooth-work-on-rpi4/</link>
      <pubDate>Tue, 01 Sep 2020 22:30:16 +0200</pubDate>
      <author>Yeri Tiete</author>
      <guid isPermaLink="true">https://yeri.be/making-bluetooth-work-on-rpi4/</guid><enclosure url="https://static.yeri.be/2020/09/Screenshot-2020-09-01-at-15.33.24.png" length="0" type="image/png" />
      <description>&lt;p&gt;I &lt;a href=&#34;https://www.benkuhn.net/wireless/&#34; target=&#34;_blank&#34; rel=&#34;noreferrer noopener&#34;&gt;rarely use&lt;/a&gt; Bluetooth on my RPis. I&#39;m already facing enough issues with my iMac and Mac Mini (it lags, it randomly disconnects in meetings, etc). &lt;/p&gt;&#xA;&lt;p&gt;My &lt;a href=&#34;http://pwnagotchi.ai/&#34; target=&#34;_blank&#34; rel=&#34;noreferrer noopener&#34;&gt;pwnagotchi&lt;/a&gt; on the other hand is counting on a BLE network to connect to the internet: for now I am using my iPad, and while that works, it causes my iPad to disconnect from WiFi (because of course, it can only do tethering from a mobile network, not from its WiFi network). &lt;/p&gt;</description>
      <content:encoded><![CDATA[<p><img src="https://static.yeri.be/2020/09/Screenshot-2020-09-01-at-15.33.24.png" alt="Making Bluetooth work on RPi4"></p><p>I <a href="https://www.benkuhn.net/wireless/" target="_blank" rel="noreferrer noopener">rarely use</a> Bluetooth on my RPis. I'm already facing enough issues with my iMac and Mac Mini (it lags, it randomly disconnects in meetings, etc). </p>
<p>My <a href="http://pwnagotchi.ai/" target="_blank" rel="noreferrer noopener">pwnagotchi</a> on the other hand is counting on a BLE network to connect to the internet: for now I am using my iPad, and while that works, it causes my iPad to disconnect from WiFi (because of course, it can only do tethering from a mobile network, not from its WiFi network). </p>
<p>I wanted to explore if I could set up bluetooth tethering/internet sharing from my RPi4 server... But for that BLE had to work! And for some reason BLE was not working on <a href="https://yeri.be/raspberry-pi-4-ssd" target="_blank" rel="noreferrer noopener">Liana</a>.</p>
<pre class="wp-block-code"><code>&#91;bluetooth]# power on
No default controller available</code></pre>
<p>For some reason no controller was available. The drivers were definitely installed... </p>
<pre class="wp-block-code"><code>apt install bluetooth pi-bluetooth bluez raspberrypi-sys-mods</code></pre>
<p>but <code>hcitool dev ; hciconfig -a</code> weren't returning anything.  </p>
<p>After quite some extensive Googling I found <a href="https://raspberrypi.stackexchange.com/questions/72419/raspberry-pi-3-bluetooth-no-controller/85158#85158" target="_blank" rel="noreferrer noopener">the solution</a>... </p>
<p>Check if this returns something:</p>
<pre class="wp-block-code"><code># ls -l /dev | grep ttyAMA0
lrwxrwxrwx 1 root root           7 Sep  1 15:08 serial1 -> ttyAMA0
crw-rw---- 1 root dialout 204,  64 Sep  1 15:08 ttyAMA0</code></pre>
<p>As opposed to:</p>
<pre class="wp-block-code"><code># ls -l /dev | grep ttyS0
# (no output)</code></pre>
<p>Then continue to do the following:</p>
<pre class="wp-block-code"><code># make a backup
cp /boot/cmdline.txt /boot/cmdline.txt.bak
# edit the file
nano -w /boot/cmdline.txt
# edit the first part from
# console=ttySerial0 to console=ttyAMA0
# the line should be something similar to but do NOT blindly copy paste it as you won't be able to boot due to your PARTUUID being different
console=ttyAMA0,115200 console=tty1 root=PARTUUID=6c586e13-02 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait
reboot</code></pre>
<p>After rebooting ... it works!</p>
<pre class="wp-block-code"><code>liana ~ # hcitool dev ; hciconfig -a
Devices:
	hci0	DC:A6:32:B1:0E:79
hci0:	Type: Primary  Bus: UART
	BD Address: DC:A6:32:B1:0E:79  ACL MTU: 1021:8  SCO MTU: 64:1
	UP RUNNING 
	RX bytes:2397 acl:0 sco:0 events:118 errors:0
	TX bytes:2603 acl:0 sco:0 commands:99 errors:0
	Features: 0xbf 0xfe 0xcf 0xfe 0xdb 0xff 0x7b 0x87
	Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3 
	Link policy: RSWITCH SNIFF 
	Link mode: SLAVE ACCEPT 
	Name: 'liana'
	Class: 0x000000
	Service Classes: Unspecified
	Device Class: Miscellaneous, 
	HCI Version: 5.0 (0x9)  Revision: 0x13b
	LMP Version: 5.0 (0x9)  Subversion: 0x6119
	Manufacturer: Cypress Semiconductor Corporation (305)

liana ~ # bluetoothctl 
Agent registered
&#91;bluetooth]# scan on
Discovery started
&#91;CHG] Controller DC:A6:32:B1:0E:79 Discovering: yes
&#91;NEW] Device 7F:A9:BC:8D:E4:14 7F-A9-BC-8D-E4-14
&#91;NEW] Device 58:EB:19:D8:D4:23 58-EB-19-D8-D4-23
&#91;NEW] Device A4:83:E7:42:79:F6 A4-83-E7-42-79-F6
&#91;NEW] Device 58:7B:24:1B:CC:5C 58-7B-24-1B-CC-5C
&#91;NEW] Device D9:05:9F:DB:55:19 N0163
&#91;NEW] Device 5F:DA:90:34:82:68 5F-DA-90-34-82-68
&#91;NEW] Device 77:2A:1B:11:54:7D 77-2A-1B-11-54-7D
&#91;NEW] Device 42:BF:0B:38:F3:20 42-BF-0B-38-F3-20</code></pre>
<p>Next step is trying to get tethering to work... </p>
]]></content:encoded>
      <category>hardware</category><category>linux</category><category>software</category>
      <category>ble</category><category>raspberrypi</category>
    </item>
    
    <item>
      <title>Raspberry Pi 4 &#43; SSD</title>
      <link>https://yeri.be/raspberry-pi-4-ssd/</link>
      <pubDate>Sun, 21 Jun 2020 01:15:02 +0200</pubDate>
      <author>Yeri Tiete</author>
      <guid isPermaLink="true">https://yeri.be/raspberry-pi-4-ssd/</guid><enclosure url="https://static.yeri.be/2020/06/IMG_9881.jpg" length="0" type="image/jpeg" />
      <description>&lt;p&gt;All right. With the release of the new &lt;a href=&#34;https://www.raspberrypi.org/blog/8gb-raspberry-pi-4-on-sale-now-at-75/&#34; target=&#34;_blank&#34; rel=&#34;noreferrer noopener&#34;&gt;RPi4 with 8Gb of RAM&lt;/a&gt; I had to get myself one to see if it was already a viable desktop replacement for surfing and emails. &lt;/p&gt;&#xA;&lt;p&gt;While a SD card works fine for certain tasks (things that don&#39;t require a lot of IO) -- for a desktop that&#39;s a no-go... It&#39;s just too slow.&lt;/p&gt;&#xA;&lt;p&gt;I still had an old Macbook Pro 13&#34; (2o15?) SSD lying around that was collecting dust. Why not use that one to use as root for the RPi? &lt;/p&gt;</description>
      <content:encoded><![CDATA[<p><img src="https://static.yeri.be/2020/06/IMG_9881.jpg" alt="Raspberry Pi 4 + SSD"></p><p>All right. With the release of the new <a href="https://www.raspberrypi.org/blog/8gb-raspberry-pi-4-on-sale-now-at-75/" target="_blank" rel="noreferrer noopener">RPi4 with 8Gb of RAM</a> I had to get myself one to see if it was already a viable desktop replacement for surfing and emails. </p>
<p>While a SD card works fine for certain tasks (things that don't require a lot of IO) -- for a desktop that's a no-go... It's just too slow.</p>
<p>I still had an old Macbook Pro 13" (2o15?) SSD lying around that was collecting dust. Why not use that one to use as root for the RPi? </p>
<p>This article will focus on making it work on Raspbian first. Technically this should all work on other distros as well, but <a href="https://www.urbandictionary.com/define.php?term=ymmv" target="_blank" rel="noreferrer noopener">YMMV</a> seeing all this is still beta. </p>
<p>I use Raspbian Lite: I like to work with minimalstic systems and install just what I need. But technically this should work with any flavour. </p>
<p>But first, let's prep the device.</p>
<p><strong>Case</strong></p>
<p>I already have a RPi4 (4Gb) at home running mostly Docker containers (nginx proxy and a few personal things and <a href="https://smokeping-sg.superuser.one/" target="_blank" rel="noreferrer noopener">Smokeping</a>). </p>
<p>And one of the 'best' purchases I made for the RPi4 was the "Raspberry Pi 4 Model B Aluminium Case" (<a href="https://web.archive.org/web/20210125015506/https://www.lazada.sg/products/for-raspberry-pi-4-model-b-aluminum-case-passive-cooling-aluminum-alloy-protective-shell-metal-enclosure-for-raspberry-pi-4-model-b-i738812614-s2377660292.html?mp=1" target="_blank" rel="noreferrer noopener nofollow sponsored">Lazada</a>, <a href="https://www.aliexpress.com/item/33051396297.html?spm=a2g0o.productlist.0.0.125a5bd6Y009xm&amp;algo_pvid=0d7b54ae-8c21-4cee-82ad-201fb4359d0c&amp;algo_expid=0d7b54ae-8c21-4cee-82ad-201fb4359d0c-8&amp;btsid=0ab6fb8315926566848663739ead8c&amp;ws_ab_test=searchweb0_0,searchweb201602_,searchweb201603_" target="_blank" rel="noreferrer noopener nofollow sponsored">AliExpress</a>). This case is passive and dissipates enough heat (even in a closed cabinet in Singapore where it's 30°) for the CPU never to throttle back when overclocked at 2Ghz (see below). </p>
<p>Do note that this case (which is pretty much just a massive heat sink) gets pretty hot if the RPi is running at max performance for long periods of time. </p>
<p><strong>USB-SSD</strong></p>
<p>Get one that fits your SSD and that ideally has Linux support. As Apple uses custom SSD connectors (prior to being soldered onto the motherboard) I had to get a converter from China. It was a bit of Russian Roulette to see if it would work or be supported on Linux. I got myself <a href="https://www.aliexpress.com/item/4001014439722.html?spm=a2g0o.productlist.0.0.53e65b1eIgYBZs&amp;algo_pvid=07a65076-95e6-4fe9-962d-7a70c22b8df5&amp;algo_expid=07a65076-95e6-4fe9-962d-7a70c22b8df5-1&amp;btsid=0ab50f4415907422600613293e387b&amp;ws_ab_test=searchweb0_0,searchweb201602_,searchweb201603_" rel="noreferrer noopener nofollow sponsored" target="_blank">this one</a> (chipset: Netchip Technology). As I didn't remember what type of Macbook Pro this came from, using <a href="https://beetstech.com/product/solid-state-drive-256gb-655-1803" target="_blank" rel="noreferrer noopener">this site</a> to compare serial/model was useful. This USB-to-SSD converted also works on Mac and Windows by the way. </p>
<div class="wp-block-image"><figure class="aligncenter size-large"><a href="https://static.yeri.be/2020/06/ssd-enclosure.jpg" target="_blank" rel="noopener noreferrer"><img src="https://static.yeri.be/2020/06/ssd-enclosure-1024x768.jpg" alt="" class="wp-image-9077"/></a><figcaption>The SSD with the PCB that provides the USB interface.</figcaption></figure></div>
<p>In my case, the RPi also did not provider enough power to the USB-SSD converter (although... it really should but whatevs), so be sure to use the provided power cable and plug it into a USB power source. Not doing so will cause the SSD to heat up and show a bunch of disconnects/errors in <code>dmesg</code>. </p>
<pre class="wp-block-code"><code>raspbian ~ # fdisk -l /dev/sda1 
Disk /dev/sda1: 233.8 GiB, 250999127552 bytes, 490232671 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
raspbian ~ # lsusb 
Bus 002 Device 002: ID 0525:622b Netchip Technology, Inc. 
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 002: ID 2109:3431 VIA Labs, Inc. Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
raspbian ~ # lsusb -t
/:  Bus 02.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/4p, 5000M
    |__ Port 2: Dev 2, If 0, Class=Mass Storage, Driver=usb-storage, 5000M
/:  Bus 01.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/1p, 480M
    |__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/4p, 480M</code></pre>
<div class="wp-block-image"><figure class="aligncenter size-large"><a href="https://static.yeri.be/2020/06/ssd.png" target="_blank" rel="noopener noreferrer"><img src="https://static.yeri.be/2020/06/ssd-1024x628.png" alt="Raspberry Pi 4 with USB SSD connected" class="wp-image-9059"/></a><figcaption>Raspberry Pi 4 with USB SSD connected</figcaption></figure></div>
<p><strong>eeprom update</strong></p>
<p>Disconnect the USB-SSD for now.</p>
<p>At the time of writing we need to <a href="https://www.raspberrypi.org/documentation/hardware/raspberrypi/bcm2711_bootloader_config.md" target="_blank" rel="noreferrer noopener">update</a> the eeprom to boot from USB. I'm using the latest eeprom available to me. Note that the USB-boot eeprom is about to hit stable so you might not need to do this anymore. </p>
<p>There are two methods for updating. We can do it manually:</p>
<pre class="wp-block-code"><code>rpi-update
cd /lib/firmware/raspberrypi/bootloader/beta
rpi-eeprom-update -d -f ./pieeprom-2020-06-15.bin
# BCM2711 detected
# VL805 firmware in bootloader EEPROM
# BOOTFS /boot
# *** INSTALLING ./pieeprom-2020-06-15.bin ***
# BOOTFS /boot
# EEPROM update pending. Please reboot to apply the update.
reboot
# RPi should come back online after a reboot</code></pre>
<p>Or we use <code>rpi-eeprom-update</code> (see <a href="https://www.raspberrypi.org/documentation/hardware/raspberrypi/booteeprom.md" target="_blank" rel="noreferrer noopener">article</a>, at the bottom):</p>
<pre class="wp-block-code"><code>nano -w /etc/default/rpi-eeprom-update
# edit critical to stable
rpi-eeprom-update
rpi-eeprom-update -a</code></pre>
<p>The good thing is that, even if you boot from a Raspbian that does not have <code>/etc/default/rpi-eeprom-update</code> edited to use <code>stable</code> instead of <code>critical</code>, it will not downgrade your eeprom. </p>
<p>Now you can plug in the SD card in an USB-SD card reader, and test if the RPi boots from USB. Note that the SD card might be slower. </p>
<div class="wp-block-image"><figure class="aligncenter size-large"><a href="https://static.yeri.be/2020/06/rpi-boots-usb-sd.png" target="_blank" rel="noopener noreferrer"><img src="https://static.yeri.be/2020/06/rpi-boots-usb-sd-1024x993.png" alt="" class="wp-image-9062"/></a><figcaption>RPi booting the SD card from USB (<code>/dev/sda</code>)</figcaption></figure></div>
<p>All right -- so everything is working. I am keeping this SD card to update the eeprom again at a later stage (as the one we flashed is beta). If we use <a href="https://archlinuxarm.org/platforms/armv8/broadcom/raspberry-pi-4" target="_blank" rel="noreferrer noopener">Archlinux</a> or Ubuntu the eeprom update tools won't be included. </p>
<p>Next step is to flash Raspbian to the USB-SSD. </p>
<div class="wp-block-image"><figure class="aligncenter size-large"><a href="https://static.yeri.be/2020/06/flash-to-ssd.png" target="_blank" rel="noopener noreferrer"><img src="https://static.yeri.be/2020/06/flash-to-ssd-1024x665.png" alt="" class="wp-image-9065"/></a><figcaption>This screenshot shows <a href="https://ubuntu.com/download/raspberry-pi" target="_blank" rel="noreferrer noopener">Ubuntu</a>, but for the sake of this article, we'll use Raspbian still. I'm using <a href="https://www.balena.io/etcher/" target="_blank" rel="noreferrer noopener">Etcher</a> to flash. </figcaption></figure></div>
<p>Boot-up from the USB-SSD. </p>
<p><strong>Errors</strong></p>
<p>In case you are getting an error similar to <code>start4.elf: is not compatible</code> you'll need to copy paste <code>/boot/start4.elf</code> from a Raspbian that ran <code>rpi-update</code> (i.e. the one from the SD card, or see below). </p>
<p>If you are booting (a fresh) Raspbian, it might complain about <code>cma: Failed to reserve 256 MiB</code> (and several other errors). The solution is running <code>rpi-update</code>. </p>
<p>Boot from the working Raspbian (using the SD card):</p>
<pre class="wp-block-code"><code># check which drive is your USB-SSD (i.e. using fdisk -l or dmesg). 
# In my case I booted from USB-SD (/dev/sda) and we'll update the new/clean Raspbian on the SSD (/dev/sdb).
#
# First resize the partition, if the system never booted it'll be 1.5Gb and thus not big enough:
# Device     Boot  Start     End Sectors  Size Id Type
# /dev/sdb1         8192  532479  524288  256M  c W95 FAT32 (LBA)
# /dev/sdb2       532480 3620863 3088384  1.5G 83 Linux
fdisk /dev/sdb
# Type the following:
# p (and visually check it all makes sense)
# d
# 2
# n
# Select (default p): p
# Partition number (2-4, default 2): &lt;enter>
# First sector (2048-490234751, default 2048): 532480 (or whichever is the same "start" from the 2nd partition) 
# Last sector, +/-sectors or +/-size{K,M,G,T,P} (532480-490234751, default 490234751): &lt;enter>
# Created a new partition 2 of type 'Linux' and of size 233.5 GiB.
# Partition #2 contains a ext4 signature.
# Do you want to remove the signature? &#91;Y]es/&#91;N]o: n
# p (visually check once again it makes sense, if not you can cancel/quit by typing q)
# w (if it makes sense)
# The last command will write the changes to the partition table and sync all changes. 
# Then we need to check and resize the filesystem:
e2fsck -f /dev/sdb2
resize2fs /dev/sdb2
# If all that worked we can start mounting everything
mkdir /tmp/ssd
mount /dev/sdb2 /tmp/ssd/
mount /dev/sdb1 /tmp/ssd/boot/
mount /proc/ /tmp/ssd/proc/ -t proc
mount --rbind /sys/ /tmp/ssd/sys/
mount --rbind /dev/ /tmp/ssd/dev/
# Once everything is mounted, we're chrooting into the fresh Raspbian running on the SSD
chroot /tmp/ssd/ /bin/bash
# you can double confirm the partition size using:
df -h
# And we update the system. Again, if all this hits stable it might not be needed.
rpi-update
# say "y" when it's asking you to.
# exit the chroot and turn off the device, remove the USB-SD and leave USB-SSD connected. 
exit 
halt</code></pre>
<p>My first reboot the boot process threw errors about failing to mount the root fs.</p>
<p>We'll need to update <code>/etc/fstab</code> with the correct <code>partuuid</code>. </p>
<pre class="wp-block-code"><code># Boot from the (USB-)SD card again
# In my case sdb became sda and vice versa, so double check
lsblk
# be sure to select the right disk (the SSD, no the SD)!
mkdir /tmp/ssd
mount /dev/sda2 /tmp/ssd/
# And find the SSD here as well.
# look for the last column, partuuid, something like 
"6f6cc2fb-01"
blkid
nano -w /tmp/ssd/etc/fstab
# edit the existing partuuid's with the ones from blkid
# you'll need to edit both /boot (-01) and / (root, -02).
halt
# When rebooting from the SSD it'll go through a fsck. In my case for some reason it failed and dropped to a shell. I did a manual check and everything was fine. Rebooted and it booted normally... *shrug*</code></pre>
<p><strong>Booting</strong></p>
<p>At this stage booting from the USB-SSD should work just fine. You have a working system booting from USB. </p>
<div class="wp-block-image"><figure class="aligncenter size-large"><a href="https://static.yeri.be/2020/06/rpi4-booted-from-ssd.png" target="_blank" rel="noopener noreferrer"><img src="https://static.yeri.be/2020/06/rpi4-booted-from-ssd-1024x714.png" alt="" class="wp-image-9074"/></a><figcaption>It's working! Now I can configure my system. </figcaption></figure></div>
<p><strong>Overclocking</strong></p>
<p>Last thing I'd recommend is getting a bit more juice out of your four cores.</p>
<p>You can quite easily overclock the RPi4 to 2Ghz (per core). It's a pretty nice boost (~25%) and worth going for. I haven't seen any heat issues leading to underclocking (throttling back), and everything runs stable. Note that under real circumstances you are unlikely to be running at 100% for extended period of times. </p>
<p><a href="https://magpi.raspberrypi.org/articles/how-to-overclock-raspberry-pi-4" target="_blank" rel="noreferrer noopener">This guide</a> explains how to overclock Raspbian (but the same applies for <a href="https://ubuntu.com/download/raspberry-pi" target="_blank" rel="noreferrer noopener">Ubuntu RPi</a> -- I'll eventually be using Ubuntu as the OS due to its 64 bit support; at the moment <a href="https://www.raspberrypi.org/forums/viewtopic.php?f=117&amp;t=275370" target="_blank" rel="noreferrer noopener">Raspbian</a> only supports a 64 bit kernel (beta) and the userland still runs 32 bit. But that'll be a follow-up article. </p>
<p>The gist of the article is to edit <code>/boot/config.txt</code> and add:</p>
<pre class="wp-block-code"><code>over_voltage=6
arm_freq=2000</code></pre>
<p>Save the file, reboot and monitor temp (<code>echo $((cat /sys/class/thermal/thermal_zone0/temp/1000))</code>) and core frequency (<code>watch -n 1 vcgencmd measure_clock arm</code>) while running <code>stress -c 4</code> to make sure the cores are running at 100%.</p>
<div class="wp-block-image"><figure class="aligncenter size-large"><a href="https://static.yeri.be/2020/06/rpi4-2ghz.png" target="_blank" rel="noopener noreferrer"><img src="https://static.yeri.be/2020/06/rpi4-2ghz-1024x628.png" alt="Raspberry Pi 4 running at 2Ghz" class="wp-image-9058"/></a><figcaption>Raspberry Pi 4 running at 2Ghz. It never throttled back after running for ~30 minutes.</figcaption></figure></div>
]]></content:encoded>
      <category>hardware</category><category>linux</category><category>software</category>
      <category>raspberrypi</category><category>ssd</category><category>usb</category>
    </item>
    
    <item>
      <title>Running WireGuard in a Docker container (RPi)</title>
      <link>https://yeri.be/running-wireguard-in-a-docker-container-rpi/</link>
      <pubDate>Fri, 08 May 2020 18:10:00 +0200</pubDate>
      <author>Yeri Tiete</author>
      <guid isPermaLink="true">https://yeri.be/running-wireguard-in-a-docker-container-rpi/</guid><enclosure url="https://static.yeri.be/2020/04/wg-liana.png" length="0" type="image/png" />
      <description>&lt;p&gt;This follows the my two other posts about &lt;a href=&#34;https://yeri.be/wireguard&#34; target=&#34;_blank&#34; aria-label=&#34;WireGuard (opens in a new tab)&#34; rel=&#34;noreferrer noopener&#34; class=&#34;aioseop-link&#34;&gt;WireGuard&lt;/a&gt;. &lt;/p&gt;&#xA;&lt;p&gt;Most of this can be copied from &lt;a aria-label=&#34;the amd64 post (opens in a new tab)&#34; href=&#34;https://yeri.be/running-wireguard-in-a-docker-container-(amd64)&#34; target=&#34;_blank&#34; rel=&#34;noreferrer noopener&#34; class=&#34;aioseop-link&#34;&gt;the amd64 post&lt;/a&gt; -- with a minor change for making it work on RPi4. &lt;a aria-label=&#34;This is the full Git repo (opens in a new tab)&#34; href=&#34;https://gitlab.com/yeri/wireguard-docker/&#34; target=&#34;_blank&#34; rel=&#34;noreferrer noopener&#34; class=&#34;aioseop-link&#34;&gt;This is the full &lt;/a&gt;&lt;a href=&#34;https://gitlab.com/yeri/wireguard-docker/&#34; target=&#34;_blank&#34; aria-label=&#34;This is the full Git repo (opens in a new tab)&#34; rel=&#34;noreferrer noopener&#34; class=&#34;aioseop-link&#34;&gt;g&lt;/a&gt;&lt;a aria-label=&#34;This is the full Git repo (opens in a new tab)&#34; href=&#34;https://gitlab.com/yeri/wireguard-docker/&#34; target=&#34;_blank&#34; rel=&#34;noreferrer noopener&#34; class=&#34;aioseop-link&#34;&gt;it repo&lt;/a&gt; (including both rpi and amd64). &lt;/p&gt;</description>
      <content:encoded><![CDATA[<p><img src="https://static.yeri.be/2020/04/wg-liana.png" alt="Running WireGuard in a Docker container (RPi)"></p><p>This follows the my two other posts about <a href="https://yeri.be/wireguard" target="_blank" aria-label="WireGuard (opens in a new tab)" rel="noreferrer noopener" class="aioseop-link">WireGuard</a>. </p>
<p>Most of this can be copied from <a aria-label="the amd64 post (opens in a new tab)" href="https://yeri.be/running-wireguard-in-a-docker-container-(amd64)" target="_blank" rel="noreferrer noopener" class="aioseop-link">the amd64 post</a> -- with a minor change for making it work on RPi4. <a aria-label="This is the full Git repo (opens in a new tab)" href="https://gitlab.com/yeri/wireguard-docker/" target="_blank" rel="noreferrer noopener" class="aioseop-link">This is the full </a><a href="https://gitlab.com/yeri/wireguard-docker/" target="_blank" aria-label="This is the full Git repo (opens in a new tab)" rel="noreferrer noopener" class="aioseop-link">g</a><a aria-label="This is the full Git repo (opens in a new tab)" href="https://gitlab.com/yeri/wireguard-docker/" target="_blank" rel="noreferrer noopener" class="aioseop-link">it repo</a> (including both rpi and amd64). </p>
<p>The main difference is in the <a aria-label="run.sh file (opens in a new tab)" href="https://gitlab.com/yeri/wireguard-docker/-/blob/master/liana.run.sh" target="_blank" rel="noreferrer noopener" class="aioseop-link">run.sh file</a>. The installation is a bit different and we'll need to install the Raspberry Pi kernel headers. </p>
<p>WireGuard is also installed from testing instead of Debian backports. </p>
<p>Note that for older RPi's (ie gen 1) you'll need to <a href="https://github.com/adrianmihalko/raspberrypiwireguard" target="_blank" aria-label="compile from scratch (opens in a new tab)" rel="noreferrer noopener" class="aioseop-link">compile from scratch</a>. </p>
]]></content:encoded>
      <category>linux</category><category>networking</category><category>software</category>
      <category>debian</category><category>docker</category><category>raspberrypi</category><category>wireguard</category>
    </item>
    
    <item>
      <title>WireGuard</title>
      <link>https://yeri.be/wireguard/</link>
      <pubDate>Mon, 27 Apr 2020 20:34:00 +0200</pubDate>
      <author>Yeri Tiete</author>
      <guid isPermaLink="true">https://yeri.be/wireguard/</guid><enclosure url="https://static.yeri.be/2020/04/WireGuard-network.png" length="0" type="image/png" />
      <description>&lt;p&gt;This is the first post of &lt;a href=&#34;https://yeri.be/tag/wireguard&#34; target=&#34;_blank&#34; aria-label=&#34; (opens in a new tab)&#34; rel=&#34;noreferrer noopener&#34; class=&#34;aioseop-link&#34;&gt;several&lt;/a&gt;. Next posts will focus on running WireGuard inside a Docker container on &lt;a href=&#34;https://yeri.be/running-wireguard-in-a-docker-container-(amd64)&#34; target=&#34;_blank&#34; aria-label=&#34;amd64 Linux (opens in a new tab)&#34; rel=&#34;noreferrer noopener&#34; class=&#34;aioseop-link&#34;&gt;amd64 Linux&lt;/a&gt; and a &lt;a href=&#34;https://yeri.be/running-wireguard-in-a-docker-container-rpi&#34; target=&#34;_blank&#34; aria-label=&#34;Raspberry Pi (opens in a new tab)&#34; rel=&#34;noreferrer noopener&#34; class=&#34;aioseop-link&#34;&gt;Raspberry Pi&lt;/a&gt;. &lt;/p&gt;&#xA;&lt;p&gt;I&#39;ve been running &lt;a aria-label=&#34;Wireguard (opens in a new tab)&#34; href=&#34;https://www.wireguard.com/&#34; target=&#34;_blank&#34; rel=&#34;noreferrer noopener&#34; class=&#34;aioseop-link&#34;&gt;WireGuard&lt;/a&gt; for a few months now and I&#39;ve been loving it. &lt;/p&gt;&#xA;&lt;p&gt;I first started using it about a year ago when in &lt;a aria-label=&#34;China (opens in a new tab)&#34; rel=&#34;noreferrer noopener&#34; class=&#34;aioseop-link&#34; href=&#34;https://yeri.be/tag/china&#34; target=&#34;_blank&#34;&gt;China&lt;/a&gt; — OpenVPN was once again being actively blocked and it was driving me nuts. Overnight I set up a &lt;a aria-label=&#34;DigitalOcean (opens in a new tab)&#34; rel=&#34;noreferrer noopener&#34; class=&#34;aioseop-link&#34; href=&#34;https://m.do.co/c/3276c58fdbfd&#34; target=&#34;_blank&#34;&gt;DigitalOcean&lt;/a&gt; server in Singapore and ran WireGuard from it — both my phone and laptop were able to actively bypass the &lt;a aria-label=&#34;GFW (opens in a new tab)&#34; rel=&#34;noreferrer noopener&#34; class=&#34;aioseop-link&#34; href=&#34;https://yeri.be/tag/gfw&#34; target=&#34;_blank&#34;&gt;GFW&lt;/a&gt; and (at that time) surf the internet freely once more. As WireGuard gains popularity, I am sure the GFW will start detecting it — it&#39;s a quiet but not a stealthy &lt;a aria-label=&#34;protocol (opens in a new tab)&#34; rel=&#34;noreferrer noopener&#34; class=&#34;aioseop-link&#34; href=&#34;https://www.wireguard.com/protocol/&#34; target=&#34;_blank&#34;&gt;protocol&lt;/a&gt;. &lt;/p&gt;</description>
      <content:encoded><![CDATA[<p><img src="https://static.yeri.be/2020/04/WireGuard-network.png" alt="WireGuard"></p><p>This is the first post of <a href="https://yeri.be/tag/wireguard" target="_blank" aria-label=" (opens in a new tab)" rel="noreferrer noopener" class="aioseop-link">several</a>. Next posts will focus on running WireGuard inside a Docker container on <a href="https://yeri.be/running-wireguard-in-a-docker-container-(amd64)" target="_blank" aria-label="amd64 Linux (opens in a new tab)" rel="noreferrer noopener" class="aioseop-link">amd64 Linux</a> and a <a href="https://yeri.be/running-wireguard-in-a-docker-container-rpi" target="_blank" aria-label="Raspberry Pi (opens in a new tab)" rel="noreferrer noopener" class="aioseop-link">Raspberry Pi</a>. </p>
<p>I've been running <a aria-label="Wireguard (opens in a new tab)" href="https://www.wireguard.com/" target="_blank" rel="noreferrer noopener" class="aioseop-link">WireGuard</a> for a few months now and I've been loving it. </p>
<p>I first started using it about a year ago when in <a aria-label="China (opens in a new tab)" rel="noreferrer noopener" class="aioseop-link" href="https://yeri.be/tag/china" target="_blank">China</a> — OpenVPN was once again being actively blocked and it was driving me nuts. Overnight I set up a <a aria-label="DigitalOcean (opens in a new tab)" rel="noreferrer noopener" class="aioseop-link" href="https://m.do.co/c/3276c58fdbfd" target="_blank">DigitalOcean</a> server in Singapore and ran WireGuard from it — both my phone and laptop were able to actively bypass the <a aria-label="GFW (opens in a new tab)" rel="noreferrer noopener" class="aioseop-link" href="https://yeri.be/tag/gfw" target="_blank">GFW</a> and (at that time) surf the internet freely once more. As WireGuard gains popularity, I am sure the GFW will start detecting it — it's a quiet but not a stealthy <a aria-label="protocol (opens in a new tab)" rel="noreferrer noopener" class="aioseop-link" href="https://www.wireguard.com/protocol/" target="_blank">protocol</a>. </p>
<p>Since then I've dug quite a bit deeper in WireGuard and am really looking forward to what it's going to bring. </p>
<p>WireGuard differentiates itself to be an extremely simple VPN server (which can make getting started and debugging a bit more challenging) — but it wants to seamlessly work together with existing tools. One of the main features still missing is for example running a DHCP server on the server and dynamically assigning IPs (like oVPN does). </p>
<figure class="wp-block-image size-large"><a href="https://static.yeri.be/2020/04/WireGuard-network.png" target="_blank" rel="noopener noreferrer"><img src="https://static.yeri.be/2020/04/WireGuard-network.png" alt="WireGuard network" class="wp-image-8750"/></a><figcaption>Simplified diagram of my network. Using static routing my clients can access the WireGuard network even without running WireGuard directly. (Some of) my containers are also able to access the network, this allows me to run Resilio Sync over WireGuard. It's using one big subnet to create one big LAN. </figcaption></figure>
<p>It's also pretty cool because any node can both be a server and a client at the same time. In my setup I am running two servers: one running at home in Singapore on a RPi4 (1Gbit fiber connection) and one on a virtual machine in <a aria-label="Amsterdam (opens in a new tab)" href="https://yeri.be/tag/rootspirit/" target="_blank" rel="noreferrer noopener" class="aioseop-link">Amsterdam</a> (1Gbit as well). The RPis at my parents are connected to the server in Amsterdam, my iPad and phones are connected to the server in Singapore. If I am in Europe I might switch over and let my iDevices connect to the AMS server instead. </p>
<figure class="wp-block-image size-large"><a href="https://static.yeri.be/2020/04/WireGuard-and-traffic-shaping.png" target="_blank" rel="noopener noreferrer"><img src="https://static.yeri.be/2020/04/WireGuard-and-traffic-shaping-1024x150.png" alt="WireGuard and traffic shaping" class="wp-image-8751"/></a><figcaption>Click to enlarge. <br />Bandwidth stats from Resilio Sync, transferring several big files. We can clearly see a speed increase (from 2-5mb/s to 11mb/s) when routing the exact same traffic over WireGuard. <a aria-label="Traffic shaping (opens in a new tab)" rel="noreferrer noopener" class="aioseop-link" href="https://en.wikipedia.org/wiki/Traffic_shaping" target="_blank">Traffic shaping</a> at its best.</figcaption></figure>
<p>The example above clearly shows speed gains by cloaking the traffic in UDP packets. The shared folder has only two nodes (sender and receiver) and shows several big files being transferred from Amsterdam to Singapore. <a aria-label="Resilio Sync (opens in a new tab)" href="https://www.resilio.com/individuals/" target="_blank" rel="noreferrer noopener" class="aioseop-link">Resilio Sync</a> uses the <a aria-label="Bittorrent protocol (opens in a new tab)" href="https://en.wikipedia.org/wiki/Resilio_Sync#Technology" target="_blank" rel="noreferrer noopener" class="aioseop-link">Bittorrent protocol</a>, something ISPs generally hate and tend to slow down as much as they can — thanks Starhub. </p>
<p>Wireguard also allows the client to decide what to route through the server: only the VPN LAN traffic, or a whole subnet, or 0.0.0.0/0? So for my iPhone I for example route all traffic through VPN to avoid hotel/airport/... WiFi's to mine/log/scan my data. For my laptop I have two configs, one to only connect to the LAN, but another that routes all my traffic through the VPN if I want to avoid exposure or circumvent censoring. </p>
<p>Note that I am not running WireGuard to remain anonymous and I'll definitely leak some information — just trying to minimise and remain in control of what I leak. This is not a <a aria-label="Tor (opens in a new tab)" rel="noreferrer noopener" href="https://www.torproject.org/" target="_blank" class="aioseop-link">Tor</a> replacement. </p>
]]></content:encoded>
      <category>linux</category><category>networking</category><category>software</category>
      <category>debian</category><category>docker</category><category>raspberrypi</category><category>vpn</category><category>wireguard</category>
    </item>
    
    <item>
      <title>Box — Docker shell server</title>
      <link>https://yeri.be/box-docker-shell-server/</link>
      <pubDate>Fri, 24 Apr 2020 10:27:00 +0200</pubDate>
      <author>Yeri Tiete</author>
      <guid isPermaLink="true">https://yeri.be/box-docker-shell-server/</guid><enclosure url="https://static.yeri.be/2020/04/box.png" length="0" type="image/png" />
      <description>&lt;p&gt;A couple of months ago I had the great idea to set up a shell server in Docker. Simply because my docker skillz were quite rusty and a shell server was something I actually genuinely needed. &lt;/p&gt;&#xA;&lt;p&gt;Shell servers... so 2005. I remember in the good old IRC days people asking for (free) shell servers to run their &lt;a aria-label=&#34;eggdrop (opens in a new tab)&#34; href=&#34;https://eggheads.org/&#34; target=&#34;_blank&#34; rel=&#34;noreferrer noopener&#34; class=&#34;aioseop-link&#34;&gt;eggdrop&lt;/a&gt; and stuff. OMG am I getting old? Anyhow... &lt;/p&gt;</description>
      <content:encoded><![CDATA[<p><img src="https://static.yeri.be/2020/04/box.png" alt="Box — Docker shell server"></p><p>A couple of months ago I had the great idea to set up a shell server in Docker. Simply because my docker skillz were quite rusty and a shell server was something I actually genuinely needed. </p>
<p>Shell servers... so 2005. I remember in the good old IRC days people asking for (free) shell servers to run their <a aria-label="eggdrop (opens in a new tab)" href="https://eggheads.org/" target="_blank" rel="noreferrer noopener" class="aioseop-link">eggdrop</a> and stuff. OMG am I getting old? Anyhow... </p>
<p>I ssh quite often. I manage quite a few <a href="https://yeri.be/tag/rootspirit" target="_blank" aria-label="servers (opens in a new tab)" rel="noreferrer noopener" class="aioseop-link">servers</a> (~15?) and <a href="https://yeri.be/?s=edgerouter" target="_blank" aria-label="routers (opens in a new tab)" rel="noreferrer noopener" class="aioseop-link">routers</a> that require me to login and do some random stuff. I also work on a laptop quite often and that means closing the lid and moving around. </p>
<p>First of all, <a aria-label=" (opens in a new tab)" href="https://mosh.org/" target="_blank" rel="noreferrer noopener" class="aioseop-link">mosh</a> is amazing and allows you to stay connected via ssh, even with crappy (airport/hotel) internet as well as moving around networks -- that solves half the problem. If you are not using it, start using it now!</p>
<p>Second, during my <a aria-label="datacenter technician (opens in a new tab)" href="https://www.google.com/about/datacenters/" target="_blank" rel="noreferrer noopener" class="aioseop-link">datacenter technician</a> days at Google we used to have a "jump server" -- a shell server that allowed us to bridge the corporate network and ssh into prod machines. Doubt that's still used nowadays, but the idea stuck. I wanted something similar to ssh from, wherever I was, and easily connect to my servers. And as the network the shell server is running on is stable, I only need to use mosh to the shell server. Thereafter, the connection very rarely dies. </p>
<p>And I guess, third, I recently purchased an iPad Pro and I really need to have my local "dev" environment with my git repo that I edit quite frequently but iPadOS isn't really your average computer, and doesn't even have a proper terminal. This is my experiment to make iPadOS work as a main computer when on the move. </p>
<p>Enter box -- <a href="https://gitlab.com/yeri/box-public" target="_blank" aria-label="Docker shell server (opens in a new tab)" rel="noreferrer noopener" class="aioseop-link">Docker shell server</a>... <a href="https://gitlab.com/yeri/box-public" class="aioseop-link"></a></p>
<p>I've copied over the files I use to this <a aria-label="example repo (opens in a new tab)" href="https://gitlab.com/yeri/box-public" target="_blank" rel="noreferrer noopener" class="aioseop-link">example repo</a>, and added some comments. Mind you that this repo acts as a proof of concept and isn't kept up to date, as I have my own private repo -- but this should give you a good idea on how to set up your own shell server with Docker. </p>
<p><a aria-label=" (opens in a new tab)" href="https://gitlab.com/yeri/box-public/-/blob/master/start.sh" target="_blank" rel="noreferrer noopener" class="aioseop-link">start.sh</a> -- this is a simple script that I execute when I first run or need to update the container. I execute the same file on two different servers: <a label="Liana (opens in a new tab)" href="http://smokeping-sg.superuser.one/" target="_blank" rel="noreferrer noopener" class="aioseop-link">Liana</a>, my Raspberry Pi at home and <a aria-label="Ocean (opens in a new tab)" href="http://smokeping.rootspirit.com/" target="_blank" rel="noreferrer noopener" class="aioseop-link">Ocean</a>, my server in <a aria-label="Amsterdam (opens in a new tab)" href="https://yeri.be/tag/rootspirit" target="_blank" rel="noreferrer noopener" class="aioseop-link">Amsterdam</a>. </p>
<p><a href="https://gitlab.com/yeri/box-public/-/blob/master/zsh.sh" target="_blank" aria-label=" (opens in a new tab)" rel="noreferrer noopener" class="aioseop-link">zsh.sh</a> -- this installs what I care about for zsh. This could be part of the Dockerfile but for some reason I separated it. ¯\_(ツ)_/¯ </p>
<p><a aria-label=" (opens in a new tab)" href="https://gitlab.com/yeri/box-public/-/blob/master/git.sh" target="_blank" rel="noreferrer noopener" class="aioseop-link">git.sh</a> -- this clones my Git repos so I can edit and commit stuff from the shell server. </p>
<p><a aria-label="run.sh (opens in a new tab)" href="https://gitlab.com/yeri/box-public/-/blob/master/run.sh" target="_blank" rel="noreferrer noopener" class="aioseop-link">run.sh</a> -- this file is launched by Dockerfile at the end and executes what matters: the ssh daemon. It also adds a <a aria-label="Wireguard (opens in a new tab)" href="https://yeri.be/tag/wireguard" target="_blank" rel="noreferrer noopener" class="aioseop-link">Wireguard</a> route and executes the scripts above. </p>
<p><a aria-label=" (opens in a new tab)" href="https://gitlab.com/yeri/box-public/-/blob/master/Dockerfile" target="_blank" rel="noreferrer noopener" class="aioseop-link">Dockerfile</a> -- this installs everything I need and configures the whole thing. I've added tons of comments that should get you going. </p>
<p>I am also cloning <a aria-label="misc (opens in a new tab)" href="https://gitlab.com/yeri/homefiles/" target="_blank" rel="noreferrer noopener" class="aioseop-link">misc</a> and <a aria-label="homefiles (opens in a new tab)" href="https://gitlab.com/yeri/homefiles/" target="_blank" rel="noreferrer noopener" class="aioseop-link">homefiles</a> as submodules in <a aria-label="files/ (opens in a new tab)" href="https://gitlab.com/yeri/box-public/-/tree/master/files" target="_blank" rel="noreferrer noopener" class="aioseop-link">files/</a> -- but you should change this to something that works for you. See the Dockerfile for more info. </p>
]]></content:encoded>
      <category>apple</category><category>linux</category><category>networking</category><category>software</category><category>virtualisation</category>
      <category>debian</category><category>docker</category><category>raspberrypi</category><category>rootspirit</category><category>vpn</category><category>wireguard</category>
    </item>
    
    <item>
      <title>CIFS: mount error(13): Permission denied</title>
      <link>https://yeri.be/cifs-mount-error13-permission-denied/</link>
      <pubDate>Thu, 30 Apr 2015 11:46:40 +0200</pubDate>
      <author>Yeri Tiete</author>
      <guid isPermaLink="true">https://yeri.be/cifs-mount-error13-permission-denied/</guid>
      <description>&lt;p&gt;You&amp;rsquo;ve just updated your Raspberry Pi (or whatever Linux) and you&amp;rsquo;re noticing your CIFS (smb) mounts aren&amp;rsquo;t getting auto mounted anymore. You curse and start noticing this error:&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;# mount -t cifs //192.168.1.100/public -o username=public,password=public sam/&#xA;mount error(13): Permission denied&#xA;Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;The solution is to add after &lt;code&gt;-o username=X,password=Y&lt;/code&gt; the following: &lt;code&gt;sec=ntlm&lt;/code&gt;; thus it becomes &lt;code&gt;-o username=X,password=Y,sec=ntlm&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;You can do the same in &lt;code&gt;fstab&lt;/code&gt;:&lt;/p&gt;</description>
      <content:encoded><![CDATA[<p>You&rsquo;ve just updated your Raspberry Pi (or whatever Linux) and you&rsquo;re noticing your CIFS (smb) mounts aren&rsquo;t getting auto mounted anymore. You curse and start noticing this error:</p>
<p><code># mount -t cifs //192.168.1.100/public -o username=public,password=public sam/
mount error(13): Permission denied
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)</code></p>
<p>The solution is to add after <code>-o username=X,password=Y</code> the following: <code>sec=ntlm</code>; thus it becomes <code>-o username=X,password=Y,sec=ntlm</code>.</p>
<p>You can do the same in <code>fstab</code>:</p>
<p><code>//192.168.1.100/public	/mnt/sam/	cifs	domain=TIETE,username=public,password=public,sec=ntlm		0	0</code></p>
<p>No idea why it&rsquo;s suddenly required, but whatevs.</p>
]]></content:encoded>
      <category>linux</category><category>networking</category><category>software</category>
      <category>raspberrypi</category><category>samba</category>
    </item>
    
    <item>
      <title>Raspberry Pi &amp; @Flightradar24</title>
      <link>https://yeri.be/raspberry-pi-flightradar24/</link>
      <pubDate>Sun, 20 Jul 2014 14:28:26 +0200</pubDate>
      <author>Yeri Tiete</author>
      <guid isPermaLink="true">https://yeri.be/raspberry-pi-flightradar24/</guid>
      <description>&lt;p&gt;In a couple of lines: how to get FR24 (+ dump1090) to work on your Raspberry Pi.&lt;/p&gt;&#xA;&lt;p&gt;Be sure to have the right hardware: &lt;a href=&#34;http://www.flightradar24.com/dvbt-stick&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;flightradar24.com/dvbt-stick&lt;/a&gt; and &amp;hellip; obviously &amp;hellip; a &lt;a href=&#34;http://benl.rs-online.com/web/p/processor-microcontroller-development-kits/8111284/&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;RPi&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;p&gt;I got a &lt;a href=&#34;http://www.amazon.co.uk/gp/product/B00JQX5HT6/ref=oh_details_o00_s00_i00?ie=UTF8&amp;amp;psc=1&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;NooElec from Amazon&lt;/a&gt; because I didn&amp;rsquo;t have the patience to wait for something (that might not work) from &lt;a href=&#34;http://www.aliexpress.com/wholesale?SearchText=RTL2832U%2FR820T&amp;amp;catId=0&amp;amp;initiative_id=SB_20140719070441&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;AliExpress&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;p&gt;As root:&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;apt-get update &amp;amp;&amp;amp; apt-get install cmake gcc pkg-config libusb-1.0 make git-core libc-dev&#xA;git clone git://git.osmocom.org/rtl-sdr.git&#xA;cd rtl-sdr&#xA;mkdir build&#xA;cd build&#xA;cmake ../ -DINSTALL_UDEV_RULES=ON&#xA;make &amp;amp;&amp;amp; make install&#xA;ldconfig&#xA;cd ../..&lt;/code&gt;&lt;/p&gt;</description>
      <content:encoded><![CDATA[<p>In a couple of lines: how to get FR24 (+ dump1090) to work on your Raspberry Pi.</p>
<p>Be sure to have the right hardware: <a href="http://www.flightradar24.com/dvbt-stick" target="_blank" rel="noopener noreferrer">flightradar24.com/dvbt-stick</a> and &hellip; obviously &hellip; a <a href="http://benl.rs-online.com/web/p/processor-microcontroller-development-kits/8111284/" target="_blank" rel="noopener noreferrer">RPi</a>.</p>
<p>I got a <a href="http://www.amazon.co.uk/gp/product/B00JQX5HT6/ref=oh_details_o00_s00_i00?ie=UTF8&amp;psc=1" target="_blank" rel="noopener noreferrer">NooElec from Amazon</a> because I didn&rsquo;t have the patience to wait for something (that might not work) from <a href="http://www.aliexpress.com/wholesale?SearchText=RTL2832U%2FR820T&amp;catId=0&amp;initiative_id=SB_20140719070441" target="_blank" rel="noopener noreferrer">AliExpress</a>.</p>
<p>As root:</p>
<p><code>apt-get update &amp;&amp; apt-get install cmake gcc pkg-config libusb-1.0 make git-core libc-dev
git clone git://git.osmocom.org/rtl-sdr.git
cd rtl-sdr
mkdir build
cd build
cmake ../ -DINSTALL_UDEV_RULES=ON
make &amp;&amp; make install
ldconfig
cd ../..</code></p>
<p>And be sure to Blacklist the normal driver:</p>
<p><code>echo &ldquo;blacklist dvb_usb_rtl28xxu&rdquo; &gt; /etc/modprobe.d/dvb-t.conf</code></p>
<p>And at this point you should <code>reboot</code>.</p>
<p>As regular user (<code>screen</code> part is no longer needed as the new FR24 program will automatically launch and execute it for you):</p>
<p><code>git clone <a href="https://github.com/MalcolmRobb/dump1090.git" target="_blank" rel="noopener noreferrer">https://github.com/MalcolmRobb/dump1090.git</a>
cd dump1090
make
ln -s dump1090 /bin/
<strike>screen -dmS dump ./dump1090 &ndash;interactive &ndash;net &ndash;net-beast &ndash;net-ro-port 31001 &ndash;net-http-port 8888</strike>
cd ..</code></p>
<p>Now get the FR24 software. In case you get a 404, <span style="text-decoration: line-through;">get the latest version <a href="http://forum.flightradar24.com/threads/4270-Linux-feeder-software-for-Flightradar24" target="_blank" rel="noopener noreferrer">here</a></span> new Raspberry Pi version is <a href="http://feed.flightradar24.com/raspberry-pi/" target="_blank" rel="noopener noreferrer">here</a>, Linux (AMD64 &amp; ARMv7) is <a href="http://feed.flightradar24.com/linux/" target="_blank" rel="noopener noreferrer">here</a>.
You can get your long &amp; lat <a href="https://web.archive.org/web/20211117100953/https://www.latlong.net/" target="_blank" rel="noopener noreferrer">here</a>.
Follow the updated howto on the page. The underlying code is no longer relevant.</p>
<p><code>wget <a href="https://web.archive.org/web/20141002002531/https://dl.dropboxusercontent.com/u/66906/fr24feed_arm-rpi_242.tgz" target="_blank" rel="noopener noreferrer">https://web.archive.org/web/20141002002531/https://dl.dropboxusercontent.com/u/66906/fr24feed_arm-rpi_242.tgz</a>
tar xvzf fr24feed*
./fr24feed_arm-rpi_242 &ndash;signup</code></p>
<p>I&rsquo;ll ask a couple of questions (answer them correctly):</p>
<p><code>Step 1/5 - Enter Latitude (DD.DDDD)
$:50.927358
Step 2/5 - Enter Longitude (DD.DDDD)
$:4.399928
Step 3/5 - Enter your email address (<a href="mailto:username@domain.tld">username@domain.tld</a>)
$:yeri@tiete.be
Step 4/5 - Enter your the hostname of the data feed (leave empty for localhost)
$:
Step 5/5 - Enter your the port number of the data feed (leave empty for 30003)
$:</p>
<p>Validating form data&hellip;OK</p>
<p>The closest airport found is &lsquo;Brussels Airport (ICAO:EBBR IATA:BRU)&rsquo; near Brussels.</p>
<p>Latitude: 50.901379
Longitude: 4.484444
Country: Belgium</p>
<p>Flightradar24 may, if needed, use your email address to contact you regarding your data feed.</p>
<p>Would you like to continue using these settings?</p>
<p>(yes/no)$:yes</p>
<p>[&hellip;].</code></p>
<p>It will give you a key (and e-mail it to you) after a couple of minutes. Keep this key, as it&rsquo;s important.</p>
<p>That&rsquo;s it. As dump1090 is already running, all you have to do is start flightradar and you&rsquo;re good to go.</p>
<p>This is the script I use to start it all (in screen, allowing me to check it). As normal user:</p>
<p><code>nano -w flightradar.sh</code></p>
<p>And copy paste the following (+ edit the variables):</p>
<p><code>#!/bin/bash
KEY=YOUR-KEY-EDIT-THIS
DIR=/home/PATH-TO-YOU-SCRIPT</p>
<h3>pro script</h3>
<p>cd $DIR</p>
<h1>Start dump1090</h1>
<p>cd dump1090</p>
<h1>I run on port 8888 because 8080 is taken on my rasp</h1>
<h3>THIS IS NO LONGER NEEDED</h3>
<p>#screen -dmS dump ./dump1090 &ndash;interactive &ndash;net &ndash;net-beast &ndash;net-ro-port 31001 &ndash;net-http-port 8888
cd ..</p>
<h1>Start Flightradar24</h1>
<p>screen -dmS flightradar24 ./fr24feed_arm-rpi_242 &ndash;fr24key=$KEY</code></p>
<p>And run: <code>chmod +x flightradar.sh</code></p>
<p>To start the script, simply run <code>./flightradar.sh</code>, and check what&rsquo;s happening with <code>screen -r dump</code> or <code>screen -r flightradar</code>.</p>
<p>To auto start this script at boot time, I edit rc.local as root:</p>
<p><code>nano -w /etc/rc.local</code></p>
<p>And add the following at the end but <strong>BEFORE</strong> exit 0:</p>
<p><code>su yeri -c /home/yeri/flightradar.sh</code></p>
<p>Obviously, modify the path and the user it should run under (in this case as &ldquo;yeri&rdquo;).</p>
<p>PS: Be sure to signup again every time you move your Raspberry around (the coords seem to be hardcoded in the key).
PPS: You can get Premium access here now: <a href="https://www.flightradar24.com/premium/" target="_blank" rel="noopener noreferrer">flightradar24.com/premium</a> (and check fancy graphs about your &ldquo;radar&rdquo;).</p>
]]></content:encoded>
      <category>hardware</category><category>linux</category><category>networking</category><category>software</category>
      <category>dvb-t</category><category>flightradar24</category><category>raspberrypi</category>
    </item>
    
    <item>
      <title>Yard Sale: Raspberry Pi&#39;s</title>
      <link>https://yeri.be/yard-sale-raspberry-pis/</link>
      <pubDate>Sat, 19 Apr 2014 14:33:31 +0200</pubDate>
      <author>Yeri Tiete</author>
      <guid isPermaLink="true">https://yeri.be/yard-sale-raspberry-pis/</guid>
      <description>&lt;p&gt;&lt;a href=&#34;https://yeri.be/tag/yard-sale&#34;&gt;Today&lt;/a&gt; I&amp;rsquo;m selling Raspberry Pi&amp;rsquo;s.&lt;/p&gt;&#xA;&lt;p style=&#34;text-align: center;&#34;&gt;&lt;a href=&#34;https://static.yeri.be/2014/04/IMG_20140417_172849_2.jpg&#34;&gt;&lt;img class=&#34;alignnone size-medium wp-image-6117&#34; src=&#34;https://static.yeri.be/2014/04/IMG_20140417_172849_2-300x222.jpg&#34; alt=&#34;IMG_20140417_172849_2&#34; width=&#34;300&#34; height=&#34;222&#34; /&gt;&lt;/a&gt;&lt;/p&gt;&#xA;4 are unused, new, in packaging. I have a couple more (about 6) who got used for a couple of hours, but never anything serious.&#xA;&lt;p&gt;I am also selling the power adapter and the laser cut casing.&lt;/p&gt;&#xA;&lt;p style=&#34;text-align: center;&#34;&gt; &lt;a href=&#34;https://static.yeri.be/2014/04/IMG_20140417_172914_2.jpg&#34;&gt;&lt;img class=&#34;alignnone size-medium wp-image-6116&#34; src=&#34;https://static.yeri.be/2014/04/IMG_20140417_172914_2-300x222.jpg&#34; alt=&#34;IMG_20140417_172914_2&#34; width=&#34;300&#34; height=&#34;222&#34; /&gt;&lt;/a&gt; &lt;a href=&#34;https://static.yeri.be/2014/04/IMG_20140417_172909_2.jpg&#34;&gt;&lt;img class=&#34;alignnone size-medium wp-image-6119&#34; src=&#34;https://static.yeri.be/2014/04/IMG_20140417_172909_2-300x222.jpg&#34; alt=&#34;IMG_20140417_172909_2&#34; width=&#34;300&#34; height=&#34;222&#34; /&gt;&lt;/a&gt;&lt;/p&gt;&#xA;Raspberry Pi: €30,49/item (type B - 512 Mb RAM)&#xA;&lt;p&gt;PSU: €4.45/item&lt;/p&gt;&#xA;&lt;p&gt;Casing: €4/item&lt;/p&gt;&#xA;&lt;p&gt;Possible on invoice.&lt;/p&gt;&#xA;&lt;p&gt;Contact: &lt;a href=&#34;mailto:yeri&amp;#43;rpi@tiete.be&#34;&gt;yeri+rpi@tiete.be&lt;/a&gt;&lt;/p&gt;</description>
      <content:encoded><![CDATA[<p><a href="https://yeri.be/tag/yard-sale">Today</a> I&rsquo;m selling Raspberry Pi&rsquo;s.</p>
<p style="text-align: center;"><a href="https://static.yeri.be/2014/04/IMG_20140417_172849_2.jpg"><img class="alignnone size-medium wp-image-6117" src="https://static.yeri.be/2014/04/IMG_20140417_172849_2-300x222.jpg" alt="IMG_20140417_172849_2" width="300" height="222" /></a></p>
4 are unused, new, in packaging. I have a couple more (about 6) who got used for a couple of hours, but never anything serious.
<p>I am also selling the power adapter and the laser cut casing.</p>
<p style="text-align: center;"> <a href="https://static.yeri.be/2014/04/IMG_20140417_172914_2.jpg"><img class="alignnone size-medium wp-image-6116" src="https://static.yeri.be/2014/04/IMG_20140417_172914_2-300x222.jpg" alt="IMG_20140417_172914_2" width="300" height="222" /></a> <a href="https://static.yeri.be/2014/04/IMG_20140417_172909_2.jpg"><img class="alignnone size-medium wp-image-6119" src="https://static.yeri.be/2014/04/IMG_20140417_172909_2-300x222.jpg" alt="IMG_20140417_172909_2" width="300" height="222" /></a></p>
Raspberry Pi: €30,49/item (type B - 512 Mb RAM)
<p>PSU: €4.45/item</p>
<p>Casing: €4/item</p>
<p>Possible on invoice.</p>
<p>Contact: <a href="mailto:yeri&#43;rpi@tiete.be">yeri+rpi@tiete.be</a></p>
]]></content:encoded>
      <category>hardware</category><category>linux</category>
      <category>raspberrypi</category><category>yard sale</category>
    </item>
    
    <item>
      <title>Munin &#43; Raspberry Pi &#43; temperature: updated</title>
      <link>https://yeri.be/munin-raspberry-pi-temperature-updated/</link>
      <pubDate>Sun, 09 Feb 2014 14:13:32 +0100</pubDate>
      <author>Yeri Tiete</author>
      <guid isPermaLink="true">https://yeri.be/munin-raspberry-pi-temperature-updated/</guid>
      <description>&lt;p&gt;I got a mail in my inbox about a week ago from &lt;a href=&#34;https://web.archive.org/web/20130817065743/http://blog.glag.la/&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Anthony&lt;/a&gt;, telling me how to improve my &lt;a href=&#34;https://yeri.be/munin-raspberry-pi-temperature&#34;&gt;Munin &amp;amp; temp&lt;/a&gt; script for a RPi:&lt;/p&gt;&#xA;&lt;blockquote&gt;Hi,&#xA;&lt;p&gt;I just read your (old) blog post about monitoring the temperature of the Raspberry Pi with munin[1].&lt;/p&gt;&#xA;&lt;p&gt;I had the exact same error as you did when I was trying to let munin do the job all by himself:&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;temp.value VCHI initialization failed)&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;It turns out the solution was quite easy: in&lt;/p&gt;</description>
      <content:encoded><![CDATA[<p>I got a mail in my inbox about a week ago from <a href="https://web.archive.org/web/20130817065743/http://blog.glag.la/" target="_blank" rel="noopener noreferrer">Anthony</a>, telling me how to improve my <a href="https://yeri.be/munin-raspberry-pi-temperature">Munin &amp; temp</a> script for a RPi:</p>
<blockquote>Hi,
<p>I just read your (old) blog post about monitoring the temperature of the Raspberry Pi with munin[1].</p>
<p>I had the exact same error as you did when I was trying to let munin do the job all by himself:</p>
<blockquote>
<p>temp.value VCHI initialization failed)</p>
</blockquote>
<p>It turns out the solution was quite easy: in</p>
<p>/etc/munin/plugin-conf.d/munin-node</p>
<p>You simply need to tell munin that it needs to run as root for this specific plugin:</p>
<blockquote>
<p>[pisense_]</p>
</blockquote>
<blockquote>
<p>user root</p>
</blockquote>
<p>(the plugins also tracks clock speeds and voltages but any other will work just fine as long as the &ldquo;user root&rdquo; is set in the munin-node plugin config file : [2]). Probably the easiest way to check if it&rsquo;s working is to use munin-run command before and after the change.</p>
<p>&ldquo;Demo&rdquo;: [3]</p>
<p>By the way, &ldquo;Connect different LANs over openVPN&rdquo; is pretty tempting, I always wondered what the performances would be like through a USB-to-ethernet adapter.</p>
<p>Have a nice one !</p>
<p>Apteno</p>
<p>[1] <a href="https://yeri.be/munin-raspberry-pi-temperature"><a href="https://yeri.be/munin-raspberry-pi-temperature">https://yeri.be/munin-raspberry-pi-temperature</a></a>
[2] <a href="https://github.com/perception101/pisense/blob/master/pisense_"><a href="https://github.com/perception101/pisense/blob/master/pisense" target="_blank" rel="noopener noreferrer">https://github.com/perception101/pisense/blob/master/pisense</a>_</a>
[3] <a href="http://ronon.jefter.com/jefter.com/adama.jefter.com/index.html#sensors"><a href="http://ronon.jefter.com/jefter.com/adama.jefter.com/index.html#sensors" target="_blank" rel="noopener noreferrer">http://ronon.jefter.com/jefter.com/adama.jefter.com/index.html#sensors</a></a></blockquote></p>
<p>And indeed, I knew it was a permission issue, but instead of running this script as root, I tried adding Munin to a group that was supposed to be able to run  <code>vcgencmd</code> (which didn&rsquo;t work out).</p>
<p>But, let&rsquo;s look at a simpler solution:</p>
<ol>
    <li>Go to <code>/etc/munin/plugins</code> and create a file <code>temp</code> with this content (and some indentation yourself):
<pre>#!/bin/sh
case $1 in
config)
<span style="line-height: 1.5em;">cat &lt;&lt;'EOM'
</span><span style="line-height: 1.5em;">graph_category system
</span><span style="line-height: 1.5em;">graph_title Temperature
</span>graph_vlabel temp
<span style="line-height: 1.5em;">temp.label Celsius
</span><span style="line-height: 1.5em;">EOM
</span>exit 0;;
esac
echo -n "temp.value "
/opt/vc/bin/vcgencmd measure_temp | cut -d "=" -f2 | cut -d "'" -f1</pre>
</li>
    <li>As you noticed, this doesn't require any more scripts to run from cron (and thus, in case you used my <a href="https://yeri.be/munin-raspberry-pi-temperature">previous script</a>, remove it from cron)</li>
    <li>
<pre>chmod +x temp</pre>
</li>
    <li>Make sure it runs as root; in <code>/etc/munin/plugin-conf.d</code> create the file <code>temp.conf</code> with this content:
<pre>[temp]
user root</pre>
</li>
    <li><span style="line-height: 1.5em;">Test it:</span>
<pre><span style="line-height: 1.5em;"># munin-run temp
</span><span style="line-height: 1.5em;">temp.value 59.5</span></pre>
</li>
</ol>
<p>Tadaaaa. Simpler.</p>
<p>Thanks Anthony :)</p>
]]></content:encoded>
      <category>hardware</category><category>linux</category><category>software</category>
      <category>munin</category><category>raspberrypi</category>
    </item>
    
    <item>
      <title>Why historical data matters (and is just cool to look at)</title>
      <link>https://yeri.be/why-historical-data-matters-and-is-just-cool-to-look-at/</link>
      <pubDate>Sat, 08 Feb 2014 08:11:27 +0100</pubDate>
      <author>Yeri Tiete</author>
      <guid isPermaLink="true">https://yeri.be/why-historical-data-matters-and-is-just-cool-to-look-at/</guid>
      <description>&lt;p&gt;CPU &lt;a href=&#34;https://yeri.be/munin-raspberry-pi-temperature&#34;&gt;temperature&lt;/a&gt; from a Raspberry Pi (behind the &lt;a href=&#34;http://blog.flatturtle.com/image/68047615828&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;display&lt;/a&gt;, in the wall).&lt;/p&gt;&#xA;&lt;p style=&#34;text-align: center;&#34;&gt;&lt;a href=&#34;https://static.yeri.be/2014/02/temp.png&#34;&gt;&lt;img class=&#34;alignnone  wp-image-5877 aligncenter&#34; alt=&#34;temp&#34; src=&#34;https://static.yeri.be/2014/02/temp-1024x673.png&#34; width=&#34;614&#34; height=&#34;404&#34; /&gt;&lt;/a&gt;(zoom in)&lt;/p&gt;&#xA;&amp;nbsp;&#xA;&lt;p&gt; &lt;/p&gt;</description>
      <content:encoded><![CDATA[<p>CPU <a href="https://yeri.be/munin-raspberry-pi-temperature">temperature</a> from a Raspberry Pi (behind the <a href="http://blog.flatturtle.com/image/68047615828" target="_blank" rel="noopener noreferrer">display</a>, in the wall).</p>
<p style="text-align: center;"><a href="https://static.yeri.be/2014/02/temp.png"><img class="alignnone  wp-image-5877 aligncenter" alt="temp" src="https://static.yeri.be/2014/02/temp-1024x673.png" width="614" height="404" /></a>(zoom in)</p>
&nbsp;
<p> </p>
]]></content:encoded>
      <category>hardware</category>
      <category>flatturtle</category><category>raspberrypi</category>
    </item>
    
    <item>
      <title>Raspberry Pi &#43; ad blocking &#43; nginx</title>
      <link>https://yeri.be/raspberry-pi-ad-blocking/</link>
      <pubDate>Thu, 19 Sep 2013 20:13:26 +0200</pubDate>
      <author>Yeri Tiete</author>
      <guid isPermaLink="true">https://yeri.be/raspberry-pi-ad-blocking/</guid>
      <description>&lt;p&gt;There&amp;rsquo;s &lt;a href=&#34;http://learn.adafruit.com/raspberry-pi-as-an-ad-blocking-access-point/install-software&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;this howto&lt;/a&gt; that explains how to set up the RPi as ad blocker.&lt;/p&gt;&#xA;&lt;p&gt;I&amp;rsquo;ve two RPi&amp;rsquo;s acting a router and was already running dnsmasq. I decided to give it a try. Note that this howto can actually be used on any DNS serving Linux server.&lt;/p&gt;&#xA;&lt;p&gt;First of all, don&amp;rsquo;t go with the pixelserv as it crashes after a few minutes.&lt;/p&gt;&#xA;&lt;p&gt;Apache is an option that worked fine. A general hint: if you&amp;rsquo;re already running Apache or whatever on port 80, just add a 2nd static IP and make Apache listen to that.&lt;/p&gt;</description>
      <content:encoded><![CDATA[<p>There&rsquo;s <a href="http://learn.adafruit.com/raspberry-pi-as-an-ad-blocking-access-point/install-software" target="_blank" rel="noopener noreferrer">this howto</a> that explains how to set up the RPi as ad blocker.</p>
<p>I&rsquo;ve two RPi&rsquo;s acting a router and was already running dnsmasq. I decided to give it a try. Note that this howto can actually be used on any DNS serving Linux server.</p>
<p>First of all, don&rsquo;t go with the pixelserv as it crashes after a few minutes.</p>
<p>Apache is an option that worked fine. A general hint: if you&rsquo;re already running Apache or whatever on port 80, just add a 2nd static IP and make Apache listen to that.</p>
<p>For example (/etc/network/interfaces) &ndash; be sure it&rsquo;s in the same subnet:</p>
<pre>auto eth0:0
iface eth0:0 inet static
 address 10.100.200.254
 netmask 255.255.255.0
 broadcast 10.100.200.255</pre>
<p>10.100.200.254 is the Apache IP that just serves a HTTP 200 (or 204).</p>
<p>Here&rsquo;s the relevant config part (note the HTTP 204 code, more info on that later):</p>
<pre>&lt;VirtualHost adblock:80&gt;
 ServerAdmin webmaster@domain.net
 DocumentRoot /var/www
 &lt;Directory /&gt;
 Options FollowSymLinks
 AllowOverride All
 &lt;/Directory&gt;
 &lt;Directory /var/www/&gt;
 Options Indexes FollowSymLinks MultiViews
 AllowOverride None
 Order allow,deny
 allow from all
 RewriteEngine on
 RedirectMatch 204 (.*)$
 ErrorDocument 204 " "
 &lt;/Directory&gt;

ErrorLog ${APACHE_LOG_DIR}/error.log
 LogLevel warn
 CustomLog ${APACHE_LOG_DIR}/access.log combined
&lt;/VirtualHost&gt;</pre>
<p>And edit /etc/hosts to add &ldquo;adblock&rdquo;:</p>
<pre>10.100.200.254 adblock.local adblock</pre>
<p>If I had used the IP instead of adblock I would have had this error:</p>
<pre># apache2ctl configtest
[Mon Sep 16 20:27:21 2013] [error] (EAI 2)Name or service not known: 
Failed to resolve server name for 10.100.200.254 (check DNS) 
-- or specify an explicit ServerName
Syntax OK</pre>
<p>With the HTTP 200 code, some browsers expect some content/file in return. So it&rsquo;s generally safer to use HTTP 204 &ldquo;<a href="https://en.wikipedia.org/wiki/List_of_HTTP_status_codes#2xx_Success" target="_blank" rel="noopener noreferrer">No Content</a>&rdquo;; which basically means &ldquo;all good but I have nothing to serve you.&rdquo;</p>
<p>Now, I call myself an nginx fan. Running Apache on a RPi is a no go (at least for me). I could&rsquo;ve ran nginx on the RPi, but decided to run it on a remote server with an additional IP. At least for now. To preserve resources on the RPi.</p>
<p>Here&rsquo;s the relevant config to run it on nginx (and be sure this config is the first file nginx parses; or it might redirect all the domains to some other site):</p>
<pre>server {
 listen 80;
 server_name pixel.0x04.com 10.100.200.254 _;
 access_log /var/log/nginx/pixel.access.log;
 error_log /var/log/nginx/pixel.error.log;
 expires max;
 autoindex off; 
 rewrite ^(.*)$ /;
 location / {
  return 204 'pixel';
 }
}</pre>
<p>And if we test it, this is what we get:</p>
<pre>HTTP/1.1 204 No Content
Server: nginx/1.4.0
Date: Mon, 16 Sep 2013 18:36:52 GMT
Connection: close
Expires: Thu, 31 Dec 2037 23:55:55 GMT
Cache-Control: max-age=315360000</pre>
<p>And that&rsquo;s it.</p>
<p>&lt;3 nginx</p>
<p>The only downside is that this won&rsquo;t work with HTTPS. You can run your webbrowser with a self signed certificate, but this will throw errors&hellip;</p>
<p>The result:</p>
<p><a href="https://static.yeri.be/2013/09/adblock.png"><img class="alignnone size-medium wp-image-5298 aligncenter" alt="adblock" src="https://static.yeri.be/2013/09/adblock-300x171.png" width="300" height="171" /></a></p>
]]></content:encoded>
      <category>linux</category><category>networking</category><category>software</category><category>www</category>
      <category>dns</category><category>nginx</category><category>raspberrypi</category>
    </item>
    
    <item>
      <title>Munin &#43; Raspberry Pi &#43; temperature</title>
      <link>https://yeri.be/munin-raspberry-pi-temperature/</link>
      <pubDate>Sun, 26 May 2013 17:18:09 +0200</pubDate>
      <author>Yeri Tiete</author>
      <guid isPermaLink="true">https://yeri.be/munin-raspberry-pi-temperature/</guid>
      <description>&lt;p&gt;Quick hack to get Munin to graph the cpu temperature.&lt;/p&gt;&#xA;&lt;p&gt;&lt;a href=&#34;https://static.yeri.be/2013/05/temp-day.png&#34;&gt;&lt;img class=&#34;alignnone size-full wp-image-5081 aligncenter&#34; alt=&#34;temp-day&#34; src=&#34;https://static.yeri.be/2013/05/temp-day.png&#34; width=&#34;497&#34; height=&#34;280&#34; /&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&lt;p&gt;First of all, install Munin and make sure it&amp;rsquo;s working.&lt;/p&gt;&#xA;&lt;p&gt;Then follow these steps:&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;We&amp;rsquo;ll use cron to write the current temp to a log file. We do this because I wasn&amp;rsquo;t able to get Munin to directly execute the command (error: &lt;code&gt;temp.value VCHI initialization failed&lt;/code&gt;)&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;p&gt;Execute &lt;code&gt;crontab -e&lt;/code&gt; and add this line (this has to be on one line):&lt;/p&gt;</description>
      <content:encoded><![CDATA[<p>Quick hack to get Munin to graph the cpu temperature.</p>
<p><a href="https://static.yeri.be/2013/05/temp-day.png"><img class="alignnone size-full wp-image-5081 aligncenter" alt="temp-day" src="https://static.yeri.be/2013/05/temp-day.png" width="497" height="280" /></a></p>
<p>First of all, install Munin and make sure it&rsquo;s working.</p>
<p>Then follow these steps:</p>
<ol>
<li>We&rsquo;ll use cron to write the current temp to a log file. We do this because I wasn&rsquo;t able to get Munin to directly execute the command (error: <code>temp.value VCHI initialization failed</code>)</li>
</ol>
<p>Execute <code>crontab -e</code> and add this line (this has to be on one line):</p>
<p><code>*/5 * * * * /opt/vc/bin/vcgencmd measure_temp | cut -d &ldquo;=&rdquo; -f2 | cut -d &ldquo;&rsquo;&rdquo; -f1 &gt; /tmp/.temp</code></p>
<ol start="2">
<li>Go to <code>/etc/munin/plugins/</code>, and create a file <code>temp</code>, and add this content:</li>
</ol>
<p><code>#!/bin/sh
case $1 in
config)
cat &lt;&lt;&lsquo;EOM&rsquo;
graph_category system
graph_title Temperature
graph_vlabel temp
temp.label Celsius
EOM
exit 0;;
esac
echo -n &ldquo;temp.value &quot;
cat /tmp/.temp</code></p>
<p>Save and exit the editor.</p>
<p>I&rsquo;m not sure this is needed, but better do it: <code>chmod +x temp</code></p>
<ol start="3">
<li>
<p>restart munin-node (<code>/etc/init.d/munin-node restart</code>)</p>
</li>
<li>
<p>test if it&rsquo;s working:</p>
</li>
</ol>
<p><code># telnet localhost 4949
Trying 127.0.0.1&hellip;
Connected to localhost.
Escape character is &lsquo;^]&rsquo;.</p>
<h1 id="munin-node-at-industryyeribe">munin node at industry.yeri.be</h1>
<p>fetch temp
temp.value 57.3
.</code></p>
<p>That&rsquo;s it. Your munin daemon/host should now correctly graph the temperature.</p>
<p><span style="text-decoration: underline;">Edit</span> (8/2/2014): updated script can be found <a href="https://yeri.be/munin-raspberry-pi-temperature-updated">here</a>.</p>
]]></content:encoded>
      <category>hardware</category><category>linux</category><category>software</category>
      <category>munin</category><category>raspberrypi</category>
    </item>
    
    <item>
      <title>Home made TimeMachine</title>
      <link>https://yeri.be/home-made-timemachine/</link>
      <pubDate>Sat, 23 Mar 2013 04:01:21 +0100</pubDate>
      <author>Yeri Tiete</author>
      <guid isPermaLink="true">https://yeri.be/home-made-timemachine/</guid>
      <description>&lt;p&gt;&lt;a href=&#34;http://www.bootc.net/archives/2010/11/07/apple-time-machine-and-netatalk/&#34; target=&#34;_blank&#34;&gt;This&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;p&gt;Used my Raspberry Pi, with an USB disk as TimeMachine. Another disk as NAS/storage. It&amp;rsquo;s just quite slow&amp;hellip; Not sure whether it&amp;rsquo;s my WiFi or RPi that can&amp;rsquo;t keep up.&lt;/p&gt;&#xA;&lt;p&gt;But for now, it&amp;rsquo;s working.&lt;/p&gt;</description>
      <content:encoded><![CDATA[<p><a href="http://www.bootc.net/archives/2010/11/07/apple-time-machine-and-netatalk/" target="_blank">This</a>.</p>
<p>Used my Raspberry Pi, with an USB disk as TimeMachine. Another disk as NAS/storage. It&rsquo;s just quite slow&hellip; Not sure whether it&rsquo;s my WiFi or RPi that can&rsquo;t keep up.</p>
<p>But for now, it&rsquo;s working.</p>
]]></content:encoded>
      <category>apple</category><category>hardware</category><category>linux</category><category>networking</category><category>software</category>
      <category>backup</category><category>raspberrypi</category>
    </item>
    
    <item>
      <title>Connect different LANs over openVPN</title>
      <link>https://yeri.be/connect-different-lans-over-openvpn/</link>
      <pubDate>Tue, 29 Jan 2013 11:47:50 +0100</pubDate>
      <author>Yeri Tiete</author>
      <guid isPermaLink="true">https://yeri.be/connect-different-lans-over-openvpn/</guid>
      <description>&lt;p&gt;I now own three &lt;a href=&#34;http://www.raspberrypi.org/&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Raspberry Pi&amp;rsquo;s&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;p&gt;Using two of them (and my &lt;a href=&#34;https://yeri.be/?s=guruplug&amp;amp;x=0&amp;amp;y=0&#34;&gt;Guruplug&lt;/a&gt; as WiFi AP) I connected my new apartment with my old house (= parents) over VPN.&lt;/p&gt;&#xA;&lt;p&gt;This way I can access the printers/scanners and NAS at home.&lt;/p&gt;&#xA;&lt;p&gt;The 2 rPI&amp;rsquo;s are used as router (using a Macbook Air USB-to-Ethernet adapter as 2nd ethernet (eth1) port). Basic howto&amp;rsquo;s are easily found using Google to do this (a &lt;a href=&#34;https://web.archive.org/web/20131205200223/http://www.gentoo.org:80/doc/en/home-router-howto.xml&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;good starting point&lt;/a&gt;).&lt;/p&gt;</description>
      <content:encoded><![CDATA[<p>I now own three <a href="http://www.raspberrypi.org/" target="_blank" rel="noopener noreferrer">Raspberry Pi&rsquo;s</a>.</p>
<p>Using two of them (and my <a href="https://yeri.be/?s=guruplug&amp;x=0&amp;y=0">Guruplug</a> as WiFi AP) I connected my new apartment with my old house (= parents) over VPN.</p>
<p>This way I can access the printers/scanners and NAS at home.</p>
<p>The 2 rPI&rsquo;s are used as router (using a Macbook Air USB-to-Ethernet adapter as 2nd ethernet (eth1) port). Basic howto&rsquo;s are easily found using Google to do this (a <a href="https://web.archive.org/web/20131205200223/http://www.gentoo.org:80/doc/en/home-router-howto.xml" target="_blank" rel="noopener noreferrer">good starting point</a>).</p>
<p>I made my own installation of Raspbian (as the downloadable image contains too much crap), details <a href="http://www.raspbian.org/RaspbianInstaller" target="_blank" rel="noopener noreferrer">here</a> (actually not that easy to find when Googling for bootstrap raspbian etc).</p>
<p> </p>
<p>I&rsquo;ve connected three different LANs over an OpenVPN connection:</p>
<ul>
    <li>LAN1 (home): 192.168.1.0 (Gateway: 192.168.1.1, VPN ip: 10.9.8.254)</li>
    <li>LAN2 (apartment, ethernet): 10.60.111.0 (Gateway: 10.60.111.1, VPN ip: 10.9.8.250)</li>
    <li>LAN3 (apartment, wifi): 10.10.10.0 (Gateway: 10.10.10.1, VPN ip: 10.9.8.246)</li>
</ul>
<p>OpenVPN range: 10.9.8.0. The subnet is 255.255.255.0 in all cases.</p>
<p>LAN3 is connected via LAN2 to the internet. So the default gateway of router 10.10.10.1 is 10.60.111.1.</p>
<p>The gateway/routers are all Debian-based Linux systems. I&rsquo;m using <a href="http://www.edpnet.be/" target="_blank" rel="noopener noreferrer">EDPnet</a> as ISP, and thus need to use those Sagem/Belgacom approved routers (BBox-2 hardware). These Sagems are set in bridged mode, and don&rsquo;t do the PPP stuff. <a href="http://wiki.debian.org/PPPoE" target="_blank" rel="noopener noreferrer">PPPoeconfig</a> on Debian takes care of most of the stuff. As EDPnet provides ipv6, I can ping6 from those routers.</p>
<p>The idea is to connect/ping each and every LAN from any of the clients connected the LANs (without running OpenVPN on the clients; only run it on the gateways).</p>
<p>For example: my PC with ip 10.10.10.15 wants to connect to the NAS with ip 192.168.1.100.</p>
<p>This can easily be achieved by setting a client-config-dir in the openvpn.conf file (or whatever the name of your config):</p>
<pre>client-config-dir /etc/openvpn/tiete</pre>
<p>And don&rsquo;t forget to add route pushes:</p>
<pre>push "route 192.168.1.0 255.255.255.0"
push "route 10.60.111.0 255.255.255.0"
push "route 10.10.10.0 255.255.255.0"</pre>
<p>But here comes the annoying part. As I&rsquo;m pushing routes 10.60.111.0 via VPN, which is supposed to be my Guruplug&rsquo;s default gateway as well (ISP &gt; eth0:RaspberryPi:eth1 &gt; eth0:Guruplug, remember?) this was causing quite some routing fuck ups.</p>
<p>The easiest way to solve this was to turn off VPN on the Guruplug all together, and route 10.10.10.0 over the Raspberry Pi, by adding this line to /etc/network/interfaces:</p>
<pre>up route add -net 10.10.10.0 netmask 255.255.255.0 gw 10.60.111.2 dev eth1</pre>
<p>Then I&rsquo;ll change the client specific configs on the VPN. Create a file in whatever you picked as client-config-dir, and name it the actual VPN name (the name used when creating the key).</p>
<p>As I have three routers, I created three files (sheeva for my guruplug, Pi for my first rPI and Industry for my 2nd. Yep&hellip; Fancy names).</p>
<p>I also want to give a static IP address to the gateways, so I use the option:</p>
<pre>ifconfig-push 10.9.8.&lt;valid-ip&gt; 10.9.8.&lt;valid-ip - 1&gt;</pre>
<p>And I&rsquo;ll also add the iroute option to push routes.</p>
<p>This is what it looks like for the router on the 192.168.1.0 network (&ldquo;Pi&rdquo;):</p>
<pre>ifconfig-push 10.9.8.254 10.9.8.253
iroute 192.168.1.0 255.255.255.0</pre>
<p>For &ldquo;Sheeva&rdquo;, the WiFi AP on 10.10.10.0:</p>
<pre>ifconfig-push 10.9.8.246 10.9.8.245</pre>
<p>And for 10.60.111.0 plus 10.10.10.0 routed over 10.60.111.0 (&ldquo;Industry&rdquo;):</p>
<pre>ifconfig-push 10.9.8.250 10.9.8.249
iroute 10.60.111.0 255.255.255.0
iroute 10.10.10.0 255.255.255.0</pre>
<p>And don&rsquo;t forget to set up masquerading over tun0 (or tun+) with iptables.</p>
<p>Now&hellip; Oddly enough, this didn&rsquo;t require that much configuration, cursing and stress&hellip; And, well, it kind of just works.</p>
<p>From my Mac to my NAS:</p>
<pre>nazgul ~ $ traceroute 192.168.1.100
traceroute to 192.168.1.100 (192.168.1.100), 64 hops max, 52 byte packets
 1 sheeva (10.10.10.1) 1.936 ms 1.159 ms 0.800 ms
 2 10.60.111.1 (10.60.111.1) 1.456 ms 1.776 ms 1.539 ms
 3 10.9.8.254 (10.9.8.254) 55.745 ms 55.046 ms 54.734 ms
 4 192.168.1.100 (192.168.1.100) 62.302 ms 55.327 ms 54.795 ms</pre>
<p>From Pi (gateway 192.168.1.1) to nazgul, my Mac:</p>
<pre>pi ~ # traceroute 10.10.10.15
traceroute to 10.10.10.15 (10.10.10.15), 30 hops max, 60 byte packets
 1 10.9.8.250 (10.9.8.250) 65.892 ms 74.177 ms 73.957 ms
 2 10.60.111.2 (10.60.111.2) 73.441 ms 72.902 ms 72.342 ms
 3 10.10.10.15 (10.10.10.15) 71.780 ms 71.187 ms 70.760 ms</pre>
<p>From Heartbeat (10.9.8.102), my Munin stats server to the printer:</p>
<pre>heartbeat ~/bin # traceroute 192.168.1.90
traceroute to 192.168.1.90 (192.168.1.90), 30 hops max, 60 byte packets
 1 pi (10.9.8.254) 39.835 ms 40.794 ms 41.567 ms
 2 192.168.1.90 (192.168.1.90) 41.541 ms 42.452 ms 43.307 ms</pre>
<p>From Heartbeat to Sheeva&rsquo;s eth0 IP:</p>
<pre>heartbeat ~/bin # traceroute 10.60.111.2
traceroute to 10.60.111.2 (10.60.111.2), 30 hops max, 60 byte packets
 1 industry (10.9.8.250) 32.716 ms 32.615 ms 34.359 ms
 2 sheeva (10.60.111.2) 34.405 ms 34.349 ms 35.014 ms</pre>
<p>From Heartbeat to an Android device (not sure why the latency spike):</p>
<pre>heartbeat ~/bin # traceroute 10.10.10.72
traceroute to 10.10.10.72 (10.10.10.72), 30 hops max, 60 byte packets
 1 industry (10.9.8.250) 31.337 ms 32.269 ms 32.218 ms
 2 sheeva (10.60.111.2) 33.006 ms 33.052 ms 32.996 ms
 3 10.10.10.72 (10.10.10.72) 471.564 ms 472.169 ms 473.082 ms</pre>
<p>Next up (once I have spare time): try to sync local DNS and fix local ipv6.</p>
<p>I&rsquo;ll put most of the configs on Github at some point.</p>
]]></content:encoded>
      <category>hardware</category><category>linux</category><category>networking</category><category>software</category>
      <category>debian</category><category>raspberrypi</category>
    </item>
    
  </channel>
</rss>
