donderdag 23 december 2010

Livebox automount of usb HD

Ok, I'm streaming from my Mobistar Livebox to my PS3, but no thumbnails, bad directory structure, ...
So, I'd also have Mediatomb installed on my laptop, and want to be able to use that too.

Mediatomb needs a mounted filesystem however, whereas I now connect to it via smb://livebox/DisquesUSB/HD204UI/data/ in Dolphin.

So here how I mount that on the different systems:
cd /media/
sudo mkdir liveboxUsbHD
test it:
sudo mount -t smbfs -o username=theuser,password=hispass //livebox/DisquesUSB/HD204UI /media/liveboxUsbHD
The directory /media/liveboxUsbHD should contain the files.
For automatic mounting:
cd /etc/init.d
sudo kate start_smb
And have this file contain the above line
#!/bin/bash
sudo mount -t smbfs -o username=theuser,password=hispass //livebox/DisquesUSB/HD204UI /media/liveboxUsbHD
So we use smbfs, cifs should work too and is even needed if a real windows share. Anyway, the file contains your password, so hide it and give it correct permissions:
sudo chmod 550 start_smb
sudo update-rc.d start_smb defaults
In case the samba share is not available on start-up, you can create the link on a later time with:
sudo ./etc/init.d/start_smb
That's it!

donderdag 19 augustus 2010

sound out on Dell studio XPS

I bought some nice boxes so as to be able to have nicer sound for the radio stations I listen to, but look, the headphone out jack of my dell studio xps is not working in Kubuntu 10.04!

Apparently the default for sound is using the bios configuration, and as I see no sound option in the bios that means I cannot repear the error there. All info to fix it is on the ubuntu community wiki.

So, for this laptop, fire up eg Kinfocenter, and see under sound:
Audio devices:
0: STAC92xx Analog (Duplex)

Mixers:
0: IDT 92HD73C1X5


Looking at the HD audio models documention, we see

STAC92HD73*
===========
ref Reference board
no-jd BIOS setup but without jack-detection
intel Intel DG45* mobos
dell-m6-amic Dell desktops/laptops with analog mics
dell-m6-dmic Dell desktops/laptops with digital mics
dell-m6 Dell desktops/laptops with both type of mics
dell-eq Dell desktops/laptops
alienware Alienware M17x
auto BIOS setup (default)

So as said, the BIOS setting is the default. So let's change it to dell-m6:
sudo kate /etc/modprobe.d/alsa-base.conf

and add at the end of the file:
options snd-hda-intel model=dell-m6

Reboot, and yes, sound is available on one of the headphone out jacks. The above line is also what is listed on the forum. Should you know how to make both headphone out to work, let me know.

donderdag 10 juni 2010

A0 poster with latex


I had to make an A0 poster for a conference. As I had my source in LaTeX, I tried for the first time to do it with latex. It worked better than I thought.

First, at UGent, one can print the poster with http://www.elis.ugent.be/nl/designjet

Second, a latex base file using columns and posterboxes, is at http://www.sgeier.net/poster/. I had to change it a bit to get it working ok though: remove some /hfill and /vfill calls, add some \mbox{\ } as needed.

Note that in Europe, you would want to create an A3 example, then scale it by 2.8 to obtain an A0 poster. So you need the following width and height in the tex:
\def\layoutwidth{297mm} % A3 portrait, A0 when scaled 2.82
\def\layoutheight{420mm}
\def\numcolumns{3}
The above produces a bad dvi file when compiled with LaTeX though, you need to run the command
dvips -Ppdf -G0 -o poster.ps poster
to obtain a nice ps file okular can nicely show. You can then print this to an A3 printer with good results.

Third step is to scale it to A0 poster. You need the poster_resize script for this:
csh poster_resize poster.ps 2.8
This creates a poster.resize.ps file which is an A0 print. If you do not have csh, sudo apt-get install it!

Fourth step is to create a backup: split the A0 poster in 16 A4 sheets you can plot on a colour printer and glue together yourself:
poster -iA0 -mA4 -pA0 poster.resize.ps > posterA4.ps
That is it. If you do not have the poster program, it should be available in your package manager (sudo apt-get install poster).

vrijdag 14 augustus 2009

upgrade, reinstall scipy

So I jumped on the upgrade wagon again with ubuntu, but now I need to obtain last versions of scipy again. All is now python2.6, and only gfortran is supported anymore. Make sure g77 is completely removed, and gfortran latest distro package

The workflow:

NOTE: use the --prefix /usr flag if setup.py installs in the wrong directory.

