Linux archive

Norway mandates open formats

2007-12-19 15:59

According to this article (Norwegian only, sorry) on digi.no the Norwegian government has mandated the use of open document formats from January 1st, 2009. I’ll give a brief overview of what the article actually says.

There are three formats that have been mandated for all documentation between authorities and users/partners, namely:

  • HTML for all public information on the Web.
  • PDF for all documents where layout needs to be preserved.
  • ODF for all documents that the recipient is supposed to be able to edit

Goverment, state and regional agencies, authorities and services may also publish in other formats, but they must always publish in one of these formats. The decree is retroactive, and by 2014 all documents published prior to this decree must have been converted and made available in one of the three formats.

While the decree doesn’t mandate any format for internal documentation, I still have hopes that every interested party will standardize on the same formats for internal use as well, and it is also my hope that a real competitive market for information systems is created.

Either way, for me as a dedicated user of Linux, proponent of open formats and standards, this is delightful. I’ll end it with a quote from our minister for information technologies, Heidi Grande Røys, with some emphasis added from my side:

Everyone should have equal access to public documents. From 2009, every citizen will be able to choose which software they want to use to get access to public information. The goverment’s decision will also improve the terms of competition between software providers. In the future, we will not accept that govermental agencies lock the users of public information to closed formats.

YAY!

Semi-automatic offline synchronization of a digital media player

2007-10-29 14:33

When writing this post, I initially titled it “I ♥ rsync”. And I really, really do. Through the magic of rsync and a couple of scripts for Nautilus, I now have more-or-less automated synchronization of my Rockbox-equipped media player.

And it’s so easy, you can do it on your own in a few simple steps

How it works

My solution works by adding a few nautilus scripts that do two things:

  1. Create symbolic links in a (predefined) directory, so you can sync this folder with the mp3 player. This is achieved through selecting files and folders for synchronization in Nautilus, and using a context menu script to create the actual links.
  2. Perform the actual synchronization. Also done with a simple context-menu Nautilus script (that can be run from a shell, if wanted).

Prerequisites

The first prerequisite here is actually that you have some familiarity with the shell, and that you have a backup of the important files on your media player. I have not devised this way of synchronization for the feeble of mind, or the ones with no backup, or able to restore their device, should this method leave it unusable. See the warning at the end of this post.

The first thing you need to do is to download the create_symbolic_links
nautilus script from the G-Script repository, and save it to the .gnome2/nautilus-scripts folder. From a shell, you can do it this way:

$ wget -nv -O ~/.gnome2/nautilus-scripts/create_symbolic_links http://g-scripts.sourceforge.net/nautilus-scripts/File%20System%20Management/create_symbolic_links

Next, you need to create a directory into where you want to sync. I have called mine “rockbox”

$ mkdir ~/rockbox

Further, we now need to slightly modify the script we downloaded, so that it syncs in to the correct directory:

$ sed -i "/\/Desktop/rockbox" ~/.gnome2/nautilus-scripts/create_symbolic_links

Now, we need to make the script executable:

$ chmod +x ~/.gnome2/nautilus-scripts/create_symbolic_links

Installing zenity

The symbolic links script requires Zenity to display dialog boxes, and we need to install it

$ sudo apt-get install zenity

Common steps for all devices using Rockbox

If you have a device using the excellent Rockbox firmware, you now need to copy your rockbox firmware directory to the sync folder you created in your home directory a few steps back:

$ cp -r /media/IPOD/.rockbox ~/rockbox/

This example assumes that your device is mounted on /media/IPOD. Note that this step is cruicial, or you might end up losing all of your customizations for Rockbox, and may end up with an unbootable device.

rsync with automated updating of the Rockbox firmware

If your digital audio player is equipped with Rockbox - follow these instructions. Otherwise, just skip to the next step.

First, go to the Rockbox build index, locate the correct rockbox firmware, and copy the link to that firmware. Next, copy the contents below to a file, that you save as ~/.gnome2/nautilus-scripts/Sync_now

#!/bin/bash
rsync --delete --force -irKLtWvu /media/KABOOM/.rockbox/ ~/rockbox/.rockbox/
wget -nv -O ~/rockbox/rockbox.zip http://build.rockbox.org/dist/build-ipodnano/rockbox.zip
unzip -quo -d ~/rockbox/ ~/rockbox/rockbox.zip && rm ~/rockbox/rockbox.zip
rsync --include=.rockbox -irKLtWvu --delete --force ~/rockbox/ /media/IPOD/

