Ubuntu: Installing the Opera Browser via repository

It really is very simple, especially if you are familiar (like I was) with the Debian apt system. All you have to do for the 7.04 “Feisty Fawn” release as suggested by Ubuntu Community:

  1. Add the repository line to your sources.list by hand (sudo vi /etc/apt/sources.list && sudo aptitude update) or via the GUI (Applications -> Add/Remove… -> Preferences -> Third-Party Software -> Add… and don’t mistakenly hit “Revert” afterwards; hit Close!):
    deb http://archive.canonical.com/ubuntu feisty-commercial main
  2. Even though they suggest to search for “Opera” with the graphical user end (it’s called Synaptic Package Manager) it wouldn’t list it for me. So I went:
    sudo aptitude install opera
  3. Hit Enter for aptitudes question to install additional packages.

After the install run you find Opera listed in the Applications menu (in your Gnome desktop panel menu bar, i.e. upper left corner) sorted in as Internet Application. By the way, the standard keyboard shortcut for that menu is Alt+F1.

Edit: The code line above starting with “deb” is to be one single line!


Resizing Digital Pictures Made Easy

One might think it’s not that much of a task to resize a bunch of files in one directory so a certain dimention. Say you want to have all jpg images in your directory have width 1024 with aspect ratio maintained. For one image using GIMP actually this is easy. Just open it, go to image > scale image and type “1024” for width. That’s it. Knowing of GIMP’s batch mode feature I though: Well, now let’s just do this very same thing in batch mode for multiple files. Googling I found this passage Adrian Likins GIMP Batch How-To:

Batch mode is slow. Its not really a practical replacement for tools like ImageMagick or NetPBM when it comes to large scale image conversions or similar. At least not without writing some very clever scripts.
The problem with this approach is that gimp/script-fu has no built in procedures to iiterate though a list of images. So you cant easily tell gimp to load up *.jpg and run predator.scm on them, at least not without it taking a _long_ time.

There’s the solution, I thought. So I installed ImageMagick for Windows and made myself ready to run a Windows batch for loop on the files. After double checking against ImageMagick’s delivered help for convert I knew the syntax:

convert  -resize 1024

So far so good. But now comes the Windows batch bit. Even though fairly powerfull even compared with bash or other mighty script languages on Linux I couldn’t figure out how to run more than one command per iteration step. This is what I came around to, which does what intended, but without a pretty notice to the user that could have been done with adding something like ; @echo %i

for /f %i in ('dir /b *.jpg') do convert %i -resize 50% %i

Note that I chose to halve the pics rather than to hard-set the width so I don’t risk upright pictures to become bigger in file size than the original. There you go!

Update: I finally came around to do it with Linux. Here is the Bash equivalent to the above (plus an additional nice notification which is easy with Bash):

for i in *.jpg; do echo "converting \"$i\"..."; convert "$i" -resize 50% "$i"; done

Newer entries »