Planet Larry

May 27, 2008

Martin Matusiak

kwin leaks memory

Something is very wrong here. Right after starting a KDE session everything looks normal.

But after running for a day we have a different story. I’m assuming this isn’t the expected behavior (if so I didn’t expect it).

This time I specifically took a screenshot to prove it, but I’ve seen it eat up as much as 1.3gb of my memory, which is rather unnerving.

kwin-kde4        4:4.0.4-0ubuntu1

Bug report.

May 27, 2008 01:00 AM :: Utrecht, Netherlands  

May 26, 2008

Jürgen Geuter

Thinkwhack

I was in a project-y mood today and since work was going good all day, I started some work on a little pet-project called "Thinkwhack".

It's somewhat inspired by smack.py but I wanna make it somewhat more flexible and useful.

What it will do is to allow you to have certain action triggered when "whacking" the laptop (if your laptop has a hdaps module which only Thinkpads have I think). Right now it's pretty simple and just plays a sound but it already has a proper systray icon so things should be easy to add there.

I play to give the user the option to play sounds or trigger other options when whacking the machine (maybe tilting also): Hide all the windows on your desktop for example, switch workspaces, run a random script.

The next step will be to get a proper motion detection algorithm in there cause right now it's not that smart, then some proper configuration.

Here is some video footage:


It's not really all that useful I admit but still might turn out to be useful later ;-)

What this definitely will spawn are a few python howtos so it's not in vain.

May 26, 2008 08:49 PM :: Germany  

Jason Jones

Ultrasound For 3rd Child

For the last two children, I've been relatively relaxed with the rest of my life, so I was eagerly awaiting and up-to-date with the happenings of our pregnancy.

This time around, I'm quite busy otherwise, and this ultrasound crept up on me.

I'm also quite amazed at the technology which wraps around the medical field.  At the last portion of the video, you can see our little boy's profile quite clearly.  It's amazing.

Anyway...  I was really excited to hear the heartbeat and see our little guy this time, as I wasn't really thinking much about it until it happened.  Kind of a spiritual occasion.

The video was quite big this time, and I haven't got around to editing videos yet, so the above is the complete ultrasound.

Thanks for watching!

May 26, 2008 03:16 PM :: Utah, USA  

Daniel de Oliveira

menelkir


For those (like me) that are tired of 2.20 and don’t want to install autounmask for any random reason, here’s the list of packages:

sys-apps/hal ~x86
dev-python/pyxf86config ~x86
app-misc/hal-info ~x86
net-wireless/bluez-libs ~x86
media-plugins/gst-plugins-dvb ~x86
media-libs/gst-plugins-bad ~x86
media-plugins/gst-plugins-fluendo-mpegdemux ~x86
media-plugins/gst-plugins-mythtv ~x86
media-libs/gmyth ~x86
gnome-base/gnome ~x86
media-libs/gst-plugins-base ~x86
dev-libs/liboil ~x86
media-libs/gstreamer ~x86
gnome-base/gnome-applets ~x86
dev-libs/glib ~x86
dev-libs/libgweather ~x86
gnome-base/control-center ~x86
gnome-base/gnome-settings-daemon ~x86
gnome-base/gnome-desktop ~x86
gnome-base/libgnomekbd ~x86
x11-wm/metacity ~x86
gnome-extra/fast-user-switch-applet ~x86
gnome-base/gconf ~x86
gnome-extra/gconf-editor ~x86
x11-libs/libwnck ~x86
gnome-base/gnome-panel ~x86
gnome-base/gvfs ~x86
net-libs/libsoup ~x86
gnome-base/gnome-session ~x86
gnome-base/gnome-keyring ~x86
app-editors/gedit ~x86
x11-libs/gtksourceview ~x86
dev-python/pygtksourceview ~x86
gnome-extra/evolution-data-server ~x86
dev-util/gtk-doc-am ~x86
gnome-base/libgnomeui ~x86
gnome-extra/gnome2-user-docs ~x86
gnome-base/gnome-vfs ~x86
gnome-extra/deskbar-applet ~x86
gnome-extra/gucharmap ~x86
gnome-extra/nautilus-cd-burner ~x86
gnome-base/nautilus ~x86
gnome-base/eel ~x86
net-misc/vinagre ~x86
net-libs/gtk-vnc ~x86
gnome-base/gnome-menus ~x86
gnome-extra/gnome-system-monitor ~x86
media-video/totem ~x86
dev-libs/totem-pl-parser ~x86
dev-python/gdata ~x86
media-plugins/gst-plugins-meta ~x86
gnome-base/gdm ~x86
sys-auth/pambase ~x86
sys-libs/pam ~x86
x11-themes/gnome-themes ~x86
media-sound/sound-juicer ~x86
gnome-extra/bug-buddy ~x86
media-gfx/eog ~x86
mail-client/evolution ~x86
gnome-extra/gtkhtml ~x86
app-arch/file-roller ~x86
net-analyzer/gnome-nettool ~x86
app-crypt/seahorse ~x86
x11-terms/gnome-terminal ~x86
x11-themes/gnome-icon-theme ~x86
gnome-extra/swfdec-gnome ~x86
media-libs/swfdec ~x86
gnome-extra/zenity ~x86
gnome-extra/yelp ~x86
app-text/rarian ~x86
gnome-extra/gnome-games ~x86
gnome-base/libgnome ~x86
x11-libs/pango ~x86
x11-libs/gtk+ ~x86
net-misc/vino ~x86
net-im/ekiga ~x86
gnome-extra/gnome-power-manager ~x86
www-client/epiphany ~x86
dev-python/gnome-python-desktop ~x86
gnome-base/libgtop ~x86
gnome-base/gnome-volume-manager ~x86
gnome-extra/gnome-screensaver ~x86
gnome-base/libbonobo ~x86
gnome-base/librsvg ~x86
app-misc/tomboy ~x86
dev-dotnet/dbus-sharp ~x86
dev-dotnet/mono-addins ~x86
dev-dotnet/dbus-glib-sharp ~x86
gnome-extra/evolution-webcal ~x86
x11-misc/alacarte ~x86
dev-libs/atk ~x86
gnome-base/libbonoboui ~x86
gnome-extra/gnome-media ~x86
app-text/evince ~x86
app-text/libspectre ~x86
gnome-extra/gcalctool ~x86
app-admin/sabayon ~x86
x11-themes/gtk-engines ~x86
x11-themes/gnome-backgrounds ~x86

May 26, 2008 08:29 AM :: São Paulo, Brazil  

Brian Carper

Emacs undo is horrible

Emacs has a, well, "unique" undo system. It only has undo, no redo. When you undo something, the act of undoing is added as itself onto a stack of undo actions. When you've un-done enough things, you do "something, like move the cursor, and that breaks the chain. From there if you undo again, you will traverse back over the undo actions you just did.

This is supposedly powerful. It does help with the following situation:

  1. Type something.
  2. Type something #2.
  3. Type something #3.
  4. Undo undo undo.
  5. Type something #4.

In most programs once you reach step 4, you can redo to get back to the text you just undid But once you reach step 5, the first three things you typed are lost forever. You've gone back in time and changed history, eradicating the old future and replacing it with a new one. You can never get back to the old future. Emacs undo, on the other hand, where undo actions are just like any other actions and pushed onto a stack of actions, does let you undo back first three things you typed.

However in practice this doesn't work so well. This site has a nice quote:

“By [undoing] repeatedly, you can gradually work your way back to a point before your mistake. This is convenient if you’ve made a mistake four or five commands back. It is marginally useful if you’ve made a mistake twenty or thirty characters back. And it is completely useless if your mistake is ancient history.” - Learning GNU Emacs (page 42)

The problem being, supposing you undo 20 times, and break the chain (by moving the cursor for example), if you then decide to undo one step FURTHER back, you have to undo all 20 of your previous undos, undo 20 more times, then undo once more. Eventually you end up feeling like you're going up and down a roller coaster of undos.

If you hate this, which you probably do, you could use redo mode, which gimps up Emacs undo/redo to be like any other program's, i.e. you get the same behavior as Microsoft Notepad. (Although when I tried it, it was buggy as heck, failing to undo my actions properly, mangling text from different lines together and whatnot.)

Vim's undo system on the other hand is far better and equally powerful. You have a standard undo / redo option via u and CTRL-R. You also have a second completely different way to undo: you can "go back in time". In the above example, Vim will create two undo "branches" and you can jump from one to the other even if you undo and "break the chain" by typing something new.

Doing :undol lists the branches, in a somewhat confusing format. But you can just pound g- and g+ to go to older / newer text states, or use :earlier with a human-readable time (say, 10s or 5m) and it will take you to that point. These will get you all the power of Emacs' undo stack, with none of the pain or confusion. See also :h undo-two-ways.

