linux

Running 32 bit executables on a 64 bit machine (Ubuntu Linux)

1 July, 2010 - 11:55
Categories:

I recently had this strange problem with running a 32 bit executable on a 64 bit machine. It executed just fine on 32 bit machines and some other 64 bit machine. But on this particular machine I got the strange error message:

bash: some32bitexecutable: No such file or directory

which is confusing because bash seems to complain that it does not find the executable, while I knew it was there. Using absolute paths and double checking the permissions didn't help.

The problem was however that the 32 bit runtime libraries were not available.

The fix on Ubuntu is to install the ia32-libs package, described as:

ia32 shared libraries for use on amd64 and ia64 systems.
This package contains runtime libraries for the ia32/i386 architecture, configured for use on an amd64 or ia64 Debian system running a 64-bit kernel.

(FYI: it will pull down some other packages too, like lib32gcc1, libc6-i386 and lib32stdc++6.)

Read more...

Gearman (job queue manager) command line tool: routing the workload to the worker process arguments with xargs

27 April, 2010 - 14:55

Abstract

Gearman provides a basic command line tool that helps to distribute work from clients to worker processes/machines. By default the worker process can only receive data from its standard input. With the xargs tool we can circumvent this and route data to the process arguments of the worker process.

Read more...

PDF to PostScript conversion: pdf2ps versus pdftops

5 February, 2010 - 12:16

Occasionally, I have to convert a PDF file to Postscript (e.g. for subsequent processing with some PostScript utility). In the Linux/command line area, I know two options: pdf2ps and pdftops. I also know that one of the two sucks has some issues and the other is better. But because their names are so close I can't manage to remember which one to take. This post should put an end to that!

[Spoiler alert and a questionable mnemonic: pdftops is da top.]

Read more...

An audio conversion use case: comparison of execution speed between SoX, FFmpeg and MPlayer

4 December, 2009 - 15:44

In a previous post I listed some options for audio data manipulation (conversion of format, sample rate, bitrate, trimming, etc), with SoX, MPlayer and FFmpeg. The obvious question is now: which one is best?

Read more...

Audio format conversion cheat sheet (aka how to)

2 December, 2009 - 14:17

In my day job, I regularly have to convert/transcode/re-encode audio data from one format to another. Because I typically have to do this in batch jobs, I'm mostly dealing with command line tools (on Linux) like Lame, SoX (Sound eXchange), MPlayer and FFmpeg. Having a cheat sheet of how to invoke them with the desired options has proven to be very useful, so here is mine. Note that I only cover the operations I mostly need, like format conversion, sample rate conversion, conversion to mono and trimming/cropping. If you need more/other functionality, look in the man pages or ask your favorite search engine.

[Update] also see a follow up blog post about an execution time comparison between SoX, FFmpeg and MPlayer.

Read more...

My bashrc, bash aliases, profile and other files

19 October, 2009 - 15:30
Categories:

I spend a lot of time on the (bash) command line in (Linux and OS x) and it's always good for productivity to have your favorite set of shortcuts, aliases, perferences, predefined (environment) variables and such at your fingertips. You know, all the stuff that lives in .bashrc, .profile, .vimrc, .git, etc.

I have access to several systems (at home, at work, remote servers, etc) and from time to time I'm sitting behind a system that doesn't know my preferences yet. I considered using some sort of version control system to "synchronize" these preference files between my setups, but (apart from the practical hurdles) it generally seemed overkill, especially since each setup can have its own peculiarities and customizations.

So, mainly for my own reference, I'm keeping an list of the most important general stuff here. Be welcome to cherry-pick (or suggest additions).

Read more...

Time-lapse of construction site "Het Ufo" of Ghent University

1 October, 2009 - 13:04
Categories:

In front of the place I work, Ghent University is constructing a new building with two large auditoria and office space, called "Het Ufo" (Universiteitsforum). Being in the digital age, there was of course a webcam pointing at the construction site. Since 21 September 2007, I had a cron job running to capture a photo each day. Apparently, the cron job died on 18 august 2009 for some reason, so my pile of daily photo's stopped growing. Time to put them together in a time-lapse video:

Update: Michiel Ronsse (see comments below) also had a cron job running and kindly provided me with extra frames from July 2007 to September 2007. This is the part when there is no concrete yet.

Read more...

How to find out which version of Ubuntu you are running?

11 September, 2009 - 09:51
Categories:

How to find out which version of Ubuntu you are running?

Use one of the commands below:

lsb_release -a
cat /etc/lsb-release
cat /etc/issue

kthxbye

Jython and PYTHONPATH

9 September, 2009 - 11:07
Categories:

For some small tools or jobs I use Jython so I can (re)use some existing Java code, while still writing in Python. I also have various custom Python modules, of which I put the paths in my PYTHONPATH environment variable, so those modules are easily available in Python scripts and interactive sessions.

However, Jython does not automatically pick up the PYTHONPATH information, for reasons that seem to be discussed in this Jython development mailing list thread.

Jython 2.5 introduced the JYTHONPATH environmental variable as Jython-equivalent of PYTHONPATH, so setting both to the same value should do the trick for most use cases (unless you're working in a setup with incompatible Python an Jython versions).

For Jython versions prior to 2.5 (like 2.2.1 in my case), there is an easy "workaround", by invoking Jython with the appropriate -Dpython.path=foo/path:bar/path option. For example as follows:

Read more...

Showing the running command in a bash script with "set -x"

29 May, 2009 - 09:03

Bash scripts are handy for putting a bunch of longer running jobs in one batch. In some occasions it can be useful to know which command is running at the moment, especially when the commands do not generate output themselves or this output is redirected to files.

Bash has a simple setting to achieve this:

set -x

which, according to help set, enables the following feature:

-x Print commands and their arguments as they are executed.

Disabling it just takes a mere

set +x

You can play with it from the bash command line itself, or put it in a bash script of course.

Read more...