Archive for the ‘ubuntu’ Category

h1

ScreenCast on Linux

March 17, 2007

I needed to do some screencast on my PC. After reading around the net I found vnc2swf and Istanbul. I decided to give a try first to Istanbul as it had a deb package ready. I am a bit reluctant to installing gnome based software and their lib on my KDE but well…
So well, the usual :
sudo apt-get install istanbul
But at launch I would end with :
Traceback (most recent call last):
File "/usr/bin/istanbul", line 30, in ?
from istanbul.main import main
File "/var/lib/python-support/python2.4/istanbul/main/main.py", line 33, in ?
from istanbul.main.gconf_client import GConfClient
File "/var/lib/python-support/python2.4/istanbul/main/gconf_client.py", line 19, in ?
import gconf
ImportError: No module named gconf

I read that it was fixed with later version of Istanbul, So I went to install the new version. But first you’ll need newer libxml2 library aswell (here link for amd64) :
wget http://http.us.debian.org/debian/pool/main/libx/libxml2/libxml2_2.6.27.dfsg-1_amd64.deb
sudo dpkg -i libxml2_2.6.27.dfsg-1_amd64.deb

wget http://http.us.debian.org/debian/pool/main/i/istanbul/istanbul_0.2.1-3_amd64.deb
sudo dpkg -i istanbul_0.2.1-3_amd64.deb

Later if a software require older version of libxml2, you can overwrite the newer you installed with the previous ubuntu version, istanbul should continue to work correctly.
You’re done, you can launch and record through the icon in tray bar.

It’s really easy to use but the output is only OGG Theora and unfortunately web browsers don’t all handle that format.

That’s why I switched to vnc2swf which produces directly flash format.
Couldn’t be easier to install, you need a vnc server, ie :
sudo apt-get install x11vnc
Then install vnc2swf. I installed pyvnc2swf as it’s the one under development and maintained contrary to the C older version.
sudo apt-get install python-tk
sudo apt-get install python-pygame
wget http://www.unixuser.org/~euske/vnc2swf/pyvnc2swf-0.9.1.tar.gz
tar xzvf pyvnc2swf-0.9.1.tar.gz
cd pyvnc2swf-0.9.1/

Now you can launch vnc server :
x11vnc -localhost -viewonly -wait 10 -defer 10 &
And you can launch vnc2swf :
python vnc2swf.py
You might land on this message :
open /dev/sequencer: No such file or directory
You should install kernel module : kernel/sound/pci/emu10k1 as stated here.

h1

Upgrading to Beryl 0.2.0

March 17, 2007

Beryl 0.2.0 is out with many cool features and fixes :

    New Plugins :

  • Thumbnail: Thumbnails on the taskbar (window list) which show a mini view of the actual window
  • Snap: Allows windows to “snap” to each other, or provide edge resistance
  • Opacify: Makes windows behind the active window transparent
  • Group: Allows windows to be group, to easily switch between a set of windows
    New system requirements check :

  • The improved check has much better accuracy
  • The check is a lot faster
    New Window Decorators :

  • Since 0.1, we have two new window decorators
  • Heliodor: Uses metacity themes
  • Aquamarine: Uses Kwin themes.
    Newly Rewritten Beryl-Settings :

  • Written in Python
  • More user-friendly UI
  • Better profile support
    New Translations :

  • Thanks to all of our foreign speaking users, we’ve had a much better time getting translations

Now how to upgrade your version (mine used to be 0.1.4) on your kubuntu edgy ?
Edit your /etc/apt/sources.list and add the following lines :
deb http://ubuntu.beryl-project.org edgy main
deb-src http://ubuntu.beryl-project.org edgy main

Update the list :
sudo apt-get update
And upgrade the following packages :
sudo apt-get install beryl
sudo apt-get install beryl-core
sudo apt-get install beryl-manager
sudo apt-get install beryl-plugins
sudo apt-get install beryl-plugins-data
sudo apt-get install beryl-settings
sudo apt-get install emerald
sudo apt-get install emerald-themes
sudo apt-get install libberylsettings0
sudo apt-get install libberylsettings-dev
sudo apt-get install libemeraldengine0
sudo apt-get install libemeraldengine-dev