1. make sure you do not have the repository stuff installed or old versions:
sudo apt-get remove python-scipy python-numpy python-matplotlib python-gnuplot
sudo rm -rf /usr/lib/python2.6/site-packages
sudo rm -rf /usr/lib/python2.6/dist-packages/numpy
sudo rm -rf /usr/lib/python2.6/dist-packages/scipy
sudo rm -rf /usr/lib/python2.6/dist-packages/matplotlib
sudo rm -rf /usr/lib/python2.6/dist-packages/scikits*
2. obtain source code if you do not have it yet:
svn co http://svn.scipy.org/svn/numpy/trunk numpy
svn co http://svn.scipy.org/svn/scipy/trunk scipy
svn co https://matplotlib.svn.sourceforge.net/svnroot/matplotlib/trunk/matplotlib matplotlib
svn co https://gnuplot-py.svn.sourceforge.net/svnroot/gnuplot-py/trunk gnuplot-py
svn co http://svn.scipy.org/svn/scikits/trunk/odes odes

3. Make sure you have the dependencies, eg
sudo apt-get install python-dev python-setuptools
For matplotlib, gtk backend, see build depend of the ubuntu package.
I used:

sudo apt-get install libpng-dev libgtk2.0-dev python-gtk2-dev python-imaging python-qt4 python-qt4-dev python-tz python-wxgtk2.8 zlib1g-dev libfreetype6-dev


4. go to numpy, update, compile, and install. Normally you need to remove /usr/lib/python2.6/site-packages/scipy or /usr/lib/python2.6/dist-packages/scipy and same for numpy first, but as python2.6 is new, those are not present.

cd numpy
sudo rm -rf build
svn up
sudo python setup.py install --install-layout=deb

cd scipy
sudo rm -rf build
svn up
sudo python setup.py install --install-layout=deb

cd matplotlib
sudo rm -rf build
svn up
sudo python setup.py install --install-layout=deb

3. Now I can reinstall my own module in scikits

cd programs/odes
sudo rm -rf build
svn up
sudo python setup.py install --install-layout=deb
Above works only on first install. Afterwards I obtain an error with zip files?? To resolve
rm -rf /usr/lib/python2.6/dist-packages/scikits/odes
sudo rm -rf build
sudo python setup.py install --single-version-externally-managed --root / --install-layout=deb
And then it is time to test if all is working again.
Interesting resource: python distutils

donderdag 28 mei 2009

Jaunty, ati/radeon and a big desktop with xrandr

Buggers, my ati card is no longer supported by the fglrx driver of ati. Full 3D support is present though in the open source driver. Big desktop over two screens? Well 'man radeon' claims it is present. However, I noticed also bug 348332

So I waited with the upgrade, but today, I felt lucky and did the upgrade. Not a good idea.

First, although the upgrade manager said fglrx would not be installed, it did not regenerate my xorg file. So X crashed on startup. Alt+F1, a login and a "sudo dpkg-reconfigure -phigh xorg-server" later, I had my X back.

I got bit by bug 348332 very quickly though, so disabled desktop effects in the system settings for now. No option to make a big desktop in these settings though, so apparently that will be a manual install.

But first getting my effects back. A trip to http://kernel.ubuntu.com/~kernel-ppa/mainline/v2.6.29.4/ and then install of the relevant components:
sudo dpkg -i linux-headers-2.6.29-02062904_2.6.29-02062904_all.deb linux-headers-2.6.29-02062904-generic_2.6.29-02062904_amd64.deb linux-image-2.6.29-02062904-generic_2.6.29-02062904_amd64.deb


After restart things looked ok:
$ uname -a Linux bmwork 2.6.29-02062904-generic #02062904 SMP Sat May 23 23:35:48 UTC 2009 x86_64 GNU/Linux
And re-enabling desktop effects was ok too. Still waiting for a crash, but all looks good so far.

So, now, how to get my big desktop back. My setup is using the default xorg.conf the radeon driver. My xorg.conf:

Section "Device"
Identifier "Configured Video Device"
EndSection

Section "Monitor"
Identifier "Configured Monitor"
EndSection

Section "Screen"
Identifier "Default Screen"
Monitor "Configured Monitor"
Device "Configured Video Device"
EndSection
Apparently we are supposed to use xrandr (see good intel guide) now for enabling a big desktop. First let's see if it is enabled:
$ xrandr -q
Screen 0: minimum 320 x 200, current 1024 x 768, maximum 1280 x 1280
VGA-0 connected 1024x768+0+0 (normal left inverted right x axis y axis) 340mm x 270mm
1280x1024 60.0 + 75.0 60.0
1024x768 75.0 70.1 60.0*
800x600 75.0 60.3
640x480 75.0 59.9
720x400 70.1
DVI-0 connected 1024x768+0+0 (normal left inverted right x axis y axis) 304mm x 228mm
1024x768 60.0*+ 75.0 60.0*
800x600 75.0 60.3
640x480 75.0 59.9
720x400 70.1
OK, my VGA and DVI output are both recognized and correctly enabled, one with identifier VGA-0 and one with DVI-0. The default is clone mode though, which is what I indeed am seeing. To set my VGA left of the DVI I do:

$ xrandr --output VGA-0 --left-of DVI-0
xrandr: screen cannot be larger than 1280x1280 (desired size 2048x768)
It did not work. We need to make sure we can have a virtual screen of 2048x768 before above will work. The graphics card should be capable of this. My /var/log/Xorg.0.log file says:
(II) RADEON(0): Max desktop size set to 2560x1600
(II) RADEON(0): For a larger or smaller max desktop size, add a Virtual line to your xorg.conf
(II) RADEON(0): If you are having trouble with 3D, reduce the desktop size by adjusting the Virtual line to your xorg.conf
So add a Virtual line (see xorg.conf below), and all works.
Next, as given in the guides, you need to use xrandr commands to see if it works. Well, I can say it does not work 100% via the xrandr command in my case. The desktop got bigger indeed, but both screens kept showing the same thing. Fortunately, changing the xorg.conf file to do the xrandr settings worked like a charm. My new xorg.conf file is:

Section "Monitor"
Identifier "VGA"
EndSection

Section "Monitor"
Identifier "DVI"
Option "RightOf" "VGA"
EndSection

Section "Device"
Identifier "Configured Video Device"
Option "Monitor-VGA-0" "VGA"
Option "Monitor-DVI-0" "DVI"
EndSection

Section "Screen"
Identifier "Default Screen"
Monitor "Configured Monitor"
Device "Configured Video Device"

SubSection "Display"
Depth 24
Virtual 2048 768
EndSubSection
EndSection
Things to note in the above:
  1. The options in the Device section you see, must have the identifier as given by the xrandr -q output, so Option "Monitor-VGA-0" "VGA" works but not Option "Monitor-VGA" "VGA"
  2. The Virtual 2048 768 line in Display is where the maximum virtual size is set (see xrandr error above) you need for your display. Take it as low as possible, so you can have as much as possible depth (it eats memory on the card!)
Good. Half a day to get a working set-up. Perhaps I should not upgrade so often. Fortunately, 3D does seem to work like a charm on my dual head setup :-)

maandag 3 november 2008

slow touchpad in (K)Ubuntu 8.10 Latitude D830

My wife has a new work laptop. Install of Kubuntu Intrepid Ibex went fine, but vpnc did not work. Well, a bug entry in lauchpad solved that: 280926

Next, the touchpad was much too insensitive, and editing xorg.conf is no longer wanted with Xorg 7.3+ Fortunately another launchpad bug brought the solution: 177146

So now I have a file touchpadsens in my ~/.kde/Autostart directory with the contents:

#!/bin/bash
xinput set-ptr-feedback "AlpsPS/2 ALPS GlidePoint" 3 8 1

After that, the file touchpadsens is made executable:

chmod +x touchpadsens

and now, all looks fine... well till the next issue! I did not put dvd's or cd's in the drive, ....

woensdag 10 september 2008

GRAMPS, client-server, SQL: Django?

GRAMPS, client-server and SQL are 3 terms one normally does not find in the same sentence. For those not in the know, GRAMPS is a genealogy application which I started using in 2007, and ended up developing for. Gramps is a nice application, but it is a PC application storing it's data in a Berkeley DB embedded database for performance.

Hence, it does not allow for collaboration, running on a single PC. The use of a low level database has the advantage of speed, at the expense of being less known, and a lot more complicated to work with. However, genealogy data as stored by GRAMPS is a verly linked set of relations, so fitting it in a relational type of database is no easy feat.

Collaboration by exchanging your files in the gramps xml format is the way to go, but merging is not implemented yet, and even if added, people in the database world know that merging two diverging datasets back together is a very difficult task.

Now, people might opt for another solution, going for one of the collaboration apps out there for genealogy, some even open source. However, those work on GEDCOM, which is not as versatile as GRAMPS, so it means not using GRAMPS anymore. However, obviously one cannot always have the internet in it's pocket, so a collaboration app that could work in the data model of GRAMPS would be great.

It was hence with pleasure that I noticed that Django had reached version 1.0. This is important as
  1. Django is written in Python, so allows the use of GRAMPS code and logic directly. Present OSS collaboration apps for genealogy are in perl/php/...
  2. Django is a web application, so client-server is the way from the beginning
  3. Django interfaces with SQL databases (MySQL, PostgreSQL, ...)
  4. Write a model once, and without coding, administration code is available to edit the data via a web interface
Based on this and the fact that I was interested in knowing/understanding/learning Django, I started translating the GRAMPS data model to a Django model. The aim is to get the administration tool working, and allow for import/export to gramps xml files.
With my web-design skills it is best to leave any web views to other developers, if there are any interested in that out there.

I know, why do what has been done again, blah, blah, join forces with other OSS efforts. You know, that is just not how it works. Anarchy rules? Perhaps. My take on it is that the tools we use improve, so there is a constant need to rewrite what has been done so as to use these new shiny tools instead. In this case, setting up a Django app is too difficult for most PC users (apache server configuration anyone?) so it will not replace GRAMPS in any way. That would actually be impossible anyway I think. However, thinking GRAMPS can 'evolve' so as to have an SQL backend or become client-server aware, is also wishfull thinking as there is just too much legacy to be carried. Better start a new initiative and see later on if there is possibility to work together. In the worst case, experience will be learned with what works, and what doesn't

More on the technical details some other time.