Archive for the ‘software’ Category

Remove protection of OpenOffice/LibreOffice spreadsheets

Wednesday, May 2nd, 2012

Sjouke and I just ran into a minor hitch with a spreadsheet: some cells were protected, and in the new Ubuntu / Open/LibreOffice version they just looked plain wrong.
How to fix this?
Turns out that protection isn’t that hard to break. In a nutshell, an .ODS file is very much like an EPUB file — it’s also a ZIPped file which also contains a structure with a mimetypes file and a content.xml file.

To remove protection, edit contents.xml and change the attribute *protected="true" to say false. Rezip the file in the correct way, that is: store mimetype uncompressed as the first file, the rest doesn't really matter. Et voila, you have removed protection!

In a nutshell:

mkdir tmp
cd tmp
unzip ../FILE.ods
sed 's/protection="true/protection="false/g' content.xml c2.xml
mv c2.xml content.xml
zip -0X ../FILE-unprotected.ods mimetype
zip -r9 ../FILE-unprotected.ods * -x mimetype

ZSH tricks

Monday, April 30th, 2012

ZSH logoFor a while now I’ve been wondering how to do the equivalent of jot (which generates a list of numbers) in ZSH. It’s pretty obvious that ZSH could do such a thing, but how? Jot isn’t installed by default, and I am lazy. Lazy enough to never look into it.

For a change, I did. Success! Here is one way to do it, which is sort of elegant:
while (( i++ < 10 )) { echo i is $i; }
Do note the remarks on the above link: playing around with the syntax might kill it quickly.
Using repeat might be neater, but that's only when you just need to iterate (and not keep track of the iteration).

Gnome tidbits

Wednesday, April 25th, 2012

Gnome logoJust came across 2 tidbits. One wasn’t enough to post, but two… I had to ;-)

1. Remove annoying “hover over me” scrollbars

(From WebUpd8.)

In the newer versions, Gnome did away with the scrollbar. There is this scroll-hint which, if you hover over it, changes into something with buttons. Which you cannot click, because the exact center of the two buttons (up/down or left/right, depending on vertical/horizontal scrolling) is projected below your mouse.
It is annoying. It confuses me every single time. But, the good news: it is not necessary.

  • Fix 1: sudo echo "export LIBOVERLAY_SCROLLBAR=0" > /etc/X11/Xsession.d/80overlayscrollbars
  • Fix 2:
    1. apt-cache search 'liboverlay-scrollbar', and remember these packages (e.g. as $PKG-TO-DELETE),
    2. sudo apt-get remove overlay-scrollbar $PKG-TO-DELETE.

The search gets around the problem of slightly different package names (version number changed) between Ubuntu 11.04/11.10/12.04.
On a related note: stop putting your version number in the package name!

Split Nautilus window in two for easy moving

(From a Slashdot comment)

Either fix ought to work. The first leaves the packages and modifies behaviour, while the second nukes the functionality. Haven’t tried either yet, curious though.

Ever need to move a file from one place to another?
Open Nautilus (i.e., “Places”). In the window, press F3.
Ta – (explitive deleted) – daaaa!

Wish I had known that sooner.

Updating Thunderbird on Ubuntu

Sunday, April 15th, 2012

Thunderbird logoMy Ubuntu 11.04 at home was still running the old Thunderbird. The old, end-of-support-almost-reached Thunderbird. Time to fix that. Lessee, open Thunderbird and look for “update”… nope.
Hmms, get updates for Ubuntu then? … nope.
Hmms. Okay, let’s do this the hard way. Download the new TB, run it… hey, that looks a lot like my old TB! “Help > About”… it is my old TB?! WTH?!
Okay, turning to the Google for more updates.
Aaah, here’s how it’s done: tell your system updater to include packages from Mozilla, and then it should work.
Test one: err, nothing to update?
Test two (a few days later, different package-address included): still nothing??
You know what, this is silly.

And just when I was ready to give up:

  • sudo add-apt-repository ppa:ubuntu-mozilla-security/ppa
  • sudo apt-get update && sudo apt-get install thunderbird

Apparently, there are all sorts of mozilla-related valid words (e.g., combinations with “security” and “release”) you can enter after “ppa:”. Some of them work , but don’t update your system. Such as the aforehinted mozilla-security-ppa and mozilla-release-ppa. This one does.

@Mozilla: is this really necessary? Just provide some sort of warning with pointer to the right location in the non-updating PPA’s, would you?

Hiking ebook finished!

Sunday, January 29th, 2012

kindle logoI finished the ebook project! When I started with this, I just got all of the files together and pressed “convert” in Calibre (an ebook manager). That crashed my PRS-T1 though :s.

After the holidays, despite it being too late to be of use now, I still had an itch to scratch. Well, I scratched it :) Took me a while and it got me back into sed-scripting (this page was a wonderful resource). Why sed-scripting? Well, I wanted to basically do “batch”-vi – that is, use the power of search-and-replace with regular expressions over a group of files. Roughly, there are 3 straightforward options: Perl, sed, and awk. Of these, I picked sed — it allows you to just type your regexps just as you would in vi :) Of course, they got a little more complicated after a while:

# row for total distance
/Total distance:<.td>$/ {
	N
	N
	N
	s/\n/ /g
	s#\s*\(Tot.*tance:</td>\) \(.*\)#<tr><td>\1<td>\&nbsp;</td><td>\2</tr>#
}

Not much, just a little. Near the end, several times I figured to be done when the lay-out on the devices themselves would be rather bad. But: no more crashing — definitely an improvement. And then, finally, the last tweaks were made, the last sed-script was run, and it was over! Hooray! To celebrate, I made two versions: one for my Kindle DX version (mobi) and one for my Sony Reader version (epub). (No clue if there’s any specific tweaks Calibre adds based on the device, but you can select specific devices for the “output profile”, and I did.)

If you’re interested in a copy of the book, drop me a line.
And, as a bonus, here’s the cover of the book: a photo of La Palma from the International Space Station.

cover

Tuxguitar working :)

Saturday, January 28th, 2012

playing guitarFor my birthday (a while ago, I admit it :), Aga thought about getting me Guitar Pro – a piece of software that can help you with guitar playing. Somehow. The trial version on Aga’s laptop looked pretty cool, but I had two hesitations:

  1. Will it run under Ubuntu?
    That’s kind of paramount for me…
  2. Will I actually use it?
    If people are going to spend money on my behalf and I get a say in it, I’d like to make sure they get value for money.

The first point is easily settled with a quick Google… except it isn’t. As in: the company says “yes”, plenty of users complain. Hmms. But, in the course of googling, I stumble upon TuxGuitar, a freeware project doing roughly similar things. (Note that development seems to have ceased 3 years ago…). Installed it, but: no sound. For a tablature editor (or any musical score editor, for that matter) lack of sound is of course the death knell. Tweaked around with the various settings, unplugged and replugged cables, but to no avail. Left it alone for a long while, and then realised I didn’t do the obvious: complain to google. I do, and indeed, the first hit solves my problems! Turns out Ubuntu doesn’t come with midi support by default. Makes sense, probably. Anyway, let’s add some!

In a nutshell: install TiMidity, a piece of software so finished it hasn’t been updated since before 2005 ;-). Then, run TuxGuitar, tweak the settings to use a TiMidity midi port as output, test, et voila! (In case of absence of Voila!, choose a different midi port and repeat).

Now to find out what this TuxGuitar thingy actually does

Time in Thunderbird

Monday, October 17th, 2011

Thunderbird logoThe time of messages in Thunderbird always used to be annoying (i.e. non-24hrs format). This post explained what that’s due to: Thunderbird takes your default locale and presents time in the view due to that.

Somehow, the default locale it took was not my default locale (LC_ALL=C). So, to fix this minor annoyance, I changed the Thunderbird launcher to env LC_ALL=C thunderbird %u (where %u passes arguments — I just left it there).

Thunderbird default sort view fixed

Thursday, October 13th, 2011

Thunderbird logoOkay, so my previous post on the default sort behaviour of Thunderbird was largely correct — I just need to learn to read instructions better :)

In a nutshell, I set mailnews.default_sort_order to 22: sort by thread (where previously I tried 18 and other combinations of settings). Le duh. Now It Works(tm)

Thunderbird: attach file keyboard shortcut

Thursday, October 6th, 2011

Thunderbird logoKeyConfig addon, and configure a new key: CTRL+ALT+M as binding, code: goDoCommand("cmd_attachFile") (note: no “;” at the end!), and voila, you can attach messages with CTRL+ALT+M!

And yes, there’s a similar extension called Nostalgy, which hides this behind Esc+A. I tried it, and it worked… if I kept Esc pressed while pressing A. That’s awkward. This is way better :)

Ubuntu music player Banshee won’t stop.

Saturday, October 1st, 2011

Ubuntu logoThis thread and this bug are amazing. Apparently, “they” decided that when music is playing, and you close the player, the window will go away, but the music will continue. WTF?! Why the *BLEEP* did you think I was closing that window? Because I couldn’t find the damned minimize button???

Seriously, this “innovation” allows your computer to play music without any GUI. Nice huh? You clicked to start, but if you want to stop: open a terminal and issue a command (either banshee –stop or just kill the bastard).

I know the difference between a friggin’ minimize button and a close button. I want to quit the application, not the GUI. Stop treating me like a baby and stop thinking you know what’s best for me.

Edit: worst thing: you set it to play one song, quit the GUI, and it plays one song. And then the process sits there, wasting mem/cpu cycles. *ANNOYANCE*

Edit2: Okay, I’ll just give up on all these new-fangled media players. I never got the fad, I was curious, but with annoyances piling on annoyances… Let me just compile/install the old XMMS myself. Sure, nowadays it doesn’t play nice with the sound system. But it also quits when I tell it to — apparently an uncommon feature nowadays.