Reboot and enjoy!

h1

Adding a folder to System Menu applet from KDE Task Panel

February 18, 2007

I found it frustrating not being able to add a folder to System Menu in KDE by just right-clicking or through the KDEMenu Editor. After some search, in fact the folders you see in this menu are located in /usr/share/apps/systemview/. To add one you’ll need to :
mkdir ~/.kde/share/apps/systemview/
And copy an existing .desktop, for example media.desktop
cp /usr/share/apps/systemview/media.desktop \
~/.kde/share/apps/systemview/somestuff.desktop

Then just edit the newly created somestuff.desktop by changing Name= and Path= to point on the folder.
On next login to your session it will appear!

New System Menu View

h1

Installing RadRails on Ubuntu Edgy amd64

February 13, 2007

For a future post about Ruby IDE I needed to install RadRails. I did it in the past without problem on windows. Unfortunately the official (and snapshot) versions come with a 32 bits shared library (libswt-pi-gtk-3232.so). So I was landing on an error message quoted later. The only solution I read while investigating on the net was to use RadRails the oldway : install Eclipse and add RadRails and RDT Plugin to it… I didn’t want to download the overbloated eclipse platform while a standalone RadRails version exists which is lighter (still 40MB…) So I convinced myself to get those bloody 64 bits shared libraries to work.
The laziest way is to find a solution without any compilation (compilation of such libraries can be a nightmare when they depend on zillions of projects and I have no fun messing with that anymore).
So let’s go!
Download Eclispe RPC eclipse-RCP-3.2.1-linux-gtk-x86_64.tar.gz from eclipse site.
wget http://sunsite.informatik.rwth-aachen.de/eclipse/downloads/drops/R-3.2.1-200609210945/eclipse-RCP-3.2.1-linux-gtk-x86_64.tar.gz
Untar
tar xzvf eclipse-RCP-3.2.1-linux-gtk-x86_64.tar.gz
Get RadRails (0.7.2 or snapshot) from RadRails site
wget http://www.web20.com/downloads/radrails-0.7.2-linux-gtk.tar.gz
Untar
tar xzvf radrails-0.7.2-linux-gtk.tar.gz
Launch RadRails once (you need to do that to init RadRails configuration)
./radrails/RadRails
An error message will popup :
An error has occurred. See the log file
/del/radrails/workspace/.metadata/.log.

By editing this file you’ll read that a 32 bits shared library is doing some mess
!STACK 1
java.lang.UnsatisfiedLinkError: /del/radrails/radrails/configuration/org.eclipse.osgi/bundles/59/1/.cp/libswt-pi-gtk-3232.so: /del/radrails/radrails/configuration/org.eclipse.osgi/bundles/59/1/.cp/libswt-pi-gtk-3232.so: wrong ELF class: ELFCLASS32
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1660)
at java.lang.Runtime.loadLibrary0(Runtime.java:822)

Backup the existing faulty jar containing the bloody 32 bits library.
mv radrails/plugins/org.eclipse.swt.gtk.linux.x86_3.2.0.v3232m.jar radrails/plugins/org.eclipse.swt.gtk.linux.x86_3.2.0.v3232m.jar.backup
And replace it with the jar you downloaded from eclipse site containing 64bits shared libraries (like libswt-pi-gtk-3235.so)
cp eclipse/plugins/org.eclipse.swt.gtk.linux.x86_64_3.2.1.v3235.jar radrails/plugins/org.eclipse.swt.gtk.linux.x86_3.2.0.v3232m.jar
You can finally relaunch RadRails!

h1

Installing Miro PCTV Remote Control to run with xdtv

February 8, 2007

