All posts by erk

I love writing, computers, puns... can sometimes be spiritual, or mindful. Life is the biggest experience gift you'll ever get... enjoy the hell out of it!

FTP with Wget

I’ve just had the total pain of trying to get files (a lot of files, in a lot of directories) via a musty old FTP client (in Linux/Ubuntu).

The problem is that the FTP client (ftp) doesn’t offer much to help (like recursive downloads, or mapping up the directories on the client side with those on the serverside, etc).

I searched and I found this thread:

http://ubuntuforums.org/archive/index.php/t-378221.html

…with this excellent snippet (posted by Mr. C.):

wget -r --ftp-user YourUSERNAME --ftp-password YourPASS ftp://FTPSITE//dir/'*.html'

If you want to download something other than *.html, you can change the file name pattern as you would expect.

If you want to add more directories, simply add them, but keep track of the number of slashes (“/”).  There should be only one after the new directory names (at least that’s how I made it work.  It may work wonderfully regardless of the number of slashes, but then again, why challenge fate?)

Happy FTPing!

Open UP

Anybody who ever came into contact with RUP (which is the name of Rational’s — now IBM’s — version of the Unified Process) may have stumbled upon their web application created to support the process. In there you can find work flows, actor and artifact definitions, templates etc etc.

I did, come across it some ten or so years ago. Since then I’ve had the (mis)fortune to work at companies with their own “UP” or what-have-you-versions of development processes. However, imagine my surprise and delight when I came across an Open version of UP (sponsored by the Eclipse project) with the web application, the actors and templates and all.

Institutionalized hearsay – no, we still don’t know what’s really going on!

I just read in my local news paper that the US’s war on terror has failed to weaken al Qaeda.

Interesting, I thought, and read on, just to find out that someone had made a survey of some 20 000 people in 23 countries around the world, asking them if the war on terror had weakened al Qaeda.

I managed to track down the survey to a company called Globescan. The actual survey can be found here. This survey seems rather scientific. They have a methodology page, where an account for how the data was collected for each of the involved countries, can be found in a table.

Interestingly enough, in more than half of the countries included interviews have been conducted face-to-face, suggesting the sample was only semi random, if even that. Most likely the interviewers asked people passing by in a market place, supermarket, or some other place, and since a random sample of the country’s population is less than likely to pass them in the hours or days they conducted the interviews, the sample for that country was not random. (Which in turn skews the result; imagine if only moms between 20 and 30 were asked this question, as opposed to everyone in the country, and then we’re not even discussing the difference between face-to-face and telephone interviews when it comes to interviewer influence errors.)

It is also possible to find the actual questions asked on the methodology page. One that stands out is the question “Overall would you say your feelings about al Qaeda are positive, negative or mixed?”

Imagine that question being posed to someone on a street in Egypt, Indonesia, or Pakistan (face-to-face interviews) and then imagine if the interviewee would be honest or not with respect to the far from negligible chance of being overheard…

The actual question probably quoted by my local news paper (and many like it, I’ve been able to gather) was probably “Do you think what US leaders refer to as the ‘war on terror’ has made al Qaeda stronger, weaker, or has had no effect either way?”

This question was not posed to prime ministers of the countries included in the survey, neither were it posed to members of the intelligence community or the military (at least not solely, as far as the methodology page of the survey reveals), instead the you’s and me’s of these countries were asked about the progress of the war on terror.

The question in itself is a potent and interesting one. The method to find the answer quite frankly sucks! The first question in the survey, if the interviewee was positive or not towards al Qaeda is interesting given it had been posed in a situation where anonymity were assured and spectator influence limited. Other questions trying to determine the interviewee’s personal experience and relation to the war on terror would have been interesting, but the attempt to try to make average Joe determine if the war was effective or not is, if I’m really nice, plain dumb.

However, as a survey this one is scientific and within parameters (even though I would have wanted more information on methodology). Unfortunately this kind of research (and others like it, there are other gems dealing with the war in Iraq in basically the same way, to mention one), dealing with these kinds of questions, does not exist in a vacuum.

