Anything else

I try to categorize all posts. Yet some posts just don’t seem to fit any category. So here’s everything else:

This isn’t really new, but it’s sure worth knowing… The fact that there’s a 128K buffer used to pass arguments to child processes in the Linux Kernel can have the following effect on shell external commands:

When you run commands such as rm spam* the shell (e.g. bash) will expand the “spam*” to a list of names of all files in the working directory that start with “spam”. That list is then passed to the executable /bin/rm using the 128K buffer mentioned above. If you have a large number of files, or the list gets long because of long file names, you may get an error message saying /bin/rm: Argument list too long.

To work around this you can get the list of filenames using find and pipe it to xargs which in turn invokes rm for every single file. There is no limit on the size of a pipe (or at least none that I am aware of for this practical purpose). Here’s the full command:

find . -name 'spam*' -print0 | xargs -0 rm

This differs from similar commands you might find in the -print0 and -0 arguments: These are needed in case you have spaces in your filenames.

For an in-depth explanation of both the 128K buffer and the spaces in filenames issue you may also want to read the May 2004 update in this blog post. (See, I told you it’s not really new.)

In case you’ve ever wondered what the monthly traffic allowance in your web hosting plan means in bandwidth, here’s an easy-to-remember number:

3.19 (month kbit) / (sec GB) – I shall call this the Brian Adkins number

Under the assumption that traffic from a web server only flows in one direction it means that for every GB (gigabyte) of monthly traffic included in your plan you could consume 3.19 kbit/s constantly. Or for every TB (terabyte) of traffic allowed per month you can transmit data at a constant rate of 3.19 Mbit/s.

I hope he takes this down to the Cafe: 1987 Compaq Portable III (286 based) with Wireless and Lynx part one, and here’s part two (seen it on Hack a Day)

June 19, 2011 | No comments

Syntax Highlighting on this blog is brought to you by http://alexgorbatchev.com/wiki/SyntaxHighlighter. – I’m using the “old” 1.5.1 version on purpose: it allows you to copy the code to your clipboard without using the flash code… unlike the new version where you end up selecting the line numbers as well. Update: I’ve shifted to the SyntaxHighlighter Evolved WordPress plugin by Viper007Bond.

August 6, 2009 | No comments

Hello World

So here’s a new blog. – I used to have a FileMaker blog in German. It never really got any traffic and so I stopped posting in March 2005. But I felt confident that the idea to have a FileMaker blog wasn’t bad after all. I just hadn’t chosen the right time. Let’s see if the time is right now…