I was missing my PCTV Remote control from Windows so I couldn’t lazily switch off my pc by air anymore 🙂
So I decided to install lirc.
I though a simple sudo apt-get install lirc would be enough, but that was not. I wouid get the error message :
could not get file information for /dev/lirc
And indeed /dev/lirc didn’t exist.
So I looked again on the quality ubuntu forum to find the solution that I updated a bit here.
So I decided to install middle-way from apt and oldway.
wget http://prdownloads.sourceforge.net/lirc/lirc-0.8.1.tar.bz2
tar xvjf lirc-0.8.1.tar.bz2
cd lirc-0.8.1/
./configure
# here setup will prompt you
# for your hardware settings :
# PCTV / COM port...
# with a sweet dialog display
# else you should edit /etc/lirc/hardware.conf
# and
# sudo cp /usr/share/lirc/remotes/\
# pinnacle_systems/lircd.conf.pctv \
# /etc/lirc/lircd.conf
make
sudo make install
# backup
sudo mv /usr/sbin/lircd /usr/sbin/lircd-original
sudo mv /usr/sbin/lircmd /usr/sbin/lircmd-original
# if you installed lirc through apt-get previously
sudo rm /dev/lirc
# install the apt-way
sudo apt-get install lirc
# finish the oldway install
sudo make install
# and replace the apt binaries
sudo cp /usr/local/sbin/lircd /usr/sbin
sudo cp /usr/local/sbin/lircmd /usr/sbin

Now that all is installed it’s time to test it.
Launch in one terminal :
sudo /etc/init.d/lirc stop
sudo lircd --nodaemon

And launch in another terminal lirc tool :
irw
Now you can type on your pctv remote and you should see in this terminal some things like :
00031 00 1 PinnacleSysPCTVRemote
00031 00 1 PinnacleSysPCTVRemote
00031 01 1 PinnacleSysPCTVRemote
00031 02 1 PinnacleSysPCTVRemote
00032 00 2 PinnacleSysPCTVRemote

Now you can edit your settings (~/.lircrc) to make it work with xdtv. (.lircrc content doc)
Ok so now you can restart it correctly as daemon.
sudo /etc/init.d/lirc restart

h1

How to run your windows firefox on kubuntu with wine ?

January 28, 2007

I needed to run my windows firefox to retrieve some login (not password!) for things like my bank account…
Here comes an easy one, you’ll just need wine :
sudo apt-get install wine
Then you can launch your windows firefox (my partition is mounted on /media/sda1) :
wine /media/<YOUR_WINDOWS_PARTITION>/\
Program\ Files/Mozilla\ Firefox/firefox.exe

The problem is that your profile won’t be loaded. At first I wanted to link (ln) the profile from windows partition but that wouldn’t work as I have the basic ntfs driver that mount the partition as read only, and firefox would complain (and anyway I wouldn’t want wine to put a mess in my windows firefox profile…). So you’ll just need to copy it :
cp -R /media/<YOUR_WINDOWS_PARTITION>\
/Documents\ and\ Settings/<YOUR_WINDOWS_USERNAME>\
/Application\ Data/Mozilla/Firefox/ ~/.wine\
/drive_c/windows/profiles/<YOUR_KUBUNTU_LOGIN>\
/Application\ Data/Mozilla/

chmod -R 700 ~/.wine/drive_c/windows/profiles\
/<YOUR_KUBUNTU_LOGIN>/Application\ Data/Mozilla/Firefox

And you’re done, you can relaunch and your profile will be loaded.

h1

How to get symlinks to point tv and webcam in a non random manner ?

January 27, 2007

Starting with 2.5x kernels, all physical and virtual devices in a system are visible to userspace in a hierarchical fashion through sysfs. udev is replacing the functionality of devfs.

The order in which devices with the same function appear in /dev is essentially random. E.g., if you have a USB web camera and a TV tuner, sometimes /dev/video0 refers to the camera and /dev/video1 refers to the tuner, and sometimes after a reboot the order changes to the opposite one.

To get round this problem we will identify our hardware and create correct symlinks pointing to the right device.
For that :
udevinfo -a -p /sys/class/video4linux/video0
I got :
looking at device '/class/video4linux/video0':
KERNEL=="video0"
SUBSYSTEM=="video4linux"
SYSFS{name}=="Creative Labs Webcam 5"
SYSFS{dev}=="81:0"

