How to Build a DEB package for the git sources – January 9th, 2010

I wanted to build python-moinmoin from the 1.8.x series because python-moinmoin 1.9 didn’t work for me.

So I went and grabbed the source tar ball from http://git.debian.org/?p=collab-maint/moin.git;a=summary.

Then I did the following:

tar xvzf moin.tar.gz
sudo apt-get build-dep python-moinmoin

dpkg-buildpackage -rfakeroot -uc

and then I got myself a debian package working, a few more edits on the website configuration, and I was good to go with my wiki.

That’s here short for reminding me, in can I need this again…

Posted in Debian

How to convert LATEX to OPENOFFICE – January 2nd, 2010

For a long time I know that I can export lyx files to ODT format, and it does a pretty good job. Today, I start lyx with moving it to the background and I looked what’s going in on when I export to ODT. It’s using a commant htlatex, which can be found in the Debian package tex4ht .

Here’s how to use it:

htlatex yourlatexfilename.tex "xhtml,ooffice" "ooffice/! -cmozhtf" "-cooxtpipes -coo"

This is pretty CPU intesive if your document is pretty complex, so be patient !

A Brief what to expect and few cavities I could not solve:

  1. Images are not inserted! So total fail here.
  2. Bibliography is done pretty good, design of your style is kept, and all the references are inserted in the correct place. However, the bibliography items, are just text, not like real references! So, here I give it “almost good”
  3. Styles are done nicely, so it’s very good.
  4. Dynamic lists, i.e. Table of Contents, List of Figures etc, are not created ! Clicking Update on the Table of Contents solves the problem, however, I tried doing this on the List Of Figures, and created again the Table on Contents ! So here htlatex gets a “sufficient” grade, but not good!

So, in my opinion this is not a very good to my need, but never the less, I can’t find any better alternative. If you find a better one or know how to solve one of the above issues, I’ll be happy to know.


				
Posted in latex

How not to use Kill Command on Linux – November 22nd, 2009

A few months ago I installed Debian GNU/Linux on an old Sony Vaio Laptop of a friend of mine. The laptop is really nice with slim case and a 15″ screen. She was really happy she could write her thesis on this nice machine again because Windows XP could not function properly on this machine. Installation was a breeze and  the non technical friend of mine was working on it happily for 4 months now.

Three weeks ago she called me and asked how she can watch DVD’s with. I figured out I forgot to install libdvdcss2 on her Debian. So I dropped by her place to fix it. I opened Synaptics and searched for it. But somehow it got stuck. So I had a terminal open and I typed

ps aux | grep synaptic.

At this point she mad a remark on “oh, what is this magic and all those words…”

I murmured something about this is the linux terminal while reading the pid of synaptic, and then I typed:

kill -9 5322

At this moment she stopped breathing and then yelled “Oh, what’s going on… don’t kill my computer…”.

Trying to explain what is the meaning of the command kill where non-useful. She was really astound by this.

So my conclusion is for next type – to save panic from your non technical friends, avoid using the command kill in front of them. It sound scary I guess. If you really have to kill a process, to it from gnome-system-monitor or ask them to bring you a glass of water before you type kill on their computer !

Posted in Debian, Linux

Evalution of Tracer Test with Python scipy.optimize – October 10th, 2009

This post is not intended only to hydrogeologists, but also to any one who needs a working example of the use of a function minimum search.

It is very common for many scientific problems to search for a minimum condition. In optimization of problems it’s very common to use a minimum of least squares function between measured results and some model function.

In the following code you can see the results of a tracer test procedure preformed at a test site called Lauswiesen, at the skirts of ‎‎Tübingen in southren Germany. This tracer test was performed as part of a course called Field Methods in Hydrogeology given in the Master’s program of Applied Environmental Geosciences.

Read the rest of this entry »

Posted in Python, science

MoinMoin wiki on Debian, Installation and configuration – September 11th, 2009

Sometimes, installation of Debian packages is too easy, but them configuration can be quite confusing.

This is the case, in my opinion, with the README.Debian file which describes an example of moin-moin wiki installation under a subdomain wiki.example.org.

Here are my notes of how to install moinmoin package from Debian Squeeze on Debian Lenny.

First, you need to install python-support from debian-backports.org.

Second, download manually or with apt-get the package of debian lenny for python-moinmoin.

Install both packages, if you downloaded them manually with the command:

dpkg -i python-support_1.0.3~bpo50+1_all.deb python-moinmoin_1.8.4-1_all.deb