This is one of many instances where Vim wins, hands-down. Vim's undo system isn't as reprogrammable as Emacs, but it's so powerful and so perfectly what you'd want that it doesn't matter. This is beautifully typical of Vim. I don't have a year to figure out all the nooks and crannies and edge cases and idiosyncrasies of Emacs undo system, let alone the time it'd take to write a custom, crusty elisp script to buggily re-implement it.

Being an "extensible text editor" doesn't help much when such basic functionality is so broken. Unless you want to play your undo history back like a movie, in rainbow colors, which I don't. I want undo/redo that works.

May 26, 2008 06:54 AM :: Pennsylvania, USA  

May 25, 2008

Zeth

Is Django stable?

I have a friend and fellow member of the Python West Midlands group. Whenever, someone mentions Django, he asks the person "but is it stable?". This has been repeated so much that is has become a local in-joke. However, lets take the question seriously.

To explore this further, we need to ask what does stable mean? I.e. can we replace the word "stable" with something else to provide some more meaningful questions:

  • Can Django handle traffic loads?
  • Is Django actively maintained, i.e. are bugs being fixed?
  • Will the Django API evolve in the most backwards compatible way possible?

Lets take these one at a time.

Traffic loads

Django's frequently-asked-questions says:

Is Django stable?

Yes. World Online has been using Django for more than three years. Sites built on Django have weathered traffic spikes of over one million hits an hour and a number of Slashdottings. Yes, it's quite stable.

The first sentence is a testimony, useful but not a direct answer. In the second sentence, 'stable' is used as in 'strong table', i.e. Django can handle a heavy load, (i.e traffic rather than physical objects).

It goes on to explain that Django has a "shared-nothing" approach, i.e. you can throw more servers directly at whatever bottleneck you have. If the database is the database, then you can add more hardware to the databases, if it is images the are the problem, you can add more hardware to the media servers, and so on.

Is Django maintained?

The next question is whether Django is actively maintained. One simplistic measure is to look at the bug database and see what is going on. In what follows I use "ticket" in the broadest sense, i.e. not just a confirmed code error, but also enhancement requests, invalid bugs and so on.

At time of writing, Django has 1092 open tickets, out of which, 311 are new and unreviewed, I would guess that half of these are valid problems, and half are not.

Meaning the other 781 open tickets have reviewed by someone at least once. Some have been triaged and are waiting to be worked on, some are already being worked on, some will have been closed wrongly and reopened.

In the last three years, 6047 Django tickets have been closed, we can break these down further:

Number Closed As
3348 "fixed"
867 "invalid"
809 "duplicates"
797 "wontfix"
226 "worksforme"

A ticket being fixed is very useful, but a ticket being found to be not a problem or not Django's problem is still useful information, marginally useful perhaps, but still useful if you have that issue.

So Django is three years old, which is pretty new. In that time, they have closed 85% of tickets, while 10.6% of tickets are open but have been read, 4.4% are open and have never been read.

This seems competitive with similar open-source web frameworks:

Framework Years Tickets % closed
Django 3 7139 82
Pylons 2 444 90
Symphony 3 3612 82
Turbogears 3 1840 85
Zope2 7 2352 81
Zope3 6 886 76

The 'years' column represents how far the ticket tracker data goes back for, not necessarily the age of the project. There may also be sampling errors caused by differences in the ticket tracker software, or a project might have had a clear-out of closed tickets.

On the whole, it is all impressive stuff, all six open-source projects seem to be on top of things. One nice thing about Pylons is that, at the time of writing, it appears that all of the open tickets have been reviewed to some extent. Some other projects such as Django would benefit from more a few more triagers to review new tickets.

API

This is perhaps what my friend meant, i.e. if one makes a web application using Django in 2008, how much pain will it be for it to still work in 2013?

There is of course a balance to be struck between backwards compatibility on the one hand, and keeping the framework modern enough for meet the needs of today's web applications. It is a difficult balance.

As Joel Spolsky points out in How-Microsoft-Lost-the-API-War, if you change your API such that users of it have to learn new things or change software in any significant way, the risk is that the users of the API will instead decide this moment to jump to the next big thing.

On the other side, changing too slow is also a risk. Apart from people like me when I am feeling retro, does any one really create web applications of any complexity using only the CGI support in the Python standard library? The API has not changed much in the last half-decade which is good, but the standard Python CGI is lacking in any pre-built features so you have to do all the repetitive boilerplate yourself. Also CGI generally has no persistence or caching meaning that it is far more processor intensive.

I don't want to be mean, but all the cool things that people are actually using to make web applications in 2008, such as SQLAlchemy, Django and Pylons are outside the standard library and have very little chance of merging with the standard library. I am not going to mention Python Server Pages, (oh I did - d'oh).

So the balance between backwards compatibility and providing modern features that people want is the life-or-death question for a larger toolkit such as a web framework.

Django provide their answer in a webpage called API-stability, in this document, they explain what seems a reasonable compromise between backwards compatibility, and changes that are required to keep the framework both modern and secure.

Of course, the document is mere policy/propaganda and the real issue is whether they stick to it. However, Django is free software/open source and it is being used by a large number of people. If the Django developers change the API unnecessarily, people will vote with their feet and not upgrade and/or fork the API.

Django Development

So is Django stable? Well given what we looked at above, we can at least say that it does not seem any less stable than any other similar toolkit.

The philosophy of a traditional software application, often goes like this: there is a cycle, starting with the development window, followed by a code freeze, followed by stabilisation, followed by a release, followed by a new cycle.

The current fashion in the Django community is to develop sites using the SVN version of Django. This philosophy is that the mainline branch should be usable at all times, and the latest SVN revision is likely to be less buggy and more secure than previous revisions.

This approach is somewhat all or nothing; you decide yourself to become a web developer using Django and so commit yourself with keeping up with the state-of-the-art. Perhaps this is the only way for a toolkit of such complexity. This investment is perhaps less of an issue if Django becomes the mainstream way to make a web application in Python.

The Django developers do however plan on an eventual 1.0 release, their plans are nicely summarised on a wiki page called VersionOneFeatures. At Version 1.0, the toolkit will (in theory) have a fixed point. After that they plan to do the Pythonic thing of not breaking the API in one step. So if they want to introduce an incompatible change that requires code changes to the user's web application, they will provide a warning in the next release, and then make the incompatible change in the release after.

However, I imagine most people will continue tracking SVN. Since a person needs a certain level of technical skills to use Django at all, then they probably have enough skill to handle some minor API changes.

Stability is a process. Complex software is never finished, it just runs of money or becomes obsolete.

Your turn. What do you think? I would love to know your opinions?

Discuss this post - Leave a comment

May 25, 2008 09:07 PM :: West Midlands, England  

Dan Ballard

Turning your laptop into a wired to wireless router for your wirelessly challenged friends

Say you're at a party and the only internet is a wireless router and for whatever reason, no one can plug into it. Wireless internet only. You with your fancy laptop are sitting pretty and this is just fine. They your friend shows up lugging his clunky old desktop that only has an ethernet port for internet connectivity. Is he out of luck? Turns out not, because you an come to the rescue!

It's really easy, especially with Ubuntu.

To start with, you need to be a router, so you need firewall software that can do NAT (network address translation). This is part kernel side (NAT and iptables options enabled and modules loaded) and part user space side, in the form of the program 'iptables', so make sure it is installed, which it is by default on Ubuntu (I think).

Now all you really need to do is add two routing rules, one says anything coming on the ethernet port should go through the NAT procedure, which basically means it's IP headers are tweaked to make it look like they originated from your computer and then you send them along to the internet. The second rule helps facilitate this (I'm a little less sure what it does, but it's needed).

In this case we are assuming the interface eth0 is the wired network and eth1 is the wireless. Change as required.

iptables --table nat --append POSTROUTING --out-interface eth1 -j MASQUERADE
iptables --append FORWARD --in-interface eth0 -j ACCEPT

Next you just need to tell the kernel port forwarding should be turned on, and you can do this through the wonderful /proc filesystem.

echo 1  > /proc/sys/net/ipv4/ip_forward

Now you're pretty much ready to go. Connect to the wireless, presumably though NetworkManager or your wireless toll of choice. Then enable the wired network manually.

ifconfig eth0 up 192.168.1.1

This turns on eth0 with a local network address of 192.168.1.1. Now plug your friend's computer into the ehternet port with a crossover ethernet cable or into a hub and then the hub into you with regular ethernet cable and have them manually pick an address on 192.168.1.* (or whatever local network you chose, it doesn't matter) and set you (192.168.1.1) as the gateway router.

If this is a little much for them or they are running an OS that makes this non trivial, than its really another easy step for you to set up a DHCP server and do all the configuration for them :).

