Xgl with Xfce under Debian Etch

See http://www5.autistici.org/debian-xgl/x86-xgl-pkg/README

d/l .debs from http://www5.autistici.org/debian-xgl/debian/binary-i386/

see http://www5.autistici.org/debian-xgl/

add “/usr/share/fonts/X11/misc/” to the Xgl command in http://gentoo-wiki.com/HOWTO_XGL#Running_Xgl, otherwise it gives “could not open default font ‘fixed'”

Comments

GParted and my laptop

OK, yesterday I bought a laptop (my first ever), and I am so excited about it! It’s specs:

Fujitsu-Siemes Amilo PI1536
CPU: Intel Core 2 Duo T7200 2×2.0GHz
RAM: 2x1Gb
HD: 120Gb SATA
Display: 15.4 WXGA
Graphics: ATI Mobility Radeon X1400 (128Mb dedicated/512Mb shared)

I chose it for its high quality CPU, and half-decent graphics card. It turns out most sellers have a large Core Duo stock, but a pitifully short list of Core 2 Duo models. Hence, they want to sell their already outdated Core models, and offer little choice in Core 2s (and a bit higher prices, although Intel sells them both at similar prices). The little choice in Core 2 Duos made it difficult to me to find what I was looking for, but I finally did.

However, this post is not only dedicated to spread my happiness. I also wanted to praise the Free Software program GParted, which I just used.

As any laptop+Linux user has experienced, usually Windows is pre-installed and shipped with the computer. In my case, I wanted to have it, so no problem with that. The bad part is that, of course, the whole hard disk is usually a single partition, with Windows being in it. Since I wanted to install Linux also, I had to make partitions. Although the laptop came with CDs for all the software that comes pre-installed (Windows included), I wanted to try to resize the Windows partition, and make room for the other partitions, without destroying the Windows installation.

I downloaded an Ubuntu ISO, burned it, then restarted the laptop with it. Good thing of Ubuntu is that its CD is a Live CD, which means that can be run without installing anything in the hard disk. Ubuntu started flawlessly, and I was presented with a GNOME desktop. There, I started GParted, and a simple, yet visually pleasing, GUI opened, and I point-and-clicked all the settings, which took me from:

1x 111Gb partition under NTFS

to:

1x 15Gb (NTFS)
1x 512Mb (swap) probably wasted disk, but oh well…
3x 10Gb (ReiserFS)
1x 50Gb (ReiserFS)
1x 18Gb (NTFS)

This way, the second NTFS partition can be used to store files Windows can access (I have to try if Linux can access that. If not, I’ll reformat with FAT32), and I still have room for three Linux distro installs (10 Gb Reiserfs), and a big home/ that all Linux-es can share.

Now, the delicate part… rebooting into Windows. I held my breath while the computer rebooted, but it did so fine. Windows started without problem, it just performed a disk integrity check at startup (which finished OK), and then said it had found new hardware, which turned out to be the second NTFS partition (the E: drive now). As we are used to with the stupid Windows, I was told to reboot to have the system recognize the recently-discovered hardware. So I did, and it worked!

Now Windows is installed in the 15Gb NTFS partition (and recall I didn’t reinstall anything. What was there, is still there), and sees a second 18Gb partition. As for Linux, I am looking forward to installing Debian, Ubuntu or something…

Comments (3)

Separados

Ayer vi Separados(FilmAffinity|IMDb) en el cine.

Aunque pudo haber sido mejor, la verdad es que me gustó. Está llena de clichès, pero están bien usados, y ¿no son todas las relaciones sentimentales repeticiones de los mismos clichès? Nos gusta pensar que nuestra relación es única, pero en el fondo lo mismo les ha pasado ya a millones de parejas, y ha sido retratado en cientos de películas.

Quizá decir que esta película hace reflexionar es pasarse, pero ciertamente no es tan ligera como aparenta. Me sentí reconfortado al verla, porque en vez de identificarme con Vince Vaughn, era la postura de Jennifer Aniston la que me resultaba comprensible. ¡Menudo figura el Vince este!

Aviso: lo que sigue contiene detalles de la trama

