Install TWRP and Magisk to root Pocophone F1

Disclaimer: I am not responsible for your phone if you do anything covered on this page, this page merely documents how I did it for myself.

What am I using?

I’m using Windows 10 for the MIUI unlock tool, Ubuntu 18.04 for fastboot and adb.

Unlock Bootloader

This sucks, I needed to dust off my Windows install and visit to download a .zip file which contained an executable.

Before being able to unlock it, I needed to wait 72 hours…

Install TWRP

Once unlocked I found a recovery-20181012.img file from this file host: which was shared on

I installed it by pressing power+vol-down for a long time to get into fastboot and using the following command from my Linux terminal

Recovery wiped

Booting into Android unfortunately resulted in the recovery being restored to MI-Recovery 3.0, so…

Download DisableForceExcryption

From I downloaded the file and placed it along with therecovery-20181012.img file onto the phone’s storage.

(The twrp- file in the GDrive wasn’t decrypting the storage in TWRP, so I didn’t use that anymore.

Boot into TWRP

Formatted data, flashed the file.

Flashing  actually installed Magisk as well and rooted the device in the process.

Run a backup

At this point I made a backup of all partitions to my MicroSD card to capture the current OS, booted into the OS, downloaded some apps, registered the device again in MIUI, made some changes and tested a restore.


First do a standard wipe (data, cache & Dalvik are standard) and then do the restore of all partitions (excl. storage).


This resulted in a bootloop, at least TWRP is still there..

Install MIUI 10 Global Stable

On I found


It started booting into Android again and encrypting the device 🙂

Recovery also restored

Unfortunately this also set me back to the MI-Recovery 3.0, at least the device was still unlocked, so back to fastboot it was.

Install Icinga Using Ansible

I wanted to play around with Icinga and automate the installation of it as documented on


  • Vagrant
  • Virtualbox
  • Ansible
  • Ansible-vault
  • .vault file in your home folder
  • encrypted_variables.yml in your icinga-poc folder (ignored by .gitignore containing the following variables with your own preferred passwords:

If you’ll have cloned and cd into the icinga-poc directory, you’ll be able to run the playbook doing most of the install as follows:

If you then go to you’ll be able to set-up your icinga2 server with the credentials above.

Nexus 5x Unlock Bootloader, Flash TWRP and SuperSU


Use this howto at your own risk, I am not responsible if you brick your device and I will not support you.


  • Nexus 5x Bullhead
    • LGH791F 32GB
  • Linux Desktop or Laptop
    • adb and fastboot installed
      • android-tools-adb
      • android-tools-fastboot


Enable USB-Debugging

Go to Settings -> System -> About Phone -> Build number and hit it about 5 times until you’re a developer.

Go to Settings -> System -> Options for developers -> USB Debugging -> On

Enable OEM Unlock

Go to Settings -> System -> Options for developers -> USB Debugging -> On

See if adb is working


At first I was presented with the following.

This was because I forgot to sudo the command above.

Restart adb-server

See if adb is working now

Reboot into bootloader

List device

Unlock the bootloader

Warning: This will erase your phone completely, be sure to have backed up everything!

Confirm it on your screen

Reboot device

Don’t skip this step, this will reboot your device.

Enable USB-Debugging (again)

Go to Settings -> System -> About Phone -> Build number and hit it about 5 times until you’re a developer.

Go to Settings -> System -> Options for developers -> USB Debugging -> On

Allow all future connections from your computer

Enable OEM Unlock

This should still be on.

See if adb is working

All is well if you see:

Reboot into bootloader

Download TWRP

Download the most recent .img file from

Flash the TWRP image to the Recovery partition

For some reason the defice was locked again after the reboot so I had to unlock it again.

Get into Recovery mode

Press down a couple of times until it shows recovery mode and press power to confirm

Download SuperSU

Download the .zip file from

Upload SuperSU to your internal SD

Install SuperSU .zip

Install -> Browse to and select it.


To confirm the installation.


You might get a prompt about the device being unable to decrypt your previously encrypted volume, it’ll bring you back to TWRP to do a factory reset.

Install AICP Oreo ROM

Download AICP

Download the latest nightly on and get into TWRP.

Download Magisk

Download Magisk Manager Latest Version 5.4.0 For Android 2017

AICP doesn’t go well with SuperSU but it does with Magisk.

Download OpenGApps

ARM64 -> 8.0 -> Full

Upload the .zip files

Flash AICP & Magisk

This is the usual procedure through TWRP, wipe caches afterwards and boot into the system.

Install OpenGApps

This took me some debugging as the nano version didn’t work, but the full version might do.




Installing LXD as a Snap with Ubuntu Core 16.04 on a Raspberry Pi 3

I have for a long time experimented with LXC/LXD and I’ve got a server running 24/7 in my household to do (among others) DHCP and NS, not because I need but just because I can.

This is of course costing me way too much electricity so I’m exploring the idea to run these services as Linux Containers on a Raspberry Pi 3.

Continue reading “Installing LXD as a Snap with Ubuntu Core 16.04 on a Raspberry Pi 3”

Ansible Jinja2 join dict nected values

For a certain configuration file I needed all my SSH users to be listed as p.puk,j.snot,s.sjors  etc from the following dict.

But whenever I ran the following task:

With the following template:

it would give me:

AnsibleUndefinedVariable: ‘list object’ has no attribute ‘account’

But having found:

I put the following in my template:

It gave me the following in /tmp/file.

The StackOverflow article covered something else so I wasn’t able to thank Crypto for his/her contribution but hopefully by creating this small post I can reach out to this person to say that this little fix saved my evening!

Guess I’d overlooked as I was of the assumption that my dict was YAML structured and therefor such a thing as json-query-filter wouldn’t work.

But then again:



Install GPMDP using Ansible

Just a quick playbook to install/update GPMDP using Ansible.


NextCloud install on Apache/2.4.18 php7.0-fpm ERR_TOO_MANY_REDIRECTS

I was confronted with an ERR_TOO_MANY_REDIRECTS when installing NextCloud on my Apache/2.4.18 php7.0-fpm setup.

It took some searching but this fix was so unbelievably easy thanks to this guy.

So basically modifying:


And/etc/php/7.0/fpm/php.ini, restarting apache2 & php7.0-fpm made my day.


Ubuntu 16.04 virt-manager over X11

Had a little trouble accessing virt-manager or firefox over SSH with X11 forwarding from my headless Ubuntu 16.04 KVM server to my Windows 7 work-laptop with Cygwin.

It kept giving me this error:

Installing libglu1-mesa fixed it for me.