Journalists will read these surveys and make headlines from them. You and I will read these articles and draw conclusions. We will bring them with us when we vote the next time, when we plan our vacations, and go about our lives (okay not always but now and then we will make decisions remembering “that article” about the war in Iraq or the war on terror), and most of the time we won’t have the background or know the methodology, and in light of that I believe these kinds of questions should not be asked in this way.

Globescan calls their activity reputation research, I think of it as institutionalized hearsay. With the kind help of these guys we can have what Bob next door has been saying for years served to us as a Survey, based on more than X-thousand interviews in so-and-so many countries. What a glorious example of statistics once more abused as a tool for spreading FUD.

To all of you who read about this survey and drew your own conclusions from it, I can only say this: No, we still don’t know what’s really going on!

Using Statistical Analysis to Create Intrusion Detection

Professor Avishai Wool presents a system that protects GNU/Linux machines from intrusion and malicious program code by using statistical analysis and policy files defining a programs normal behavior, and if that program deviates from said behavior the system stops it.

Since the analysis is hooked into standard GNU/Linux build tools and uses the source code to derive the policy the system is said to guarantee zero false positives. A system of this type is cited to be able to perform protection from threats long before traditional anti virus solutions has categorized them, and with far less penalty to system performance.

Here’s a list of links for further reading:

How to make US lawmakers realize the crisis is for real…

The two news items (1 and 2) depicted to the right arrived in my news reader at the same time. This may be the most truthful testimony to the inner workings of the bank crisis and the possibly incoming recession. It gives us, the rest of the world, a ballpark idea of what needs to happen in the US before lawmakers over there realize they have to stand up to their responsibilities.

Then again, had they made laws keeping control over activities in board rooms, by middle management and brookers in general they might not have had to vote on a $700 bn bailout plan in the first place… perhaps?

Oh, well… 8-/

Mounting devices with UUID identifiers instead of using /dev paths

I don’t know why, but from time to time drivers are assigned other “/dev”-paths on my ubuntu 6.10 LTS GNU/Linux server. I think a removable USB driver might have something to do with it…

However, when that happens it is a complete pain in the a$$ because if the driver is relocated, the system cannot find it and if it is mentioned in /etc/fstab the system reasons (justly so, I might add) that if it can’t find the drive it should pull the emergency break and jump into a rescue prompt (where mostly everything is disabled), letting the user (that’s me) deal with the problem.

I usually press the CTRL-D command exiting the shell and getting back to the boot process praying that no vital driver was lost. (I’m not really a guru, just a poor guy trying to make live a little easier).

For some reason (touch wood!) the drives with the boot image or with system specific things on them has never been moved around this way. Usually its the USB drive itself (when I still had it in the fstab) that has moved (I’ll get back on how to make it auto-mount in a later post) or in this latest case, one of the back-up drives.

However, there’s a solution. If you run GNU/Linux you might have seen it in your fstab-file. The use of a UUID to do mount instead of the regular /dev/something. My desktop computer’s fstab looks like this:

# /etc/fstab: static file system information.
#
# <file system> <mount point>   <type>  <options> <dump>  <pass>
proc            /proc           proc    defaults  0       0
# /dev/sda1
UUID=e1f37856-6cfd-43f9-bea0-d4c2e43afe29 /     reiserfs notail,relatime 0  1
# /dev/sda6
UUID=64549135-a478-4aef-bb2a-da37d245dd9c /home reiserfs relatime        0  2

From this rather confusing array of characters (I had to shrink the spaces in order to fit it on the site) you can determine that there’s three devices mounted at start up (proc, sda1 and sda6, I’ve got even more, but the exact number of devices are not interesting for this discussion).

The proc device always resides at the file system “proc”, and it does not have nor need a UUID. However the sda1 and sda6 devices are regular hard drives (formatted with reiserfs) and they can change designation, for instance if I start rearranging my sata-cables or start a USB drive in a USB slot with a lower ID than those of my sda drivers (I’m guessing on that one but I’ve seen it on my server so…) These are therefore interesting to mount not by their dev-names but by their UUID’s. The UUID are stored on the drive itself and it wont change unless the drive is reformatted. The drive can be moved, turned off, turned on, it will still have the same UUID.