So install dhcpd, on Ubuntu it's 'dhcp3-server', on Gentoo I think it's just 'dhcpd'.

Now we have to configure it. We have to tell it the gateway router, which is us (192.168.1.1), the nameservers (the servers in /etc/resolv.conf) and the pool of IPs to use and what interface/network to listen on.

Open the config file, on Ubuntu '/etc/dhcp3dhcpd.conf'.

The relevant parts are as follows

...
# servers in /etc/resolv.conf
option domain-name-servers 192.168.0.1;

...

# the local network you created
subnet 192.168.1.0 netmask 255.255.255.0 {
        #IPs free to assign
        range 192.168.1.100 192.168.1.200;
        #your computer, the router
        option routers 192.168.1.1;
}

And that's it. (Re)Start the server

/etc/init.d/dhcp3-server restart

And you are now serving all the information your friend's computer will need to automatically connect properly.

They should now be online once they restart their internet connection.

One annoying thing about Ubuntu vs Gentoo is that on Ubuntu, the init system is a bit more kludgy and old fashioned. Any server software installed is automatically configured to start at boot time, forever, which in this case isn't what you want. You only want the dhcpd server to run very rarely, at parties, the rest of the time it's a waste. So we need to turn it's auto starting off. Apparently the /ubuntu init system barely supports this, we have to force it.

update-rc.d -f dhcp3-server remove

Now just turn it on when you need with its init.d file.

May 25, 2008 08:23 PM :: British Columbia, Canada  

Daniel de Oliveira

menelkir


LVM (Logical Volume Manager) is a great piece of software which allow you to deal with Logical Volumes. Using LVM, you are able to extend/reduce your filesystems which is pretty handy when you need more space.

Let’s get the easy way to do that.

Obs.: My post about LVM on ubuntu have a lot of info, so I’ll paste the important info about LVM here

What is LVM?

LVM (Logical Volume Manager) is a great piece of software which allow you to deal with Logical Volumes. Using LVM, you are able to extend/reduce your filesystems which is pretty handy when you need more space.

A lot of distributions support out of the box in installer. Unfortunately, Hardy Heron doesn’t offer this on the Desktop Install CD.

What can I do with LVM?

* Resize volume groups online by absorbing new physical volumes (PV) or ejecting existing ones.
* Resize logical volumes online by concatenating extents onto them or truncating extents from them.
* Create read-only snapshots of logical volumes (LVM1).
* Create read-write snapshots of logical volumes (LVM2).
* Stripe whole or parts of logical volumes across multiple PVs, in a fashion similar to RAID0.
* Mirror whole or parts of logical volumes, in a fashion similar to RAID1.
* Move online logical volumes between PVs.
* Split or merge volume groups in situ (as long as no logical volumes span the split). This can be useful when migrating whole logical volumes to or from offline storage.

What can’t I do with LVM?

* LVM does not provide parity-based redundancy across LVs, as with RAID4, RAID5 or RAID6. This functionality is instead provided by Linux metadisks, which can be used as LVM physical volumes.
* Converting regular filesystems into LVM filesystems online (you also can copy the stuff to a logical volume).

Implementation

LVM keeps a metadata header at the start of every PV, each of which is uniquely identified by a UUID. Each PV’s header is a complete copy of the entire volume group’s layout, including the UUIDs of all other PV, the UUIDs of all logical volumes and an allocation map of PEs to LEs. This simplifies data recovery in the event of PV loss.

In the 2.6-series Linux kernels, the LVM is implemented in terms of the device mapper, a simple block-level scheme for creating virtual block devices and mapping their contents onto other block devices. This minimizes the amount of relatively hard-to-debug kernel code needed to implement the LVM. It also allows its I/O redirection services to be shared with other volume managers (such as EVMS). Any LVM-specific code is pushed out into its user-space tools, which merely manipulate these mappings and reconstruct their state from on-disk metadata upon each invocation.

To bring a volume group online, the “vgchange” tool:

1. Searches for PVs in all available block devices.
2. Parses the metadata header in each PV found.
3. Computes the layouts of all visible volume groups.
4. Loops over each logical volume in the volume group to be brought online and:
1. Checks if the logical volume to be brought online has all its PVs visible.
2. Creates a new, empty device mapping.
3. Maps it (with the “linear” target) onto the data areas of the PVs the logical volume belongs to.

To move an online logical volume between PVs, the “pvmove” tool:

1. Creates a new, empty device mapping for the destination.
2. Applies the “mirror” target to the original and destination maps. The kernel will start the mirror in “degraded” mode and begin copying data from the original to the destination to bring it into sync.
3. Replaces the original mapping with the destination when the mirror comes into sync, then destroys the original.

These device mapper operations take place transparently, without applications or filesystems being aware that their underlying storage is moving.

How can I learn more?

http://en.wikipedia.org/wiki/Lvm
http://tldp.org/HOWTO/LVM-HOWTO
http://sourceware.org/lvm2/
http://www.gentoo.org/doc/en/lvm2.xml

Requirements

* Gentoo 2007.0 livecd/livedvd or any other distribution livecd able to load lvm modules and applications.

Preparing

1) Start dm-mod (if not started yet)

modprobe dm-mod

3) Redetect disks and/or start lvm stuff.

vgscan
vgchange -a -y

Preparing Disks

Let’s create a boot partition outside of LVM and all the rest for LVM (120Mb for /boot in 2*40Gb hardisks).


$ sudo fdisk /dev/sda

The number of cylinders for this disk is set to 4865.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
(e.g., DOS FDISK, OS/2 FDISK)

Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-4865, default 1):
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1033-9729, default 9729): +120M

Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 2
First cylinder (17-4865, default 17):
Using default value 17
Last cylinder or +size or +sizeM or +sizeK (17-4865, default 4865):
Using default value 4865

Command (m for help):t
Partition number (1-4): 2
Hex code (type L to list codes): 8e

Command (m for help):w
The partition table has been altered!

Calling ioctl() to re-read partition table.

WARNING: Re-reading the partition table failed with error 16: Device or resource busy.
The kernel still uses the old table.
The new table will be used at the next reboot.
Syncing disks.

$ sudo fdisk /dev/sdb

The number of cylinders for this disk is set to 4998.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
(e.g., DOS FDISK, OS/2 FDISK)

Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-4998, default 1):
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-4998, default 4998):
Using default value 4998

Command (m for help):t
Partition number (1-4): 2
Hex code (type L to list codes): 8e

Formating Partitions

1) Format /boot partition
$ sudo mke2fs /dev/sda1

2) Create physical volumes for LVM

$ sudo pvcreate /dev/sda2
$ sudo pvcreate /dev/sdb1

3) Create volume group (I’ll use rootvg, like AIX)…

$ sudo vgcreate rootvg /dev/sda2

4) …then add the second physical volume

$ sudo vgextend rootvg /dev/sdb1

5) Create the logical volumes.

$ sudo lvcreate -n rootlv -L 15G rootvg
$ sudo lvcreate -n varlv -L 5G rootvg
$ sudo lvcreate -n homelv -L 30G rootvg
$ sudo lvcreate -n usrlv -L 15G rootvg

6) Now you’re able to *see* this logical volumes in Ubuntu Installer.

7) After installation ends, don’t reboot yet. Mount your logical volumes, proc and dev.

$ sudo mount /dev/rootvg/rootvg-rootlv /mnt
$ sudo mount /dev/rootvg/rootvg-usrlv /mnt/usr
$ sudo mount /dev/rootvg/rootvg-varlv /mnt/var
$ sudo mount /dev/rootvg/rootvg-homelv /mnt/home
$ sudo mount -t proc proc /mnt/proc
$ sudo mount -o bind /dev /mnt/dev

You know the rest… and don’t forget to put LVM support on kernel.

May 25, 2008 03:10 PM :: São Paulo, Brazil  

Zeth

Is Django stable?

I have a friend and fellow member of the Python West Midlands group. Whenever, someone mentions Django, he asks the person "but is it stable?". This has been repeated so much that is has become a local in-joke. However, lets take the question seriously.

To explore this further, we need to ask what does stable mean? I.e. can we replace the word "stable" with something else to provide some more meaningful questions:

  • Can Django handle traffic loads?
  • Is Django actively maintained, i.e. are bugs being fixed?
  • Will the Django API evolve in the most backwards compatible way possible?

Lets take these one at a time.

Traffic loads

Django's frequently-asked-questions says:

Is Django stable?

Yes. World Online has been using Django for more than three years. Sites built on Django have weathered traffic spikes of over one million hits an hour and a number of Slashdottings. Yes, it's quite stable.

The first sentence is a testimony, useful but not a direct answer. In the second sentence, 'stable' is used as in 'strong table', i.e. Django can handle a heavy load, (i.e traffic rather than physical objects).

