This is How We Catch You Downloading

torrentfreak.com has acquired a document how a british company is tracking down illegal use of P2P: This is How We Catch You Downloading.

Basically they use a modified P2P client which searches for infringing content, download it and if that works and is indeed is the content then they do a whois on your IP and send a infringement notice to your ISP. The best thing is that they claim that this provides enough proof that you really are infringing.

They probably never heard about botnets.

C&C 3 on Linux

I’ve got Command and Conquer 3: Tiberium Wars running on my Gentoo Linux installation with wine 0.9.34 by following the instructions here. I had to first install it on windows though, and copy the folder for the installer didn’t work, even with Crossover Office.

Except for (very glitchly) video and sometimes a crash everything seems to run. (Didn’t try multiplayer yet though). I had to put all quality settings to lowest, which makes me wonder whether that is my radeon X1400 being not so good as I expected or wine just being slow in emulating Direct3D.

The Filesystem Failed. Part I: introduction

The Filesystem (I’ll consider the Linux VFS as an example) has failed:

  • Database storage is implemented on top of the Filesystem, because the Filesystem is incapable of serving the needs of relational storage.
  • Metadata is stored inside files in many different formats which can only be guessed by clumsy ‘magic’ in the headers. This forces many media player and desktop search application to duplicate tag information in their own databases. Each of them has only limited support for each of the many different formats.
  • More and more device and service abstractions are moving from the Filesystem to seperate namespaces, because the Filesystem’s API is inadequate. Take for instance oss which used /dev/dsp, whereas alsa uses its own. Many new abstractions don’t even go near the filesystem anymore, for instance kevents, futexes, networking, dbus and hal.
  • Small files are stored in (compressed) packs and archives because the Filesystem can’t handle them. This happens with for instance your mailbox.

The problem comes down to fragmentation of data and metadata in too many namespaces because the Filesystem doesn’t seem to be an adequate one.

In a series of posts I’ll look at the possibilities to create one unified filesystem.

Watermarking media

It seems the new trend of the music industry against piracy is watermarking movies/audio/etc.

Content is water-marked by adding very small (unnoticeable) changes that could store something like a rsa based certificate to identify a given audiotrack.

Originally I thought they’d use it to track down the source of an illegal download. It sounds illogical to me because it’s hard to keep watermarks when format is changed (mp3, ogg and others really do mess up slight unnoticeable differences because otherwise they wouldn’t compress as good). And when someone has got two versions of the same audiotrack one can compare them and find out how something is watermarked.

Maybe the scheme of the industry isn’t that stupid, but the other way around (and a lot more evil). Maybe just sue everyone who hasn’t got a watermark on their movies or mp3.

Luckily a Fair Use bill was passed which they say (haven’t checked) allows fair-use conversion of format of media.

ati-drivers-8.33.6 for Gentoo

This is a slightly adjusted 25.3 ebuild that will give you the 8.33.6 ati-drivers for Gentoo. Yes, it’s dirty. They aren’t in the main tree yet because they are considered broken, although it works just fine for me.

Download: ati-drivers-overlay-8.33.6.tar.bz2

Extract them to an overlay.

Update, the 8.33.6 drivers are in the mainline tree now, so you should use those instead of mine.

Intel’s free literature

I noticed that you are able to order hard-copy’s of Intel’s books on the IA-32, 64 and Itanium architecture. So I did.

Today, a few days later, I received them. They’re very informative thorough and well structured. And, in contrary to other professional literature, you are able to read it without crunching your brains on one jargon-filled sentence. Basically free, dense and easily read books and great references.

So, a big thank you to Intel for this nice free service.

By the way, Itanium seems to really rock. (256 registers, compiler branch prediction, 8-superscalar, etc)

Also, I’ve got no spare room anymore on my desk. 🙂

intelbooks1.JPG

Rotating Beryl cube using HDAPS on a Thinkpad

I hacked together this little ruby script to read the G-measuring device in the Thinkpad’s harddisk (HDAPS) and rotate the desktop cube of Beryl when sudden movement occurs. A bit like what has been done for the MacBook already.

http://w-nz.com/~darkshines/projects/rtollina.rb

GPL, obviously. It’s not really perfect yet. I’ll try to improve it tomorrow and add support for compiz and maybe even make a little widget out of it.

It’s based on code by Fer, which is for Compiz instead of Beryl.

XGL take 2

I tried to get AIGLX to work on my Thinkpad yesterday. AIGLX is an API similar to XGL, but is a better implementation. Unfortunately AIGLX requires implementation by the video-card driver (which is good because it allows more performance), but the proprietary drivers of ati still doesn’t support it. (nvidia’s do, note to myself: get nvidia next time).

So I had to revert to XGL. A lot has changed since the last time I installed XGL. Other gentoo overlays, other windows managers, other hacks.

I used the gentoo-xeffects overlay to get Xgl.

Installing Xgl was a lot more straight forward and less of a problem than it used to be. An emerge and writing a simple startxgl script was enough.

The compiz-quinstorm patchset seems to have evolved to a proper branch of the compositing window manager, now called Beryl. It also includes a nice settings manager now.

Even hibernation and suspend finally seem to work. 🙂

A nice screenshot:
xgl4.png

One thing left to do: integrate Xgl into xdm.

Avoiding multiple lock dead-locks by memory addresses

Sometimes you need to lock several resources. If you don’t take great care you are likely to get yourself into dead-locks. A simple example with just two lockable resources A and B:

function foo {
  lock A;
  lock B;
  // Do something with A and B
  unlock A;
  unlock B;
}

function bar {
  lock B;
  lock A;
  // Do something different with A and B
  unlock B;
  unlock A;
}

When foo and bar are called at about the same time then there is the change that foo locks A and bar locks B which will make bar wait on foo‘s lock on A and vice versa.

Solution: fixed order on memory address
The simplest way to get rid of the deadlock is to always try to acquire a lock on A before on B. A generic solution would be to always lock the resource with the lowest memory address first.

This only works when memory addresses are fixed or that there is an otherwise fixed order-able property.

(auto)mounting removable media as user

I’ve always been bothered by the fact that you need to be root to mount anything (like an usb stick). It can be solved a bit by setting up udev rules and putting a specific device in /etc/fstab, but that only works for that single usb stick. Pretty annoying.

Googling only gives you stupid and silly solution (like allowing users to mount /dev/sd[a-z] — security risk).

Luckily I’ve recently been pointed to ivman, which is an automounter. It automatically mounts removable media for you in /media.

I looked at the internals of ivman, and noticed that it uses pmount, which is a wrapper around mount which allows users to mount removable media on a /media folder. Great!

Btw, you need to be in the plugdev group to use pmount.

Update It seems that gnome-mount also works fine when you’re in the plugdev group. Gnome-mount does about the same as pmount with the advantage that gnome-mount has got the nice gui integration everywhere in gnome.

Long mySQL keys

Instead of limiting your long key (for instance a path) to approximately 800 characters (on mySQL with generic UTF8), you can hash your key and store the hash as index.

The drawback is that you need to use a quite good hash function to avoid duplicates if you want to use it for a unique or primary key. These good hash functions tend to require some computing time.