...making Linux just a little more fun!



[ In reference to "Introduction to Shell Scripting, part 6" in LG#116 ]

Mr Dash Four [mr.dash.four at googlemail.com]

Mon, 30 Jun 2008 13:06:25 +0100

Hi Gang,

_* *_Found this list thanks to the excellent article of Ben Okopnik here <http://linuxgazette.net/116/okopnik1.html> - I was trying to create a floppy disk to help me boot-up an old PC (PII, 256MB RAM, 2xUSB + FDD), by transferring the control over to the USB drive (which can't be booted-up directly as the PC is too old). The USB contains slimmed-down version of FC8 containing propriety tools and programs. I wasn't successful, though this is not why I am writing this email (help with the floppy-usb boot-up is also appreciated though that may be a subject to a different email as Ben's article points out that I would need Knoppix Linux, but I have FC8 on the USB drive). Anyway...

After unsuccessfully trying to make the boot-up floppy, allowing me to boot-up the USB drive I tried to make a bare-bone boot-up floppy, containing just stage1 & stage 2 files to get me to the GRUB prompt (see 'What happened' below) with the intention of trying my luck from there and this is where I encountered my problem.

_*The problem:*_ I can't boot from my HDD - when I try I see the word "GRUB " on the screen and then nothing (this is not the GRUB prompt - it is just a message on the screen saying "GRUB " and then the system halts)!

I can access all my partitions - no problem (none of them appear damaged, same is valid for my partition table, thank god) using Boot/Rescue CD, which I made following the instructions shown in section 3.4 here <http://orgs.man.ac.uk/documentation/grub/grub_3.html>.

_*My system:*_

Fedora Core 8 with the latest updates, P4-M, 1GB RAM, 80GB HDD, split 
into the following partitions:
hda1 - primary, WinXP, NTFS
hda2 - extended
hda5 - logical, data disk, NTFS
hda6 - logical, RedHat 9, ext2
hda7 - logical, Fedora Core 8 /boot, ext2
hda8 - logical, Fedora Core 8 LVM volumes (5 of them mapped to /, /usr, 
/var, /home and /var/cache), lvm
hda9 - logical, data backups, NTFS
hda3 - primary, Service/Rescue DOS, FAT

GRUB used to be in my MBR as through its menu I used to boot all partitions successfully (up until now that is). One other thing I need to point out - as soon as the partitions were made I have created a copies of the boot sectors of all my partitions, plus the main MBR sector using these commands:

%dd if=/dev/hda of=hda-mbr-full bs=512 count=1 # mbr including partitions
%dd if=/dev/hda of=hda-mbr-nopart bs=446 count=1 # no partition 
information, just the MBR
%dd if=/dev/hdaX of=hdaX-bootsect bs=512 count=1 # boot record of a 
particular partition

where 'X' is the number of the partition. The files were saved on a separate usb device (memory stick) for safekeeping.

I should also point out that within FC8 Linux my HDD is mapped as /dev/sda (not /dev/hda).

[ ... ]

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


[ In reference to "Understanding Threading in Python" in LG#107 ]

Ben Okopnik [ben at linuxgazette.net]

Thu, 3 Jul 2008 10:40:33 -0400

----- Forwarded message from Greg Robinson <grobinson@google.com> -----

Date: Wed, 2 Jul 2008 20:41:13 -0700
From: Greg Robinson <grobinson@google.com>
To: editor@linuxgazette.net
Subject: Understanding threading in Python

I appreciated the article entitled "Understanding Threading in Python" by Krishna G Pai. However, it states that "there is no significant difference between threaded and non threaded apps." While this is true for the specific example used in the article, the statement is misleading. Don't neglect the advantages of threading, even with green threads such as those in Python, in situations where the thread is likely to block on something other than local processing. For example, if someone fires off numerous RPCs to multiple computers in succession, each RPC call may have to sit and wait for the callback. This can take much longer than dispatching multiple simultaneous RPCs and handling each one concurrently.

Cheers, Greg Robinson

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


[ In reference to "2-Cent Tips" in LG#152 ]

Greg Metcalfe [metcalfegreg at qwest.net]

Fri, 25 Jul 2008 11:35:02 -0700

Regarding "2-cent tip: Removing the comments out of a configuration file":

I don't like to invoke Yet Another Interpreter (Perl, Python, etc.) for simple problems, when I've already got a perfectly good one (the bash shell) running, and all those wonderful GNU programs. So I often view 'classic' config files (for httpd, sshd, etc) via the following, which I store as ~/bin/dense:

# Tested on GNU grep 2.5.1
grep -Ev ^\([[:space:]]*#\)\|\(^$\) $1

~/bin is in my path, so the command is simply 'dense PATH/FILE'. This code strips comments, indented comments, and blank lines.

Of course, if you need this frequently, and bash is your login shell, a better approach might be to just add:

alias dense='grep -Ev ^\([[:space:]]*#\)\|\(^$\)'
to your ~/.bashrc, since it's so small, thus loading it into your environment at login. Don't forget to source the file via:
'. ~/.bashrc'
after the edit, if you need it immediately!

Regards, Greg Metcalfe

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


[ In reference to "Apertium: Open source machine translation" in LG#152 ]

Jimmy O'Regan [joregan at gmail.com]

Fri, 4 Jul 2008 17:43:45 +0100

I mentioned the infinite monkeys idea in relation to SMT in my article... I found today that it has been done: http://www.markovbible.com/

"You've seen the King James, the Gutenberg and the American Standard, but now here is the future ........ The Markov Bible.

Everyone has heard the saying 'a million monkeys typing for a million years will eventually produce the bible'.

Well, we have done it!!! And in a far shorter time.

Using our team of especially trained Markov Monkeys, we can rewrite whole books of the bible in real time."

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


[ In reference to "Automatic creation of an Impress presentation from a series of images" in LG#116 ]

Karl-Heinz Herrmann [kh1 at khherrmann.de]

Wed, 2 Jul 2008 12:23:06 +0200


I got an email a few days back including a patch to the img2ooImpress.pl script in issue 116. I would like to forward the following discussion to TAG (with permission, Rafael is CC'ed):


From: Rafael Laboissiere <rafael@debian.org>
To: Karl-Heinz Herrmann <kh1@khherrmann.de>
Subject: Re: Bug in your img2ooimpress.pl script
Date: Tue, 24 Jun 2008 21:53:36 +0200
User-Agent: Mutt/1.5.17+20080114 (2008-01-14)
* Karl-Heinz Herrmann <kh1@khherrmann.de> [2008-06-24 21:39]:

> thanks for the patch... actually I stumbled onto the problem myself
> after an upgrade of OODoc some time back and sent a correction to LG
> which got published as talkback for the article. That patch is there:
> http://linuxgazette.net/132/lg_talkback.html#talkback.02
> but as #116 was before they introduced talkbacks the talkback is not
> actually linked in the original article so it doesn't help people
> much. As LG is mirrored in many places the original articles are not
> changed usually.  

Indeed... Sorry for bothering you with this. It is too bad that the LG article does not link to the talkback.

> I hope -- apart from having to find and fix that bug -- that script
> was helpful :-)  

Yes, it was. I wrote another Perl script based on yours to directly convert a PDF file into ooImpress. Besides the OpenOffice::OODoc module, it needs the xpdf-utils (for pdfinfo), the pdftk, and the ImageMagick (for convert) packages. The script is attached below. [...]

and another followup by Rafael:

I am attaching below an improved version of the script. I improved the header material, put it under the GPL-3+ license and it now accepts a --size option.

I also put the script in a (kind of) permanent URL: http://alioth.debian.org/~rafael/scripts/pdf2ooimpress.pl


Is there a possibility to "upgrade" the older TAG pages with the talk-back links? I'm of course aware of the mirror problem.

[[[ FYI to Karl-Heinz (and everyone else interested) - I manually build the Talkback style for dicussions of articles that predate the Talkback link. It doesn't help during the discussion, but it does make the published version look just as spiffy! -- Kat ]]]

In any case his improved script version might be a nice 2c tip (or mail bag) contribution.


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

Talkback:116/okopnik.html - success!

[ In reference to "Introduction to Shell Scripting, part 6" in LG#116 ]

Mr Dash Four [mr.dash.four at googlemail.com]

Sun, 06 Jul 2008 02:00:12 +0100

Hi, Ben,

> Please don't drop TAG from the CC list; we all get "paid" for our time
> by contributing our technical expertise to the Linux community, and that
> can't happen in a private email exchange.
Apologies, it wasn't intentional - I've got your message and hit the 'reply' button without realising there was a cc: as well.

>>    Here is my plan (funny enough I was about to start doing this in about 2
>>    hours and possibly spend the whole of tomorrow - Sunday - depending in
>>    what kind of a mess I may end up in):
>>    1. Backup my entire current /boot partition (it is about 52MiB).
>>    2. Restore a month-old backup of this /boot partition to a safe' location
>>    (USB drive). As this backup is old apart from the new kernel version it
>>    won't contain anything wrong with the partition and my first task will be
>>    to compare the files, which may cause my partition not to boot (menu.lst
>>    etc) as well as the boot sector. I would expect to see changes and will
>>    ignore the ones caused by the kernel updates (like new versions of the
>>    vmlinuz- file).
>>    3. If I find such changes between the 'old' backup and the new one, which
>>    prevent me from booting up the new partition then I will reverse them and
>>    see if I can boot up.
The first two steps went off without a hitch. To my big surprise I did NOT find any significant changes to the /boot partition. I've attached 'files.zip' which contains a few interesting files in it. 'boot_list.txt' and 'boot_grub_list.txt' lists the contents of my '/' and '/grub' directories of the '/boot' partition. The only difference between the old (backed up) and the new was file size and different version numbers of the kernel files (vmlinuz, initrd and the like).

>>    4. If there are NO changes I could find (the least favourable option for
>>    me as I will enter uncharted waters here!) then I would have no option,
>>    but to run grub-install /dev/sda while within FC8 Live CD to restore GRUB
>>    in the hope of getting GRUB to load. If I could then boot normally from
>>    the hard disk then I would compare what has been done (both in terms of
>>    files and the boot sector - bot on the /boot partition as well as the
>>    absolute on /dev/sda) and see if I can find any differences. If not, well
>>    ... it will remain a great mystery what really went wrong, sadly!
Well, this was my almost last-chance saloon and given that 'grub-install' messed up my mbr completely (read below) I was VERY reluctant to use it again to re-install GRUB, so after re-reading the original article on how to re-install it (refer to my 1st email) coupled with me getting nowhere with managing to boot from the CD via the GRUB menu (instead of typing each and every grub command) I did the following:

[ ... ]

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

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 153 of Linux Gazette, August 2008