It goes on to explain that Django has a "shared-nothing" approach, i.e. you can throw more servers directly at whatever bottleneck you have. If the database is the database, then you can add more hardware to the databases, if it is images the are the problem, you can add more hardware to the media servers, and so on.

Is Django maintained?

The next question is whether Django is actively maintained. One simplistic measure is to look at the bug database and see what is going on. In what follows I use "ticket" in the broadest sense, i.e. not just a confirmed code error, but also enhancement requests, invalid bugs and so on.

At time of writing, Django has 1092 open tickets, out of which, 311 are new and unreviewed, I would guess that half of these are valid problems, and half are not.

Meaning the other 781 open tickets have reviewed by someone at least once. Some have been triaged and are waiting to be worked on, some are already being worked on, some will have been closed wrongly and reopened.

In the last three years, 6047 Django tickets have been closed, we can break these down further:

Number Closed As
3348 "fixed"
867 "invalid"
809 "duplicates"
797 "wontfix"
226 "worksforme"

A ticket being fixed is very useful, but a ticket being found to be not a problem or not Django's problem is still useful information, marginally useful perhaps, but still useful if you have that issue.

So Django is three years old, which is pretty new. In that time, they have closed 85% of tickets, while 10.6% of tickets are open but have been read, 4.4% are open and have never been read.

This seems competitive with similar open-source web frameworks:

Framework Years Tickets % closed
Django 3 7139 82
Pylons 2 444 90
Symphony 3 3612 82
Turbogears 3 1840 85
Zope2 7 2352 81
Zope3 6 886 76

The 'years' column represents how far the ticket tracker data goes back for, not necessarily the age of the project. There may also be sampling errors caused by differences in the ticket tracker software, or a project might have had a clear-out of closed tickets.

On the whole, it is all impressive stuff. One nice thing about Pylons is that is seems that at the time of writing, it appears that all of the open tickets have been reviewed to some extent. Some other projects such as Django would benefit from more a few more triagers.

API

This is perhaps what my friend meant, i.e. if one makes a web application using Django in 2008, how much pain will it be for it to still work in 2013?

There is of course a balance to be struck between backwards compatibility on the one hand, and keeping the framework modern enough for meet the needs of today's web applications. It is a difficult balance.

As Joel Spolsky points out in How-Microsoft-Lost-the-API-War, if you change your API such that users of it have to learn new things or change software in any significant way, the risk is that the users of the API will instead decide this moment to jump to the next big thing.

On the other side, changing too slow is also a risk. Apart from people like me when I am feeling retro, does any one really create web applications of any complexity using only the CGI support in the Python standard library? The API has not changed much in the last half-decade which is good, but the standard Python CGI is lacking in any pre-built features so you have to do all the repetitive boilerplate yourself. Also CGI generally has no persistence or caching meaning that it is far more processor intensive.

I don't want to be mean, but all the cool things that people are actually using to make web applications in 2008, such as SQLAlchemy, Django and Pylons are outside the standard library and have very little chance of merging with the standard library. I am not going to mention Python Server Pages, (oh I did - d'oh).

So the balance between backwards compatibility and providing modern features that people want is the life-or-death question for a larger toolkit such as a web framework.

Django do themselves provide their answer in a webpage called API-stability, in this document, they explain what seems a reasonable compromise between backwards compatibility, and changes that are required to keep the framework both modern and secure.

Of course, the document is mere policy/propaganda and the real issue is whether they stick to it. However, Django is free software/open source and it is being used by a large number of people. If the Django developers change the API unnecessarily, people will vote with their feet and not upgrade and/or fork the API.

Django Development

So is Django stable? Well given what we looked at above, we can at least say that it does not seem any less stable than any other similar toolkit.

The philosophy of a traditional software application, often goes like this: there is a cycle, starting with the development window, followed by a code freeze, followed by stabilisation, followed by a release, followed by a new cycle.

The current fashion in the Django community is to develop sites using the SVN version of Django. This philosophy is that the mainline branch should be usable at all times, and the latest branch is likely to be less buggy and more secure than previous revisions.

This approach is somewhat all or nothing; you decide yourself to become a web developer using Django and so commit yourself with keeping up with the state-of-the-art. Perhaps this is the only way for a toolkit of such complexity. This investment is perhaps less of an issue if Django becomes the mainstream way to make a web application in Python.

The Django developers do however plan on an eventual 1.0 release, their plans are nicely summarised on a wiki page called VersionOneFeatures. At Version 1.0, the toolkit will (in theory) have a fixed point. After that they plan to do the Pythonic thing of not breaking the API in one step. So if they want to introduce an incompatible change that requires code changes to the user's web application, they will provide a warning in the next release, and then make the break the code in the release after.

However, I imagine most people will continue tracking SVN. Since a person needs a certain level of technical skills to use Django at all, then they probably have enough skill to handle some minor API changes.

Stability is a process. Complex software is never finished, it just runs of money or becomes obsolete.

Your turn. What do you think? I would love to know your opinions?

Discuss this post - Leave a comment

May 25, 2008 03:07 PM :: West Midlands, England  

Patrick Nagel

GPRS with Nokia 9300i, Gentoo and China mobile (2, OpenRC)

Since I moved my laptop to the new OpenRC init framework, my GPRS connection stopped working. At first I didn’t know what needed to be changed, but after having a careful look at /usr/share/doc/openrc/net.example and adjusting the proposed ppp chat script, I got it up and running again. Here is my configuration:

### GPRS ###

config_ppp0=( “ppp” )

link_ppp0=”/dev/rfcomm0″

pppd_ppp0=(
“noauth” # Do not require the peer to authenticate itself
“debug”
“local” # Ignore carrier detect signal from the modem

“defaultroute” # Make this PPP interface the default route
“usepeerdns” # Use the DNS settings provided by PPP

“lcp-echo-interval 15″ # Send a LCP echo every 15 seconds
“lcp-echo-failure 3″ # Make peer dead after 3 consective
# echo-requests

“lock” # Lock serial port
“115200″ # Set the serial port baud rate
“crtscts” # Enable hardware flow control
)

chat_ppp0=”
ABORT BUSY
ABORT ERROR
ABORT ‘NO ANSWER’
ABORT ‘NO CARRIER’
ABORT ‘NO DIALTONE’
ABORT ‘Invalid Login’
ABORT ‘Login incorrect’
” AT
TIMEOUT 5
OK ‘ATH’
OK ‘ATE1′
OK ‘AT+CGDCONT=1,\”IP\”,\”cmnet\”‘
OK ‘ATD*99#’
TIMEOUT 60
CONNECT ”
TIMEOUT 5
~– ”

May 25, 2008 03:18 AM :: Shanghai, China  

Jason Jones

New Camera, Nikon Cool Pix S210

Not much more to say, other than what was in the video.  I'm trying now to work out the best bitrate to video quality trade-off with FLV files.

I plan on having a bit of fun with this new camera in the ensuing weeks.

I'm amazed at the technology with which these new cameras / camcorders are built.

May 25, 2008 12:54 AM :: Utah, USA  

May 24, 2008

Jürgen Geuter

Multi-Pointer X

The X-Server will be getting multipointer support soon (I guess in Xorg 7.5). That looks like it might allow some awesome stuff. Using more that one mouse for example might change the way that we work with 3D design tools or graphics software. Looking forward to playing with it!

May 24, 2008 10:18 PM :: Germany  

Dieter Plaetinck

Announcing the Netlog Developer Pages

At work, we've setup the Netlog Developer Pages

It is the place where you can/will find all information around our OpenSocial implementation, our own API, skin development, sample code and so on.
We've also launched a group where you can communicate with fellow developers and Netlog employees.
The page also features a blog where you can follow what is going on in the Netlog Tech team.

read more

May 24, 2008 10:39 AM :: Belgium  

May 23, 2008

Jason Jones

Job Security

I've been pondering on how I am to write about this without seeming haughty or prideful, because quite honestly, I feel nothing more than blessed beyond words.

When I was offered this job, it just felt right.  Six months previous to my being offered this job, I was offered another job in SLC which seemed right in every aspect but the fact that it was in SLC.  I decided I'd take it, but after making the decision, it did not feel right.  It just didn't jive with my mojo, ya know?

Well...  I've been at Nature's Way now for almost a full year.

We've got a new server, a new website, a new sales reporting system, and I'm working on getting the website admin system up.  Life is good.

If you didn't get it in the video, might I say that today two of the three owners of this  multi-million (possibly billion) dollar company came to my office to tell me what a great idea it was to hire me.

First, the CEO came in smiling and said something to the effect of, "In the executive meeting today, lots of good words were said about you."

Then, just a couple of minute ago, the CFO came in and he, being a bit more of a relaxed guy said, "Scott (the President of Marketing) said, 'Hiring that guy was the best decision....  He has saved us so much money.'"

