Browse Source

Run hooks.

master
Franco Masotti 5 months ago
parent
commit
7b18a644ad
Signed by: frnmst GPG Key ID: 24116ED85666780A
  1. 2
      _assets/badge-no_javascript.svg
  2. 2
      _assets/badge-powered_by_jekyll.svg
  3. 2
      _assets/badge-uses_html5.svg
  4. 2
      _assets/badge-uses_minimal_css.svg
  5. 2
      _includes/anchor_headings.html
  6. 2
      _includes/post_navigation.html
  7. 2
      _includes/tag_list.html
  8. 2
      _layouts/default.html
  9. 1
      _pages/tags.md
  10. 60
      _posts/2017-04-24-qemu-ssh-tunnel.md
  11. 86
      _posts/2017-04-25-a-new-fan-for-the-processor.md
  12. 89
      _posts/2017-09-03-kalliope-assistant-on-qemu.md
  13. 26
      _posts/2017-10-22-hibernation-in-three-simple-steps.md
  14. 12
      _posts/2018-03-02-algorithm.md
  15. 3
      _posts/2018-03-05-cups-simple-shared-printer.md
  16. 68
      _posts/2018-04-03-repairing-my-first-pc.md
  17. 2
      _posts/2018-04-16-my-python-release-workflow.md
  18. 42
      _posts/2018-04-19-openwrt-on-the-dg834gv4-modem-router.md
  19. 50
      _posts/2018-08-04-android-backup-with-rsync.md
  20. 56
      _posts/2018-10-02-automatic-removable-media-synchronization.md
  21. 14
      _posts/2018-10-18-change-raid-device-name.md
  22. 76
      _posts/2018-11-06-the-stupid-smart-doorbell.md
  23. 24
      _posts/2018-11-18-my-bash-option-parsing-template.md
  24. 46
      _posts/2019-02-23-my-backup-system.md
  25. 6
      _posts/2019-07-08-raid-data-scrubbing.md
  26. 4
      _posts/2019-11-10-running-python-scripts-with-different-package-versions.md
  27. 10
      _posts/2020-02-08-my-new-backup-system.md
  28. 5
      _posts/2020-06-16-a-solution-to-io-errors-on-usb3-external-hdd-enclosures.md
  29. 2
      _posts/2020-10-07-fail2ban.md

2
_assets/badge-no_javascript.svg

@ -1 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="90" height="20"><linearGradient id="b" x2="0" y2="100%"><stop offset="0" stop-color="#bbb" stop-opacity=".1"/><stop offset="1" stop-opacity=".1"/></linearGradient><clipPath id="a"><rect width="90" height="20" rx="3" fill="#fff"/></clipPath><g clip-path="url(#a)"><path fill="#555" d="M0 0h23v20H0z"/><path fill="black" d="M23 0h67v20H23z"/><path fill="url(#b)" d="M0 0h90v20H0z"/></g><g fill="#fff" text-anchor="middle" font-family="DejaVu Sans,Verdana,Geneva,sans-serif" font-size="110"> <text x="125" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="130">no</text><text x="125" y="140" transform="scale(.1)" textLength="130">no</text><text x="555" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="570">JavaScript</text><text x="555" y="140" transform="scale(.1)" textLength="570">JavaScript</text></g> </svg>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="90" height="20"><linearGradient id="b" x2="0" y2="100%"><stop offset="0" stop-color="#bbb" stop-opacity=".1"/><stop offset="1" stop-opacity=".1"/></linearGradient><clipPath id="a"><rect width="90" height="20" rx="3" fill="#fff"/></clipPath><g clip-path="url(#a)"><path fill="#555" d="M0 0h23v20H0z"/><path fill="black" d="M23 0h67v20H23z"/><path fill="url(#b)" d="M0 0h90v20H0z"/></g><g fill="#fff" text-anchor="middle" font-family="DejaVu Sans,Verdana,Geneva,sans-serif" font-size="110"> <text x="125" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="130">no</text><text x="125" y="140" transform="scale(.1)" textLength="130">no</text><text x="555" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="570">JavaScript</text><text x="555" y="140" transform="scale(.1)" textLength="570">JavaScript</text></g> </svg>

Before

Width:  |  Height:  |  Size: 952 B

After

Width:  |  Height:  |  Size: 953 B

2
_assets/badge-powered_by_jekyll.svg

@ -1 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="116" height="20"><linearGradient id="b" x2="0" y2="100%"><stop offset="0" stop-color="#bbb" stop-opacity=".1"/><stop offset="1" stop-opacity=".1"/></linearGradient><clipPath id="a"><rect width="116" height="20" rx="3" fill="#fff"/></clipPath><g clip-path="url(#a)"><path fill="#555" d="M0 0h75v20H0z"/><path fill="black" d="M75 0h41v20H75z"/><path fill="url(#b)" d="M0 0h116v20H0z"/></g><g fill="#fff" text-anchor="middle" font-family="DejaVu Sans,Verdana,Geneva,sans-serif" font-size="110"> <text x="385" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="650">powered by</text><text x="385" y="140" transform="scale(.1)" textLength="650">powered by</text><text x="945" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="310">Jekyll</text><text x="945" y="140" transform="scale(.1)" textLength="310">Jekyll</text></g> </svg>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="116" height="20"><linearGradient id="b" x2="0" y2="100%"><stop offset="0" stop-color="#bbb" stop-opacity=".1"/><stop offset="1" stop-opacity=".1"/></linearGradient><clipPath id="a"><rect width="116" height="20" rx="3" fill="#fff"/></clipPath><g clip-path="url(#a)"><path fill="#555" d="M0 0h75v20H0z"/><path fill="black" d="M75 0h41v20H75z"/><path fill="url(#b)" d="M0 0h116v20H0z"/></g><g fill="#fff" text-anchor="middle" font-family="DejaVu Sans,Verdana,Geneva,sans-serif" font-size="110"> <text x="385" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="650">powered by</text><text x="385" y="140" transform="scale(.1)" textLength="650">powered by</text><text x="945" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="310">Jekyll</text><text x="945" y="140" transform="scale(.1)" textLength="310">Jekyll</text></g> </svg>

Before

Width:  |  Height:  |  Size: 963 B

After

Width:  |  Height:  |  Size: 964 B

2
_assets/badge-uses_html5.svg

@ -1 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="82" height="20"><linearGradient id="b" x2="0" y2="100%"><stop offset="0" stop-color="#bbb" stop-opacity=".1"/><stop offset="1" stop-opacity=".1"/></linearGradient><clipPath id="a"><rect width="82" height="20" rx="3" fill="#fff"/></clipPath><g clip-path="url(#a)"><path fill="#555" d="M0 0h35v20H0z"/><path fill="black" d="M35 0h47v20H35z"/><path fill="url(#b)" d="M0 0h82v20H0z"/></g><g fill="#fff" text-anchor="middle" font-family="DejaVu Sans,Verdana,Geneva,sans-serif" font-size="110"> <text x="185" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="250">uses</text><text x="185" y="140" transform="scale(.1)" textLength="250">uses</text><text x="575" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="370">HTML5</text><text x="575" y="140" transform="scale(.1)" textLength="370">HTML5</text></g> </svg>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="82" height="20"><linearGradient id="b" x2="0" y2="100%"><stop offset="0" stop-color="#bbb" stop-opacity=".1"/><stop offset="1" stop-opacity=".1"/></linearGradient><clipPath id="a"><rect width="82" height="20" rx="3" fill="#fff"/></clipPath><g clip-path="url(#a)"><path fill="#555" d="M0 0h35v20H0z"/><path fill="black" d="M35 0h47v20H35z"/><path fill="url(#b)" d="M0 0h82v20H0z"/></g><g fill="#fff" text-anchor="middle" font-family="DejaVu Sans,Verdana,Geneva,sans-serif" font-size="110"> <text x="185" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="250">uses</text><text x="185" y="140" transform="scale(.1)" textLength="250">uses</text><text x="575" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="370">HTML5</text><text x="575" y="140" transform="scale(.1)" textLength="370">HTML5</text></g> </svg>

Before

Width:  |  Height:  |  Size: 946 B

After

Width:  |  Height:  |  Size: 947 B

2
_assets/badge-uses_minimal_css.svg

@ -1 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="116" height="20"><linearGradient id="b" x2="0" y2="100%"><stop offset="0" stop-color="#bbb" stop-opacity=".1"/><stop offset="1" stop-opacity=".1"/></linearGradient><clipPath id="a"><rect width="116" height="20" rx="3" fill="#fff"/></clipPath><g clip-path="url(#a)"><path fill="#555" d="M0 0h35v20H0z"/><path fill="black" d="M35 0h81v20H35z"/><path fill="url(#b)" d="M0 0h116v20H0z"/></g><g fill="#fff" text-anchor="middle" font-family="DejaVu Sans,Verdana,Geneva,sans-serif" font-size="110"> <text x="185" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="250">uses</text><text x="185" y="140" transform="scale(.1)" textLength="250">uses</text><text x="745" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="710">minimal CSS</text><text x="745" y="140" transform="scale(.1)" textLength="710">minimal CSS</text></g> </svg>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="116" height="20"><linearGradient id="b" x2="0" y2="100%"><stop offset="0" stop-color="#bbb" stop-opacity=".1"/><stop offset="1" stop-opacity=".1"/></linearGradient><clipPath id="a"><rect width="116" height="20" rx="3" fill="#fff"/></clipPath><g clip-path="url(#a)"><path fill="#555" d="M0 0h35v20H0z"/><path fill="black" d="M35 0h81v20H35z"/><path fill="url(#b)" d="M0 0h116v20H0z"/></g><g fill="#fff" text-anchor="middle" font-family="DejaVu Sans,Verdana,Geneva,sans-serif" font-size="110"> <text x="185" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="250">uses</text><text x="185" y="140" transform="scale(.1)" textLength="250">uses</text><text x="745" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="710">minimal CSS</text><text x="745" y="140" transform="scale(.1)" textLength="710">minimal CSS</text></g> </svg>

