Archive for October, 2006

Quit Windows, my friend

Bruce Lee, on Windows (based on his Be water, my friend speech):

Empty your hard disk.

Don’t be pointless, hopeless… like Windows.

You put Windows in a bottle… it’s still a bottle,
you put it in a computer… it becomes a teapot!

Windows can crawl, or it can crash

Quit Windows, my friend.

¿Te gusta reiniciar?

Comments

Comparison of Wiki software

I am working out a Wiki page for a small sized group of users of a supercomputer at the UPV/EHU.

You might find this comparison useful.

My impressions so far:

[[MoinMoin]]

See more comprehensive HowTo at this more recent post

To install it, create a directory for it (e.g., in your /home), then copy some files to it (after installing the python-moinmoin and moinmoin-common packages, in Debian):

mkdir my_moinmoin_dir
cp /usr/share/moin/config/wikiconfig.py my_moinmoin_dir
cp /usr/share/moin/server/moin.py my_moinmoin_dir
cp /etc/moin/mywiki.py my_moinmoin_dir

Then, edit the files (mainly wikiconfig.py, and run my_moinmoin_dir/moin.py to start up the server.

If you want to make a single Wiki (not a “farm”), then remove (or better, just rename) the file /etc/moin/farmconfig.py (so that it is not read).

This one was easy to install, but has a “small” drawback: the CamelCase internal links. How freaking silly is that? First off, it makes writing CamelCase words that are not links impossible. Second, how can one make a link that displays a text X, but points to page Y?. If only CamelCase generates links, ThisText will link to the page called ThisText. This means that there is no way to put a custom string as link, pointing to a custom page. This is frustrating at the very least. Third, how does one make a one-word link?

These three concerns are taken care of, fortunately. A custom string (not CamelCase) can be used as link like that:

["Custom string here"] (links to page called Custom string here”)

The text of the link can differ from the title of the refered page like this:

[:The Refered:The Text] (displays “The Text”, while pointing to page “The Refered”)

I found out about this workaround after I started to write this page, so sue me for complaining.

It is also problematic (for a dumbass like me) to make the Wiki accesible to machines other than localhost. That is, over the Intra- or Internet. I’m working on in.

DidiWiki

Pros: it is very simple. It is a breeze to install and run. Under Debian, just aptitude install didiwiki, then run didiwiki -p 8080, open a web browser, and put http://localhost:8080 at the location bar. The default port is 8000 (if you run just didiwiki), but for me it fails. The -p can be used to attach DidiWiki to any port.

Contras: it is very simple. Editing is very easy, but… there is no preview! Is there a way to hack a preview into it? I do not know, and the project having made no progress since 2004 smells like there will never be such an upgrade.

More important: there is no “history” of the edits into a page. You can see a list of “recently edited pages”, but no such a list for each single page, or a diff between to arbitrary versions, or reversion capabilities.

On the brigth side, it is immediate to access the Wiki from any other computer… I just don’t know if this is a feature or a security hole :^)

DokuWiki

To install under Debian, do aptitude install dokuwiki, answer the questions it makes, then run dpkg-reconfigure dokuwiki to see if it asks for some more options (e.g. if Wiki will be accesible from localhost, a subnet, or the whole Internet, or what directory to put it under). Then, restart the web server (if you are running Apache2: /etc/inid.d/apache2 restart), and you are done! Now, simply point your broser to http://localhost/dokuwiki/, and you can start using it (replace dokuwiki/ with whatever dir you chose when configuring, if you changed the default).

At first sight is looks good. However, it keeps giving me errors when saving a page. The page gets full of the following:

Warning: preg_match() [function.preg-match]: Compilation failed: repeated subpattern is too long at offset 17093 in /usr/share/dokuwiki/inc/common.php on line 391

It actually saves the page… but the error is annoying at least, dangerous at worst. I suppose I could try to read the source code and fix it (it is PHP, and I have spotted the line with the error… hehehe, line 391, that is), but I do not have the programing skills, I fear.

I’ll give it a try…

Okay, I might have corrected the first bug of a FLOSS program in my life: the 391th line giving an error reads:

if( preg_match('#('.join('|',$re).')#si',$TEXT, $match=array()) ) {

I read the PHP manual for preg_match, and found out that this function chokes for long strings. They say that you can use substr instead, if you are only using the function to find out if some substring exists inside some string (substr is faster and more efficient than preg_match). So I commented out the line above, and wrote instead:

/*if( preg_match('#('.join('|',$re).')#si',$TEXT, $match=array()) ) {*/
if( strpos('#('.join('|',$re).')#si',$TEXT, $match=array()) ) {

Now it works (or pretend it does) like a charm!! UPDATE: the above is rubbish :^( Find a better solution at the DokuWiki bugtracker.

Appart from that, DokuWiki seems to have a decent page edit history, and you can compare different versions with the current one. Pity it doesn’t seem to be possible to compare different old edits between them, as it is with MediaWiki (the engine behind Wikipedia). DokuWiki also looks a bit ugly, but I guess one can correct that with CSS, skins or whatever.

It also looks more difficult to configure than MoinMoin, for example I do not see an easy way to create users. Probably I should just RTFM, as there must be an easy explanation for all that… but I’m too lazy, and MoinMoin is more intuitive on this account (and looks prettier).

ErfurtWiki

It goes under the name ewiki, as a Debian package. However, when I tried to install it, it requested PHP4 (I have PHP5 installed), so I refused to downgrade my PHP and ewiki would not install.

Kwiki

It needs to run as a Perl cgi module. After installing, add the following to your /etc/apache2/apache2.conf:

ScriptAlias /kwiki/ /var/www/kwiki/

Options +ExecCGI

The ScriptAlias makes the browser go to /var/www/kwiki/ when pointed to /kwiki. The Directory block lets Apache execute scripts in that dir.

One then needs to install modules, from CPAN.

All in all, not too easy, a bit annoying, and a bit buggy. Didn’t work well for me.

MediaWiki

Time to give the engine behind Wikipedia itself a try. Probably it is a big overkill for my needs, but what the heck…

First: it is a breeze to install under Debian. First, aptitude install mediawiki, which will automatically install mediawiki1.7, php5-cli and php5-mysql, plus PHP5 and MySQL, if you don’t have them installed. It is also suggested to install memcached.

After aptitude installation, steer your browser to http://localhost/mediawiki/config/index.php (as the README.Debian.gz file says), and fill the required data. After everything is correctly set, copy the Settings file to its final location (also said in the README):

cp /var/lib/mediawiki1.7/config/LocalSettings.php /etc/mediawiki1.7/

URL beautification HowTo

Following instructions at the WikiMedia site.

The default MediaWiki URL is:

http://mywiki.site.tld/wiki/wiki/index.php?title=Article_name

This could be rewriten as:

http://mywiki.site.tld/wiki/Article_name

To achieve that, add the following to /etc/apache2/httpd.conf:

AcceptPathInfo On

#These must come last, and in this order!
Alias /wiki /usr/share/mediawiki1.7/index.php
Alias /index.php /usr/share/mediawiki1.7/index.php

Then the following to /var/lib/mediawiki1.7/LocalSettings.php:

$wgScriptPath = "/mediawiki";
$wgArticlePath = "/wiki/$1";

Then enable the rewrite PHP module, and reload Apache:

ln -s /etc/apache2/mods-available/rewrite.load /etc/apache2/mods-enabled/rewrite.load
/etc/init.d/apache2 reload

Now just point your broser to http://localhost/wiki/, and you are done.

Comments (1)

Blackout summary V

Last saturday, Iberdrola suspended the electrical power suply for a couple of hours. The only good thing is that they warned beforehand. The bad part is that they said that they’d cut it on tuesday, which they didn’t, for no apparent reason. Then, they actually cut it on saturday.

Here goes the updated list of blackouts I have been able to compile, with comments if any:

  1. 2005-Dec-13
  2. 2005-Dec-21
  3. 2006-May-26 (The card-based automated access to the Faculty broke down)
  4. 2006-Jun-04
  5. 2006-Jun-08
  6. 2006-Jun-13
  7. 2006-Jun-16
  8. 2006-Jul-04 (Orpheus didn’t fall)
  9. 2006-Sep-14 (Orpheus fell, the DNSs fell, the DHCP servers fell)
  10. 2006-Oct-21 (they warned beforehand)

Summary: 10 blackouts in 311 days, or 31.1 dpb (days per blackout). 37 days since last blackout. Average dpb went up by 0.7.

First post in the series: here

Comments

Running Scared

This week I have watched Running Scared (“La prueba del crimen”) (IMDb|FilmAffinity[es]).

It is a good action movie, albeit a bit too violent at moments. The photography has some Tony Scott-like moments of choppy and fuzzy scenes, but much less pronounced than in, e.g., Domino.

The plot is well drafted, and the story is absorbing. Too bad the end is confusing, violent and Hollywoodesque. There are some plot twists that add to the value of the movie, but others are mere concessions at “all ends well”. However, it is much more dark and bitter than your average cops/mob movie, where nothing really bad ever happens.

All in all, I would say this movie is not bad, and deserves to be watched.

Comments

The music industry is in crisis

Being a fan of Jamendo and CC music in general, the discographic lobby might have tagged me as a disruption vector. After all, I am worse than a “pirate”: I do not buy commercial CDs but the music I listen to has been legally acquired.

Well, this is not strictly true. I do buy CDs, from time to time. Just yesterday, I spent 69.40 eur in CDs!! However, I never (seldom) buy trendy music, for the simple reason that CDs over 9.00 eur are almost invisible for me.

The list of what I bought:

  • El infierno es demasiado dulce (Eskorbuto) – 8.25 eur
  • En tránsito (J.M. Serrat) – 10.65 eur
  • Loco por incordiar (Rosendo) – 8.30 eur
  • Física y Química (J. Sabina) – 8.75 eur
  • Bolsillos (Pedro Guerra) – 2.25 eur
  • Valle de Lágrimas and Aparejo de Fortuna (Javier Krahe) – 10.75 eur both
  • Versiones Originales (Pérez Prado) – 5.75 eur 2CDs
  • Pájaros en la cabeza (Amaral) – 5.95 eur
  • Planeta Eskoria (SKA-P) – 8.75 eur

Total: 11 CDs at 6.40 eur each avg.

Comments (1)

El diablo viste de Prada

Ayer vi esta película (IMDb|FilmAffinity), y me gustó mucho.

La verdad es que una más de las películas que retratan el precio del éxito, y tampoco la mejor… pero está bien, y es amena. Me esperaba una crítica más brutal al mundo de la moda, pero en el fondo esta temática solo es tratada como ambientación. Si cambiamos la revista de moda Runway (donde la protagonista Anne Hathaway encuentra trabajo, bajo las órdenes de la tiránica y caprichosa Meryl Streep) por una empresa automovilística o una farmaceutica, las cosas no cambian mucho.

El contraste entre la poco sofisticada protagonista y sus glamurosas compañeras de trabajo da pie a situaciones divertidas, pero el tema de fondo no es el mundo de la moda, sino la traición y la falta de escrúpulos para lograr el triunfo.

Comments

Default Ghostscript paper size

The three times god-forsaken Ghostscript (I use the Debian package gs-afpl) suite is shipped worldwide with the US letter default paper size. So, when you use it (e.g. to convert PS to PDF), and if the source file does not specify a paper size, the output file will have a letter size, instead of the more sane A4.

You can specify A4 size at runtime, with the -sPAPERSIZE=a4 flag:

ps2pdf -sPAPERSIZE=a4 input.ps

However, if you want to always use A4 as default, you can change the gs_init.ps file (locate gs_init.ps), and uncomment the following line (remove the leading ‘%‘):

% /DEFAULTPAPERSIZE (a4) def

Beware that in Debian you will have to change it to (because the name of the variable is different):

/DEFPAPERSIZE (a4) def

You will only need to edit the gs_init.ps file (as root), make the changes and save the file. Subsequent gs uses (e.g. ps2pdf), will default to A4 page size.

Comments (2)

Jarl!

Me acabo de pulir los 142 links ambiguos a La Rioja que había en la Wikipedia, visitando las 142 páginas (bueno, en alguna página había más de un link) y haciendo que dichos links señalasen hacia la entrada de la Wikipedia a la que el autor quería haber señalado (en el 99% de los casos “La Rioja (autonomous community)”, aunque hay una provincia, y su capital, con ese nombre en Argentina también). Lo he hecho, lógicamente, con el método del mvs, que menciono en el post anterior, a más de un link por minuto de media :^)

Comments

Editing Wikipedia with mvs

I am currently doing some link disambiguation work for the Wikipedia, and as such, I have to find and replace the same strings many times, in many articles. The on-line Wikipedia edition is in general fine, but one would love to be able to use vim, for a task such as the one I’m taking. To do so, one can make use of mvs.

The mvs program allows us to download a Wikipedia article, save it as a file, then upload it again, after manipulating the file the way we want.

To log in to our Wikipedia account:

mvs login -d wikipedia.org -u username -p password

To download article “X” (beware the .wiki extension):

mvs update X.wiki

We can then edit X.wiki:

vim X.wiki

Then check it:

mvs preview X.wiki
firefox preview.html

And finally upload it:

mvs commit -m 'Your comment goes here' X.wiki

For more info, read the Wikipedia text editor support page

Comments

Txema’s SCF recipe for Gaussian

According to an e-mail by Txema, if you have a Gaussian job whose SCF does not converge, you can try the following:

scf(noincfock,conver=6,maxcyc=2025) iop(5/22=20)

Explanation:

  • NoIncFock: Prevents use of Incremental Fock formation
  • Conver=6: Request a mere 10-6 convergence criterion (whereas the default is 10-9, I believe).
  • iop(5/22=20): Use DIIS extrapolation, with energy-based mixing. OK, OK, I have no idea what this means, and I use it out of superstition… yeah, sue me.

Other keywords with (in)direct impact on convergence: QC, VShift, FullLinear.

Comments

« Previous entries Next Page » Next Page »