Thursday, April 3, 2014

Ubuntu/Debian: Mouse buttons and trackpoint scrolling on T440s, X1 Carbon and all other new Thinkpads!

I just got a new Thinkpad T440s and was not very happy with it. No wifi, bad graphics and the touchpad was not working properly after installing Debian Wheezy, the current stable version.
I soon realized: Upgrading to Jessie is necessary to fix these problems. And it did - to a certain degree. Wifi was working (install firmware-iwlwifi), graphics were better, and also touchpad worked - but not as expected!

There are no actual mouse buttons on the new Thinkpad models. WHY would they do that? I hate touch and I hate pressing a whole oversized plate with a very bad haptic feedback which makes cracky noises. #whycopyapple
Further, whenever I pressed the touchpad down, the mouse arrow moved slightly which was really annoying. This is probably the Linux driver's fault, but still...
Most problematic: There is no middle mouse button scrolling any more. I hate moving my whole hand away from the keyboard just to scroll down a little bit. #hatetouchpads Pressing and holding the middle mouse button while just tapping the trackpoint a bit was so convenient!

How to make this a lot better:
Thanks to this post on Launchpad I got most of the problems somehow fixed. No more mouse moving while clicking, middle mouse button scrolling (yay!), you can even disable all the touch if you want.
All you need to do is to get the newest sources of the xserver-xorg-input-evdev driver, copy some files over from the xserver-xorg-input-synaptics sources and patch all of this with some work done by the arch linux guys.

In the end you just need to build the *.deb package and install it on your machine. You don't need to remove the original driver package! Also, don't forget to put the 90-evdev-trackpoint.conf file into /etc/X11/xorg.conf.d/ and reboot!

I already did all of the patching and building, so if you trust me (you can!) just install my packages on Debian Jessie 64bit:
Current (updated 28/01/2015) evdev version in Debian Jessie is 2.9.0, so download: patched_synaptic_amd64_debs_2.9.0.tar.gz
If you still use version 2.8.2 (eg. on Ubuntu), get this: patched_synaptic_am64_debs_2.8.2.tar.gz

PLEASE CHECK your dependencies and version numbers before installing! If the installation fails, you end up without mouse and keyboard input!

> wget http://homepage.univie.ac.at/s.hammer/files/patched_synaptic_amd64_debs_2.9.0.tar.gz
> tar -xzf patched_synaptic_amd64_debs_2.9.0.tar.gz
> sudo dpkg -i xserver-xorg-input-evdev_*
> sudo cp 90-evdev-trackpoint.conf /etc/X11/xorg.conf.d/


Have fun with your new Thinkpad!
PS: If you want me to build a 32bit package for you, please comment below!

Monday, January 20, 2014

HowTo manually upgrade the Moto G to Android 4.4 in Germany and Austria

Just today I read that it is easily possible to manually force the Moto G to a system update to get Android 4.4. All you need is to put the signed installer package on your phone under /sdcard/ and the Moto G will automatically move the files into the system memory and perform the upgrade.

So follow these steps:

  1. Download the upgrade package from here: http://d-h.st/JRE
  2. Move it to /sdcard/ either when plugged into your computer or with a file-manager
  3. Go to Settings -> About phone -> System Updates
  4. You will be asked to push the files into the systems memory and the update will begin
The installer package I linked above is a Germany/Austria specific package, I don't know if it will work for other countries too. If you current version in Settings -> About Phone -> System Version is also *falcon_umts.Retail.en.DE it will work for sure. If you have links for other builds, please leave a comment.

Have fun with Android 4.4!

Saturday, August 31, 2013

One-liner to convert any music file to mp3

On Debian 7 ffmpeg is not installed any more as it comes with its successor avconv.
Therefore it is enough to write a small bash for loop which takes any *.wma file of the folder and starts the conversion. The output file will then have the file extension replaced to mp3. Done!
The result looks like this:
for f in *.wma; do avconv -i "$f" -ab 192k "${f%.wma}.mp3"; done
However, you can replace the two occurrences of *.wma with any other music file format you want to convert from (eg: *.flac, *.aac, *.wav,...). Keep in mind that you need to have the right gstreamer plugin installed to encode and decode the desired formats.

