Apple Magic Trackpad 2 on Ubuntu Linux

The is a guide to installing the Apple Magic TrackPad 2 on Ubuntu Linux. While this guide has been written for Ubuntu 20.04, it should be easy to follow these instructions with minor changes for Fedora.

Plug the TrackPad in to USB. The trackpad should just work via a cabled connection. 2 Finger scrolling will work, a 2-finger tap is right mouse button, and a 3-finger tap is the middle button (or paste).

Enabling Bluetooth

To connect the trackpad via bluetooth, unplug the USB cable and turn the trackpad off, wait a second or two then turn it back on. The trackpad will now appear in bluetooth settings and can be paired.

Enabling Gesures

Add your user to the ‘input’ group. After doing this you will need to completely restart your session – the easiest way to do this is to reboot. Logging in and out will not work.

$ sudo gpasswd -a $USER input

Now you will need to install libinput-gesture – the example below uses the latest from git

$ sudo apt-get install xdotool wmctrl git python3 libinput-tools build-essential
$ mkdir ~/src/
$ cd ~/src/
$ git clone https://github.com/bulletmark/libinput-gestures.git
$ cd libinput-gestures
$ sudo make install
$ libinput-gestures-setup autostart
$ libinput-gestures-setup start

After this, a three finger swipe up and down will switch workscapes. Read /etc/libinput-gestures.conf to see other options that are available.

Issues

Unfortunately, when used over bluetooth, the sensitivity of the touch to click is far too sensitive. I found that text was constantly accidently selected. This issue does not occour when the decice is wired.

Libinput seems to show the same device details as below for both wired and bluetooth – so I’ve not figured out that cause of this yet.

Device:           Apple Inc. Magic Trackpad 2
Kernel:           /dev/input/event25
Group:            6
Seat:             seat0, default
Size:             162x115mm
Capabilities:     pointer gesture
Tap-to-click:     disabled
Tap-and-drag:     enabled
Tap drag lock:    disabled
Left-handed:      disabled
Nat.scrolling:    disabled
Middle emulation: disabled
Calibration:      n/a
Scroll methods:   *two-finger edge 
Click methods:    button-areas *clickfinger 
Disable-w-typing: n/a
Accel profiles:   none
Rotation:         n/a

How to download YouTube videos using Docker on Linux

I recently found a 2 hour YouTube video where I wanted to listen to the audio only.  On trying to install youtube-dl on my server, I was shocked to see the number of packages that it was trying to install.

I run Ubuntu, but this should work in any Linux distro.  Using a docker container saves polluting your server with a lot of dependencies you might not need.

If you don’t already have it, install docker:

# curl -fsSL get.docker.com -o get-docker.sh
# sh ./get-docker.sh

The following will download a video to the current working directory:

# docker run --rm  -v $PWD:/downloads wernight/youtube-dl "https://www.youtube.com/watch?v=id-here

This will extract just the audio and give you the output as an mp3:

# docker run --rm  -v $PWD:/downloads wernight/youtube-dl --extract-audio --audio-format mp3  "https://www.youtube.com/watch?v=id-here"

Filtering Postini tagged mail with Sieve

The headers Postini’s anti-spam system adds to emails are quite hard to filter on, as you need to compare part of one header to part of another. Here’s a little snipped that works with dovecot 1.2’s sieve implementation. I don’t actually use this myself anymore, but I’m posting it here for anyone else struggling with the problem.

Continue reading “Filtering Postini tagged mail with Sieve”

Cacti and Exim – a (mostly) complete guide – Part 1

I recently had to set up monitoring for a new Exim MX server at work. I wanted to make exim statistics available over SNMP such that I can easily hook it into cacti and nagios. Having recently been though the whole process from beginning to end, I thought I’d take the time to document the process, so that others can not only download and use my scripts/templates – but also modify it to suit their needs and learn some cacti whilst doing so.

Download my script and template: – exim_cacti_v1.tar.gz

Continue reading “Cacti and Exim – a (mostly) complete guide – Part 1”

Connecting to the Internet via bluetooth using a Nokia on OS X

I recently got a new MacBook, thanks to my employer – Timico. Believe it or not, my previous laptop I ran Windows Vista on – and despite Linux usually being my OS of choice, I got on well with Vista. For me, things ‘just works’, and on that list of things that ‘just work’ was Nokia’s ‘One Click’ internet access tool included in the Nokia windows software. This tool makes it dead easy to connect via bluetooth, it really was just a matter of selecting your network provider, and clicking a button.

I typed a few things into google to try to figure out how to get OS X to connect via bluetooth over my N95 or E71 mobile phone. I found all sorts of confusing articles suggesting I needed to download scripts and place them somewhere, and jump over a few hurdles. Frankly, I couldn’t be bothered to mess about with that kind of thing, I wanted things to just work like they did in Windows.

Despite the confusion caused by the various articles on the internet, it’s actually surprisingly easy to setup – so I thought I would document it here for others. Simply go to the bluetooth menu, and select to ‘Set up a bluetooth device’, follow though the obvious settings. The last step in the wizard has a tick box labeled ‘Access the Internet with your phone’s data connection’. Ensure it’s ticked, and click next.

These settings are for Vodafone contract (PAYG is different apparently) in the UK, a quick google of something like ‘GPRS settings <country> <provider>’ should allow you to find the settings you need.

Username web
Password web
APN internet

Save these settings. I like to have ‘show bluetooth status in menu bar’ and ‘show modem status in menu bar’ selected, that choice is yours. It is now as easy as going into network preferences (or using the menu status in the menu bar) and clicking ‘connect bluetooth’ to connect to the internet. This works perfectly for me in OS X 10.5.6.