Lars’ Braindump

Unix and FriendsJune 8, 2010 1:33 pm

Sometimes you want to get rid of all these .svn or CVS directories (or whatever directories/files). Doing this manually is a pain, better use basic Unix commands. For instance:

rm -rf `find . -name ".svn"`

This recursively deletes all .svn directories, starting in the current directory. In a similar way you can delete all CVS directories, or all *.class files:

rm -rf `find . -name "*.class"`

or whatever. If you have an alias for the rm command (like alias rm=’rm -i’), which makes the rm command prompt before every removal, you can get rid of that prompting by prefixing the rm command with a backslash, like:

\rm -rf `find . -name "CVS"`

But make sure that you do not delete stuff accidentally here.

Unix and FriendsOctober 16, 2009 7:27 am

Since a few month I am now trying to work with Apple’s MobileMe service. My main motivation was the purchase of an iPhone, and I finally wanted to have a working and easy to use service managing and syncing my calendar and contacts. Unfortunately, so far it turned out to be one of the crappiest service I have ever seen.

To my setup: in addition to the mentioned iPhone I am mainly using Linux at home and in the office. It was not a surprise that Apple does only support Mail, Address Book, and iCal on a Mac, and Microsoft Outlook on a PC (Windows XP or Windows Vista). But, hey, they also have a Web client at http://www.me.com/, and for me a working web client seemed more than sufficient. So I was willing to pay the annual 79,00 € here in Germany.

The first major surprise was that Apple does only officially support Safari and Firefox browsers on a Mac or PC! WTF!

The last time I saw a message like "this site is optimized for Web Browser XYZ" is at least 5 years ago. Nowadays every run-of-the-mill web developer knows that restricting to a specific browser is a no-go. Not so Apple.

But at first I thought this might be more of a warning which can be safely ignored, like "we do not officially support it, but it works fine". Bogus! MobileMe is absolutely unusable at least under Firefox (and relatives) and Opera under Linux. Here are the main reasons:

  • Changes made to a contact or calendar get regularly lost. The browser constantly reloads the whole page, and then it comes to a surprise if your changes are still there.
  • The whole service is terribly slow.
  • Often the service does not work at all.
  • Basic functionality is missing, like dealing with calendar invites.

I would not even call this beta. This is just embarrassing. And you have to pay for this!

And, what is somewhat worst, your private data is handled absolutely irresponsibly. This became more than apparent a few days ago, when the Web client of MobileMe suddenly showed me the address book of a completely different person (I have no clue who this person is). Here a screenshot:
 

 

That were more than 100 names belonging to someone others address book, and at least the first one was also shown in detail. So, I wonder who sees my addresses once in a while… This is absolutely unacceptable, and one of the worst failures I have seen so far, brought to you by one of the leading software development companies.

For now I can only disadvice to use MobileMe, also not on a Mac or PC, since Apple seems to have serious problems running the service and ensuring your data security. And due to the resitrictive access policy to the iPhone’s app store, iPhone users are at the mercy of this crappy application. But there seem to be alternatives, at least for contact management, Funambol looks interesting.

Unix and FriendsJuly 17, 2009 5:44 pm

In this post I will collect some of my experiences with using the Samsung CLX-3175FW MFP under Linux. I will probably update this every now and then, just got it today (July 17 2009). I have here one Ubuntu 8.04 desktop wired to my router, and two Ubuntu 8.10 laptops connected wireless. First I connected the Samsung (I call it MFP from now) via cable to my router. It comes with a quick install guide, and the manual itself comes on CD. Strangely, I couldn’t read it on any Linux machine, they just showed an empty directory for the CD. But you can download it from the Samsung site.

The Linux drivers can also be downloaded from  the Samsung site. There are three archives:

  1. Unified Linux Driver (the basic thing you need to access the printer)
  2. Smart Panel Application for Linux (a panel application giving you some printing status)
  3. Printer Setting Utility for Linux (not sure what this is good for)