So, using UUIDs are a good idea when I want to create my new, drives-moving-around-proofed server configuration. The first step is to determine what UUID the drives have. This is done with the following command:

sudo vol_id -u /dev/something

I had problems finding “vol_id”. It was not in the PATH, and could therefore not be run like above. I did a locate (locate vol_id) and found it in “/lib/udev” so I prepended that path to my command. I’ve also to determine how to get the UUID from a swap partition, but for now I’m happy to have the infringing drives on UUID and hope the swap wont move (perhaps with the extra 2GB of memory I also stashed in it will need the swap even less, but anyway)…

You won’t be able to determine the UUID of any drive part of a software raid configuration (but then again, the software raid is able to do its own magic locating of drives regardless of their sd-number — trust me, I’ve done that as well — so they won’t need a UUID anyway — wouldn’t surprise me if raid uses the same scheme behind the scene though)

Let’s look at the changes I did in my fstab file (always make backups before you start messing with this file! If you fail to set it up correctly your system will probably not start at all so have a live-cd handy before trying to do this!):

/etc/fstab before I changed it (just a part of it)

# /etc/fstab: static file system information.
#
# <file system> <mount point>    <type>   <options>           <dump>  <pass>
proc            /proc            proc     defaults            0       0
/dev/sdc1       /                reiserfs notail,user_xattr   0       1
/dev/sdc5       /home            reiserfs defaults,user_xattr 0       2

As you can see the situation is not as clear on this machine as it was on my desktop machine. Here sdc is the main system drive and that alone is a, well not a worrisome problem, but a slight discomfort… sdc never moved around, but being that I have a bunch (8 or 9) sata-cables in a large but far-from-large-enough case I’m bound to switch them around one day or another…

Anyway, using the above vol_id command to get the UUIDs of the drives, I’ve updated my fstab to look like this (still only partial fstab but you get the idea):

# /etc/fstab: static file system information.
#
# <file system> <mount point>    <type>   <options>           <dump>  <pass>
proc            /proc            proc     defaults            0       0
#/dev/sdc1
UUID=716cf691-dabd-4894-8e46-bc02b4c092b4 /     reiserfs notail,user_xattr   0  1
#/dev/sdc5
UUID=9587a32e-ebb2-45ab-9e68-7a66cf43d6b4 /home reiserfs defaults,user_xattr 0  2

Unfortunately I have the same problem as above, the lines wont fit in the editor (or on the site) if I tabulate them correctly, but hopefully you’ll still be able to connect the dots. Every group of white spaces (space, or tab) in the file counts as a field separator. I’ve commented out the “/dev/sdc…” section, added a line feed and replaced it with the “UUID=…” section, and then left the rest of the line intact.

This makes sense since I’ve replaced one identifier (“dev/sdc…”) with another (“UUID=…”). So, after the original “dev”-version of the file has been safely backed up, the entries in the original “/etc/fstab” has been checked and double checked, it’s time to restart and pray this will actually work. :O

Here’s a few links you might want to check out before you give it a try:

Good luck!

Update: If, however, you’re using LVM, you’ll get stable device names and you should mount these instead. If you use LVM-snapshots you’re going to get two or more volumes with the same UUID, and in that case you should absolutely not use UUID mounting.

Four Still lifes

A couple of years ago, when I’ve just about purchased my Nikon D50 I snapped off a number of “still life” like pictures. These are the sometimes unusual things you just happen to have lying around in an otherwise rather uninteresting apartment.

Still life 1: Pile of laundry
Still life 1: Pile of laundry

This is obviously one of the first things I snapped a picture of. After looking at the picture closer I realized it was a rather nice picture, selection of subject excluded. Anyway, as far as I’ve been able to determine there’s no underwear on the picture, and no insanely dusty socks, so I hope it’s at least PG-13 😀

The thing with this picture I like is that the object in center, the pile of clothes are actually adding a kind of calm from the rather detailed background. It feels kind of backwards, and perhaps it is.

Still life 2: Knick-knacks
Still life 2: Knick-knacks

