...making Linux just a little more fun!


This month's answers created by:

[ Sayantini Ghosh, Amit Kumar Saha, Ben Okopnik, Joey Prestia, Kapil Hari Paranjape, René Pfeiffer, Neil Youngman, Paul Sephton, Rick Moen, Thomas Adam, Thomas Bonham ]
...and you, our readers!

Gazette Matters

LG server is down...

Ben Okopnik [ben at linuxmafia.com]

Sun, 1 Jun 2008 11:33:22 -0700

...and it's quite the story. Not because of us specifically, but because theplanet is such a huge data center - i.e., it's causing a huge outage all over the place.

To quote Doug Erwin of theplanet (issued at 10:46 PM, May 31 2008):

   This evening at 4:55pm CDT in our H1 data center, electrical gear
   shorted, creating an explosion and fire that knocked down three walls
   surrounding our electrical equipment room. Thankfully, no one was
   injured. In addition, no customer servers were damaged or lost.
   We have just been allowed into the building to physically inspect the
   damage. Early indications are that the short was in a high-volume wire
   conduit. We were not allowed to activate our backup generator plan based
   on instructions from the fire department.
   This is a significant outage, impacting approximately 9,000 servers and
   7,500 customers. All members of our support team are in, and all vendors
   who supply us with data center equipment are on site. Our initial
   assessment, although early, points to being able to have some service
   restored by mid-afternoon on Sunday. Rest assured we are working around
   the clock.

Our publication process is rolling on regardless of this, of course. In principle, we should be back up pretty much as soon as theplanet is. For the moment, if anyone needs to contact me, I'll be monitoring this linuxmafia.com address.

* Ben Okopnik * Editor-in-Chief, Linux Gazette * http://linuxgazette.net *

[ Thread continues here (6 messages/4.61kB) ]

small request for the editor

Ben Okopnik [ben at linuxgazette.net]

Tue, 10 Jun 2008 22:44:31 -0400

Hi, Nicola -

On Mon, Jun 09, 2008 at 09:28:54PM +0200, nicola giacobbe wrote:

> Hello,
> I have just discovered your webzine (it is that the name?), it is fresh  
> and full of nice goodies and I am eager to get all past issues. Of course  
> they are available but just downloading it without a thanks or a hug  
> seemed rather rude.

Actually, we make them available for exactly that purpose; we even have a repository with all the issues compressed into tarballs for downloading.


