Answerblog archive

What was the name of the first opera?

2007-10-29 23:33

This question is straight from my server logs, and since I don’t know the context of the question, I’ll answer both.

Opera, the music: The name of the first opera is, according to Wikipedia, Dafne by Jacopo Peri — a quote from Wikipedia says:

The word opera means “work” in Italian (from Latin opus meaning “work” or “labour”) suggesting that it combines the arts of solo and choral singing, declamation, acting and dancing in a staged spectacle. Dafne by Jacopo Peri was the earliest composition considered opera, as understood today. It was written around 1597, largely under the inspiration of an elite circle of literate Florentine humanists who gathered as the “Camerata dé Bardi”. Significantly, Dafne was an attempt to revive the classical Greek drama, part of the wider revival of antiquity characteristic of the Renaissance.

And for Opera, the browser: The first version of Opera, the browser, was called Multitorg Opera and was initially a research project at Telenor. A brief history of the browser is on Wikipedia’s Opera entry, but Multitorg doesn’t seem to be mentioned. Wikipedia’s guidelines and my moral compass forbids me from editing the page to correct the omission of the Multitorg name, but feel free to edit this on your own.

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.

HOWTO: Painless markup validation with Opera and Ubuntu

2006-10-03 15:18

Opera has a rather neat feature for validating markup. By pressing Ctrl-Alt-V or if you right click on a page and select “Validate”, you send off the data to the W3C validator.

However, if you ever work offline, or you, like me, work with markup that shouldn’t be transmitted to external sources, or if you want a validator that responds immediatly, there is a better solution: Installing the validator locally. Here’s how to install the validator locally in Ubuntu, and then configuring Opera to use the locally installed validator instead of the external one.

Installing Apache and the validator

The first thing you’ll have to do, is to install Apache and the w3c markup validator on your local system. Type the following in a terminal:

sudo apt-get install apache2 w3c-markup-validator

apt should take care of all needed dependencies for you. When installation is finished, continue to the next step:

Configuring Apache

(Updated: The previous version edited /etc/apache2/apache2.conf directly, which is a bit more messy if you feel like disabling the service later)

Next, you will have to add the validator to your Apache configuration by adding the validator configuration as a virutal site:

sudo gedit /etc/apache2/sites-enabled/validator.conf

When you have the file open in gedit, insert the following into the file:

ScriptAlias /w3c-markup-validator/check /usr/lib/cgi-bin/check
ScriptAlias /w3c-markup-validator/checklink /usr/lib/cgi-bin/checklink
Alias /w3c-markup-validator /usr/share/w3c-markup-validator/html

<Location /w3c-markup-validator>
  Options +Includes +MultiViews
  AddHandler server-parsed .html
</Location>

Save and close the file. To start the validator, you now have to restart apache. Again, by going to the terminal:

sudo apache2ctl restart

Verify that you have the web server and the validator running by visiting http://127.0.0.1/w3c-markup-validator/

Configuring Opera

The final step is configuring Opera. Go to the Opera configuration editor: opera:config#UserPrefs|ValidationURL (clicking this link should be just fine). Replace the contents of the input field Validation URL, that has the following default content …

http://validator.w3.org/check

… with

http://127.0.0.1/w3c-markup-validator/check

Now, click “Save” in the configuration editor, and close the configuration page. When you now press Ctrl-Alt-V when visiting a page, Opera will now open the validator on your local system, hopefully saving you some time in the process.

Opera Mini mind tricks

2006-01-24 19:25

I use Opera Mini absolutely everywhere: If I’m waiting for someone, if I’m at the bus, if I’m having a discussion (or rather, when I want to end a discussion), and I’ll give a few hints as to how I use it.

  • I have set up a portal page with a few searches on mini.virtuelvis.com - and I might possibly be adding a micro-aggregator there to have the most important sites I use (The site might not have propagated to your DNS yet) — I use Google directly from the front page
  • When I scroll, I use Joystick Left and Joystick Right to go Page Up and Page down — it’s much quicker than moving one line at a time.
  • The * key toggles toolbar display on the hi-fi version between a regular view, reduced toolbars and full screen. I almost always use the reduced toolbar view, as it still gives me a page title and clock.
  • The #, 3 shortcut is a killer shortcut when reading news sites, as it takes you to the start of the page content.
  • #, 4 takes me to the start page.
  • #, 9 to search Google.
  • There are numerous other keyboard shortcuts — learn them, and use them.
  • Depending on the phone I use Opera Min oni, I turn on “small fonts” to cram in more information. On some phones the writing becomes to small, and on some it works great.
  • I only occasionaly turn on “High quality” for images, as the regular quality saves a lot of bandwith
  • On my series 60 phone, I never quit Opera Mini, in order to have instant availability.

My list of killer web sites for Opera Mini are found in my personal portal.

Have fun

Where are the Opera headquarters?

2006-01-11 20:03

Link: Where are the Opera headquarters?

Have you ever wondered where the Opera HQ is? Look no further. The tilted, L-shaped building (or is that a mirrored ‘F’?) to the west of the river and north of the main road is Opera software.

How to disable sound in Firefox?

2005-04-16 10:36 – Ten comments

From the answerblog: How to disable embedded audio in Firefox using the Adblock extension.

How to redirect output and errors to /dev/null?

2005-04-13 01:28 – Two comments

Handy little trick to ensure that both standard error, and standard output are redirected to /dev/null, so you never have to see error mails from your cron jobs again.

How do you pronounce quark?

2005-02-15 15:35 – Two comments

When you want to check the pronounciation of a word, checking an online dictionary like Merriam-Webster Online is an excellent idea.

Who created CSS? CSS Early History

2005-01-05 23:37 – Ten comments

An answer to the question of who created CSS/CSS1, and a recollection of CSS history prior to CSS1

Why are people switching from Internet Explorer?

2004-12-13 18:41 – 16 comments

Why do people switch from Internet Explorer? Why did you switch from Internet Explorer?

CSS rounded corners without images

2004-11-20 21:37 – 12 comments

Rounded corners without images: The CSS3 solution, and the non-solution offered by Mozilla/Firefox