This is my webcam, I don’t have that much device identification for it apart from the name and dev.
For my pctv card i get :
udevinfo -a -p /sys/class/video4linux/video1
looking at device '/class/video4linux/video1':
KERNEL=="video1"
SUBSYSTEM=="video4linux"
SYSFS{card}=="39"
SYSFS{name}=="BT878 video _Pinnacle PCTV Stud"
SYSFS{dev}=="81:1"
looking at device '/devices/pci0000:00/0000:00:09.0/0000:05:06.0':
ID=="0000:05:06.0"
BUS=="pci"
DRIVER=="bttv"
SYSFS{modalias}=="pci:v0000109Ed0000036Esv000011BDsd00000012bc04sc00i00"
SYSFS{local_cpus}=="01"
SYSFS{irq}=="66"
SYSFS{class}=="0x040000"
SYSFS{subsystem_device}=="0x0012"
SYSFS{subsystem_vendor}=="0x11bd"
SYSFS{device}=="0x036e"
SYSFS{vendor}=="0x109e"
looking at device '/devices/pci0000:00/0000:00:09.0':
ID=="0000:00:09.0"
BUS=="pci"
DRIVER==""
SYSFS{modalias}=="pci:v000010DEd0000005Csv00000000sd00000000bc06sc04i01"
SYSFS{local_cpus}=="01"
SYSFS{irq}=="0"
SYSFS{class}=="0x060401"
SYSFS{subsystem_device}=="0x0000"
SYSFS{subsystem_vendor}=="0x0000"
SYSFS{device}=="0x005c"
SYSFS{vendor}=="0x10de"
looking at device '/devices/pci0000:00':
ID=="pci0000:00"
BUS==""
DRIVER==""

Here we get more identification for the pctv device, we will ignore the ones with DRIVER==””, so we have the first 2 to keep.
Now we can create /etc/udev/rules.d/83-duplicate_devs.rules with identifications in :
# Persistent symlinks for webcam and tuner
KERNEL=="video*", BUS=="pci", \
SYSFS{device}=="0x036e", SYSFS{vendor}=="0x109e", \
SYMLINK+="tvtuner"
KERNEL=="video*", SYSFS{name}=="Creative Labs Webcam 5", \
SYMLINK+="webcam"

Now you can reboot and change the kde shortcut of your xdtv (or any tvsoft that doesn’t autodetect the device) with the new symlink here :
xdtv -c /dev/tvtuner

For more information on the subject : refer to this.

h1

How to get rid of the 10 minutes Blank Screen screensaver ?

January 27, 2007

You might not have noticed when you never happen to idle on your kubuntu more than 10 minutes, but a Blank Screen will be triggered. Not that embarassing you might think as there’s a big chance you’re away but well if there’s screensaver settings, it’s to configure that… And it becomes really irritating when you have a pctv card watching tv and that you have to move the mouse every 10 minutes.

So I couldn’t understand why this BlankScreen would appear although my settings in Desktop (right-click) / Configure Desktop / ScreenSaver was clearly using fireworks screensaver after 15minutes, and even after disabling it, I would still see this bloody BlanckScreen popping up. I thought it could be the Energy optimization from System Settings / Monitor & Display. But this one was set to 1 hour.

After some browsing on the net and some unsuccessful tries (with xset …) I thought I found it… in Desktop (right-click) / Configure Desktop / ScreenSaver / Blank Screen, unsetting the Start Automatically

Blank Screen Disabled

But that wouldn’t work either, finally I found a trick to disable this behavior thanks to ubuntu forum. In fact the problem appears when you run beryl with Xgl as a session on display :1. You’ll need to edit /etc/X11/xorg.conf and add at the end :
# To prevent Blank Screen from popping up every 10 minutes
# when xgl is run as a session on display :1,
# when all the power management settings
# you normally find only concerns display :0
Section "ServerFlags"
Option "blank time" "0"
Option "standby time" "0"
Option "suspend time" "0"
Option "off time" "0"
EndSection