Remember to change http://build.rockbox.org/dist/build-ipodnano/rockbox.zip to the actual rockbox URL for your model, or you might end up with an unbootable media player. Also, if your device mounts somewhere other than /media/IPOD/ remember to change it (and keep the trailing slashes in the path). Ditto for the ~/rockbox/ directory.

Remember to make this script executable:

$ chmod +x ~/.gnome2/nautilus-scripts/Sync_now

rsync for all other devices

If your player is not using rockbox, or you do not wish to update your firmware automatically, the ~/.gnome2/nautilus-scripts/Sync_now.sh script is simply a few lines shorter:

#!/bin/bash
rsync --include=.rockbox -irKLtWvu --delete --force ~/rockbox/ /media/IPOD/

rsync and whole-file synchronization

Those already familiar with rsync may notice that I’m only syncing whole files, instead of syncing only bits and pieces of them. When I originally tried using the rsync algorithm, I couldn’t unmount the device afterwards, getting complaints about too many file handles being open, and I ended up corrupting the contents of my iPod upon forcing an unmount, so this is a “better safe than sorry” approach.

Restart Nautilus

To make the scripts visible in Nautilus, you need to restart Nautilus

$ killall nautilus

There should now be a “Scripts” submenu in the Nautilus context menu, where your scripts are available, and you can start using the tools. When you want to make a folder available on your iPod or other media player on next sync, you select the files/folders and choose Script>create_symbolic_links. You will be prompted for a “new name” for every file, and usually, just selecting the default option should be good enough.

When you are finally ready to sync with your iPod, just select “Sync_now” in the menu, and synchronization automatically commences. You will not be given any further progress, so you can follow whatever progress meter your device offers, to decide when to eject/unmount.

A word of warning

The method outlined here leaves your media/mp3 player as a perfect replica of the folder you synchronize to. This means that files that were on the media player before synchronization, but weren’t present in the folder on disk, will be gone after synchronization, so you really want to ensure that you have copied those files that you need copied back to the device to the synchronization folder (the one named ~/rockbox/ in these examples). Don’t say I didn’t warn you.

Gotchas

This method does not currently attempt any sort of disk space checking, so you might very well end up running out of disk space during the process, if you aren’t careful. To check if you have enough disk space to perform the synchronization, you can cd in to the directory containing the files you want to sync and do this:

$ du -hLs

