LWD – December

I will start making this section bimonthly, otherwise the only content of my blog will consist on it. Besides, the new information generation rate is not enough to require more often updates.

You can read an intro for my Linux World Domination project in this May 2008 post.

As usual D2D means “days to domination” (the expected time for Windows/Linux shares to cross, counting from the present date), and DD2D means difference (increase/decrease) in D2D, with respect to last report. CLP means “current Linux Percent”, as given by last logged data, and DD means domination day (in YYYY-MM-DD format).

Project D2D DD2D DD CLP Confidence %
Einstein 250.8 -631.3 2009-08-09 37.48 (+2.31) 9.5
MalariaControl 7172.8 +282.8 2028-07-22 12.45 (+0.19) 0.8
POEM 5020.4 +1406.5 2022-08-31 10.05 (+0.26) 1.1
QMC >10k 7.91 (+0.03)
Rosetta >10k 7.99 (+0.08)
SETI >10k 7.88 (+0.02)
Spinhenge >10k 3.35 (+0.14)

As promised, today I’m showing the plots for MalariaControl. In next issue: POEM@home.

Number of hosts percent evolution for MalariaControl (click to enlarge)

Accumulated credit percent evolution for MalariaControl (click to enlarge)

Comments

Donations to Wikipedia

As they do periodically, these greedy bastards benefactors of humanity at [[Wikimedia Foundation]] are rising money to pay for the infrastructure that that a service like Wikipedia offers.

Since I shelled out some euros to them, I see no reason not to encourage the (many) readers of this blog to do the same:

Wikipedia Affiliate Button

Comments (2)

Hibernating my MacBook under Ubuntu Intrepid Ibex

No matter what they say, [[Hibernate (OS feature)|hibernating]] Linux laptops has always been a problem. I managed to get my MacBook to [[sleep mode|suspend]] to RAM quite reliably without much of a hassle. It suspends when I close the lid, and it resumes when I open the lid back. I even configured it to suspend when battery is critically low. This way, and due to the really low power consumption while suspended, I can safely forget my laptop on and unplugged for extended periods of time, and the worst that can happen is that I will have to resume it. A huge difference from the nasty surprise of finding it off and losing all the information not saved to disk.

However hibernating to disk is a whole different business. I never managed it to work, and that was an itch I wanted to scratch. Finally I managed, with the following recipe.

HowTo

First, make sure that you have enough [[paging|swap space]] available in disk. In Linux you generally create a swap [[disk partitioning|partition]] when installing the OS. The old adage states that one should make the swap partition twice as big as the RAM memory of the computer. With modern computers this is both unnecessary (because the big RAM makes sure you’ll never run out of it, and if you do, you are screwed anyway) and wasteful (if you have a 4GB RAM, it means that you dump 8GB of disk space). However, if you intend to hibernate your computer, all the information in the RAM memory has to be copied to the hard disk, so you sure need at least as much swap as RAM (but not twice).

Second, you need to use the correct tool. I use [[Xfce]] as desktop environment under Ubuntu, and the Exit menu presents me with six options: “Switch user”, “Log out”, “Restart”, “Shut down”, “Suspend” and “Hibernate”. I think that the latter two make use of the tools in the acpi-support package. The suspend action seems to work OK, but the hibernate one doesn’t (for me). It runs the command /etc/acpi/hibernate.sh, and it gives me problems. Thankfully I found some utilities that work reliably, namely pm-utils.

The pm-suspend command seems to work as correctly as the “Suspend” button in the Exit menu of Xfce. The pm-hibernate, on the other hand, works perfectly, unlike the “Hibernate” button. The drawback is that only root can run it. My solution is to put a launcher button in the Xfce task bar, that will run “gksudo pm-hibernate”. This way I am asked for my password and, if sudo is correctly set up, pm-hibernate will run.

More info

Sometimes it is very interesting to run some commands at suspension/hibernation moment, or at resuming/thawing. One such command is [[hdparm]], with which you can fix the long known load/unload cycle problem (you can google about it). Another one is one to fix a problem that apparently appears on MacBooks: the [[touchpad]] is lost when the computer wakes up back. The keyboard works, and USB mice work, but the touchpad doesn’t. This problem can be fixed by reloading the appletouch [[Loadable kernel module|kernel module]]:

# modprobe -r appletouch && modprobe appletouch

You can fix both issues above by creating a file named, e.g., 99-macbook_fix, in /etc/pm/sleep.d/, and making it executable. Then write in it the following:

#!/bin/sh

if [ $1 = ‘thaw’ ]; then
# The appletouch module has to be reloaded after hibernating
# (not after suspending, though), because otherwise the touchpad
# remains frozen upon awakening.
modprobe -r appletouch
modprobe appletouch

# Correct the load/unload cycles problem
/sbin/hdparm -B 254 /dev/sda
fi

if [ $i = ‘resume’ ]; then
# Correct the load/unload cycles problem
/sbin/hdparm -B 254 /dev/sda
fi

Comments

First day at IFCA

Hardy a new of interest for the wide audience, but since my audience is not “wide” I will post it anyway: this monday has been my first day of work at the Instituto de Física de Cantabria (Institute of Physics of Cantabria, IFCA).

I will work in the e-Science group there, mainly in the the EGEE III project.

I am eager to find out about my tasks here… I have just landed.

Comments (4)

LWD – October

Hey, October almost passed and I didn’t write the montly report on LWD. I might make it bimontly, to produce less spam in the blog. You can read an intro for my Linux World Domination project in this May 2008 post.

As usual D2D means “days to domination” (the expected time for Windows/Linux shares to cross, counting from Feb 3, 2008), and DD2D means difference (increase/decrease) in D2D, with respect to last report. CLP means “current Linux Percent”, as given by last logged data. The new datum DD means domination day (in YYYY-MM-DD format).