h1

Install xdtv on Kubuntu amd64

January 18, 2007

As I said in earlier post I wanted to install xdtv (on windows K!TV is the best soft I found around and xdtv is its linux version) but I couldn’t either set a full correct apt source neither find easily the amd64 deb from Marillat and I was a bit reluctant (or lazy) to compile it with the zillions of projects it depends on.
Finally found them here xdtv_2.3.3+2.4.0pre0-0.1_amd64.deb (it is referenced on xdtv site /Downloads).
You can try to sudo dpkg -i xdtv_2.3.3+2.4.0pre0-0.1_amd64.deb. But it’s unlikely to work directly. You’ll prolly need (find them either from depot or the web) :

dependency-step :

Finally you’ll hang on a last annoying dependency :
xdtv depends on libfaac0 (>= 1.24+cvs20060416); however:
Version of libfaac0 on system is 1.24clean-0ubuntu4.

As I didn’t want to backversion the lib with some cvs versions, I thought I would attempt to remove this dependency from the deb itself. Nothing easier :
dpkg-deb --extract xdtv_2.3.3+2.4.0pre0-0.1_amd64.deb \
xdtv-custom
dpkg-deb --control xdtv_2.3.3+2.4.0pre0-0.1_amd64.deb \
xdtv-custom/DEBIAN

Now you’ll need to edit xdtv-custom/DEBIAN/control and remove libfaac0 (>= 1.24+cvs20060416), from it.
And finally rebuild the deb with :
dpkg --build xdtv-custom/ \
xdtv_2.3.3+2.4.0pre0-0.1_custom_amd64.deb

Finally you can install it
sudo dpkg -i xdtv_2.3.3+2.4.0pre0-0.1_custom_amd64.deb
Note : there might be some other thirdparties libraries missing (tvfonts, codecs…), do just like described on dependency-step.

Xdtv will also require ssuid, to fix that :
sudo chown root: /usr/bin/xdtv \
&& sudo chmod u+s /usr/bin/xdtv

You might encounter a problem seeing black screen when you launch xdtv and get only ‘Webcam’ as source and not ‘Television’, that is because your /dev/videoX taken into account is the wrong one. To check which /dev/videoX is the right one to use, you can either look at dmesg logs or (if you have xawtv installed) xawtv -hwscan which brought for me :
/dev/video0: OK [ -device /dev/video0 ]
type : v4l2
name : BT878 video (Pinnacle PCTV Stud
flags: overlay capture tuner
/dev/video1: OK [ -device /dev/video1 ]
type : v4l
name : Creative Labs Webcam 5
flags: capture

So just launch xdtv -c /dev/video0 (there must be a way to automate this detection), and you’re done, you’ll have the best image quality for your pctv on linux (The interface can’t be qualified “the best” but well I don’t care about the interface itself).

h1

Kubuntu Install day!

January 14, 2007

I installed Kubuntu one week ago and thought I would share my experience toward that.

Firstly now that I have it installed, running, tweaked, I find it not so bad.
I have experienced quite a lot of os install :

  • For personal use : Debian (2.2, 3.0, Sarge), and the usual microsoft : windows9x/2k and XP.
  • For educational use : FreeBSD

And now it’s Kubuntu 6.10 Edgy turn, a Debian-based system.

I have to admit Kubuntu did a lot of effort on their install as it’s really easy to handle, with livecd (still I used to prefer the old interface with cfdisk … ;)). But when I installed the other os, I had been installing them on a newer machine while now it is 2 years old, so I won’t get the latest unresolved bug at install screen I had with the other install (sata not recognized for instance with Sarge DVDs…).

I experienced a small problem with grub that would install on an old ide hard drive used only for backup, the faster solution I found was to unplug the harddrive and reinstall with only my sata harddrive plugged (yeah I know I should have played with the hdX,X but had no fun…). By the way speaking of grub that I had installed since Debian Sarge, that’s a great and easy to use booter. I’m happy that LILO belongs to the past.

