<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Informatics on BlocNotes</title>
    <link>https://notes.iopush.net/categories/informatics/</link>
    <description>Recent content in Informatics on BlocNotes</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en-us</language>
    <lastBuildDate>Fri, 29 Jan 2021 00:00:00 +0000</lastBuildDate><atom:link href="https://notes.iopush.net/categories/informatics/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>UBports part 1 - Compiling and booting for Samsung S7</title>
      <link>https://notes.iopush.net/blog/2021/01-ubports-part-1/</link>
      <pubDate>Fri, 29 Jan 2021 00:00:00 +0000</pubDate>
      
      <guid>https://notes.iopush.net/blog/2021/01-ubports-part-1/</guid>
      <description>&lt;p&gt;I went down the hole of installing Linux on my phone (Samsung Galaxy S7). The
easiest path is compiling and installing &lt;a href=&#34;https://www.ubports.com/&#34;&gt;UBports&lt;/a&gt;,
some people have heavily started the process but it is still a work in progress.&lt;/p&gt;
&lt;p&gt;This is the first part: step by step description to build and boot the system,
with helpers scripts to setup the system once flashed.&lt;/p&gt;
    
    
        
        
        
        
    

    
    
    

    
    







  


    

    
        &lt;p&gt;&lt;span class=&#34;image center&#34;&gt;
            &lt;img src=&#34;https://notes.iopush.net/blog/2021/01-ubports-part-1/ubports-home.jpg&#34; alt=&#34;UBports screenshot&#34;&gt;
        &lt;/span&gt;&lt;/p&gt;
        &lt;p&gt;&lt;div class=&#34;align-center&#34; style=&#34;font-weight: bold;&#34;&gt;
            UBports screenshot
        &lt;/div&gt;&lt;/p&gt;
    


&lt;p&gt;The first part is my notes gathered during the initial build. You can install
TWRP then jump directly to the step by step at the end of this page.&lt;/p&gt;
&lt;h1 id=&#34;state&#34;&gt;State&lt;/h1&gt;
&lt;p&gt;This is the status of working features with my current build, some others are
more advanced.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;[ X ] Wi-Fi&lt;/li&gt;
&lt;li&gt;[ X ] Web browsing&lt;/li&gt;
&lt;li&gt;[ X ] MP4 playback&lt;/li&gt;
&lt;li&gt;&lt;input disabled=&#34;&#34; type=&#34;checkbox&#34;&gt; Bluetooth&lt;/li&gt;
&lt;li&gt;&lt;input disabled=&#34;&#34; type=&#34;checkbox&#34;&gt; Camera&lt;/li&gt;
&lt;li&gt;&lt;input disabled=&#34;&#34; type=&#34;checkbox&#34;&gt; Sim card&lt;/li&gt;
&lt;li&gt;&lt;input disabled=&#34;&#34; type=&#34;checkbox&#34;&gt; Phone calls&lt;/li&gt;
&lt;li&gt;&lt;input disabled=&#34;&#34; type=&#34;checkbox&#34;&gt; SMS&lt;/li&gt;
&lt;li&gt;&lt;input disabled=&#34;&#34; type=&#34;checkbox&#34;&gt; MMS&lt;/li&gt;
&lt;/ul&gt;
&lt;h1 id=&#34;documentation&#34;&gt;Documentation&lt;/h1&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;https://docs.halium.org/en/latest/porting/first-steps.html&#34;&gt;https://docs.halium.org/en/latest/porting/first-steps.html&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://www.doof.me.uk/2020/04/06/installing-gnu-linux-on-my-samsung-s7/&#34;&gt;https://www.doof.me.uk/2020/04/06/installing-gnu-linux-on-my-samsung-s7/&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://docs.halium.org/en/latest/supplementary/devices/herolte.html&#34;&gt;https://docs.halium.org/en/latest/supplementary/devices/herolte.html&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://github.com/Halium/projectmanagement/issues/48&#34;&gt;https://github.com/Halium/projectmanagement/issues/48&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h1 id=&#34;twrp-installation&#34;&gt;TWRP installation&lt;/h1&gt;
&lt;p&gt;Just follow official instructions
&lt;a href=&#34;https://forum.xda-developers.com/t/recovery-exynos-official-twrp-for-galaxy-s7-herolte.3333770/&#34;&gt;https://forum.xda-developers.com/t/recovery-exynos-official-twrp-for-galaxy-s7-herolte.3333770/&lt;/a&gt;&lt;/p&gt;
&lt;h1 id=&#34;issue-custom-binary-blocked-by-frp-lock&#34;&gt;Issue &amp;ldquo;Custom binary blocked by FRP lock&amp;rdquo;&lt;/h1&gt;
&lt;p&gt;Go to Android developer options, activate &lt;code&gt;enable OEM unlock&lt;/code&gt; slider.&lt;/p&gt;
&lt;h1 id=&#34;halium-compilation&#34;&gt;Halium compilation&lt;/h1&gt;
&lt;p&gt;Under Debian Bullseye it is not in the docs and might be obvious, but ADB must
be installed &lt;code&gt;apt install adb&lt;/code&gt;.&lt;/p&gt;
&lt;h2 id=&#34;first-steps&#34;&gt;First steps&lt;/h2&gt;
&lt;h3 id=&#34;set-up-your-build-device&#34;&gt;Set up your build device&lt;/h3&gt;
&lt;p&gt;Package &lt;code&gt;python-markdown&lt;/code&gt; does not exists, to be replaced by &lt;code&gt;python3-markdown&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;The error &lt;code&gt;E: Unable to locate package repo&lt;/code&gt; is because &lt;code&gt;contrib&lt;/code&gt; repo needs to
be activated in &lt;code&gt;/etc/apt/sources.list&lt;/code&gt;.&lt;/p&gt;
&lt;h2 id=&#34;get-halium-source&#34;&gt;Get Halium source&lt;/h2&gt;
&lt;h3 id=&#34;adding-device-specific-source&#34;&gt;Adding device-specific source&lt;/h3&gt;
&lt;p&gt;&lt;code&gt;android_device_[manufacturer]_[device]&lt;/code&gt;=&lt;code&gt;android_device_samsung_herolte&lt;/code&gt;
lineage.dependencies file on
&lt;a href=&#34;https://github.com/LineageOS/android_device_samsung_herolte/blob/lineage-18.1/lineage.dependencies&#34;&gt;Github&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;File &lt;code&gt;halium/devices/manifests/[manufacturer]_[device].xml&lt;/code&gt;already exists:
&lt;code&gt;halium/devices/manifests/samsung_herolte.xml&lt;/code&gt;&lt;/p&gt;
&lt;h3 id=&#34;vendor-blobs&#34;&gt;Vendor blobs&lt;/h3&gt;
&lt;p&gt;Nothing to do? At least I did not for now.&lt;/p&gt;
&lt;h2 id=&#34;build-halium&#34;&gt;Build Halium&lt;/h2&gt;
&lt;h3 id=&#34;modify-the-kernel-configuration&#34;&gt;Modify the kernel configuration&lt;/h3&gt;
&lt;p&gt;Clone &lt;code&gt;mer-kernel-check&lt;/code&gt; outside of &lt;code&gt;BUILDDIR&lt;/code&gt; . Then the command for Samsung S7
kernel is:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt; ./mer_verify_kernel_config ../halium/kernel/samsung/universal8890/arch/arm64/configs/exynos8890-herolte_defconfig
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Options I had to set:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;
# https://cateee.net/lkddb/web-lkddb/QUOTA.html
# If you say Y here, you will be able to set per-user limits for disk usage
# It does not work for me, the kernel is not able to mount partitions without.
CONFIG_QUOTA_NETLINK_INTERFACE=y

