Cleaning Cache on Android >= 6.x (Apps won't work!)

As I am quite an Twitter Addict, I tend to surf a lot on that Social Media Site, blowing my Android Cache to unfriendly-sizes. In earlier days, I installed some random Cache Cleaner from the PlayStore, cleaned the Caches and directly uninstalled those Apps again, as they tended to be full of Ads. However, in recent days, I saw that most Cache Cleaners did not work - even though "the devs said so". How come? Well, I found my answer on the Github Repo of the android-cache-cleaner: "Starting with Android 6.0, CLEAR_APP_CACHE permission seems to be no longer available to regular applications and since this permission is required for cleaning of internal cache, Cache Cleaner is not able to clean internal cache on Android 6.0 and newer. However, cleaning of external cache is still supported." Well, cool thing. So most of those apps are useless as hell. But how to clean all the caches?!

TL;DR:
You do not need [an] app anymore if you are on Android 6.0 or newer. Just go to Settings & Storage -> USB -> Internal storage and click on Cached data in order to clear all the cache.

Source: https://github.com/Frozen-Developers/android-cache-cleaner/blob/master/README.md

Raspberry Pi Pixel - on your x86/x64

The guys over at the Raspberry Pi Foundation - in cooperation with the MagPi Team came up with a cool project: They ported the new "Pixel" desktop from Raspbian over to Debian, so you could use it on your normal x86/x64 machine. The DVD is included in the latest MagPi edition, however, you can also download the DVD from the Raspberry Pi Website, the link is in the article: https://www.raspberrypi.org/magpi/debian-pixel-mac-pc/

PS: Also the "root" directory of the pixel_x86 seems to be: http://downloads.raspberrypi.org/pixel_x86/images/

Raspberry Pi Remote Desktop

To use the RPi via Remote Desktop, different protocols and programs exist, i.e. VNC. Due to simplicity of use, however, I mostly chose XRDP, which works with the Microsoft Remote Desktop Tools. However, you must not install it via sudo apt-get install xrdp - as this will install it with realvnc and break xrdp (Package error which has not been fixed yet in the recent "Pixel" Release of Raspbian...).

Instead, use:
sudo apt-get install tightvncserver xrdp

As it will install tightvnc first and xrdp will use it after that as source. You can then use mstsc on your Windows Machine or any other RDP Viewer to access your RPis Desktop.

PS: Yes, the new Pixel Version of Raspbian does contain an VNC Server which can be enabled very easily via the GUI "Raspberry Pi Configuration" Tool, if you want to use VNC directly without RDP. However, I did chose this way, as the old VNC server installations never worked for me and I got used to this kind of "workaround" (more or less a "works-for-me"(tm) solution)

[Docker] Backup / Restore Images

Images should be a kind of "throw-away" format: You got your Dockerfile, and as soon as you need to run a specific container, you should just built it from scratch: All the latest security updates, software versions - great. However, sometimes you got a bit of specialized stuff which you want to backup for later use.

I found a good answer to that topic: http://stackoverflow.com/questions/26707542/how-to-backup-restore-docker-image-for-deployment


Backup:
docker save myusername/myproject:latest | gzip -c > myproject_img_bak20141103.tgz

Restore:
gunzip -c myproject_img_bak20141103.tgz | docker load

Nexus 4 Upgrade to CM 14.1 / Android 7.1 Nougat + Updates

[UPDATED 10.12.2016]
A little bit problematic, but... works in the end.

Warning: Bleeding Edge!
Will bootloop, you'll need to format your phone, it will break eggs, pcs, glass and burn down your house.
Comes with no support what-so-ever from my side.
You have been warned!

1.) Get all the files
CM: https://download.cyanogenmod.org/?device=mako (Latest version was: https://download.cyanogenmod.org/get/jenkins/187896/cm-14.1-20161202-NIGHTLY-mako.zip)
GAPPS: http://opengapps.org/ (ARM, 7.1 GAPPS, Picco Version)
TWRP: https://twrp.me/devices/lgnexus4.html (Download from: https://dl.twrp.me/mako)

2.) Flash TWRP
- Press Vol Down and Power Button to shut down the Phone.
- Press Vol Down and Power Button again to boot to the Bootloader
- Upload TWRP via fastboot: fastboot flash recovery twrp.img

3.) Flash and Install
- Boot to Recovery
- Delete all Files from your Phone
- Upload CM and GAPPS file via MTP to sdcard
- Flash CM, then GAPPS
- Clean Cache

4.) "Debug"
You would get an bootloop, if you would reboot now. According to http://androidforums.com/threads/twrp-bootloop-fix-after-update-ota.922585/ you need to go to the Terminal (or adb shell) and enter following commands:
dd if=/dev/zero of=/dev/block/platform/msm_sdcc.1/by-name/fota
(enter) - and then
dd if=/dev/zero of=/dev/block/platform/msm_sdcc.1/by-name/misc
(enter)

5.) Reboot
And you're good to go. However, somehow the update functions are bricked, so... check out the forums and bug reports:

http://forum.xda-developers.com/nexus-4/orig-development/official-cyanogenmod-14-1-nexus-4-t3507532/page7
https://www.cmxlog.com/14.1/mako
https://review.cyanogenmod.org/#/c/173328/

