HomeHome ArchiveArchive

Copying a DVD with Linux

Copying a DVD under Linux wasn’t a problem for a long time. I always used k3b. However lately I failed to copy a DVD.

k3b would say: "failed to retireve all CSS keys" or in german "es konnten nicht alle CSS Schlüssel geholt werden". k9copy would say: "libdvdread: Error cracking CSS key for /VIDEO_TS/VTS_03_1.VOB (0x0031ccb6)!!"

First I thought k3b didn’t have access to libdvdcss. However it turns out that aparently some DVD drives won’t return data from some sections of a disc if the region code of the drive is not set.

My drive is a “HL-DT-ST DVDRAM GSA-T20N”. After setting the region code with "regionset" I was able to copy the DVD. Thanks a lot to the population of the internet that allowed me to slowly progress to a solution…

In short:

$ sudo apt-get install regionset
$ regionset
[...]
Would you like to change the region setting of your drive? [y/n]:y
Enter the new region number for your drive [1..8]:2
New mask: 0xFFFFFFFD, correct? [y/n]:y
Region code set successfully!

Region codes can be found here

Tomáš Pospíšek

what fields does this OpenStruct instance have?

OpenStruct is a nice tool to work with. However…

Let’s say you do this:

user    = OpenStruct.new( :name => "Franca Botanica", :uid => "777" )
address = OpenStruct.new( :user => user, :country => "Paraguay" )

some_stuff = []
some_stuff << user
some_stuff << address

and now you want to iterate over the some\_stuff collection and want to dump all those “containers” you created. But how do you find out which fields those OpenStruct instances have?

You could consult the documentation and be tempted to inspect them:

some_stuff.each { |c| c.inspect }

Let’s try it:

p address.inspect

"#<OpenStruct country=\"Paraguay\", user=#<OpenStruct ...>>"

Not terribly useful, is it? Instead of parsing that stuff, we can do some white box engineering and do:

class OpenStruct
  def fields
    @table.keys
  end
end

Now we can instead do:

p address.fields

… and be sure, that our code will break once OpenStruct will be re-engineerd. Let’s see what ruby’s gatekeepers think of this

cursor keys not working in Mojotron

When I run the statically bound Mojotron executable, as downloadable from sourceforge under Ubuntu Interpid, then it doesn’t recognize the arrow/cursor keys. I.e. changing the direction of the shots is not possible.

This can be “taken care of” by changing the Mojotron configuration file:

$ diff -u ~/.mojotronrc.orig ~/.mojotronrc
--- .mojotronrc.orig    2009-04-13 12:43:57.000000000 +0200
+++ .mojotronrc 2009-04-13 12:44:43.000000000 +0200
@@ -8,11 +8,11 @@
    section Player1 {
        usekey = 62 (type=integer);
        movement = wasd (type=string);
-       aiming = cursorkeys (type=string);
+       aiming = ijkl (type=string);
    }

Tomáš Pospíšek

Vortrag FOSSGIS 09

Sourcepole war an der FOSSGIS vom 17.-19. März 2009 an der Leibniz-Universität in Hannover mit dem Vortrag “Kartenaufbereitung für Tile Map Services mit Cloud Computing” vertreten. Die Folien stehen hier zum Download zur Verfügung.