Monday, July 29, 2013

How to manually install the OpenVPN binary

It seems that since the upgrade to Android 4.3 the OpenVPN Installer App is not working for me any more. I get some error saying /system cannot be mounted writeable (rw).
However, it is still possible to install the openvpn binary per hand... and it is not as complicated as it seems! This guide only works on rooted devices and is written for Linux users, however the lower part should also work on Windows and Mac.

At first you need to get the Android Debug Bridge binary and install it on your computer (I just put it into $HOME/bin).
Then download the latest OpenVPN Installer APK - we need to extract the openvpn binary from this package:
wget http://android-openvpn-installer.googlecode.com/files/OpenVPN-Installer-0.2.4.apk
To extract the xbin-binary, you can use FileRoller on Gnome or any other tool. Here is an example of how do it with the terminal only:
unzip OpenVPN-Installer-0.2.4.apk assets/openvpn-2.1.1-static-xbin
mv assets/openvpn-2.1.1-static-xbin openvpn
rm -r assets
Now use adb to push the binary to your phone/tablet's "sdcard" (external storage):
adb push openvpn /sdcard/
The next two commands will open a shell and give us root access on your Android device. Everything you type afterwards happens directly on your device, so be careful!
adb shell
su
Now we need to mount /system as writeable to be able to make changes. Next we copy the binary to its final location and delete it on the sdcard (unfortunately moving is not possible). After we changed the file-permissions so that the binary can be executed, we need to mount /system as read-only again:
mount -o remount rw /system
cp /sdcard/openvpn /system/xbin/
rm /sdcard/openvpn
chmod 755 /system/xbin/openvpn
mount -o remount ro /system
Everything should be done now. Close the connection to your device by typing exit two times and try to use OpenVPN Settings! The installer app will also show you "Binary installed" if everything worked!

Sunday, July 14, 2013

Rainy can't be built on Debian Wheezy any more - here is a solution!

To be able to build Rainy on Debian Wheezy (and probably also on Ubuntu), you need to do several preparations, because building now depends on NuGet (http://nuget.codeplex.com).
At first you need to install mono-complete, as this tool has many dependencies:

$ sudo apt-get install mono-complete

Then download the nuget command-line utility: http://nuget.codeplex.com/releases
Further create a file/script called "nuget" so that nuget.exe is called with our desired options:
#!/bin/bash
mono --runtime=v4.0 /usr/local/bin/nuget.exe "$@"

Copy both files (nuget and nuget.exe) to /usr/local/bin/ and make it executable:

$ sudo cp nuget* /usr/local/bin/
$ sudo chmod a+x /usr/local/bin/nuget


You now can already call nuget in your terminal. However, if it still creates an error, you need to download Microsoft.Build.dll and also copy it to /usr/local/bin. Get it, for example, here: http://headsigned.com/download/running-nuget-command-line-on-linux/Microsoft.Build.zip
This blogpost also explains how to extract the ddl from a working Windows installation in case you don't trust the previous source: http://headsigned.com/article/running-nuget-command-line-on-linux

Now you can try to make Rainy. If it throws an error not being able to download from https://something, import the certificates from Mozilla:

$ mozroots --import --sync

Now it should be able to build Rainy on Debian!

$ git clone https://github.com/Dynalon/Rainy.git
$ cd Rainy
$ make

Wednesday, April 10, 2013

Create a custom launcher icon in gnome-shell

Today, I realised that navigating into a certain folder to start mincraft with a terminal command is much to complicated. A nice minecraft icon within the other installed applications would be great!


All I needed to do was to create a file: ~/.local/share/applications/minecraft.desktop and fill it with such a content:
[Desktop Entry]
Encoding=UTF-8
Name=Minecraft
GenericName=Game
Comment=Block Building Game
Exec=java -Xmx1024M -Xms512M -jar /path/to/minecraft.jar
Icon=/path/to/minecraft/icon.png
Terminal=false
Type=Application
MimeType=text/plain;
Categories=Game;
Name[en_US]=Minecraft
You still need to download a beautiful icon and adopt the two lines in bold (path to your executable and to the icon). Further you need to run
chmod a+x ~/.local/share/applications/minecraft.desktop
to give this file proper rights for execution. This is it! It works for any other application/script too!

Wednesday, February 27, 2013

Tomboy's new sync-server Rainy running on the Raspberry Pi!


As Ubuntu One is shutting down their note-sync service based on the Snowy server, I needed to come up with a solution for this problem. My main thought was: Why should I trust anyone on this again, if it is so easy to build your own "cloud" for syncing notes?
Rainy is still in early development, but already does an awesome job on syncing notes between Tomboy and Tomdoid. Special thanks to Timo Dรถrr for this! Further, the Raspberry Pi (a credit-card sized computer) is the ideal platform for this purpose as it only "eats" 2 Watts per hour and can be easily run 24/7.

How do I build my own note-sync-server?

To create a minimal Debian system on a SD Card for the Raspberry Pi, just follow the steps here: 
http://blog.kmp.or.at/2012/05/build-your-own-raspberry-pi-image/

In summary you need to:
1. Install these dependencies on your computer: 
apt-get install binfmt-support qemu qemu-user-static debootstrap kpartx lvm2 dosfstools
2. Adopt the script (Optional! Just search for the lines and put your things in there!):
x) Change the debian mirror url: deb_mirror="http://http.debian.my/debian"
x) Add the network interface wlan0 for wifi access and use a static IP address of your choice:
echo "auto lo
iface lo inet loopback

