Finding Your Way Home

14/12/2010

Like many of us, you may need to host stuff on your home computers and access it via the Internet. If you paid for a static address from your provider, you can map a domain name to it via your ISP’s DNS. But for the majority of us, getting a static address from our provider means paying a good deal more for little to nothing more. For example, my provider (which by the way offers excellent service) is so stable that my IP address changes once a year, or even less often. But for others, the IP address changes more often and it’s difficult to keep track of it.

Some services, like DynDNS, provide you with a script and a couple of tools to access your stuff via a virtual domain name (or something like that). The magic behind DynDNS maps your domain name to your ever-changing provider-specific IP address. But what if you just want to find your way home, without a domain name and without having to deal with an extra service provider?

Read the rest of this entry »


Scripting with Postfix/mail

16/11/2010

Sometimes you’re automating tasks that requires you to be informed of changes at the moment they’re occurring (or at least, not too long after). Turns out if you’re planning only to send mail, it takes abouts 3 minutes to setup postfix and send your first automate mail message!

First, you have to install postfix and mailutils, two packages that are fortunately already (likely) installed and readily available from the default repository. In a shell, type:

Read the rest of this entry »


Patching the Environment for ‘exotic’ Libraries

26/10/2010

Every time I add a development library (or any other application) that is not found in my distro‘s repositories, I ask myself how troublesome it will be. If you’re really lucky, it comes in a package (and repository) compatible with the target distribution (like a Debian package or a RPM) and everything is just fine: you install it from the package manager, and that’s it. But if not, you have to download a tarball from some (more or less trusted) location like Sourceforge. It usually comes with a rather well designed set of configure, make, and (sudo) make install scripts that reduces configuration to little more than launching the configuration script, check for any unmet dependencies, add them and rerun the configuration script until they are all met, and then make install performs a smart, standard location install and you’re done. You won’t have the automagical upgrades with everything else, but you can go on with your life.

Then again sometimes you have to install a library (or application) that either has a half-baked installation script, or is incompatible with your distro, or, cerise sur le gâteau, both. And, just to aggravate you just fine, it installs to a non-standard location requiring you to specify include and library paths in your make files or just to invoke the application. And, of course, default location will change from from /usr/local/shared/thislib/ to /usr/shared/include/thislib between version 2.1.5 and 2.1.6, just to make sure to break just about everything you set up.

Read the rest of this entry »


Damn you, Saint-Exupéry!

14/09/2010

The Ubuntu Linux distribution is putting a lot of efforts into streamlining the interface and provide a greater user experience. While there’s clear progress, there are a number of things that are still really missing. The guys at Gnome and at Ubuntu are maybe taking the motto perfection is not when there’s nothing else to add, but nothing else to remove a bit too seriously. Every release shows more and more features but less and less user configurability.

Well, to be honest, I have always found my way around those limitations by hacking directly configuration files, the gconf-editor registry-like thingie, and writting scripts to set automatically configurations for which there were no other way—or just not documented, which is the same as far as I am concerned.

Amongst the extra thingies, there are many keyboard shortcuts, but not all of them are configurable. For example, if there’s a way from Gnome to configure which keys you want to use to control LCD or keyboard brightness or to display power information, it’s pretty damn well hidden. On my Dell mini, there’s a nice key with a battery icon on it. If I press it, Gnome displays in the OSD a concise battery status. But on my macbook pro, there’s’nt such a key and I have no way of telling Gnome (from Gnome itself) to use the F4/Gauge key to act as the Show Battery key.

Read the rest of this entry »


Dog Days

07/09/2010

Last week (at the time of writing), we were hit by a bad heat wave and, while none of my computers crashed or caught fire, it was clear that they were operating well outside their usual comfort zone. The first thing to do is of course to use well designed cases that provide adequate cooling (not like the compaq 6400NX). The second is to use all the advanced power management features available—whether it’s SpeedStep, Cool’n’Quiet, or PowerNow!. You enable it from your computer’s BIOS and usually the operating system takes over when you boot.

