My uptime hits 60d

Following the irrelevant custom begun with a post two an a half months ago, I’ll share my uptime data with the world again.

Short after my computer hitting 50d uptime (at the time of my previous post), I had to reboot it (I must admit it’s one of the 3 or 4 times in ten years that I had to reboot for technical reasons), so now it is “building up” uptime again. As of the writing of this post:

% uptime
10:55:22 up 61 days, 18:56,  1 user,  load average: 14.22, 14.37, 14.27

I fear I will have to shut it down sometime soon, because I will be moving to a new lab (the DIPC). I don’t know if someone will inherit my old computer and/or if it will be reformatted. Anyway, I’ll post every time a 20d milestone is hit (yes, just because I feel like it. Last time I checked, this was my blog. Got a problem? Sue me).

Now back to work.

Comments (1)

LaTeX: the textpos package

I have recently discovered a marvelous LaTeX package, namely textpos (PDF manual). My problem was that I wanted to place pieces of text arbitrarily in a page. I had tried tabular environments, a liberal use of \vspace and \hspace, the minipage environment, and even the picture environment. None would do.

However textpos is just what I wanted. The package is loaded with the usual:

\usepackage[options]{textpos}

The options I have used are:

  • absolute – the placing is made with respect to the whole page (stuff me if I understand this)
  • showboxes – draws boxes around the text, so you exactly see what you do (for debugging, of course)

Some variables have to (can) be set, namely the width and height units, for example:

\setlength{\TPHorizModule}{\paperwidth}\setlength{\TPVertModule}{\paperheight}

After that, all the placing specifications can be referred to \TPHorizModule and TPVertModule. A typical use of textpos would be:

\begin{textblock}{width}[xt,yt](X,Y)  the-text-goes-here  \end{textblock}

where width is the desired width of the text box (the height will be enough to place all the text specified), X and Y are the (x,y) placement of the text box, and xt and yt are the point inside the text box which will be placed at (X,Y). All the units refer to \TPHorizModule and TPVertModule. For example:

\begin{textblock}{0.6}[0.5,0.5](0.3,0.4)  hello world\end{textblock}

will print the text “hello world” in a box of width 60% of \TPHorizModule (in my example, this is 60% of the total page width). The center (0.5,0.5) of that box will be placed at a point 30% to the right of the left margin, and 40% below the top margin (in TPxxxModule units).

Comments (1)

Remote graphical applications with NX

I have been recently (re)made aware of NoMachine’s NX communication programs by my colleage Txema. NX technology is a way of stablishing a connecting from one computer to another one, and create some sort of tunnel through which displayed info (graphics) is transmitted compressed. The communication, of course, is made through SSH secure connection.




Molden opening a file at Arina, a supercomputation cluster I have connected to from Bart, my computer at work, to which I have stablished a NX connection from Heracles, my computer at home. Screenshot taken from Heracles.
(Clic to enlarge)

Veteran Linux users will say “So what’s the big deal?”. Remote connections via telnet, and later with SSH, have been available a long time ago. Exporting the display (that is, making graphical programs opened in the remote computer appear in the local screen) has always been a simple task, and more recently even SSH tunneling has been made available for that task.

However, the key point here is the compression. When running a NX connection, we open a communication channel, running a custom application in the remote machine (for example, we can open the desktop environment, and work as if we were sitting in front of the remote machine), and all the information is compressed, so that the responsivenes of the remote application is as close as possible to applications run in the local computer.

Even though the core NoMachine’s NX code is free software, the client and the server themselves are not, I think. That is a pity, but free alternatives, such as FreeNX are being built upon the free core. From here I wish the best of successes for that project.

Comments

Peer to peer: the new distribution paradigm

This post will hardly talk about rocket science, but there’s still a lot of ignorance on the subject.

A lot of people associate p2p with “piracy”, and eMule and BitTorrent with some shady way of obtaining the miraculous software of the big companies like Adobe or Microsoft.

Well, the fact is that p2p is a really advantageous way of sharing digital information through the net. Actually, the philosophy behind p2p is applicable to any process in which information, or some other good, is spread. So what is this philosophy? Simply put, p2p opposes a distributed way of obtaining t the goods, with a centralized one (see figure below).



Figure 1: Scheme of operation of p2p network. From Wikipedia.

I use the BitTorrent p2p technology (with the KTorrent program) quite often, particularly to download Creative Commons music from Jamendo. Lately, I have used KTorrent to download some GNU/Linux CDs, particularly the 4.0 version of Debian, and the beta (and this weekend, the stable) version of Ubuntu Feisty Fawn. With the latter, I have come to feel more deeply the advantages of p2p over centralized distribution of files.