What wonderful words to hear in this time of economic trouble in the USA.

Anyway...  I just thought I'd write this down.  I almost wanna celebrate.

Also, for those of you who don't know, Nature's Way was a 100% microsoft shop.  The website was served on an IIS server running Windows Server 2003, using ASP and MSSQL as the scripting and database technology.

It now uses Gentoo Linux as the OS, running Apache as the server.  The scripting language is PHP and it's connected to a Postgres database.  All open-source, 100% free software.

Yeah, I'd say we're saving a load of money from the change.

Thank you, open source technology.  You're paying my bills quite well these days.

Maybe I should ask my boss if he could throw in a turbo-charger for my Mustang as a "thank you." *wink wink*

May 23, 2008 04:36 PM :: Utah, USA  

Jürgen Geuter

Linux Sucks-Rules-O-Meter

To cheer up all the Gentoo users I give you a like to the result of the Linux Sucks-Rules-O-Meter: Gentoo is by far the one that "rules" the most and most others "suck" more.

It's just the result of a perl script searching altavista for "DistroX sucks" and "DistroX rules" but still it's funny to see the results. Of course Ubuntu gets bad results because of its mindshare and because it's a beginner distribution that has many people trying it out and bashing it when it does not work but I had not thought that SuSe would be that close to Ubuntu. Nothing serious but still fun.

The sourcecode is free and you can run your own Sucks-Rules-O-Meters with it (if you can bear to fiddle around with Perl).

May 23, 2008 02:18 PM :: Germany  

Jens Mayer

MUTO - Bewegende Wandmalerei

Ich habe nicht die geringste Ahnung, wie oft der Auslöser hier gedrückt werden musste oder wie lange der gesamte Schaffensprozess an sich gedauert haben mag - es ist das Ergebnis, welches mir bekannt ist und sich mit Superlativen gerecht bewerten lässt. “MUTO - A wall-painted Animation” von BLU aus Buenos Aires. Atemberaubend.

Via Hannes Blog.

May 23, 2008 01:08 PM :: Baden-Wuerttemberg, Germany  

Zeth

Firefox is your nanny?

Extensions are cool

Extension frameworks are a good way to add new functionality to large applications that are messy to alter directly, they also help to quickly add functionality now, without having to wait six months for the next release.

The whole fun of extensions is that you can make your own and download random ones from the Internet, try them out for a bit, remove the ones you don't like, share the ones you do.

This of course implies two things. Firstly, that the extension interface is well thought out so that a badly written extension does not crash or unexpectedly interfere with the main application. Secondly, that the user who installs the application is adept enough to know what they are doing.

The killer feature of Firefox has been its extension framework, having hundreds or even thousands of useful extensions is what has enabled Firefox to break into the IE-dominated browser market where so many have failed.

All your extensions belong to us

Firefox 3 has changed many things compared to previous versions. One unexpected change is that the extension framework has been locked down.

I have mixed feelings about this. I understand there is a balance between on the one hand, fun and spontaneity, and on the other hand, security and protecting clueless people from themselves. However, for me, I hate software designed as a jail for idiots. That is why I refuse to use Windows for anything beyond testing that web applications work on it.

Firefox 3's extensions framework has a new DRM-like security barrier. You have to either submit your extension to be vetted and hosted by Mozilla, or you must use SSL, or use cryptographic keys.

I am all in favour of cryptography (as long as it is open for everyone to play), but I would be worried if this implementation makes it harder for people to write and share updates.

Computer says no

I tried to install an extension the old fashion way, by going to the author's homepage and clicking on link to install the extension.

Firstly, there a warning popped up, the same warning that was also in Firefox 2:

/images/posts/firefox/firenanny1.png

So I clicked "Allow" and then reclicked the install link.

Then, like a naughty child, we have to wait 4 seconds as a cooling off period, before we can click "Install".

/images/posts/firefox/firenanny2.png

Thirdly, even though we clicked "Allow", then were put into time-out like a child, then clicked "Install", it flatly refused to do what I had told it to do:

/images/posts/firefox/firenanny3.png

'Secure' here being defined as "approved by Mozilla", very few Firefox extensions are secure in the formal sense of 'trusted'.

I am root

I know Firefox are trying to keep us safe, but I have to admit that the interface here gets on my nerves somewhat. There are "Allow" and "Install" buttons, I press them, but Firefox changes its mind and does not do what the button says.

Fortunately, in Firefox, the extension censorship can be overridden in the about:config settings dialog. So I went to Firefox 3's about:config page, and guess what? Yes you guessed it, they have added another new confirmation screen!

/images/posts/firefox/firenanny4.png

Oh well, all's well that ends well. I am sure some of you will have strong views either way on this. Let me know!

Discuss this post - Leave a comment

May 23, 2008 01:13 AM :: West Midlands, England  

May 22, 2008

Zeth

Ekiga VoIP client on Windows

I have used Ekiga quite a bit. It is one of the main free software voice over IP clients. It is often installed by default on many GNOME-based systems such as many free software distributions, and it is also available on Solaris.

It also now has a Windows port, so I thought I would try it out. Giving any remaining Windows-using relatives Ekiga means they can chat to you online without you having to install proprietary phone clients that do strange things on your network.

To start with, you need a SIP username, I got a free SIP username from Ekiga's online-registration, but you can get one from any SIP provider, or you can be your own provider by running your own SIP server such as Asterisk.

To start with, lets just use Ekiga's free usernames.

So once you have a SIP username, we want to download Ekiga. the Windows binary is available from Ekiga's Windows-Users page.

Download the exe and click on it. This will bring up a little box asking you for your language. My first language, English, was the default so I went with that.

http://commandline.org.uk/images/posts/ekiga/ekiga0.png

Next comes the Ekiga Setup Wizard:

http://commandline.org.uk/images/posts/ekiga/ekiga1.png

Press next twice and you get this:

http://commandline.org.uk/images/posts/ekiga/ekiga2.png

Press finish. I did this on Windows XP, which brought up a warning me that Ekiga is attempting to connect the Internet. Being a program to chat over the Internet, I pressed "Unblock":

http://commandline.org.uk/images/posts/ekiga/ekiga3.png

Next is the First Time Configuration Assistant.

http://commandline.org.uk/images/posts/ekiga/ekiga4.png

It will ask you for your SIP username and password (i.e. the username we created at the beginning of this article), and it will try to detect your microphone, speakers and webcam (if you have one).

Press "Forward" a lot and read through each of the screens. when you are done it will summarise your choices:

http://commandline.org.uk/images/posts/ekiga/ekiga5.png

Press "Apply" if you are happy, or press "Back" to change them.

So now hopefully you are done with all the hard work. You should see the main Ekiga interface like this:

http://commandline.org.uk/images/posts/ekiga/ekiga6.png

The first icon on the right allows you to open a text chat with the person you are talking to.

So far, I only really use Ekiga to call my friends over the Internet, I have never phoned a landline, therefore I turned the numberpad off, you can do this by clicking the second item on the left, or by going to the "View" menu, and choosing "View Mode" then "Videophone".

Typing usernames into the address bar is a bit dull, so pressing the third icon on the left of the interface brings up the address book. If you add your friends to the address book then you can click on them rather than having to remember their SIP username.

Ekiga has many more features, but you can easily discover most of them yourself.

http://commandline.org.uk/images/posts/ekiga/ekiga7.png

Now you probably want to test it. Put sip:500@ekiga.net in the address bar and press enter. This will call the Ekiga 500 echo service. It is a robot who will echo back whatever you tell it, this way you can tell whether your connection, microphone and speakers are working properly.

Happy chatting!

Discuss this post - Leave a comment

May 22, 2008 06:13 PM :: West Midlands, England  

Michael Klier

Meme Your Favorite Desktop Linux Software

Seems I got tagged by JayPiKay and Demod :-).

Here are the rules:

  1. blog a list with your favorite destktop Linux software (as many or few you want)
  2. add links to the software project's websites
  3. post these rules
  4. tag three other Linux using bloggers

Since Splitbrain said the list should contain applications which provide a GUI I fear mine is going to be a little short :-/.

