Planet Larry

May 28, 2008

Brian Carper

mp3gain

I listen to MP3s in the car and it's annoying when the volume isn't normalized. I can't be fumbling around with the tiny buttons on my MP3 player to adjust the volume while I'm driving. I found mp3gain and used it on a bunch of files and it appears to have worked.

If anyone knows of a better program for normalizing volume of lots and lots of MP3s, post now or forever hold your peace.

May 28, 2008 01:52 AM :: Pennsylvania, USA  

May 27, 2008

Steven Oliver

steveno


I found two new things to stuff in my vimrc file. I thought I would post about them here so that others could revel in the glory of v-i-m.

set backupdir=$VIM\vim71\backup
set directory=$VIM\vim71\backup

On Linux these two commands do not really appear to help you that much. On Windows though (haven’t tried on any other OSes) these two lines are a life saver.

If you have backup set in your vimrc you’ll notice that Vim leaves little backup files of every file you edit in the same location as that file. Well, generally, these are hidden files on Linux so you might very well have hundreds of them laying around and you don’t even know it. On Windows though they’re not hidden and constantly clog of you desktop along with every other folder full of text files. So the first one is a lifesaver.

The second command, the directory setting, is were Vim will store its swap files that it creates. I do not honestly know what exactly is kept in these things, but they’re temp files who are removed as soon as the editor is closed. But this command keeps them out of sight if nothing else. I’m anal about my desktop so that explains my love of the second setting as well.

I put both of mine in a directory, simply titled, “backup.” I do not know what the difference is between the vimfiles directory and the vim71 directory, but I put them in the latter. Everything else seemed to be there.

So there you have it. Two little tidbits to tiddy of your desktop.

Enjoy the Penguins!

May 27, 2008 07:01 PM :: West Virginia, USA  

steveno


These new beast they call Exherbo looks tempting. Almost tempting enough to ruin a perfectly fine Gentoo installation just to see if I can do it or not. For now though I believe I will hold off and wait. At least until the new init system is fairly usable. Then you can bet your ass I’ll be all over it. But until it gets to that point I’ll have to settle for the feed. Which has thus produced some fairly interesting posts.

Being built from scratch with paludis makes this distro more than interesting. Paludis has always felt like it was only living up to half its potential on Gentoo. But various parts of the distro were holding back. Hopefully Exherbo will cure that sensation.

May 27, 2008 06:19 PM :: West Virginia, USA  

steveno


If there is one thing I love, its a good install story. The trial and tribulations of the people who think they know what they’re doing and how badly they screw it up.

I actually installed Gentoo this weekend. At this point my only  saving grace when it comes to installing Gentoo is I’ve screwed up in just about every way possible so when I screw it up these days I generally know how to get out of it. Everything went great except for the vga parameter in my grub.conf. I should write down which one I use because I spend at least an hour rebooting a blank screen every time trying to figure out the right one.

One thing I have noticed though is the ridiculous amount of posts (blogs and forums) on the speed comparisons of the various package managers. Personally, numbers mean nothing to me, speed is subjective. Just like how my car feels really fast at 50 on curvy road but slow as hell at 50 on the interstate. What I’m getting to here is that the discussion of speed always leads to other talks about how terribly hard it is to setup the various package managers. Well, I’ll just tell you right now, anyone who cannot get paludis up and running within 5 minutes of installing is an idiot. The portage2paludis.bash script has worked flawlessly for me every time.

Regardless of all of that, I now have Gentoo Linux, Fluxbox, and Paludis all working together to make me a happy camper.

Enjoy the Penguins!

May 27, 2008 06:15 PM :: West Virginia, USA  

Martin Matusiak

OpenID deserves to die

Here’s my perspective on it. We all have ideas, some good and some bad. Now it’s understandable that people who have invested themselves into a bad idea, especially if they thought it was good, are reluctant to walk away from it. It’s painful to have to realize that. But the flip side is that we have to maintain the myth of Santa Claus because, well, so many kids believe in him that we can’t let them down. Bad ideas deserve to die for the good of everyone.

The first thing a good idea must have is a real problem to solve. OpenID does very well here. The point of OpenID is to solve our common problem of the internet age: many websites, many accounts, many usernames and passwords. This is probably why OpenID still appears to some people as being a good idea.

Here’s how they do it. Instead of keeping track of your accounts on all the sites you’re a member of, just let one site keep all your account records (sound ominous yet? it did to me). Now, whenever you want to login to one of your sites, instead of using your username/password for that site, you use your OpenID login, which looks like this: http://username.myid.net. This url is effectively your OpenID provider, ie. the site you use to keep track of all your accounts. So now the site you’re logging into sends you to your provider, where you login with a username/password belonging to the account on the provider site, and that logs you into the site you were visiting. So in other words, your account on the provider is the gatekeeper to all your accounts. Sounds simple, right?