With a centralized way of downloading, there is an “official” computer (the server) that has the “original” version of the information to download, and all the people who want to get the info (the clients) have to connect to that server to get it. The result is quite previsible: if a given piece of software is highly sought, a lot of clients will flood the server, and it will not be able to provide all the clients with the info they request, slowing the transmission down, or even stopping it alltogether for further clients, once saturation is reached. This happened with the release of the Windows Vista beta, when the high demand of the program, and the low resources Microsoft devoted to serving the files, provoked a lot of angry users having to wait for unreasonable periods of time until being able to download it.

This problem could well happen with the release of Ubuntu Feisty Fawn, and in fact this morning connecting to the Ubuntu servers was hopeless. However, unlike Microsoft, Canonical decided to make use of the BitTorrent technology to serve the ISO files, and this made all the difference.

With a p2p way of serving the files, the first clients connect to the server to get the files. However, once they have downloaded a part of the files, they too become servers, and further clients can choose whether to download from the central server or from other clients/servers (usually the decision is taken automatically by the p2p program). As the net of clients grows, and the file flow is balanced, the download speed is maximized for all, and the load on the servers is kept within reasonable limits.

The advantages are clear: each person willing to download some files (e.g. the Ubuntu ISOs) does not become a leech, imposing a burden on the server, but rather a seeder, providing others with the files, and speeding up, not slowing down, the spread of the files. It is, thus the ideal way of distributing files.

However, it has two disadvantages that made Microsoft not use it to spread the Windows Vista beta: since there is no single server, controlled by a central authority, it is not possible to assert how many copies of the files have been distributed. Moreover, since the distribution net is scalable, it can not choke, and thus MS would not be able to claim that the demand for their product was so high that the servers were not able to attend it.

So, for promotional purposes, the p2p is not very good. If your priority is the client, and making the files as widely and quickly spread as possible, then p2p is for you.

Comments

My uptime hits 50d

I am bored, working a little bit too much overtime, and I just realized that my work computer’s uptime exceeded 50 days today. Yes, this means that I last rebooted my computer 50 days ago.

I realize that this number is far from impressive, but I can’t help but compare it with the case of our only fellow workmate who uses Windows (XP). He once left his computer on and unattended for a couple of weeks (he went on a trip abroad), and to be fair Windows behaved: it didn’t crash. However, when he is working he religiously turns the computer off every evening, because (he says), “otherwise it eventually slows down to a crawl”. My beloved Debian runs as smoothly as the first day, after being on (and under heavy use) for almost two months.

Comments

Vista vs Mepis

Wanna see how a humble GNU/Linux distro such as Mepis compares to Windows Vista? We are not talking of Ubuntu, Debian, Mandriva or SuSE Enterprise Edition here. No big-fat distros. Just Mepis, a distro that fits in a single CD that can be used to install it, or run it as a LiveCD.

You can read a throughout article at DesktopLinux.com. Enjoy!

Comments

Microsoft and MP3 patents

I read in the Diario Vasco newspaper (online article[es]), that Microsoft has been recently sued by Alcatel-Lucent over some MP3 patent infringement, and found liable for a fine of around 1.100M euro. MS alleges that they did pay the Fraunhofer Society $16M for these very rights.

All this rubbish is typical of Microsoft and their obsolete proprietary model. They are the dinosaurs of the XXI century. MS could include Ogg Vorbis support in their music player(s), and forget about patent issues, since Ogg Vorbis is open and free. However, all the friends I have that use MS Windows complain if I share music in Vorbis format with them, and I am forced to convert it to MP3 (actually MP2 Layer 2, not Layer 3, which is the patented one) if I want them to listen to it.

The choice of MP3 is an unfortunate one, because it traps MS in a legal nightmare of patents and licenses, yet they’d rather face it than switch to something that “stinks” of freedom. One more example of the absurd ways of the Redmond smartasses.

Comments (2)

Bandwidth shaping made easy with Trickle

I have recently downgraded the bandwidth of my internet connection, switching to a flat rate (previously I had a monthly traffic limit, albeit with a wider bandwidth). This means that now I can download to my heart’s content, but it also means that when doing things like upgrading my Debian OS with aptitude, it eats all of my bandwidth, and I can barely do anything else in the Internet, untill all packages are upgraded.

A similar effect can happen when using p2p software like aMule or KTorrent, but these programs have options to throttle down their bandwidth usage (e.g., set maximum download and upload rates).

When dealing with programs that do not have this facility, we can always resort to Trickle, which can set arbitrary limits to any program it is used with. For example:

% trickle -d 20 aptitude upgrade

will run aptitude upgrade as usual, but with a maximum download rate of 20 kB/s. Note: aptitude usually spawns two processes (downloads files in couples, not one by one), and the limit imposed by trickle is applied to each process, so the used download bandwidth will be double that specified in the command line. Or, in other words, if you want aptitude to use X bandwidth, execute:

% trickle -d X/2 aptitude upgrade

Comments (2)

Word processors are easy to use

