In an earlier post, I asked a number of questions, most of
which are now answered. Here's a recap:
I wrote
I stumbled across some CF Engine-style definitions for puppet in a Debian Administration article (taken originally from puppet's own wiki, which have since been moved/deleted)Perhaps it was removed with good reason This is a fairly horrid solution to the problem. Phil was the first to suggest investigating Augeas, a neat tool that abstracts away the nasty specifics of parsing the myriad configuration file formats and provides a unified, tree-like interface for adjusting configurations. The interface reminds me of manipulating XML via the DOM. More on Augeas in a later blog post I also wrote
package [foo,bar]: syntax worked fine, but is a little verbose and the package list is awkward to maintain buried inside the puppet syntax. I spent some time trying to see whether I could populate a puppet list based on the contents of a file: then I could list the packages one-per-line in a separate file. I haven't found a way of doing that yet.I haven't found a more concise way of solving this problem, but as I have grown more familiar with puppet's syntax I have become less bothered by it. I igo suggested pre-processing the puppet configuration, but I'd rather not complicate my provisioning approach (VCS hooks) by attempting that. Finally I wrote
Using my laptop as a second node also exposed some interesting puppet client behaviour. Once I went off-site, the laptop tried to look upI'm pleased to report that the client is at least this clever: it refused to talk to a local puppetmaster that I setup at home.puppeton foreign networks (such as my home network). I would have assumed that, once the strong SSL association had been made, the client would try to connect to the FQDN of the server. This probably isn't a serious problem in practice, as we probably won't need to rely on nodes off-site talking to the configuration server, but I hope that the client doesn't trust any host that happens to answer topuppet...
Puppet lets you install packages on your system, like this:
package 'foo': ensure => installed
You can also ask it to make sure that the package is kept up-to-date:
package 'foo': ensure => latest
What does "latest" mean? How does this interact with a mixed repository
sources.list on Debian?
It turns out that both ensure => installed and ensure => latest honour
pinning. For example: if you have a stable system; sid in your sources.list
and pinning set up; either of the above will install stable's version of foo.
I think ensure => latest is less useful than it might initially appear. If
you install a package foo and use ensure => latest, but foo depends on
packages bar and baz, it will only ensure that foo is up-to-date, not
bar or baz. Similarly any other packages that you have not installed with
puppet will not be kept up-to-date unless you name them explicitly. If you
want to automatically take all updates from your distributor, you need to use
another mechanism to do so.
Sanjog Misra, who
uses Rcpp for
Monte Carlo Markov Chain (MCMC) analyses in quantitative marketing, kindly set me a
short example of Rcpp use.
The example is based on a
blog post by Darren Wilkinson
which itself discusses and compares the suitability of R, Python, Java or C for MCMC analysis, using the
Gibbs sampler as a concrete example. Darren's post is worth checking out: he
stresses the rather pragmatic aspects of how fast and/or easy it is to write the code, rather than just the mere runtime. As such,
he is not too concerned with a speed advantage of Python over R which he sees at a factor of around 2.4, leaving him to continue to prototype in
R. Similarly, with C 'only' being faster than Java by a factor of two, he prefers Java for the numerically more demanding parts.
We do of course advocate the use of Rcpp to combine the best aspects of R and C++,
respectively. This Gibbs sampler example provides a nice backdrop. So working with Darren's example, consider the same Gibbs sampler for
a bivariate distribution (and apologies for the lack of latex typesetting on my blog)
where the conditional distributions aref(x,y) = k x^2 exp( -x y^2 - y^2 + 2y - 4x)
Sanjog then spotted and corrected a small error in the variance expression in Darren's derivation; this is now acknowledged on Darren's website. Full details are in the R script now committed in SVN. The R code for the Gibbs sample can therefore be written as follows below. Note that this uses thinning to minimize serial correlation in the conditional densities--which renders the computation more demanding as 'N times thin' draws have to be generated:f(x y) = (x^2)*exp(-x*(4+y*y)) ## a Gamma density kernel f(y x) = exp(-0.5*2*(x+1)*(y^2 - 2*y/(x+1)) ## a Gaussian kernel
A second variant can be computed using the R bytecode compiler which appeared with the recent release of R 2.13.0 (and which we analysed in this blog post from April). This is as easy as## Here is the actual Gibbs Sampler ## This is Darren Wilkinsons R code (with the corrected variance) ## But we are returning only his columns 2 and 3 as the 1:N sequence ## is never used below Rgibbs <- function(N,thin) mat <- matrix(0,ncol=2,nrow=N) x <- 0 y <- 0 for (i in 1:N) for (j in 1:thin) x <- rgamma(1,3,y*y+4) y <- rnorm(1,1/(x+1),1/sqrt(2*(x+1))) mat[i,] <- c(x,y) mat
Thanks to Rcpp and the inline package, we can also write a C++ variant that can be built and launched from R with ease. The C++ code is assigned to an R text variable## We can also try the R compiler on this R function RCgibbs <- cmpfun(Rgibbs)
gibbscode. (And we used to typeset such
code on the blog as a character string, ie in a faint red color---but have now switched to highlight it as if it were freestanding C++
code. It really is passed as a single string to R which then uses the cxxfunction() to compile, link and load a C++ function
built around the code. See previous posts on the inline package for more.)
It is noteworthy how the code logic is essentially identical between the basic R version, and the C++ version. Two nested loops control draws of x from a Gamma distribution, conditional on y, as well as draws of y from a Normal, conditional on x. Add a small amount of parameter passing to obtain the parameters## Now for the Rcpp version -- Notice how easy it is to code up! gibbscode <- ' using namespace Rcpp; // inline does that for us already // n and thin are SEXPs which the Rcpp::as function maps to C++ vars int N = as<int>(n); int thn = as<int>(thin); int i,j; NumericMatrix mat(N, 2); RNGScope scope; // Initialize Random number generator // The rest of the code follows the R version double x=0, y=0; for (i=0; i<N; i++) for (j=0; j<thn; j++) x = ::Rf_rgamma(3.0,1.0/(y*y+4)); y = ::Rf_rnorm(1.0/(x+1),1.0/sqrt(2*x+2)); mat(i,0) = x; mat(i,1) = y; return mat; // Return to R ' # Compile and Load RcppGibbs <- cxxfunction(signature(n="int", thin = "int"), gibbscode, plugin="Rcpp")
N and thin, allocation of a results matrix and setup of the random number generator state
to remain consistent with R, as well as a return of the matrix---and that is all.
As Darren's code uses the GNU GSL in its C variant, I also became interested in seeing how a C/C++ hybrid variant using our
RcppGSL package would fare. The code is below.
This code is similar to the version using just Rcpp, but we need to allocate space for the GSL random generator object (and later release that memory allocation), and we do of course call the GSL functions. This also necessitates declaring the function using the two header files listed as arguments for thegslgibbsincl <- ' #include <gsl/gsl_rng.h> #include <gsl/gsl_randist.h> using namespace Rcpp; // just to be explicit ' gslgibbscode <- ' int N = as<int>(ns); int thin = as<int>(thns); int i, j; gsl_rng *r = gsl_rng_alloc(gsl_rng_mt19937); double x=0, y=0; NumericMatrix mat(N, 2); for (i=0; i<N; i++) for (j=0; j<thin; j++) x = gsl_ran_gamma(r,3.0,1.0/(y*y+4)); y = 1.0/(x+1)+gsl_ran_gaussian(r,1.0/sqrt(2*x+2)); mat(i,0) = x; mat(i,1) = y; gsl_rng_free(r); return mat; // Return to R ' ## Compile and Load GSLGibbs <- cxxfunction(signature(ns="int", thns = "int"), body=gslgibbscode, includes=gslgibbsincl, plugin="RcppGSL")
include argument of
cxxfunction().
So how is the performance?
The script (now committed in Rcpp's SVN repo as
examples/RcppGibbs/RcppGibbs.R, and also part of the next release) creates the output below when running in non-interactive
mode (whereas interactive mode creates a few charts too):
edd@max:~/svn/rcpp/pkg/Rcpp/inst/examples/RcppGibbs$ r RcppGibbs.R
Replication # 1 complete
Replication # 2 complete
Replication # 3 complete
Replication # 4 complete
N=1000 N=5000 N=10000 N=20000
Elasped Time (R) 0.124 2.650 10.511 41.773
Elasped Time (RC) 0.081 1.916 7.594 30.280
Elapsed Time (Rcpp) 0.003 0.076 0.306 1.221
Elapsed Time (Rgsl) 0.002 0.049 0.196 0.784
SpeedUp Rcomp. 1.530 1.380 1.380 1.380
SpeedUp Rcpp 41.330 34.870 34.350 34.210
SpeedUp GSL 62.000 54.080 53.630 53.280
test replications elapsed relative user.self sys.self
4 GSLGibbs(N, thn) 10 7.845 1.000000 7.84 0
3 RcppGibbs(N, thn) 10 12.218 1.557425 12.22 0
2 RCgibbs(N, thn) 10 312.296 39.808286 311.98 0
1 Rgibbs(N, thn) 10 420.953 53.658764 420.59 0
The first block is a hand-computed comparison using four sets of parameters; the second block uses the excellent rbenchmark package to
compare ten runs at twenty-thousand draws.
We see a nominal increase in performance due to the bytecode compiler, saving roughly 38 percent which seems appropriate given that the R
code mostly controls the loops; actual work in undertaken in the already compiled RNG functions. The Rcpp variant is about 34 times faster
than the pure R code. Sanjog reported higher increases on his OS X machines (and Darren's post echos a similar order of
magnitude). However, on my i7 running Linux I always obtained an improvement in the mid- to high thirties. That is certainly already a
rather pleasant result.
What surprised and stunned me at first was that the GSL solution scores an improvement of around 53 times (close to the factor of 60
reported by Darren). A closer look at the code (shown above) makes it clear that there are very few compute-intensive operations outside of
the RNG draws. I validated this further with a second study timing just one million draws each from a Gaussian and Gamma using R via Rcpp,
and using the GSL. It turns out that the R code is about 2.5 times slower for random draws from the Gamma distribution than the GSL. Inspection of the
source code---in files src/nmath/rgamma.c for R and randist/gamma.c for the GSL shows why. R uses a much more complex
(and presumably more precise) algorithm. I may follow up with Martin Maechler to see if we can illustrative the numerical benefits of this
more expensive approach---this blog entry is getting long enough already.
So to sum up: Gibbs sampling is a somewhat resource-heavy Monte Carlo Markov Chain method for investigating multivariate distributions. R excels at
quick and simple explorations, albeit at somewhat slower execution speed. The
Rcpp package can help by providing easy
means to accelerate simulations by a significant factor. The example discussed here is now in SVN repository for
Rcpp and will be part of the next release.
Updated 2011-07-16: Darren has just updated his comparison; fixed two typos here too.
Deutsche Version dieses Postings read the English Version instead Der Leiter der Abteilung Systemadministration einer Firma, welche in diesem Artikel ungenannt bleiben soll, wo der Zufall es will, da ich f r sie arbeite, m chte uns Mitarbeiter dazu zwingen, das Feature der persistenten Historie (also einen niedergeschriebenen Verlauf der abgesetzten Befehle) der Shell (Kommandozeile) auf allen Systemen zu benutzen. Nun hat die mksh dies vern nftigerweise, w hrend immer noch verf gbar, standardm ig aus Gr nden der Privatsph re deaktiviert, und ich finde, dies sollte sich nicht ndern. Es kann ja nicht sein, da man mir beim Arbeiten ber die Schulter guckt; was kommt als n chstes, Video berwachung der B ros? (Seine Argumentation l uft darauf hinaus, da er nachvollziehen/verstehen kann, wie ich (ha! ich! nicht die anderen, nein, ich!) ein Problem das letzte Mal gel st habe; es ist aber nichts anderes als rekonstru eren zu k nnen, wer wann was eingetippt/gemacht hat. Naja, Argumentationen sind eh relativ, andere jagen Flugzeuge in ihre eigenen Verteidigungsministerien, welche gerade zuf llig umgebaut werden ) Ich habe dies nat rlich in die F hrungsetage eskaliert, und unser Gesch ftsf hrer versteht meine Bedenken und m chte nun ein Gespr ch anraunen, um eine L sung zu finden. Die meisten meiner Kollegen im Bereich Systemadministration denken leider nichtmals dr ber nach, obschon ich in anderen Bereichen Gleichgesinnte gefunden habe. Einen Betriebsrat haben wir auch gro er Fehler, ich wei nicht (aber ich s e eh nicht drin, ich hasse Politik jeder Art). Dies l t mich in dringender Not, Argumente wider diese Total berwachung aller (insbesondere auf der Kommandozeile arbeitenden also besonders mich) Kollegen zu finden, idealerweise solche, die durch deutsches Recht gest tzt sind. Wenn ihr solche habt, bitte mailt die schnell an meine eMail-Adresse, welche da nicht junk@mirbsd.org lautet, sondern mit einem tg vor dem Klammeraffen (dies dient der Abwehr unerw nschter Werbemails). Vielen Dank bereits im Voraus! Update 12.07.2011: Wir haben geredet, und wie viele kommentierten keine L sung auf rechtlicher Ebene gefunden, sondern stattdessen, nachdem wir festgestellt hatten, da mir dieses Problem sehr am Herzen liegt, nach anderen L sungen f r das eigentliche Ziel des Chefadmins gesucht; dies z hlt als ein Entgegenkommen auf Seiten der Firma. Ich habe zugestimmt, meine L sungen in kleine Skripte zu verpacken und ins VCS zu committen f r das Herausfinden, wann was auf einem Server ge ndert wurde, im Fehlerfall, denken wir uns gerade ohnehin was aus. Danke an alle, die kommentiert haben!
[283808.667454] radeon 0000:01:00.0: ffff88021f815c00 unpin not necessaryThe time between going black reduces every time. The system wasn t usable any more in the end. After testing that the screen was going blank on other systems like a live CD of Ubuntu and a not noteworthy proprietary system, it was clear that some hardware component was dying. My first assumption was verified after replacing it: My graphic card, a Radeon HD 4670, died. This was three weeks ago and around 25 month after I bought the graphics card. So I didn t have to worry if replacing the fan voided the guarantee, because the guarantee lasts only 24 month. Conclusion:
[283808.667820] radeon 0000:01:00.0: GPU softreset
[283808.667823] radeon 0000:01:00.0: R_008010_GRBM_STATUS=0xE57024A4
[283808.667825] radeon 0000:01:00.0: R_008014_GRBM_STATUS2=0 00330302
[283808.667826] radeon 0000:01:00.0: R_000E50_SRBM_STATUS=0x200000C0
[283808.667832] radeon 0000:01:00.0: R_008020_GRBM_SOFT_RESET=0x00007FEE
[283808.682844] radeon 0000:01:00.0: R_008020_GRBM_SOFT_RESET=0 00000001
[283808.698840] radeon 0000:01:00.0: R_008010_GRBM_STATUS=0 00003028
[283808.698843] radeon 0000:01:00.0: R_008014_GRBM_STATUS2=0 00000002
[283808.698845] radeon 0000:01:00.0: R_000E50_SRBM_STATUS=0x200000C0
[283808.699845] radeon 0000:01:00.0: GPU reset succeed
[283808.717570] [drm] Clocks initialized !
[283808.765829] [drm] ring test succeeded in 0 usecs
[283808.765838] [drm] ib test succeeded in 1 usecs
[283808.765840] [drm] Enabling audio support
[283812.521265] radeon 0000:01:00.0: GPU lockup CP stall for more than 1000msec
[283812.521269] [ cut here ]
[283812.521294] WARNING: at /build/buildd/linux-2.6.35/drivers/gpu/drm/radeon/radeon_fence.c:235 radeon_fence_wait+0 365/0x3d0 [radeon]()
[283812.521297] Hardware name:
[283812.521299] GPU lockup (waiting for 0x00AE670A last fence id 0x00AE6705)
[283812.521301] Modules linked in: btrfs zlib_deflate crc32c libcrc32c ufs qnx4 hfsplus hfs minix ntfs vfat msdos fat jfs xfs exportfs reiserfs nls_utf8 udf ip6table_filter ip6_tables binfmt_misc ipt_MASQUERADE iptable_nat nf_nat nf_conntrack_ipv4 nf_defrag_ipv4 xt_state nf_conntrack ipt_REJECT xt_tcpudp iptable_filter ip_tables x_tables bridge stp kvm_intel kvm parport_pc ppdev snd_emu10k1_synth snd_emux_synth snd_seq_virmidi snd_seq_midi_emul snd_emu10k1 snd_ac97_codec ac97_bus snd_pcm snd_page_alloc snd_util_mem snd_hwdep snd_seq_midi radeon snd_rawmidi snd_seq_midi_event snd_seq snd_timer snd_seq_device ttm snd pl2303 drm_kms_helper coretemp usbserial joydev psmouse soundcore drm serio_raw intel_agp i2c_algo_bit lp parport hid_cherry usbhid hid firewire_ohci firewire_core usb_storage crc_itu_t e1000e ahci libahci pata_marvell
[283812.521360] Pid: 2194, comm: compiz Tainted: G W 2.6.35-24-generic #42-Ubuntu
[283812.521362] Call Trace:
[283812.521370] [<ffffffff8106089f>] warn_slowpath_common+0x7f/0xc0
[283812.521374] [<ffffffff81060996>] warn_slowpath_fmt+0 46/0 50
[283812.521390] [<ffffffffa01bd775>] radeon_fence_wait+0 365/0x3d0 [radeon]
[283812.521394] [<ffffffff8107f730>] ? autoremove_wake_function+0 0/0 40
[283812.521410] [<ffffffffa01bdf71>] radeon_sync_obj_wait+0 11/0 20 [radeon]
[283812.521418] [<ffffffffa01751a3>] ttm_bo_wait+0 103/0x1c0 [ttm]
[283812.521435] [<ffffffffa01d4e1a>] radeon_gem_wait_idle_ioctl+0x9a/0 150 [radeon]
[283812.521447] [<ffffffffa010f433>] drm_ioctl+0 463/0 520 [drm]
[283812.521465] [<ffffffffa01d4d80>] ? radeon_gem_wait_idle_ioctl+0 0/0 150 [radeon]
[283812.521470] [<ffffffff81162f0d>] vfs_ioctl+0x3d/0xd0
[283812.521473] [<ffffffff811637e1>] do_vfs_ioctl+0 81/0 340
[283812.521477] [<ffffffff811535f1>] ? vfs_read+0 181/0x1a0
[283812.521480] [<ffffffff81163b21>] sys_ioctl+0 81/0xa0
[283812.521484] [<ffffffff8100a0f2>] system_call_fastpath+0 16/0x1b
[283812.521487] [ end trace 6d5e03bab743abfa ]
[283812.521493] [drm] Disabling audio support
[283812.525575] [drm:radeon_ib_schedule] *ERROR* radeon: couldn t schedule IB(10).
[283812.525579] [drm:radeon_cs_ioctl] *ERROR* Faild to schedule IB !
[283812.527021] [drm:radeon_ib_schedule] *ERROR* radeon: couldn t schedule IB(11).
[283812.527024] [drm:radeon_cs_ioctl] *ERROR* Faild to schedule IB !
[283812.527921] [drm:radeon_ib_schedule] *ERROR* radeon: couldn t schedule IB(12).
[283812.527923] [drm:radeon_cs_ioctl] *ERROR* Faild to schedule IB !
I have bought a Samsung Galaxy S Android phone some time
ago. One of the first thing that you try to do with such a phone is to
switch to some alternate firmware (the coined term is ROM ), like
CyanogenMod. Flashing a firmware is a whole new universe. You
are told about a lot of proprietary tools, you need to download a lot
of things from MegaUpload and friends and nobody really explains
what s going on under the hood. I was a bit lost at first.
I will not provide a step-by-step guide since I cannot afford to stay
up-to-date. Such a guide is usually posted on some forum. It assumes
you are running Windows and provides appropriate download links. You
must follow it (and check that it is recent enough). I will just
provide you some background to understand those guides.
$ git clone https://github.com/Benjamin-Dobell/Heimdall.git Cloning into Heimdall... remote: Counting objects: 423, done. remote: Compressing objects: 100% (271/271), done. remote: Total 423 (delta 220), reused 332 (delta 138) Receiving objects: 100% (423/423), 5.91 MiB 962 KiB/s, done. Resolving deltas: 100% (220/220), done. $ cd Heimdall/heimdall $ sudo apt-get install libusb-1.0-0-dev $ ./configure && make [...] $ sudo cp 60-heimdall-galaxy-s.rules /etc/udev/rules.d $ sudo /etc/init.d/udev reload
$ ./heimdall print-pit
IBL+PBL is the boot loader, be extra careful with it;PIT is the partition table;EFS contains some important data like IEMEI, be extra careful with it;SBL is the second boot loader;SBL2 is the backup of the second boot loader;PARAM contains some images used as various stage of the boot process;KERNEL is the kernel;RECOVERY is the backup of the kernel;FACTORYFS contains /system file system which is some kind of
root file system;DBDATA contains /data file system which is the database to
store application parameters;CACHE contains /cache file system which contains the Dalvik cache;MODEM contains the firmware for the modem.flash subcommand.
$ tar zxvf ~/download/android-sdk_r11-linux_x86.tgz $ cd android-sdk-linux_x86 $ tools/android update sdk [select Android SDK Platform-tools] $ platform-tools/adb shell # uname -a Linux localhost 2.6.35.7-I9000XWJVH-CL184813 #Dark_Core_2.4 PREEMPT Mon May 16 15:02:38 EEST 2011 armv7l GNU/Linux
shell to get a shell on the device;reboot recovery to reboot in recovery mode;reboot download to reboot in download mode;push to put a file on the phone;pull to retrieve a file;install to install an application from its APK;logcat to see the logs and what happens, very useful!adb and heimdall. You need to grab
some official firmware and extract boot.bin and
Sbl.bin from it.
$ adb reboot download $ heimdall flash --primary-boot ~/download/boot.bin --secondary-boot ~/download/Sbl.bin
$ ./heimdall flash --repartition --pit s1_odin_20100512.pit \ > --factoryfs factoryfs.rfs \ > --cache cache.rfs --dbdata dbdata.rfs \ > --param param.lfs --modem modem.bin \ > --kernel zImage --secondary-boot Sbl.bin Claiming interface again... Success Setting up interface... Success Beginning session... Handshaking with Loke... Success Uploading PIT PIT upload successful Uploading SBL 100% SBL upload successful Uploading KERNEL 100% KERNEL upload successful Uploading MODEM 100% MODEM upload successful Uploading PARAM 100% PARAM upload successful Uploading FACTORYFS 100% FACTORYFS upload successful Uploading DBDATAFS 100% DBDATAFS upload successful Uploading CACHE 100% CACHE upload successful Ending session... Rebooting device...
I have bought a Samsung Galaxy S Android phone some time
ago. One of the first thing that you try to do with such a phone is to
switch to some alternate firmware (the coined term is ROM ), like
CyanogenMod. Flashing a firmware is a whole new universe. You
are told about a lot of proprietary tools, you need to download a lot
of things from MegaUpload and friends and nobody really explains
what s going on under the hood. I was a bit lost at first.
I will not provide a step-by-step guide since I cannot afford to stay
up-to-date. Such a guide is usually posted on some forum. It assumes
you are running Windows and provides appropriate download links. You
must follow it (and check that it is recent enough). I will just
provide you some background to understand those guides.
$ git clone https://github.com/Benjamin-Dobell/Heimdall.git Cloning into Heimdall... remote: Counting objects: 423, done. remote: Compressing objects: 100% (271/271), done. remote: Total 423 (delta 220), reused 332 (delta 138) Receiving objects: 100% (423/423), 5.91 MiB 962 KiB/s, done. Resolving deltas: 100% (220/220), done. $ cd Heimdall/heimdall $ sudo apt-get install libusb-1.0-0-dev $ ./configure && make [...] $ sudo cp 60-heimdall-galaxy-s.rules /etc/udev/rules.d $ sudo /etc/init.d/udev reload
$ ./heimdall print-pit
IBL+PBL is the boot loader, be extra careful with it;PIT is the partition table;EFS contains some important data like IEMEI, be extra careful with it;SBL is the second boot loader;SBL2 is the backup of the second boot loader;PARAM contains some images used as various stage of the boot process;KERNEL is the kernel;RECOVERY is the backup of the kernel;FACTORYFS contains /system file system which is some kind of
root file system;DBDATA contains /data file system which is the database to
store application parameters;CACHE contains /cache file system which contains the Dalvik cache;MODEM contains the firmware for the modem.flash subcommand.
$ tar zxvf ~/download/android-sdk_r11-linux_x86.tgz $ cd android-sdk-linux_x86 $ tools/android update sdk [select Android SDK Platform-tools] $ platform-tools/adb shell # uname -a Linux localhost 2.6.35.7-I9000XWJVH-CL184813 #Dark_Core_2.4 PREEMPT Mon May 16 15:02:38 EEST 2011 armv7l GNU/Linux
shell to get a shell on the device;reboot recovery to reboot in recovery mode;reboot download to reboot in download mode;push to put a file on the phone;pull to retrieve a file;install to install an application from its APK;logcat to see the logs and what happens, very useful!adb and heimdall. You need to grab
some official firmware and extract boot.bin and
Sbl.bin from it.
$ adb reboot download $ heimdall flash --primary-boot ~/download/boot.bin --secondary-boot ~/download/Sbl.bin
$ ./heimdall flash --repartition --pit s1_odin_20100512.pit \ > --factoryfs factoryfs.rfs \ > --cache cache.rfs --dbdata dbdata.rfs \ > --param param.lfs --modem modem.bin \ > --kernel zImage --secondary-boot Sbl.bin Claiming interface again... Success Setting up interface... Success Beginning session... Handshaking with Loke... Success Uploading PIT PIT upload successful Uploading SBL 100% SBL upload successful Uploading KERNEL 100% KERNEL upload successful Uploading MODEM 100% MODEM upload successful Uploading PARAM 100% PARAM upload successful Uploading FACTORYFS 100% FACTORYFS upload successful Uploading DBDATAFS 100% DBDATAFS upload successful Uploading CACHE 100% CACHE upload successful Ending session... Rebooting device...
config-edit -application lcdproc -forceThe -force option is required to load the file the first time. (because the default LCDd.conf file contains configuration options for all drivers, even though only one them if usefull). You will get this screen:
## This file was written by Config::Model ## You may modify the content of this file. Configuration ## modifications will be preserved. Modifications in ## comments may be mangled. # LCDd.conf -- configuration file for the LCDproc server daemon LCDd # # This file contains the configuration for the LCDd server. # # The format is ini-file-like. It is divided into sections that start at # markers that look like [section]. Comments are all line-based comments, # and are lines that start with ' # # The server has a 'central' section named [server]. For the menu there is # a section called [menu]. Further each driver has a section which # defines how the driver acts. # # The drivers are activated by specifiying them in a driver= line in the # server section, like: # # Driver=curses # # This tells LCDd to use the curses driver. # The first driver that is loaded and is capable of output defines the # size of the display. The default driver to use is curses. # If the driver is specified using the -d command line option, # the Driver= options in the config file are ignored. # # The drivers read their own options from the respective sections. [server] # Where can we find the driver modules ? # IMPORTANT: Make sure to change this setting to reflect your # specific setup! Otherwise LCDd won't be able to find # the driver modules and will thus not be able to # function properly. # NOTE: Always place a slash as last character ! DriverPath=/usr/lib/lcdproc/ # Tells the server to load the given drivers. Multiple lines can be given. # The name of the driver is case sensitive and determines the section # where to look for further configuration options of the specific driver # as well as the name of the dynamic driver module to load at runtime. # The latter one can be changed by giving af File= directive in the # driver specific section. # # The following drivers are supported: # bayrad, CFontz, CFontz633, CFontzPacket, curses, CwLnx, ea65, # EyeboxOne, g15, glcdlib, glk, hd44780, icp_a106, imon, imonlcd, # IOWarrior, irman, joy, lb216, lcdm001, lcterm, lirc, lis, MD8800, # mdm166a, ms6931, mtc_s16209x, MtxOrb, mx5000, NoritakeVFD, picolcd, # pyramid, sed1330, sed1520, serialPOS, serialVFD, shuttleVFD, sli, # stv5730, svga, t6963, text, tyan, ula200, xosd Driver=imonlcd # Tells the driver to bind to the given interface Bind=127.0.0.1 # Listen on this specified port; defaults to 13666. Port=13666 ReportLevel=3 # Sets the reporting level; defaults to 2 (warnings and errors only). # ReportLevel=3 # Should we report to syslog instead of stderr ? [default: no; legal: yes, no] # ReportToSyslog=yes # User to run as. LCDd will drop its root priviledges, if any, # and run as this user instead. User=nobody Foreground=no Hello= Hello Hello= LCDproc! GoodBye= GoodBye GoodBye= LCDproc! # The server will stay in the foreground if set to true. # Foreground=no # Hello message: each entry represents a display line; default: builtin # Hello=" Welcome to" # Hello=" LCDproc!" # GoodBye message: each entry represents a display line; default: builtin # GoodBye="Thanks for using" # GoodBye=" LCDproc!" # Sets the default time in seconds to displays a screen. WaitTime=5 # If yes, the the serverscreen will be rotated as a usual info screen. If no, # it will be a background screen, only visible when no other screens are # active. The special value 'blank' is similar to no, but only a blank screen # is displayed. [default: on; legal: on, off, blank] # ServerScreen=no # Set master backlight setting. If set to 'open' a client may control the # backlight for its own screens (only). [default: open; legal: off, open, on] # Backlight=open # Set master heartbeat setting. If set to 'open' a client may control the # heartbeat for its own screens (only). [default: open; legal: off, open, on] # Heartbeat=open # set title scrolling speed [default: 10; legal: 0-10] # TitleSpeed=10 # The "...Key=" lines define what the server does with keypresses that # don't go to any client. # These are the defaults: ToggleRotateKey=Enter PrevScreenKey=Left NextScreenKey=Right ScrollUpKey=Up ScrollDownKey=Down # ScrollUpKey=Up # ScrollDownKey=Down # If you have only 4 keys, you can choose to use this: # ToggleRotateKey=Enter # PrevScreenKey=Up # NextScreenKey=Down # If you have only 3 keys, you can choose to use this: # ToggleRotateKey=Enter # PrevScreenKey=Up [menu] # You can configure what keys the menu should use. Note that the MenuKey # will be reserved exclusively, the others work in shared mode. # The following works excellent with 4 keys or more. MenuKey=Escape EnterKey=Enter UpKey=Up DownKey=Down LeftKey=Left RightKey=Right [imonlcd] Protocol=0 OnExit=2 Device=/dev/lcd0 # My fishes dont like the glow Backlight=off DiscMode=0You will notice a few things:
sudo config-edit -application lcdprocThe -force option is no longer needed. If you don t like to click, you can run:
config-edit -application lcdproc -ui none -saveFor instance:
config-edit -application lcdproc -ui none -save 'server driver=imonlcd - imonlcd Device="/dev/lcd1" 'Further reading If you want to know more about lcdproc model, you can view:
I uploaded a new upstream version of the ttf-oldstandard font. The new
version is a real 2.2 while the former was numbered 2.02 by upstream
but got accidentally numbered 2.2 by us, packagers.. The occasion was
good and I renamed the source package to follow the
"yes-yes-yes-soon-to-be-published" fonts packaging policy for
naming. The new package is "fonts-oldstandard".
A new upstream version of samba was released and I packaged it just
after the last 3.5.8 package entered testing. Samba
is now 3.5.9 in unstable. I should work on backporting (for
backport.debian.org) what's entered
in testing, by the way.
I sent l10n NMU proposals for unattended-upgrades, memtest86+, cacti.
I also NMUed memtest86 (still in DELAYED).
Over the course of the last five years, some relatives of me and I have been working on a family book which lists all descendants of my grandgrandgrandgrandfather Isaak Riehm, born 1799, and his wife Charlotte. My task was everything related to maintaining the data, running the infrastructure and generating the final book. In the end, we have collected biographical details, often with the person s live story, of 703 descendants, 285 partners and 416 parents-in-law. Together with an extensive preface the book now has a respectable size of 401 pages, includes 144 pictures and maps and over 200 copies have been printed and sold through the family.
Although I do not think that the details of the lives of my family is very interesting for the general public, or even suitable for general release, I do want to show the fruit of our work. Therefore, I have created a stripped-down on-line version that only covers the first four generations. I bundled the book body with the cover and the end sheets into one complete PDF file (caution, large: 54MB, and of course in German).
Some nifty embellishments of the book that I especially like are the abstract looking descendant fan in the front-end and back-end sheets, the separating bars between the persons which indicate the livespan of that person between 1799 and 2011 and the maps of the birth places and Isaak s travel destinations in the preface.
Now to the technical details: Naturally, I used only Free Software in the genesis of the work (The cover is an exception, as it was not created by me). The most important is definitely gramps, a free genealogy system that held all our data. It is written in python and extensible with plug-ins, so I was able to create a custom report that takes the data relevant for us, filters for people who have agreed to appear in the book, and then generate LaTeX code that typesets the book, ready to be printed. I learned a great deal of LaTeX for this project, which uses over 30 different packages and required me to create a font of my own (which, as a side product, lead to a publication in the Linux-Magazin).
For the maps I found the Generic Mapping Tools (GMT) and the freely available data for that of great use. I still had to manually collect the coordinates for all the places I wanted to show up in the map. Here, I relied mostly on Wikipedia.
The fan which appears in the end sheets is laid out using a Haskell program (naturally, I have to use Haskell somewhere).

I am going to DebCamp11 and DebConf11. I hope I can do some productive work with the website team, as well for the DSA team. Maybe I can find someone for a little skill-exchange regarding pylons.
I was travelling on a train today, and got a seat at a table, with a power
socket. I decided to do some coding to pass the time, and picked the
task of measuring the speed of summain,
my tool for generating manifests of directory trees. Think
md5sum or sha1sum, but printing out much of the inode information:
the goal being that if I can diff manifests before a backup and
after a restore and see that everything is OK.
So I wrote a little script to time any checksummer for a particular
set of files, and got the following results:
113 ./summain
112 md5sum
114 sha1sum
121 sha512sum
It doesn't look like I need to actually optimize it at all: it's
already as fast as md5sum and sha1sum, even though it's written
in pure Python. (That's cause it uses the Python standard library
module hashlib, which is, of course, pure C.)
Here's a sample output from summain, for the curious:
Name: README
Mtime: 2011-02-13 09:59:09.000000 +0000
Mode: 100644
Ino: 1
Dev: 1
Nlink: 1
Size: 1256
Uid: 1000
Username: liw
Gid: 1000
Group: liw
Sha-1: b7fa5517ea20311d13128312456c0dba3da3b11d
Luckily I had some other things I could work on, so the rest of the
train ride wasn't too boring.
I've finished importing the usenet archive for
oldusenet. The fun part was parsing the dates to
put the posts in order.
No date format was really required on usenet, and so a wide variery of
formats were used. Some posts didn't have a Date, but a guess could be made
from their Message-ID. Some posts had absurd dates (ie, 1969, 1995), others
had dates that were correct in every way.. except the year was left out
(oops). One early post had a date of "_".
Still, this excerpt of my code managed to parse the rest and so gives a
fairly complete picture of how messy dates can possibly be. Read and weep.
p anyzone "%d %b %y %T" "15 Jun 88 02:27:41 GMT"
, p anyzone "%a, %d %b %y %T" "Thu, 22 Jun 89 20:02:03 GMT"
, p anyzone "%a, %d-%b-%y %T" "Thu, 15-Jun-89 18:01:56 EDT"
, p anyzone "%d %b %y %T" "8 Jan 90 14:07:27 -0400"
, p anyzone "%d %b %y %H:%M" "4 Oct 89 19:56 GMT"
, p anyzone "%a, %d %b %y %H:%M" "Thu, 23 May 91 02:13 PDT"
, p anyzone "%a, %d %b %Y %T" "Thu, 23 May 1991 07:07:00 -0400"
, p anyzone "%a, %d %b %Y %H:%M" "Sat, 18 May 1991 17:28 CDT"
, p anyzone "%d %b %Y %T" "11 Apr 1991 12:02:01 GMT"
, p anyzone "%d-%b-%y %H:%M" "24-Mar-90 14:22 CST"
, p anyzone "%d %b %y, %T" "22 May 91, 16:31:37 EST"
, p anyzone "%d %b %Y %H:%M" "30 June 1991 17:15 -0400"
, p anyzone "%a, %d %b T %T" "Fri, 8 Feb T 09:49:39 EST"
-- special cases
, p (tzconst est) "%a %b %d %T EST %Y" "Tue Jan 11 12:44:36 EST 1983"
, p (tzconst est) "%a %b %d %T EST %y" "Tue Jan 11 12:44:36 EST 83"
, p (tzconst edt) "%a %b %d %T EDT %Y" "Tue Jan 11 12:44:36 EDT 1983"
, p (tzconst edt) "%a %b %d %T EDT %y" "Tue Jan 11 12:44:36 EDT 83"
, p (tzconst utc) "%a %b %d %T GMT %Y" "Thu Nov 1 23:14:37 GMT 1990"
, p (tzconst pdt) "%d %b %y %T -7" "11 Jun 91 15:41:21 -7"
-- dates with no timezone specified are guessed
, p nozone "%d %b %y %T" "9 Jan 90 09:33:59"
, p nozone "%d %b %Y %T" "10 APR 1990 05:25:28"
, p nozone "%a %b %d %T %Y" "Fri Feb 6 00:19:47 1981"
, p nozone "%a %b %d %T %y" "Fri Feb 6 00:19:47 81"
, p nozone "%Y-%m-%d %T" "1981-11-12 18:31:01"
, p nozone "%y-%m-%d %T" "81-11-12 18:31:01"
, p nozone "%a, %d %b %y %T" "Sat, 13 Apr 91 08:37:57"
, p nozone "%a, %d %b %Y %T" "Sun, 16 Jun 1991 13:23:02"
, p nozone "%d %b, %Y %T" "1 May, 1991 00:00:00"
, p nozone "%d %b %y %H:%M" "8 Jan 88 18:03"
, p nozone "%a, %d %b %y %H:%M" "Wed, 29 May 91 17:14"
, p nozone "1 %b %d %T %Y" "1 Jan 08 20:59:08 1991"
-- this has to come near the end, as it matches greedily
, g nozone "%a %b %d %T %Y (" "Wed Oct 27 17:02:46 1982 (Tuesday)"
, g nozone "%a, %d %b %y %T +" "Tue, 21 May 91 16:46:01 +22323328"
-- extract date from message-id headers
-- (used for messages with no Date field)
, g nozone "<%Y%b%d.%H%M%S." "<1989Jul6.214048.28313@jarvis.csri.toronto.edu>"
(Parsing the often ambiguous, malformed, etc timezones was fun all its own
too, of course.)
Disclaimer: There is a huge discussion going on right now in the debian-devel mailing list, about different ways to rearrange how Debian development happens, and maybe to provide a Debian users with an additional release. This blog entry is not a comment on that discussion, which I am ignoring. The discussion did, however, prompt a dent about "test driven development". That prompted a short exchange of thoughts with Tom Marble, and this blog post is a cleaned up version of my part in that discussion.Currently Debian development happens roughly like this: all packages are uploaded to a part of the Debian archive called unstable. Once they've been in use for a while without serious problems, they get automatically copied into another part called testing. Every year or two, testing is frozen and any remaining problems are fixed, after which all of testing gets copied into yet another part of the archive called stable, and that's the actual release. There is a little bit of automatic testing, but only a little. Almost all testing is done by people, by them using unstable or testing on their usual computers. If they have problems, they report them. Contrast this with development using Test Driven Development, or TDD, and other modern development methodologies. Here's a rough summary of what I do when I write (much) of my software.
My last update about running activities is dated back to Paris
Marathon (April 10th). Time for a new update, then.
After a very busy end March-early April, with that crazy succession of
55km Ecotrail and 42km Paris marathon with only two weeks between both, I
needed a kind of "break".
Moreover, I had another goal set with the 35m trail race named "Trail
des Cerfs", on May 15th, in my neighbourhood.
So, end of April was a little bit quieter. Still, one week after
Paris marathon, I completed a very hard trail run in Seine Valley:
only 18km, but about 600-700m positive slope. That was indeed a good
moutain-style run (yes, in Seine valley....) and a good way to check
that I recovered quite well.
Later on, I slowed down a little with even a Sunday (24th) where I
*didn't run at all*..:-).. Just a few short uns during the week and a
short Saturday run.
Well, that was indeed Easter Sunday and Monday is a holiday in France,
so I ran an half-marathon on 25th...:-)...on a loop where I already
have some references, the fastest being 1h46. This time it was
1h52'...but, well, that was two weeks after a marathon...
Still, a small pain at the back of my ankle decided me to stop running
long distances until May 15th. So, I only did short trainings up to no
more than 12km, even during my stay in Germany for SambaXP.
As a consequence, I was very well for the 35km (600m positive slope)
Trail
des Cerfs, which I completed in 3h31', 168th out of 328
runners. More interestingly, I completed it in negative split with a
much faster second half, ending up at about 12km/h. For seomthing that
(given the slope and the nature of the paths) is comparable to a
marathon, that's very promising.
The rest of May was spent quietly with a standard training and
progressively resuming longer distances. I originally planned to do my
spring solo marathon on May 28th in Versailles Castle park, but I
stopped at km28 and completed the distance two days after with a 14km
run..:-)... Stopping was wiser as I was feeling that the last loop
would have been a great pain. That was indeed the first time I give up
on a marathon. I prefer this to happen for a non official race, after
all!
June will not see any "big goal". I might be running one race
somewhere in my neighbourhood but the point will mostly be
accumulating kilometers before summer. Summer (which includes DebConf
that makes training a little bit more hectic) will not see any race,
probably (unless I find one in banja Luka!) but more some specific
preparation for Berlin marathon. Here, the "safe" target for me is,
first, breaking my record. I'm probably not ready for 3h30 and even
3h35 might be difficult. It seems that I'm now reaching a barrier
where progress becomes harder. Before Berlin, I'll run the Bois d'Arcy
half-marathon, two weeks before. Last year, I managed to set a very
good mark, there, with 1h37. Not sure that i'll try to break this only
two weeks before Berlin.
After Berlin? We'll see, but my last big goal of the year will be the
67km "Le Puy-Firminy" night race, in November (no web site, this is indeed a
"small" local race). Yet another adventure beyond
marathon distances, in the unknown...
I've made a first release of GNOME Prepaid Manager a couple of days ago
after switching to GTK+3, GSettings and PyGObject's GObject introspection but
it still wasn't that useful since the very common Huawei chipsets (present in
many UMTS USB sticks) weren't working due to some missing code in
ModemManager.
Thanks to Dan's great description I just got around to add that which
should make ppm useful to more people.
This blog is flattr enabled.
At April 30, I took over maintenance of of
Debian's kFreeBSD
autobuilders. Means getting something
like 4,5k e-Mails this month (gladly no need to sign all those 4k
successful builds any more!), filling nearly 30 RC Bugs (quite a lot
of which got fixed just within hours after filling, wow!),
investigating some of the more strange build failures and such
stuff. In general it turned out to be quite some fun.
Quite interesting which libraries turn out to be rather central to the
Archive. I wouldn't have guessed that a uninstallable libmtp would
prevent a reasonable fraction of the builds to fail -- including
packages like subversion.
Packages builds failing because the disk space is exhausted may be
something most of us have already witnessed, especially those here
that use one of these small notebook hard drives. Build failures
caused by a lack of RAM might certainly be imaginable as well,
especially on highly parallel builds. But have you ever seen gcc fail
because the virtual address space was exhausted on 32 bit
architectures?
Also there's a interesting lot of packages with misspelled build
dependencies which sbuild can't find and therefore can't build the
package. Maybe having a lintian check for some of these problems would
be a good idea?
I'm also regularly seeing build failures that look easy enough to fix
-- like some glob in a *.install for some python package matching
lib.linux*. I try to fix some of these as I see them but my time is
unfortunately limited as well. Someone interested in quick&easy
noticed about these kind of issues? I could put URLs to build-logs on
identi.ca or somewhere on IRC.
There are also some really strange failures like llvm, which builds
flawlessly on my local kFreeBSD boxes all the time, inside and outside
schroot but hangs all the time in the same testcase when building on
any of the autobuilders (any hints welcome!) or perl failing on
kfreebsd-amd64 selectively but all the time.
Next.