29/07/2008

Linux programs on Windows? Yes! The magic word: andLinux

Again a post which is not really related to OpenSuSE at all, but for people still living in the Windoze world...

Maybe you stumbled upon really nice programs while trying out some Linux distribution, but you can't get away from Windows (yet) and still want to use some of those nice programs? Here is the solution:
andLinux offers you a complete Ubuntu Linux within Windows. The nice thing is: it is not a virtual machine (i.e. a second "PC" starting in your main machine) but rather a running service in Windows which speeds up the whole thing quite a bit.

I've installed the andLinux kde version on my office Windows Machine. I didn't want to have it started automatically so I chose "run as service manually" in the install options. (Just a note: you'll need 4.5 GB of free harddisk space for the KDE version!)

You can exchange data with it most recommendetly via "Samba" - for all newbies: this is the part in Linux which can communicate with the Windows File Share System. To use this feature, you need to create a Share for the folder you want to exchange date with linux (most likely: your private data folder). Create a user with username and password and share the folder for this user (don't use blanks in the share name) - these data will be asked for during the install routine of andLinux and enable it to communicate with Windows

First impression: after having clicked the "Start andLinux" startup button in the associated Start-Menu entry, nothing happened.
The reason was my firewall: andLinux installes a virtual network device called TAP-Colinux and all the communication with windows runs over the TCP/IP-protocol. So tell your firewall to accept any traffic on that network device and from and to the IPs: 192.168.11.150 (linux host) and 192.168.11.1 (windows host). There is also the sound server called pulseaudio and the X-Server called Xming which need entire network address to the addresses mentioned before. You will also have to enable network access to "menu.exe" which communicates with the embedded linux via TCP/IP.

Now you can open any program in this nice little kde-launcher-menu installed by andlinux and running in the task bar, or if you prefer, open a console (see the andLinux start menu folder) and launch stuff from there. By using Synaptic you can install whatever package you like from the ubuntu

All that being very nice, I was still unhappy that e.g. the kde-menu and the Xserver Xming started on system boot up and not only when I wanted to use andLinux, so I edited the startup script "start andLinux" (i.e. C:\Programme\andLinux\srvstart.bat) to the following content and removed Xming and the kde-menu from the startup by using msconfig.exe (you should be familiar with that, otherwise don't fiddle with it!)
start C:\Programme\andLinux\Xming\Xming.exe :0 -dpi 85 -clipboard -notrayicon -c -multiwindow -reset -terminate -unixkill -logfile Xming.log
net start andLinux
cd C:\Programme\andLinux\Launcher\
start C:\Programme\andLinux\Launcher\menu.exe

Note: the first lines beginning with "start" until "Xming.log" are actually ONE line.

Just to let you know, in case you see strange characters e.g. by using Kate or Kile in Windows: the standard code page used for the German Windows is ISO 8859-15 (which you can set being the default for the programs mentioned).

BE CAREFUL: there is a security issue: every program is in standard run as the root user in andLInux, which means, you (or somebody else having access to your machine) can quite heavily damage the installed andLinux system by accident). There is in principle a way to change that in the wiki of andLinux, but it seems rather complicated and I didn't want to fiddle around with it so far.

python-matplotlib and wxmpl

wxmpl is a nice library for implementing matplotlib-plots in wxpython-GUIs.

However, it is not always synchronised with the latest matplotlib. So, a rather careless system update to matplotlib 0.98 (major makeover somewhere) from the packman repo quite efficiently disables wxmpl 1.2.9:
"ImportError: cannot import name Point" (from matplotlib.transforms)... and so on...
0.91 works - there is a SuSE package in the Education repository, add
ftp5.gwdg.de/pub/opensuse/repositories/Education/desktop/openSUSE_10.3/ in YaST (or openSUSE_11.0, note that the URL dropped a ":" since I last edited this post) - and while you're at it, protect your python packages against updates ;-)

On the matplotlib Sourceforge mailing list, someone has posted an inofficial updated version, which should be OK with matplotlib-0.98. However, they dropped 3d plotting support from matplotlib > 0.91, so maybe it's still advisable to stick to older versions. Update: 3d plotting is going to be back in in 0.99 (see here). Yay!
Note that there seems to be some bug with numpy's histogram function: if you set the normed keyword, you might get a
TypeError: 'NoneType' object is not iterable error.


Note: I've been experiencing segmentation faults at calling pylab.show() from a wxpython application. In my case this was due to the matplotlib using the wrong backend:
If there is no file ~/.matplotlib/matplotlibrc, copy it from /usr/lib/python2.5/site-packages/matplotlib/mpl-data/matplotlibrc.
Edit the "backend"-line to WxAgg:
#### CONFIGURATION BEGINS HERE
# the default backend; one of GTK GTKAgg GTKCairo FltkAgg QtAgg TkAgg
# WX WXAgg Agg Cairo GD GDK Paint PS PDF SVG Template
backend: WXAgg

Alternative: import the packages in exactly this order:
$ import matplotlib
$ matplotlib.use('WXAgg')
$ import pylab


On the other hand, calling pylab.show() repeatedly with the 'WXAgg' backend from a non wx-environment (e.g. a shell) can result in blank or crashing figure windows starting from the second call. Use some other backend, for example 'GTKAgg', following the example above.

27/07/2008

Amarok - composer vs. artist tag

It is always a bit frustrating for classical music lovers when audio players don't distinguish properly between artist and composer or insist on sorting by artist, so that one tends to specify the composer as the artist.
Amarok is quite good there. The tag editor (right click on file or album, ->Edit track information) distinguishes between artist and composer. The collection can be browsed by any criterion by clicking on "Group by" in the top toolbar. On-screen display ("%composer" placeholder) and the track list (edit columns) can also display composer info. Only the Wikipedia context browser still has only the "Artist" option. Someone wrote a wishlist entry (Bug 147552) on bugs.kde.org - so vote for it ;-)

Note (amarok2 on KDE4.2): check the output of qdbus org.kde.amarok /Player GetMetadata. And I wondered why my Karamba edits had no effect…
Moreover, they dropped the OSD text configuration option - so no composer there either.

Automating the pdf movie workaround

These ought to make the PDF-embedded movie workaround a bit less cumbersome.

25/07/2008

Embedded movies in LaTeX PDF - the workaround

Not very elegant, but it works. Als o slightly historic: okular and acroread/flash can be made to play back movies to a certain extent, and lately I defected to exporting the PDF presentation to Impress, because it has a gorgeous presenter console (summary here).
Prerequisites: mplayer, acroread and a window manager capable of window rules: KWin, Compiz with CCSM or Gnome with Devil's Pie (I'm not a Gnome user, so no experience with the latter)
You can automate most of this with a shell script, but that's going to be another post (this is over-long already).

