USB storage devices and gparted

February 8, 2008 by automatthias

USB devices like pendrives and external drives stopped mounting. I couldn’t work out what was the problem. dmesg showed that the USB device was recognized. Gnome volume manager was started. Hal and dbus also working. And my drives just wouldn’t mount automatically.

I’ve finally found a solution on forums.gentoo.org.  The problem was that gparted, which I happened to install a while ago, put this file into hal’s configuration:

/usr/share/hal/fdi/policy/gparted-disable-automount.fdi

I found the „true” part in the file, changed it into „false”, restarted hal, and voila, my drives are being mounted now!

Why was the file put in that place? The story is, gparted puts it there on start so usb devices don’t get in its way. It removes this file on exit. On graceful exit, that is. If it’s killed, it doesn’t remove it and the file just stays there.

Supernatural for Linux users

February 8, 2008 by automatthias

 I bet you guys have a hard time figuring out how it works with woo-woos. Here you have it black on white. If a woo-woo would be a sysadmin, they would do more or less:

$ dd if=/dev/urandom of=i-believe bs=1 count=$RANDOM
18676+0 records in
18676+0 records out
18676 bytes (19 kB) copied, 0.172968 s, 108 kB/s
$ chmod 755 i-believe
$ ./i-believe

And voila! All the work is done!

Watching an interlaced DVD with MPlayer

January 30, 2008 by automatthias

Resuming my tech-notes blogging…

I’ve recently bought three Studio Ghibli’s movies. I don’t have a TV-set (yes, lenina, I’m still not watching any TV), so I’m watching DVDs on my laptop. DVDs I got are interlaced, when watching them on a computer, you can see small horizontal stripes along the sides of moving objects.

On a TV-set, this is not a problem, actually, interlacing makes animation on TV-set smoother. But on a computer, all you get from interlacing is stripes.

MPlayer comes with few deinterlacing plugins, from which yadif and kerndeint seem to work best (but I’m open to other suggestions). However, my video output is GL:

maciej@clover ~ $ cat .mplayer/config
vo = gl
autosync = 20
monitorpixelaspect = 1
af = volnorm=2:0.6
ao = pulse

The problem with those deinterlace filters is that they don’t cooperate with the gl video output. Fortunately, there’s an easy fix for that: append scale filter.

mplayer -vobsubid 1 -vf kerndeint,scale dvd://5

Replace 5 with your title number. The vobsubid option tells MPlayer to display subtitles. I like to watch Japanese movies with the original soundtrack and English subtitles. Usually, English dubbing reveals too much about the characters and lacks the original expression.

James Randi - On Geller’s Reversal

January 28, 2008 by automatthias

Hard to believe. Uri Geller has admitted he’s not a psychic. Wow.

Geller didn’t stick with his position, though. A month later he again claimed to be a telepath. Randi is right, Geller has got to stick to it. I can imagine it has to be quite painful to keep on lying the whole life. Or has he become psychically numb to the issue of truth versus falsity?

I wonder if journalists will keep on asking this question to Uri.

If you’re unfamiliar with the story, see this:

Chinese Nigerian Scam

January 15, 2008 by automatthias

Do you remember your first Nigerian scam? Mine was circa 2000, if I remember correctly. How didn’t it die out yet, is a mystery to me. Anyway, I just saw something interesting: a Nigerian scam going Chinese! See this:

fromANGANG STEEL <i…@chinamade.com.cn>reply-toinfo_angangsteel1@yahoo.com.hk,
toundisclosed-recipients,
dateJan 14, 2008 8:08 PMsubjectANGANG STEEL OUTSOURCING FOR REPRESENTATIVE

Dear Prospective Representative,

I am David Wan. Personnel Officer to ANGANG NEW STEEL COMPANY LIMITED,China. We are a company that deal on steel product and export worldwide Presently, we are faced with some problems most especially with our Payment methods as most clients we have prefer to pay us with cheque rather than cash. We find it very cumbersome in accepting such payments due to the new monetary policy in our banking systems here in China and this is crippling our business and that is why I am contacting you now.I am looking for a man/woman who is trustworthy to be in charge of receiving payments on my company’s behalf in his/her country.if you know you are not trustworthy please do not bother to reply at all because alot of money is involved here.all I am asking you is if you would like to earn for the first 60days Reps will receive 10% commission on every transaction processed.