#auto eth0
#iface eth0 inet static
# address 192.168.0.4
# netmask 255.255.255.0
# gateway 192.168.0.1

auto wlan0
iface wlan0 inet static
address 192.168.0.4
netmask 255.255.255.0
gateway 192.168.0.1
wpa-ssid MYSSID
wpa-psk MYWIRELESSKEY
" > etc/network/interfaces

    x) Change the password: echo \"root:MYPASSWORD\" | chpasswd
    x) Add packages to pre-install for wifi (you might need other firmware packages!): 
apt-get -y install locales console-common ntp openssh-server less vim wireless-tools firmware-atheros firmware-realtek wpasupplicant
3. Run script: sudo ./build_rpi_sd_card.sh /dev/sdX
4. Put the SD Card into your Raspberry Pi and plug it in. It should automatically connect to your wifi (or lan)!

After you logged in (either directly or over ssh root@192.168.0.4), you will see a typical Linux shell. At first we will have to install the dependencies and necessary packages for our mono based Rainy server:
apt-get -y install libmono-system-runtime2.0-cil libmono-microsoft-csharp4.0-cil libmono-system-componentmodel-dataannotations4.0-cil libmono-system-web2.0-cil libmono-system-web-services4.0-cil libmono-system-data-linq2.0-cil libmono-system-data-linq4.0-cil libmono-system-web-abstractions4.0-cil mono-runtime unzip screen
Then we have to download the pre-compiled Rainy binary, unzip it and change into the directory:
wget http://rainy.notesync.org/release/rainy-0.1.3.zip
unzip rainy-0.1.3.zip
cd rainy-0.1.3
With a text editor of you choice you can edit the settings.conf file to change the user names, passwords, etc. Then start Rainy:
mono Rainy.exe -c settings.conf
If you want to run the server as a background job, I suggest to use screen. A very short explanation on how it works can be found here: http://jjjjango.blogspot.co.at/2013/01/linux-start-long-running-jobs-with-ssh.html

Now open your Tomboy, or Tomdroid and add the new sync server URL:
http://192.168.0.4:8080/<username>/<password>/
If you want to sync from outside your home, you have to redirect the 8080 port of your router to the IP address of the Pi. Further, you have to use the public IP of your router in the sync URL. In case you get a dynamic public IP, you will have to use http://www.noip.com/ or a similar service.

I hope, you know what to do! If not, please don't hesitate and ask your questions in the comments!