CONFIG_QFMT_V2=y
CONFIG_NETFILTER_XT_MATCH_MULTIPORT=y
CONFIG_IP_NF_MATCH_RPFILTER=y
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Patch against 1046b86e869d6a77bc1f905b3a61bbd5e5478ee1: TODO&lt;/p&gt;
&lt;h3 id=&#34;include-your-device-in-fixup-mountpoints&#34;&gt;Include your device in fixup-mountpoints&lt;/h3&gt;
&lt;p&gt;Nothing to do, already included.&lt;/p&gt;
&lt;h3 id=&#34;building-the-systemimg-and-hybris-bootimg&#34;&gt;Building the system.img and hybris-boot.img&lt;/h3&gt;
&lt;h4 id=&#34;mka-hybris-boot&#34;&gt;mka hybris-boot&lt;/h4&gt;
&lt;p&gt;Error:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;/usr/bin/ld: scripts/dtc/dtc-parser.tab.o:(.bss+0x50): multiple definition of `yylloc&#39;; scripts/dtc/dtc-lexer.lex.o:(.bss+0x0): first defined here
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Due to a redundant declaration. Let&amp;rsquo;s make it extern in&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;./kernel/samsung/universal8890/scripts/dtc/dtc-lexer.l&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;./kernel/samsung/universal8890/scripts/dtc/dtc-parser.tab.c_shipped&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Error:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;mkbootimg: command not found
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Add it to the system path after compiling it.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;export PATH=./system/core/mkbootimg/:$PATH
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;halium-reference-rootfs&#34;&gt;Halium reference rootfs&lt;/h2&gt;
&lt;h1 id=&#34;flash-halium&#34;&gt;Flash Halium&lt;/h1&gt;
&lt;p&gt;Restart it download mode, flash hybris boot:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;heimdall flash --BOOT out/target/product/herolte/hybris-boot.img
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Install Halium rootfs and system&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;./halium-install -p halium ../halium-rootfs-20170630-151006.tar.gz ../halium/out/target/product/herolte/system.img
&lt;/code&gt;&lt;/pre&gt;&lt;h1 id=&#34;i-gave-up-halium-rootfs&#34;&gt;I gave up Halium rootfs&lt;/h1&gt;
&lt;p&gt;But I did not succeed to make Halium rootfs boot: I had a constant reboot loop.
When I asked on Halium&amp;rsquo;s Telegram channel someone told me that it is a 4 years
old rootfs and I should move on UBports rootfs, so I did :-)&lt;/p&gt;
&lt;h1 id=&#34;ubports&#34;&gt;UBports&lt;/h1&gt;
&lt;p&gt;&lt;a href=&#34;https://www.ubports.com/&#34;&gt;UBports&lt;/a&gt; is a touch-friendly Ubuntu flavor maintained
by a community, since Canonical dropped the
&lt;a href=&#34;https://ubuntu.com/blog/ubuntu-edge&#34;&gt;Edge project&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id=&#34;building-the-images&#34;&gt;Building the images&lt;/h2&gt;
&lt;h3 id=&#34;fix-mount-points&#34;&gt;Fix mount points&lt;/h3&gt;
&lt;p&gt;No edit necessary to the fstab file, found at:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;device/samsung/hero-common/ramdisk/fstab.samsungexynos8890
&lt;/code&gt;&lt;/pre&gt;&lt;h3 id=&#34;fix-defconfig&#34;&gt;Fix defconfig&lt;/h3&gt;
&lt;p&gt;Command:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;./halium/halium-boot/check-kernel-config kernel/samsung/universal8890/arch/arm64/configs/exynos8890-herolte_defconfig -w
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;First time I ran the command:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;Config file checked, found no errors.

 Made 110 fixes.
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Run it again:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;Config file checked, found no errors.

 Made 1 fixes.
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;But the
line&lt;code&gt;CONFIG_DEFAULT_SECURITY is set, but to &amp;quot;selinux&amp;quot; y not &amp;quot;apparmor&amp;quot;.&lt;/code&gt;is never
fixed. Fix it manually with &lt;code&gt;CONFIG_DEFAULT_SECURITY=&amp;quot;apparmor&amp;quot;&lt;/code&gt; then run it
again without the &lt;code&gt;-w&lt;/code&gt; argument:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;Config file checked, found no errors.
&lt;/code&gt;&lt;/pre&gt;&lt;h3 id=&#34;ubuntu-touch-requires-setting-consoletty0&#34;&gt;Ubuntu Touch requires setting console=tty0&lt;/h3&gt;
&lt;p&gt;&lt;code&gt;console=tty0&lt;/code&gt; is already defined in the kernel config file, so nothing required&lt;/p&gt;
&lt;h3 id=&#34;fix-apparmor&#34;&gt;Fix Apparmor&lt;/h3&gt;
&lt;p&gt;I did not try to understand why, but it is recommended in Github issue by and
hoster in UBports Github, so let&amp;rsquo;s do it:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;cd kernel/samsung/universal8890/security/
rm -r apparmor/
wget  https://raw.githubusercontent.com/ubports/apparmor-backports-ut/master/apparmor-3.18.tar.bz2
tar -xf apparmor-3.18.tar.bz2
&lt;/code&gt;&lt;/pre&gt;&lt;h3 id=&#34;build-halium-bootimg-and-systemimg&#34;&gt;Build halium-boot.img and system.img&lt;/h3&gt;
&lt;p&gt;Build as instructed&lt;/p&gt;
&lt;h2 id=&#34;installing-ubports&#34;&gt;Installing UBports&lt;/h2&gt;
&lt;p&gt;As instructed in tge &lt;a href=&#34;https://pad.ubports.com/p/porting-faq&#34;&gt;UBPort FAQ&lt;/a&gt;, use
&lt;code&gt;xenial-hybris-edge-rootfs-arm64&lt;/code&gt; from
&lt;code&gt;https://ci.ubports.com/job/xenial-hybris-edge-rootfs-arm64&lt;/code&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;wget https://ci.ubports.com/job/xenial-hybris-edge-rootfs-arm64/lastStableBuild/artifact/out/ubuntu-touch-hybris-xenial-edge-arm64-rootfs.tar.gz
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Flash boot image il download mode (phone off, long press on power+home+volume
down)&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;./Heimdall/build/bin/heimdall flash --BOOT files/halium-boot.img
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Reboot in recovery, flash system.img+rootfs&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;/halium-install -p ut ../files/ubuntu-touch-hybris-xenial-edge-arm64-rootfs.tar.gz ../files/system.img
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;halium-logging-in&#34;&gt;Halium logging in&lt;/h2&gt;
&lt;h3 id=&#34;wi-fi&#34;&gt;Wi-fi&lt;/h3&gt;
&lt;p&gt;As described &lt;code&gt;nmtui&lt;/code&gt; then select &lt;code&gt;Activate a connection&lt;/code&gt;.&lt;/p&gt;
&lt;h2 id=&#34;ubpots---the-graphical-ui&#34;&gt;UBpots - The graphical UI&lt;/h2&gt;
&lt;h3 id=&#34;udev-rules&#34;&gt;udev rules&lt;/h3&gt;
&lt;pre&gt;&lt;code&gt;sudo -i
cat /var/lib/lxc/android/rootfs/ueventd*.rc|grep ^/dev|sed -e &#39;s/^\/dev\///&#39;|awk &#39;{printf &amp;quot;ACTION==\&amp;quot;add\&amp;quot;, KERNEL==\&amp;quot;%s\&amp;quot;, OWNER=\&amp;quot;%s\&amp;quot;, GROUP=\&amp;quot;%s\&amp;quot;, MODE=\&amp;quot;%s\&amp;quot;\n&amp;quot;,$1,$3,$4,$2}&#39; | sed -e &#39;s/\r//&#39; &amp;gt;/usr/lib/lxc-android-config/70-herolte.rules
&lt;/code&gt;&lt;/pre&gt;&lt;h3 id=&#34;edit-layout-from-github&#34;&gt;Edit layout (From Github)&lt;/h3&gt;
&lt;p&gt;Edit &lt;code&gt;/etc/ubuntu-touch-session.d/android.conf&lt;/code&gt; to add&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;GRID_UNIT_PX=29
QTWEBKIT_DPR=3.0
NATIVE_ORENTATION=portrait
FORM_FACTOR=handset
&lt;/code&gt;&lt;/pre&gt;&lt;h3 id=&#34;add-user-to-update&#34;&gt;Add user to update&lt;/h3&gt;
&lt;p&gt;Step described in Github issue, why?&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;sudo adduser --force-badname --system --home /nonexistent --no-create-home --quiet _apt || true
&lt;/code&gt;&lt;/pre&gt;&lt;h3 id=&#34;install-xenial-fix-dataspace&#34;&gt;Install xenial fix dataspace&lt;/h3&gt;
&lt;p&gt;Again, from Github. Probably linked to the new user creation to update packages&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;sudo ubports-qa install xenial_-_fix-dataspace
sudo ubports-qa remove xenial_-_fix-dataspace
sudo reboot
&lt;/code&gt;&lt;/pre&gt;&lt;h1 id=&#34;step-by-step-with-to-flash-systemimg-and-halium-bootimg-and-boot&#34;&gt;Step by step with to flash system.img and halium-boot.img and boot&lt;/h1&gt;
&lt;p&gt;This step by step guide is working for me, if you have an issue please read the
previous chapter which might help to understand it. In all cases please leave a
comment so I can fix the instructions.&lt;/p&gt;
&lt;h1 id=&#34;backup&#34;&gt;Backup&lt;/h1&gt;
&lt;p&gt;Backup your user data if you want. This process will also create a TWRP backup
for Android itself.&lt;/p&gt;
&lt;h1 id=&#34;install-twrp&#34;&gt;Install TWRP&lt;/h1&gt;
&lt;p&gt;Follow official instructions
&lt;a href=&#34;https://forum.xda-developers.com/t/recovery-exynos-official-twrp-for-galaxy-s7-herolte.3333770/&#34;&gt;https://forum.xda-developers.com/t/recovery-exynos-official-twrp-for-galaxy-s7-herolte.3333770/&lt;/a&gt;&lt;/p&gt;
&lt;h1 id=&#34;setup-ubports&#34;&gt;Setup UBports&lt;/h1&gt;
&lt;h2 id=&#34;reboot-in-recovery&#34;&gt;Reboot in recovery&lt;/h2&gt;
&lt;p&gt;Reboot in recovery, it can be done with &lt;code&gt;adb reboot recovery&lt;/code&gt; or switch off the
phone then &lt;code&gt;power&lt;/code&gt; + &lt;code&gt;volume down&lt;/code&gt; + &lt;code&gt;home&lt;/code&gt; keys.&lt;/p&gt;
&lt;h2 id=&#34;twrp-backup-optional&#34;&gt;TWRP backup (optional)&lt;/h2&gt;
&lt;p&gt;If you want to be able to easily switch back to Android backup:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;boot&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;system&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;data&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;format-data-partition&#34;&gt;Format data partition&lt;/h2&gt;
&lt;p&gt;In TWRP:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Touch &lt;code&gt;Wipe&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Touch &lt;code&gt;Format Data&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Enter &lt;code&gt;yes&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Go back to home menu thanks to the home button&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id=&#34;flash-the-boot-and-file-system-to-the-device&#34;&gt;Flash the boot and file system to the device&lt;/h2&gt;
&lt;p&gt;Still in TWRP:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Clone &lt;a href=&#34;https://gitlab.com/JBBgameich/halium-install&#34;&gt;Halium install&lt;/a&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Download
&lt;a href=&#34;https://ci.ubports.com/job/xenial-rootfs-armhf/lastSuccessfulBuild/artifact/out/ubports-touch.rootfs-xenial-armhf.tar.gz&#34;&gt;UBports rootfs&lt;/a&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;With sudo, or as root:
&lt;code&gt;./halium-install -v -p ut ./path/to/ubports-touch.rootfs-xenial-armhf.tar.gz ./path/to/system.img&lt;/code&gt;
Note add &lt;code&gt;-i&lt;/code&gt; if your want to have your &lt;code&gt;id_rsa.pub&lt;/code&gt; key copied&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Enter the password for the phone&amp;rsquo;s new user.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;When finished, then reboot in download mode. In TWRP:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Touch &lt;code&gt;reboot&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Touch &lt;code&gt;Download&lt;/code&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Download and compile &lt;a href=&#34;https://gitlab.com/BenjaminDobell/Heimdall&#34;&gt;Heimdall&lt;/a&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Once in Download mode, flash the bootloader with
&lt;code&gt;heimdall flash --BOOT ./path/to/files/halium-boot.img&lt;/code&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;The phone will reboot, &lt;code&gt;Unity&lt;/code&gt; will appear, the screen goes back, the phone
restarts then &lt;code&gt;Unity&lt;/code&gt; hangs. It is expected, then&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Enter &lt;code&gt;ip address show&lt;/code&gt; in a terminal, it should make display a new
interface. Mine returns:&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;pre&gt;&lt;code&gt;9: enp0s20u2: &amp;lt;BROADCAST,MULTICAST&amp;gt; mtu 1500 qdisc noop state DOWN group default qlen 1000
    link/ether 00:00:00:00:00:00 brd ff:ff:ff:ff:ff:ff
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;So the new interface name is &lt;code&gt;enp0s20u2&lt;/code&gt;&lt;/p&gt;
&lt;ol start=&#34;7&#34;&gt;
&lt;li&gt;
&lt;p&gt;Download helpers files from &lt;a href=&#34;https://github.com/Oliv4945/uports-herolte-helpers&#34;&gt;Github&lt;/a&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Run the script to setup the connection, send required files to the phone and
connect to it: &lt;code&gt;bash helper-install-host.sh interface_name&lt;/code&gt;. Ex:
&lt;code&gt;bash helper-install-host.sh enp0s20u2&lt;/code&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;You should obtain a terminal on: &lt;code&gt;phablet@ubuntu-phablet:~$&lt;/code&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Setup Wi-Fi thanks to:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Enter &lt;code&gt;nmtui&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Select &lt;code&gt;Activate a connection&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Select your SSID&lt;/li&gt;
&lt;li&gt;Enter your Wi-Fi password&lt;/li&gt;
&lt;li&gt;Push &lt;code&gt;tab&lt;/code&gt; to select &lt;code&gt;&amp;lt;Quit&amp;gt;&lt;/code&gt; then &lt;code&gt;enter&lt;/code&gt; to exit&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Start the configuration script thanks to &lt;code&gt;bash helper-install-phone.sh&lt;/code&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Answer &lt;code&gt;y&lt;/code&gt; when prompted (twice)&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;The phone should reboot, then you are in! :-)&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>Wireguard and Pi-hole in Docker containers</title>
      <link>https://notes.iopush.net/blog/2020/wireguard-and-pi-hole-in-docker/</link>
      <pubDate>Wed, 18 Nov 2020 21:32:24 +0000</pubDate>
      
      <guid>https://notes.iopush.net/blog/2020/wireguard-and-pi-hole-in-docker/</guid>
      <description>&lt;p&gt;I had to move my previous Wireguard VPN + Pi-hole ad blocker to another server,
but this time I was not able to expose Pi-hole DNS port (53) to the host
machine. It was also better to have Wireguard VPN inside a Docker container&amp;hellip;
so I did!&lt;/p&gt;
&lt;p&gt;As a reminder, Wireguard is a stateless and easy to configure VPN: share a pair
of public keys between the client(s) and server then you are good to go!
Moreover, stateless is great when used from a phone as there is no power-hungry
keep-alive like OpenVPN, nor reconnection time when switching from Wi-FI to 4G.&lt;/p&gt;
&lt;h2 id=&#34;dns-address-issue&#34;&gt;DNS address issue&lt;/h2&gt;
&lt;p&gt;The main issue I had is the way to provide Pi-hole address to Wireguard
container: &lt;code&gt;docker-compose&lt;/code&gt; does
&lt;a href=&#34;https://github.com/docker/compose/issues/6180&#34;&gt;not yet&lt;/a&gt; accept do translate a
container name in &lt;code&gt;dns&lt;/code&gt; section. The easiest workaround is to set a fixed IP for
the Pi-hole container, not pretty, but hey&amp;hellip; it works :-)Then both services
must be in the same &lt;code&gt;docker-compose.yml&lt;/code&gt; file to avoid any issue related to a
network race condition when the docker daemon restarts.&lt;/p&gt;
&lt;h2 id=&#34;pi-hole&#34;&gt;Pi-hole&lt;/h2&gt;
&lt;p&gt;Pi-Hole configuration is straightforward and well documented on their
&lt;a href=&#34;https://hub.docker.com/r/pihole/pihole&#34;&gt;Docker Hub page&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id=&#34;wireguard&#34;&gt;Wireguard&lt;/h2&gt;
&lt;p&gt;Instead of creating my own Dockerfile I used the image from
&lt;a href=&#34;https://github.com/linuxserver/docker-wireguard/&#34;&gt;linuxserver.io&lt;/a&gt;, which has
been beautifully implemented. Then
&lt;a href=&#34;https://hub.docker.com/r/linuxserver/wireguard&#34;&gt;follow the documentation&lt;/a&gt;.
Thanks to Wireguard&amp;rsquo;s QR Code feature, the phone setup is dumb-proof: just scan
it from the container&amp;rsquo;s logs.&lt;/p&gt;
&lt;h2 id=&#34;docker-compose-file&#34;&gt;docker-compose file&lt;/h2&gt;
&lt;p&gt;The resulting &lt;code&gt;docker-compose&lt;/code&gt; file is:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-yaml&#34; data-lang=&#34;yaml&#34;&gt;&lt;span style=&#34;color:#f92672&#34;&gt;version&lt;/span&gt;: &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;3.5&amp;#34;&lt;/span&gt;

&lt;span style=&#34;color:#f92672&#34;&gt;services&lt;/span&gt;:
  &lt;span style=&#34;color:#f92672&#34;&gt;wireguard&lt;/span&gt;:
    &lt;span style=&#34;color:#f92672&#34;&gt;image&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;linuxserver/wireguard&lt;/span&gt;
    &lt;span style=&#34;color:#f92672&#34;&gt;depends_on&lt;/span&gt;:
      - &lt;span style=&#34;color:#ae81ff&#34;&gt;pihole&lt;/span&gt;
    &lt;span style=&#34;color:#f92672&#34;&gt;dns&lt;/span&gt;:
      - &lt;span style=&#34;color:#ae81ff&#34;&gt;172.29.0.2&lt;/span&gt;
    &lt;span style=&#34;color:#f92672&#34;&gt;cap_add&lt;/span&gt;:
      - &lt;span style=&#34;color:#ae81ff&#34;&gt;NET_ADMIN&lt;/span&gt;
      - &lt;span style=&#34;color:#ae81ff&#34;&gt;SYS_MODULE&lt;/span&gt;
    &lt;span style=&#34;color:#f92672&#34;&gt;sysctls&lt;/span&gt;:
      - &lt;span style=&#34;color:#ae81ff&#34;&gt;net.ipv4.conf.all.src_valid_mark=1&lt;/span&gt;
    &lt;span style=&#34;color:#f92672&#34;&gt;restart&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;unless-stopped&lt;/span&gt;
    &lt;span style=&#34;color:#f92672&#34;&gt;volumes&lt;/span&gt;:
      - &lt;span style=&#34;color:#ae81ff&#34;&gt;../../data/wireguard:/config&lt;/span&gt;
      - &lt;span style=&#34;color:#ae81ff&#34;&gt;/lib/modules:/lib/modules&lt;/span&gt;
    &lt;span style=&#34;color:#f92672&#34;&gt;ports&lt;/span&gt;:
      - &lt;span style=&#34;color:#ae81ff&#34;&gt;51820&lt;/span&gt;:&lt;span style=&#34;color:#ae81ff&#34;&gt;51820&lt;/span&gt;&lt;span style=&#34;color:#ae81ff&#34;&gt;/udp&lt;/span&gt;
    &lt;span style=&#34;color:#f92672&#34;&gt;environment&lt;/span&gt;:
      - &lt;span style=&#34;color:#ae81ff&#34;&gt;TZ=Europe/Paris&lt;/span&gt;
      - &lt;span style=&#34;color:#ae81ff&#34;&gt;SERVERURL=host_server.yourdomain.com&lt;/span&gt;
      - &lt;span style=&#34;color:#ae81ff&#34;&gt;SERVERPORT=1194&lt;/span&gt;
      - &lt;span style=&#34;color:#ae81ff&#34;&gt;PEERS=Android_phone&lt;/span&gt;
    &lt;span style=&#34;color:#f92672&#34;&gt;networks&lt;/span&gt;:
      - &lt;span style=&#34;color:#ae81ff&#34;&gt;network-pihole&lt;/span&gt;

  &lt;span style=&#34;color:#f92672&#34;&gt;pihole&lt;/span&gt;:
    &lt;span style=&#34;color:#f92672&#34;&gt;image&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;pihole/pihole:latest&lt;/span&gt;
    &lt;span style=&#34;color:#f92672&#34;&gt;volumes&lt;/span&gt;:
      - &lt;span style=&#34;color:#ae81ff&#34;&gt;../../data/pi-hole/etc/:/etc/pihole/&lt;/span&gt;
      - &lt;span style=&#34;color:#ae81ff&#34;&gt;../../data/pi-hole/dnsmasq.d:/etc/dnsmasq.d&lt;/span&gt;
    &lt;span style=&#34;color:#f92672&#34;&gt;environment&lt;/span&gt;:
      &lt;span style=&#34;color:#f92672&#34;&gt;TZ&lt;/span&gt;: &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;Europe/Paris&amp;#34;&lt;/span&gt;
      &lt;span style=&#34;color:#f92672&#34;&gt;PROXY_LOCATION&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;pihole&lt;/span&gt;
      &lt;span style=&#34;color:#f92672&#34;&gt;VIRTUAL_HOST&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;pihole.yourdomain.com&lt;/span&gt;
      &lt;span style=&#34;color:#f92672&#34;&gt;VIRTUAL_PORT&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;80&lt;/span&gt;
      &lt;span style=&#34;color:#f92672&#34;&gt;LETSENCRYPT_EMAIL&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;email@yourdomain.com&lt;/span&gt;
      &lt;span style=&#34;color:#f92672&#34;&gt;LETSENCRYPT_HOST&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;pihole.yourdomain.com&lt;/span&gt;
    &lt;span style=&#34;color:#f92672&#34;&gt;restart&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;unless-stopped&lt;/span&gt;
    &lt;span style=&#34;color:#f92672&#34;&gt;networks&lt;/span&gt;:
      &lt;span style=&#34;color:#f92672&#34;&gt;network-pihole&lt;/span&gt;:
        &lt;span style=&#34;color:#f92672&#34;&gt;ipv4_address&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;172.29.0.2&lt;/span&gt;

&lt;span style=&#34;color:#f92672&#34;&gt;networks&lt;/span&gt;:
  &lt;span style=&#34;color:#f92672&#34;&gt;network-pihole&lt;/span&gt;:
    &lt;span style=&#34;color:#f92672&#34;&gt;name&lt;/span&gt;: &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;dns-pihole&amp;#34;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;</description>
    </item>
    
    <item>
      <title>How to compile KiCad 5.1.x for Debian 10</title>
      <link>https://notes.iopush.net/blog/2019/how-to-compile-kicad-5-1-x-for-debian-10/</link>
      <pubDate>Tue, 13 Aug 2019 19:39:24 +0000</pubDate>
      
      <guid>https://notes.iopush.net/blog/2019/how-to-compile-kicad-5-1-x-for-debian-10/</guid>
      <description>&lt;p&gt;I was looking to use &lt;a href=&#34;https://github.com/openscopeproject/InteractiveHtmlBom/&#34;&gt;InteractiveHtmlBom&lt;/a&gt; plugin for KiCad but unfortunately, Debian maintainers did not set &lt;code&gt;KICAD_SCRIPTING&lt;/code&gt; option in the official package. After a few failing attempts I even tested the official &lt;a href=&#34;http://kicad-pcb.org/download/flatpak/&#34;&gt;flatpak&lt;/a&gt; package but it is an old version (currently 4.x) and scripting is not enabled too.&lt;/p&gt;
&lt;p&gt;So I dug further until it actually succeeds to compile :-)&lt;/p&gt;
    
    
        
        
        
        
    

    
    
    

    
    







  


    

    
        &lt;p&gt;&lt;span class=&#34;image center&#34;&gt;
            &lt;img src=&#34;https://notes.iopush.net/blog/2019/how-to-compile-kicad-5-1-x-for-debian-10/kicad-interactive-html-bom.png&#34; alt=&#34;Pellet stove&#34;&gt;
        &lt;/span&gt;&lt;/p&gt;
        &lt;p&gt;&lt;div class=&#34;align-center&#34; style=&#34;font-weight: bold;&#34;&gt;
            Pellet stove
        &lt;/div&gt;&lt;/p&gt;
    


&lt;p&gt;Here is the thing: KiCad official documentation still recommend packages for python2, and v5.1.4 is &lt;a href=&#34;https://forum.kicad.info/t/building-on-debian-10-buster/17954/3&#34;&gt;not compatible&lt;/a&gt; with new versions of &lt;code&gt;libglm-dev&lt;/code&gt; if compiled with GCC; this is now &lt;a href=&#34;https://git.launchpad.net/kicad/commit/?id=5aa48e523dd46632564d3a118921f6c1f02abc2f&#34;&gt;fixed in master&lt;/a&gt;. So the commands I used are:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span style=&#34;color:#75715e&#34;&gt;# From http://kicad-pcb.org/download/debian/ without Python2 packages&lt;/span&gt;
apt install cmake doxygen libboost-context-dev &lt;span style=&#34;color:#ae81ff&#34;&gt;\
&lt;/span&gt;&lt;span style=&#34;color:#ae81ff&#34;&gt;&lt;/span&gt;  libboost-dev libboost-system-dev libboost-test-dev &lt;span style=&#34;color:#ae81ff&#34;&gt;\
&lt;/span&gt;&lt;span style=&#34;color:#ae81ff&#34;&gt;&lt;/span&gt;  libcairo2-dev libcurl4-openssl-dev libgl1-mesa-dev &lt;span style=&#34;color:#ae81ff&#34;&gt;\
&lt;/span&gt;&lt;span style=&#34;color:#ae81ff&#34;&gt;&lt;/span&gt;  libglew-dev libglm-dev libngspice-dev &lt;span style=&#34;color:#ae81ff&#34;&gt;\
&lt;/span&gt;&lt;span style=&#34;color:#ae81ff&#34;&gt;&lt;/span&gt;  liboce-foundation-dev liboce-ocaf-dev libssl-dev &lt;span style=&#34;color:#ae81ff&#34;&gt;\
&lt;/span&gt;&lt;span style=&#34;color:#ae81ff&#34;&gt;&lt;/span&gt;  libwxbase3.0-dev libwxgtk3.0-dev swig wx-common

&lt;span style=&#34;color:#75715e&#34;&gt;# Add Debian Buster/Python3 required packages&lt;/span&gt;
apt install python3-wxgtk4.0 libwxgtk3.0-gtk3-dev &lt;span style=&#34;color:#ae81ff&#34;&gt;\
&lt;/span&gt;&lt;span style=&#34;color:#ae81ff&#34;&gt;&lt;/span&gt;  libboost-filesystem-dev python3-dev

&lt;span style=&#34;color:#75715e&#34;&gt;# Add KiCad libraries&lt;/span&gt;
apt install kicad-libraries kicad-packages3d --no-install-recommends

&lt;span style=&#34;color:#75715e&#34;&gt;# Downgrade libdlm-dev - For 5.1.4 or older only&lt;/span&gt;
apt remove libglm-dev
wget http://ftp.us.debian.org/debian/pool/main/g/glm/libglm-dev_0.9.8.3-3_all.deb
dpkg -i libglm-dev_0.9.8.3-3_all.deb

&lt;span style=&#34;color:#75715e&#34;&gt;# Clone and build KiCad&lt;/span&gt;
git clone https://git.launchpad.net/kicad
mkdir -p kicad/build/release
cd kicad/build/release
cmake -DCMAKE_BUILD_TYPE&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;Release &lt;span style=&#34;color:#ae81ff&#34;&gt;\
&lt;/span&gt;&lt;span style=&#34;color:#ae81ff&#34;&gt;&lt;/span&gt;  -DKICAD_SCRIPTING_ACTION_MENU&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;ON &lt;span style=&#34;color:#ae81ff&#34;&gt;\
&lt;/span&gt;&lt;span style=&#34;color:#ae81ff&#34;&gt;&lt;/span&gt;  -DwxWidgets_CONFIG_OPTIONS&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;--toolkit=gtk3&amp;#34;&lt;/span&gt; &lt;span style=&#34;color:#ae81ff&#34;&gt;\
&lt;/span&gt;&lt;span style=&#34;color:#ae81ff&#34;&gt;&lt;/span&gt;  -DKICAD_SCRIPTING_WXPYTHON_PHOENIX&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;ON &lt;span style=&#34;color:#ae81ff&#34;&gt;\
&lt;/span&gt;&lt;span style=&#34;color:#ae81ff&#34;&gt;&lt;/span&gt;  -DKICAD_SCRIPTING_PYTHON3&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;ON &lt;span style=&#34;color:#ae81ff&#34;&gt;\
&lt;/span&gt;&lt;span style=&#34;color:#ae81ff&#34;&gt;&lt;/span&gt;  -DwxWidgets_CONFIG_EXECUTABLE&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;/usr/bin/wx-config&amp;#39;&lt;/span&gt; &lt;span style=&#34;color:#ae81ff&#34;&gt;\
&lt;/span&gt;&lt;span style=&#34;color:#ae81ff&#34;&gt;&lt;/span&gt;  ../..
make -j
make install
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Now you can use InteractiveHtmlBom which is really pleasant for big boards!&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>Thinkpad T440p &amp; fingerprint sensor under Linux</title>
      <link>https://notes.iopush.net/blog/2019/thinkpad-t440p-fingerprint/</link>
      <pubDate>Fri, 10 May 2019 18:38:19 +0000</pubDate>
      
      <guid>https://notes.iopush.net/blog/2019/thinkpad-t440p-fingerprint/</guid>
      <description>&lt;p&gt;There are a lot of pages stating that the Thinkpad T440p fingerprint sensor is
not working well under Linux, but those are old and outdated. For me it worked
well after figured out which packets to install:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;apt-get install libfprint fprintd libfprintd
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The package &lt;code&gt;fprint-demo&lt;/code&gt; can also be installed to play with the sensor.&lt;/p&gt;
&lt;p&gt;Then to enable login with the sensor in Gnome3, navigate to&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;code&gt;Users&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Select &lt;code&gt;Enable&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Enroll you finger.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Tested under Debian Buster Buster, fingerprint sensor model is &lt;code&gt;vfs5011&lt;/code&gt;.&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>Setup Pi-Hole &amp; WireGuard VPN on smartphone</title>
      <link>https://notes.iopush.net/blog/2018/setup-pi-hole-wireguard-vpn-on-smartphone/</link>
      <pubDate>Tue, 25 Dec 2018 12:46:52 +0000</pubDate>
      
      <guid>https://notes.iopush.net/blog/2018/setup-pi-hole-wireguard-vpn-on-smartphone/</guid>
      <description>&lt;p&gt;&lt;a href=&#34;https://www.wireguard.com/&#34;&gt;WireGuard&lt;/a&gt; is a new VPN software, which is
described as
&lt;code&gt;It aims to be faster, simpler, leaner, and more useful than IPSec, while avoiding the massive headache and using state-of-the-art cryptography&lt;/code&gt;.
&lt;a href=&#34;https://pi-hole.net/&#34;&gt;Pi-hole&lt;/a&gt; is &lt;code&gt;a black hole for Internet advertisements&lt;/code&gt;,
ie a server blocking advertisements at DNS level.&lt;/p&gt;
&lt;p&gt;I have Pi-hole on my home network but wanted to have it also as DNS server on my
phone when I am not at home. As I have a bad DSL connection, I can not rely on
my home server. So I put Pi-hole on a VPS server I rent: it works, flawlessly.&lt;br&gt;
Nevertheless, it was an open DNS resolver, which can be used to
&lt;a href=&#34;https://www.us-cert.gov/ncas/alerts/TA13-088A&#34;&gt;amplify DDoS attacks&lt;/a&gt;; there is
already &lt;a href=&#34;https://www.shodan.io/search?query=pi-hole&#34;&gt;2212 unsecured Pi-hole&lt;/a&gt; on
the Internet, so I do not want to add another one.&lt;/p&gt;
&lt;p&gt;Pi-hole provides &lt;a href=&#34;https://docs.pi-hole.net/guides/vpn/overview/&#34;&gt;documentation&lt;/a&gt;
to use OpenVPN, even to redirect
&lt;a href=&#34;https://docs.pi-hole.net/guides/vpn/only-dns-via-vpn/&#34;&gt;only DNS requests&lt;/a&gt; but
it is not efficient on a phone as it is not a stateless connection, so it
consumes battery; moreover, GSM/Wifi switch is not really handled, you have to
reconnect. The solution comes from WireGuard which is stateless, and provides
&lt;a href=&#34;https://play.google.com/store/apps/details?id=com.wireguard.android&amp;amp;hl=en_US&#34;&gt;Android&lt;/a&gt;
&amp;amp; &lt;a href=&#34;https://git.zx2c4.com/wireguard-ios&#34;&gt;iOS&lt;/a&gt; apps. I struggle to configure
everything, so here is what I did:&lt;/p&gt;
&lt;h1 id=&#34;configuration&#34;&gt;Configuration&lt;/h1&gt;
&lt;h2 id=&#34;pi-hole-in-docker-container&#34;&gt;Pi-Hole in Docker container&lt;/h2&gt;
&lt;p&gt;Pi-holes provides a [convenient Docker]https://hub.docker.com/r/pihole/pihole/)
container so it is easy to build a Docker-compose file on top.&lt;/p&gt;
&lt;p&gt;Here is an example, as there are already other Docker services serving on ports
&lt;code&gt;80&lt;/code&gt; and &lt;code&gt;443&lt;/code&gt; through
&lt;a href=&#34;https://github.com/jwilder/nginx-proxy&#34;&gt;jwilder container&lt;/a&gt; providing reverse
proxy, so I add this container to the same network. Pi-hole also recommends to
have it as default on the machine in order to replace adds with white pages, it
helps to keep pages layout, so jwilder&amp;rsquo;s Docker environment variable
&lt;code&gt;DEFAULT_HOST&lt;/code&gt; should be set to Pi-hole&amp;rsquo;s &lt;code&gt;VIRTUAL_HOST&lt;/code&gt; value. If you do not
use jwilder container just delete &lt;code&gt;VIRTUAL_HOST&lt;/code&gt;, &lt;code&gt;VIRTUAL_PORT&lt;/code&gt;, and &lt;code&gt;networks&lt;/code&gt;
related options.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-yaml&#34; data-lang=&#34;yaml&#34;&gt;&lt;span style=&#34;color:#f92672&#34;&gt;version&lt;/span&gt;: &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;3.5&amp;#34;&lt;/span&gt;

&lt;span style=&#34;color:#f92672&#34;&gt;services&lt;/span&gt;:
  &lt;span style=&#34;color:#f92672&#34;&gt;pihole&lt;/span&gt;:
    &lt;span style=&#34;color:#f92672&#34;&gt;image&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;pihole/pihole:latest&lt;/span&gt;
    &lt;span style=&#34;color:#f92672&#34;&gt;dns&lt;/span&gt;:
      - &lt;span style=&#34;color:#ae81ff&#34;&gt;127.0.0.1&lt;/span&gt;
      - &lt;span style=&#34;color:#ae81ff&#34;&gt;1.1.1.1&lt;/span&gt;
    &lt;span style=&#34;color:#f92672&#34;&gt;ports&lt;/span&gt;:
      - &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;127.0.0.1:53:53/tcp&amp;#34;&lt;/span&gt;
      - &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;127.0.0.1:53:53/udp&amp;#34;&lt;/span&gt;
      &lt;span style=&#34;color:#75715e&#34;&gt;# Adapt to WireGuard interface&lt;/span&gt;
      - &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;192.168.2.1:53:53/tcp&amp;#34;&lt;/span&gt;
      - &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;192.168.2.1:53:53/udp&amp;#34;&lt;/span&gt;
    &lt;span style=&#34;color:#f92672&#34;&gt;volumes&lt;/span&gt;:
      &lt;span style=&#34;color:#75715e&#34;&gt;# Adapt to folders&lt;/span&gt;
      - &lt;span style=&#34;color:#ae81ff&#34;&gt;../../data/pi-hole/etc:/etc/pihole/&lt;/span&gt;
      - &lt;span style=&#34;color:#ae81ff&#34;&gt;../../data/pi-hole/dnsmasq.d:/etc/dnsmasq.d&lt;/span&gt;
    &lt;span style=&#34;color:#f92672&#34;&gt;networks&lt;/span&gt;:
      - &lt;span style=&#34;color:#ae81ff&#34;&gt;network-proxy&lt;/span&gt;
    &lt;span style=&#34;color:#f92672&#34;&gt;environment&lt;/span&gt;:
      &lt;span style=&#34;color:#75715e&#34;&gt;# Adapt to server IP address&lt;/span&gt;
      &lt;span style=&#34;color:#f92672&#34;&gt;ServerIP&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;X.X.X.X&lt;/span&gt;
      &lt;span style=&#34;color:#f92672&#34;&gt;PROXY_LOCATION&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;pihole&lt;/span&gt;
      &lt;span style=&#34;color:#75715e&#34;&gt;# Adapt to domain&lt;/span&gt;
      &lt;span style=&#34;color:#f92672&#34;&gt;VIRTUAL_HOST&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;pihole.YOURDOMAIN.ext&lt;/span&gt;
      &lt;span style=&#34;color:#f92672&#34;&gt;VIRTUAL_PORT&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;80&lt;/span&gt;
    &lt;span style=&#34;color:#f92672&#34;&gt;extra_hosts&lt;/span&gt;:
      &lt;span style=&#34;color:#75715e&#34;&gt;# Resolve to nothing domains (terminate connection)&lt;/span&gt;
      &lt;span style=&#34;color:#75715e&#34;&gt;#  &amp;#39;nw2master.bioware.com nwn2.master.gamespy.com:0.0.0.0&amp;#39;&lt;/span&gt;
      &lt;span style=&#34;color:#75715e&#34;&gt;# LAN hostnames for other docker containers using jwilder&lt;/span&gt;
      - &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;pihole pihole.yourDomain.lan:5.135.166.67&amp;#34;&lt;/span&gt;
    &lt;span style=&#34;color:#f92672&#34;&gt;restart&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;unless-stopped&lt;/span&gt;

&lt;span style=&#34;color:#f92672&#34;&gt;networks&lt;/span&gt;:
  &lt;span style=&#34;color:#f92672&#34;&gt;network-proxy&lt;/span&gt;:
    &lt;span style=&#34;color:#f92672&#34;&gt;name&lt;/span&gt;: &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;https-proxy&amp;#34;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id=&#34;wireguard&#34;&gt;WireGuard&lt;/h2&gt;
&lt;h3 id=&#34;server&#34;&gt;Server&lt;/h3&gt;
&lt;p&gt;WireGuard configuration was more difficult. My server is running Debian 9 where
Debian
&lt;a href=&#34;https://wiki.debian.org/Wireguard#Step_2_-_Alternative_C_-_systemd&#34;&gt;systemd documentation&lt;/a&gt;
can not be used as the version is too old, and I never found out why regular
documentation was failing with &lt;code&gt;wg-quick&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;So I had to use the old &lt;code&gt;/etc/network/interfaces&lt;/code&gt; file. Replace eth0 with your
&amp;ldquo;main&amp;rdquo; interface.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;auto wg0
iface wg0 inet static
        address 192.168.200.1
        netmask 255.255.255.0
        pre-up ip link add $IFACE type wireguard
        pre-up wg setconf $IFACE /etc/wireguard/$IFACE.conf
        pre-up iptables -A FORWARD -i wg0 -j ACCEPT; iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE;
        post-down iptables -D FORWARD -i wg0 -j ACCEPT; iptables -t nat -D POSTROUTING -o eth0 -j MASQUERADE;
        post-down ip link del $IFACE
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Now we have to configure WireGuard itself in &lt;code&gt;/etc/wireguard/wg0.conf&lt;/code&gt;, where
wg0 is WireGuard interface name:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;[Interface]
ListenPort = 8124
PrivateKey = REPLACE_WITH_YOUR_PRIVATE_KEY

[Peer]
PublicKey = REPLACE_WITH_CLIENT_PUBLIC_KEY_GENERATED_AFTER
AllowedIPs = 0.0.0.0/0
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Server keys are generated as
&lt;a href=&#34;https://www.wireguard.com/quickstart/&#34;&gt;per documentation&lt;/a&gt;:
&lt;code&gt;wg genkey | tee privatekey | wg pubkey &amp;gt; publickey&lt;/code&gt; Then route should be added:
&lt;code&gt;ip route add 192.168.2.2/32 dev wg0&lt;/code&gt;&lt;/p&gt;
&lt;h3 id=&#34;android-client&#34;&gt;Android client&lt;/h3&gt;
&lt;ol&gt;
&lt;li&gt;Generate public/private key thanks to &lt;code&gt;GENERATE&lt;/code&gt; button&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Interface-&amp;gt;Addresses&lt;/code&gt; is client IP address. ex: &lt;code&gt;192.168.200.2&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Interface-&amp;gt;Listen port&lt;/code&gt; is the same than &lt;code&gt;wg0.conf&lt;/code&gt;. ex: &lt;code&gt;8124&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Interface-&amp;gt;DNS servers&lt;/code&gt; is your server WireGuard IP. ex: &lt;code&gt;192.168.200.1&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Peer-&amp;gt;Public key&lt;/code&gt; is the server&amp;rsquo;s public key&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Allowed IP&lt;/code&gt; should be serverIp/24 but I do not know why it forwards only DNS
queries to the server. Putting &lt;code&gt;0.0.0.0/0&lt;/code&gt; makes it work, I have to figure
out why.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Endpoint&lt;/code&gt; is server public IP address:port. ex: &lt;code&gt;X.X.X.X:8124&lt;/code&gt;&lt;/li&gt;
&lt;/ol&gt;</description>
    </item>
    
    <item>
      <title>Linux/Gnome - Associate an application with a filetype</title>
      <link>https://notes.iopush.net/blog/2018/linux-gnome-associate-an-application-with-filetype/</link>
      <pubDate>Fri, 05 Jan 2018 20:36:57 +0000</pubDate>
      
      <guid>https://notes.iopush.net/blog/2018/linux-gnome-associate-an-application-with-filetype/</guid>
      <description>&lt;p&gt;I lost some time figuring out how to associate &amp;ldquo;.stl&amp;rdquo; extensions with Slic3r.
Gnome wrote a
&lt;a href=&#34;https://help.gnome.org/admin/system-admin-guide/stable/mime-types.html.en&#34;&gt;good documentation&lt;/a&gt;
but it is not obvious to find. I did not use the package manager for that because
I wanted the up to date &lt;a href=&#34;https://en.wikipedia.org/wiki/AppImage&#34;&gt;AppImage&lt;/a&gt;.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Create &lt;code&gt;/usr/share/mime/packages/slic3r.xml&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-XML&#34; data-lang=&#34;XML&#34;&gt;&lt;span style=&#34;color:#75715e&#34;&gt;&amp;lt;?xml version=&amp;#34;1.0&amp;#34;?&amp;gt;&lt;/span&gt;
&lt;span style=&#34;color:#f92672&#34;&gt;&amp;lt;mime-info&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;xmlns=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;http://www.freedesktop.org/standards/shared-mime-info&amp;#39;&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;&amp;gt;&lt;/span&gt;
  &lt;span style=&#34;color:#f92672&#34;&gt;&amp;lt;mime-type&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;type=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;application/octet-stream&amp;#34;&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;&amp;gt;&lt;/span&gt;
    &lt;span style=&#34;color:#f92672&#34;&gt;&amp;lt;glob&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;pattern=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;*.stl&amp;#34;&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;/&amp;gt;&lt;/span&gt;
  &lt;span style=&#34;color:#f92672&#34;&gt;&amp;lt;/mime-type&amp;gt;&lt;/span&gt;
&lt;span style=&#34;color:#f92672&#34;&gt;&amp;lt;/mime-info&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;ul&gt;
&lt;li&gt;Create &lt;code&gt;/usr/share/applications/slic3r.desktop&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span style=&#34;color:#f92672&#34;&gt;[&lt;/span&gt;Desktop Entry&lt;span style=&#34;color:#f92672&#34;&gt;]&lt;/span&gt;
Version&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;1.0
Type&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;Application
Name&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;Slic3r
Icon&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;/opt/AppImages/icons/Slic3r.ico
Exec&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;Slic3r
Path&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;/opt/AppImages/
NoDisplay&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;false
Categories&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;3DGraphics;Utility;
StartupNotify&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;false
Terminal&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;false
MimeType&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;application/octet-stream
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;</description>
    </item>
    
    <item>
      <title>How to setup an OpenWrt repository</title>
      <link>https://notes.iopush.net/blog/2017/how-to-setup-an-openwrt-repo/</link>
      <pubDate>Thu, 13 Jul 2017 18:29:37 +0000</pubDate>
      
      <guid>https://notes.iopush.net/blog/2017/how-to-setup-an-openwrt-repo/</guid>
      <description>&lt;p&gt;I recently wanted to setup a repository for some custom OpenWrt packages for
Respeaker. It seems that it is not so well documented, or at least, I did not
found it and I have been helped on
&lt;a href=&#34;https://forum.openwrt.org/viewtopic.php?pid=357835&#34;&gt;OpenWrt forum&lt;/a&gt;. Also, it is
better to sign packages so&amp;hellip;here we go!&lt;/p&gt;
&lt;h3 id=&#34;prepare-the-repository&#34;&gt;Prepare the repository&lt;/h3&gt;
&lt;ol&gt;
&lt;li&gt;Compile and install &lt;code&gt;usign&lt;/code&gt; from &lt;a href=&#34;https://github.com/xypron/usign&#34;&gt;here&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Generate key thanks to: &lt;code&gt;usign -G -p openWrtUsign.pub -s openWrtUsign.key&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Put the following script in the IPK directory.&lt;/li&gt;
&lt;li&gt;Make it executable: &lt;code&gt;chmod +x repoUpdate.sh&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Execute it: &lt;code&gt;./repoUpdate.sh&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Copy the whole directory and &lt;code&gt;openWrtUsign.pub&lt;/code&gt; to a webserver.&lt;/li&gt;
&lt;li&gt;Done!&lt;/li&gt;
&lt;/ol&gt;
&lt;h3 id=&#34;add-key-and-install-packages-on-the-target&#34;&gt;Add key and install packages on the target&lt;/h3&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span style=&#34;color:#75715e&#34;&gt;# Add the public key&lt;/span&gt;
wget http://youserver.ext/path/to/openWrtUsign.pub
opkg-key add openWrtUsign.pub
opkg update

&lt;span style=&#34;color:#75715e&#34;&gt;# Install package&lt;/span&gt;
opkg install newPackage
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id=&#34;manifest-generation-script&#34;&gt;Manifest generation script&lt;/h3&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span style=&#34;color:#75715e&#34;&gt;#!/bin/bash
&lt;/span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;&lt;/span&gt;
SCRIPT&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;../../../../scripts/ipkg-make-index.sh&amp;#34;&lt;/span&gt;
KEY&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;../openWrtUsign.key&amp;#34;&lt;/span&gt;

&lt;span style=&#34;color:#75715e&#34;&gt;# Generates package manifest&lt;/span&gt;
$SCRIPT . 2&amp;gt;/dev/null &amp;gt; Packages.manifest
grep -vE &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;^(Maintainer|LicenseFiles|Source|Require)&amp;#39;&lt;/span&gt; Packages.manifest &amp;gt; Packages
gzip -9nc Packages &amp;gt; Packages.gz
usign -S -m Packages -s $KEY
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;</description>
    </item>
    
    <item>
      <title>ioPush-App</title>
      <link>https://notes.iopush.net/projects/iopush-app/</link>
      <pubDate>Wed, 27 Jan 2016 00:00:00 +0000</pubDate>
      
      <guid>https://notes.iopush.net/projects/iopush-app/</guid>
      <description>&lt;p&gt;This web service is an IoT logbook and Android push notification server, it can
be considered like Twitter but for the Internet of Things. It is a part of my
&lt;a href=&#34;https://notes.iopush.net/projects/noterf/&#34;&gt;home automation system&lt;/a&gt;: I previously used
Twitter as a logbook of warning/errors but it lacks some functionalities, and
for few months notifications did not work well on my phone.&lt;/p&gt;
&lt;h1 id=&#34;website-screenshot&#34;&gt;Website screenshot&lt;/h1&gt;



    
    
        
        
        
        
    

    
    
    

    
    







  


    

    
        &lt;p&gt;&lt;span class=&#34;image center&#34;&gt;
            &lt;img src=&#34;https://notes.iopush.net/projects/iopush-app/iopush-messages.png&#34; alt=&#34;ioPush messages&#34;&gt;
        &lt;/span&gt;&lt;/p&gt;
        &lt;p&gt;&lt;div class=&#34;align-center&#34; style=&#34;font-weight: bold;&#34;&gt;
            ioPush messages
        &lt;/div&gt;&lt;/p&gt;
    


&lt;h1 id=&#34;android-notification&#34;&gt;Android notification&lt;/h1&gt;



    
    
        
        
        
        
    

    
    
    

    
    







  


    

    
        &lt;p&gt;&lt;span class=&#34;image center&#34;&gt;
            &lt;img src=&#34;https://notes.iopush.net/projects/iopush-app/push-notification.png&#34; alt=&#34;ioPush Android notification&#34;&gt;
        &lt;/span&gt;&lt;/p&gt;
        &lt;p&gt;&lt;div class=&#34;align-center&#34; style=&#34;font-weight: bold;&#34;&gt;
            ioPush Android notification
        &lt;/div&gt;&lt;/p&gt;
    


&lt;h1 id=&#34;so-it-should-be-able-to&#34;&gt;So it should be able to&lt;/h1&gt;
&lt;ul&gt;
&lt;li&gt;Keep record of events - Done&lt;/li&gt;
&lt;li&gt;Send event to push message if asked - Done&lt;/li&gt;
&lt;li&gt;Manage users - Done&lt;/li&gt;
&lt;li&gt;Send push notifications to Android, maybe other OS - Done, Android app to be
published&lt;/li&gt;
&lt;li&gt;Android application -&amp;gt; receive notifications - Tested in the 1st version&lt;/li&gt;
&lt;li&gt;Android application -&amp;gt; display user&amp;rsquo;s events&lt;/li&gt;
&lt;/ul&gt;
&lt;h1 id=&#34;what-can-be-logged&#34;&gt;What can be logged?&lt;/h1&gt;
&lt;ul&gt;
&lt;li&gt;Sensors out of battery warning&lt;/li&gt;
&lt;li&gt;Pollution data over a threshold&lt;/li&gt;
&lt;li&gt;Your 3D printer has finished its job&lt;/li&gt;
&lt;li&gt;Server down&lt;/li&gt;
&lt;li&gt;Motion sensor triggered&lt;/li&gt;
&lt;li&gt;A new mail is inside your mailbox&lt;/li&gt;
&lt;li&gt;Hoarfrost alert&lt;/li&gt;
&lt;li&gt;Whatever you want to be written :)&lt;/li&gt;
&lt;/ul&gt;
&lt;h1 id=&#34;useful-links&#34;&gt;Useful links&lt;/h1&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;https://iopush.net/app/&#34;&gt;Find it here&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://github.com/ioPush&#34;&gt;Source code&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
</description>
    </item>
    
    <item>
      <title>HAProxy - How to use Let&#39;s Encrypt certificates</title>
      <link>https://notes.iopush.net/blog/2015/haproxy-and-lets-encrypt/</link>
      <pubDate>Sat, 19 Dec 2015 14:32:00 +0000</pubDate>
      
      <guid>https://notes.iopush.net/blog/2015/haproxy-and-lets-encrypt/</guid>
      <description>&lt;p&gt;Thanks to &lt;a href=&#34;https://letsencrypt.org/&#34;&gt;Let&amp;rsquo;s Encrypt&lt;/a&gt; program, we can now generate
free SSL certificates. I used the beta program with success, but now I want to
use it on another server running through HAProxy. This is a trick to combine
certificate, chain, and private key to be loaded by HAProxy :-)&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;cat cert.pem chain.pem privkey.pem &amp;gt; combined.pem
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Following is the command I used to generate the certificates, which can be
improved to set email address and accept conditions.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;./letsencrypt-auto certonly -a webroot --webroot-path /var/www/ -d domain.net -d www.domain.net
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;</description>
    </item>
    
    <item>
      <title>Flask-Security - How to extend a form and its validator</title>
      <link>https://notes.iopush.net/blog/2015/flask-security-extend-form-and-validator/</link>
      <pubDate>Thu, 17 Dec 2015 13:53:00 +0000</pubDate>
      
      <guid>https://notes.iopush.net/blog/2015/flask-security-extend-form-and-validator/</guid>
      <description>&lt;p&gt;I am currently building a Python application, which let me use:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;http://flask.pocoo.org/&#34;&gt;Flask&lt;/a&gt; - a simple and very well documented web
Framework&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://pythonhosted.org/Flask-Security/&#34;&gt;Flask-Security&lt;/a&gt; - an extension
dedicated to user management.&lt;br&gt;
While it is a really great extension, there is some documentation missing or
quite hard to find on search engines or StackOverflow.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&#34;how-to-add-fields-to-a-flasks-security-form-with-a-custom-validator&#34;&gt;How to add fields to a Flask&amp;rsquo;s security form, with a custom validator.&lt;/h3&gt;
&lt;p&gt;First, we need to declare a new class, which extends RegisterForm, then add the
new fields we want on the form. If we want a custom validator for that field, we
need to define it, but, to avoid losing Flask-Security validator, just call it
with &lt;code&gt;Form.validate(self)&lt;/code&gt; The last thing needed is to tell Flask-Security to
use our form when instantiating it.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Instantiation&lt;/strong&gt;&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-Python&#34; data-lang=&#34;Python&#34;&gt;security &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; Security(app, user_datastore, register_form&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;ExtendedRegisterForm)
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;strong&gt;Form.py&lt;/strong&gt;&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-Python&#34; data-lang=&#34;Python&#34;&gt;&lt;span style=&#34;color:#f92672&#34;&gt;from&lt;/span&gt; flask.ext.wtf &lt;span style=&#34;color:#f92672&#34;&gt;import&lt;/span&gt; Form
&lt;span style=&#34;color:#f92672&#34;&gt;from&lt;/span&gt; wtforms &lt;span style=&#34;color:#f92672&#34;&gt;import&lt;/span&gt; StringField, BooleanField
&lt;span style=&#34;color:#f92672&#34;&gt;from&lt;/span&gt; wtforms.validators &lt;span style=&#34;color:#f92672&#34;&gt;import&lt;/span&gt; DataRequired
&lt;span style=&#34;color:#f92672&#34;&gt;from&lt;/span&gt; flask_security.forms &lt;span style=&#34;color:#f92672&#34;&gt;import&lt;/span&gt; RegisterForm
&lt;span style=&#34;color:#f92672&#34;&gt;from&lt;/span&gt; .models &lt;span style=&#34;color:#f92672&#34;&gt;import&lt;/span&gt; User


&lt;span style=&#34;color:#66d9ef&#34;&gt;class&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;ExtendedRegisterForm&lt;/span&gt;(RegisterForm):
    &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;&amp;#34;&amp;#34; Add nickname field to the register&amp;#39;s class
&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;    &amp;#34;&amp;#34;&amp;#34;&lt;/span&gt;
    nickname &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; StringField(&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;Nickname&amp;#39;&lt;/span&gt;, [DataRequired()])

    &lt;span style=&#34;color:#66d9ef&#34;&gt;def&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;validate&lt;/span&gt;(self):
        &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;&amp;#34;&amp;#34; Add nickname validation
&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;
&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;            :return: True is the form is valid
&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;        &amp;#34;&amp;#34;&amp;#34;&lt;/span&gt;
        &lt;span style=&#34;color:#75715e&#34;&gt;# Use standard validator&lt;/span&gt;
        validation &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; Form&lt;span style=&#34;color:#f92672&#34;&gt;.&lt;/span&gt;validate(self)
        &lt;span style=&#34;color:#66d9ef&#34;&gt;if&lt;/span&gt; &lt;span style=&#34;color:#f92672&#34;&gt;not&lt;/span&gt; validation:
            &lt;span style=&#34;color:#66d9ef&#34;&gt;return&lt;/span&gt; False

        &lt;span style=&#34;color:#75715e&#34;&gt;# Check if nickname already exists&lt;/span&gt;
        user &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; User&lt;span style=&#34;color:#f92672&#34;&gt;.&lt;/span&gt;query&lt;span style=&#34;color:#f92672&#34;&gt;.&lt;/span&gt;filter_by(
            nickname&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;self&lt;span style=&#34;color:#f92672&#34;&gt;.&lt;/span&gt;nickname&lt;span style=&#34;color:#f92672&#34;&gt;.&lt;/span&gt;data)&lt;span style=&#34;color:#f92672&#34;&gt;.&lt;/span&gt;first()
        &lt;span style=&#34;color:#66d9ef&#34;&gt;if&lt;/span&gt; user &lt;span style=&#34;color:#f92672&#34;&gt;is&lt;/span&gt; &lt;span style=&#34;color:#f92672&#34;&gt;not&lt;/span&gt; None:
            &lt;span style=&#34;color:#75715e&#34;&gt;# Text displayed to the user&lt;/span&gt;
            self&lt;span style=&#34;color:#f92672&#34;&gt;.&lt;/span&gt;nickname&lt;span style=&#34;color:#f92672&#34;&gt;.&lt;/span&gt;errors&lt;span style=&#34;color:#f92672&#34;&gt;.&lt;/span&gt;append(&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;Nickname already exists&amp;#39;&lt;/span&gt;)
            &lt;span style=&#34;color:#66d9ef&#34;&gt;return&lt;/span&gt; False

        &lt;span style=&#34;color:#66d9ef&#34;&gt;return&lt;/span&gt; True
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;And you are done !&lt;/p&gt;
</description>
    </item>
    
  </channel>
</rss>
