...making Linux just a little more fun!



[ In reference to "Hollywood, Linux, and CinePaint at FOSDEM 2008" in LG#147 ]

Robert E A Harvey [bobharvey at europe.com]

Sun, 10 Feb 2008 21:56:34 +0000

"What kind of crazy open source world is this where copyright zealot Disney funds development of LGPL code in Wine to replace Windows? Why isn't the film industry doing more to support open source development?"

Or, indeed, allowing me to watch DVDs on Linux at home. I have tried to buy e.g. LinDVD for real cash-money and been told I need to run windows.

Bob Harvey Lincolnshire UK


[ In reference to "Booting Linux in Less Than 40 Seconds" in LG#147 ]

MNZ [mnzaki at gmail.com]

Sun, 3 Feb 2008 20:24:31 +0200

Hi TAG, I really enjoyed this article, just what I need! But there's only one problem, the DMA on the hard-disk. I've always used a very similar approach to the one mentioned in the article to set DMA on on my disks, the problem is INIT doesn't actually start when waking up from hibernation and so DMA is not set which makes reading the image (and booting, therefore) a very painfully long process. Any ideas on other ways to set DMA that don't involve INIT?


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


[ In reference to "Fine-tuning SpamAssassin" in LG#105 ]

Neil Youngman [ny at youngman.org.uk]

Mon, 28 Jan 2008 09:36:21 +0000

I'm not sure there's a question in there?

Also I'm not familiar with the Perl interface for SpamAssassin. I'm forwarding this to The Answer Gang to see if any of them can offer you a more useful response.

Neil Youngman

On Monday 28 January 2008 07:43, you wrote:

> Hi,
> In my project I am going to send newsletters to our clients. Here I need to
> validate my newsletter(content). Also I need to show the content's Spam
> score. I need to check the spam score for only body content not header. I
> have tried with Mail-Spamassassin-3.2.4, the SA is written in Perl API. The
> SA will check the both header and body content like ,
> .ie n .IP "$score = $status\fR\->\fIget_head_only_points()" 4
> .el .IP "$score = \f(CW$status\fR\->\fIget_head_only_points()\fR" 4
> .IX Item "$score = $status->get_head_only_points()"
> Return the message's score as computed for auto\-learning, ignoring
> all rules except for header-based ones.
> .ie n .IP "$score = $status\fR\->\fIget_learned_points()" 4
> .el .IP "$score = \f(CW$status\fR\->\fIget_learned_points()\fR" 4
> .IX Item "$score = $status->get_learned_points()"
> Return the message's score as computed for auto\-learning, ignoring
> all rules except for learning-based ones.
> .ie n .IP "$score = $status\fR\->\fIget_body_only_points()" 4
> .el .IP "$score = \f(CW$status\fR\->\fIget_body_only_points()\fR" 4
> .IX Item "$score = $status->get_body_only_points()"*
> *
> I've been your topic "Fine-tuning SpamAssassin" in
> http://linuxgazette.net/authors/youngman.html

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

Talkback:114/kapil.html (2)

[ In reference to "Right To Your Own Devices" in LG#114 ]

Kapil Hari Paranjape [kapil at imsc.res.in]

Tue, 26 Feb 2008 07:00:01 +0530


----- Forwarded message from lee hughes <toxicnaan@gmail.com> -----

Date: Sun, 24 Feb 2008 15:09:19 +0000
From: lee hughes <toxicnaan@gmail.com>
To: kapil@imsc.res.in
Subject: tkb:Device Mapper?

There still not any good device mapper documentation out there, you page was a great help to me!

I am trying to do this.

I have a loopback filesystem, that I am trying to snapshot.



cow1--------/dev/loop1 cow2--------/dev/loop2 cow3--------/dev/loop3 cow4--------/dev/loop4

you document allowed me to a snapshot of /dev/loop0, and cow the changes to /dev/loop1

can, I do the same with loop2,3,4?

i.e. I have 4 file system cow, from the same filesystem?

hope you can help, thanks for a great article.

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

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


[ In reference to "Encrypted Storage with LUKS, RAID and LVM2" in LG#140 ]

Andrej Kartashov [a-m-kartashov at yandex.ru]

Tue, 26 Feb 2008 17:45:39 +0600


Please pay attention to unmounting script in "Mounting and umounting" section:

umount /backup
lvremove backuplv
vgremove cryptvg
cryptsetup remove crypt1
cryptsetup remove crypt2

Commands `lvremove backuplv` and `vgremove cryptvg` will remove logical volume and its volume group. It is not unmounting but ~erasing~

I knew nothing about lvm while reading your article so I deleted important data while running 'unmounting' script blindly.

Please correct the article.

Best regards,


[ Thread continues here (5 messages/7.35kB) ]


[ In reference to "SMTP Authentication with Postfix" in LG#142 ]

René Pfeiffer [lynx at luchs.at]

Wed, 20 Feb 2008 11:05:12 +0100

Hello, Stefan!

On Feb 19, 2008 at 2226 -0500, Stefan S appeared and said:

> Hello:
> I just wanted you to know that I am sending you this email thru your
> configuration settings on your SMTP Auth for Postfix page.
> Squid configurationry much for writing a clear, concise page for a issue that can
> be clear as mud on Linux/Unix MTA's.  I am relaying thru my (new) canadian
> ISP SMTP servers without issue, and I did not know how to set this up
> before..
> I just wanted you to know your efforts are not in vain!

You're welcome, and thanks for the feedback. SMTP AUTH is more popular than it was years ago, so I thought sharing how to configure it with Postfix would be a good idea.

Best wishes, René.


[ In reference to "Measuring TCP Congestion Windows" in LG#136 ]

René Pfeiffer [lynx at luchs.at]

Sat, 16 Feb 2008 16:12:19 +0100

[[[ Greetings to Indonesia! Thanks to this thread, I've learned the word "Balasan", which seems to mean "re:". Is this a word in Malay, or Bahasa Indonesia? -- Kat ]]]


On Feb 15, 2008 at 1135 +0700, Niko Wilfritz Sianipar Sianipar appeared and said:

> I,ve read your article about measuring tcp congestion window. Maybe I
> can ask you, how to use tcp_info structure in my Apache code (more
> specifically in sendfile_it_all function in core_filters.c. I want to
> get the time to transfer last byte sent in order to schedule the
> packet sent to client according to that metric), cause I really realy
> confused with the Apache source code. Or, do you know what part in
> Apache that provide the time to transfer last by sent to client.

The tcp_info structure contains statistics derived from an active TCP connection. getsockopt() fills the structure with data. An example function call from my article in #136 looks like this:

getsockopt( tcp_work_socket, SOL_TCP, TCP_INFO, (void *)&tcp_info,
&tcp_info_length );

I looked into the code for core_filters.c in a httpd 2.2.8 distribution. Basically the sendfile_it_all() function reads a file and sends it to the network by using sendfile(). There's not much you can tune there since sendfile() does most of the buffering. You could periodically call getsockopt() with the TCP_INFO option, but you'd only get the TCP parameters. You cannot influence the TCP connection when it transfers date, it is handled by the kernel. You can only use one of the TCP congestions algorithms and set some parameters of the TCP stack (either through /proc/sys/net/... or by using socket options such as TCP_CORK).

If you want to do any timing you have to do the buffering yourself, send chunks of data and take the time after every buffer transmit. That's what I did in my example code, but that's not what you want to do in production code. The Linux kernel has the TCP stack and should deal with the details. The kernel also keeps track of TCP parameters used with recent clients. An application usually doesn't see all of this.

As far as the Apache code is concerned, I don't know where or whether Apache stores the time of transfers. There are some options for the socket code, so I'd look for the persistant connections (KeepAlive, etc.) or all things that deal with the socket handling.

Best, René.

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


[ In reference to "/okopnik.html" in LG#issue84 ]

Ben Okopnik [ben at linuxgazette.net]

Thu, 7 Feb 2008 02:01:58 -0500

On Wed, Feb 06, 2008 at 05:26:21PM -0500, Karl Vogel wrote:

> Some minor tweaks: I got rid of spaces, slashes, etc. in the filename.

I usually leave file names as they are unless I have reason to suspect something nasty in them (like a forward slash, which is the only character that's not allowed in filenames - at least in Unix). If I'm going to process them at all, I make it simple:


This replaces any characters that don't appear in the first list with an underscore, and squashes any repeated underscores. If I'm feeling especially energetic, I might add the following:


This will remove any leading/trailing underscores from the result. It's also a good place to add the '.html' extension.

> ---------------------------------------------------------------------------
> #!/usr/bin/perl -w
> # Created by Ben Okopnik on Thu Jan 24 13:39:27 EST 2008
> use strict;
> die "Usage: ", $0 =~ /([^\/]+)$/, " <html_file[s]_to_rename>\n"
>   unless @ARGV;
> my $title;
> for (@ARGV) {
>     open(F, $_) or die "$_: $!\n";
>     {
>         local $/;
>         ($title) = <F> =~ /<title>\s*([^<\n]+)/i;
>     }
>     close(F);
>     if ($title) {
>         $title .= ".html";
>         $title =~ s!/!-!g;
>         $title =~ s/\s/-/g;
>         $title =~ s/-&-/-and-/g;
>         $title =~ s/--*/-/g;
>         $title =~ s/-\././g;
>         $title =~ s/[:,.]-/-/g;
>         $title =~ tr/'";//d;
>     }
>     else {
>         warn "$_: no title\n";
>         next;
>     }
>     if (-f "$title") {
>         warn "'$title' already exists\n";
>     }
>     else {
>         print "$_ -> $title\n";
>         rename($_, "$title") or die "rename $_: $!\n";
>     }
> }
> exit(0);

This last line may be standard practice in C, etc., but it's unnecessary (and deprecated) in Perl. The same is true for the parens in your 'open', 'close', and 'rename' calls: punctuation that doesn't have a specific reason for being there should be omitted.

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


[ In reference to "A dummies introduction to GNU Screen" in LG#147 ]

Kapil Hari Paranjape [kapil at imsc.res.in]

Mon, 4 Feb 2008 09:29:17 +0530


This is a nice intro to screen.

As you might expect ... some additional pointers from a long time screen user :)

1. Your method of binding the C-\ key to command might cause you
   grief. The suggested method is "escape ^\\".
   You can also bind a "function key" to the screen command with
   something like "bindkey -k <keyname> command". The list of
   <keyname>s can be found in "man -s5 termcap" under the section
   "String Capabilities". I use "F1" which is the F11 key. (It should
   have been F12 but that is for the window manager).
   You can also use some command like "escape ^^^" to
   override the default C-a being bound to the escape key.
   There currently seems to be no way to specify "no escape key" to
   screen which is a bit unfortunate!
2. You can also use "C-a '<initial char(s) of window name>" to switch
   to a window for example "C-a 'Eli" followed by enter will switch
   to that window.

Some other things to have fun with in screen are "nethack mode" and more seriously cut-and-paste and multi-user mode.


Kapil. --

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


[ In reference to "TCP and Linux' Pluggable Congestion Control Algorithms" in LG#135 ]

hiren jebaliya [hiren_64 at yahoo.com]

Sat, 2 Feb 2008 22:29:05 -0800 (PST)

Sir, I am a student of BE Electronics and communication, As a part of final year cirriculum we have a subject in which we have to make a project. so we choose to make a project in which we will measure performance of various TCP variants like TCP tahoe, reno, new reno, sack etc with help of netword emulator tool NISTnet. we have faced a problem that current version of linux (fedora) uses sack but we want to use older version of TCP like tahoe and reno etc so what should we do is there kernel available where we could get this version and could install them or is that we just have to modify the codes in networkstack please tell us the solution which is possible and also state that through which link will we get the required kernels and the name of kernel if possible. Thanking you. H Jebaliya.


[ In reference to "App of the Month" in LG#147 ]

reine dedeurwaerder [reined at gmail.com]

Thu, 14 Feb 2008 16:34:00 +0100

rich over(in depth)view EVERY coder should check: Tech_Talk__Linus-Torvalds-on-Git.flv

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


[ In reference to "Mailbag" in LG#147 ]

Jon Schewe [jpschewe at mtu.net]

Sat, 09 Feb 2008 08:16:19 -0600

Re: large file server/backup system: technical opinions?

For backups that take longer than overnight, why not just use snapshots in LVM?

Jon Schewe | http://mtu.net/~jpschewe
If you see an attachment named signature.asc, this is my digital
See http://www.gnupg.org for more information.
For I am convinced that neither death nor life, neither angels 
nor demons, neither the present nor the future, nor any 
powers, neither height nor depth, nor anything else in all 
creation, will be able to separate us from the love of God that 

Talkback:137/lazar.html - Linux mint network issue

[ In reference to "Getting Started with Linux Mint" in LG#137 ]

Chuck 2.0 [chuck418 at gmail.com]

Fri, 15 Feb 2008 15:38:31 -0500

Loved the article, but what if you have DHCP and Linux Mint still doesn't find the Internet (so no updates of new programs;{ Went to Network and filled in workgroup and machine names, my router hands out IPs...System see's the hardware...do I have to Mount the eth0, and if so how does one do that. Thanks for the great web page, and in advance for your help. This is the 4th Linux I've tried over the years, looks ALMOST easy enough for me! This machine dual boots to Xp and that can see the Internet, home built Athlon 1700 machine, multiple hard drives, wired to the router, and through that to cable.


chuck 2.0

"And as imagination brings forth the forms of things unknown, the Magician's
Will turns them to shapes, and gives to airy nothing a local habitation and
a name."

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


[ In reference to "Right To Your Own Devices" in LG#114 ]

René Pfeiffer [lynx at luchs.at]

Mon, 28 Jan 2008 21:41:04 +0100


While getting in touch with some colleagues who had a slight misfortune with the dd command and image files, Google directed me to the "Right To Your Own Devices" article in LG #114. The device mapper is indeed very, very useful.

Image you have a big dump file created with dd from a whole disk.

dd if=3D/dev/hda of=3D/mnt/usb/big_dump.img

Now imagine your /dev/hda device was a disk with multiple partitions. How can you access the partitions individually? Try the device mapper. By using the dmsetup command directly you have to use offsets to get to the right partition(s). There's an easier way. The command kpartx can automatically create device mapper devices from a dumpfile. kpartx is part of the "multipath-tools" package (at least on Debian, Ubuntu and Gentoo). Create a loopback device backed by the image file and use kpartx:

losetup /dev/loop0 /mnt/usb/big_dump.img
kpartx -a /dev/loop0

After that you will find the mapped devices for every partition in /dev/mapper/. You can remove the devices by using the following command:

kpartx -d /dev/loop0

"kpartx -l /dev/loop0" gives you a list of the partitions with lines that can be used in a dmsetup description table.

Make sure that your kernel and your device mapper utils match. Best use recents versions or the ones from your distribution.

Best, René.

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

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 148 of Linux Gazette, March 2008