If you are interested endeavour to furnish us with your following informations

1.Full names
2.Phone number/fax
3.Full address(NOT P.O BOX)
4.Age
5.Sex
6.Marital Status,
7.Present occupation(Company And position)

Thanks In advance

Yours sincerely,
David Wan.
Personnel Officer to
ANGANG NEW STEEL COMPANY LIMITED,
China

If you wonder what it is all about, read about advance fee fraud. There are people who like to play with it, scambaiters. I never dared to do this, but I think it might be a form of hobby.

David Allen: Getting Things Done

January 10, 2008 by automatthias

David Allen gave this talk when I was in Google campus in Mountain View. It was one of the most popular tech talks, the room was really filled up.

Basic ideas of GTD are simple.  After you get them, they seem to be just common sense.  But it takes a while to figure out what we’re doing when we’re doing stuff.  And also, doing stuff becomes collecting, processing, organizing, reviewing and doing.  Myself, I’ve merely gotten to the stage of organizing.  But at least I started to collect and process.  If you’re curious what that means, sit back, relax and enjoy the talk.

boomerangs.com

January 7, 2008 by automatthias

I’m a big fan of boomerang throwing. Boomerangs are, at the end of the day, mere wooden sticks. No moving parts, no electronics, no remote control. And yet, if you have skills to throw them, they will fly, turn, go up, go down, and land on your hand after a short gentle hover.

My first boomerang was Aerobie Orbiter, which was lost, hanging on a pine ten meters above the ground. It seemed very unlikely that it would go that far, but… well, it did, and it’s probably still there, in a small park near Piaseczno, Poland.

I got my second one for Christmas 2006. It was a wooden boomerang, Delicate Arch from boomerangs.com.

I had a lot of fun throwing it. Then I’ve decided I want more of those toys. The one and pretty much only boomerang shop in the internet is boomerangs.com, an internet store powered by Yahoo Stores. An alternative was to buy from British eBay, but it didn’t seem like there was a lot of choice, and I’d have to buy each one separately, paying for shipping of each package. From boomerangs.com, I could have a whole bunch of boomerangs in one package.

So I made an order for three boomerangs, paid for it, waited, and waited, and never received it. I’ve sent them an e-mail, then a next one, and a next one. No reply. I sent an e-mail to Yahoo Stores, but they sent me back to the merchant… Finally, I called them, they said they’ve sent it, and it wasn’t insured, so they can’t do anything about it. Heck, I was an unlucky guy this time, I thought to myself. I still wanted boomerangs, but didn’t decide to risk it again

When I went to the US for training, I decided I’m going to order some boomerangs, shipping within the United States should be better than overseas. So I’ve made an order, paid for it, and about a week later I’ve received the package. Yay! New boomerangs!

Boomerangs on grass

Then I’ve ordered another set of boomerangs, paid, and got it. Wow, that was so cool! So, of course, I wanted more, a good customer, eh? Well, it seems that boomerangs.com thought otherwise. I’ve made my fourth order and waited, and waited, but the package wouldn’t come. So I checked my order status, which read: ON HOLD. I rang them and they said more or less:

“You’re in the United States, you are from Poland and you live in Ireland. Your Paypal account isn’t verified. We don’t know if you’re legitimate or not. We need to protect ourselves a little bit, you know.”

Protect from what?

My Paypal account wasn’t verified at the time, fair enough. But they’ve already got money from me three damn times! If that doesn’t make me a good customer, what does?

My order got canceled and I returned to Ireland without it. Thing is, I still want to buy boomerangs. I used to like this store and I would like to try again, but this incident really put me off.

Blogging in the English world

December 19, 2007 by automatthias

After a long period of non-blogging, people often explain why was that and promise to blog more, just as if it was some kind of an obligation. I know it’s not, but still I’m going to fall into this pattern and write about not writing.

