...making Linux just a little more fun!


This month's answers created by:

[ Sayantini Ghosh, Amit Kumar Saha, Ben Okopnik, Kapil Hari Paranjape, Karl-Heinz Herrmann, René Pfeiffer, Neil Youngman, Rick Moen, Thomas Adam ]
...and you, our readers!

Our Mailbag

Delete the contents

sunil pradhan [kumar22.sunil at gmail.com]

Fri, 11 Apr 2008 17:56:11 +0530

Hi Sir ,

Can you help me how to delete the contents of the file..


Sunil Pradhan.


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

Scalable TCP Tuning

René Pfeiffer [lynx at luchs.at]

Mon, 31 Mar 2008 21:29:06 +0200

On Mar 31, 2008 at 0024 -0700, Erik van Zijst appeared and said:

> René Pfeiffer wrote:
>> [...]
>>  - /proc/sys/net/ipv4/tcp_low_latency controls if the data is forwarded
>>    directly through the TCP stack to the application buffer (=1) or not
>>    (=0). I have never benchmarked or compared this setting, thought it's
>>    always on on my laptop (as I noticed just now, I must have fiddled
>>    with sysctl.conf here).
> I'm not sure what that one does exactly, but the problem is not the 
> client-side, as it is fast enough to read the video from the socket. 
> Instead, it's the server-side that saturates the socket, filling up the 
> entire send buffer and thereby increasing the end-to-end time it takes for 
> data to travel from server to client.

I meant to try this on the server. I think it is designed to work on the client side, but I am not sure.

> The way our streaming solution works is by letting the server anticipate 
> congestion (blocking write calls) by reducing the video bitrate in 
> real-time. As a result, the send buffer is usually completely filled. For 
> that same reason, disabling Nagle's algorithm has no effect either: the send 
> buffer always contains more than one MSS of data.

I see.

> This is fine, but as I frequently get buffer underruns on networks with 
> highly fluctuating Bandwidth-Delay-Products, it looks like Linux is happy to 
> increase the send buffer's capacity when beneficial, but less so to decrease 
> it again when circumstances change.

Judging from the measurements I've seen when playing with the congestion algorithms, the Linux kernel seems to be able to decrease the sender window. However I think the behaviour is really targetted at having a full buffer and a suitable queue all of the time. You could check which one of the algorithms works best for your application and create another kernel module with the desired window behaviour. I make the distinction between buffer and window size since I believe that the congestion algorithms only affect the window handling, not the buffer handling.

>>  - The application keeps its own buffer, but you can also influence the
>>    maximum socket buffers of the TCP stack in the kernel.
>>    http://dsd.lbl.gov/TCP-tuning/linux.html describes the maximum size
>>    of send/receive buffers. You could try reducing this, but maybe you
>>    can't influence both sides of the connection.
> Yes, I've been tempted to manually shrink the send buffer from the 
> application-level, but since the fluctuating bandwidth and delay justify a 
> dynamic buffer size, I'm reluctant to try and hardwire any fixed values in 
> user space.

Yes, I agree, having an algorithm doing that automatically would be more useful.

[ ... ]

[ Thread continues here (7 messages/12.56kB) ]

Sendmail and capacity

Dennis Veatch [dennisveatch at bellsouth.net]

Fri, 25 Apr 2008 10:34:49 -0400

Hi guys and gals.

I have what I thought would be a simple question. How do you figure out how many emails sendmail can process and not drive the load average over say 2 or 3? After much googling around and trying to glean information from the sendmail FAQs, etc I am still stumped. I know it depends on hardware configuration, the number of mailboxes, how many emails are sent and received for a given time frame, etc. But I can't even find a general rule of thumb to even get a ball park idea. Can ya help me out?

Perhaps I am approaching this from the wrong perspective as I realize the above statements are most likely way to general to give even a ball park answer, though if you could that would be great.

You can tuna piano but you can't tune a fish.

[ Thread continues here (7 messages/14.66kB) ]

Netcape to OpenLDAP Migration

top mungkala [pakin8 at gmail.com]

Tue, 22 Apr 2008 11:56:36 +0700

I'm beginning the project of upgraded mail hosting. In the process I have to migrate data in old Netscape LDAP server to an OpenLDAP server. I'm newbie in UNIX shell script and my task is mail address book migration. I have only one text file which has data like this:

dn: cn=ldap://:389,dc=yomo,dc=aaa,dc=bbb,dc=ccc
cn: ldap://:389
objectclass: top
objectclass: applicationprocess
objectclass: ldapserver
generation: 020000318055502
aci: (targetattr = "*")(version 3.0; acl "Configuration Adminstrators Group";
 allow (all) groupdn = "ldap:///cn=Configuration Administrators, ou=Groups, o
 u=TopologyManagement, o=NetscapeRoot";)
aci: (targetattr = "*")(version 3.0; acl "Configuration Adminstrator"; allow (
 all) userdn = "ldap:///uid=admin,ou=Administrators, ou=TopologyManagement, o
aci: (targetattr = "*")(version 3.0; acl "Local Directory Adminstrators Group"
 ; allow (all) groupdn = "ldap:///ou=Directory Administrators, o=arc.net.my";
aci: (targetattr = "*")(version 3.0; acl "XXX Group"; allow (all)groupdn = "ld
 ap:///cn=slapd-yomo, cn=Netscape Directory Server, cn=Server Group, cn=yom
 o.aaa.bbb.ccc, ou=aaa.bbb.ccc, o=NetscapeRoot";)
modifiersname: uid=admin,ou=Administrators,ou=TopologyManagement,o=NetscapeRoo
modifytimestamp: 20000318055506Z
dn: un=RMohana4bdbd8,ou=sharonscy,ou=People,o=aaa.bbb.ccc,o=aaa.bbb.ccc,o=pab
un: RMohana4bdbd8
objectclass: top
objectclass: person
objectclass: organizationalPerson
objectclass: inetOrgPerson
objectclass: pabperson
memberofpab: AddressBook3e0c2d8
mail: rmohan@aaa.bbb.ccc
givenname: R.
sn: Mohan
cn: R. Mohan
creatorsname: uid=msg-admin-1,ou=People,o=aaa.bbb.ccc,o=aaa.bbb.ccc
modifiersname: uid=msg-admin-1,ou=People,o=aaa.bbb.ccc,o=aaa.bbb.ccc
createtimestamp: 20050622142039Z
modifytimestamp: 20050622142039Z

After I reviewed the files I found that each box entries has "objectclass: pabperson" is box entries of email address book so at first I want to detect the "objectclass: pabperson" and cut all its box entries. For each box entries is separated by the new line. please you give me any pointers on how to do this successfully by using shell script?

Thank You,


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

WEP: a 1-minute wonder

Ben Okopnik [ben at linuxgazette.net]

Mon, 14 Apr 2008 14:44:47 -0400

WEP, since pretty much its very beginning, was acknowledged as a stop-gap protocol. Seems that the gap has been bridged:


  Abstract: We demonstrate an active attack on the WEP protocol that is
  able to recover a 104-bit WEP key using less than 40.000 frames in 50%
  of all cases. The IV of these packets can be randomly chosen. This is an
  improvement in the number of required frames by more than an order of
  magnitude over the best known key-recovery attacks for WEP. On a IEEE
  802.11g network, the number of frames required can be obtained by
  re-injection in less than a minute. The required computational effort is
  approximately 2^{20} RC4 key setups, which on current desktop and laptop
  CPUs is neglegible.
* Ben Okopnik * Editor-in-Chief, Linux Gazette * http://LinuxGazette.NET *

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

how to create hard link

Ben Okopnik [ben at linuxgazette.net]

Sun, 6 Apr 2008 23:34:38 -0400

----- Forwarded message from kailas <kailas1711@rediffmail.com> -----

Date: 5 Apr 2008 08:41:39 -0000
From: kailas  <kailas1711@rediffmail.com>
Reply-To: kailas  <kailas1711@rediffmail.com>
To: editor@linuxgazette.net
Subject: how to create hard link
respected sir, i required information about how to create hard link in linux with suatable examplewise.so please provide this information .

----- End forwarded message -----

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

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

NT description

Petr Vavrinec [Petr.Vavrinec at seznam.cz]

Tue, 08 Apr 2008 08:10:54 +0200 (CEST)

Allmighty TAG,

How can I find out NetBIOS name and "NT description" (or "server string" in Samba terminology) of a windows box, knowing its IP address ?

"nmblookup -A <win_ip_address>" gives me the NetBIOS name. That's OK.

But the "server string" - I'm not able to find it anywhere :-( Can you help me? Any info is greatly appreciated.

TIA, Petr

 Petr Vavrinec                       E-Mail: petr.vavrinec@seznam.cz
 Vysice 8, 388 01 Blatna, CZECHIA    Voice :          +420 383490147

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

Shell scripting Help

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

Wed, 16 Apr 2008 16:33:49 +0530

Hello all,

I have got a shell variable (passed as an argument) which stores some value such as:

$4 = 'abc,def'

Now, I want to replace all the ',' by a ' ' such that the resulting value is 'abc def'.

How do I do it?

This seems to be very basic, so PLEASE do not flame me :-)

I tried doing this:

echo $4 > devlist.tmp
#awk script to extract the fields (invididual devices) in the list
awk 'BEGIN { FS = "," } ; {print $1, $2 }' devlist.tmp > awk_tmp.tmp
devs='cat awk_tmp.tmp';
echo $devs

Seems like I am going now-where.

do suggest a solution!

regards, Amit

Amit Kumar Saha
*NetBeans Community
Docs Coordinator*

[ Thread continues here (15 messages/17.41kB) ]

sunversion on linux

Ben Okopnik [ben at linuxgazette.net]

Mon, 14 Apr 2008 13:12:20 -0400

----- Forwarded message from deepali wadekar <wadekardeepali@gmail.com> -----

Date: Mon, 14 Apr 2008 11:20:21 +0530
From: deepali wadekar <wadekardeepali@gmail.com>
To: editor@linuxgazette.net
Subject: sunversion on linux
   I am Deepali Wadekar  I am working as a linux admin as fresher.
   I was read some PDF of subversion.
   I install subversion on linux (rhel 4)
   but, how to accesse
   so please can u guide me,
   how to use of  subversion.
   With Regards
   Miss Deepali Wadekar
   Mobile: 09225775467

----- End forwarded message -----

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

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

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 150 of Linux Gazette, May 2008