> Are you willing to sell them on DVD for a nominal sum (let's say $10+S&H)?  

Nope - it's all free!

> Or is there any other way to even your good job?
> Just let me know...

Nicola, you've just "paid". Thank you for your considerate question, and you're more than welcome. I hope you enjoy reading LG!

Best regards,

* Ben Okopnik * Editor-in-Chief, Linux Gazette * http://LinuxGazette.NET *

Our Mailbag

U.S. sanctions-compliant Linux

Simon Lascelles [simon.lascelles at rems.com]

Thu, 26 Jun 2008 17:38:51 +0100

We are looking for a version of Linux we can use legally in Syria. Do you know of a list of all Linux variants and their country of origin or do you know of a variant that is export compliant?

Simon Lascelles 
Managing Director
REMS International
Email:  <blocked::mailto:simon.lascelles@rems.com> simon.lascelles@rems.com
Web Site:  <http://www.rems.com/> http://www.rems.com/
Mobile: 07956 676112
Telephone: 01727 848800
Yahoo: rems25x8@yahoo.com

Mobile communications are changing the face of business, and organisations that deploy mobile solutions will reap the greatest competitive advantage


[ Thread continues here (10 messages/35.63kB) ]

Spam Prevention by Enforcing Standards

Rick Moen [rick at linuxmafia.com]

Wed, 11 Jun 2008 20:51:25 -0700

Recently received Chez Moen, and I replied back saying it's indeed an astute and elegant idea, which I might very well adopt for my own domains. (In the absence of an MX = mail exchanger record in the DNS for a mail-receiving machine on the Internet, RFC 2821 specifies that the sending host should fallback on the "A" = forward lookup record, instead. This was also true with the original SMTP-defining RFC, RFC 821.)

And, in case anyone is wondering, Gokhan Gucukoglu's name is Turkish. He seems to be based in the UK, and is one of those protean characters active broadly across free / open source software, just to make the rest of us look bad by comparison. ;->

----- Forwarded message from Sabahattin Gucukoglu <mail@sabahattin-gucukoglu.com> -----

Date: Wed, 11 Jun 2008 09:48:55 +0100
From: Sabahattin Gucukoglu <mail@sabahattin-gucukoglu.com>
To: rick@linuxmafia.com
Subject: Spam Prevention by Enforcing Standards

I notice that linuxmafia.com has just one MX, linuxmafia.com. See RFC 2821 section 5: remove your MX record; there is an implicit MX rule. Good MTAs know it, most spammers, their spamware, their agents, etc, etc, still don't. It's a great little trick and is doing me bloody wonders. (It may on very, very rare occasions break mailers which insist that there be an MX record when you issue MAIL FROM linuxmafia.com; such mailers are broken and you really don't want to talk to them anyway :-) .)

(If you wonder why I noticed at all, it's your multiline greeting.)

Cheers, Sabahattin

Sabahattin Gucukoglu <mail<at>sabahattin<dash>gucukoglu<dot>com>
Address harvesters, snag this: feedme@yamta.org
Phone: +44 20 88008915
Mobile: +44 7986 053399

[ Thread continues here (13 messages/28.27kB) ]

Cron Sandbox

dar ksyte [dksyte at googlemail.com]

Tue, 17 Jun 2008 10:09:21 +0100

Google brought me to you. You might be interested in this new resource for experimenting with crontab commands.

For most of us, setting up a new cron job is not something we do every day. So we can easily forget the details.

Cron Sandbox at HxPI offers an opportunity to play with the crontab scheduling commands in safety.

Type in the 'm h D M Dw' parameters and see a calendar of job execution times/dates.



Dar Ksyte

[ Thread continues here (9 messages/8.87kB) ]

For users of RMAIL in Emacs, how do you deal with spam messages?...

don warner saklad [don.saklad at gmail.com]

Fri, 30 May 2008 08:51:32 -0400

For users of RMAIL in Emacs, how do you deal with spam messages?...

Not all messages appear with SpamAssassin headers.

[ Thread continues here (6 messages/5.86kB) ]

Followup: Using Ubuntu 8.04 on Notebook?

Amit k. Saha [amitsaha.in at gmail.com]

Fri, 30 May 2008 08:47:27 +0530

On Mon, May 19, 2008 at 9:54 PM, Amit k. Saha <amitsaha.in@gmail.com> wrote:

> Hi Ben,
> On Sun, May 18, 2008 at 9:56 PM, Ben Okopnik <ben@linuxgazette.net> wrote:
>> On Sun, May 18, 2008 at 02:51:36PM +0530, Amit k. Saha wrote:
>>> Hello all,
>>> I have installed Ubuntu 8.04 (32-bit) beta on my 32-bit notebook and
>>> the Ubuntu 8.04(64-bit) on a friend's 64-bit laptop. I am using Acer
>>> laptops.
>>> In both cases, using the touchpad to click (single/double-click) is
>>> pretty troublesome and needs a rather "hard" hit on the pad. I have
>>> tried setting the mouse preferences similar to the one on Ubuntu 7.04
>>> (which I use), but to no avail.

I upgraded to the final release of Ubuntu 8.04 and things are fine now!


Amit Kumar Saha

Query on linux source code

Tue, 17 Jun 2008 17:37:55 +0930

Hi Guys,

I was finally able to do the compilation process. Thanks for the help.

Another question:

1. I am using a tcpdump network sniffer to capture packets of the tcp header. I wanted to analyze a specific variable like smoothed rtt (srtt). I already changed the header file to include this new srtt variable into the option side of the tcp.h header file and also change the tcp_input.c source code to incorporate the said variable into the options side. I am confused whether tcp_input.c is the correct code to change since tcp_output.c and tcp.c is also in the linux kernel code. I am also confused how to output this new srtt variable into the tcp header so as to be captured by the tcpdump and be seen in the tracefiles.

Is there a specific function in the code to be manipulated to do the task? Any help would be appreciated.

Thank you very much in advance.



[ Thread continues here (2 messages/2.96kB) ]

C++'s cout and hexadecimal output

René Pfeiffer [lynx at luchs.at]

Thu, 26 Jun 2008 01:16:04 +0200

Hello, Gang!

I am trying to compute a SHA1 hash inside a C++ program without linking to additional libraries. There are some SHA1 code snippets around and they seem to work. So far so good. In order to compare SHA1 sums it's nice to have them in hexadecimal representation. The SHA1 code I used holds the sum in a byte array which is basically an array of unsigned chars. Creating hexadecimal output can be done as follows:

// Filename:  hex_output.cc - cout test firing range
#include <iomanip>
#include <ios>
#include <iostream>
#include <stdlib.h>
using namespace std;
int main(int argc, char **argv) {
    unsigned char array[10];
    unsigned short i;
    // An array with a French accent (sorry, SCNR)
    array[0] =3D 'A';
    array[1] =3D 'L';
    array[2] =3D 'L';
    array[3] =3D 'o';
    array[4] =3D ' ';
    array[5] =3D 'O';
    array[6] =3D 'r';
    array[7] =3D 'l';
    array[8] =3D 'd';
    array[9] =3D '!';
    for( i=3D0; i<10; i++) {
        cout << hex << setfill('0') << setw(2) << nouppercase << array[i];
    cout << endl << endl;

Unfortunately this outputs: 0A0L0L0o0 0O0r0l0d0!

As soon as I change the cout line to

cout << hex << setfill('0') << setw(2) << nouppercase << (unsigned short)array[i];

it works and produces: 414c4c6f204f726c6421

It's late and I still lack my good night coffee, but why is that? I didn't expect this behaviour.

Best, René.

[ Thread continues here (4 messages/5.91kB) ]

kernel header modification

Wed, 11 Jun 2008 15:23:44 +0930

Good day!

I am adding new variables to the tcp header(tcp.h) of the linux kernel and reflect this changes to the source code .Kindly shed light to my confusions below:

1. Do I have to recompile the whole kernel to reflect the changes in the header files and source code(i.e., tcp.c, tcp_input.c, etc)?

2. If so, what are the necessary steps involved( i.e., re-compile process) to reflect the new variables I added to the header file and the source codes?

3. Thank you very much in advance for the support.



[ Thread continues here (6 messages/7.81kB) ]

BLOCKSIZE unset by default

Mahesh Aravind [ra_mahesh at yahoo.com]

Sat, 21 Jun 2008 08:25:02 -0700 (PDT)

Dear TAG,

I was playing around the command line (learning), and I came across df(1) reporting block size in "1k-blocks". But my dumpe2fs(8) says the block size is 4096 (4K). Shouldn't it be doing thus by default?

It seems this is filed as a Bug under Ubuntu (Bug #180415).

One suggestion is for the install program to calculate the blocksize at install time, and put it somewhere safe (immutable). Like 'export BLOCKSIZE=<whatever>' in /etc/profile.

I also saw that adding ' (apostrophe) before the block size will yield you a digit separator -- cool, eh?

I did:

BLOCKSIZE="'4096" ls -l
           ^ <- see this?

and it gave me size figures separated by commas! :)

My $LANG is en_IN.UTF-8



Mahesh Aravind

[ Thread continues here (8 messages/8.55kB) ]

Spammy Job Offer

Ben Okopnik [ben at linuxgazette.net]

Wed, 28 May 2008 19:15:41 -0400

[[[ This had some other Subject line when the spammer sent it out. I chose to replace it with something more accurate. -- Kat ]]]

On Tue, May 27, 2008 at 03:03:29PM -0600, XXXX XXXXXX wrote:

> Hello,
> My customer located in West Austin is searching for a recent graduate
> that has significant academic / internship experience with embedded
> software development.  They seek someone with C programming experience
> in a Linux / QNX environment.
> If you or someone you know qualified, please call me or have them call me directly.
> My number is XXX-XXX-XXXX

Thanks for letting us know... that you're a spammer. I will not, for the moment, report you to the Federal Trade Commission's "spam@uce.gov", the FBI's Internet Fraud Complaint Center, or your state's attorney - but that's only because this is the first time you've done this here. For now, I'll grant you the courtesy of believing you to be completely clueless and ignorant rather than assuming that you knowingly violated Texas law (http://www.spamlaws.com/state/tx.shtml) as well as your network provider's Acceptable Use Policy.

I have, however, blocked you from this mailing list. Have a pleasant day.

* Ben Okopnik * Editor-in-Chief, Linux Gazette * http://LinuxGazette.NET *

[ Thread continues here (18 messages/30.46kB) ]

You have 6 messages, 1 add friend request

Terence Timburwa [invitation at ASPAMMERNETWORK.invalid]

Wed, 4 Jun 2008 10:12:08 +0100

Terence Timburwa has added you as a friend on [a spammer network]

[[[ Rest of the message with all the spammy splendor of bogus claims of "you have 6 messages" and "click here to remove" "click here for this" "click here for that" removed. -- Kat ]]]

[ Thread continues here (4 messages/2.72kB) ]

How to refine a spam delete technique for beginners, emphasis on beginner.

don warner saklad [don.saklad at gmail.com]

Thu, 12 Jun 2008 00:07:32 -0400

What other hints, tips or pointers are there with RMAIL in Emacs?... about how to refine a spam delete technique for beginners, emphasis on beginner.

For example...

. by using
     C-c C-s C-s
     C-c C-s C-L
. by using
     Esc C-s rolex
     Esc C-s viag
     Esc C-s pharm
     and so forth
  and referring to charts at
             online pharmacies
             replica products
             other spam
             illegal advertising
             casino and gaming
             software sales
             spam insurance
             credit and debt relief
             bank phishing
             job offers
. or ...?

For beginners with dotfile and programming skills below minimal, if at all !

Terence Timburwa added you as a friend on $$$$...

Rick Moen [rick at linuxmafia.com]

Wed, 11 Jun 2008 19:38:12 -0700

Quoting Terence Timburwa (first_reminder@THATANNOYINGSPAMMERNETWORK.INVALID):

> Dear tag, 
> Terence Timburwa

[[[ There was more to this, but I've stripped it out. -- Kat ]]]

That's funny: I'd already permanently consigned to the outer darkness the domain that sent us this rubbish last month, but neglected to do likewise with two other variants. I'm attending to that oversight, now.

Apache -- Redirect if found this "Regex"

Smile Maker [britto_can at yahoo.com]

Thu, 19 Jun 2008 04:05:20 -0700 (PDT)


I have recently upgraded all of my jsp's to php's and pointed my rr to the new server. But for the backward compatibility How do i say to apache "if it finds request for any "jsp " go to this php page"


[ Thread continues here (8 messages/5.55kB) ]

tcp.c and tcp_input inquiry

Fri, 30 May 2008 12:13:58 +0930

Hi guys,

Good day!

I am currently doing my phd in telecommunications working on tcp. I found the document tcp_input.c and tc.c source code document at a website but browsing through my kernel, I cannot find the source codes mentioned. Thus, this inquiry.

It would be appreciated if you can kindly help me on my questions since I am new to tcp.

1. I am using fedora core6 linux and I cannot find the file tcp_input.c and tcp.c in the kernel. Where can I find this code in the kernel since I need to do some modification on the tcp header as part of my thesis?

2. What are the steps in inserting an estimated value into a kernel variable?

I have already visited the linux kernel faq and I cannot find the answer to my questions ( or maybe I need to browse more:-(). I hope you can shed light on the above queries. Thank you very much in advance.


Dom Ignacio

[ Thread continues here (11 messages/13.96kB) ]

Searching for multiple strings/patterns with 'grep'

Amit k. Saha [amitsaha.in at gmail.com]

Mon, 23 Jun 2008 11:52:44 +0530

Hello TAG,

I have a text file from which I want to list only those lines which contain either pattern1 or patern2 or both.

How to do this with 'gre'p?

Assume, file is 'patch', and 'string1' and 'string2' are the two patterns.

The strings for me are: 'ha_example' and 'handler'- so I cannot possibly write a regex for that.

Thanks, Amit

Amit Kumar Saha

[ Thread continues here (3 messages/2.70kB) ]

Talkback: Discuss this article with The Answer Gang

Copyright © 2008, . Released under the Open Publication License unless otherwise noted in the body of the article. Linux Gazette is not produced, sponsored, or endorsed by its prior host, SSC, Inc.

Published in Issue 152 of Linux Gazette, July 2008