Landfill of wisdom

Dumping ground for small tips and big papers

Browsing Posts published by chutz

When trying to install grub2 (whatever snapshot was current as of today) I kept getting the following error:

$ sudo /sbin/grub-setup -v --directory=/media/sysrescd/boot/grub \
  --device-map=/media/sysrescd/boot/grub/device.map -r '(hd1,1)' '(hd1)'
.... snip ...
grub-setup: error: Cannot read `/media/sysrescd/boot/grub/core.img' correctly

The error was not very descriptive because grub was apparently able to read other important files like boot.img and such. The filesystem on my USB stick was identical (feature wise) to the /boot on my HDD — ext2. And the same command worked just fine for installing to my hard disk.

Digging through the code revealed where the problem is. The error was caused by grub-setup being unable to embed core.img in the MBR. The core.img prepared by grub-mkimage was 25k big. That is about 50 sectors. The first partition on my hard disk starts on sector 63. The first partition on my USB stick was starting on sector 32 (or was it 31?). 32 < 50 => core.img cannot be embedded. If only the error message had been a little clearer it would have saved me some headache.

Destroying the first partition on the USB stick and recreating it starting from sector 63 fixed the problem.

Me, a long-term Windowmaker user, recently switched to Gnome. There main reason is that I had wanted to drop Windowmaker for a while now. There has been no development for a while now and I don’t really like the fonts or the lack of themability of window borders and such.

I decided to give Gnome a try because I’ve always liked the appearance of Gtk applications and a full Gnome desktop can run without having to run a zillion processes in the background. I have looked at KDE but it just doesn’t feel right.

One feature I really liked in Gnome was the automounting of removable media. It didn’t work smoothly because there are a few prerequisites:

  • Your user must be in the plugdev group
  • You must not have an entry for the device in /etc/fstab

The last one is mostly speculation, but when I removed the lines in /etc/fstab (leftovers from the windowmaker era) it all started working.

I still prefer the Windowmaker style Alt+<Right Click and Drag> to resize a window. With Gnome (or more correctly, with metacity) it is Alt+Middle click and drag… and that’s not too convenient.

A common issue — setting the onSubmit event handler of a form with JavaScript. I mean, it’s easy enough to set it with

<form id='theForm' onsubmit="return confirm('Really submit?');">

but here is how to do it with JavaScript

<script type='text/javascript'>
document.getElementyById('theForm').onSubmit =
function() { return confirm('Really submit?'); };
</script>

I have had to write an HTML parser a few times already and I’ve always used HTML::Parser. Because it’s simple and because I never bothered to do it anohter way. I always wanted to ideally do some parsing with XPath because that way I can easily find what I need with one or two queries. Unfortunately, XPath only works on properly formatted XML documents, so unless the page I am parsing is XHTML, I couldn’t do much.

I also wanted to somehow convert the HTML to properly formatted XHTML and use XPath with that. Unfortunately, I didn’t know an easy way to do that either. Well, now I do. I can use the HTML::TreeBuilder module from HTML-Tree CPAN distribution. It is easy enough to use the module itself for parsing:

my $tree = HTML::TreeBuilder->new_from_file("test.html");
my @img = $tree->look_down('tag', 'img',
sub { $_[0]->attribute("src") =~ m!thumbnail!; }

However, as I would rather use XPath, here is how to easily convert the HTML to XML so that is parseable with XPath:

my $xml = HTML::TreeBuilder->new_from_file("test.html")->as_XML();
my $xp = XML::XPath->new( xml => $xml );
my @img = $xp->find('//img[contains(@src, 'thumbnail')]);

And as always, use whichever approach is fit for the task at hand.

Poster Movie Die Reste meines Lebens 2017

Die Reste meines Lebens (2017) HD

Watch movie online Die Reste meines Lebens (2017)
Director : Jens Wischnewski.
Release : May 25, 2017
Country : Germany.
Language :
Runtime : 82 min.
Genre : Comedy.

‘Die Reste meines Lebens’ is a movie genre Comedy, was released in May 25, 2017. Jens Wischnewski was directed this movie and starring by Ulrike Kriener. This movie tell story about no movie overview

Do not miss to Watch movie Die Reste meines Lebens (2017) Online for free with your family. only 2 step you can Watch or download this movie with high quality video. Come and join us! because very much movie can you watch free streaming.

Watch Full Beauty and the Beast (2017) Free Online Streaming and Download HD Quality English Subtitles
Incoming search term :

Die Reste meines Lebens 2017 live streaming film online
watch full Die Reste meines Lebens film
live streaming film Die Reste meines Lebens 2017
Die Reste meines Lebens 2017 English Episodes Free Watch Online
watch full Die Reste meines Lebens movie online
film Die Reste meines Lebens 2017
Die Reste meines Lebens 2017 Episodes Watch Online
watch Die Reste meines Lebens movie online now
Die Reste meines Lebens 2017 English Full Episodes Online Free Download
Die Reste meines Lebens 2017 Full Episodes Watch Online
Die Reste meines Lebens 2017 Full Episodes Online
watch film Die Reste meines Lebens 2017 now
film Die Reste meines Lebens streaming
Die Reste meines Lebens 2017 English Episode
Watch Die Reste meines Lebens 2017 Online Free
download movie Die Reste meines Lebens 2017
Die Reste meines Lebens 2017 Watch Online
Die Reste meines Lebens movie download
Die Reste meines Lebens 2017 HD English Full Episodes Download
streaming Die Reste meines Lebens 2017
Watch Die Reste meines Lebens 2017 Online Free Viooz
Watch Die Reste meines Lebens 2017 Online Free putlocker
download Die Reste meines Lebens movie now
trailer movie Die Reste meines Lebens 2017
watch Die Reste meines Lebens 2017 film online now
Die Reste meines Lebens 2017 English Full Episodes Free Download
Die Reste meines Lebens 2017 Full Episode
Die Reste meines Lebens 2017 HD Full Episodes Online
Watch Die Reste meines Lebens 2017 Online Megashare
streaming film Die Reste meines Lebens 2017
Die Reste meines Lebens 2017 For Free Online
Die Reste meines Lebens 2017 English Full Episodes Watch Online
Die Reste meines Lebens 2017 For Free online
Die Reste meines Lebens 2017 English Episodes
Watch Die Reste meines Lebens 2017 Online Free megashare
Die Reste meines Lebens 2017 English Full Episodes Download
download full movie Die Reste meines Lebens
Watch Die Reste meines Lebens 2017 Online Free Putlocker
download film Die Reste meines Lebens now
Watch Die Reste meines Lebens 2017 Online Viooz
Die Reste meines Lebens 2017 Episodes Online
film Die Reste meines Lebens 2017 trailer
Watch Die Reste meines Lebens 2017 Online Putlocker
Die Reste meines Lebens film
Die Reste meines Lebens 2017 Online Free Megashare

A nice feature in XEN that I miss in KVM is the ability to use a single partition as a disk image. In XEN you can do

disk = [ 'file:/dev/vg0/img_root,sda1,r' ]

and you can also safely mount /dev/vg0/img_root when the virtual machine is not powered on.
With KVM you’re out of luck, or at least my googling returned lots of questions and no solutions.

Well, there is a not so hard way of working around the issue.
continue reading…

Edit the svn:externals property for the directory where the external stuff will go into

svn propedit svn:externals .

Add a line for each external entry you want to have:

local/path http://external/repo
local/path2 -r### http://external/repo

Example for me adding jokey’s virtualbox ebuilds:

svn pe svn:externals /var/repos/chutz/app-emulation
virtualbox http://overlays.gentoo.org/svn/dev/jokey/trunk/app-emulation/virtualbox
virtualbox-additions http://overlays.gentoo.org/svn/dev/jokey/trunk/app-emulation/virtualbox-additions
virtualbox-bin http://overlays.gentoo.org/svn/dev/jokey/trunk/app-emulation/virtualbox-bin
virtualbox-guest-additions http://overlays.gentoo.org/svn/dev/jokey/trunk/app-emulation/virtualbox-guest-additions
virtualbox-modules http://overlays.gentoo.org/svn/dev/jokey/trunk/app-emulation/virtualbox-modules

The original tip was here.

Note to self for common commands use by ImageMagick:

  • The manual
  • The examples
  • Geometry specification
    • [width]x[height][+-x+-y]
    • Cropping
      • Always use “+repage” or else…
      • When cropping do specify +0+0 or you’ll get lots of tiles
    • Checking the output on the command line — use
      xpm:-

      for output (

      -compress none pbm:-

      is also kind-of usable).

    • Thumbnail gallery:
      montage input*.jpg -tile XxY -mode Concatenate output.jpg

The problem

Here’s a simplified snippet of what illustrates the problem I had today.

SQLiteCommand cmd = cnn.CreateCommand("SELECT a.a1, b.b1 FROM a INNER JOIN b USING (b1)");
SQLiteDataReader reader = cmd.ExecuteReader();
DataTable dt = new DataTable();
dt.Load(reader);
reader.Close();

The problem is that

dt.Rows.Count

is way lower than what running the same statement in the SQLite CLI produces.

The reason

The reason is that DataTable complains about an invalid constraint on the “b1” column. Why? Because “b1” has a unique index in “b” and for some reason DataTable doesn’t like it when you get to entries with the same value for that column regardless that it is perfectly legal when joining tables.

The workaround

I have no idea if this is a problem with SQLite or the AdoNet SQLite wrapper, and I haven’t tried other databases to see if this is not a problem with SQLite at all. The workaround, however, is this:

SELECT a.a1, b.b1 + 0 FROM a INNER JOIN b USING (b1)

That’s an ugly workaround but at least it works.

Mutt is my mail client of choice. The reasons are simple: It…

  • is fast
  • is usable from the command line (a big plus)
  • lets you do essentially anything to a message
  • supports hooks for very flexible configuraiton

And the tip of the day — how to fix unreadable (as in — mojibake mail) to be readable again.

  1. Highlight the mail in the index and press “e”. This will fire up your editor (vim in my case) and load the full mail in it.
  2. Find the “Content-Type” header. Edit the value of the “charset” field on the line. If there is no such header just add one:
    Content-Type: text/plain; charset="iso-2022-jp"

If the subject of the mail is also unreadable, do the following:

  1. Install maildrop
  2. Select the Subject line and pass it to this command
    cat | xargs -ifoo reformime -h "foo" | iconv -f iso-2022-jp -t utf8 | xargs -ibar reformime -o "bar" -c utf8

    . In vim speak, this means

    1. /^\csubject:
    2. Shift-V!cat | xargs -ifoo …
  3. Play around with the charsets if you’re not getting correct results.