Skip to main content

MediterraneanNight GTK+ theme quick-hack Debian package

Intro

There is a nice GTK+ 2.x/3.x theme called MediterraneanLight (part of the MediterraneanNight Series) that I have started using a while ago. Since there is no official Debian package and most of the files end up in /usr/share/themes/ as-is, I decided to make a quick-hack Debian package myself so that I could cleanly un-install it any time later. This blog post documents the steps needed, applicable to any just-copy-files sort of Debian package. The process is made of three steps:

  1. Fetch files
  2. Add simple Makefile
  3. Start build process

In detail:

1. Fetch files

wget https://dl.dropboxusercontent.com/u/80497678/MediterraneanNight-2.03.tar.gz
mkdir mediterranean-night-2.03
cd mediterranean-night-2.03
tar xf ../MediterraneanNight-2.03.tar.gz

2. Add simple Makefile

DESTDIR ?= debian/mediterranean-night
PREFIX ?= /usr

.PHONY: install
install:
    mkdir -p "$(DESTDIR)$(PREFIX)"/share/themes/
    cp -R Mediterranean* "$(DESTDIR)$(PREFIX)"/share/themes/

3. Build the package

dh_make --native --indep --yes
debuild -us -uc

The result can be found at ../mediterranean-night_2.03_all.deb. If you know a cleaner way (with as little effort or less), please comment below. Thanks!

Running Hotline Miami on 64-bit Linux ("amd64")

Contents

  • On Debian (using 32-bit chroot)
  • On Gentoo (using a mix of multilib and emul-linux-x86-* packages)

I recently had trouble getting (the 32-bit binaries of) PC game Hotline Miami to run on a amd64 Debian machine. In the end I got it to work using a 32-bit chroot. That's what the post is about, mainly. If you know a non-chroot way to achieve this on amd64 Debian, please share your solution in the comment section. Thanks!

On Debian

One way is to use a 32-bit chroot built by debootstrap:

# Build 32-bit chroot
sudo debootstrap --arch i386 testing debian_testing_i386_root

# Make chroot enterable
sudo mount -o bind /dev/ debian_testing_i386_root/dev/
sudo mount -t proc PROC debian_testing_i386_root/proc/
sudo mount -t sysfs SYS debian_testing_i386_root/sys/

# Ensure that /dev/dsp exists
sudo modprobe snd_pcm_oss

# Copy .deb package into chroot
sudo cp hotline-miami_1.0.9a-0ubuntu6_i386.deb debian_testing_i386_root/root/

# Enter chroot
sudo chroot debian_testing_i386_root/ /bin/bash

# Install Hotline Miami, its dependencies and PulseAudio
dpkg -i hotline-miami_1.0.9a-0ubuntu6_i386.deb
apt-get -f install
apt-get install pulseaudio

# Add a dedicated user to not be gaming as root
adduser hotline
addgroup hotline audio  # for access to /dev/dsp

# Switch to that user
su hotline

# Start PulseAudio user process so we actually hear something
# We're using "&" over "--start" since user "hotline" might have
# the same user ID as another user running PulseAudio outside
# of the chroot already
pulseaudio --log-target=syslog &

# Launch Hotline Miami, done!
( cd /opt/hotline-miami/ && ./Hotline )

On Gentoo

Emerge these direct dependencies:

  • app-emulation/emul-linux-x86-opengl
  • app-emulation/emul-linux-x86-soundlibs
  • media-libs/fontconfig[abi_x86_32]
  • media-libs/freetype[abi_x86_32]
  • x11-libs/libX11[abi_x86_32]
  • x11-libs/libxcb[abi_x86_32]
  • x11-libs/libXext[abi_x86_32]
  • x11-libs/libXrender[abi_x86_32]
  • x11-libs/libXrandr[abi_x86_32]

.. or use my ebuild off betagarden:

sudo layman -a betagarden
sudo emerge -av games-action/hotline-miami-bin

Freeverb3 3.0.0 now working with latest Audacious (3.3.4) in Gentoo

Just a quick update on Freeverb3 in Gentoo: media-libs/freeverb3-3.0.0 is now unmasked and working with media-sound/audacious-3.3.4, the latest Audacious in Gentoo. Give it a try :-)