Lo insoportable de Vince no es que sea vago, o no ayude en casa. Lo que colma el vaso de la paciencia de Jennifer es que no le importan sus prioridades. Jennifer le encarga que compre 12 limones para decorar la mesa en una cena familiar (mientras ella hace todo el resto), y él trae solo 3. El problema no es el error en sí, sino que, una vez aclarado dicho error, él no es capaz de volver a bajar a por otros 9 limones… simplemente porque en el fondo no da ningún valor a la necesidad que vea Jennifer por tener 3, 12 o 200 limones. No es capaz de decirse: “comprar tantos limones para decorar la mesa me parece una chorrada, pero si a ella le parece importante, para mí es importante”. No, él se queda en “me parece una chorrada”, y ya está. Y lo mismo con acompañarla al ballet, cosa que nunca hace, porque no le gusta, mientras que ella va a todos los partidos de baseball que él quiere.

Sí, todo esto son tópicos… pero me gusta el planteamiento y la ejecución. Y también me gusta que al final se separen (he avisado que daba detalles de la peli). Me habría defraudado mucho que tras plantear una situación amarga para ambos miembros de la pareja (el separarse), Hollywood le hubiera dado el toque “todo acaba de color de rosa” marca de la casa. La peli no podía “acabar bien”, y no acaba bien.

Comments

Do one thing, do it well. Part II

This post is the continuation of a previous one. In that first part I mentioned the “bells and whistles” of most Windows programs being even counterproductive, and getting in the way of the user. Here I will elaborate on that.

Most GNU and Free Software applications for GNU/Linux and other Unix-like systems have the possibility of being called from the command line, appart from any GUI they may have.

One would think that no-one in his right mind would use an ugly CLI, where a visual point-and-click GUI exists. However, CLIs give a substantial flexibility, and I will illustrate this with an example.

Suppose you want your computer to remind you of the upcoming birthdays of your friends. Suppose you use Windows. Then, you have to find a program like Birthday Reminder Plus 2006, or whatever, which does it. Maybe you want to be reminded by e-mail… but you will have to make do with what the options in the BRP2006 GUI give you. If BRP2006 has a menu with: “Remind with a beep” and “Remind with a pop-up”, you will have to choose one, and that’s it. Windows programs don’t expect you to think or develop. They expect you to use Google, eMule and so on to download a pirated copy of a monolithic program that fits your needs. If BRP2006 has not an option for reminding you via e-mail, then you have to drop it alltogether, and keep searching for Birthday MegaReminder for PowerUsers 2007, which has such an option.

With GNU/Linux, maybe there is such a program, and you are free to use it. However, there are far better solutions, which you can tailor to your needs. The following is what I actually do to be reminded of birthdays:

First, I need a kind of “database” of birthdays, and a program that, reading this database, can extract the upcoming ones (the ones for which a given amount of days or less, are left). There are probably many of them, but I use one called simply Birthday. I haven’t found the Home Page of this program (to give it here), but I use the Debian package, mantained by Alexander Neumann. The “database” consists in a file called .birthdays that we have to place in our home/ directory. This file will contain lines like:

Bill Gates=30/09/666

Then, when called from the command line, it will output:

Bart[~]: birthday
Bill Gates is 1340 years old in 4 days' time.

If no option is given, birthdays in the following 21 days will be printed out. If you want to see birthdays in the following X days, just issue birthday -W X.

Second, this output is ugly. For example, the use of “is” is wrong, and “days’ time” could be shortened to “days”. To do so, we can pipe it through sed (another GNU utility):

Bart[~]: birthday | sed -e "s/ is / will be /;s/'.*//g"
Bill Gates will be 1340 years old in 4 days