After that you need to issue the following command, which are also described in the README.Debian:

1) Create and populate /var/www/mywiki

mkdir /var/www/mywiki
cp -r /usr/share/moin/server/moin.cgi /var/www/mywiki
mkdir /var/lib/mywiki
cp -r /usr/share/moin/data /usr/share/moin/underlay /var/lib/mywiki

2) Pass on the wiki to Apache:

 chown -R www-data: /var/www/mywiki /var/lib/mywiki

3) Configure Apache2:
Add the following as /etc/apache2/sites-available/mywiki:

<VirtualHost *:80>
 #comment the line below if you intend to use only http://localhost/mywiki
 ServerName wiki.example.org
 DocumentRoot /var/www/mywiki/
 Alias /moin_static184/applets/FCKeditor/ "/usr/share/fckeditor/index.html"
 Alias /moin_static184/ "/usr/share/moin/htdocs/index.html"
 ScriptAlias /MyWiki "/var/www/mywiki/moin.html"
</VirtualHost>
<Directory /var/www/mywiki/>
 Options Indexes FollowSymLinks MultiViews
 AllowOverride None
 Order allow,deny
 allow from all
 Options +ExecCGI
</Directory>

4) Configure MoinMoin:

Edit /etc/moin/farmconfig.py to commentout data_dir and
data_underlay_dir (we need those defined separately for each wiki)

Edit /etc/moin/mywiki.py to include these lines:

 sitename = u'MyWiki' # [Unicode]
 data_dir = '/var/lib/mywiki/data/index.html'
 data_underlay_dir = '/var/lib/mywiki/underlay/index.html'

Edit /etc/moin/wikilist to include this line:

 www-data wiki.example.org/

5) Activate wiki:

a2ensite mywiki
invoke-rc.d apache2 reload

6) Enjoy your new wiki at http://your.site/MyWiki/

A Note about themes, debian, moin-moin

Debian is intended for the server… Thus it’s quite biased for a wiki-farm rather than a personal use wiki. Default moinmoin shares lot’s of files between different possible moinmoin installations.

The appropriate directory for installation of themes, under Debian won’t be the data directory (in the above example, /var/lib/mywiki/data)  rather a shared directory under /usr/share/moin/htdocs.

So the css/, img/, js/ directories of a plugin go there, and the python module of the theme goes to /var/lib/mywiki/data/plugin/theme.

Here is an example of how I installed fixedleft theme:

ls -p /usr/share/moin/
config/  data/    htdocs/  server/  underlay/

ls -p /usr/share/moin/htdocs/
applets/  common/      fixedleft/  modern/    rightsidebar/
classic/  favicon.ico  index.html  modernized/    robots.txt

ls -p /usr/share/moin/htdocs/fixedleft/
css/  img/  js/

ls -p /var/lib/mywiki/data/plugin/theme/
fixedleft.py  fixedleft.pyc  __init__.py  __init__.pyc

To activate the theme, you need to /etc/moin/mywiki.py, add the following line:

theme_default = 'fixedleft'

to activate fixed left as the default theme.

If you have two lines like this:

theme_default = 'rightsidebar'
theme_default = 'fixedleft'

The last one will be the effective one.

Posted in Debian, Python

Wicd ROCK on the roads ! – August 27th, 2009

Been traveling in the USA for a couple of weeks now. I was prepared for bitter timetime with my Debian and wireless roaming. So I’ve mastered the use of commands ifconfig and iwlist and such. The reason is that I’ve had my share already with network-manager.

I always found gnome-network-manager resource hog, and non reliable. And when I tried it two weeks ago after one and a half years I discovered it’s developed so much I can’t recognize it anymore. It has too many options, and it’s more suitable to a network engineer than a simple user. What happened to the GNOME simplicity I don’t know, some one in Red Hat really screwed up with the development of it.

Anyways, I decided to give WICD a shot. Hearing only warm words of it I downloaded the version from Debian repos, and after a minute I was already connected and running wireless.

What makes WICD awesome ?

It’s reliable, It’s easy to use because the user interface is clear and simple. And most importantly it stays out of my way, unlike gnome-network-manager.

The latter needed to many mouse clicks and dialogs to configure, whereas wicd just needs one click.

Here’s a screenshot of the simple wicd notification:

Screenshot

I really like the simplicity. Just for the nostalgia I keep also on the panel the gnome-netstatus-applet…

P.S I forgot to mention, I really think this should be the default network application in Debian/Ubuntu and other gnome based distros.

Posted in Debian, Linux