November 9, 2015

Encrypting an Android phone with a broken USB port

I have an Android phone with a broken USB port: neither the data nor the power lines work. However, I can still charge the battery by removing it from the device and putting it into an external charging device. Apart from that, the device still works absolutely fine and I see no reason to throw it away or risk breaking it by trying to repair it.

I have now decided that I want to encrypt this phone, but Android wanted me to connect it to power, even though the battery was 100% full.

Fortunately, one can force the device encryption from a root shell on the device by invoking:

vdc cryptfs enablecrypto inplace 

The phone will then reboot and start encrypting. Note that if your battery runs out during this process, you will loose data, so make sure to take a backup first!

January 25, 2015

Controlling your monitor’s brightness from your computer

I usually have to work more than eight hours a day on my computer. Especially in winter when the sun sets early, I often would have to dim the brightness of my monitor in the evening. But because most monitor on screen menus are hard to use, I almost never do that, because I am too lazy. But if I don’t I sometimes get a headache. So I thought, it must be possible to somehow control the brightness of my monitor without using the crappy menu. And it turns out that this is actually possible. Many monitors support DDC, which should in theory allow you to adjust their brightness. For Linux, there is DDCcontrol, which worked perfectly for my Dell UltraSharp U2412M, altough it does not offically support this monitor.

Unfortunately, DDCcontrol is not in the Ubuntu package repositories. However, on my Ubuntu 14.04 I was able to use the packages from ddccontrol, gddccontrol and libddccontrol0 from 15.04. Additionally, I had to install ddccontrol-db from 10.04. However, keep in mind that using packages from different Ubuntu versions could in theory break your whole system. So be careful, I am not responsible if kittens die.

After that, I had to install i2c-tools and add my user to the i2c group: sudo apt install i2c-tools && sudo gpasswd -a nico i2c

Then, ensure that the i2c-dev module is loaded on boot by adding it to /etc/modules.

After rebooting your machine, you should be able to use gddccontrol to adjust monitor parameters. On the shell, I was able to adjust the brightness using the following command: ddccontrol -r 0x10 -w “$your_brightness_value” dev:/dev/i2c-7 Keep in mind that the command most likely looks different, depending on your machine and your monitor.

That’s it! Now I can adjust the brightness of my monitor more conveniently!

January 8, 2015

PC Engines APU: Installing debian

Until now, I only ran pfSense on my PC Engines APU boards. But I now wanted to get one of them running under Debian Linux.

The first challenge is creating a live Linux that starts a serial terminal on boot. I found that this was the easiest using Grml2Usb. I booted Grml on my normal PC and plugged in a USB stick. Then, using a Grml ISO image, I did the following:

grml2usb --fat16 --bootoptions="vga=off" --bootoptions="fb=false" --bootoptions="console=ttyS0,115200n8" grml96-full.iso /dev/sdz1

This formats /dev/sdz1 and creates a Grml stick that automatically starts a serial console.

Then, boot from that stick. Using the awesome grml-debootstrap you can debootstrap a Debian installation on your APU. After that, you have to chroot into your new installation:

mount /dev/sda1 /mnt
mount -t sysfs sys /mnt/sys
mount -t proc proc /mnt/proc
mount -o bind /dev /mnt/dev
chroot /mnt /bin/bash

First, edit /etc/default/grub to make Grub aware of your serial port. To do that, set the following variables there (replacing them if they already exist):

GRUB_CMDLINE_LINUX_DEFAULT="gfxpayload=text fb=false console=ttyS0,115200n8"
GRUB_SERIAL_COMMAND="serial --speed=115200 --unit=0 --word=8 --parity=no --stop=1"

Then, make Debian spawn a shell on your serial port. Edit /etc/inittab and uncomment the following line:

T0:23:respawn:/sbin/getty -L ttyS0 115200 vt100

Afterwards run update-grub and reboot. You should see Grub and then your Debian booting!

October 5, 2014

Firefox: Disable search and Domain Guessing

I don’t want my firefox to perform searches on google or similar when I don’t explicitly instruct it to do so. This is especially annoying if you enter something like and firefox performs a google search on that because you didn’t configure your DNS correctly.

Go to about:config and set keyword.enabled = false

But that isn’t enough. If you enter something like internalapp it will complete that to… This “feature” is called Domain Guessing. Let’s get rid of that, too: browser.fixup.alternate.enabled = false

Additionaly, I have set up a few keywords for search engines, so when I enter something like g test into the URL bar firefox will do a google search.

September 19, 2014

Amazon ELB and SHA-256 Certificates

With the recent SHA1 deprecation in new browsers, I wanted to start deploying SHA-256 certificates to my clients.

One of them used a Amazon Elastic Load Balancer (ELB). Because I could not find any information about whether they support SHA-256 certificates, I just wanted to post that they do and it works without any problems.

Powered by Hugo & Kiss.