All can be unpacked in the same directory, they put all their stuff in a directory called ‘cdroot‘. Next, as root, execute cdroot/Linux/install.sh. You go through a bunch of questions, and then it does the magic, restarting CUPS and putting a bunch of files in /opt/Samsung. This is the important step, since it will put all the necessary files on your machine. It may happen that after this an "Add printer wizard" is started. This one did only work on the desktop machine connected via wire, the others did not manage to find the printer on the network after pressing "Search". Also choosing "Manual select" does not help here. But there is a simple solution, close the wizard and access the CUPS server via a web browser (http://localhost:631). Here, add a new printer, give it some name, and choose Internet Printing Protocol (ipp) as the protocol. Next you have to give the URI. You need to know here the IP of the MFP. One common way to find this out is to check the web interface of your router (look for connected devices), or you can use the MFP itself, there is an option to print the network configuration (look for IP-Address in TCP/IP). Once you know this, say 123.456.7.8, enter ipp://123.456.7.8. Then choose Samsung and then Samsung CLX-3170 Series (SPL-C) (en). That should do the trick, you should now be able to print. Note that you may want to change the paper size to A4 in CUPS (default is Letter)

To configure the printer itself you also need its IP, enter it in a browser, like http://123.456.7.8/. Here you can do all the setup. Clicking Printer Settings in the Smart Panel application will not work (unless you are root…).

To the wireless connection of the MFP. One slightly weird feature is that the MFP automatically connects to the first non-secured wireless network it finds. This is really lame, and I guess you do not want that. As mentioned above, I connected it via wire, but it staid connected to some unsecured network. To try out if it also works wireless I entered the access details of my wireless network, and it did not connect. After some trial and error I found out that I had to disconnect the wire first, then it connected to my wireless network. So, if you use a wire, make sure that it does not connect to some non secured wireless network!

What does not seem to work is to scan via the network, but using the scan to email function is a first workaround here.

So, at the end I could install the drivers on all three machines, and it makes a good impression, since it gives you access to a lot of features of the printer.

Update 04.01.2010:
After all I did not manage to get scanning via the network running natively under Linux. But you can use a virtual Windows for that, the following YouTube screencast explains how to set it up:

Samsung MFP in a Virtual Windows

Unix and Friends, German / DeutschMarch 6, 2009 1:45 pm

Es ist ja löblich, dass es den wirklich nützlichen Duden Korrektor 5.0 erstens für OpenOffice und zweitens für Linux gibt. Weniger schön ist, dass sich der Linux Support auf openSUSE (ab 10.3) und Ubuntu (ab 7.10) beschränkt. Unter Ubuntu lief die Installation auch problemlos, unter Fedora 10 wurde es dann teilweise problematisch.

Der Korrektor besteht aus zwei Komponenten, einmal der eigentliche Duden Korrektor der als OpenOffice Extension daher kommt. Hier ist die Installation auch unter Fedora kein Problem. Dazu kommt dann die Office-Bibliothek, welche den Duden beinhaltet. Um den Korrektor unter OpenOffice zu nutzen, ist die Office-Bibliothek nicht zwingend notwendig. Wird sie nicht installiert, fehlt lediglich die Möglichkeit, Wörter im Duden direkt nachzuschlagen. Die eigentliche Korrekturfunktionalität in OpenOffice wird dadurch aber nicht beinträchtigt.

Die Office-Bibliothek ist ein eigenständiges Programm. Erstmal ist kein Fedora rpm auf der CD, sondern nur eins für openSUSE. Es gibt aber ein Update hier:
http://www.office-bibliothek.de/service/index.html

Leider ist das rpm gegen alte Libraries gelinkt:

rpm -i officebib-5.0.4-1-fedora.rpm
Fehler: Fehlgeschlagende Abhängigkeiten:
    libcrypto.so.6 wird benötigt von officebib-5.0.4-1.i386
    libssl.so.6 wird benötigt von officebib-5.0.4-1.i386

Mit dem Setzen zusätzlicher symbolischer Links geht es, auch wenn das nicht wirklich schön ist, und nur zu hoffen bleibt, dass bald eine echte Version für Fedora 10 nachgeliefert wird, die gegen die aktuellen Bibliotheken gelinkt ist.

Folgendes ist also als Notlösung zu verstehen, und auf eigene Gefahr:

  1. Update der Office-Bibliothek für Fedora herunterladen (siehe Link oben)
    Ab jetzt alles als root!
  2. rpm -i --nodeps officebib-5.0.4-1-fedora.rpm
  3. cd /lib
  4. ln -s libcrypto.so.7 libcrypto.so.6
  5. ln -s libssl.so.7 libssl.so.6
Jetzt kann man unter Fedora auch die Office-Bibliothek starten. Allerdings hatte ich auf einigen Systemen das Problem, dass Zeichen nicht richtig angezeigt werden:

Über einen Hinweis, wie man dieses Problem lösen könnte, würde ich mich freuen!

Unix and FriendsJanuary 5, 2009 3:09 pm

The king of joysticks is back - Speedlink sells an USB reincarnation of the the Competition Pro, optionally bundled with the Amiga Classix Diamond Edition CD giving you 185 Amiga games, see here. Both the joystick and the games can be used under Linux. In the following I describe the necessary steps.

First to the joystick itself. Just connect it to a free USB port. Next you have to calibrate it, you can use the jscal command here. Under Ubuntu you can install it by running:

sudo apt-get install joystick

Next you run jscal, it should go similar to this:

$ jscal -c /dev/input/js0
Joystick has 2 axes and 4 buttons.
Correction for axis 0 is broken line, precision is 0.
Coeficients are: 128, 128, 4194176, 4227201
Correction for axis 1 is broken line, precision is 0.
Coeficients are: 128, 128, 4194176, 4227201

Calibrating precision: wait and don’t touch the joystick.
Done. Precision is:                                             
Axis: 0:     0
Axis: 1:     0

Move axis 0 to minimum position and push any button.
 (Move the stick to the left and push any button)
Hold … OK.                                                                  
Move axis 0 to center position and push any button.
Hold … OK.                                                                  
Move axis 0 to maximum position and push any button.
 (Move the stick to the right and push any button)
Hold … OK.                                                                  
Move axis 1 to minimum position and push any button.
 (Move the stick up and push any button)
Hold … OK.                                                                  
Move axis 1 to center position and push any button.
Hold … OK.                                                                  
Move axis 1 to maximum position and push any button.
 (Move the stick down and push any button)
Hold … OK.                                                                  

Setting correction to:
Correction for axis 0: broken line, precision: 0.
Coeficients: 128, 128, 4194176, 4227201
Correction for axis 1: broken line, precision: 0.
Coeficients: 128, 128, 4194176, 4227201

That’s it already for the joystick!

Coming to the Games, that is a bit more work. Unfortunately you first have to install it once on some Windows machine since all the relevant files are part of the Setup.exe executable. I tried to decrunch (!) it under Wine, but that did not work for me. So, find some Windows installation and install it there. This should give you a directory AmigaClassixDiamondEdition in the Program Files folder. If you have access to this folder under Linux by mounting the Windows partition, that’s fine. If not, just burn the folder on a CD and bring it to your Linux machine. For each game the following items are provided:

  • the Amiga disk files (*.adf), up to four per game
  • a screenshot of the game
  • a WIN-UAE configuration file file when no joystick is available
  • a WIN-UAE configuration file file when a joystick is available (optional, only when the game can be played with a joystick)
  • a manual text file (optional)

Unfortunately these items are scattered over several directories. I wrote a small bash script which collects all the relevant items and makes a new single directory for each game containing all the upper items, see the following screenshot:

 

Note that the script is just a hack, use it at your own risk! Here we go:

#!/bin/bash
	
# for CLASSIXDIR give the path to the Windows Amiga Classix Diamond edition directory
CLASSIXDIR=/path/to/AmigaClassixDiamondEdition
# for NEWGAMESDIR give the path to the directory where you would like to have your games copied
NEWGAMESDIR=/path/to/Amiga/ClassixGames
	
# Do not modify stuff from here on (unless you know what you are doing)
CLASSIXGAMESDIR=$CLASSIXDIR/msys/games
	
if [ ! -d "$CLASSIXDIR" ]; then
  echo "Directory" $CLASSIXDIR "does not exist. Aborting!"
  exit 1
fi
	
if [ ! -d "$NEWGAMESDIR" ]; then
  echo "Directory" $NEWGAMESDIR "does not exist. Aborting!"
  exit 1
fi
	
echo "Creating directories in " $NEWGAMESDIR
mkdir $NEWGAMESDIR/Action
mkdir $NEWGAMESDIR/Adventure
mkdir $NEWGAMESDIR/Arcade
mkdir $NEWGAMESDIR/Sport
mkdir $NEWGAMESDIR/Strategy
	
# copy the ROM files
cp -r $CLASSIXGAMESDIR/Roms $NEWGAMESDIR
	
# copy the games
for ((i=1;i<=212;i+=1)); do
	
    LINE=`awk " \
        BEGIN {FS = \";\"} \
        NR==$i && \\$1 == \"Action\" \
	{print \"Action;\" \\$2 \";\" \\$6 \";\" \\$7\";\" substr(\\$8,30)\";\" substr(\\$9,30,length(substr(\\$9,30))-1)} \
        NR==$i && \\$1 == \"Adventure\" \
	{print \"Adventure;\" \\$2 \";\" \\$6 \";\" \\$7\";\" substr(\\$8,30)\";\" substr(\\$9,30,length(substr(\\$9,30))-1)} \
        NR==$i && \\$1 == \"Arcade\" \
	{print \"Arcade;\" \\$2 \";\" \\$6 \";\" \\$7\";\" substr(\\$8,30)\";\" substr(\\$9,30,length(substr(\\$9,30))-1)} \
        NR==$i && \\$1 == \"Sport\" \
	{print \"Sport;\" \\$2 \";\" \\$6 \";\" \\$7\";\" substr(\\$8,30)\";\" substr(\\$9,30,length(substr(\\$9,30))-1)} \
        NR==$i && \\$1 == \"Strategy + Mind\" \
	{print \"Strategy;\" \\$2 \";\" \\$6 \";\" \\$7\";\" substr(\\$8,30)\";\" substr(\\$9,30,length(substr(\\$9,30))-1)} \
        " $CLASSIXGAMESDIR/Csv/games.csv`
	
    GENRE=`echo $LINE | cut  -d ';' -f1`
    NAME=`echo $LINE | cut  -d ';' -f2`
    MANUAL=`echo $LINE | cut  -d ';' -f3`
    PIC=`echo $LINE | cut  -d ';' -f4`
    UAECONFIG=`echo $LINE | cut  -d ';' -f5`
    UAEJOYCONFIG=`echo $LINE | cut  -d ';' -f6`
	
    if [ "$GENRE" != "" ]; then
	echo "Copying: " $NAME
	mkdir $NEWGAMESDIR/$GENRE/"$NAME"
	
	# copy the manual text file
	if [ "$MANUAL" !=  "-" ]; then
	    MANFILE=`echo $MANUAL | sed "sXManuals\\\\\XX"`
	    if [ -a "$CLASSIXGAMESDIR/Manuals/$MANFILE" ]; then
		cp $CLASSIXGAMESDIR/Manuals/$MANFILE $NEWGAMESDIR/$GENRE/"$NAME"/
	    fi
	fi
	
	# copy the picture file
	if [ "$PIC" !=  "-" ]; then
	    PICFILE=`echo $PIC | sed "sXPics\\\\\XX"`
	    if [ -a "$CLASSIXGAMESDIR/Pics/$PICFILE" ]; then
		cp $CLASSIXGAMESDIR/Pics/$PICFILE $NEWGAMESDIR/$GENRE/"$NAME"/
	    fi
	fi
	
	# copy the WIN-UAE configuration file and modify ROM and disk file locations
	if [ "$UAECONFIG" !=  "" ]; then
	    if [ -a "$CLASSIXGAMESDIR/Configurations/$UAECONFIG" ]; then
                sed -e 'sXRoms\\X'$NEWGAMESDIR'/Roms/X' -e 'sXGames\\XX' <$CLASSIXGAMESDIR/Configurations/$UAECONFIG  >$NEWGAMESDIR/$GENRE/"$NAME"/$UAECONFIG
	    fi
	fi
	
	# copy the WIN-UAE configuration file for joysticks and modify ROM and disk file locations
	if [ "$UAEJOYCONFIG" !=  "" ]; then
		#if [ -a "$CLASSIXGAMESDIR/Configurations/$UAEJOYCONFIG" ]; then
                sed -e 'sXRoms\\X'$NEWGAMESDIR'/Roms/X' -e 'sXGames\\XX' <$CLASSIXGAMESDIR/Configurations/$UAEJOYCONFIG  >$NEWGAMESDIR/$GENRE/"$NAME"/$UAEJOYCONFIG
		#fi
	fi
	
	# copy the disk files (maximum 4), as they are named in the UAE configuration file
	for ((j=0;j<=3;j+=1)); do
	    FILES=`awk "BEGIN { FS = \"=\"} /floppy$j=/ {print substr(\\$2,7,length(substr(\\$2,7))-1)}" $CLASSIXGAMESDIR/Configurations/$UAECONFIG`
	
	    if [ "$FILES" != "" ]; then
		cp  $CLASSIXGAMESDIR/Games/$FILES $NEWGAMESDIR/$GENRE/"$NAME"/
	    fi
	done
    fi
done

Before you run the script you have to modify the first two variable declarations and set the variables CLASSIXDIR and NEWGAMESDIR, see the script. Having the script done its job, you should have the games copied in the way shown in the picture above. What remains to be done is to download E-UAE. The WIN-UAE configuration files contain some Windows-specific information, but that should not bother. Going into a games directory and invoking:

uae -f name.joy.uae

should work out of the box in most cases. Have fun!

Unix and FriendsSeptember 18, 2008 10:07 am

Most of the time I work with Gnome, which comes with a network manager. I was never really happy with it when it comes to wireless networks since its configuration appeared always somewhat unpredictable to me. After a fresh install of Ubuntu Hardy Heron on an older laptop having a NetGear WG511v1 wireless card, the network manager did not even show the available networks anymore, and it forgot a configuration each time a different network was accessed. But then I came across a great and much better alternative to the gnome network manager - wicd. It does exactly what I expect from a network manager, like listing all available networks including signal strength and encryption mode, configuration is easy, etc. Great!

Unix and Friends, German / DeutschJuly 14, 2008 1:39 pm

Das Speedport scheint Probleme mit IPv6 zu haben, was dazu führt, dass das Internet z.B. unter OpenSUSE 10.3 extrem langsam wird. Wer IPv6 nicht braucht, einfach in YaST die Netzwerkkarte konfigurieren und unter Globale Optionen IPv6 deaktivieren und den Rechner neu starten. Danach sollte es wieder sauber laufen.

Unix and Friends, LaTeX and PDFMarch 18, 2008 6:24 pm

In case you need to extract some pages from a PDF file, you can use the pdfnup tool. For instance, to extract the pages 1-2 from a document.pdf, do a:

pdfnup --nup 1x1 --pages 1-2 document.pdf

You can also put together multiple pages on one physical page at a reduced size by varying the –nup option.

Unix and FriendsFebruary 5, 2008 2:46 pm

I had some trouble installing Picasa 2.2 on OpenSUSE 10.3. After some tweaking it finally worked out. Here’s what I did:

  1. Install wine via YaST. Wine seems to be integrated in the Picasa archive, but anyhow this step was necessary.
  2. Download Picasa 2.2 at http://picasa.google.com/linux/thanks-rpm.html
  3. Install the rpm via sudo rpm -Uvh picasa-2.2.2820-5.i386.rpm
  4. Make a symbolic link for the wine libs via a sudo ln -s /usr/lib/wine /usr/local/lib/
  5. Edit /etc/sysconfig/ulimit and set SOFTVIRTUALLIMIT=0
    This change will only get active after a reboot. See also http://tr.opensuse.org/Wine for alternatives.
Hope it helps!

Unix and FriendsJanuary 29, 2008 6:38 pm

I admit it, the girlfriend I spent most time with during my teenager years was simply called Amiga. But after some exciting years of soundtracking, spreading (remember the good old Postlagerkarte?), copy parties, and all that stuff, I left her… But - she’s back! On my Linux screen, thanks to the UAE Amiga Emulator! Have a look at Play Digital #42 (!) to get some introduction.

Using Ubuntu you can simply install UAE via Synaptic. Note that you need a Kickstart ROM to do something useful with it. Even though the UAE homepage states that the RSI Megademo runs with the minimal free build-in Kickstart, this didn’t work for me. You can buy the Kickstart ROMs at Amiga Forever.

To get also sound running, you have the problem that UAE was compiled for OSS instead of ALSA. But that doesn’t hurt, install the package alsa-oss. Now start UAE via the command aoss uae.

There is also E-UAE, which adds some features to UAE. Furthermore, it comes compiled for ALSA. Just downloading and running the Linux binary should work out of the box. I just get sometimes some snatchy sound output, no clue, yet, why.

Having it running, a huge and free archive of games, demos, and applications is available. The UAE site already points to some. Also noteworthy are, e.g., the Amiga pages at Netzreport and Wikipedia. If you liked Amiga music, also have a look at Amiga Music Preservation (I found there a few mods of mine, and I was soooo glad since I lost all of them some time ago…). Finally, a great site for demos is DTV.

How could I ever leave her…