Before

Width:  |  Height:  |  Size: 961 B

After

Width:  |  Height:  |  Size: 962 B

2
_includes/anchor_headings.html

@ -102,4 +102,4 @@
{% endcapture %}
{% capture edited_headings %}{{ edited_headings }}{{ new_heading }}{% endcapture %}
{% endfor %}
{% endcapture %}{% assign headingsWorkspace = '' %}{{ edited_headings | strip }}
{% endcapture %}{% assign headingsWorkspace = '' %}{{ edited_headings | strip }}

2
_includes/post_navigation.html

@ -23,5 +23,3 @@
</ul>
</div>

2
_includes/tag_list.html

@ -72,7 +72,7 @@
{% assign freq = tag[0] | plus: 0 %}
{% if page.is_home %}
{% if freq >= site.tag_list.score.min %}
{% capture link %}{{ site.baseurl }}/tags/#{{ tagg }}{% endcapture %}
{% capture link %}{{ site.baseurl }}/tags/#{{ tagg }}{% endcapture %}
<li>
<a href="{{ link }}">{{ tag_name }} [{{ freq }}]</a>
</li>

2
_layouts/default.html

@ -27,7 +27,7 @@ layout: compress
{% if page.is_home != true and page.is_404 != true and page.is_tags != true and page.is_sitemap != true %}
<hr>
{% include comments.html %}
{% endif %}
{% endif %}
<hr>

1
_pages/tags.md

@ -25,4 +25,3 @@ permalink: /tags/
{% endfor %}
</div>

60
_posts/2017-04-24-qemu-ssh-tunnel.md