As a new feature, I am now fitting the curves (to predict Windows/Linux crossing) to first degree polynomials, but taking only the last N points so that the [[Coefficient_of_determination#Definitions|coefficient of regression]] is close to 1 (yes, I am being purposely unclear and arbitrary on this subject).

Project D2D DD2D DD CLP Confidence %
Einstein 882.1 +571.9 2011-03-31 35.17 (+0.27) 37.3
MalariaControl 6890.0 +6268.8 2027-09-10 12.26 (+0.06%) 0.3
POEM 3613.9 2018-09-21 9.81 (+0.05%) 0.4
QMC >10k 7.88 (+0.0%)
Rosetta >10k 7.91 (+0.11%)
SETI >10k 7.86 (+0.03)
Spinhenge >10k 3.21 (+0.2%)

OK, the data seems discouraging. The crossing day (DD) seems to be further away every month, instead of closer. Recall however that the only (half) reliable data are the current (and past) percents. All the rest is speculation, and the fits change wildly depending on the function used to make them, and the number of points fit.

Starting with this month’s issue, I might post pictures of the evolution plots. Today I’m showing the plots for Einstein@home. Next month: Malaria@home.

Number of hosts percent evolution for Einstein@home (click to enlarge)

Accumulated credit percent evolution for Einstein@home (click to enlarge)

Comments

ogg2mp3 is out

The music loving community may rejoice, ogg2mp3 is out! OK, OK, that is too much to say, but nonetheless someone could find it useful.

Visit its site at: http://isilanes.org/soft/ogg2mp3

ogg2mp3 is a simple Python script I have made to make the task of converting OGG files to MP3 and the other way around easier. There might be other (better) tools out there for the same task, but I had some need, and this script fulfills it. ogg2mp3 can convert single files, lists of them, or even whole directory contents, and reads the [[ID3]] tags of the input OGG/MP3 files, saving them into the output MP3/OGG.

I basically convert bunches of OGG files to MP3 when I want to put them in portable players that don’t read OGG. I do the opposite when someone passes me an MP3 and I want to add it to my collection, which is in OGG format.

Enjoy!

Comments

Installation of simyo Huawei E220 under Linux

Last friday I wrote about how to install a Huawei E220 modem under MacOSX. Today I will write the corresponding HowTo for Linux.

Usually installation of hardware with non-free drivers is a bit more difficult in Linux than in MacOS and Windows, because the drivers are only made for the latter two. However the E220 is well supported by the Linux kernel (starting at 2.6.20, apparently), so we only need to tweak some configuration files.

1 – Make the system see it properly

The Huawei E220 is a dual machine: apart from being a modem, it is also an USB flash device, with some space to save the Mac/Windows drivers, so that it will “autoinstall” when plugging it under those OSs.

This adds a small level of difficulty, because we have to make sure that the OS sees it as a modem, not as a storage device. In principle the command dmesg (or the file /var/log/messages) will tell us about it. However, I have had it work when dmesg would say that it was a storage device!

The short story is that some [[Kernel (computer science)|kernel modules]] must be loaded, and some others unloaded, when you plug the device. Needed modules: option, usbserial, ppp_async. Must not be present: airprime. In my case usb_storage made no harm, some people say you should unload it. For airprime not to be automatically loaded, put it in some [[Modprobe#Blacklist|blacklist]] file in /etc/modprobe.d/. I decided to add the following line to /etc/modprobe.d/blacklist-modem:

blacklist airprime

You can ensure the required modules are loaded by taking advantage of [[udev]], but it is not really necessary (in my case it wasn’t). udev can also give you a consistent name for the modem. For me the relevant device was always /dev/ttyUSB0, but you can make it /dev/huawei if you will. For that, you can put the following optional rules in a file in /etc/udev/rules.d/ (for example create 55-huawei.rules):

BUS==”usb”, SYSFS{idProduct}==”1003″, SYSFS{idVendor}==”12d1″, NAME=”huawei”
BUS==”usb”, SYSFS{idProduct}==”1003″, SYSFS{idVendor}==”12d1″, RUN+=”/sbin/modprobe option”
BUS==”usb”, SYSFS{idProduct}==”1003″, SYSFS{idVendor}==”12d1″, RUN+=”/sbin/modprobe ppp_async”

Two notes: the strings in idProduct and idVendor are obtained running the command lsusb when the modem is plugged. It will show something like:

Bus 003 Device 005: ID 12d1:1003 Huawei Technologies Co., Ltd. E220 HSDPA Modem

This is a very neat trick for any USB device we want to manage with udev. The second note is that [[kppp]] (see later) only allows to choose a modem device from a list. If you make the modem be /dev/huawei, you will not be able to use kppp, since that device won’t appear in the list.

2 – Configure wvdial / kppp

You can make use of programs such as [[wvdial]] or [[kppp]] to make the actual connection. I use kppp myself, but that’s up to you (wvdial is apparently more flexible).

wvdial

To use it you have to create a /etc/wvdial.conf file. You can achieve this by running wvdialconf as root, or editing the file by hand, if you are brave.

For me, the output of wvdialconf yielded:

Editing `/etc/wvdial.conf’.

Scanning your serial ports for a modem.

Modem Port Scan<*1>: S0 S1 S2 S3
WvModem<*1>: Cannot get information for serial port.
ttyUSB0<*1>: ATQ0 V1 E1 — OK
ttyUSB0<*1>: ATQ0 V1 E1 Z — OK
ttyUSB0<*1>: ATQ0 V1 E1 S0=0 — OK
ttyUSB0<*1>: ATQ0 V1 E1 S0=0 &C1 — OK
ttyUSB0<*1>: ATQ0 V1 E1 S0=0 &C1 &D2 — OK
ttyUSB0<*1>: ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0 — OK
ttyUSB0<*1>: Modem Identifier: ATI — Manufacturer: huawei
ttyUSB0<*1>: Speed 9600: AT — OK
ttyUSB0<*1>: Max speed is 9600; that should be safe.
ttyUSB0<*1>: ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0 — OK
WvModem<*1>: Cannot get information for serial port.
ttyUSB1<*1>: ATQ0 V1 E1 — OK
ttyUSB1<*1>: ATQ0 V1 E1 Z — OK
ttyUSB1<*1>: ATQ0 V1 E1 S0=0 — OK
ttyUSB1<*1>: ATQ0 V1 E1 S0=0 &C1 — OK
ttyUSB1<*1>: ATQ0 V1 E1 S0=0 &C1 &D2 — OK
ttyUSB1<*1>: ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0 — OK
ttyUSB1<*1>: Modem Identifier: ATI — Manufacturer: huawei
ttyUSB1<*1>: Speed 9600: AT — OK
ttyUSB1<*1>: Max speed is 9600; that should be safe.
ttyUSB1<*1>: ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0 — OK

Found a modem on /dev/ttyUSB0.
Modem configuration written to /etc/wvdial.conf.
ttyUSB0: Speed 9600; init “ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0”
ttyUSB1: Speed 9600; init “ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0”

And my current /etc/wvdial.conf looks as follows:

[Dialer Defaults]
;Init1 = ATZ
Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
Modem Type = Analog Modem
ISDN = 0
New PPPD = yes
Modem = /dev/ttyUSB1
Baud = 9600

[Dialer simyo]
Dial Command = ATDT
Phone = *99#
Init2 = ATZ
Init4 = ATE0V1&D2&C1S0=0+IFC=2,2
Init3 = AT+CGDCONT=1,”IP”,”gprs-service.com“;
Stupid Mode = 1
Modem Type = Analog Modem
ISDN = 0
Modem = /dev/ttyUSB0
Username = whatever
Password = whatever
Baud = whatever

In bold, the relevant user-provided settings. In italics, some items in which you can put whatever, because it doesn’t seem to make a difference.

To connect, run wvdial simyo (or whatever you put in the “[Dialer xxx]” setting above), in the command line. To terminate, Ctrl+C.

kppp

This is the one I use. To open the config/run dialog, run kppp (you can do this as user). There you will have to configure two things: the account and the modem. By pressing “Configure” you will be presented with a window with four tabs. In the first one you will create a new account, in which the relevant data is:

  • Phone number: *99#
  • Authentication: PAP/CHAP
  • Callback type: none

In the second tab you will configure the modem:

  • Modem device: /dev/ttyUSB0
  • Flow control: Hardware
  • Line termination: CR/LF
  • Connection speed: 921600

Please note that those are parameters that work for me. I can not assure that they are the “correct” ones. I have player around with different values, and many times the modem would work all the same with different settings. If you find some error in my setup, please tell me :^)

Comments (3)

Usable Compiz Fusion: zoom to window

It is common to hear that recent advances in the Linux desktop, such as [[Compiz Fusion]], are more of a fancy but useless aesthetic contribution to the desktop. While it may be true for many of the CF features, it is no less true that you never know when a given effect will turn out to be useful.

In this post I want to praise the Enhanced Zoom Desktop plugin. It turned out to be of great use for me in the following situation. I wanted to run [[Diablo II]] in my laptop (yes, it runs in Linux, under Wine). The native resolution of the program (640×480 or 800×600) is lower than that of my screen (1280×800), so I have two options: to execute it in windowed mode, or fullscreen. In windowed mode the window occupies less than 2/3 of the 13.3″ screen, wasting space and making it unnecessarily small. Fullscreen mode seems to be better, but it isn’t. Since the width/height ratio is smaller for Diablo than for the screen, the former will be stretched horizontally, distorting the images (everything looks more squat). Fullscreen mode also gave me other problems, like crashing more easily when alt-tabbing.

Here is where the zooming of Compiz Fusion comes in handy. Apart from an arbitrary zoom (using the mouse wheel while pressing the Super key, a.k.a. windows key), there is a handy shortcut (Super+r) that zooms up to the point of the screen under the cursor occupying the whole screen. When zooming, the movement of the mouse makes the zooming “window” to move around, showing different parts of the desktop. To avoid it (clearly unwanted if we want to stay inside the Diablo window), we have another shortcut: Super+l. This shortcut toggles on and off the “zooming lens follows the mouse” movement.

So now, if I want to play Diablo I open it in windowed mode, then put the cursor inside the window, then hit Super+r, then Super+l, and I have a Diablo window as big as possible to fit in my screen, preserving height/width ratio, and keeping the mouse inside the window.

Comments

Disabling autoscale in a Xmgrace agr file

I am a heavy user of the [[Grace (plotting tool)|Xmgrace]] plotting program, and I love it. An operation very ofter used is to scale the X and Y axes to our liking, to show different parts of our data in the resulting plot. You can do that from the command line by setting the “world” of the graph, providing four numbers as X,Y boundaries:

% xmgrace -world xmin ymin xmax ymax file.dat

Apart from setting the maximum and minimum values for X and Y, we can make use of the autoscale option to selectively show some ranges. The four options to autoscale are:

  • none – show the X,Y ranges defined by the “world” variable (if not set, the default is “0 0 1 1”).
  • xy – forget about “world” data, make plot range in X and Y enough to plot all data in input.
  • x – autoscale X to show all data, but respect Y given by “world”. This means that if a point is not shown because it lies outside the Y range, then it doesn’t count to force X autoscale. This is a wee bit trickier than it sounds.
  • y – see previous point, with X and Y swapped.

But Xmgrace is not only about [[command-line interface|command line]], or even [[Graphical user interface|GUI]]. You can write a .agr file (for example by saving a plot from the Xmgrace GUI), and manipulate it so that the following command:

% xmgrace file.agr

will bring up a plot with all the data and formatting we have put into the .agr file. It’s really handy to save a file as-is.

Now, the syntax for inputting the world in the .agr is well known:

@ world xmin, ymin, xmax, ymax

where xmin etc. are floating point numbers.

The problem is how to hardcode the autoscale feature into the .agr. I had always been forced to do:

% xmgrace -autoscale none file.agr

from the command line, because I couldn’t find out how to include it in the .agr. Finally I did find it, and that’s the main reason of this post. The syntax is explained in the manual at the Xmrace site, but I found it after googling for agr files containing “autoscale” in them. The line to include seems to be:

@ autoscale onread none

A .agr containing the above line will produce, when called as follows:

% xmgrace file.agr

the same output as a file not containing it, when called as follows:

% xmgrace -autoscale none file.agr

Comments (3)

Comment on a Fox forum comment on Obama

Silly title for the post, I know. Bear with me.

Through the “random hot post” feature in WordPress, I read Fox forum post criticizing Barak Obama (I would’t expect that in a Fox forum!). In short, it says that the claim that women are worse paid than men for the same job is a myth. For a longer explanation, read the whole article

The thing is that I tried to comment there, but I couldn’t (when hitting “Submit comment” a [[HTTP 404|404 error]] appears). Bad page coding or anti-leftist filter? I don’t know, but I’m writing down my opinion here. Because I can :^)

I didn’t expect such right-wing ideas in a Fox forum [/irony]

I partly agree with the reasoning of the post, fair is fair. But the writer absolutely fails to stick to the logic he proclaims. There are two issues, that he correctly differentiates:

A) Whether men and women have different salaries “on average”

B) Whether men and women have different salaries “for the same job”

The writer seems to accept that while it is true that men earn more in A, in the more “fair” comparison B, the salaries are equal. I am not going to comment on B, because I have no data. For the sake of argumentation, I will assume that it is true that in the B comparison salaries are equal.

Now the writer tries to convince us that the comparison in A is unfavorable to women because:

a) women tend to not choose jobs with higher salaries.
b) women can not sacrifice themselves to their job, because they have to be good mothers

Let me disagree. The fact that, on average, men have better jobs does not imply that women do not choose them. Actually, it is more probable that what it means is that those on charge (men) do not choose women for those jobs. This is discrimination.

And about the point b, it is hard to make it enter some people’s skulls, but women should be “good mothers” as men should be “good fathers”. A home/family is a hard work for BOTH parents, and there is no sacrifice a man could do for his job that a woman should not be allowed to do. Maybe men are more willing to make sacrifices to their job (condemning their partners to stay home in the process), and maybe men are more allowed to do those sacrifices. This is discrimination.

Comments

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