Well then, here is the list of my current favorites desktop apps:

  • Awesome - an awesome window manager
  • Firefox - my browser of choice
  • Gajim - for all things jabber
  • Sonata - the MPD frontend I use to listen to my music (when I don't use ncmpc directly on my NSLU2 8-))
  • (g)Vim - my favorite text editor
  • Mirage - a simple and lightweight GTK+ image viewer
  • Gimp - image editing
  • Viking - a GTK program to manage/manipulate GPS data
  • Urxvt - Terminal

The bloggers I tag are:

Have fun!

Read or add comments to this article

May 22, 2008 05:59 PM :: Germany  

Patrick Nagel

Uploading mail to an IMAP server with Thunderbird (2.0.0.14) sucks - perl script to the rescue

Today I was trying to upload a lot of mail (something like 160000 mails stored in a deeply nested folder structure of about 13000 folders) to an IMAP server. Those mails were converted from the Eudora mailbox format to a more sane Eudora mailbox format using “Eudora rescue”, and then imported into Thunderbird’s “Local folders”. From there, so we thought, it would only be a matter of minutes to put those mails onto the newly setup dovecot IMAP server, with one drag-and-drop action.

But…

The upload horribly failed after the 3rd folder or so, with no error message whatsoever. No matter what I tried, it would just fail silently. The debug logging (see Debugging/Thunderbird article in the Dovecot wiki) didn’t help, and neither did dovecot’s log on the server. The problem seems to be connected with creating folders on the server somehow - because uploading a big amount (400 for a small test) mails within one folder wasn’t a problem. I couldn’t find out if Thunderbird or dovecot is to blame here…

I eventually managed to get this big pile of mail to the server by using a perl script that I found on perlmonks.org. Thanks to Davis for providing this! I downloaded it, installed the Mail::MboxParser and Mail::IMAPClient dependencies (with two ‘cpan install …’ calls), changed the configuration in the script to our site’s data and ran it. ~30 minutes later, the mails were on the server. Only thing that could have been better: All mails were ‘marked as unread’ - but that’s easy to fix.

Update:
After looking into the perl code, I found a way to ‘mark as read’ during the transfer. I posted it under the original perlmonks.org script as a comment.

May 22, 2008 04:52 PM :: Shanghai, China  

Zeth

Ekiga on Windows

Ekiga is the main voice over IP client on GNOME-based systems such as many free software distributions and Solaris. It also has a Windows port. So I thought I would try it out.

Giving your relatives Ekiga means they can chat to you online without you having to install strange proprietary phone clients that do strange things on your network.

To start with, you need a SIP username, I got a free SIP username from Ekiga's online-registration, but you can get one from any SIP provider, or you can be your own provider by running your own SIP server such as Asterisk.

To start with, lets just use Ekiga's free usernames.

So once you have a SIP username, we want to download Ekiga. the Windows binary is available from Ekiga's Windows-Users page.

Download the exe and click on it. This will bring up a little box asking you for your language. My first language, English, was the default so I went with that.

System Message: WARNING/2 (<string>, line 13)

malformed hyperlink target.

Next comes the Ekiga Setup Wizard:

System Message: WARNING/2 (<string>, line 17)

malformed hyperlink target.

Press next twice and you get this:

System Message: WARNING/2 (<string>, line 21)

malformed hyperlink target.

Press finish. I did this on Windows XP, which brought up a warning that Ekiga attempts to connect the Internet:

System Message: WARNING/2 (<string>, line 25)

malformed hyperlink target.

Since I want to use Ekiga to make phone calls over the Internet, I pressed "Unblock".

Next is the First Time Configuration Assistant.

System Message: WARNING/2 (<string>, line 31)

malformed hyperlink target.

It will ask you for your SIP username and password (i.e. the username we created at the beginning of this article), and it will try to detect your microphone, speakers and webcam (if you have one).

Press "Forward" a lot and read through each of the screens. when you are done it will summarise your choices:

System Message: WARNING/2 (<string>, line 37)

malformed hyperlink target.

Press "Apply" if you are happy, or press "Back" to change them.

So now hopefully you are done with all the hard work. You should see the main Ekiga interface like this:

System Message: WARNING/2 (<string>, line 43)

malformed hyperlink target.

The first icon on the right allows you to open a text chat with the person you are talking to.

So far, I only really use Ekiga to call my friends over the Internet, I have never phoned a landline, therefore I turned the numberpad off, you can do this by clicking the second item on the left, or by going to the "View" menu, and choosing "View Mode" then "Videophone".

Typing usernames into the address bar is a bit dull, so pressing the third icon on the left of the interface brings up the address book. If you add your friends to the address book then you can click on them rather than having to remember their SIP username.

Ekiga has many more features, but you can easily discover most of them yourself.

System Message: WARNING/2 (<string>, line 53)

malformed hyperlink target.

Now you probably want to test it. Put sip:500@ekiga.net in the address bar and press enter. This will call the Ekiga 500 echo service. It is a rebot who will echo back whatever you tell it, this way you can tell whether your connection, microphone and speakers are working properly.

Happy chatting!

System Message: WARNING/2 (<string>, line 62)

Explicit markup ends without a blank line; unexpected unindent.

Press Next a lot

Discuss this post - Leave a comment

May 22, 2008 12:13 PM :: West Midlands, England  

Daniel de Oliveira

menelkir


What is LVM?

LVM (Logical Volume Manager) is a great piece of software which allow you to deal with Logical Volumes. Using LVM, you are able to extend/reduce your filesystems which is pretty handy when you need more space.

A lot of distributions support out of the box in installer. Unfortunately, Hardy Heron doesn’t offer this on the Desktop Install CD.

What can I do with LVM?

* Resize volume groups online by absorbing new physical volumes (PV) or ejecting existing ones.
* Resize logical volumes online by concatenating extents onto them or truncating extents from them.
* Create read-only snapshots of logical volumes (LVM1).
* Create read-write snapshots of logical volumes (LVM2).
* Stripe whole or parts of logical volumes across multiple PVs, in a fashion similar to RAID0.
* Mirror whole or parts of logical volumes, in a fashion similar to RAID1.
* Move online logical volumes between PVs.
* Split or merge volume groups in situ (as long as no logical volumes span the split). This can be useful when migrating whole logical volumes to or from offline storage.

What can’t I do with LVM?

* LVM does not provide parity-based redundancy across LVs, as with RAID4, RAID5 or RAID6. This functionality is instead provided by Linux metadisks, which can be used as LVM physical volumes.
* Converting regular filesystems into LVM filesystems online (you also can copy the stuff to a logical volume).

Implementation

LVM keeps a metadata header at the start of every PV, each of which is uniquely identified by a UUID. Each PV’s header is a complete copy of the entire volume group’s layout, including the UUIDs of all other PV, the UUIDs of all logical volumes and an allocation map of PEs to LEs. This simplifies data recovery in the event of PV loss.

In the 2.6-series Linux kernels, the LVM is implemented in terms of the device mapper, a simple block-level scheme for creating virtual block devices and mapping their contents onto other block devices. This minimizes the amount of relatively hard-to-debug kernel code needed to implement the LVM. It also allows its I/O redirection services to be shared with other volume managers (such as EVMS). Any LVM-specific code is pushed out into its user-space tools, which merely manipulate these mappings and reconstruct their state from on-disk metadata upon each invocation.

To bring a volume group online, the “vgchange” tool:

1. Searches for PVs in all available block devices.
2. Parses the metadata header in each PV found.
3. Computes the layouts of all visible volume groups.
4. Loops over each logical volume in the volume group to be brought online and:
1. Checks if the logical volume to be brought online has all its PVs visible.
2. Creates a new, empty device mapping.
3. Maps it (with the “linear” target) onto the data areas of the PVs the logical volume belongs to.

To move an online logical volume between PVs, the “pvmove” tool:

1. Creates a new, empty device mapping for the destination.
2. Applies the “mirror” target to the original and destination maps. The kernel will start the mirror in “degraded” mode and begin copying data from the original to the destination to bring it into sync.
3. Replaces the original mapping with the destination when the mirror comes into sync, then destroys the original.

These device mapper operations take place transparently, without applications or filesystems being aware that their underlying storage is moving.

How can I learn more?

http://en.wikipedia.org/wiki/Lvm
http://tldp.org/HOWTO/LVM-HOWTO
http://sourceware.org/lvm2/

Requirements

* Ubuntu install LiveCD 8.04.
* Internet connection or lvm2 deb package.
* Free Disk Space

Preparing

1) Install LVM2 Package

sudo apt-get install lvm2

2) Start dm-mod

sudo modprobe dm-mod

3) Redetect disks

sudo partprobe

Preparing Disks

Let’s create a boot partition outside of LVM and all the rest for LVM (120Mb for /boot in 2*40Gb hardisks).


$ sudo fdisk /dev/sda

The number of cylinders for this disk is set to 4865.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
(e.g., DOS FDISK, OS/2 FDISK)

Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-4865, default 1):
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1033-9729, default 9729): +120M

Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 2
First cylinder (17-4865, default 17):
Using default value 17
Last cylinder or +size or +sizeM or +sizeK (17-4865, default 4865):
Using default value 4865

Command (m for help):t
Partition number (1-4): 2
Hex code (type L to list codes): 8e

Command (m for help):w
The partition table has been altered!

Calling ioctl() to re-read partition table.