Which isn’t quite true; in fact I’ve been quite steadily blogging all this time, in my native language: Polish. There are two main reasons for doing so:

  1. I seem to have a couple devoted readers of my Polish blog: family and friends. I tried to switch into blogging in English, but apparently, they don’t see the me that they used to know when they read me in English. Or whatever the reason was, my friends just wouldn’t read and respond to equivalent posts in English. Blogging in Polish was (and is) more rewarding.
  2. I don’t have anything interesting to say in the English-speaking world. How come I have things to say in Polish, you ask? Well, I just translate or comment on things I’ve read in English! There are far more interesting things to read in English than in Polish, and I’m trying to bring at least at a glimpse of them to my fellow Poles. I’m sometimes writing original posts, but they happen to be hermetic and making sense only among my Polish friends.

It’s not that I don’t see any good things from blogging in English. To point out a few:

  1. Good practice in using the language. Although I have opportunities to speak English now, writing is something that trains a different angle of the language use.
  2. Since I live in an English-speaking country now, it makes sense to have an active English blog as means of getting to know more people, and perhaps even making friends.
  3. Occasionally, I do have something interesting to say in English. By habit, I write it in Polish and never translate it. I could translate from Polish more often.
  4. My English blog used to be more of a „tech notes” kind of blog. I think I will still use it to post solutions to problems I solved. Now, mixing personal ramblings with tech notes doesn’t seem like a good idea, because readers interested in personal stuff will be annoyed by those small posts about some Linux command working this way or other. Splitting blogs seems like a sensible thing to do, but I’ve got 3 blogs already and don’t want to multiply entities beyond necessity.

For now, things are going to stay the way they are. Maybe someday I’ll actually have something interesting to say in English. If I do, you’ll find it on my blog.

NAS won’t play? Wrap it with aoss!

November 26, 2007 by automatthias

I like to watch video on one laptop, while speakers are connected to the other; I don’t like the cable hanging in midair between the tables, begging to be pulled by someone when passing. I used to solve this by NAS, the Network Audio Server, an ancient, but still usable project that allows you to send audio through network and play from one computer to another. The problem is that I couldn’t lately get it to work. I’ve solved this yesterday, so here you go, back to the tradition of blogging my tech notes.

  • problem: nasd (the NAS daemon) would interfere with other applications, or other applications with nasd
  • symptoms: nasd won’t play, or Firefox won’t play, or music won’t play
  • how to discover: applications complain about /dev/dsp being busy
  • cause: nasd uses OSS, the deprecated “open sound system”, instead of ALSA, and OSS drivers often don’t allow applications to share sound output
  • solution: make NAS (and other applications, too) use alsa by using aoss wrapper

In Ubuntu:

  1. sudo apt-get install alsa-oss
  2. sudo gedit /usr/bin/start-nas
  3. Replace:
    nice -n -10 /usr/bin/nasd -b "$@"
    with:
    nice -n -10 aoss /usr/bin/nasd -b "$@"
    As for Firefox, follow these short instructions.

What happens now is, that the aoss wrapper hijacks calls to /dev/dsp made by NAS and handles them by using Alsa. The main interesting difference between OSS and ALSA is that in most OSS drivers, the sound output /dev/dsp cannot be shared among applications. For instance, having Firefox open might mean that Flash application is keeping the sound device open, even though it isn’t playing anything at the moment. And keeping /dev/dsp open means that no other application is allowed to play sound.

So far, I’ve watched one video using this setup, and the audio wasn’t perfect; I could hear clicks quite often. But I’m fine with that. If it annoys me, I’ll consider switching over to Pulse Audio.

UPDATE 2008-03-30:
I’ve switched to PulseAudio a couple weeks ago and I have to say it’s the best audio system I’ve ever used. The only strange thing I had to do was installing a library for Flash Player 9 that would make it able to use Pulse Audio. I have two computers transparently using a single set of speakers. Best setup ever.

Richard Dawkins’ speech

October 16, 2007 by automatthias

Richard Dawkins’ Deschner Prize acceptance speech.