I remember when I first heard about this idea years ago. The first concern I had was that in order for this to work, I need a provider to keep track of all my accounts. So I asked myself the question: whom do I trust do this for me? The answer came back: myself. I don’t know about you, but the idea of some third party storing all my logins doesn’t make me feel warmy and cuddly. As it happens, the open in OpenID means you can choose any provider you want, including yourself. You just set up some php scritps and voila, you can use http://mysite.com as your provider. So basically, instead of storing your accounts in some “account manager” program on your computer, you do the same thing on your server. This is where the concept of OpenID died for me. I don’t want to have to depend on my own OpenID provider to work in order to use other sites. I don’t want to add a dependency on my ability to login to some other site contingent on the assumption that my own site is available and working properly at all times (which it isn’t, I have a little downtime like everyone else).

If you don’t want the hassle of being your own provider, you can pick a provider from a list. This is not an attractive fallback option, because now your account on the provider is your key to all your other accounts. If I have an account on some site and I forget my credentials, big deal, I only lose that one account. But if I lose my credentials on the provider, I lose everything.

In theory, OpenID tries to improve your overall security. The hassle of keeping track of accounts is known to us all, and we get around the problem by reusing the same (or similar) credentials on a lot of sites. This is obviously bad for security, because if someone gets your password to one site, they can access all your other accounts that use this password. So security people will always recommend that you use distinct credentials for every account. Suppose you do this, and you use OpenID to alleviate record keeping. Now, OpenID actually works against you. Your account on the OpenID provider is the key to everything. With a different password on every site, you’re that much less likely to remember what it was, therefore your account on the provider is proportionally more valuable.

There is a strange irony at play here. Supposedly, the more accounts you manage with OpenID the more useful it is. But on the other hand, the more accounts you manage with it, the more you depend on it, and the more you make it the one gateway to all your online identities for a potential attacker or for abuse by a dishonest or incompetent provider.

Most importantly, however, OpenID’s solution to the login problem isn’t a very clever solution at all. Typing http://username.myid.net is not a big improvement over a username/password form. My browser already gives me the option to login without typing anything.

Those are my reasons why OpenID is a bad idea and should have died years ago. If you want more, Stefan Brands has an exhaustive laundry list of problems with OpenID.

May 27, 2008 04:15 PM :: Utrecht, Netherlands  

Dirk R. Gently

Linux Quick Tips


Linux Quick Tips
Hello blogosphere! As I’m working on putting my bash scripts together, here’s a few quick tips that one may use in everyday life.

Background Command

Ever started a program in the terminal because it doesn’t have a menu listing, or need to see it’s error output and then realize later that you need the terminal? Opening another tab is simple enough but you really don’t need the program hogging the terminal anymore. Well, there is a way to do this.

Previously, people may have viewed my bash script that can start programs in the terminal in the background. Already running applications can be backgrounded as well. First type ctrl-Z to release the application, then using the bg program will background it’s output.

Gnome’s Middle-Click, Title-Bar Trick

For the long time I’ve been using Gnome and just learned about this one. A quick way to look at a window below the current on is to middle-click on title bar. Voila! The current window izzz lowered. More tricks can be found on Gnome Tip’s and Tricks page.

Firefox Hunt

I have the tendency that once I’m on the keyboard, I like to stay on the keyboard, so doing a search in Firefox by going to the mouse selecting the search engine, and typing in the field seems like extra legwork to me. To do a fast search in Firefox on the keyboard is as easy as: ctrl-K to move to the search box and alt-up/down to select the search engine.

Grep Two Search Terms

On the occasion that a grep search needs to look for two words, egrep it:

egrep -w 'word1|word2' /path/to/file

Fox in Hounds Teeth

This is personal advice, but take it from me - worth it. Don’t use Foxmarks Bookmarks Synchronizing Service. I used this service as I sold my old computer when I got the new. I trusted this service to hold my web bookmarks and… it didn’t. It errored with the line, “Can’t synchronize bookmarks, transfer error.” I asked about the error and only got the explanation that, “…this sometimes happens”. Also I got no explanation on why or what happened to their backup service.

There’s another Bookmark Synchronizer out there but for the life of me can’t remember the name of it. Anyone?

Thunar Custom Actions

Thunar has the ability to create custom scripts built directly into it. For the most part it’s self explanatory. For greater degree of difficultly scripts, here’s the documentation.

Have a Good Day! :)

May 27, 2008 04:13 PM :: WI, USA  

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

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, 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 03:07 PM :: West Midlands, England  

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  

May 22, 2008

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 22, 2008 07: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  

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 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  

May 21, 2008

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 21, 2008 11:28 PM :: West Midlands, England  

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 j