It took 1 hour to install (incl partition ordering/formatting), and I had a working linux running X (X was a big pain to handle in the past, it’s still a bit when you want the latest drivers working). It detected the other partitions (windows) and mounted them in media.

The ppoeconf was fastly configured (when you know it’s called that way) so I had inet 2minutes after install.

Ok now first problem, how do I increase resolution, I’m stuck at 1024 and 60Hz and my eyes don’t like that. Incredible, my (5 years old) iiyama screen is in the list! Ok click on ‘Test’ and you’ll get a blackscreen and noway to get rid of it even with ctrl-alt-F1… Ok reboot… Try again but with apply directly, cool I can view the effect now…

Ok now drivers, firstly a good idea is to save your /etc/X11/xorg.conf. Firstly tried the ubuntu way from Ubuntu Edgy Installation Wiki Guide. Unfortunately, with the ubuntu way of install I would get a DRI Initialization failed in /var/log/Xorg.0.log, and after installation of the drivers the manual way and a sudo aticonfig –initial then I would get a black screen of the death at login startup with my screen being requested 95Hz that it doesn’t support. So I took back my xorg.backup.conf uninstalled previous drivers and reinstalled the manual way and aticonfig –initial from my clean xorg.conf. Neat, I got it with DRI!!

Then wanted to listen to some Music, so I launched Amarok but it wouldn’t be able to grab the mp3 codec from the net (now it’s working good), So I switched to xmms which worked but had crazy fonts when browsing file system for mp3 (I didn’t fix that yet).

Ok, I find Konqueror better with each linux distro I installed in time, but my favorite webbrowser is : firefox. Naive as I am I tried to apt-get it without success, It would only bring me some patches… So I tried to install it from Mozilla but it complained that it doesn’t find the executable although I am 100% sure it is here… In fact this is the non-explicit message you’ll get each time you install an i386 binary on your amd64 architecture. After some search and some unsuccessful tries, I ended on an Ubuntu forum post How to install 32 bit Firefox with flash, it worked like charm!

While all this, I encountered a major problem with my keyboard : I was not able to type the essential key ‘|’ and several others you get while pressing ‘Alt Gr’. Also / * – + from keypad were not working, not that I use them that much but it’s faster when you have some calculus to do.
This was solved creating $HOME/.Xmodmap with :
keycode 113 = Mode_switch
keysym KP_Divide = slash
keysym KP_Multiply = asterisk
keysym KP_Add = plus
keysym KP_Subtract = minus

This won’t work as I read here and there that xmodmap is deprecated and that xkb should be used instead. For the moment I’ll just add xmodmap ./Xmodmap to my $HOME/.bash_profile. I’ll play with xkb later.

Ok, For the moment we stayed with the basis, I wanted to give a try to beryl 3d desktop manager version 0.1.4. I followed the simple Beryl Installation For Edgy but without success as when I would run beryl-manager I would end with a non-explicit message (again) : Beryl caught deadly signal 11. After some reading around the net I downloaded rearranged amd64 beryl package beryl-0.1.4.tar.gz that I got from Ubuntu Forum. It worked like charm, and then I had to admit I was really surprised by this nice and new Desktop!

Finally, I wanted to have my pctv working so I installed kdetv Viewer. It’s not bad but the screen is scrambled on certain screen size. Then I tried with XawTv, but their interface didn’t change and is still unfriendly… Wanted to try xdtv but couldn’t find the latest deb for amd64 so I took older one (I didn’t want to compile it, as it depends on zillions of lib and that I had better stuff to do than spending time on that), but without success. Finally the award winning for tv watching on my ubuntu was tvtime. But still the rendering without overlay is worse than with K!TV on Windows.

To draw a conclusion, I would say that Kubuntu managed to put one of the best distro around (Debian) available for Desktop users easily. Once configured you’ll have a good Desktop (I’ll blog about that later cause I still have criticism about that). But if you want it perfect, it will take you quite a lot of time to get to the result you want, lambda user doesn’t want that! He wants to click, reboot X times and that’s it…
Now a programmer can spend some more time to get his best Integrated Development Operating System Environment.