<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>RPi &#8211; ZZ &amp; Joa</title>
	<atom:link href="https://blog.znjoa.com/category/rpi/feed/" rel="self" type="application/rss+xml" />
	<link>https://blog.znjoa.com</link>
	<description>Work &#38; Life</description>
	<lastBuildDate>Sat, 01 Mar 2025 14:30:09 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>

<image>
	<url>https://blog.znjoa.com/wp-content/uploads/2022/11/cropped-DALL·E-2022-11-23-19.39.49-USSR-style-poster-of-VR-and-AR-150x150.jpg</url>
	<title>RPi &#8211; ZZ &amp; Joa</title>
	<link>https://blog.znjoa.com</link>
	<width>32</width>
	<height>32</height>
</image> 
<site xmlns="com-wordpress:feed-additions:1">192961540</site>	<item>
		<title>Installing Overleaf server (community edition) on Raspberry Pi</title>
		<link>https://blog.znjoa.com/2024/11/24/installing-overleaf-community-edition-on-raspberry-pi/</link>
					<comments>https://blog.znjoa.com/2024/11/24/installing-overleaf-community-edition-on-raspberry-pi/#comments</comments>
		
		<dc:creator><![CDATA[Zz]]></dc:creator>
		<pubDate>Sun, 24 Nov 2024 21:51:20 +0000</pubDate>
				<category><![CDATA[RPi]]></category>
		<category><![CDATA[Arm64]]></category>
		<category><![CDATA[Overleaf]]></category>
		<category><![CDATA[Overleaf CE]]></category>
		<category><![CDATA[Overleaf community editon]]></category>
		<category><![CDATA[Raspberry Pi]]></category>
		<guid isPermaLink="false">https://www.znjoa.com/?p=299</guid>

					<description><![CDATA[Get toolkit cd ~ git clone https://github.com/overleaf/toolkit.git cd toolkit bin/init Change listening IP and port sudo&#46;&#46;&#46;]]></description>
										<content:encoded><![CDATA[<h2>Get toolkit</h2>
<pre class="EnlighterJSRAW" data-enlighter-language="bash">cd ~
git clone https://github.com/overleaf/toolkit.git
cd toolkit
bin/init
</pre>
<h2>Change listening IP and port</h2>
<pre class="EnlighterJSRAW" data-enlighter-language="bash">sudo vim config/overleaf.rc
</pre>
<ul>
<li>change <code>YourPORTChoice</code> in <code>OVERLEAF_PORT=YourPORTChoice</code></li>
<li>change  <code>OVERLEAF_LISTEN_IP</code>to <code>0.0.0.0</code></li>
</ul>
<h2>Build docker images for ARM</h2>
<p>This is the key part. One needs to build the arm version of the docker images using the command below.</p>
<pre class="EnlighterJSRAW" data-enlighter-language="bash">cd ~<br />git clone https://github.com/overleaf/overleaf.git
cd overleaf/server-ce

make ARCH=arm build-base
make ARCH=arm build-community</pre>
<h2>Change image names</h2>
<p>The image needs to be renamed, correponding to the version mentioned in the version file below.</p>
<pre class="EnlighterJSRAW" data-enlighter-language="bash">docker image tag sharelatex/sharelatex:main sharelatex/sharelatex: x.x.x</pre>
<pre>Note:<br />- <code>x.x.x</code> comes from ~/toolkit/config/version</pre>
<h2>Start service</h2>
<pre class="EnlighterJSRAW" data-enlighter-language="bash">bin/up -d</pre>
<h2>Verify the service is accessible</h2>
<ul>
<li>Access the below link in your browser:</li>
</ul>
<pre class="EnlighterJSRAW" data-enlighter-language="bash">YourServerIP:YourPORTChoice</pre>


<h2 class="wp-block-heading">Creating a new user</h2>



<pre class="wp-block-code"><code>bin/docker-compose exec sharelatex /bin/bash -ce "cd /overleaf/services/web &amp;&amp; node modules/server-ce-scripts/scripts/add-user --email=your_email_address"</code></pre>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.znjoa.com/2024/11/24/installing-overleaf-community-edition-on-raspberry-pi/feed/</wfw:commentRss>
			<slash:comments>4</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">299</post-id>	</item>
		<item>
		<title>Migrating Raspberry Pi OS from micro SD card to SSD with existing partitions</title>
		<link>https://blog.znjoa.com/2023/12/16/migrating-raspberry-pi-os-from-micro-sd-card-to-ssd-with-existing-partitions/</link>
					<comments>https://blog.znjoa.com/2023/12/16/migrating-raspberry-pi-os-from-micro-sd-card-to-ssd-with-existing-partitions/#respond</comments>
		
		<dc:creator><![CDATA[Zz]]></dc:creator>
		<pubDate>Sat, 16 Dec 2023 19:01:08 +0000</pubDate>
				<category><![CDATA[RPi]]></category>
		<category><![CDATA[Tech]]></category>
		<guid isPermaLink="false">https://www.znjoa.com/?p=240</guid>

					<description><![CDATA[Moving the installation of your Raspberry Pi from the micro SD card to an external SSD&#46;&#46;&#46;]]></description>
										<content:encoded><![CDATA[
<p><em>Moving the installation of your Raspberry Pi from the micro SD card to an external SSD can boost performance. </em></p>
<p><em>In case the SSD  planned to move the installation to already has data which should be kept, the following steps can be followed.</em></p>



<h2 class="wp-block-heading">Create partitions for RPi on the SSD</h2>



<p>All the following partition operations can be done in<code class="EnlighterJSRAW" data-enlighter-language="generic">GParted</code>.</p>



<p>First, two partitions corresponding to the micro SD card need to be created on the SSD: <code class="EnlighterJSRAW" data-enlighter-language="generic">bootfs</code> and <code class="EnlighterJSRAW" data-enlighter-language="generic">rootfs</code>. If necessary the existing partition on the SSD should be resized on the left side to allow for the new partitions. The size of these two partitions should be the same as those on the micro SD card.</p>



<h2 class="wp-block-heading">Clone micro SD partitions into the two partitions on SSD</h2>



<p>The following commands can be used to clone the partitions:</p>



<pre class="EnlighterJSRAW" data-enlighter-language="bash" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">sudo dd bs=512M  if=/dev/your_microSD_boot_partition of=/dev/your_ssd_boot_partition
sudo dd bs=512M  if=/dev/your_microSD_root_partition of=/dev/your_ssd_root_partition</pre>



<p>The cloned partitions should be checked in <code>GParted</code> to check no errors are given.</p>



<h2 class="wp-block-heading">UUID settings</h2>



<p>Partition <code>UUIDs</code>  need to be adjusted to point to these on the SSD. This includes two parts: <code>/cmdline.txt</code> in <code>bootfs</code></p>



<p>and <code>/etc/fstab</code> in <code>rootfs</code>. They can be changed by mounting partitions on another Linux machine.</p>



<h3 class="wp-block-heading">How to check partition PARTUUID and UUID</h3>



<p>The <code class="EnlighterJSRAW" data-enlighter-language="generic">PARTUUID</code> and <code class="EnlighterJSRAW" data-enlighter-language="generic">UUID</code> of a partition can be checked by the blow command:</p>



<p><code class="EnlighterJSRAW" data-enlighter-language="generic">sudo blkid /dev/partition_to_check</code></p>



<h3 class="wp-block-heading">cmdline.txt in bootfs partition</h3>



<p>Change <code class="EnlighterJSRAW" data-enlighter-language="generic">xxxxxxxx</code> below to the <code>PARTUUID</code> of <code>rootfs</code> partition on the SSD.</p>



<pre class="EnlighterJSRAW" data-enlighter-language="generic" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">root=PARTUUID=xxxxxxxx</pre>



<h3 class="wp-block-heading"><span style="font-family: monospace; color: #000000;"><span style="caret-color: #222222; background-color: #f2f4f5;">/etc/fstab</span> </span>in rootfs partition</h3>



<p>Change <code class="EnlighterJSRAW" data-enlighter-language="generic">yyyyyyyy</code> below to the <code>UUID</code> of <code>bootfs</code> partition on the SSD.</p>



<p>Change <code class="EnlighterJSRAW" data-enlighter-language="generic">zzzzzzzz</code> below to the <code>UUID</code> of <code>rootfs</code> partition on the SSD.</p>



<pre class="EnlighterJSRAW" data-enlighter-language="generic" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">proc            /proc           proc    defaults          0       0
UUID=yyyyyyyy /boot/firmware  vfat    defaults          0       2
UUID=zzzzzzzz /               ext4    defaults,noatime  0       1</pre>
<hr />
<p><em>Now, plug your SSD to the Raspberry Pi without your micro SD card plugged. Start the RPi and enjoy!</em></p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.znjoa.com/2023/12/16/migrating-raspberry-pi-os-from-micro-sd-card-to-ssd-with-existing-partitions/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">240</post-id>	</item>
		<item>
		<title>DDNS setup using name servers</title>
		<link>https://blog.znjoa.com/2022/11/24/ddns-setup/</link>
					<comments>https://blog.znjoa.com/2022/11/24/ddns-setup/#respond</comments>
		
		<dc:creator><![CDATA[Zz]]></dc:creator>
		<pubDate>Wed, 23 Nov 2022 23:06:05 +0000</pubDate>
				<category><![CDATA[RPi]]></category>
		<category><![CDATA[DDNS]]></category>
		<category><![CDATA[Dynu]]></category>
		<category><![CDATA[Godaddy]]></category>
		<category><![CDATA[nameserver]]></category>
		<guid isPermaLink="false">http://192.168.0.186/?p=134</guid>

					<description><![CDATA[This is about my DDNS setup for znjoa.com which is managed by Godaddy. On the GoDaddy&#46;&#46;&#46;]]></description>
										<content:encoded><![CDATA[<p>This is about my DDNS setup for znjoa.com which is managed by Godaddy.</p>
<ol>
<li>On the GoDaddy settings page, go to the DNS management page
<ol>
<li>Remove GoDaddy default name servers</li>
<li>Add the following name servers from Dynu
<ol>
<li>
<pre class="EnlighterJSRAW" data-enlighter-language="generic">NS1.DYNU.COM
NS2.DYNU.COM
NS3.DYNU.COM
NS4.DYNU.COM
NS5.DYNU.COM
NS6.DYNU.COM
NS10.DYNU.COM
NS11.DYNU.COM</pre>
</li>
<li>Here, NS10 and NS11 are from Europe. If not added the DNS propagation takes very long for myself to see the change. So just remember to add the NS from your region</li>
</ol>
</li>
<li>Other than this, nothing needs to be done (no c name no a record no site redirection)</li>
</ol>
</li>
<li>On Dynu website:
<ol>
<li>register your domain</li>
<li>Follow <a href="https://www.dynu.com/DynamicDNS/IPUpdateClient/RaspberryPi-Dynamic-DNS">this tutorial</a> to enable the local service of Dynu on rpi4 (which I&#8217;m using to host this site)
<ol>
<li>Use md5 of password for safety</li>
<li><code class="EnlighterJSRAW" data-enlighter-language="bash">echo "password"| md5</code>  is wrong, should be <code class="EnlighterJSRAW" data-enlighter-language="bash">echo -n "password" | md5</code> which does not keep the trailing new line character</li>
</ol>
</li>
<li>Back to Dynu website, go to DDNS services:
<ol>
<li>check your domain is there and the ip address was just updated</li>
<li>this can also be done by checking the log file on the script folder on rpi4</li>
<li>or you can directly enter the url in the script file in a browser and see if there&#8217;s any error</li>
</ol>
</li>
</ol>
</li>
</ol>
<p>Now you are good to go! To me, using name servers from a DDNS provider seems to be faster than redirecting the whole site to a DDNS url (which points to my real public IP) on the GoDaddy website.</p>
<p>&nbsp;</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.znjoa.com/2022/11/24/ddns-setup/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">134</post-id>	</item>
		<item>
		<title>Backing up and restoring Raspberry Pi SD card</title>
		<link>https://blog.znjoa.com/2021/05/17/backing-up-and-restoring-raspberry-pi-sd-card/</link>
					<comments>https://blog.znjoa.com/2021/05/17/backing-up-and-restoring-raspberry-pi-sd-card/#respond</comments>
		
		<dc:creator><![CDATA[Zz]]></dc:creator>
		<pubDate>Mon, 17 May 2021 00:06:36 +0000</pubDate>
				<category><![CDATA[RPi]]></category>
		<category><![CDATA[backup]]></category>
		<category><![CDATA[dd]]></category>
		<category><![CDATA[pv]]></category>
		<category><![CDATA[restore]]></category>
		<category><![CDATA[rpi]]></category>
		<category><![CDATA[watch_progress]]></category>
		<guid isPermaLink="false">http://192.168.0.186/?p=67</guid>

					<description><![CDATA[This shows how to do it on MacOS. It&#8217;s quite straightforward using dd. Backup Remote way&#46;&#46;&#46;]]></description>
										<content:encoded><![CDATA[
<p><em>This shows how to do it on MacOS. It&#8217;s quite straightforward using <code class="EnlighterJSRAW" data-enlighter-language="generic">dd</code>.</em></p>



<h5 class="wp-block-heading">Backup</h5>



<h6 class="wp-block-heading">Remote way</h6>



<p>If you prefer to do it remotely via SSH, use this command:</p>



<pre class="EnlighterJSRAW" data-enlighter-language="generic" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">ssh root@your_rpi_ip "dd if=/dev/your_rpi_sd_card bs=1m | gzip -1 -" | pv | dd of=rpi.gz</pre>



<p><code data-enlighter-language="generic" class="EnlighterJSRAW">your_rpi_ip</code>&nbsp;can be obtained by <code data-enlighter-language="generic" class="EnlighterJSRAW">hostname -I</code>&nbsp;. <code data-enlighter-language="generic" class="EnlighterJSRAW">if</code>&nbsp;is followed by the your sd card path when mounted on RPi, which can be obtained by <code data-enlighter-language="generic" class="EnlighterJSRAW">lsblk -p</code>&nbsp;(make sure the disk you believe to be the SD card matches the size of your SD card!). <code data-enlighter-language="generic" class="EnlighterJSRAW">pv</code>&nbsp;is used here so that the progress of <code data-enlighter-language="generic" class="EnlighterJSRAW">dd</code> can be constantly checked. If you don&#8217;t have it, install it using <code data-enlighter-language="generic" class="EnlighterJSRAW">brew install pv</code> if you have homebrew installed.&nbsp;</p>



<p>Depending on the size of your SD card and your connection speed, it could take some time. So go and get a coffee!</p>



<h6 class="wp-block-heading">Local way (RPi end)</h6>



<p>Similarly, you should be able to dd locally on <code data-enlighter-language="generic" class="EnlighterJSRAW">RPi</code> then scp the image to your PC/Mac. As a result, the <code data-enlighter-language="generic" class="EnlighterJSRAW">SSH</code> part will be stripped away:</p>



<pre class="EnlighterJSRAW" data-enlighter-language="generic" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">dd if=/dev/your_rpi_sd_card bs=1m | gzip -1 - | pv | dd of=rpi.gz</pre>



<p>After it&#8217;s done, you can use <code data-enlighter-language="generic" class="EnlighterJSRAW">scp</code> to transfer the image file to your PC/Mac.</p>



<h6 class="wp-block-heading">Local way (PC/Mac end)</h6>



<p>This is recommended since it&#8217;s faster due to the fact that the SD card is physically connected to your PC/Mac.</p>



<ol class="wp-block-list"><li>Remove the SD card from your RPi and connect it to your computer.</li><li>Check the disk name on your Mac using: <code data-enlighter-language="generic" class="EnlighterJSRAW">diskutil list</code>. Similarly, double check the disk size so that you don&#8217;t make a mistake.</li><li>Same as the local way on RPi end: <code data-enlighter-language="generic" class="EnlighterJSRAW">dd if=/dev/your_rpi_sd_card bs=1m | gzip -1 - | pv | dd of=rpi.gz</code>.</li></ol>



<hr class="wp-block-separator is-style-wide"/>



<h5 class="wp-block-heading">Restoring</h5>



<p>It&#8217;s also pretty straight-forward for the restoring. The steps are:</p>



<ol class="wp-block-list"><li>Connect the SD card to your computer.</li><li>Check the name of the disk using the method mentioned above</li><li>Unmount (not eject) the SD card by <code data-enlighter-language="generic" class="EnlighterJSRAW">diskutil unmountDisk /dev/disk_nr</code></li><li>Burn the image file into your SD card using: <code data-enlighter-language="generic" class="EnlighterJSRAW">gzip -dc yourRPiImage | pv | sudo dd of=/dev/disk_nr bs=1m</code></li></ol>



<p>After another coffee, you can plug your SD card back into your RPi. Enjoy your back-to-life RPi.</p>



<h5 class="wp-block-heading">P.S.</h5>



<p>Instead of using <code data-enlighter-language="generic" class="EnlighterJSRAW">pv</code>, <code data-enlighter-language="generic" class="EnlighterJSRAW">progress</code> and <code data-enlighter-language="generic" class="EnlighterJSRAW">watch</code> can be used together to check the status. So run the above commands without <code data-enlighter-language="generic" class="EnlighterJSRAW">pv</code>, and open another terminal and run <code data-enlighter-language="generic" class="EnlighterJSRAW">watch progress</code>, you now even have a progress bar!</p>



<p></p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.znjoa.com/2021/05/17/backing-up-and-restoring-raspberry-pi-sd-card/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">67</post-id>	</item>
		<item>
		<title>Install Pi-hole with existing Apache2 on Raspberry Pi 4</title>
		<link>https://blog.znjoa.com/2021/05/16/install-pi-hole-with-existing-apache2-on-raspberry-pi/</link>
					<comments>https://blog.znjoa.com/2021/05/16/install-pi-hole-with-existing-apache2-on-raspberry-pi/#respond</comments>
		
		<dc:creator><![CDATA[Zz]]></dc:creator>
		<pubDate>Sun, 16 May 2021 22:25:23 +0000</pubDate>
				<category><![CDATA[RPi]]></category>
		<category><![CDATA[dns-sink]]></category>
		<category><![CDATA[pi-hole]]></category>
		<category><![CDATA[rpi]]></category>
		<guid isPermaLink="false">http://192.168.0.186/?p=36</guid>

					<description><![CDATA[This is a record of the steps that I took to install pi-hole on my raspberry&#46;&#46;&#46;]]></description>
										<content:encoded><![CDATA[<p><em>This is a record of the steps that I took to install pi-hole on my raspberry pi (RPi). It might not be universally applicable. Still hopefully it can help some out there.</em></p>
<h5><strong>Precondition</strong></h5>
<ul>
<li>apache2 and php already installed and set up on your raspberry pi (raspbian)</li>
</ul>
<hr />
<h5 class="wp-block-heading"> <strong>Download and run the automated install</strong> (<a href="https://github.com/pi-hole/pi-hole">Reference</a>)</h5>



<p>Run this command in the terminal:</p>



<pre class="EnlighterJSRAW" data-enlighter-language="shell" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">curl -sSL https://install.pi-hole.net | bash</pre>



<ol class="wp-block-list">
<li><em>Select interface:</em> wlan0 (depending on your need, wlan0 is for wifi and eth0 is for the wired connection)</li>
<li><em>Select DNS provider</em>: OpenDNS</li>
<li><em>IPv4&amp;v6:</em> both</li>
<li><em>Use static IP?:</em> Yes</li>
<li><em>Web admin interface</em>: yes</li>
<li><em>Install web server?</em>: <strong>No</strong></li>
<li><em>Log query</em>: On</li>
<li><em>Privacy</em>: full</li>
</ol>



<p>After these steps, a message will appear in the terminal telling you the IP and the password of the admin page (something like <code class="EnlighterJSRAW" data-enlighter-language="shell">http://192.168.x.xxx</code>). Note this down as you will need it later.</p>



<h5 class="wp-block-heading">Two warnings</h5>



<p>The installation finished with two warnings:</p>



<ol class="wp-block-list">
<li><em>xxx modules are missing for php</em></li>
<li><em>the web server user needs to be member of the &#8220;pihole&#8221; group for full functionality</em></li>
</ol>



<p>The first can be solved using <code><code class="EnlighterJSRAW" data-enlighter-language="shell">sudo apt install php-xxx</code></code> to install these packages.</p>



<p>The second can be solved by <code class="EnlighterJSRAW" data-enlighter-language="shell">sudo usermod -a -G pihole your_apache2_user</code>.</p>



<h5 class="wp-block-heading"><strong>Some setup on the admin page</strong></h5>



<p>On the left, go to <code>group management -&gt; Adlists</code> to add custom list. Below are some that I use:</p>



<ul class="wp-block-list">
<li><a href="https://raw.githubusercontent.com/0Zinc/easylists-for-pihole/master/easylist.txt">Easy list</a></li>
<li><a href="https://raw.githubusercontent.com/0Zinc/easylists-for-pihole/master/easyprivacy.txt">Easy privacy</a></li>
<li><a href="https://www.github.developerdan.com/hosts/lists/ads-and-tracking-extended.txt">Developer Dan&#8217;s ads&amp;tracking list</a></li>
<li><a href="https://cdn.jsdelivr.net/gh/neoFelhz/neohosts@gh-pages/basic/hosts">Neohosts basic</a></li>
<li><a href="https://github.com/easylist/easylistchina/blob/master/easylistchina.txt">Easylist China</a></li>
</ul>



<p>After adding your lists, go to tools -&gt; update gravity -&gt; update.</p>



<h5 class="wp-block-heading"><strong>Check it’s working</strong></h5>



<p>Go to a site that you are certain that is riddled with ads or a ab backer checker site (such as<a href="https://d3ward.github.io/toolz/src/adblock.html" target="_blank" rel="noreferrer noopener"> this one</a>), and you show see that most of the ads are gone!</p>



<p>Now, enjoy a more pleasant online experience!</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.znjoa.com/2021/05/16/install-pi-hole-with-existing-apache2-on-raspberry-pi/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">36</post-id>	</item>
	</channel>
</rss>