WARNING: Re-reading the partition table failed with error 16: Device or resource busy.
The kernel still uses the old table.
The new table will be used at the next reboot.
Syncing disks.

$ sudo fdisk /dev/sdb

The number of cylinders for this disk is set to 4998.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
(e.g., DOS FDISK, OS/2 FDISK)

Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-4998, default 1):
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-4998, default 4998):
Using default value 4998

Command (m for help):t
Partition number (1-4): 2
Hex code (type L to list codes): 8e

$ sudo partprobe

Formating Partitions

1) Format /boot partition
$ sudo mke2fs /dev/sda1

2) Create physical volumes for LVM

$ sudo pvcreate /dev/sda2
$ sudo pvcreate /dev/sdb1

3) Create volume group (I’ll use rootvg, like AIX)…

$ sudo vgcreate rootvg /dev/sda2

4) …then add the second physical volume

$ sudo vgextend rootvg /dev/sdb1

5) Create the logical volumes.

$ sudo lvcreate -n rootlv -L 15G rootvg
$ sudo lvcreate -n varlv -L 5G rootvg
$ sudo lvcreate -n homelv -L 30G rootvg
$ sudo lvcreate -n usrlv -L 15G rootvg

6) Now you’re able to *see* this logical volumes in Ubuntu Installer.

7) After installation ends, don’t reboot yet. Mount your logical volumes, proc and dev.

$ sudo mount /dev/rootvg/rootvg-rootlv /mnt
$ sudo mount /dev/rootvg/rootvg-usrlv /mnt/usr
$ sudo mount /dev/rootvg/rootvg-varlv /mnt/var
$ sudo mount /dev/rootvg/rootvg-homelv /mnt/home
$ sudo mount -t proc proc /mnt/proc
$ sudo mount -o bind /dev /mnt/dev
8) Copy your resolv.conf to filesystem.

$ sudo cp /etc/resolv.conf /mnt/etc/

9) Chroot

$ sudo su -
# chroot /mnt/ /bin/bash
# source /etc/profile

10) And now, install lvm2 and re-install grub

# apt-get install lvm2
# grub-install /dev/sda

11) Now you can reboot.

May 22, 2008 10:33 AM :: São Paulo, Brazil  

Zeth

List files recursively by modified time

Often when using my computer, I will have a "project", by this I mean a directory containing an arbitrary number of files and directories. This could be a software project, or a website, or an essay, or whatever.

So when going back to a project, I might want a quick overview of what has been going on. This is what my filehistory.py script is for. It recursively orders your project files by last modified date.

The unique feature is that it mixes them all together as one stream. There is of course a tradeoff, the larger the number of files, the longer it takes, however it is quite fine for projects of up to several thousand files.

There are a few command line arguments:

  • By default, the output is just the filepaths, if you use -v then it outputs timestamps as well.
  • By default, it will output warnings if it finds permission errors or malformed symlinks in your project. If you want to suppress these messages, use -q.
  • By default, it will output all the files within your project. If you want to specify the number of lines then use -n followed by the number. So -n 20 will output the most recently edited files.

If you followed my post about making a scripts-directory, then you can just make the Python file executable and drop the Python file into it.

It really comes into its own when you pipe it to other tools. For example, to copy the last 20 modified files to a USB stick mounted at /media/disk :

filehistory.py -q -n 20 | xargs -I x cp x /media/disk/

So feel free to check out my filehistory script. As you know I use Linux, but I think this particular script should work on Windows/Mac as well.

Discuss this post - Leave a comment

May 22, 2008 05:28 AM :: West Midlands, England  

May 21, 2008

Jürgen Geuter

dm-crypt in Gentoo

Quick reminder: If you use dm-crypt on Gentoo to crypt your harddrives and you have trouble entering the right passphrase it might be that you don't have a US keyboard. This bug is the one responsible: The proper terminal keymap is not set before starting dmcrypt (which means you have US keyboard settings and not your localized ones). Annoying and makes you think you are insane ;-)

May 21, 2008 06:36 PM :: Germany  

Steven Oliver

steveno


I swear, you take a hiatus for about 6 months, and this kind of stuff happens!

Exherbo

Enjoy the Penguins!

May 21, 2008 05:13 PM :: West Virginia, USA  

George Kargiotakis

Fotox 42 ebuild

Since the newest available fotox ebuild I found was for version 17, I decided to change it for version 42 which is currently the latest and greatest. To compile and install it using portage you also need a minor patch I made for it’s build system. fotox-42.ebuild fotox-build.patch

May 21, 2008 02:32 PM :: Greece  

Jürgen Geuter

On the success of Ubuntu

Ubuntu, Canonical's linux distribution "for human beings" has been dominating the linux news and reports for a few years now: At first out of the "look at the freaky African rich guy who tried to build a distro" interest, then because blogs and other media started picking it up. Today Ubuntu is pretty much a synonym for linux for many people. Opensuse? What's that? Fedora? Never heard of it. Debian, Arch, Slackware, Gentoo? Words without meaning.

I'm writing this as I'm wrapping up the Gentoo installation on my thinkpad that replaced the horrible mess that was Ubuntu 8.04 ("Hardy") and it kinda got me thinking about how it came to be that Ubuntu dominated the mindshare.

We don't often see a complete reduction to one product in a certain area (it might be comparable to the Ipod when it comes to MP3 players) and there are some reasons why that usually happens:


  • Technical superiority: One product is just that much better than the rest that, while the competition is playing catch-up, the leader improves even further.

  • Elegance: One product is just that much prettier or stylisher than the rest. The sold image is just that much more appealing (pretty much the reason why the wannabes all run around with Macbooks).

  • Price: The one product might not be the best but it's just so cheap that it would be retarded to buy something more expensive

  • Novelity: One product is just new and so different that it becomes the thing to have. It changed the rules in some respect that no one had thought about before.



So what's the reason for Ubuntu's success?

Well we have to make a quick reality check first: It's hard to see how the actual installed base of operating systems is so the fact that there is a lot of buzz about Ubuntu does not mean that the installed base of linux systems is in any way related to that. When we are talking about success here, we are actually just talking about publicity and representation in media (whether blogs or traditional doesn't matter).

Ubuntu is obviously not technically superior to the rest. While Ubuntu has added a few things like graphical dialogs here and there that can simplify things (and often keeps those patches to themselves instead of sending them upstream so everyone can benefit) the base technology is not that different from the rest and in some aspects it's actually behind the competition (pulseaudio integration being one of the examples).

Ubuntu's default theme is actually not bad (I kinda like it) but it's not that much prettier than the competition.

Ubuntu is free of charge but so is the competition so price is not important. And novelity is nothing Ubunut excels in either.

So where does the success stem from?

It comes from two things mainly:

  1. Communication/community: Ubuntu has Jono Bacon as community manager. Then there's the forums and wikis. All in all it's like a bee hive of people all generating buzz and noise. Some of their work might be sub-par but still it's a stream of constant buzz about Ubuntu that keeps the word in the public discussion.


  2. The slogan: "Linux for Human beings". I have no clue who came up with it, but that person is, in my opinion, responsible for at least 50% of the success of Ubuntu. The slogan is not geeky, it's not technical, it's talking about human beings (which we probably all are [except Harvey the invisible rabbit which is obviously reading this]) and it talks to feelings. It tells you that this is for you. No restriction, no catch.



Ubuntu has applied the strategies that we know from marketing and advertising better than any other open source project (well the KDE people are quite good with that, too, with, based on the slogans, some people believing that KDE4 was the second coming of christ or the revolution of the desktop).

Ubuntu is not a bad distribution but its representation in our media is not based on merit but on advertising. People believe that it's easy because everybody says so. When it's not easy they look up stuff in the wiki or forums or ask. How is that different from Debian or Fedora? It isn't. But those don't claim aggressively enough that they are easy.

It's, like so often, a story about makebelieve. Make people believe that things are easy and they will claim that they are. Installing software on windows is a pain in the butt: No dependency resolution, hunting down software yourself. But still people claim that it's easy. Because that's what they were told. And that's what they have convinced themselves of.

Let's see how long it takes the distros competing for Ubuntu's user base will need to realize that they have to work like advertising people do. Right now is the right time with the Ubuntu devs dropping the ball on their last release.

May 21, 2008 01:51 PM :: Germany  

Jason Jones

User-Based RSS Feeds!

Quite a few people have been wondering how they can get RSS feeds which are specific to the individual users of ILoveMyJournal.com.  Until now, they couldn't.

ILoveMyJournal.com now has feeds which will contain public posts from only the user you're interested in!

To get it, you simply click on the RSS feed logo found within the user's blog.

First, click on the public sub-nav on the title bar,  then click on the user's blog you wish to view, then click on the RSS feed logo, and you'll be there!

May 21, 2008 01:12 PM :: Utah, USA  

