Debian Time Machine

Tuesday, February 10, 2015

I wish there would be a standard tool in Debian or Ubuntu to list all the packages installed since certain date. So that I could use that information to rollback the system state to its original or even a fresh-install state.

Luckily there is a log written with every ever installed, upgraded or removed package by dpkg or apt-get, which can be found at /var/log/dpkg.log. I wrote a simple script that parses the logs and extracts the packages names.

So to list all the packages installed from the beginning of the year:

$ ./ -n 2015-01-01

Or to clean up the system from anything installed during last two hours:

$ sudo apt-get remove `./ 2 hours`

How to pair a Low Energy (LE) Bluetooth device in dual boot with Windows & Linux

Thursday, September 18, 2014

Those who dualboot know the pain of re-pairing your keyboard or mouse everytime you boot to a different OS. In this tutorial I will show how to pair a LE Bluetooth mouse in both Windows 8 and Debian simultaneously.

First pair the device in Debian, then reboot in Windows and pair the device there too. Yes, this will reset the paring in Debian, just carry on. Now we need to access the pairing keys in Windows. Download psexec.exe and open a command prompt with Administrator rights.

> cd Downloads
> psexec.exe -s -i regedit /e C:\BTKeys.reg HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\BTHPORT\Parameters\Keys

The keys should be now exported to C:\BTKeys.reg. You should get something like:

Windows Registry Editor Version 5.00


7512a3185b2c is the MAC address of the Bluetooth adapter, which can also be written in standard format as 75:12:A3:18:5B:2C. 84abd4a25ee1 is the mouse address that was assigned during the pairing. We will need those numbers in the next steps.

Now boot again to Debian. The mouse wont paired automatically, because it is now assigned to a different address and with different keys. Let's fix it.

$ cd /var/lib/bluetooth/75:12:A3:18:5B:2C/
$ ls
cache 84:AB:D4:A2:5F:E1 settings

If you look closely, the mouse address is not the same as in Windows. In my case only the fifth group is different. We need the device addresses to match, so rename the file.

$ mv 84:AB:D4:A2:{5F,5E}:E1
$ cd 84:AB:D4:A2:5E:E1/
$ ls
attributes gatt info

Now open the info file for editing and update the keys values. The relation between Windows and Bluez keys format is as follows:

At the end you should get this.



Save the changes and reboot. From now on Debian and Windows will connect the mouse automatically. Awesome!

P.S. Mygod was nice to turn the instructions into a Python script, try it out.

Force Qt apps to use the currently selected Gnome 3 icon theme

Wednesday, February 26, 2014

Gconf, Dconf, Gsettings too many settings storages for Gnome. Although the latest Gnome 3 uses GSettings only, Qt 4.x still relies on Gconf from Gnome 2.x. So changing the icon theme in Gnome 3 doesn't affect Qt apps. What you need is to copy the theme name from Gsettings to GConf via this command:

$ gconftool-2 --type=string --set "/desktop/gnome/interface/icon_theme" `gsettings get org.gnome.desktop.interface icon-theme | tr -d "'"`

and restart the Qt app.

How to paste from PRIMARY selection buffer via keyboard shortcut

Monday, February 17, 2014

In your desktop environment of choice, go to keyboard shortcuts setting and create a new shortcut with the command:

$ sh -c 'xsel | xvkbd -file - 2>/dev/null'

and set the desired key combination.

Using Focusrite Scarlett 18i6 in Linux, Part II

Thursday, August 8, 2013

Earlier I posted how to patch ALSA for Scarlett. Apparently it didn't work for everyone.

Didn't work quite well for me either. Every time I put my computer to sleep, after resume Scarlett lose the connection and there was nothing I could do to bring it back, except rebooting the computer. I got so tired of it that I even switched to internal sound card on my motherboard.

Recently I found another way that some may find suitable too. Digital inputs! That's right, if you're okay to use Scarlett for playback only and you value the sound quality, digital inputs is the way to go. Scarlett has two options in fact, ADAT via TOSLINK and S/PDIF via RCA.

Luckily my motherboard is equipped with S/PDIF as well, TOSLINK and internal S/PDIF connector. Some motherboards may have ready S/PSID RCA output on rear panel. At least I had to spend 30 min with soldering iron to get a bracket like this:

Boot to Windows and enable S/PDIF inputs in Scarlett MixControl panel, if they are not enabled for some reason yet. Scarlett will remember the settings, so no need to do it again. Enjoy!

<- Newer Posts Older Posts ->