PS: The theme on the screenshot is Radience known from Ubuntu or x11-themes/light-themes in Gentoo.

(German) Logische Fehler in Artikel "Schlecht, schlechter, Geschlecht" von Harald Martenstein im ZEITmagazin vom 6. Juni 2013

Normalerweise schreibt Harald Martenstein die Kolumne, die das ZEITmagazin einleitet -- jede Woche aufs Neue. Diese Woche hat er es außerdem eine Streitschrift mit dem Titel "Schlecht, schlechter, Geschlecht" verfasst, die er auch im Vorschau-Video zur aktuellen Ausgabe der ZEIT vorstellen durfte. Zum Artikel als Ganzes will ich keine Stellung nehmen. Ich möchte im Folgenden allein zwei logische Fehler aufzuzeigen, die mir aufgefallen sind.

Der Evolutionsbiologe Simon Baron-Cohen, ein Vetter des Filmemachers Sascha Baron-Cohen, hat die Reaktionen von Neugeborenen erforscht, da kann die Gesellschaft noch nichts angerichtet haben: Mädchen reagieren stärker auf Gesichter, Jungen auf mechanische Geräte. Richard Lippa hat 200.000 Menschen in 53 Ländern nach ihren Traumberufen gefragt, Männer nannten häufiger "Ingenieur", Frauen häufiger soziale Berufe. Die Ergebnisse waren in so unterschiedlichen Ländern wie Norwegen, den USA und Saudi-Arabien erstaunlich ähnlich. Wenn es wirklich einen starken kulturellen Einfluss auf die Berufswahl gäbe, sagt Lippa, dann müssten die Ergebnisse je nach kulturellem Kontext schwanken.

Die Ergebnisse könnten schwanken, aber sie müssten nicht: Das lässt sich nicht folgern. Warum? Nehmen wir an, in zwei Ländern wirken zum Teil gleiche, zum Teil unterschiedliche kulturelle Einflüsse und es sind vorrangig gemeinsame kulturelle Einflüsse für die Berufswahl entscheidend. Dann ist nicht verwunderlich, dass sich die Ergebnisse ähneln, es sind aber durchaus kulturelle Einflüsse am Werk.

In Wirklichkeit ist die Biologie längst weiter. Sie kann zeigen, dass Männer und Frauen in vielen Bereichen gleich sind, in anderen verschieden. Sonst wäre die Evolution ja sinnlos gewesen – wozu zwei Mal das gleiche Modell entwickeln?

Evolution ist Mutation und Selektion in Wiederholung. Dabei können sich Merkmale durchsetzen, die keinen Sinn (im Hinblick auf höhere Überlebenschancen) haben. Hier wird argumentiert, dass etwas nicht sein kann, weil es im Widerspruch zum Sinn der Evolution des Menschen stehe. Evolution folgt aber keinem Sinn, weshalb so nicht gefolgert werden kann.

Hotline Miami PC game: Extract OGG Vorbis OST/soundtrack from .wad file

Quick summary

Humble Indie Bundle #8 (still available, get yours quickly!) includes seven games, most of them with (FLAC and MP3) soundtrack as dedicated downloads. With Hotline Miami, one of the bundle's most exciting games, no soundtrack is included. Well, maybe it is! :-) Friend Jonathan and I wrote a command line tool to extract the original OGG Vorbis music files from the game's .wad file today. It's free software licensed under GPL v3 or later and hosted at Github.

Superficial file format analysis