22/07/2008

lshw: a pretty useful system analysis tool...

...which is not included in the openSuSE distribution. Get the sources from ezix.org.
Untar, run make, if you want the GUI, run also make gui (cf. the README file).
The lshw command-line tool is in the src subdir, the GUI (gtk-lshw) in src/gui. If you want to use both systemwide, copy lshw to /usr/bin and create a shell script in /usr/bin:
#!/bin/bash
kdesu <location of gtk-lshw>
Make it executable.
There is even a 10.3 rpm here. In case the sources don't compile - it also seems to work OK on 11.0.

Talking of compile bugs - I got a compile error on 11.0 with lshw-B.02.13 (apparenty yet again caused by the switch to GCC 4.3)
abi.cc: In function ‘bool scan_abi(hwNode&)’:
abi.cc:39: error: ‘free’ was not declared in this scope

Just add a #include <cstdlib> statement in <lshw source dir>/src/core/abi.cc.
dev.ezix.org had the solution and also a diff file.

HowTo configure an SSH tunnel via PuTTY

Not really OpenSuSE-related, well somewhat: how to tunnel to a ssh box from a Windows Machine using PuTTY

  1. Start PuTTY
  2. Enter the Host Name or IP address of the machine you want to connect in the appropriate field
  3. Change to Connection --> SSH --> Tunnel
  4. Enter the LOCAL Port Number in "Source Port"
  5. Enter the REMOTE host and port in the form: remotehost.tld:PortNumber in "Destination"
  6. Double Check whether "Local" and "Auto" is marked in the settings
  7. Click "Add"
  8. Something like "L12345 remotehost.tdl:23456" should appear in the "Forwarded Ports" box
  9. Go back to "Session" and save the session in order to keep the settings for the next start of PuTTY
  10. Connect to your machine - the terminal needs to stay open as long as you want to use the SSH-Tunnel
