Friday, December 16. 2005
I do testing in web development in that way, that the public website is stored in the public_html subdirectory, and the test site is located in develop_html. To see whether there are differences between those two sites, I use the following aliases:
alias changes=’dir=$(pwd|sed -e s:develop:public:); echo diff with $(echo $dir|sed -e s:$HOME:\~:); for file in $(for rcsfile in RCS/.??* RCS/*; do echo $rcsfile|cut -d, -f1; done); do echo “>>> $(basename $file):”; colordiff --no-banner $(basename $file) $dir; done’
That way only files I manage with RCS are checked, and I can do that call from any subdirectory of develop_html.
Tuesday, November 15. 2005
# screen -r
Suddenly the Dungeon collapses!! - You die...
#
# strings $(which screen) | egrep [Yy]ou
getpwuid() can’t identify your account!
Cannot open your terminal ‘%s’ - please check.
You are not the owner of %s.
Unfortunatelly you are not its owner.
You feel dead inside.
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version.
You should have received a copy of the GNU General Public License along with this program (see the file COPYING); if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
You can’t run screen on a hardcopy terminal.
You can’t run screen on a terminal that overstrikes.
Suddenly the Dungeon collapses!! - You die...
Really quit and kill all your windows [y/n]
Your termcap does not specify how to change the terminal’s width to %d.
Your termcap does not specify how to change the terminal’s height to %d.
Your termcap does not specify how to change the terminal’s resolution to %dx%d.
Sorry, too late now. Place that in your .screenrc file.
You are %s logging.
’%s’ tries to touch your session, but fails.
The dead screen%s touch%s you. Try ‘screen -wipe’.
You hear %d distant explosion%s.
You may wish for a screen, what do you want?
You see here a good looking screen:
Your inventory:
You regain consciousness.
You must play from a terminal.
The Keystone Kops are after you!
getpwuid() can’t identify your account!
KAABLAMM!!! You triggered a land mine!
[ Passwords don’t match - your armor crumbles away ]
The blast of disintegration whizzes by you!
You add to your scroll of logging named “%s”.
You start writing on your scroll of logging named “%s”.
You don’t seem to have a scroll of logging named “%s”.
You put away your scroll of logging named “%s”.
You cannot escape from window %d!
You no longer sense the watcher’s silence.
You feel like someone is waiting for %d sec. silence...
Your bell is no longer invisible.
Suddenly you can’t see your bell!
You no longer sense the watcher’s presence.
You feel like someone is watching you...
You destroy poor window %d (%s).
You have a sad feeling for a moment...
You escaped the dungeon.
You drop a magic marker - Column %d Line %d
You choke on your food: %d bytes from %s
#
Tuesday, October 18. 2005
Taken from the Gentoo Weekly Newsletter, 17 October 2005:
ext2/3 are the main filesystems for a large amount of users but what a lot of people don’t know is that you can get almost Reiser4 speed out of it without any of the instability they’d associated with Reiser4. One of the great features of ext2/3 is the ability to tune it by adjusting various parameters.
Let’s take some precautions, first of all by finding out if some of those parameter are already enabled, by running
# tune2fs -l /dev/hdXX
(replacing XX with your drive and partition your ext2/3 filesystem resides in). If you don’t see tune2fs in the list then we can enable it, and just in case you do see ‘dir_index’ in ‘Filesystem features’ then you have either enabled it already or it was automatically enabled for you.
You are going to need a Gentoo LiveCD because changing parameters on mounted filesystems can cause problems, so in the interest of safety we are booting off the CD. At the start phase the Gentoo install system is booted into what’s called a “ramdisk” which is where the files needed are put into RAM to be used. mke2fs, tune2fs and other parts of the e2fsprogs package will be present at this stage.
Now let’s turn on the feature with
# tune2fs -O dir_index /dev/hdXX
Do a filesystem check with
# e2fsck -D /dev/hdXX
Do that on any ext2 or ext3 partition and then reboot. You should notice the difference straight away.
Thursday, October 13. 2005
# strings /lib/modules/2.4.20-4GB/FastTrak.o | \
> grep fasttrak_ioctl | uniq
fasttrak_ioctl not support the fun (%#x).
fasttrak_ioctl: Drive not exist.
#
Wednesday, October 12. 2005
It was more complicated than I thought, but it finally was and therefore is possible to move a system from (Software-)RAID-1 using 2 disks to (Software-)RAID-5 using 3 disks without the help of an additional disk during transfer.
Some things I had to keep in mind:
- One harddisk (say, hda) has to be excluded from the RAID-1, i.e. it must be marked as failed. Otherwise the array would automatically get re-assembled at boot time, as the partitions are still flagged as type 0xFD (“Linux RAID autodetect”). The boot manager needs a new entry to boot from this one. The /etc/fstab on hda needs to be modified not to mount the md-devices, but the hda-devices only.
- Using an additional PCI ATA-controller, it appears as SCSI boot device in the BIOS. If hda is hanged over to this one, make the SCSI device the first to boot from. The kernel needs support for the controller’s chipset compiled in. Note that the devices on the PCI ATA-controller appear as hd[a-d], and those on the mainboard’s controller come afterwards!
- It is then possible to create a degraded RAID-5 with the two other disks:
# mkraid --dangerous-no-resync --really-force /dev/md1
RAID-5 knows the two states ‘dirty’ (i.e. up and running) and ‘clean’ (right before shutdown). RAID-5 does not re-assemble automatically at boot time and ‘raidstart’ fails if the array had not been marked as ‘clean’ before. You need mdadm to mark the array as clean for the first time:
# mdadm --stop /dev/md1
# mdadm --assemble /dev/md1 /dev/hdb2 /dev/hde2
- As in my case the count of the md-devices now has decreased from 8 to 4, I had a problem with the “Linux RAID autodetect” partitions on hda - They still try to reassemble themselves at boot time as /dev/mdx for x>3! Therefore, I had to use those automatically detected md-devices instead of the pure hda-devices in the /etc/fstab of hda, although they contained the hda-devices only. But that was not consistent: Booting from a Linux live-CD, the numbering of the md-devices changed its order *forever*, i.e. the changed order remained even after booting from the harddisks again!
To handle that problem I started freshly with a different strategy: I duplicated the partitioning of hda to the other two disks and recreated the original RAID-1 arrays there. Then I could do a (backup) sync from hda to the RAID-1 devices. After rebooting from that RAID, I flagged the partitions of hda as ordinary Linux partitions - The data even remained intact! Rebooting from hda as root, there was no more autodetection of the hda partitions and I could create the RAID-5 with the other two disks as mentioned above.
After that I could do the usual mounting, rsync’ing and dual booting, praying that no disk fails right in that “degraded array phase”. As everything seemed to work, I repartitioned hda and raidhotadd’ed it to the running system. The sync for the 147GB array took about 90 minutes.
Wednesday, September 14. 2005
Whenever sendmail has to deliver mails to other hosts which cannot be reached at that time, the messages are kept in the queue and are marked as “Deferred: Connection timed out”. Although the other hosts could be reached again and you want to tell sendmail to flush the mail queue, the command
sendmail -q -v
does not really try to reconnect to these hosts and still assumes that the connection timed out. The reason is that the hoststatus is cached, per default for a period of 30 minutes. Using
sendmail -OTimeout.hoststatus=0m -q -v
you can re-run the mail queue and force sendmail to reconnect to the hosts. You may want to define an alias for that, say, ‘sendmail-flush-timeouts’.
You can set further options in /etc/sendmail.cf.
Tuesday, August 30. 2005
I successfully stitched together my first panorama pictures on GNU/Linux. I used the GUI frontend hugin, which itself uses autopano-sift for automatic detection of mapping points. For the actual stitching process I used enblend, but not from within hugin, as there currently is no possibility to watch it progressing. This tutorial helped me doing my first steps, more tutorials are available on hugin’s website.
My first try was on a series of 3 pictures of a rainbow above Vienna, Austria:
Next, I created a panorama picture of a mountain view consisting of 8 pictures, which I took last october near Kitzbühel in Tyrol, Austria:
Installation of these tools was quite easy, as I use a distribution which includes such cutting-edge multimedia programs in its package tree: Gentoo Linux.
Tuesday, July 26. 2005
If RCS is used separately from CVS (e.g. for system configuration management), I sometimes want to know whether there are any uncommitted changes pending. Here’s my bash alias to get an overview: alias rcschanges=’for file in $(for rcsfile in RCS/.??* RCS/*; do echo $rcsfile|cut -d, -f1; done); do [ -f “$(basename $file)” ] && rcsdiff $(basename $file); done’ Maybe you want rcsdiff to be an alias for a home-made rcscolordiff, which itself simply calls rcsdiff $@ | colordiff --no-banner.
|