Thus, sed substitutes ‘ is ‘ with ‘ will be ‘, and a literal ‘ and anything behind it ('.*) with nothing (effectively deleting it).

Third, we have to send this “Bill Gates will be…” to our e-mail address. For that, we will use the mail GNU command, like this:

Bart[~/]: birthday | sed -e "s/ is / will be /;s/'.*//g" | mail -s '[BIRTHDAY]' myaddress@myisp.org

This will send an e-mail to myaddress@myisp.org, with the subject [BIRTHDAY], and the body being the Bill Gates will be 1340 years old in 4 days text above.

Fourth, we need to automate this. For that, we can make a little Perl script:

#!/usr/bin/perl -w

#
# This scripts e-mails me to remind me of
# upcoming birthdays. It needs the ‘birthday’
# package.
#

use strict;

# Test if birthday package is installed:
die “No birthday package!\n” if (`which birthday` =~ /not found/);

# Read the list of upcoming birthdays, formated with sed:
my @bulk = `birthday | sed -e “s/ is / will be /;s/’.*//g”`;

# The e-mail address:
my $u = ‘a@b.c’;

# Send e-mail, if there is any upcoming birthday:
system “echo ‘ @bulk’ | mail -s ‘[BIRTHDAY]’ $u” if @bulk;

Next, we have to set this script to run periodically. We can do it with the GNU cron utility. This is a daemon, constantly running in the background (if its service has been activated), wasting negligible resources, and executing the task the users schedule, via the crontab command, or even a GUI like Kcron.

So, I use kcron to schedule the Perl script above to run everyday, at 7:01 am, et voilà! I receive an e-mail from my system every morning, reminding me of the upcoming birthdays.

Uf, all THAT has to be done?

OK, it sounds like a lot of work, for something our Birthday MegaReminder 2007 could do with half a dozen clicks.

Now, consider. The procedure outlined here is fully modular. Any time you want to modify something, you can act on the relevant step: e.g.: if you want to add a birth date to your list, you can just add it editing the ~/.birthday file. If you want to be reminded just once a week, the crontab should be modified. If you want to be reminded 73 days in advance, just add -W 73 to the birthday command in the Perl script. If you want the reminder to be sent to a list of e-mails, instead of only to yourself, you can modify the script accordingly.

The good part is that now you have learned how to use different tools, for different tasks: You have used cron here, but you can use elsewere to schedule ANY job. You have used mail here, but you can use it elsewere to send any text by e-mail, including the contents of a file, the output of a command, or a fixed text.

Maybe the Birthday MegaReminder has scheduling capabilities (like cron), running in the background and activating itself when appropriate. That’s fine but… can its scheduling capabilities be used for other programs? Sorry, no. If you want a periodic scheduler for program X, you have to buy, or pirate, a copy of a program which not only makes X, but also has scheduling capabilities. Maybe Birthday MegaReminder has e-mailing capabilities (like mail), but… can they be used to e-mail other things? Sorry, no.

With the GNU tools (like cron, sed and mail), when I want a program to connect to the Web, retrieve my horoscope, and send a copy to my e-mail, I don’t need a program that is good at sending e-mails or scheduling actions. I need a program that is good at retrieving horoscopes from the Internet. Then, I have tools to e-mail me with the output of such a program, and/or schedule its execution periodically.

Comments

Do one thing, do it well. Part I

If one reviews the Unix philosophy, it is readily seen a huge different from Windows-land. With Windows, every single task has huge programs, with a colorful graphical interface, menues galore, icons, flashing lights and all functionality incorporated into point-and-click buttons, scrolling bars etc.

All this is advocated in the name of “user friendliness”, that is, making it easy for the user. However, there are two major drawbacks I can see (there can be others). First, in a technical aspect, each and every program is a mammoth. Second, the flexibility and usefulness of these programs actually gets degraded with this policy. I’ll address the first question in this post, the second one in another one.

The “mammoth-ness” of proprietary programs happens because, since they forbid sharing code and information among their developers, they tend (have) to be mostly self-contained. This is highly counterproductive, because instead of sharing resources, they have to be replicated.

Think of the following (silly) example: I have programs A, B and C, all of which can produce red circles. Since their source code is closed, each one of them has to implement a piece of code (library) to make “red circles”. Each time one of the three programs is installed, it carries its own redcircles library, with its bugs and problems (and hard disk and memory resource waste). See Figure 1.

bad

Figure 1: Each program has incorporated a redcircles module.

If these programs were Free, they could all share a common redcircles package, which could be developed by other people. See Figure 2. This would let the developer of each program concentrate on the particular things their program does. And also disk space would not be wasted installing that library for each new program that uses it. A new A, B or C instalation would only need the installer to know that the extra package redcircles has to be also installed (a “required” package), if it already isn’t.

good

Figure 2: All programs share an external redcircles library.

The development of the redcircles package would also be much more efficient, because developing and debugging a single package would be much easier than doing so for each program that uses it.

Comments (1)

Buy yourself a presidency

I have read at Enrique Dan’s blog[es], that some researchers at Princeton University have found serious vulnerabilities in the Diebold voting machines (the ones used, for example, in the reelection of G.W. Bush). You can read about these vulnerabilities here.

Do you trust this shit? Do you think the presidential crew didn’t know about the flaws of the system? Do you think they would not take advantage of said flaws? Do you think they didn’t have the chance to? Think twice.

Comments

Blackout summary IV

Today the power supply has failed again, suposedly due to an storm.

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)