BTW: if you want to start PuTTY from the command line easily, just copy putty.exe into the /Windows/system32/ folder and rename it to ssh.exe, then you can start it by commanding ssh on a console or in the "run" dialog.

When Amarok doesn't play audio CDs…

Amarok 1.x is quite unreliable with audio CDs. Apparently this has to do partly with configuration bugs, so the following tricks might help - or not. Depending on the engine you use, you get different error messages - "No suitable input plugin" (xine) or "could not open cd device for reading" (yauap). On the other hand, Amarok2 does not play audio CDs at all.
BTW, Amarok comes without xine plugin in openSuSE 11.0, so install the amarok-xine package to use the engine.
Possible solutions:

21/07/2008

OpenSuSE 11, kdesu and sudo ;-)

Hardly more than a quick comment to daWuzzzz's last post:
Note that in 11.0 they switched from sudo to su behind kdesu. Starting YaST or KControl, you will still be prompted for the root password, even if you are a sudoer. Ben Kevan's blog has some recipe for that.
E.g. for KDE3, edit ~/.kde/share/config/kdesurc (or create that file).
[Passwords]
Keep=false

[super-user-command]
super-user-command=sudo
For KDE4, take the ~/.kde4/... equivalent (did it only on KDE3 myself). Of course, you can also switch kdesu to su on openSuSE 10.3 with the same method.

OpenSuSE 11 and Sudo

Just to let you know again: in order to add a user to the sudoers, adding the user to the group "trusted" and configuring it in the Yast Module Sudo is NOT sufficient. What avocadohead has already pointed out in this article posted in this blog is valid as well for OpenSUSE 11, i.e. manually configuring the /etc/sudoers file and commenting out the lines indicated in the commented file.

18/07/2008

ATI, OpenSuSE 11 and Compiz

Apparently the drivers in the openSuSE ATI repo are recent enough to support a reasonable AIGLX/Compiz performance, so no fiddling with the xorg.conf any more, just install the drivers and run sax2.
Compiz can replace KDM at startup: Control Centre -> KDE Components -> Session Manager. Here, you have a choice of window managers. "Compiz" will only work if compiz runs on your systems without extra options (e.g. --no-libg-fallback), which usually isn't the case. I prefer the "Compiz custom" option. To make that work, create a file "compiz-kde-launcher" in /usr/bin/, ~/bin or wherever your system can find it:
#!/bin/bash
sleep 3
wait
compiz --replace --no-libgl-fallback --ignore-desktop-hints ccp & #or whatever options work for you
sleep 1
emerald --replace &
exit 0

The sleep and wait statements are there to ensure that tray apps etc. have enough time to start up and emerald doesn't fire up before compiz is ready. Feel free to remove/change them.
Make the script executable:
# chmod a+x /usr/bin/compiz-kde-launcher
That's it.

Compiz and desktop shortcuts