EDIT / REGARDING UPDATES:
Updates seem to be bricked because of some error in TWRP which sends Android 7.1 into a bootloop after EVERY update. So if you're updating via regular "Fullsized Images" from get.cm, you need to run the 4th Section / Debug EVERY time you update! However, you can get around that, if you use CyanDelta Updater (https://play.google.com/store/apps/details?id=com.cyandelta). Just install CyanDelta Updater on your phone, choose your CURRENT cm.zip (i.e. the one you installed your phone with, in this tutorial the cm-14.1-20161202-NIGHTLY-mako.zip) and let it index that. After this, it will try to find newer CM versions on the net and only download the delta, i.e. the changes to your current image. This will most likely break down your new 330+ MB download to an about 40+ MB download (which is nice!) - and after that, you can just install the update via the same app (actually it will ask you, just give it root rights and let it do its job, next reboot will take a while, but it works! :)). In any case, the TWRP Bootloop problem is solved with that, update downloads are smaller and everyones happy ;).

IMPORTANT: Best strategy before attempting ANY kind of update would be to make a full backup via TWRP and move it to a secure location (i.e. your pc harddrive) in case you brick your phone and need to restore it! At least one backup after your initial install (with all apps and stuff) should be made. It makes life so much easier in case something goes wrong :).

[Ubuntu / Proxmox] Hosting NFSv3 Server on Ubuntu for Proxmox Server

So, yesterday evening y0sh came to me with following problem: "I got an real nice proxmox server with loads of CPU and RAM - and nearly no storage left. And I got an small little Atom Server with loads of Storage - but not very useful as VM Host - and yes, they are within the same network". Ok, so: Lets create an NFSv3 Server on the Atom system and mount it as disk storage within Proxmox 🙂

# Atom Server (Ubuntu)
# Install NFS v3 Server
sudo apt-get install nfs-kernel-server rpcbind
# Create Shared Directories
sudo mkdir -p /var/nfsshare
sudo chmod -R 777 /var/nfsshare
# Configure Server
sudo vi /etc/exports
# Insert the line into exports, with the IP Address of your NFS Client / Proxmox Server
/var/nfsshare 192.168.1.111(rw,sync,no_root_squash)
# save and exit, fine tuning:
sudo vi /etc/default/nfs-kernel-server
# change the line RPCMOUNTDOPTS to
RPCMOUNTDOPTS="--manage-gids --no-nfs-version 4"
# to use nfs v3 ...
# reload the nfs exports...
sudo exportfs -r
# ...or restart the server
sudo /etc/init.d/nfs-kernel-server restart
# show all share directorys
sudo exportfs -v

# Mount NFS in Proxmox
Go to Datacenter, Storage, Add, NFS
IP:

[Python / QL-570] Using Brother QL Printers via Python

I have been building an complete Invoice / Cashier system for Cafés in my spare time for quite some time. It consists of an server, running the web app, an laptop to use as the real cashier system, multiple Android Phones as a way for the waiters to enter their orders and two Raspberry Pis with Brother QL-570s as Invoice Printers. One of those is set at the counter, printing the "normal invoice", the second one is located at the kitchen and got some special routing logic, so that it only recieves the items actually produced in the kitchen. However, as I was using these special kind of printers, I was bound to use the printer-ptouch drivers... and yeah, they are *kind of* buggy. Buggy in that way, that, after installing them with cups and hacking your paper media in there - they will just stop working from time to time. Without further warning. They will stop printing just somewhere in the middle of the job. I really tried all options available to me now - and was now keen on finding *other* kinds of solutions. And after two days of searching, I stumpled upon this master piece: https://github.com/pklaus/brother_ql. Mr. Philipp Klaus did actually dump the whole cups and printer server stuff and directly converted png files into the needed binary code for the printer. And not only the QL-570, but other types as well. I really recommend checking out his code and trying his way on printing - its a huge timesaver, especially on embedded devices like the Raspberry Pi :)!

[Freifunk] Virtual Freifunk Router on VMWare ESXi 4.1

This post was planed a LONG TIME, however - due to the fact that I could not get it working back in 2015 (See: https://github.com/freifunk-gluon/gluon/issues/496) it had been delayed. However, as I have the need to get Freifunk working as VM on a central ESXi Server - I tried it again - and it worked! Basic instruction to get it working can be found here in german: https://www.it-kl.eu/2015/08/gluon-x86-unter-vmware/

I got following equipment: ESXi 4.1 Server with multiple NICs.
Start up with getting the right image from your Freifunk Team. I got the gluon-fftr-0.8.4-x86-vmware.vmdk from the Firmware Store of my trusted guys from FFTR (https://github.com/freifunktrier/firmware_store/tree/master/firmware/stable/factory [ Trier 0.8.4 is gluon 2016.1.6-3-g9300421, it's just 2016.1.6 + ee597c6 + Webinterface-color-patches ] )
After that, create a new VM on your VMWare ESXi Server. Choose an user definied configuration, "Other" OS and "Other (32-Bit)" Version. I gave the VM a 1 vCPU and 512 MB of RAM - but you can chose as you like. After that, you need to create two Network Devices / NICs. I chose two E1000 ones, and gave the first Interface the Freifunk LAN and added the second Interface to my common WAN (IMPORTANT!). After that, you're not going to create an HDD.
After the creation of the VM, upload your vmdk file to the folder, edit the VM and chose the downloaded VMDK as Harddrive.

On your ESXi Server, go to Configuration, Network and edit your vSwitch. Allow Promiscuous Mode, MAC Change and Fake Transmissions.

After that, go to Configuration, Software, Advanced Settings - to the "Net" section and change Net.ReversePathFwdCheckPromisc to 1 (thanks to FFS-Roland for helping out! :))

After that, you can start up your VM. You should get DHCP on your FFLAN Port - something like an 192.168.1.x address. Go to 192.168.1.1 via browser, give your Router a name, enable Mesh VPN (important!) and maybe change the bandwidth settings. Save and mail your VPN Key to your Freifunk Team. In some hours, you should be good to go (the Key added to their system - and after a quick reboot of your VM, you should be live :))

Thanks a lot to Draco and Ranlvor from Freifunk Trier for their tremendous help :)!