Frustrating. Very frustrating.

I am teaching my father how to use OpenOffice.org, as a replacement/reinforcement of a MS Word course he took recently.

My present rant comes from the ubiquitous problem of where some feature of a text piece starts/ends, which is not always obvious. More precisely, I’ll refer to itemized/numbered lists and nested lists, like:

* Item 1
  - Subitem 1.1
* Item 2
  - Subitem 2.1
  - Subitem 2.2

After years using LaTeX almost exclusively for document writing, I found it annoying to no end the way in which OpenOffice.org (or any other word processor) handles this kind of things. When I make a list of items, I want the list to be perfectly separated from the surrounding (regular) text, so that I know exactly when I am introducing items in the list, or text before or after the list. I also want to have a logical tree of items and subitems, so I know in every moment at what nesting level I am, and what comes after, or at a lower level than, what.

With LaTeX, this is trivial, as can be seen in the following example:

text before list

\begin{enumerate}

  \item Item 1

  \begin{enumerate}    \item Subitem 2  \end{enumerate}

\end{enumerate}

text after list

I have absolute control about what belongs where. No more fuss about terminating the lists, or about inserting them somewhere, or anything.

On the other hand, word processors provide neither clear separation from the surrounding nor logic for lists. My poor father was struggling to teach the damned program what nest level each entry he wanted it in, how to eliminate the damned dangling “last item”, how to add text after a list, but telling the program that it is already out of the list… a nightmare. Yes, some of his problems were probably trivial, but I am the first to admit that I have come across all of them at least once. And some, I never figured out.

Comments (4)

WiFi with WPA under Ubuntu/Debian

I finally made my new laptop connect with WPA encryption to my WiFi router!!

I could already connect it to WiFi networks with WEP encryption (or no encription at all), but WPA proved harder.

Mini HowTo

1) My setup is the following:

WiFi router: SMC Barricade WBR14-G2
WiFi card in laptop: Intel PRO/Wireles 3945
OS: Ubuntu 6.06 LTS (Dapper Drake)

2) The router settings:

Wireless encryption: WPA/WPA2 Only
Cipher suit: TKIP+AES (WPA/WPA2)
Authentication: Pre-shared Key (yes, I know 802.1X would be more secure… sue me)
Pre-shared key type: Passphrase (8~63 characters)

3) The package one needs to install:

# aptitude install wpasupplicant

4) Making WPA supplicant run:

First, create a config file, by the name /etc/wpa_supplicant.conf, and inside it, write:

ctrl_interface=/var/run/wpa_supplicant
ap_scan=1

network={
  ssid="your_ssid_name"
  scan_ssid=0
  proto=WPA RSN
  key_mgmt=WPA-PSK
  pairwise=TKIP CCMP
  group=TKIP CCMP
  psk="your_preshared_key"
  priority=5
}

At that point, you should make sure that the WiFi is turned on, and that the correct driver is loaded. In my case:

# modprobe ipw3945

Then, to test the WPA supplicant, run:

# wpa_supplicant -Dwext -ieth1 -c /etc/wpa_supplicant.conf

Recall I have used the wext device, instead of the ipw one, that would seem the appropriate one. Well, I read somewhere, that with 2.6.16 kernels and newer, this should be the case. Now I recall that my kernel is 2.6.15… nevermind, it works that way, and not the other (with -Dipw).

Recall also that my wireless device is eth1. Your mileage may vary (but each wireless card model gives rise to a precise device name, don’t worry).

If everything went fine, the output for the above command should be something like:


# wpa_supplicant -Dwext -ieth1 -c /etc/wpa_supplicant.conf
Trying to associate with xx:xx:xx:xx:xx:xx (SSID='xxxxxxxx' freq=0 MHz)
CTRL-EVENT-DISCONNECTED - Disconnect event - remove keys
Authentication with 00:00:00:00:00:00 timed out.
Associated with xx:xx:xx:xx:xx:xx
WPA: Key negotiation completed with xx:xx:xx:xx:xx:xx [PTK=CCMP GTK=TKIP]
CTRL-EVENT-CONNECTED - Connection to xx:xx:xx:xx:xx:xx completed (auth)

If you see that “negotiation completed”, it worked (Ctr-C to exit the above).

5) Automating the WPA connection when bringing wireless interface up

Next, I’ll explain the small changes one has to make to /etc/network/interfaces to correctly bring up the interface. As I said, my wireless interface is eth1, so, I added the lines below to the aforementioned config file:


iface eth1 inet dhcp
wireless-essid my_wireless_essid
pre-up wpa_supplicant -Bw -Dwext -ieth1 -c /etc/wpa_supplicant.conf
post-down killall -q wpa_supplicant

And that’s all! Whenever you ifup eth1, you’ll bring up the wireless interface, with WPA encryption working.

Comments (5)

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