One slightly annoying thing about Compiz is that it grabs control of some global shortcuts - I heavily depend on Katapult (default Alt+Space), the run dialog (Alt+F2) and the occasional XKill (Strg+Alt+Esc).
Fix:
1) Go to CCSM->General Options->Commands tab
2) Under "Commands", you can define up to 12 entries.
Katapult:katapult
Run dialog:dcop kdesktop KDesktopIface popupExecuteCommand
XKill:xkill
3) Associate any keyboard shortcuts you want under "Key bindings". If there is a conflict, compiz will notify you. Compiz had already set Run dialog for Alt+F2 before, but for some reason the shortcut didn't work this time. Also shortcuts containing Esc will not work, you have to choose a different one for XKill.

Global shortcut conflicts (Amarok example, most KDE programs work analogously):
Amarok shortcuts seem to be generally window-manager-independent, however, conflicts are resolved in favour of compiz. This usually affects Win (Super) + C (Enhanced Zoom/Group and Tab Windows) and Win + Z (Put Windows).
The easiest way is to change your Amarok shortcuts: Amarok->Settings->Configure Global Shortcuts…
If you want to keep the Amarok shortcuts and to know exactly which compiz plugin is blocking your shortcut, do a grep (found here) in /etc/gconf/schemas:
grep -A 2 '&lt;Super&gt;c' /etc/gconf/schemas/*.schemas
(XML file, so use HTML string notation. Example for <Super>C, adapt if necessary). Either change the shortcut directly in the affected .schemas file (check whether the plugin is active), or use the CCSM GUI.

KDE 4
Global shortcuts are managed in the Personal Settings manager (Keyboard & Mouse) for all KDE4 applications.

09/07/2008

X(anthippe)-Files Part 2: The "Clean" Install

First little joyful fact: SuSE 11.0 replaced the Ubuntu and not the SuSE 10.3 GRUB; took me a while to realise that, and a GRUB crashing at stage 1.5 or failing to read the system partition is not a pretty thing. Also, even the working version completely ignores the Windoze and Ubuntu installs. Still, one can fix that.

Secondly: SuSE boots, X doesn't start. At least I had a root shell and a network connection. xorg.conf had no mention of AIGLX options, so I started the console yast (old and staunch friend), added the ATI repositories, did an update, installed the fglrx driver and ran sax2. rcxdm restart resulted in a graphical login screen. Phew!

Thirdly: no users. I could have sworn I imported the old ones during installation. I logged in as root, created the users again in yast and gave them their old home directories, which remained unchanged, thank God.

Maybe it's Xanthippe, the little bitch, and her ATI Radeon X1300, or I was just extremely tired and stupid during install, but this could really have gone more smoothly (cf. Persephone).

06/07/2008

"Get the latest Quicktime" - !??!

Do you too check out movie trailers on apple.com when you are bored / procrastinating?
For quite a number of pages the movie doesn't play, instead you are told to get the latest Quicktime, which is a good joke for people stuck on mplayerplug-in.
Actually, the problem has already been resolved (see this discussion and the mplayer page), there is just no ready-made RPM yet:
1) According to the ArchLinux forums discussion, I changed
"QuickTime Plug-in 6.0 / 7:$" to "QuickTime Plug-in 7:$" in ~/.mozilla/firefox/pluginreg.dat
(not sure whether that is necessary)
2) I uninstalled the current mplayer-plugin and added the mozilla-xulrunner190-devel package (in place of Firefox development package) in yast
3) I got the mplayerplug-in daily build (3.55 probably works too, as it's just two weeks old) untarred, ran ./compile and make. Make install doesn't work, as the build files assume a different plugin directory, so copy the files by hand:
$ sudo cp mplayerplug-in*.so mplayerplug-in*.xpt /usr/lib/browser-plugins/

Control run on Tisiphone: Works also with just steps 2 and 3 and the 3.55 release.
Happy procrastinating!

04/07/2008

Upgrading SuSE 10.3 to SuSE 11.0 - The X(anthippe) Files

Being in a rather venturous mood, I decided to try out the upgrade-from-DVD feature on Xanthippe (I don't really want to hunt down every package of additional software again).
For starters, I dumped gzipped partition images of my system and home partitions (cf. daWuzz) on an external disk. I used knoppix to do this (and to format my external partitions), I am not sure whether one can dump the system partition of a running system. Caveats: to write to a drive in Knoppix, you have to enable write support (right click to drive's desktop icon). For the dumping you have to be root - there is no root password set by default, so sudo su won't ask for it.

During the update process (update option is given after the system analysis) the installer analyses the software repositories present on your system. Provided you get the internet connection working in the next step (which I didn't :-( ), you might manually change them to the corresponding SuSE 11 repos. Lacking a LAN connection, I had no 11.0 Packman repo available and got a small number of conflicts in the software selection, which could be resolved by downgrading to the SuSE versions (stuff like Amarok, Ktorrent or wxGTK).
The following update took approx. 2 hours (might be just due to all that additional packages), which is of course quite a bit longer that a clean install (1/2 h?). So if you don't have a lot of additional software and settings, you might consider to just leave your home partition as it is, do a clean install on the system partition and install by hand what's missing.

OK, bad news: during boot, the system gets stuck on endless repetitions of
hub 2-3:1.0: unable to enumerate USB device on port n
. This is the 2.6.25 kernel's reaction to my faulty internal USB hub - still, I can't get the updated system to boot that way.
I will try a clean install next...

Clean install notes:
Automatic partitioning setup even includes mounting my former home partition, which is quite nice. Not quite so smart: the user setup still just offers to create a new user, the "import old users option" is concealed behind the Change... button.

How to find a damn fast download server


The download page for the openSuSE releases usually chooses a mirror for you. I use to fetch big downloads over my university's broadband connection, so the server speed really matters to me.
Luckily, openSuSE features a mirror list (follow the mirrors link).

PS: In light of certain very recent releases, here are the mirror links for openSuSE 11.1.

02/07/2008

Who's afraid of SuSE 11?

Me, apparently.
After spending the release date abroad, I still didn't want to abandon any of my nicely running 10.3 systems. Luckily (?) Persephone's (crappy old Intel lab computer) hard disk had just crashed and I took the opportunity to add a trial SuSE 11 to the ubiquitous Windows XP.

First impressions:
Setup:
Computer took 3 reboots each to recognise the SuSE DVD and the system disk. Did I mention it's crappy and old?
During setup, it is apparently possible to set up a standard user account as root (tick mark during password setup, active by default). Seems pretty dangerous to me.
Given the choice of KDE 3.5.9 and 4.0.4, I settled for the 3.5 line (I'm waiting for 4.1 before trying anything serious). I presume that you can still add the KDE4-Desktop on top afterwards, as with SuSE 10.3.
Usage:
The default login screen in my humble opinion is ugly.
The system time is consistently off by more than an hour (I suspect the crappy hardware). Ctrl+Alt+Backspace has to be pressed two times to kill the X server, accompanied by a nasty beep (it's not a bug, it's a feature ... of Xorg 7.3 - thanks, daWuzzz). Hm. I can be pretty confused sometimes, but I have never in my life hit those keys by accident. Apparently one can remove the feature by setting "Zap Warning" to "off" in the xorg.conf (cf. comments here)
New Yast Software utility: miraculously, doesn't always refresh repositories before starting. If it does, it doesn't spawn pop-up windows every time a new repo is refreshed, so the focus-stealing issue is resolved. I love it!
Also comes in handy: The repository manager is directly accesible from the software manager.
The community repositories entry in Yast->Software has been merged into the Add-On Product item - as long as it's still around...
I didn't like the update checker in 10.3, the new one seems to speed up things a bit. Nice little extra: text bubble with update process details.

Eye Candy:
A not-too-fancy Compiz works OK even on a slightly older Intel on-board graphics chip (D845GVSR). AIGLX is enabled by default (no idea how this works with non-AIGLX capable chips or prorietary drivers, will test it with Xanthippe's ATI chip). Compiz can be started via Utilities->Desktop->Desktop Effects (some basic effects can be switched, for advances configuration use CCSM), no X restart necessary.

I will keep testing for some time - but I am seriously tempted to upgrade one of my other systems.

01/07/2008

Brother DCP-7010, openSuSE 10.3 and openSuSE 11

Ok, so I got the nice scanner-printer-copymachine-combo named DCP-7010 from Brother. Just some small things to mention:

  1. Printer Driver installation using the CUPS-Wrapper system went smooth following the description given by the brother people, i.e.

  2. Scanner Driver installation also went smooth:

    Xsane instantly could work with the scanner (I'm impressed - not necessarily because of the scanner - it is good for black/white and grey scans, not really good for colours - but because of the smooth installation)
  3. The BrKey tool enabling the support for the hardware "Scan-to-Email", "Scan-to-File", "Scan-to-Image" and "Scan-to-text" keys also worked buuuuuut: the fine tuning might be a little tricky, so here are some hints how to optimize your workflow:

Each of those "scanning options" simply invokes a script which does the work. You can find the scripts in the folder
/usr/local/Brother/sane/script
if you want to edit them, be sudo, if you want to work with them, be a normal user.

Change the resolution to your needs. I also wanted to change the scan length (in standard, it is obviously set to be 35cm, which is a little too much for normal A4 or letter...)
you can achieve that by adding the option -y 298.00 to the "scanimage" command. I furthermore wanted to have the scan not in 24bit color, but in b/w and wanted to get a pdf file out of it. Don't use the line brother suggests. For me the following script worked, so I'll just copy it here - I think most of it is self-explaining. BTW: with scanimage --help you can get the specific driver options for the brother as well, if you want to fiddle around more (but - Black & White seems to be just "Black", at least it worked for my model)


#! /bin/sh
set +o noclobber
#
# $1 = scanner device
# $2 = friendly name
#

#
# 100,200,300,400,600
#
resolution=400
device=$1
mkdir -p ~/brscan
if [ "`which usleep`" != '' ];then
usleep 10000
else
sleep 0.01
fi
output_file=`mktemp ~/brscan/brscan.XXXXXX`
chmod 644 $output_file
echo "scan from $2($device) to $output_file"
# ================================================
# here is the actual scan command:
scanimage --device-name "$device" --mode Black \
--resolution $resolution \
-y 298.00 \
|pnmtops > "$output_file".ps
ps2pdfwr "$output_file".ps "$output_file".pdf
# delete temporary files
rm "$output_file".ps
rm "$output_file"



All documents scanned will show up in a folder named brscan in your home directory.

Just to mention: since there are four scripts, you might want to have actually different "scan-to-file" settings on the other positions (scan-to-email, scan-to-picture, scan-to-ocr). Which scripts are started with each setting of the scan key is set up in the file
/usr/local/Brother/sane/brscan-key-versionnumber.cfg.
Just edit it to your needs. Have a lot of fun ;-) - and by the way: the DCP-7010 is really a good model, if you want to have a quite good laser printer and copier and no space on your desk for an additional scanner.

Update:
The same procedure works for a MFC-7820N (connected via USB) on Ubuntu 9.10 and 10.10. Follow the instructions on http://welcome.solutions.brother.com/ - you'll need to put /usr/bin/brscan-skey in the Autostart for every user who shall be able to use the scan key options. With the script above, unfortunately, the Automatic Document Feeder (ADF) doesn't work. You can however use it with Xsane: you'll just have to put the number of pages you want to scan in the upper left corner of the main field of Xsane.

2nd Update: 
The Automatic Document Feeder (ADF) actually works with a slightly modified script, as has been posted here.