Changing dynamically the CPU’s (and other devices?) speed (and therefore power consumption) to respond on demand to the user or system tasks is quite a good policy for desktops and servers (that’s why it defaults to “ondemand” on Ubuntu) but it may not be what you want for your laptop or netbook. For a netbook, setting the power policies to “powersave” will keep the CPUs into low gear and extend significantly battery life. The thing is, Ubuntu doesn’t let you set the default policy easily.

Read the rest of this entry »


Getting Clip-Art

20/07/2010

Interoperability of software is still a major issue. Not only closed systems do not play well with others, open systems sometimes—often—have the same problems with exchanging information. One that only plays well with others when forced to is, of course, our good friend Microsoft. Sometimes they pretend to play well, and other software developers must reverse-engineer the file formats to read and write data in a compatible format.

One minor annoyance is Microsoft Office’s clip-art bundle file format that is not supported (at the time of writing, anyway) by Open Office. This means that you can download clip-art for your presentation only to discover that they are perfectly useless. Or, you can take 10 minutes and look at what the bundles actually contains!

Read the rest of this entry »


Getting Documents Back From JPEG Scans

06/07/2010

We’re all looking for documentation, books, and papers. Sometimes we’re lucky, we find the pristine PDF, rendered fresh from a text processor or maybe LaTeX. Sometimes we’re not so lucky, the only thing we can find is a collection of JPEG images with high compression ratios.

Scans of text are not always easy to clean up, even when they’re well done to begin with, they may be compressed with JPEG using a (too) high compression ratio, leading to conspicuous artifacts. These artifacts must be cleaned-up before printing or binding together in a PDF.

Read the rest of this entry »


#defines are EVIL (part II)

29/06/2010

In a previous post I discussed some aspects of the C preprocessor (hereafter the CPP) that are evil. Turns out that this week, I had another problem related to a bad usage of the CPP. It didn’t take long to fix, but I can understand why it could be long to figure out.

And while the bug was caused by a careless use of the CPP, I think there’s a couple of simple things we can do to help avoid these.

Read the rest of this entry »


Is Python Slow? (Part II)

08/06/2010

In a previous post I expressed my worries about Python being excruciatingly slow and I used a toy problem to compare the speed of Python to programs in other several languages, including C.

Of course, all kind of people complained that I couldn’t compare a dynamic, interpreted language with static, compiled languages. First, let met tell you that I sure can. First, the goal was to measure speed, and not the effects of type system of the language (although logically correlated) nor the programming paradigm: the amount of CPU used to solve a given problem was the primary (if not only) point in interest.

But to be fair to Python, I extended the tests to other interpreted, dynamic languages, such as Lua, Perl, PHP and JavaScript. I also added Pascal and Haskell in the compiled languages groups.

Read the rest of this entry »


The Platypus

14/04/2010

This afternoon, on #bash on Freenode:

[19:08:56]  < DrMax > well, yes, with the trailing -print, it works as expected
[19:09:20] * nDuff mutters about people who don't follow his examples exactly, and then complain when they don't work. :P
[19:09:37]  < DrMax > lol yes, sorry, my bad
[19:09:58]  < DrMax > won't do it again, promise
[19:11:55]  < DrMax > find is the platypus of the *nix ecosystems. It has a beak, claws, venom. It swims, lay eggs, is ugly, but somehow manages to survive
[19:12:13]  < DrMax > I hate this command
[19:12:39]  < DrMax > nDuff : nevertheless, the help is greatly appreciated
[19:13:48] < nDuff > eh; find is like *nix in general -- a little picky about who its friends are. Once you get to know it though, it's the kind of friend that helps you move bodies.
[19:14:16]  < DrMax > hmm interesting, but I don't have to move bodies very often
[19:14:21]  < DrMax > I'd rather have regular friends

We’re discussing find, the command I hate the most in all *nix-like commands. Needless to say, the guys and gals on #bash are always extremely helpful and got me on my way.