Corrupted ODS-File

I have had the exact same problem as Azman did, and he found the solution and described it here [1]. After reading his post I’ve decided to take the shortcut and install the xmlindent package first. So here is my approach:

# cp FILE.ods BACKUP_FILE.ods
# unzip -p FILE.ods content.xml | xmlindent > content.xml
# vim content.xml
# zip FILE.ods content.xml

Thanks Azman, it helped me a lot!


SATA hotplug

Have you ever hotplugged a SATA Drive? With new mainboards udev will recognize the new harddisk with no effort, but if you use older hardware maybe you should check your BIOS (switch from IDE to AHCI mode) and type following command in your shell after replacing your SATA drives:

echo "- - -" >> /sys/class/scsi_host/host[2|3|4]/scan

For more information and a safe unmount script look here:

Google Drive – Conditional formatting of entire rows

I was searching for a possibility to format entire rows or defined cells in condition to a formula or content of another cell. This is a really handy functionality of other spreadsheet programs. So I thought it should also be possible in Google Drive … yeah, but only with a selfwritten function. Here [1] I found the first hints and with the API [2] I finished mine:

function onEdit() {
var ss = SpreadsheetApp.getActiveSpreadsheet();
var sheet = ss.getSheetByName('Issues'); // Change to your own
var rows = sheet.getRange('a1:c');
var numRows = rows.getNumRows();
var values = rows.getValues();

for (var i = 0; i <= numRows - 1; i++) {
var n = i + 1;
if (values[i][2] == 'finished') {
sheet.getRange(n + ':' + n).setBackgroundColor('white');
sheet.getRange(n + ':' + n).setFontColor('lightgrey');
else if (values[i][2] == 'new') {
sheet.getRange(n + ':' + n).getCell(1,2).setBackgroundColor('yellow');
sheet.getRange(n + ':' + n).setFontColor('black');
else if (values[i][2] == 'workingOn') {
sheet.getRange(n + ':' + n).getCell(1,2).setBackgroundColor('red');
sheet.getRange(n + ':' + n).setFontColor('black');
else {
sheet.getRange(n + ':' + n).setBackgroundColor('white');
sheet.getRange(n + ':' + n).setFontColor('black');

function onOpen() {
var ss = SpreadsheetApp.getActiveSpreadsheet();
var sheet = ss.getSheetByName('Issues'); // Change to your own
var sortRange = sheet.getRange('a2:c');
sortRange.sort([{column: 1, ascending: true}, {column: 3, ascending: true}]);

Hope it helps you too!


arch latex bug

hey folks!

Have you got this nasty error message?

This is pdfTeX, Version 3.1415926-2.5-1.40.14 (TeX Live 2013/Arch Linux) restricted \write18 enabled.---! /var/lib/texmf/web2c/pdftex/latex.fmt doesn't match pdftex.pool(Fatal format file error; I'm stymied)

Then you should do the following:

… copying the *.pacnew files in /etc/texmf over the non .pacnew files and running fmtutil –all fixes the issue.

Found here:

Grub 2 and the VGA parameter

It was annoying to have only a resolution of 640×480 in the virtualbox instance of my new debian virtual instance. So I have had to do something. Here [1] I found the solution of the already well known problem:

In Grub2 the vga= parameter is deprecated.

To set a screen resolution for your console you can do the following log in as root

edit /etc/default/grub uncomment the GRUB_GFXMODE=640×480 and change the resolution to something you can use e.g. 1024×768
Add the line
to the file to have the same resolution at the Linux console. You do not edit the 00_header file as some suggest you need to do.

run update-grub

run reboot to confirm that your changes worked!


how to restart udev

hey folks,

if you need to refresh your /etc/udev/rules.d/config.rule and for example add some embedded devices, take your editor and do so:

#EnergyMicro J-Link Device
SUBSYSTEM=="usb", ATTRS{idVendor}=="1366", ATTRS{idProduct}=="0101", GROUP="users", MODE="0666"

if you don’t want to restart your service or reboot your machine to enable your changes, here is a really handy command:

udevadm control --reload

happy coding and developing!

Logitech K400r and the missing middle mouse button

Recently I bought me a new wireless keyboard. Reason was the advice of my physiotherapist to improve my sitting posture at work, so she told me to place the monitor in eye level and the keyboard and mouse near the edge of the desk. But this is not really easy with a notebook. Therefore I searched for a lightweight keyboard with an integrated touchpad: Logitech K400r won the selection.
The keyboard is small so I need to getting used to it but it worked out of the box even on my new installed linux arch distribution. Only one thing was annoying: the missing middle mouse button. I need this little helper so much on a linux system, think only about the handy copy&paste function …

After asking google for help I was a little bit disappointed, because “neojam” [1] wasn’t able to activate/find a way to use the middle mouse button. But I was willing to find a way.

First of all I thought about the possibility to map keys with xmodmap. So I started xev to realize the proper code for the middle mouse button. This approach led to nowhere, because clicking both mouse buttons on my laptop was indicated as “button2″ but not on the K400r, there I got only “button1″ and “button3″. So I searched for a possibility to map the simultanouse clicking of both buttons. I found the hint to use the “Emulate3Buttons”-Option in the xorg.conf. The default set of this configuration is disabled, but I didn’t want to enable it for the generic mouse InputDevice. This site [2] helped me to remember the “MatchProduct”-Option for special configuration of InputClasses in the xorg.conf. With the xinput list command I got this output:

$ xinput list
⎡ Virtual core pointer                        id=2    [master pointer  (3)]
⎜   ↳ Virtual core XTEST pointer                  id=4    [slave  pointer  (2)]
⎜   ↳ SynPS/2 Synaptics TouchPad                  id=10    [slave  pointer  (2)]
⎜   ↳ TPPS/2 IBM TrackPoint                       id=11    [slave  pointer  (2)]
⎜   ↳ Logitech Unifying Device. Wireless PID:4024    id=13    [slave  pointer  (2)]
⎣ Virtual core keyboard                       id=3    [master keyboard (2)]
    ↳ Virtual core XTEST keyboard                 id=5    [slave  keyboard (3)]
    ↳ Power Button                                id=6    [slave  keyboard (3)]
    ↳ Video Bus                                   id=7    [slave  keyboard (3)]
    ↳ Sleep Button                                id=8    [slave  keyboard (3)]
    ↳ AT Translated Set 2 keyboard                id=9    [slave  keyboard (3)]
    ↳ ThinkPad Extra Buttons                      id=12    [slave  keyboard (3)]

So I only had to add this stuff to my xorg.conf:

Section "InputClass"
    Identifier      "Logitech K400r"
    MatchProduct    "Logitech Unifying Device. Wireless PID:4024"
    Option          "Emulate3Buttons" "yes"

And finally my precious middle mouse button worked also on my new keyboard 8-)