The game consists of a few files only, the biggest file is HotlineMiami_GL.wad. Using a hex viewer like od(1) you see filenames on the first page, already. However, the .wad seemed to be in a proprietary format and we could not figure it out quick enough. (If you find a way to extract all files from the archive, please comment below!) Using the strings(1) command a list of Music/*.ogg files can be found:

$ strings HotlineMiami_GL.wad | grep -Eo '^.+\.ogg'
Music/ANewMorning.ogg
Music/Crush.ogg
Music/Crystals.ogg
Music/Daisuke.ogg
Music/DeepCover.ogg
Music/ElectricDreams.ogg
Music/Flatline.ogg
Music/HorseSteppin.ogg
Music/Hotline.ogg
Music/Hydrogen.ogg
Music/InnerAnimal.ogg
Music/ItsSafeNow.ogg
Music/Knock.ogg
Music/Miami2.ogg
Music/Musikk2.ogg
Music/Paris2.ogg
Music/Perturbator.ogg
Music/Release.ogg
Music/SilverLights.ogg
Music/Static.ogg
Music/ToTheTop.ogg
Music/TurfIntro.ogg
Music/TurfMain.ogg

So we knew we were looking for OGG Vorbis content. Jonathan had the idea to just scan for any OGG Vorbis content in the file (i.e. guessing the offsets), rather than trying to understand where those Music/*.ogg file offsets where located. The OGG file format is well suited for that. Basically we just had to search for the byte sequence "OggS", extract a few bytes from the header starting at that location, do some simple math, and write a block of continues bytes to a dedicated file.

Our tool in action

Clone, compile and run:

$ make
cc -std=c99 -Wall -Wextra -pedantic   -c -o extract.o extract.c
cc   extract.o -o extract-hotline-miami-soundtrack

$ ./extract-hotline-miami-soundtrack
File "ANewMorning.ogg" (offset 324769444 to 328796370, size 4026926 bytes) extracted.
File "Crush.ogg" (offset 328796370 to 331873115, size 3076745 bytes) extracted.
File "Crystals.ogg" (offset 331873115 to 338070714, size 6197599 bytes) extracted.
File "Daisuke.ogg" (offset 338070714 to 342209815, size 4139101 bytes) extracted.
File "DeepCover.ogg" (offset 342209815 to 354220376, size 12010561 bytes) extracted.
File "ElectricDreams.ogg" (offset 354220376 to 361621106, size 7400730 bytes) extracted.
File "Flatline.ogg" (offset 361621106 to 364436799, size 2815693 bytes) extracted.
File "HorseSteppin.ogg" (offset 364436799 to 379380866, size 14944067 bytes) extracted.
File "Hotline.ogg" (offset 379380866 to 384817467, size 5436601 bytes) extracted.
File "Hydrogen.ogg" (offset 384817467 to 393673098, size 8855631 bytes) extracted.
File "InnerAnimal.ogg" (offset 393673098 to 401464171, size 7791073 bytes) extracted.
File "ItsSafeNow.ogg" (offset 401464171 to 407138611, size 5674440 bytes) extracted.
File "Knock.ogg" (offset 407138611 to 414801118, size 7662507 bytes) extracted.
File "Miami2.ogg" (offset 414801118 to 420456265, size 5655147 bytes) extracted.
File "Musikk2.ogg" (offset 420456265 to 425787691, size 5331426 bytes) extracted.
File "Paris2.ogg" (offset 425787691 to 433210181, size 7422490 bytes) extracted.
File "Perturbator.ogg" (offset 433210181 to 441536474, size 8326293 bytes) extracted.
File "Release.ogg" (offset 441536474 to 452985194, size 11448720 bytes) extracted.
File "SilverLights.ogg" (offset 452985194 to 462700814, size 9715620 bytes) extracted.
File "Static.ogg" (offset 462700814 to 464811086, size 2110272 bytes) extracted.
File "ToTheTop.ogg" (offset 464811086 to 468529275, size 3718189 bytes) extracted.
File "TurfIntro.ogg" (offset 468529275 to 472214580, size 3685305 bytes) extracted.
File "TurfMain.ogg" (offset 472214580 to 480864247, size 8649667 bytes) extracted.

While not all files seem to contain proper tags, all of them seem perfectly playable. The bitrate seems constant 224 kb/s for all, could be worse. At least to our ears, these files sound like higher quality than this "Hotline Miami Soundtrack (Full)" video on YouTube. But you don't need that anymore now anyway, right? :-) Again, the code is up here.

[EDIT]: Someone uploaded track "Daisuke" to The Infinite Jukeboxcheck it out!

[EDIT]: Our extractor inspired Andy to take it a little further and extract all files from the .wad file. Check out his code on GitHub, it's GPL 3, too.