USB not detected in Ubuntu 18.04

Posted: January 22, 2019 in Uncategorized

After some updates after upgrading to Ubuntu 18.04 my Lenovo Thinkpad computer refused to detect USB drives. It first gave the impression that my USB stick was broken, but even all other sticks didn’t work. It even didn’t pop up in disks. When you run into this problem, you can do the following trick to mitigate this behaviour. I’ve got the idea from a post from 2004, but it works after a reboot:

echo -1 > cat /sys/module/usbcore/parameters/autosuspend


Ubuntu 17 uses resolved for DNS resolution. This does not always work very well with OpenVPN. When your DNS is not resolved correctly (always externally instead of internal addresses), try to use this fix here.

Update the line in /etc/nsswitch.conf:

`hosts: files mdns4_minimal [NOTFOUND=return] resolve [!UNAVAIL=return] dns myhostname`


`hosts: files mdns4_minimal [NOTFOUND=return] dns resolve [!UNAVAIL=return] myhostname`

This changes the order in which the calls are resolved.

When Ubuntu refuses to mount an encrypted harddisk, try the following on the command-line:  (just in case: modprobe dm-mod)

sudo vgchange -ay
sudo lvscan

Then mount the disk to somewhere:

sudo mount /dev/computer-name-vg/root x

Ubuntu 16.04 ships an OpenSSH version which does no longer support DSA keys out of the box. If you want to use DSA keys, you can add the following line to the SSH config file:

echo "PubkeyAcceptedKeyTypes +ssh-dss" >> /etc/ssh/ssh_config

Since a couple of days, I was plagued by some DNS problems when using Docker 1.10+. Seems that the dnsmasq process is writing the address into the resolv.conf. The purpose of the dnsmasq is to cache DNS queries. Unfortunately, it was no longer available in my Docker containers. The only solution for now (maybe it is a workaround) is to throw dnsmasq out. You can do this by editing the file:


Open the file with an editor and comment out the line

dns=dnsmasq   ---> #dns=dnsmasq

After that, kill dnsmasq and restart the network-manager. You should see the changes in the resolv.conf after that:

sudo killall dnsmasq
sudo service network-manager
restart cat /etc/resolv.conf

Posting to a Slack channel

Posted: July 7, 2015 in Slack, Tools

We’ve been trying out Slack for the last couple of weeks. A neat feature is the ability to make posts on behalf of external processes, like the build- and production-environment. You can create a incoming webhook for a channel. You then get an endpoint from Slack. Use this endpoint to make posts. That’s it.

curl -v -X POST 
   --data "{\"text\": \"This is a line of text in a channel.\"}"

When you checked out multiple git-repositories and you want to update them all at once, you can execute the following line:

$ ls -d */ | xargs -I{} git -C {} pull

When you’re running Ubuntu 15.04 with Docker, you must use systemctl to enable/disable your Docker service. Unfortunately, the old /etc/default/docker configuration file is not read. You must change the docker.service file and add these lines:


ExecStart=/usr/bin/docker -d -H fd:// $DOCKER_OPTS


(On my Ubuntu 15.04 system, the file resides at /etc/systemd/system/

Restart Docker with:

$ sudo systemctl restart docker 

Reduce noise in an onejar FatJar

Posted: May 15, 2015 in Java
Tags: ,

When you’re using onejar 1.4.5 or above you want to turn off the noise the bootloader makes.

java -Done-jar.verbose=false -jar service.jar

Vertx3 is nearing its release date and we’re experimenting with the upcoming release to minimize future surprises. One of the major changes is the generation of fatjars. The Vertx2 fatJar plugin doesn’t exist anymore in the Vertx 3 world. Now Vertx 3 uses the maven-shade-plugin to generate the fat JAR. Unfortunately, the shader has its own problems. For example, it is very cumbersome to handle duplicate files especially in transitive dependencies which are something out of your control.

When you’re running into unsolvable errors with the maven-shade-plugin, you can easily switch to the onejar-maven-plugin. Configure your POM as follows:


This will create a new fat JAR with the project JARs as a complete file on the inside. They are not unpacked, so there are no issues with overwriting files in the META-INF. The downside is that they use an own boot-mechanism.

This again has some problems when for example certain JARs use the SPI mechanism or self-cooked mechanisms to load classes.