HomeHome ArchiveArchive

listing init scripts, sorted by priority on RedHat

If you want to know in which order RedHat will execute init scripts, then you can list them like this:

grep '#\s*chkconfig:' /etc/init.d/* | sed 's/:#//; s/\/etc\/init.d\///;' | awk '{ printf "%2s %2s %7s %s\n", $4, $5, $3, $1 }' | sort

which will produce on my system:

01 99   12345 sysstat                                                                                                                                     
02 99   12345 lvm2-monitor                                                                                                                                
03 97     235 sysstat                                                                                                                                     
05 95     345 kudzu                                                                                                                                       
06 99   12345 cpuspeed                                                                                                                                    
08 92    2345 ip6tables                                                                                                                                   
08 92    2345 iptables                                                                                                                                    
 0 99    2345 microcode_ctl                                                                                                                               
10 90    2345 network                                                                                                                                     
11 88    2345 auditd                                                                                                                                      
11 89       - netplugd                                                                                                                                    
12 87    2345 restorecond                                                                                                                                 
12 88    2345 syslog
13  1     345 setroubleshoot
13 87    2345 irqbalance
13 87    2345 mcstrans
13 87     345 portmap
13 87       - multipathd
14 86     345 nfslock
15 85    2345 mdmonitor
15 85       - mdmpd
18 85     345 rpcidmapd
19 69       - rpcsvcgssd
19 85     345 rpcgssd
20 80       - kdump
22 85     345 messagebus
25 75     345 netfs
25 88    2345 pcscd
27 73       - ypbind
28 72     345 autofs
30 74       - nscd
35 65       - krb524
41 89       - rdisc
 4 99    2345 readahead_early
50 50       - netconsole
55 25    2345 sshd
56 50     345 xinetd
58 74       - ntpd
60 20       - nfs
64 36       - mysqld
80 30    2345 sendmail
85 15    2345 gpm
85 15       - httpd
90 10    2345 xfs
90 10       - psacct
90 60    2345 crond
91 35       - smb
91 35       - winbind
95 05    2345 anacron
95 05       - saslauthd
95  5     345 atd
95  5       - conman
96 99       5 readahead_later
97 03     345 rhnsd
97 03     345 yum-updatesd
98 02     345 avahi-daemon
98 02     345 haldaemon
98 02       - avahi-dnsconfd
99 01    2345 smartd
99 95      35 firstboot

Tomáš Pospíšek

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