Steven Oliver

steveno


  1. The Gentoo Fork - Its been rumored, and its even been attempted at least once I believe, but it has yet to happen. Personally I think some home grown competition would do Gentoo well. Would I switch if they forked? Maybe… They’d need a new tree, a replacement for the ebuild, a replacement for portage. They’d need at least a handful of very skilled technical people, and another handful of people to do all the non-technical work. Could easily be done in my opinion, only a lack of desire is really staving it off. Perhaps this is a sign Gentoo isn’t as bad off as some like to think.
  2. The Portage Replacement - We’ve got at least two contenders. Both are probably, at this point, more than able to do the job. Both are without a doubt a better system with more modern approaches to package management. Only nostalgia is really holding this one back. Sort of sad really.
  3. Graphical Package Management - Despite actually having several of these out there for Portage there is a pretty good reason why these never really caught on with John Doe Gentoo. Mainly they’re not really a good idea. Sadly running a system like Gentoo just involves to much command line work to make these really worth using. Using one would only mean having to switch back to the command line every other install to check and fix the reason(s) it failed or to update my conf files. Pointless…

Your picks?

Enjoy the Penguins!

May 21, 2008 12:13 PM :: West Virginia, USA  

Arne Stäcker

arlsair


… oder eine kleine Review über Fedora 9.

Im Sommer geht meine Mutter in den Ruhestand.  Da sie immer noch wenig Ahnung von Computern hat und erst recht mit der Sicherheitsproblematik, ist die Wartung des Computers meine Aufgabe. Und da sie im Ruhestand keine Spezialsoftware mehr benötigt, wird sie ein Linux verpasst bekommen, was meines Achtens ihr auch in Sachen Benutzerfreundlichkeit entgegen kommt. Außerdem kann ich so den Rechner besser übers Internet warten.

Also habe ich mir mal Fedora 9 als KDE Spin angeguckt, da mir die Aktualität (aktueller Kernel, verbesserter X-Server) sehr zusagt. Hier ein paar Punkte, die mir aufgefallen sind:

LiveCD:

  • Schlecht: Die Schrift war verstümmelt (oben und unten etwas abgeschnitten)

Installation:

  • Schlecht: Bei der Installation konnte man die Sprache nicht auswählen, sondern konnte sie erst im nachhinein installieren.
  • Gut/Schlecht: Fedora hat in den 2.6.25er Kernel WLan-Erweiterungen aus dem kommenden 2.6.26er Kernel einfließen lassen. Unter anderem wird nun die LED bei Intel-Chipsätzen genutzt. Allerdings zeigt sie die Aktivität durch Blinken an, was echt nervt. Mir würde es reichen, wenn sie an geht, wenn man man mit einem Netz verbunden ist.
  • Gut: Man kann die Plasmoids in der Fensterleiste verschieben. Das kann ich selbst in meinem aktuell gehaltenen KDE 4.1 SVN nicht.
  • Schlecht: Manche Programme im Startmenü haben kein Symbol. Dies kommt zum Teil daher, dass es selbst Upstream keine Symbole gibt, aber eine Distribution sollte hier dann Eigeninitiative zeigen.
  • Gut/Schlecht: Auch im KDE Spin werden standardmäßig GTK/Gnome Programme eingesetzt, wo es noch kein KDE-Frontend gibt. So z.B. PackageKit und das Gnome-Frontend zum NetworkManager 0.7 . Das finde ich eigentlich gut (bevor man gar nichts hat), allerdings merkt man schon, dass es Fremdkörper sind (Gnome gefällt mir nicht). Die Zeit wird es bringen (zumindestens für den NetworkManager 0.7 gibt es eine Integration in Solid bei KDE 4.1)
  • Gut/Schlecht: Mir gefällt die Idee von PackageKit, ein einheitliches Frontend für alle Distributionen zu haben, wenn auch im Moment nur für Gnome. Allerdings werden mir zu wenig Informationen angezeigt. Ein “Details” Knopf wäre schon toll.

Insgesamt schon ordentlich gemacht, allerdings bin ich von Gentoo total verwöhnt (auch wenn es etwas mehr Arbeit benötigt). Da aber Gentoo keine Option für meine Mutter ist, werde ich wohl noch mal Kubuntu und OpenSuse ausprobieren.

May 21, 2008 08:14 AM :: Hamburg, Germany  

Sean Potter

Why Gentoo is Still for Me

My first Linux distribution was a very old version of Red Hat with X-Windows as a GUI. I think I was in 5th or 6th grade, and I bought it from a used book store for $10. From there, I went to Mandrake Linux 7, then Fedora, and finally to Gentoo. I was never a fan of RPM installers, as there were always issues with dependencies and uninstalling.

One of my friends, Zack had recently become a fan of Gentoo Linux. I abandoned RPM hell and became a fan of Gentoo. Despite, at the time, the best way to install Gentoo was through a stage 1 (compiling everything from start to finish), I loved it. Even if it took a day to get a usable system on a 400MHz Pentium 2, it was great.

Despite some obvious issues with dependencies in Gentoo, and many claiming Portage is just a slew of unmanageable code, I'm still in love with the speed and configuration of Gentoo. Sure, some things aren't install-and-go, but you learn more when having to configure most programs yourself.

Recently, I've been installing the latest version of Ubuntu on many of the machines I use to benchmark hardware for BIOSLEVEL. I can't say I'm a fan. I'll agree that it's fantastic that Ubuntu developers have put so much time into developing and improving many applications and daemons for desktop use, but it feels slow.

Why run native 586 code on a 686+ CPU? Why install software that doesn't take advantage of a CPU's extensions? To be completely honest, using the same hardware, a Gentoo System with Compiz Fusion running feels more responsive than an Ubuntu system without any desktop effects enabled.

While much of my testing will be done with Ubuntu, my primary Linux environment for regular usage remains Gentoo.

May 21, 2008 06:40 AM

May 20, 2008

Jason Jones

Mohawks 'n' Camaro Cops

I've been needing to write a bit more about what's going on in my life lately, so... I'll give it a try this evening.

First, you'll notice by the video above that yesterday morning a sad event occurred.

No, my cat didn't die.

No, my computer didn't fry.

My mohawk went bye-bye.

Yup.  I woke up yesterday morning and just couldn't get myself to spend the necessary time to make it look acceptable, so, with the alternative being to wear a hat, or look like a complete idiot, I got out the buzzer and within a couple of minutes, it was gone.

Also, today I had a run-in with a police officer of the law.  hehe....  who just happened to be driving a camaro with some serious power.

He drove past me going about 65, I was doing 60.  I then caught up to him, and as soon as I passed him, he slowed down to about 2 car-lengths behind me, pressed the gas just a bit, and I'll be darned if I didn't hear the unmistakable sound of the supercharger waking up.

It made me smile just knowing that he couldn't let me go without knowing he had some power to punch.  hehe....  Anyway...  I got a pic of his back-end as he pulled off the same exit as I.

Anyway...  Good times today.

Hopefully I'll be chattin' with ya again soon.

Also - if the video at the top of this page didn't load for you, or you had any problems with it, please comment, so I can know what's going on.

Thanks.

May 20, 2008 06:58 PM :: Utah, USA  

FFmpeg Webcam Video in Linux

Okay...  I've been wondering how to do this for quite some time, and I finally figured it out with the help of this mailing list thread.

I've always thought ffmpeg was a pretty amazing program, but now, I will build a shrine to it and worship it weekly.

Ffmpeg is the program which allows me to create a video with sound in Linux.

I have a Logitch Orbit AF webcam, and with the following command, it records both video and audio.

ffmpeg -f video4linux2 -s 320x240 -i /dev/video0 -f audio_device -ac 2 -i /dev/dsp1 -f mp4 Filename.mp4

and the file "Filename.mp4" will be created and stored in the current working directory.

Great stuff!

After trying to get this video to work with flowplayer (flowplayer.org), it would reproduce the audio, but not the video, so in order to get it to work (albeit pretty low quality), I had to convert the m4v file to an flv file with the following command:

ffmpeg -i input_file_name.mp4 -vcodec flv -ar 22050 output_file_name.flv

That seemed to do the trick.  Here's the first video recorded using this method.

PS - Even though my camera is v4l2, I had to enable the v4l USE flag. Make sure you have the v4l USE flag turned on when you emerge it, or it won't work.

Go gentoo!

May 20, 2008 06:50 PM :: Utah, USA  

Alex Bogak

Firefox3 RC1

I cannot believe its happening to me.

I've updated to RC1 as expected by suggested update. Now the thing crashes on me almost constantly!!! Even in Gmail!

Anyone knows whats going on?

Beta 5 was so solid compared to RC....

May 20, 2008 05:54 PM :: Israel  

Dirk R. Gently