@ -7,15 +7,15 @@ description: How to use qemu via VNC and SSH
Hello readers,
I was in need to run a virtual machine to do some experiments on `archiso`
I was in need to run a virtual machine to do some experiments on `archiso`
(sic) and `parabolaiso`.
<!--more-->
My `Intel(R) Core(TM)2 Quad CPU Q8200 @
2.33GHz` PC desktop processor does not support virtualization technology which
means that when I run a virtual machine it's very, very slow (barely usable).
So I thought: why not use the home server which has newer hardware and
My `Intel(R) Core(TM)2 Quad CPU Q8200 @
2.33GHz` PC desktop processor does not support virtualization technology which
means that when I run a virtual machine it's very, very slow (barely usable).
So I thought: why not use the home server which has newer hardware and
supports virtualization:
```shell
@ -23,18 +23,18 @@ $ lscpu | grep Virtualization
Virtualization: VT-x
```
*Please note that every step described here, except installations and file
configurations have now been integrated directly in the QVM script. For this
reason you should follow the instructions reported on the
*Please note that every step described here, except installations and file
configurations have now been integrated directly in the QVM script. For this
reason you should follow the instructions reported on the
[readme file](https://github.com/frnmst/qvm/blob/master/README.md)*
Now, some time ago I've written a
[simple script](https://github.com/frnmst/qvm) to handle my "QEMU needs",
VirtualBox is not available on Parabola and I don't like the available QEMU
[simple script](https://github.com/frnmst/qvm) to handle my "QEMU needs",
VirtualBox is not available on Parabola and I don't like the available QEMU
frontends.
So, after about 1 hour of information
[retrieval](http://blog.scottlowe.org/2013/08/21/accessing-vnc-consoles-of-kvm-guests-via-ssh/)
So, after about 1 hour of information
[retrieval](http://blog.scottlowe.org/2013/08/21/accessing-vnc-consoles-of-kvm-guests-via-ssh/)
[throughout](https://www.dragonsreach.it/2012/10/06/ssh-tunneling-for-vnc/)
[Internet](https://www.cyberciti.biz/faq/linux-kvm-vnc-for-guest-machine/)
[articles](https://www.cyberciti.biz/faq/howto-setup-vnc-server-ssh-client-tunnel-via-internet/)
@ -42,9 +42,9 @@ I was able to connect all the dots... Here it is.
## Premise
The technique used here is called ["SSH
tunneling"](https://en.wikipedia.org/wiki/Tunneling_protocol#Secure_Shell_tunneling)
and enables you to use an SSH server as an intermediary between the client and
The technique used here is called ["SSH
tunneling"](https://en.wikipedia.org/wiki/Tunneling_protocol#Secure_Shell_tunneling)
and enables you to use an SSH server as an intermediary between the client and
a remote server. Let's see a trivial scheme of the VNC setup
```
@ -66,13 +66,13 @@ a remote server. Let's see a trivial scheme of the VNC setup
- `server-user`: login name of the server
- `vm-user`: login name of the virual machine
Note: `server.vnc_interface` is in a localhost location in respect to the
`server.ssh_interface`, so we will not use the term *intermediary server*
Note: `server.vnc_interface` is in a localhost location in respect to the
`server.ssh_interface`, so we will not use the term *intermediary server*
anymore.
## Server
First thing: since my server does not have a GUI I installed the
First thing: since my server does not have a GUI I installed the
`qemu-headless` package.
This line does the magic:
@ -80,7 +80,7 @@ This line does the magic:
-monitor pty -vnc 127.0.0.1:0
```
Make sure to have the following configurations in the OpenSSH configuration
Make sure to have the following configurations in the OpenSSH configuration
(`/etc/ssh/sshd_config`) otherwise the next steps won't work
AllowTcpForwarding yes
@ -93,10 +93,10 @@ You can now use the appropriate QVM vnc command.
Download the QVM script on the client also.
You must now install one of the vnc clients like
You must now install one of the vnc clients like
[gtk-vnc](https://wiki.gnome.org/Projects/gtk-vnc) or
[TigerVNC](http://www.tigervnc.org).
I've noticed that TigerVNC seems to handle window resizes better, so I decided
I've noticed that TigerVNC seems to handle window resizes better, so I decided
to go for that one.
Before starting the VNC client, an SSH socket (tunnel) is created.
@ -114,20 +114,20 @@ You should now see the virtual machine.
## SSH
The next thing was to connect to the SSH daemon on the virtual machine just
The next thing was to connect to the SSH daemon on the virtual machine just
like what qvm enables you to do. I thought I could use the same method of VNC.
Once the SSH daemon is up and running you can connect to it with the following
Once the SSH daemon is up and running you can connect to it with the following
command from the server:
```shell
$ ssh -p 2222 vm-user@127.0.0.1
```
The SSH port of the virual machine is the default one (22). qvm exposes the
The SSH port of the virual machine is the default one (22). qvm exposes the
port 2222 by default so you can connect from `localhost` with it.
We need another step to be able to connect remotely and directly to the virtual
We need another step to be able to connect remotely and directly to the virtual
machine from our client:
```shell
@ -144,21 +144,21 @@ You should now see the login.
### A simpler way to connect through SSH
As I later found out, it is possible to connect to SSH, as well as any ohter
As I later found out, it is possible to connect to SSH, as well as any ohter
service, by simply using the host address and the forwarded port, for example:
```shell
$ ssh -p 2222 vm-user@server.address
```
This happens because with this configuration the guest network is bridged with
This happens because with this configuration the guest network is bridged with
the host network.
## Final considerations
You can use this method also for internet browsing and lots of other stuff.
Infact, using SSH implies that the traffic between the client and remote server
is encrypted, but using VNC directly by default is NOT so pay
You can use this method also for internet browsing and lots of other stuff.
Infact, using SSH implies that the traffic between the client and remote server
is encrypted, but using VNC directly by default is NOT so pay
attention.
Cheers!

86
_posts/2017-04-25-a-new-fan-for-the-processor.md

@ -2,32 +2,32 @@
title: A new fan for the processor
updated: 2017-05-26 12:00
tags: [fan, cpu]
description:
description:
---
Hello again,
Some time ago I upgraded the CPU fan because I noticed that the stock one
was broken.
Some time ago I upgraded the CPU fan because I noticed that the stock one
was broken.
Here's the whole story.
<!--more-->
A couple of years ago I put in a cheap case fan retrieved from a 2003
A couple of years ago I put in a cheap case fan retrieved from a 2003
computer just to keep things cooler. The problem of this
[small fan](https://encrypted.google.com/search?hl=en&q=smaller%20fan%20more%20noise)
[small fan](https://encrypted.google.com/search?hl=en&q=smaller%20fan%20more%20noise)
was the tremendous noise which I couldn't bare anymore.
So, some months ago I decided to open the computer and I was
surprised in discovering that the CPU fan wasn't working. Now I had two
problems: the noise and one broken fan. I took drastic measures: I pulled out
the noisy fan and the broken fan. Then I tested the CPU temperatures using `$
sensors` from the `lm_sensors` package. I found out that the temperatures got
up to about 80 °C which is unacceptable for a CPU. I needed to try something
So, some months ago I decided to open the computer and I was
surprised in discovering that the CPU fan wasn't working. Now I had two
problems: the noise and one broken fan. I took drastic measures: I pulled out
the noisy fan and the broken fan. Then I tested the CPU temperatures using `$
sensors` from the `lm_sensors` package. I found out that the temperatures got
up to about 80 °C which is unacceptable for a CPU. I needed to try something
else.
I then went into the BIOS options and I heavily undercloked the CPU to obtain
I then went into the BIOS options and I heavily undercloked the CPU to obtain
temperatures like these (however I don't remember the exact clock values):
```shell
@ -40,12 +40,12 @@ Core 2: +66.0°C (high = +80.0°C, crit = +100.0°C)
Core 3: +66.0°C (high = +80.0°C, crit = +100.0°C)
```
I went on like this for months but, as you can imagine, the computer was a bit
I went on like this for months but, as you can imagine, the computer was a bit
slow and laggy especially using Iceweasel.
It was time to buy a new fan and heat sink. So I bought a [Cooler Master Hyper
212X](https://www.amazon.it/Cooler-Master-Hyper-212X-Ventola/dp/B01ARGVNV6)
for about 30 euros (which seems to be a very reasonable price). This
for about 30 euros (which seems to be a very reasonable price). This
choice was made because of various factors (in decreasing order of importance):
- The compatibility with my [`LGA 775`](https://en.wikipedia.org/wiki/LGA_775)
@ -55,19 +55,19 @@ choice was made because of various factors (in decreasing order of importance):
- Noise information declared
- Thermal paste included (which saves some euros from shipping)
Once I got the fan the hard part arrived: I had to remove the motherboard from
the case to work comfy. This was the first time for me but it well better than
Once I got the fan the hard part arrived: I had to remove the motherboard from
the case to work comfy. This was the first time for me but it well better than
I expected, except for a minor irritation at the end.
{% include image.html file="0.jpg" alt="box 0" caption="The fan box" %}
{% include image.html file="1.jpg" alt="box 1" caption="Technical information
{% include image.html file="1.jpg" alt="box 1" caption="Technical information
reported on the box" %}
{% include image.html file="2.jpg" alt="box 2" caption="The back of the box" %}
{% include image.html file="3.jpg" alt="unboxing 0" caption="Unboxing" %}
{% include image.html file="4.jpg" alt="unboxing 1" %}
{% include image.html file="5.jpg" alt="unboxing 2" %}
{% include image.html file="6.jpg" alt="unboxing 3" %}
{% include image.html file="8.jpg" alt="test 0" caption="Test and comparison
{% include image.html file="8.jpg" alt="test 0" caption="Test and comparison
with old heatsink before assembly. You may already see a problem here :)" %}
{% include image.html file="10.jpg" alt="test 1" %}
{% include image.html file="11.jpg" alt="test 2" %}
@ -82,30 +82,30 @@ I took some pictures to rember how the cabling should be.
{% include image.html file="17.jpg" alt="cabling 4" %}
{% include image.html file="18.jpg" alt="cabling 5" %}
{% include image.html file="19.jpg" alt="cabling 6" %}
{% include image.html file="21.jpg" alt="motherboard 0" caption="Mother board
{% include image.html file="21.jpg" alt="motherboard 0" caption="Mother board
with the heatsink mounted" %}
{% include image.html file="22.jpg" alt="motherboard 1" caption="Everything
{% include image.html file="22.jpg" alt="motherboard 1" caption="Everything
back in place. Ready to test" %}
{% include image.html file="28.jpg" alt="case 0" caption="Case mods or it won't
{% include image.html file="28.jpg" alt="case 0" caption="Case mods or it won't
fit" %}
{% include image.html file="30.jpg" alt="case 1" %}
I didn't take exact measurements so I knew there was that risk. Since it's an
old PC I don't really care about the case. If you have a new PC i suggest you
take measurements to see if a potential new internal component fits before you
I didn't take exact measurements so I knew there was that risk. Since it's an
old PC I don't really care about the case. If you have a new PC i suggest you
take measurements to see if a potential new internal component fits before you
buy it.
At this stage I powered up the computer. The new fan seemed to work fine so I
At this stage I powered up the computer. The new fan seemed to work fine so I
removed the undercloking BIOS settings.
## Use of fancontrol
Finally I configured fancontrol to control automatic throttling of the fan
based on the CPU temperature. I used the CLI tool called `pwmconfig` in manual
Finally I configured fancontrol to control automatic throttling of the fan
based on the CPU temperature. I used the CLI tool called `pwmconfig` in manual
mode otherwise it wouldn't detect the fan. Once the tool finished it generated
a configuration file and the gnuplot chart below. This chart is not really
useful to us because it correlates RPMs with PWMs instead of RPMs and
temperature. It just shows how the computer will handle the fan to get it to a
a configuration file and the gnuplot chart below. This chart is not really
useful to us because it correlates RPMs with PWMs instead of RPMs and
temperature. It just shows how the computer will handle the fan to get it to a
certain speed.
{% include image.html file="fan_control_report.png" alt="Fan report" %}
@ -134,28 +134,28 @@ The final thing to do was to add `fancontrol` as a system service.
Is it a good idea to overclock now that temperature is not a problem anymore?
In my case the answer is no.
{% include image.html file="23.jpg" alt="bios setings 0" caption="((2650 / 2333
MHz) *
{% include image.html file="23.jpg" alt="bios setings 0" caption="((2650 / 2333
MHz) *
100) - 100 = + 13.59% clocking" %}
{% include image.html file="24.jpg" alt="bios settings 1" caption="380 * 7 MHz
{% include image.html file="24.jpg" alt="bios settings 1" caption="380 * 7 MHz
= 2660 MHz. Maybe too much?" %}
{% include image.html file="26.jpg" alt="bios settings 2" caption="If I don't
increase the
CPU voltage the BIOS screen won't even come up and the BIOS settings need to
{% include image.html file="26.jpg" alt="bios settings 2" caption="If I don't
increase the
CPU voltage the BIOS screen won't even come up and the BIOS settings need to
be cleared manually" %}
{% include image.html file="27.jpg" alt="kernel panic" caption="Here's what
{% include image.html file="27.jpg" alt="kernel panic" caption="Here's what
happens" %}
Even at 10% (+10% means 110% of overall clock)
I had kernel panics sooner or later, although I could see it was faster. This
is probably due to ~~the power supply which is not able to stand more electric
consumption~~ the comination of processor and motherboard. According to
[some](http://www.tomshardware.co.uk/forum/283888-29-overclock-q8200-778ghz)
[websites](http://www.hardwarecanucks.com/forum/overclocking-tweaking-benchmarking/60254-overclocking-q8200-asrock-motherboard.html)
neither the processor nor the motherboard were made for
I had kernel panics sooner or later, although I could see it was faster. This
is probably due to ~~the power supply which is not able to stand more electric
consumption~~ the comination of processor and motherboard. According to
[some](http://www.tomshardware.co.uk/forum/283888-29-overclock-q8200-778ghz)
[websites](http://www.hardwarecanucks.com/forum/overclocking-tweaking-benchmarking/60254-overclocking-q8200-asrock-motherboard.html)
neither the processor nor the motherboard were made for
this. So I gave up overclocking. Too bad...
Till next time.

89
_posts/2017-09-03-kalliope-assistant-on-qemu.md

@ -7,11 +7,11 @@ description: How to setup Kalliope, a voice-controlled personal assistant, if yo
Hello again,
It's been some time I wanted to try out a personal vocal assistant that is 100%
free software, in working condition and simple to customize. Unfortunately
It's been some time I wanted to try out a personal vocal assistant that is 100%
free software, in working condition and simple to customize. Unfortunately
there aren't that many that satisfy all the those conditions.
There is however an interesting project called
There is however an interesting project called
[Kalliope](https://github.com/kalliope-project/kalliope)
which apparently has all the requirements I was looking for
(we are very close anyway :) ) [Here's a video posted by one of the authors](https://youtu.be/PcLzo4H18S4)
@ -20,51 +20,51 @@ which apparently has all the requirements I was looking for
### Introduction
There are a few aspects of Kalliope that I've grasped in a few hours of
usage and that I would like to share. First of all basic configuration is done
through [YAML](https://en.wikipedia.org/wiki/YAML) files,
where you need to describe expected input and outputs for each case. Inputs are
vocal commands, while outputs can be a composition of voice, shell scripts or
ad-hoc python scripts. You will find examples once you install a specific
There are a few aspects of Kalliope that I've grasped in a few hours of
usage and that I would like to share. First of all basic configuration is done
through [YAML](https://en.wikipedia.org/wiki/YAML) files,
where you need to describe expected input and outputs for each case. Inputs are
vocal commands, while outputs can be a composition of voice, shell scripts or
ad-hoc python scripts. You will find examples once you install a specific
language "starter".
According to the [official
According to the [official
documentation](https://github.com/kalliope-project/kalliope/blob/master/Docs/installation.md#prerequisites)
there are just a handful of supported GNU/Linux distros.
Unfortunately no Arch Linux derivative (including Parabola) is among them.
Infact, after trying both the [manual
installation](https://github.com/kalliope-project/kalliope/blob/master/Docs/installation.md)
Unfortunately no Arch Linux derivative (including Parabola) is among them.
Infact, after trying both the [manual
installation](https://github.com/kalliope-project/kalliope/blob/master/Docs/installation.md)
and an [AUR](https://aur.archlinux.org/packages/kalliope) package
and given [the](https://github.com/kalliope-project/kalliope/issues/328)
[results](https://github.com/kalliope-project/kalliope/issues/331) I decided to
switch to one of the officially supported distros: Debian (at least for the
and given [the](https://github.com/kalliope-project/kalliope/issues/328)
[results](https://github.com/kalliope-project/kalliope/issues/331) I decided to
switch to one of the officially supported distros: Debian (at least for the
moment).
### Alternative installation
Now, since I don't have any working installation of Debian 8 (Jessie) I
attempted to run it inside QEMU. To do this I used my
Now, since I don't have any working installation of Debian 8 (Jessie) I
attempted to run it inside QEMU. To do this I used my
[qvm](https://github.com/frnmst/qvm) script I made some while ago.
Once I had Debian up and running I tried the
Once I had Debian up and running I tried the
[microphone](https://github.com/kalliope-project/kalliope/blob/master/Docs/installation.md#test-your-env)
[test](https://github.com/kalliope-project/kalliope/blob/master/Docs/installation/raspbian_jessie.md#raspberry-pi-configuration).
It turned out that I didn't have any soundcards available in the virtual
machine. A [couple of options](https://github.com/frnmst/qvm/commit/1a1ba5c55537735b890de48bf767663aa39074d3)
It turned out that I didn't have any soundcards available in the virtual
machine. A [couple of options](https://github.com/frnmst/qvm/commit/1a1ba5c55537735b890de48bf767663aa39074d3)
added in the qvm script did the trick. Now I could
record and listen to my voice through QEMU.
*If you are on Parabola or Arch Linux please make sure to install `qemu`
*If you are on Parabola or Arch Linux please make sure to install `qemu`
instead of `qemu-headless` otherwise the audio would be unusable. Apparently
the ALSA audio driver is not included in the `qemu-headless` package. See `$
the ALSA audio driver is not included in the `qemu-headless` package. See `$
qemu-system-x86_64 -audio-help` for more information.*
According to the
[official documentation](https://github.com/kalliope-project/kalliope/blob/master/Docs/installation/debian_jessie.md#debian-packages-requirements),
with Debian 8, the `contrib` and
`non-free` repositories should be enabled before installing all the
dependencies. Fortunately, only one of them is [non
free](http://metadata.ftp-master.debian.org/changelogs/non-free/s/svox/svox_1.0+git20130326-3_copyright):
`libttspico-utils`. I simply removed that from the installation command and
[official documentation](https://github.com/kalliope-project/kalliope/blob/master/Docs/installation/debian_jessie.md#debian-packages-requirements),
with Debian 8, the `contrib` and
`non-free` repositories should be enabled before installing all the
dependencies. Fortunately, only one of them is [non
free](http://metadata.ftp-master.debian.org/changelogs/non-free/s/svox/svox_1.0+git20130326-3_copyright):
`libttspico-utils`. I simply removed that from the installation command and
left the `sources.list` file as-is:
```
@ -73,22 +73,22 @@ left the `sources.list` file as-is:
# apt-get install git python-dev libsmpeg0 flac dialog libffi-dev libffi-dev libssl-dev portaudio19-dev build-essential libssl-dev libffi-dev sox libatlas3-base mplayer libav-tools
```
After that, I continued with the [official
After that, I continued with the [official
documentation](https://github.com/kalliope-project/kalliope/blob/master/Docs/installation.md#installation).
I followed *Method 1 - User install using the PIP package*. **Apparently
every other component is free software, but this still needs to be verified
thoroughly**. Because I removed `libttspico-utils`, which is an offline text to
speech engine, I had to use another one. All of them except `espeak` are
online TTS. [Here](https://github.com/Ultchad/kalliope-espeak)
you will find the installation instructions for espeak. The speech to text
system used is Google's one because, although cloud-based, it's much more
I followed *Method 1 - User install using the PIP package*. **Apparently
every other component is free software, but this still needs to be verified
thoroughly**. Because I removed `libttspico-utils`, which is an offline text to
speech engine, I had to use another one. All of them except `espeak` are
online TTS. [Here](https://github.com/Ultchad/kalliope-espeak)
you will find the installation instructions for espeak. The speech to text
system used is Google's one because, although cloud-based, it's much more
precise than the offline STT at the moment.
Finally I downloaded the [english
Finally I downloaded the [english
starter](https://github.com/kalliope-project/kalliope_starter_en)
version and tested it out. Everything worked.
{% include image.html file="0.png" alt="kalliope 0" caption="Kalliope is
{% include image.html file="0.png" alt="kalliope 0" caption="Kalliope is
waiting for the trigger word" %}
{% include image.html file="1.png" alt="kalliope 0" caption="Kalliope has
@ -96,17 +96,16 @@ listened and executes a command" %}
### SSH
After testing all of this stuff, using the `-x` option for qvm, I made
After testing all of this stuff, using the `-x` option for qvm, I made
another "discovery", by running qvm with:
$ ./qvm -n
$ ./qvm -a
i.e: connecting via SSH only. Apparently this also has the ability to route the
audio. If you put this into the account, including one of the [previous
posts]({{ site.baseurl }}/notes/qemu-ssh-tunnel.html), maybe in some way
you could have one instance of Kalliope running in QEMU with an unlimited (!?)
i.e: connecting via SSH only. Apparently this also has the ability to route the
audio. If you put this into the account, including one of the [previous
posts]({{ site.baseurl }}/notes/qemu-ssh-tunnel.html), maybe in some way
you could have one instance of Kalliope running in QEMU with an unlimited (!?)
number of remote IO audio devices...
Cheers!

26
_posts/2017-10-22-hibernation-in-three-simple-steps.md

@ -1,21 +1,21 @@
---
title: How to enable hibernation in three simple steps
tags: [hibernation, parabola, systemd, mkinitcpio, syslinux]
updated: 2017-10-22 18:30
updated: 2017-10-22 18:30
description: How to enable hibernation on systemd and mkinitcpio-based systems
---
Greetings to all,
It has been some time since I needed to enable hibernation on my machine so
that I could find all my stuff exacly as I left it the previous time. This
is especially useful to me since I usually leave multiple terminals opened. So,
untill recently, I suspended instead of hibernate, but that is not
It has been some time since I needed to enable hibernation on my machine so
that I could find all my stuff exacly as I left it the previous time. This
is especially useful to me since I usually leave multiple terminals opened. So,
untill recently, I suspended instead of hibernate, but that is not
always practical.
What follows is a summary of instuctions I gathered from
[multiple](https://wiki.archlinux.org/index.php/Power_management/Suspend_and_hibernate)
[sources](https://wiki.archlinux.org/index.php/Mkinitcpio#Image_creation_and_activation)
What follows is a summary of instuctions I gathered from
[multiple](https://wiki.archlinux.org/index.php/Power_management/Suspend_and_hibernate)
[sources](https://wiki.archlinux.org/index.php/Mkinitcpio#Image_creation_and_activation)
and it reflects my use case and configuration.
## Prerequisites
@ -33,12 +33,12 @@ Get the UUID of your swap partition.
## Step 2
Edit the `/etc/mkinitcpio.conf` file to include `resume` after `udev` in the
Edit the `/etc/mkinitcpio.conf` file to include `resume` after `udev` in the
`HOOKS` section. This is how mine looks:
HOOKS="base udev mdadm_udev lvm2 resume autodetect modconf block filesystems keyboard fsck"
Then we must regenerate the ramdisk environment (please get the
Then we must regenerate the ramdisk environment (please get the
correct kernel names first). For example:
# mkinitcpio -p linux-libre
@ -50,9 +50,9 @@ Copy the variable you gathered earlier.
$ echo $UUID
Append the `resume` kernel parameter to your bootloader configuration. For
example, this would be a modified Syslinux entry to accomodate the new
parameter.
Append the `resume` kernel parameter to your bootloader configuration. For
example, this would be a modified Syslinux entry to accomodate the new
parameter.
LABEL <some label>
MENU LABEL <some value>

12
_posts/2018-03-02-algorithm.md

@ -68,8 +68,8 @@ if __name__ == '__main__':
## Explanation
The idea behind it is that we iterate character by
character through the string until we find the an element that needs
The idea behind it is that we iterate character by
character through the string until we find the an element that needs
to be removed: `if s[i] == remove_char`
If this condition is true, we set a counter ``count = 1`` which is a
@ -78,11 +78,11 @@ counter for the number of `remove_char` characters.
We assume that the next character in the string will also be `remove_char`.
If it is it then we continue to count the occurrencies of `remove_char`.
Once we reach the end of the string or if there are no more
Once we reach the end of the string or if there are no more
consecutive `remove_chars` we compute the halved number of
remove characters with `math.floor(count / 2)` and concatenate
`remove_char * math.floor(count / 2)` to the final string. Using the floor
function implies that the count is approximated to the nearest smaller integer
remove characters with `math.floor(count / 2)` and concatenate
`remove_char * math.floor(count / 2)` to the final string. Using the floor
function implies that the count is approximated to the nearest smaller integer
number.
If the current character is not `if s[i] != remove_char` we simply add it

3
_posts/2018-03-05-cups-simple-shared-printer.md

@ -34,7 +34,7 @@ ipps://${server_hostname}:631/printers/${remote_printer_name} \
Please note that `lpadmin` needs root privileges.
The only thing to do is to edit the variables appropriately and then do a printer test.
The only thing to do is to edit the variables appropriately and then do a printer test.
Recently I experienced encryption certificate problems using `ipps://` but
everything worked fine using the plain `ipp://` protocol. If you are
@ -62,4 +62,3 @@ That's it...
This post is an adaptation of the original one at
[linuxdifficile](https://linuxdifficile.wordpress.com/2016/03/02/aggiungere-una-stampante-remota-condivisa-da-un-sistema-gnulinux-con-un-solo-comando/)

68
_posts/2018-04-03-repairing-my-first-pc.md

@ -6,47 +6,47 @@ description: Attempt to repair my first PC and part inventory
---
This was my first PC back in ~ 2001 2002. It was already used back then and
it shipped with the mighty Micro$oft Windows 98 OS (probably the "First
it shipped with the mighty Micro$oft Windows 98 OS (probably the "First
Edition").
{% include image.html file="dsl_boot_on_old_pc.gif" alt="booting Damn Small Linux (DSL) from the CD-ROM" caption="booting Damn Small Linux (DSL) with the CD-ROM" %}
I remember using *Intern€t Explor€r* (version 5?) with
this thing (sic) and to do that I had to connect the internal
[Winmodem](https://en.wikipedia.org/wiki/Softmodem) to a
[tripolar phone
plug](https://en.wikipedia.org/wiki/Tripolar_plug) with an RJ-45 to
tripolar beige wire (this also happened with the
I remember using *Intern€t Explor€r* (version 5?) with
this thing (sic) and to do that I had to connect the internal
[Winmodem](https://en.wikipedia.org/wiki/Softmodem) to a
[tripolar phone
plug](https://en.wikipedia.org/wiki/Tripolar_plug) with an RJ-45 to
tripolar beige wire (this also happened with the
next computer). Internet speed was around 32Kbps on average.
No USBs, no WiFi, no Ethernet. Only a CD-ROM and a floppy disk drive which was
the only medium I used at the time to move files. Infact I remember using
No USBs, no WiFi, no Ethernet. Only a CD-ROM and a floppy disk drive which was
the only medium I used at the time to move files. Infact I remember using
floppy drives for school researches using Micro$oft Word as an editor.
It was not a gaming PC but I was able to play
titles like *Hard Truck: Road To Victory*, *Age Of Empires II* or *Flight
titles like *Hard Truck: Road To Victory*, *Age Of Empires II* or *Flight
Simulator 98* anyway.
Sadly, some years ago this PC refused to boot up. This happened
more and more frequenly and I had no idea on what was going on. I gave up
Sadly, some years ago this PC refused to boot up. This happened
more and more frequenly and I had no idea on what was going on. I gave up
using it...
... until I decided to repair it and I noticed some corrosion on
... until I decided to repair it and I noticed some corrosion on
the RAM module. I found [this post](http://www.tomshardware.co.uk/forum/253501-30-cleaning-memory-eraser-chips)
which suggests using a pencil eraser on the pins. It worked. When booting, the
leds of the AT keyboard instead of blinking once, now blinked twice. So I
connected the video card as well but nothing happened. I then connected a PC
which suggests using a pencil eraser on the pins. It worked. When booting, the
leds of the AT keyboard instead of blinking once, now blinked twice. So I
connected the video card as well but nothing happened. I then connected a PC
buzzer and found out that it was an
[AGP socket problem](http://www.helpwithpcs.com/upgrading/post-beep-codes.htm) a.k.a.
[AGP socket problem](http://www.helpwithpcs.com/upgrading/post-beep-codes.htm) a.k.a.
*Video error*, since the motherboard has an AWARD BIOS.
I tried another AGP video card with no luck. The AGP socket was probably just
I tried another AGP video card with no luck. The AGP socket was probably just
broken.
To be sure the system was working I tried a Windows 98 recovery boot floppy
disk. I issued the `dir` command and listened to the floppy drive making
To be sure the system was working I tried a Windows 98 recovery boot floppy
disk. I issued the `dir` command and listened to the floppy drive making
the usual noise.
Since it's pretty useless as it is, and of course painly slow, I think it's
Since it's pretty useless as it is, and of course painly slow, I think it's
time to recycle the components...
What follows is a thorough inventory of the parts with some photos.
@ -55,15 +55,15 @@ What follows is a thorough inventory of the parts with some photos.
### Motherboard
- 1x Unkown "Super Socket 7" motherboard with AWARD BIOS and VIA, Winbond and
- 1x Unkown "Super Socket 7" motherboard with AWARD BIOS and VIA, Winbond and
other chips.
{% include image.html file="DSCN3132.JPG" alt="motherboard and processor" %}
#### Slots
- 3x PCI
- 2x ISA
- 3x PCI
- 2x ISA
- 2x DIMM 168 pin
- 2x [SIMM](https://en.wikipedia.org/wiki/SIMM) RAM (Don't know pin #)
@ -103,7 +103,7 @@ What follows is a thorough inventory of the parts with some photos.
### Memory
- 32MB `DIMM32MTEC AL0457BY` DIMM RAM. It has 4 `M.tec` memory modules on the
- 32MB `DIMM32MTEC AL0457BY` DIMM RAM. It has 4 `M.tec` memory modules on the
front.
### Drives
@ -118,17 +118,17 @@ What follows is a thorough inventory of the parts with some photos.
### Power Supply
- Power supply with P8 and P9 pins: `EXON COMPUTER SWITCHING POWER SUPPLY
- Power supply with P8 and P9 pins: `EXON COMPUTER SWITCHING POWER SUPPLY
230W`. Model name should be `EX04T`.
{% include image.html file="DSCN3130.JPG" alt="FDD and power supply" %}
### Case Connectors
These connectors are placed on the back part of the chassis. They have the
These connectors are placed on the back part of the chassis. They have the
classic bracket form factor.
#### Connector 1
#### Connector 1
- 1x female PS/2 mouse connector
- 1x female parallel port
@ -142,20 +142,20 @@ classic bracket form factor.
### Internal accessories
- A [4 pin audio cable](https://encyclopedia2.thefreedictionary.com/CD-ROM+audio+cable)
that connected the CD-ROM drive with the sound card (can't find it). The wire
- A [4 pin audio cable](https://encyclopedia2.thefreedictionary.com/CD-ROM+audio+cable)
that connected the CD-ROM drive with the sound card (can't find it). The wire
was grey and the two connectors were black.
### Case
- The case was a classical beige 1990s looking one, with a single metal cover
- The case was a classical beige 1990s looking one, with a single metal cover
around the left, right and top sides.
### External Accessories
- AT Monterey Keyboard `MODEL : K280W` with the right foot/leg broken
(looking at the keyboard from behind).
- DELL Trinitron monitor `UltraScan 800HS Series MODEL: D825TM`, with a nice
- AT Monterey Keyboard `MODEL : K280W` with the right foot/leg broken
(looking at the keyboard from behind).
- DELL Trinitron monitor `UltraScan 800HS Series MODEL: D825TM`, with a nice
integrated crack on the basement and a non functional horizontal line on the screen.
- A serial mouse (can't find it)
- Classical PC speakers (light blue transparent plastic) with power supply (can't find them)

2
_posts/2018-04-16-my-python-release-workflow.md

@ -11,7 +11,7 @@ in case of a new version release with some of my Python repositories.
<!--more-->
*Please note that this page is deprecated and will only be kept for historical
reference. Have a look at
reference. Have a look at
[https://frnmst.github.io/fpydocs/workflow_common.html](https://frnmst.github.io/fpydocs/workflow_common.html)
for an updated version.*

42
_posts/2018-04-19-openwrt-on-the-dg834gv4-modem-router.md

@ -9,39 +9,39 @@ description: Installing OpenWrt on the DG834Gv4 modem router
![](https://raw.githubusercontent.com/frnmst/openwrt-leds-as-notification/master/dg834gv4_leds.gif)
The [DG834Gv4](https://wikidevi.com/wiki/Netgear_DG834Gv4) is an old
*Netgear* WiFi modem/router and has been my first wireless access
point. Years have passed and this hardware shows signs
The [DG834Gv4](https://wikidevi.com/wiki/Netgear_DG834Gv4) is an old
*Netgear* WiFi modem/router and has been my first wireless access
point. Years have passed and this hardware shows signs
of its age. It is compliant to
[802.11 b/g](https://en.wikipedia.org/wiki/IEEE_802.11#802.11g) only and
[802.11 b/g](https://en.wikipedia.org/wiki/IEEE_802.11#802.11g) only and
has 100 Mbps ethernet ports .
Also, when using it as a DSL modem, it sometimes disconnects
because of the heat it generates. It was time to decommission it.
In the meantime someone discovered a *nice*
[backdoor](https://github.com/elvanderb/TCP-32764)
[feature](https://wikidevi.com/wiki/TCP-32764) in a series of
[backdoor](https://github.com/elvanderb/TCP-32764)
[feature](https://wikidevi.com/wiki/TCP-32764) in a series of
modem/routers, including the DG834Gv4. One more reason not to use it *as-is*.
*After the router collected some dust*, I evaluated some options such as
*After the router collected some dust*, I evaluated some options such as
installing OpenWrt or the [DGTeam](http://www.dgteam-mirror.talktalk.net/Home.html) firmwares.
I went with the DGTeam firmware at first because it had modem support. This
I went with the DGTeam firmware at first because it had modem support. This
meant I could use it as a spare modem.
A few weeks ago, however, I tried installing OpenWrt and it wasn't so straight
A few weeks ago, however, I tried installing OpenWrt and it wasn't so straight
forward as I thought.
# Steps
- [Follow the instuctions reported on the wiki](https://openwrt.org/toh/netgear/dg834g.v4?s[]=dg834gv4)
- [Follow the instuctions reported on the wiki](https://openwrt.org/toh/netgear/dg834g.v4?s[]=dg834gv4)
but instead of getting Chaos Calamer get
[Attitude Adjustment](https://archive.openwrt.org/attitude_adjustment/12.09/brcm63xx/generic/openwrt-96348GW-10-generic-squashfs-cfe.bin).
Use `nftp.c` to flash the image on it. This will work even of you brick the
Use `nftp.c` to flash the image on it. This will work even of you brick the
router.
The reason to select such an old image is because of the insufficient free
RAM available once the important services start up. Even with Attitude
Adjustment you'll run out of memory easily. I also tried using older versions
RAM available once the important services start up. Even with Attitude
Adjustment you'll run out of memory easily. I also tried using older versions
of OpenWrt without success.
- Go to [http://192.168.1.1](http://192.168.1.1) and change the root password via the *LuCI* web interface.
@ -96,7 +96,7 @@ config interface 'lan'
option netmask '<router_s netmask>'
```
- If you want to use the router as a switch/repeater, this will disable the
- If you want to use the router as a switch/repeater, this will disable the
DHCP server:
```shell
@ -107,7 +107,7 @@ config interface 'lan'
# Problems
There is not enough memory to install anything even after killing several
There is not enough memory to install anything even after killing several
processes.
route add default gateway 192.168.1.1 netmask 0.0.0.0 metric 0
@ -115,24 +115,24 @@ processes.
root@OpenWrt:~# opkg install sshfs
Installing sshfs (2.2-1) to root...
Downloading http://downloads.openwrt.org/attitude_adjustment/12.09/brcm63xx/generic/packages/sshfs_2.2-1_brcm63xx.ipk.
Downloading http://downloads.openwrt.org/attitude_adjustment/12.09/brcm63xx/generic/packages/sshfs_2.2-1_brcm63xx.ipk.
Collected errors:
* gz_open: fork: Cannot allocate memory.
* opkg_install_pkg: Failed to unpack control files from /tmp/opkg-Ry3bvT/sshfs_2.2-1_brcm63xx.ipk.
* opkg_install_cmd: Cannot install package sshfs.
For some reason, WiFi seems less powerful (as in range) than it should be.
For some reason, WiFi seems less powerful (as in range) than it should be.
This is quite disappointing.
# Alternatives
It would be interesting to patch the original Netgear/SerComm firmware by
It would be interesting to patch the original Netgear/SerComm firmware by
removing the `scfgmgr` file and a line in a shell script that is launched at boot.
You need a 32 bit GNU/Linux distribution with the appropriate development
libraries and only then you'll be able to run the software that rebuilds the
image. Unfortunately there is only a text file describing generic instructions
You need a 32 bit GNU/Linux distribution with the appropriate development
libraries and only then you'll be able to run the software that rebuilds the
image. Unfortunately there is only a text file describing generic instructions
so it takes quite some time to track down all the necessary libraries and to have
a working environment. Maybe another time...

50
_posts/2018-08-04-android-backup-with-rsync.md

@ -7,24 +7,24 @@ description: Syncronization of files from Android to a GNU/Linux system
# Overview
Backups of mobile phone content have been a problem I wanted to solve for years
Backups of mobile phone content have been a problem I wanted to solve for years
but unfortunately the tools to do a clean job have always been inadeguate.
Also, I certainly didn't want to rely on third party services such as
Dropbox, Google, etc...
<!--more-->
The first solution was to use bluetooth with an APP I can't even remember the
The first solution was to use bluetooth with an APP I can't even remember the
name of. The problem was its slow speed and non-secureness.
So I started using micro SD cards and manual copying... with the result of
losing several times all media on the card because its filesystem got
So I started using micro SD cards and manual copying... with the result of
losing several times all media on the card because its filesystem got
corrupted.
After searching intensively I finally found a reliable and automatic way for
mobile phone backups. There is this neat APP called
[Primitive FTPD](https://github.com/wolpi/prim-ftpd) that includes an
[SFTP](https://en.wikipedia.org/wiki/SSH_File_Transfer_Protocol)
After searching intensively I finally found a reliable and automatic way for
mobile phone backups. There is this neat APP called
[Primitive FTPD](https://github.com/wolpi/prim-ftpd) that includes an
[SFTP](https://en.wikipedia.org/wiki/SSH_File_Transfer_Protocol)
server. The advantages of SFTP instead of using other systems are:
- simpleness
- encryption and authentication by default
@ -134,44 +134,44 @@ $ ${PATH_TO_SCRIPT} ${PATH_TO_CONFIGURATION_FILE}
## (Rsync over SFTP) or (Rsync over directory over SSHFS)
Since Primitive FTPD is an SFTP server, we can't use rsync
directly on SFTP because this is not supported by rsync (see: `$ man 1 rsync`).
For this reason we must first mount the directory using SSHFS and then
directly on SFTP because this is not supported by rsync (see: `$ man 1 rsync`).
For this reason we must first mount the directory using SSHFS and then
*rsyncit*.
## (Public key) or (password authentication)
I was not able to use public key authentication because of Pftpd reported
some obscure error with it. Initially I wasn't able to find Pftpd's log
file in the phone's flash memory but I noticed it after several sync
I was not able to use public key authentication because of Pftpd reported
some obscure error with it. Initially I wasn't able to find Pftpd's log
file in the phone's flash memory but I noticed it after several sync
operations. Going through the file didn't clear the situation at all.
Even the
[project issues](https://github.com/wolpi/prim-ftpd/issues?utf8=%E2%9C%93&q=is%3Aissue+public+key+)
didn't solve the problem. So, the only remaining solution was to use
password authentication. Since all the process needs to be automatic, the
password needs to be stored plaintext and passed through the `password_stdin`
[project issues](https://github.com/wolpi/prim-ftpd/issues?utf8=%E2%9C%93&q=is%3Aissue+public+key+)
didn't solve the problem. So, the only remaining solution was to use
password authentication. Since all the process needs to be automatic, the
password needs to be stored plaintext and passed through the `password_stdin`
argument. This is of course *not the best setup*.
## Storage type
Depending on the Android version and device, the type of storage selected
from Pftpd might not work and behave differently than expected, so it is
kind of a trial and error operation. In my case the option `Plain old
from Pftpd might not work and behave differently than expected, so it is
kind of a trial and error operation. In my case the option `Plain old
filesystem` worked best, although the location that will be synced will
usually be `/storage/emulated/0` and cannot be changed to use, for example,
the external SD card.
# Alternatives
There aren't many *free software* alternatives that work like this for Android.
There aren't many *free software* alternatives that work like this for Android.
What I found either didn't involve SSH or lack some functionalities.
[Syncopoli](https://gitlab.com/fengshaun/syncopoli), for example, was
[Syncopoli](https://gitlab.com/fengshaun/syncopoli), for example, was
another possible option. The readme file states that it is
an Rsync-based application optionally working via SSH and public key
authentication, however it is a client, not a server.
an Rsync-based application optionally working via SSH and public key
authentication, however it is a client, not a server.
Using a client avoids the computer polling for the connection, so it's a plus.
The only problem is that I need to do extra operations like maling and writing
to log files after the syncronization finishes. This is not possible with
The only problem is that I need to do extra operations like maling and writing
to log files after the syncronization finishes. This is not possible with
Syncopoli.
~

56
_posts/2018-10-02-automatic-removable-media-synchronization.md

@ -7,41 +7,41 @@ description: Automatic synchronization of media files from a removable block dev
# Backups, yet again
Continuing to talk about [backups](android-backup-with-rsync.html) I want to
share a script I have written for the sole purpose of copying the content of
mass storage devices that contain media files. This applies for example to SD
cards used in digital cameras, but it can be used for any removable block
Continuing to talk about [backups](android-backup-with-rsync.html) I want to
share a script I have written for the sole purpose of copying the content of
mass storage devices that contain media files. This applies for example to SD
cards used in digital cameras, but it can be used for any removable block
device.
# Automation
## Use of metadata
The script that I called `auto_media_backup.sh` works on a simple principle: it
uses the metadata of the original file to *compute* the destination directory
The script that I called `auto_media_backup.sh` works on a simple principle: it
uses the metadata of the original file to *compute* the destination directory
of the copied file, like this:
- get the base destination directory from the configuration file (variable `DST_PATH`)
- get the device's UUID using `$ lsblk -o name,uuid` (variable `uuid`)
- get year and month of the media file either using the
[EXIF data](https://en.wikipedia.org/wiki/Exif), if available, or retrieving
[EXIF data](https://en.wikipedia.org/wiki/Exif), if available, or retrieving
some of the [filesystems' metadata](https://en.wikipedia.org/wiki/Comparison_of_file_systems#Metadata)
related to the last access or last modification (variables `year`,
related to the last access or last modification (variables `year`,
`month` and `filename`)
I opted for the `${DST_PATH}/${uuid}/${year}/${month}/${filename}` scheme.
## Block device UUID monitoring
Another important aspect is that when I insert the card in the reader the
Another important aspect is that when I insert the card in the reader the
synchronization starts automatically:
```shell
[...] udevadm monitor --udev -s block [...]
```
To avoid synchronizing every removable block device I opted for a whitelisting
method based on the UUID we computed earlier. A code extract should clarify
To avoid synchronizing every removable block device I opted for a whitelisting
method based on the UUID we computed earlier. A code extract should clarify
the situation:
```shell
@ -54,8 +54,8 @@ for uuid in ${WHITELIST_UUID}; do
## Logging
There are four possible ways to know if the operation started and
how it finished. Each logging system is independent from the other so it
There are four possible ways to know if the operation started and
how it finished. Each logging system is independent from the other so it
possibile to activate or deactivate them singularly. These systems are:
- logging to `stdout`
@ -63,42 +63,42 @@ possibile to activate or deactivate them singularly. These systems are:
- emailing using the program `mail`
- beeping using the program `beep`
If you use the mail facility make sure for it to be already configured and
working. In my case I used the
[`s-nail`](https://wiki.archlinux.org/index.php/S-nail) package along with
If you use the mail facility make sure for it to be already configured and
working. In my case I used the
[`s-nail`](https://wiki.archlinux.org/index.php/S-nail) package along with
[`msmtp`](https://wiki.archlinux.org/index.php/Msmtp) as the
SMTP client.
Listening for beeps is a very immediate action and it does not require to
be in front of the computer's monitor or checking the email.
Think about how microwaves, fridges, ovens, washing machines and other domestic
Think about how microwaves, fridges, ovens, washing machines and other domestic
appliances work.
The script logs when a synchronization starts, finishes or
The script logs when a synchronization starts, finishes or
fails and does not know about its progress.
## Loop
The script will continue to monitor for new devices when in idle and does not
quit even if the previous synchronization has failed. If you need to edit the
The script will continue to monitor for new devices when in idle and does not
quit even if the previous synchronization has failed. If you need to edit the
configuration file be sure to reload the script.
## Synchronization
[Rsync](https://rsync.samba.org/) was an obvious choice for this case because
it provides fast, incremental and secure file copying just with a bunch of
[Rsync](https://rsync.samba.org/) was an obvious choice for this case because
it provides fast, incremental and secure file copying just with a bunch of
options.
# The script
I saved the following code listing as `auto_media_backup.sh`. Due to the fact
that [a small part of the script was took and modified from the Arch
I saved the following code listing as `auto_media_backup.sh`. Due to the fact
that [a small part of the script was took and modified from the Arch
Wiki](https://wiki.archlinux.org/index.php/Udisks#udevadm_monitor),
this code is licensed under the [GNU Free Documentation License
this code is licensed under the [GNU Free Documentation License
1.3](https://www.gnu.org/copyleft/fdl.html) or later.
Other small parts were took from a [github
gist](https://gist.github.com/jvhaarst/2343281) which was put
in the public domain.
Other small parts were took from a [github
gist](https://gist.github.com/jvhaarst/2343281) which was put
in the public domain.
```shell
#!/bin/bash

14
_posts/2018-10-18-change-raid-device-name.md

@ -2,17 +2,17 @@
title: Fixing the /dev/md127 problem
tags: [parabola, RAID, kernel naming, /dev/md127, mdadm, mkinitcpio]
updated: 2018-10-18 11:00
description: Fixing a RAID array kernel name
description: Fixing a RAID array kernel name
---
A quick *how to* today.
`/dev/md127`. It happened again while I was adding a new RAID array to
replace another one. You have no idea the number of times I had to look on the
Internet on how to fix this problem. It usually take 1/2 hour to get the
`/dev/md127`. It happened again while I was adding a new RAID array to
replace another one. You have no idea the number of times I had to look on the
Internet on how to fix this problem. It usually take 1/2 hour to get the
correct instructions, and I always tell to myself:
> The solution to this problem is very simple. **I know I will remember how
> The solution to this problem is very simple. **I know I will remember how
> to deal with it the next time.**
But this is not the case, hence the reason for writing this post.
@ -23,8 +23,8 @@ The fix is quite simple:
# mdadm --detail --scan
- Copy the array of interest from previous output. Remove the `name`
variable and append what remains in `/etc/mdadm.conf`. If you have for
- Copy the array of interest from previous output. Remove the `name`
variable and append what remains in `/etc/mdadm.conf`. If you have for
example
ARRAY /dev/md127 metadata=1.2 name=<hostname>:127 UUID=<some_uuid>

76
_posts/2018-11-06-the-stupid-smart-doorbell.md

@ -5,41 +5,41 @@ updated: 2019-07-01 11:16
description: A stupid smart doorbell that mails you a photo of who rang
---
A [smart doorbell](https://en.wikipedia.org/wiki/Smart_doorbell) is useful when
A [smart doorbell](https://en.wikipedia.org/wiki/Smart_doorbell) is useful when
you are not at home but you want to be notified about when and who rang.
## Ideas
The idea behind my implementation is very naïve: someone rings at the
doorbell, a program listening from a microphone pics up the sound and triggers
a script. A webcam pointed in front of the door takes a picture which is sent
The idea behind my implementation is very naïve: someone rings at the
doorbell, a program listening from a microphone pics up the sound and triggers
a script. A webcam pointed in front of the door takes a picture which is sent
as an email attachment.
Initially I wanted to use a [cheap wireless
Initially I wanted to use a [cheap wireless
doorbell](https://harizanov.com/2013/07/raspberry-pi-emalsms-doorbell-notifier-picture-of-the-person-ringing-it/).
The problem is that I have no experience in soldering and I didn't want to
The problem is that I have no experience in soldering and I didn't want to
mess things up. However, the idea intreagued me nonetheless.
I had to find another system to get the trigger. The obvious way was to use
the existing doorbell system in the house. For this purpose I found a [ruby
script](http://thomer.com/howtos/detect_sound.html) which uses
I had to find another system to get the trigger. The obvious way was to use
the existing doorbell system in the house. For this purpose I found a [ruby
script](http://thomer.com/howtos/detect_sound.html) which uses
[ALSA](https://www.alsa-project.org/main/index.php/Main_Page) and [soX](http://sox.sourceforge.net/)
to record and examine the sound. If the sound is greater than the set
threshold an external script is called. I added an expected frequency range
detection check which is useful to avoid some false positives. To do this I
to record and examine the sound. If the sound is greater than the set
threshold an external script is called. I added an expected frequency range
detection check which is useful to avoid some false positives. To do this I
first translated the script from ruby to bash.
## Hardware tests
The first thing I did was to try the Raspberry PI 3B plus, with a
an unnamed USB webcam which has an integrated microphone. A Logitech USB webcam
The first thing I did was to try the Raspberry PI 3B plus, with a
an unnamed USB webcam which has an integrated microphone. A Logitech USB webcam
would take the pictures instead.
The Raspberry was connected via Ethernet. Unfortunately the single board
computer suffers from USB bandwidth problems since [the 4 USBs ports and the
Ethernet socket are all shared as part of a single
The Raspberry was connected via Ethernet. Unfortunately the single board
computer suffers from USB bandwidth problems since [the 4 USBs ports and the
Ethernet socket are all shared as part of a single
hub](https://raspberrypi.stackexchange.com/questions/44433/does-wifi-on-the-pi-3-reduce-the-ethernet-bottleneck-when-using-usb-device).
Just in case I also tried using a powered 7 port USB hub. The results were the
Just in case I also tried using a powered 7 port USB hub. The results were the
following:
Error starting stream. VIDIOC_STREAMON: Connection timed out
@ -48,27 +48,27 @@ following:
VIDIOC_DQBUF: Invalid argument
No frames captured.
What follows is part of the output from `$ lsusb` concerning the previously
What follows is part of the output from `$ lsusb` concerning the previously
cited webcam.
ID 0c76:1600 JMTek, LLC. Ion Quick Play LP turntable
ID 1871:0306 Aveo Technology Corp.
Even using the integrated WiFi card, which is not connected to the USB hub,
Even using the integrated WiFi card, which is not connected to the USB hub,
didn't solve the problem. I had to use a proper computer...
With an old IBM Thinkpad everything seemed to work fine so I decided
to add another feature. Using the same unnamed webcam and the software
With an old IBM Thinkpad everything seemed to work fine so I decided
to add another feature. Using the same unnamed webcam and the software
[motion](https://motion-project.github.io/) it is possible to detect movement.
I tried to use that to know when and who passes through the front door.
Just like before, there were problems with the USB bandwidth. A cause of this
might be that the computer has USB version 1.1 ports. I had slightly better
improvements when I passed from a USB microphone to an analog one and changed
I tried to use that to know when and who passes through the front door.
Just like before, there were problems with the USB bandwidth. A cause of this
might be that the computer has USB version 1.1 ports. I had slightly better
improvements when I passed from a USB microphone to an analog one and changed
the original webcam to an
ID 058f:3880 Alcor Micro Corp.
[But the bandwidth was still not
[But the bandwidth was still not
enough](https://motion-project.github.io/motion_config.html#basic_setup_v4l2),
so I had to settle for a simple doorbell system for the moment.
@ -81,7 +81,7 @@ What follows are a couple of tables of all the hardware and software ingredients
| Object | Quantity | Description | Purpose | Required |
|:-------------:|:-------------:|:-----:|:
| [IBM ThinkPad A31](https://www.thinkwiki.org/wiki/Category:A31) | 1 | computer | control the devices and read sensors | yes |
| [Logitech QuickCam E1000](https://wikidevi.com/wiki/Logitech_HD_Pro_Webcam_C920#Models) | 1 | webcam | Take photos | yes |
| [Logitech QuickCam E1000](https://wikidevi.com/wiki/Logitech_HD_Pro_Webcam_C920#Models) | 1 | webcam | Take photos | yes |
| [Dlink DHP-306AV](https://eu.dlink.com/uk/en/products/dhp-306av-powerline-av-network-adapter) | 1 | powerline to ethernet adapters | if your computer is out of range from the router or switch | no |
| Ethernet wire | 2 | CAT 5e | connect the power line devices | no |
| USB extension cord | 1 | | connect this cable between the computer and the webcam | no |
@ -337,8 +337,8 @@ web_extras=""
#### Calibration
- Use `$ alsamixer` to set the audio levels. The hardest part was finding a
working interval for the amplitude and frequency values through which the
- Use `$ alsamixer` to set the audio levels. The hardest part was finding a
working interval for the amplitude and frequency values through which the
script is able to avoid as much false positives as possible.
- [Fix the desired audio level for the next reboots](https://unix.stackexchange.com/questions/210113/default-sound-volume-for-all-alsa-devices)
@ -350,18 +350,18 @@ web_extras=""
- Version 0.0: this version.
- Version 0.1: discontinue the Thinkpad A31 and use the Raspberry PI instead
with an (full HD?) IR camera module and its extension cord to reach out of
the door. This should free the USB hub that we must use for the audio
trigger (a usb microphone or USB audio card connected to the analog
with an (full HD?) IR camera module and its extension cord to reach out of
the door. This should free the USB hub that we must use for the audio
trigger (a usb microphone or USB audio card connected to the analog
microphone).
- Version 0.2: instead of using an audio trigger, use some kind of sensor. Our
doorbell transforms the electrical current to piston movement against two
- Version 0.2: instead of using an audio trigger, use some kind of sensor. Our
doorbell transforms the electrical current to piston movement against two
metal bars that vibrate at a certain frequency, which in turn produce
sound. This new yet unkown method should always be reliable and avoid any
sound. This new yet unkown method should always be reliable and avoid any
false positive.
- Version 0.3: add an open-close door sensor which interfaces to the GPIO. Use
- Version 0.3: add an open-close door sensor which interfaces to the GPIO. Use
a USB camera once this trigger activates.
- Version 0.4: adapt all this stuff so that it works with something like [Home
- Version 0.4: adapt all this stuff so that it works with something like [Home
Assistant](https://www.home-assistant.io/) or [Kalliope](https://kalliope-project.github.io/).
~

24
_posts/2018-11-18-my-bash-option-parsing-template.md

@ -7,21 +7,21 @@ description: a template for option parsing in Bash based on getopt
Hello again,
in the past years I have written a lot of scripts which rely on
`getopt`, a program that parses command line options (both short and long) and
arguments.
in the past years I have written a lot of scripts which rely on
`getopt`, a program that parses command line options (both short and long) and
arguments.
<!--more-->
Getopt is part of the [util-linux](https://www.kernel.org/pub/linux/utils/util-linux/) package.
Please, [don't confuse getopt with getopts](https://unix.stackexchange.com/questions/62950/getopt-getopts-or-manual-parsing-what-to-use-when-i-want-to-support-both-shor)
; they are quite different.
See [this](https://www.mariusvw.com/2013/02/24/bash-getopt-versus-getopts/)
and [this](http://abhipandey.com/2016/03/getopt-vs-getopts/) for a comparison
See [this](https://www.mariusvw.com/2013/02/24/bash-getopt-versus-getopts/)
and [this](http://abhipandey.com/2016/03/getopt-vs-getopts/) for a comparison
between the two.
*Please note that the script and the documentation reported here, except for
the introduction and the "Reason" paragraph, is outdated. For this
*Please note that the script and the documentation reported here, except for
the introduction and the "Reason" paragraph, is outdated. For this
reason you should refer to the [repository](https://github.com/frnmst/fbopt).*
*Please note that the documentation and source code reported here are old.
@ -92,13 +92,13 @@ What follows is `fbopt` version `0.3`.
#
# Written in 2018 by Franco Masotti/frnmst <franco.masotti@student.unife.it>
#
# To the extent possible under law, the author(s) have dedicated all
# copyright and related and neighboring rights to this software to the public
# To the extent possible under law, the author(s) have dedicated all
# copyright and related and neighboring rights to this software to the public
# domain worldwide. This software is distributed without any warranty.
#
# You should have received a copy of the CC0 Public Domain Dedication along
# with this software. If not, see
# <http://creativecommons.org/publicdomain/zero/1.0/>.
# You should have received a copy of the CC0 Public Domain Dedication along
# with this software. If not, see
# <http://creativecommons.org/publicdomain/zero/1.0/>.
#
#
# See also https://frnmst.gitlab.io/notes/my-bash-option-parsing-template.html

46
_posts/2019-02-23-my-backup-system.md

@ -8,10 +8,10 @@ description: A detailed exaplanation of my backup system which is both encrypted
## Introduction
<!--excerpt_start-->
[Rsync](https://rsync.samba.org/) is a very useful and flexible tool to do
[Rsync](https://rsync.samba.org/) is a very useful and flexible tool to do
incremental backups and I have been using it for years without any problems.
Recently I discovered the power of Rsync and [Cryptsetup with
LUKS](https://gitlab.com/cryptsetup/cryptsetup/) to do encrypted and
Recently I discovered the power of Rsync and [Cryptsetup with
LUKS](https://gitlab.com/cryptsetup/cryptsetup/) to do encrypted and
incremental backups as well.
<!--excerpt_end-->
@ -19,8 +19,8 @@ incremental backups as well.
## Partitioning scheme
I have chosen a partitioning scheme that separates *bigger and rarely used
files* (on HDDs) from *smaller and commonly used files* (on SSDs). For this
I have chosen a partitioning scheme that separates *bigger and rarely used
files* (on HDDs) from *smaller and commonly used files* (on SSDs). For this
reason I need two different hard disks for backup:
| Disk name | Disk type | Size (order of magnitude) | Backup of mountpoint |
@ -59,19 +59,19 @@ I also keep two different types of incremental backups. It's not exactly the *3
| `/mnt/backup_root_enc` | `/dev/sdw1` | encrypted root partition backup |
| `/mnt/backup_data_enc` | `/dev/sdz1` | encrypted data partition backup |
- [*Bash wildcards*](http://tldp.org/LDP/GNU-Linux-Tools-Summary/html/x11655.htm)
- [*Bash wildcards*](http://tldp.org/LDP/GNU-Linux-Tools-Summary/html/x11655.htm)
will be used in this section.
### Steps
1. Install [Rsync](https://rsync.samba.org/),
[Cryptsetup](https://gitlab.com/cryptsetup/cryptsetup/),
1. Install [Rsync](https://rsync.samba.org/),
[Cryptsetup](https://gitlab.com/cryptsetup/cryptsetup/),
[msmtp](https://marlam.de/msmtp/),
[S-nail](https://www.sdaoden.eu/code.html#s-nail),
[GNU Bash](http://www.gnu.org/software/bash/bash.html) and
[GNU awk](http://www.gnu.org/software/gawk/)
2. Make the mountpoints and change the permissions. Make them accessible only
2. Make the mountpoints and change the permissions. Make them accessible only
to the `root` user and group, just to be on the safe side. The first thing
to do is to unmount everything under `/mnt`
@ -81,7 +81,7 @@ I also keep two different types of incremental backups. It's not exactly the *3
# chown 700 backup_{root,data}{_enc,}
# popd
3. Partition, format and mount the unencrypted hard disks. You should use
3. Partition, format and mount the unencrypted hard disks. You should use
fstab instead of mounting the filesystems manually
# fdisk /dev/sd{x,y}
@ -96,8 +96,8 @@ I also keep two different types of incremental backups. It's not exactly the *3
# cryptsetup -v --type luks2 --cipher aes-xts-plain64 --key-size 512 --hash sha512 --iter-time 5000 --use-urandom --verify-passphrase luksFormat /dev/sd{w,z}1
5. We will now
[mount and create a filesystem on the encrypted partitions](https://wiki.archlinux.org/index.php?title=Dm-crypt/Encrypting_a_non-root_file_system&oldid=495610#Manual_mounting_and_unmounting).
You will be prompted for a password which will then be used every time you
[mount and create a filesystem on the encrypted partitions](https://wiki.archlinux.org/index.php?title=Dm-crypt/Encrypting_a_non-root_file_system&oldid=495610#Manual_mounting_and_unmounting).
You will be prompted for a password which will then be used every time you
call cryptsetup
# cryptsetup open /dev/sd{w,z}1 {root,data}_enc
@ -120,10 +120,10 @@ I also keep two different types of incremental backups. It's not exactly the *3
### Incremental backup script
This script, called `backup.sh`, was inspired by an
[Arch Wiki](https://wiki.archlinux.org/index.php?title=Rsync&oldid=566635#Full_system_backup)
page dating back some years ago, so I have to use the same license. The
following code is licensed under the [GNU Free Documentation License
This script, called `backup.sh`, was inspired by an
[Arch Wiki](https://wiki.archlinux.org/index.php?title=Rsync&oldid=566635#Full_system_backup)
page dating back some years ago, so I have to use the same license. The
following code is licensed under the [GNU Free Documentation License
1.3](https://www.gnu.org/copyleft/fdl.html) or later.
```shell
@ -157,7 +157,7 @@ DST="${2}"
START=$(date +%s)
if [ "${SRC}" = '/*' ]; then
# Use the exclude option to avoid infinite loops due to symlinks and to
# Use the exclude option to avoid infinite loops due to symlinks and to
# avoid backing up the /data mountpoint itself.
rsync --archive --acls --xattrs --hard-links --delete /* "${DST}" --exclude={/dev/*,/proc/*,/sys/*,/tmp/*,/run/*,/mnt/*,/media/*,/lost+found,/data}
elif [ "${SRC}" = '/data/*' ]; then
@ -224,13 +224,13 @@ LOG_FILE='/var/log/rsync.log'
### Encrypted backup script
To do our encrypted backups we will use LUKS and the previous script as a
To do our encrypted backups we will use LUKS and the previous script as a
base. The idea is quite simple:
1. mount the encrypted partition.
2. do the backup using the previous script with the appropriate parameters.
3. unmount the partition.
This new script is called `backup_enc.sh` and was inspired by
This new script is called `backup_enc.sh` and was inspired by
[this Arch Wiki](https://wiki.archlinux.org/index.php?title=Dm-crypt/Encrypting_a_non-root_file_system&oldid=495610#Manual_mounting_and_unmounting)
page.
@ -291,7 +291,7 @@ umount "${DST}" && cryptsetup close "${NAME}"
#### Configuration file
You must put the correct UUIDs of the partitions in the configuration file. To
You must put the correct UUIDs of the partitions in the configuration file. To
get these run:
$ lsblk -o name,uuid
@ -324,7 +324,7 @@ BACKUP_ALIAS_DATA['DEVICE_MAPPER_NAME']='data_enc'
## First backups
Once you have everything in place, including the configuration files,
you may start backups manually along with Rsync's `--dry-run` option in the
you may start backups manually along with Rsync's `--dry-run` option in the
script.
# ./backup.sh '/*' /mnt/backup_root
@ -332,9 +332,9 @@ script.
If everything works as expected, remove that option.
You can use Cron for the automatic backups. In my case I use
You can use Cron for the automatic backups. In my case I use
[Cronie](https://github.com/cronie-crond/cronie/). Just remember to
call the backup scripts from their directory otherwise the configuration files
call the backup scripts from their directory otherwise the configuration files
won't be sourced.
~

6
_posts/2019-07-08-raid-data-scrubbing.md