Summary: 9 blackouts in 274 days, or 30.4 dpb (days per blackout). 72 days since last blackout. Average dpb went up by 4.9. However, these data might be lacking, for I haven’t recorded the blackouts in August (I was on holiday for three weeks).

First post in the series: here

Comments

Edison Force

My weekly movie yesterday consisted in Edison Force (Ciudad sin ley[es]).

Despite the horrible critics it has had, I have to say that I liked it. Well, yes, it offers little more than clichès, and the plot is a little unbelievable at moments… but it is entertaining.

Not the world’s best movie, but worth watching (if there’s nothing better in the theater).

Comments

LaTeX: PowerDot

Tired of hearing that GNU/Linux is good for “technical things”, but not for visually appealing matters, such as presentations? Tired of hearing that LaTeX is good for 200-page books full of cross-references, tables and bibliograpy, but not for “other” documents?

Well, next time you can point your ignorant fellow to some LaTeX solutions for making fancy presentations.

You can find some overviews here:

Among the different programs and methods, I’d like to mention the Seminar and Prosper packages for LaTeX. Prosper was written by Timothy van Zandt, and is available as a package for Debian. However, the Prosper package had its capabilities extended by Hendri Adriaens, to create the HA-prosper LaTeX package. Later on, HA-prosper was dropped, and Adriaens and Christopher Ellison commited themselves to the development of PowerDot, a LaTeX class that would supercede both Prosper and HA-Prosper. The PowerDot class (and many others) can be found in the Debian package texlive-latex-recommended.

What Prosper, HA-Prosper and PowerDot do is (since you are using LaTeX) create a DVI, PS or PDF. Usually, your aim will be to create a PDF, since it even allows for fancy slide transitions (an infamous hability of you know who).

Examples of PowerDot presentations (taken from Adriaens’ site), can be accessed here: Example 1, Example 2, Example 3.

Actually, I am considering to use PowerDot to make the presentation of my PhD defense… I hope I don’t give up and end up using the GUI (and, thus, evil) programs KPresenter or (God forbid) OpenOffice.org.

Comments

LaTeX: footnotes in tables

Although an apparently widely known LaTeX issue, I came across it just today. Fact is if you use \footnote inside a \tabular environment, the footnote will be “trapped” inside the table, and actually never get displayed at all in the output.

You can find some possible solutions for that at the UK TeX FAQ on the Web.

The trick I’ll comment here is to use \tabularx, which is covered in the link above, and also at J.L. Diaz’s LaTeX blog[es].

The “problem” is that \tabularx requires a fixed table width value to be input by the user, so the following will fail misserably:

\usepackage{tabularx} % required in the preamble
\begin{tabularx}{100mm}{|c|c|} \hline
A & B \\ \hline
C & D \\ \hline
\end{tabularx}

Why? Because the {c} especification (to center the text inside the cell) makes the affected column as wide as necessary, not more (so will {r} or {l}). The output can be seen below:

The effect of the whole table being actually wider than the sum of the integrating colums could be partially “concealed” if the \hlines were eliminated, but the table would still be actually incorrectly wide, which would make things like aligning the whole table “fail” (to the eye).

Fortunately, the tabularx package provides a way to tell LaTeX that a column must be of the necessary width, so that the sum of colum widths equals the total column width. This is the {X} keyword (notice the capitalization of the “X”). E.g.:

\begin{tabularx}{100mm}{|c|X|} \hline
A & B \\ \hline
C & D \\ \hline
\end{tabularx}

This makes the first column just as wide as needed, not more (the {c}), and then, the second column will be as wide as needed to reach the 100mm. The output:

If multiple columns are given the {X} keyword, they will all have the same width, precisely the one required to meet the total table width.

Comments (3)

« Previous Page« Previous entries « Previous Page · Next Page » Next entries »Next Page »