This is a bunch of knick-knacks lying around on my desk. Among other things you might notice a burnable CD box, a can of 5-56 universal oil and an ear cleaner rubber thingy. I’m especially proud of the bizarre factor that one adds. To my defense I might add that I used it to dust off my computer… you squeeze it and it blows air…

The ear thing sits atop an ancient letter scale, a bit crooked from being in my possession. I inherited it from grandpa who got it sometime in the fifties…

Still life 3: Bookshelf
Still life 3: Bookshelf

This is one of my favorite pictures. A classic book picture, true but still… it has a kind of uneven, haphazardly-piled impression to it that I really like.

What you probably don’t know is that this is my unread-books “pile” or part of it anyway. The thing you can’t see on this picture is that all the books are quite dusty…

Too much work makes Hoakzie a dull boy!

Still life 4: Fruits
Still life 4: Fruits

Okay, I confess: I’m a sucker for the classics. The only extenuating circumstance would be that there’s no banana or pine apple in there. And that the “cloth” in the “basket” is in fact a dish towel mom gave me when I moved away from home…

Electornic Art’s Spore sued because of its DRM

Electronic Art’s game Spore was on September 22nd hit by a class action lawsuit because of its DRM (Digital Restrictions/Rights Management). Or actually the fact that the DRM was secretly installed and made uninstallable.

However, I am fairly certain the lawsuit wont fly. EA told those buyers there was a DRM involved, and they have since then provided an uninstaller for the DRM.

I think we, consumers, should stop buying games with DRMs, and instead protest against the use of DRMs. If we don’t we’ll end up in a world where every software we run are for hire and nothing, not even the contents of our own harddrives, are our property. That would be a bit like hosting a virus or a parasite… unwanted, unpleasant and uncalled for.

Here’s some other reports:

http://hothardware.com/News/Spores-DRM–ClassAction-Lawsuit-for-EA/

http://www.techradar.com/news/gaming/ea-faces-class-action-lawsuit-over-spore-drm-470850

http://www.1up.com/do/newsStory?cId=3170131

http://www.crunchgear.com/2008/09/25/ea-facing-class-action-lawsuit-over-spore-drm/

Earth Overshoot Day

Oops! We used up the last resources of our planet yesterday… Should I be worried since it was my birthday? :O (Or perhaps I have completely other reasons for concern?)

http://www.ameinfo.com/169573.html

http://www.worldchanging.com/archives/008701.html

The concept was apparently invented by Global Footprint Network. Here’s a link to their overshoot page: http://www.footprintnetwork.org/gfn_sub.php?content=overshoot

Balking Talkwards

I woke up this morning after having gotten about 5 hours of sleep, however, I’ve snoozed wildly for about two hours so I was in fact in real trouble. Crawling to the edge of the bed and forcing my legs over the side I happened to look at the clock which simply confirmed my creeping suspicions: I was late beyond repair and then some.

I fell back on the bed on my back moaning. Just as I realized I was on my back, and with no snoozed clock at that the thought popped up in my head: “This will bad endly…” (No that’s not a translation or anything, I’ve been known to have my mind invaded by English from time to time.)

Which brings me to the topic of this post: Talking backwards, or as the proper phrase would be, Balking Tackwards (in forgiving circumstances it can be paraphrased to: Balking Talkwards… if that is indeed the purpose of the backtalking…)

Basically what you do is swapping consonants, nouns, vowels or even whole words. If there’s only one of them just switch its place. Don’t let things like word limits stop you, you can take a word like unseemly and turn it into suneemly as easily… Here are a few examples, I am sure you can come up with tons of more!

Phrase

Meaning

Variants

Bad endly

Bend Adly

End badly

Stackbabbing hassole

Backstabbing asshole

Ass-stabbing Backhole 😀

Earl Startly

Start early

Tart Searly

Heal a voter icicle

Steal a motor vehicle

(no this isn’t really talking backwards… or is it? And I can’t see it entering gangsta rap any time soon either :o)

Even though the baby-talk factor is pretty high, the purpose, if an exercise like this one needs a purpose, is to have fun until something like balking talkwards, or badding endly comes up.

One warning however. Don’t do this if your are over 65. They might come and take you to the doctor and/or home if you talk like this… (I’m looking forward to it myself…)