Accessing a LVM volumes from a foreign OS

A lesson learned: in order to mount an LVM device on another machine or simply another OS (e.g., from within a live cd os, mount the local machine's volumes), the LVM volume group must be exported and then imported. This is done using the vgexport / vgimport commands.

Another requirement, is to have lvm2 package installed (so lvs command actually sees the volumes), and device mapper module should be loaded (dm-mod) or builtin the kernel.

Thanks for Amir who found that out.

By the way, I've recently found the dmsetup command very useful.

bash evilness

I've been trying to read a file in bash, and keep all the lines in a single variable, printing it at once after the loop:


all="EVIL_BASH"
cat /tmp/myfile | while read line; do
all="$all $line"
done
echo $all

However the output was only: EVIL_BASH, instead of having the lines of the /tmp/myfile appended.

WHAT THE HELL?

Because of the PIPE, the whole 'while' loop runs in another subshell. This means that $all outside the loop  is not the same $all from within the loop!

Sounds simply like scoping (as in perl), but a really awkward one. Beware.

Choosing a CMS: any reason NOT to choose Drupal?

While researching the current free CMS software options, I realized that Drupal wins in almost any category: it's intensively developed, has a wide community, lots of plugins, amazing taxonomy extension, etc.

I recommended an organization I volunteer at to swtich to Drupal (they need a major upgrade anyway). After I've said all the good things to convice them, they asked me: "what are the disadvantages of Drupal". Smart question. I wasn't sure what to say. In many Drupal vs. Joomla comparisons, the only Joomla advantage (more or less) was Joomla considered easier to use. From my little experience, it's not true (maybe it was, in earlier versions). A user can easily create content when using FCKEditor and IMCE plugins, and administration is also pretty straightforward.

The ease-of-use issue matters in my particular case, for it's possible that the next admin will be less technology oriented.

What do you think, is Drupal really more difficult to administer? Other reasons to choose something else?

* WordPress is really cool for personal blogs, I believe it's less cool for a more complex organization website.

Windows firewall adventures

At work, I needed to block outgoing IP connections in order to inspect the behavior of our product.

I thought: why not use the native, Windows Firewall for that? Oh. Controlling outgoing connections is not supported by windows firewall (w2k3, at least). lame.

So I went on and searched the net for free windows firewalls. And.. I couldn't find anything good which is really free. So I've started looking for less-free firewalls, and found the Kerio firewall which is a trial version which expires if you don't pay them $$s.

It was pretty good actually, and satisfied my needs.

[30 days later]

Why is this VM so slow?? Remote desktop doesn't work.. After chasing the wrong error message problem, I've tried logging in through the vmware console. Then I've noticed this little balloon on the systray saying something like "Kerio firewall trial has expired; limiting bandwidth to 4kb/sec". OHHH that's just a great attitude!

Local issues

This is not a post of original content, I'm simply linking to interesting things I've read recently.

  1. Israel: Linux-IL mailing list is inspecting some weird phenomenon. Looks like 012 ISP is blocking SSH packets which are  sent abroad.
  2. Hebrew: this feature is too hidden.. Diego explains that how to enable left/right alignment switching by ctrl+shift. (Useful for RTL languages).  The "trick" works for QT, KDE (3+4) apps.

Weird CSS tricks

I was quite surprised to find out these two interesting css "tricks":

  • Data urls: putting the data inside the CSS (inline).
  • CSS sprites: instead of loading many small images (one per item), it's possible to load one big image that contains them all.. then play with the offsets to get the right image.

פוסט ליום השואה: בירקנאו

Birkenau (Aushwitz II)

Auschwitz Birkenau. click to enlarge the photo.

את התמונה הזו צילמתי במסעי לפולין מביה"ס התיכון.

זוהי תמונה של מבני המגורים (מילה עדינה מדי בשביל לתאר את תת התנאים ששררו שם) של מחנה אושוויץ-בירקנאו. זהו מחנה עצום מימדים עם עשרות מבנים מאוד ארוכים, שהיה למעשה מחנה ההשמדה בו הושמד מספר האנשים הגדול ביותר (מעל מיליון).

מבחינתי זהו מקום שמסמל את הרמה השפלה ביותר אליה האדם הגיע.

For the dear English readers: today is Holocaust memorial day in Israel. I've taken this photo in my journey to Poland on year 2000. This is the picture of the barracks of Auschwitz Birkenau, the extermination camp in which the highest number of people were executed: over a million. In my opinion, this place represents the lowest point that human beings have ever reached.

Advantures of CentOS 5.3 upgrade

I've upgraded my home server (which is also a router and an access point) from 5.2 to 5.3. All in all it was pretty flawless. Kudos to the CentOS team! Still, I'll update about few issues I've encountered:

1. Atheros wifi driver: I've been using the madwifi driver until now, which is not a part of the kernel because of licensing issues (contains proprietry firmware I guess). CentOS 5.3 introduced the ath5k driver, which is a free implementation. However, ath5k still doesn't implement "access point" mode, so I had to disable it (renamed  ath5k.ko and ran depmod -a), and reinstall madwifi 0.9.4 instead (simply running make; make install).

2. udev.rules were overwritten, which cleared the changes I've made, in particular the /dev/snd permissions were reverted to CentOS default (no "audio" group, only the device owner can access audio), so I had to re-change the /dev/snd/* file permissions.