Which will list the size of all the files you are about to put on to your device. Compare this number to the “Size” column for your that shows up when you do a df -h with your device mounted. To be on the safe side, you would ideally have a 0.1-0.3GB difference; your device likely uses FAT32, and therefore wastes a bit of free disk space for every file. (On a 4GB iPod Nano, a 0.1GB difference translates into having only a few MB free after synchronization.

Opera 9.5 alpha, Kestrel, released

2007-09-04 14:44

Ok, I never got around to blog the release of Opera Mini 4 beta 2 — apologies for that. Let me instead introduce you to Opera 9.5 Alpha - a.k.a. Kestrel.

A quick overview is available on a separate product page

So, what’s new? In a nutshell:

  • History search
  • Bookmark synchronization
  • Dramatic performance improvements
  • Web site compatibility improvements
  • Improved standards support
  • Huge improvements to M2

The Changelog

I wish I could get through all of the changelog here, but I’m afraid it’s way too long, and I could blog until 2011 about it, in which case Kestrel would already be severely out of date. Instead, I’ll just give you the links.

So, let’s go through some of the changes

History search

I’ve lost count of the times in the past, when I’ve visited some page, somewhere, and have been totally unable to remember where it was, on what domain, or even what the document title was. In other words, finding what I have already visited has been a very hard task, bordering on impossible. Enter history search.

History search from the task bar

With history search, Opera creates a full-text index of each and every page you visit, and when you go to the address bar, you can simply start entering words you know have been on pages you’ve visited before, and items matching your search show up. It’s a kind of magic, really. At least compared to what browsers have done in the past.

Not only can you do this, but there is also an internal web page, named opera:historysearch that gives you a more traditional web search interface that allows you to bookmark your searches. Speaking of which …

Bookmark synchronization

Bookmarks have changed in Kestrel. In the past, the only way to get your bookmarks from machine to machine was to export the bookmarks, copy the opera6.adr file, or use external software to transport them. In Kestrel, you simply log in with your My Opera account, and sync your bookmarks, speed dial items and personal bar with the server (The synchronization is using https, fwiw, so you don’t need to fear that your data are being compromised).

So, you may say “I never use two computers, why should I sync?”. Real men don’t do external backup. They just cry a lot - when their offices catch on fire!. That’s why.

M2

I have been absolutely dependent on M2 as my mail client for years, but it has had a number of annoying issues, related both to IMAP, and to indexing, where I’ve seen mail go into the wrong access point for no reason. I’m happy to report that I haven’t seen any such issues with mail with Kestrel for a long time.

Keyboard shortcuts

Now, this change is probably somewhat controversial for old-time Opera users, since they probably have single-key shortcuts as part of their muscle memory. For newcomers, though, Opera is going to feel a lot less alien, as all single-key shortcuts have been removed in the default setup. This prevents these newcomers from performing accidental navigation, or from changing their browser’s settings without knowing how.

Those oldtimers who want the old setup back, can do so, though, by checking the box in opera:config#UserPrefs|EnabledExtendedKeyboardShortcuts (Alternatively, by going to Preferences->Advanced->Shortcuts and and check “Enable single key shortcuts”.)

Now, on to more developer-related stuff

Selectors

Kestrel has top-notch support for CSS3 selectors, as shown in this demo.

Backgrounds

Kestrel has also added support for SVG in background-images, plus support for the background-size property. David Storey has created an extremely nice demo, also including a showoff of Opera’s extended selector support (mirrored with permission, as the My Opera file store doesn’t allow external referers).

Overflows

Opera now support both the overflow-x and overflow-y from the CSS3 box model specification. This both improves web site compatibility, since there are a few sites out there that use this, and it allows you, as an author improved control over those scrollbars.

getElementsByClassName

Library vendors, take note. Opera supports getElementsByClassName natively. This should allow for even faster selectors.

Dynamic media queries

In Kestrel, CSS3 Media queries support has improved, making them dynamic. For you, as a developer, you can now count on Opera actually applying the correct style when the user resizes his window, instead of re-rendering on a resize event. You can view this yourself here - note how the content changes in the max-width & min-width tests when you resize the window.

Getters and setters

Opera now supports Getters and setters from JavaScript 1.5.

Offline support

While Opera doesn’t yet implement a peristent storage, the Navigator.onLine is now supported, with window.online and window.offline events for when the value changes.

Spatial navigation

Controlling keyboard navigation can be a major pain in web applications, in particular if your application is on a device with “keyboard” as the only input device, which is the reality if you want to make web applications tailored to mobile devices, or you want to accomodate those unable to use a mouse. Opera support for these scenarios have improved in two ways.

First, Kestrel supports a custom CSS pseudo class -o-prefocus that applies to form elements that have been reached via spatial navigation, allowing for better styling. Further, Opera also now support four methods on the document object, document.moveFocusLeft(),document.moveFocusUp(),document.moveFocusRight() and document.moveFocusDown(), allowing you to initiate spatnav on regular keyboard events. I have put up a very simple demo that demonstrates a use of this property. When you navigate of the right end of a table, the code in the example moves the spatial navigation focus to the far left of the table row below. The code is not commented, but should be fairly simple to understand.

Text-shadow

Kestrel also adds (full) support for the CSS3 text-shadow property. Unlike WebKit’s support, Opera supports multiple text-shadows, comma-separated (More precisely: You can have 12 of them).

There’s more?

Yes. There’s lots more, and like I said, I could continue posting stuff from the aforementioned changelog until 2011, now go download a build for unix, Mac or Windows

Have fun.

Search-based interfaces

2007-08-10 12:34

In the up-and coming version of Ubuntu, Gutsy Gibbon, there are new and better document search facilities. This is not without problems: Upon upgrading one of my computers to Gutsy, I noticed that random applications would slow down, and even stall totally on my system.

My question is: Are such features really needed? In my 26+ years of owning and using a computer, I have never searched my filesystem for random content in any of my files, save grepping through known sets of files.

Which brings me to the real question: is this a feature that users actually want or need? Input from Mac and Windows users especially welcome: Do you use these features, or would you prefer for your system to instead speed up?

Three and a half years ago, I was as wrong as it's humanly possible to be

2007-06-05 23:15

Roughly three and a half years ago, I wrote a blog entry titled Why Linux has failed, and why Linux will fail again. Roughly two years ago, I switched — to the operating system I claimed had failed, and would fail again. Linux. Ubuntu to be precise.

Recently, Mark Pilgrim blogged about his first year with Linux and Sam Ruby followed up with his May 2005 switch.

So, what has my experience with Linux been, and how does it relate to my previous issues. Let’s reexamine what I wrote about Joe Phobic:

Joe has:

  • Never customized windows. Not even changed the default resolution.
  • Never touched the control panel.
  • Never used the command line.

During my 2005 switch, I:

  • Never had to customize Gnome itself. I made one customization to Nautilus, to prevent it from opening a new window for every folder I selected
  • Never touched the control panel, save perhaps from setting the screen saver, and resetting the resolution when I replaced a monitor
  • I did use the command line. But I was in no way forced to. I did so out of choice, and I did so to reconfigure X after I had rather royally hosed my own xorg.conf (but I’m not Joe Phobic, either).

… so it’s pretty safe to assume that my assumptions about whether Joe Phobic could handle this was wrong. Elaborating, saying something about what I didn’t write back then:

  • Ubuntu came preinstalled with all of the applications Joe would need. He could be as phobic as he wanted, because he had replacements for all of his applications
  • The cost of switching window manager to Gnome from Windows is for all practical purposes zero. He doesn’t have to relearn much, save for icon positions.
  • There’s more, I’ll get to that later.

Further, I wrote, while having spent some time on a system, trying to locate a simple calculator:

This is where Linux fails. Miserably. Linux is about freedom. A different kind of freedom. It’s freedom to choose to use any one of seven text editors to perform the same task. It’s the freedom to choose any one of several ridiculously complicated Window Managers. It’s the freedom to choose any one of two or three IDEs. It’s the freedom to install lots of perpetually unused servers.

… and, the money quote …

Windows is all about freedom. Windows is freedom from complicated choices, it’s freedom from having to learn something new, something not really relevant to the task you want to do.

I will spare you the pain (or amusement) of giving me an embarrasing reward for being silly: The undersigned is hereby awarded the price for “Most embararssing remark about operating systems, freedoms and choices”.

In July 2005, when I switched, I spent a full four to five hours getting a Windows 2000 system that hadn’t been booted for three months back into a usable state. I spent lots of time trying to kill update managers that caused nothing but network congestion and high CPU use. I spent time dismissing dialogs. I didn’t feel free then. Nor did I feel free the time before that, when I hosed my Windows registry, because I yanked an IDE cable from a running system. I learnt a lot about restoring, no make that finding various ways of failing to restore a system whose every copy of the shackles called the “Windows Registry” had gone missing in action.

Neither did I feel free when I, a year after switching my work machine over to Linux, tried booting it, because I needed a firmware update for my mobile phone. Updating this phone’s firmware required Flash to be installed, and it required MSIE to be the default browser. So, after having gone through roughly the same update dance as I went through with the Windows 2000 system, I thought resetting the browser to MSIE would be trivial. Not so. It took manually editing the registry. It took uninstalling every single third-party browser on the system. It involved downloading a shoddy third-party application. It took a lot of cursing. And I presume it also took luck to get this working. And some more cursing. And boy, did I feel free.

And I am free. Like Mark, I love apt, update-manager and its siblings to death. I don’t compile software (Ok, I’ve done it once, to get a CVS version of some spec-related tools working). I have exactly two applications that aren’t updated with the rest, Komodo Edit and Opera. And the latter one is by choice, because I run internal versions, and as such there is no point in me using the repository versions. That leaves it down to one application not automatically managed, updated, and taken care of. Across operating system upgrades. With all of the user data kept. I also (apart from a few text editor) have only one of each application, but they fill distinctly different needs, and I have all the software I need out of the box.

Linux has given me both freedom of choice, and freedom from choice. Windows never offered me “of”, and it only ever pretended to offer me “from”. On my personal computers, I only have Linux installed. I keep the XP partition on the work computer around, just in case. I don’t expect to boot it often, I hope I don’t have to boot it often.

A message to the GTK+-developers

2007-05-07 14:14 – Two comments

Message to GTK+-developers: Changing certain keyboard shortcuts requires one little piece of research: Make sure that your changes doesn't break functionality in important applications.

Command-line usability

2007-03-06 15:18 – Leave a comment

Command-line usability in practice at work in update-manager

Just gimme a good editor, dammit

2007-03-05 16:32 – 15 comments

I'm on the lookout for a new (Linux/Gnome) editor, for mainly working with editing angle brackets, JavaScript and Python. Can you help me?

Using Quod Libet with Rockboxed iPods

2007-02-04 20:14 – Leave a comment

The sad state of media players, part II

2006-11-28 19:39 – Nine comments

A review of media players first suggested to me in "The sad state of media players, part I" - the state is not all sad. Here is the roundup of the good, the bad and the ugly.

The sad state of media players, part I

2006-11-26 09:39 – Ten comments

I've been looking for a media player/manager for Linux for some time. And during that time, I've become increasingly frustrated. Isn't there one such application that doesn't suck fiercly? In this first part of a two-part blog entry, I'll cover the requirements for a media player/manager.

A truly open Linux phone with GPS debuts

2006-11-08 12:09 – Leave a comment

Mark Pilgrim reviews gNewSense Linux

2006-11-07 10:00 – Leave a comment