musicmatzes blog

NixOS has a new Logo. So I have a new wallpaper now.

Awefully enough, my last wallpaper had this stupid error in the slogan. I just created a new wallpaper I want to share now, feel free to use and/or modify it (both the .png and the .xcf files) under the terms of WTFPL.

I think I got the slogan right this time.

NixOS wallpaper

GIMP project file. tags: #linux #nix #nixos

Finally I got NixOS installed on my Thinkpad as well. I created a wallpaper for the device, which I want to share here.

Another blog post about the switch on my Thinkpad will follow.

So here we go:

NixOS wallpaper

As you can see, I'm not really good at designing wallpapers.

Feel free to customize my gimp project, if you want: GIMP project file.

LICENSE: The above files (the wallpaper image and the GIMP project file) are available to you under terms of the terms of WTFPL. Everything else remains under the license of this blog, though.

tags: #linux #nixos #nix

So I (re)installed NixOS on my old Notebook yesterday and today. Besides some small problems it worked like a charm. Read about it here.

Why did I reinstall?

Well, the old setup was fine. Besides one thing: I hadn't my configuration repository on the device. You may think, well, where is the problem? Just install git and clone it from the other machines, right? The point is, I like to keep my configuration parts private and only share snippets of it if someone asks. Also because there are passwords in it and so on. You know what I mean.

That's why I need disc encryption when I want to clone my configuration repository on a device. So I had to reinstall the device because it had no disc encryption. No problem, as nixos is awesome!

The process of reinstalling

Well, it was really simple: Boot the USB stick, format the drive with fdisk and create encrypted volumes with cryptsetup, then mount them and create file systems with mkfs. Then mount these and do a nixos-install – smooth as hell!

After that, I edited the configuration.nix file which was created by nixos-install, so had vim and git available when rebooting – also smooth as hell.

But then, I did the big mistake.

The problem

I was a bit tired yesterday, so apologies here. But I actually did adduser. Of course, it worked for the first step. I then logged in with this user, edited the configuration.nix file to have the user as well, rebuild the system and rebooted. The user still existed, but the packages were not available. I had already cloned my configuration repository onto the encrypted drive and linked it from the /etc/nixos/configuration.nix path, but the packages were not available to the user.

The solution

The solution I found this morning was rather simple: I had two boot loader configurations in my configuration files, as my workstation machine boots via gummiboot for UEFI but the old notebook had to use grub. Two bootloader definitions are not that good – the bootloader didn't get any updates, so I always rebooted into the same generation, resulting in a way to old environment, where the packages were not available.

I fixed this one and also removed everything which was related to the user I had created. I did a nixos-rebuild switch. The user got created, the bootloader got its update.

Everything worked.

Awesomeness

So, overall, you can reproduce by:

  • Don't be tired when installing a OS
  • fdisk
  • cryptsetup
  • mkfs
  • mount
  • nixos-install
  • vim
  • nixos-rebuild

in this order.

And you have everything available. It is SO awesome. I just logged into the machine over SSH and did some things. It was SO easy, because I didn't need to reinstall all my stuff, I already had it available and it worked. That's pure awesomeness to me (pun intended)!

tags: #linux #nixos

This semester is at its end in about one and a half week. It was a good semester, even if mine is not over yet (I'm in my praxis semester right now and I have to work four weeks longer than the other students – but they have exams)! Since one year I'm the leader of the local LUG (Linux User Group) and I really like beeing it.

As far as I can tell I will be the leader for the next semester as well, but I guess one year is a great point to reflect and look back what I've done and what was awesome and maybe even what was not so good.

What was

So, in the last year, we had (during the semester) one talk each week (in alphabetical order here):

  • 31C3-Review
  • C++ – Arcane and rusty (2 parts)
  • Docker
  • Email (In)Security
  • FTP-Searchengine
  • Fish
  • Git-Intro
  • Go
  • Nix(OS) (my talk, actually)
  • Pimp my x86 (2x)
  • Presentation of a Bachelors Thesis
  • Presentation of a semester project (2x)
  • Racket
  • Regex Workshop
  • Reverse-engineering Workshop (2 parts)
  • Ruby on Rails 1
  • Ruby on Rails 2
  • Rust

Almost all talks were held by students, only one was help by an ex-student, who does one talk each semester for us. And they were awesome.

We also managed to go to the 31C3 as a group, which was an awesome experience and I'd really love it if we manage to go there this year as well. I also started a rewrite of our website, hopefully I will finish it this weekend, so I can do a talk about it next week, which is the last week where a talk is held in this semester (traditionally we do a “Pimp my x86” talk at the very end of the semester, where each student is allowed to talk for about 10 minutes, so it is lightning-talk-ish).

Plans

So next semester I really want to start organizing for the next Unix Friends and User Campus Kamp (Yes, the shortcut for this is UnFUCK). I really hope we can manage to get this event in the following semester, in the early months of 2016. It would be awesome to have a full weekend of nerdish talks and awesome people hanging around in our university, talking about Linux, programming languages and other foo which scratches my fields of interest.

And, of course, I hope we have some more awesome talks.

tags: #linux #open source #programming #social #software #tools

Yesterday I was at tübix in Tübingen, Germany. And it was awesome, thank you guys for making this event happening!

There were several really interesting talks for me, starting with, of course, a talk about NixOS, held by a NixOS guy I didn't knew by then. Joachim was there, too, and we had a nice chat about but not limited to NixOS! Thank you for beeing great, Joachim!

Afterwards I attended the talk about mutt and gpg, which was held by Sven, a really nice and inspiring guy who likes colors.

Afterwards I switched to the lightning talks, where I arrived just in time to see Ingo talking about Haskell. Oh my god, I really like this guy! He was really charged with energy when he started talking about Haskell. Awesome! I had a little chat with him afterwards about how to learn Haskell, as I still have some problems (not with Monads, as he assumed first, but) with getting the theory to do practical things for me. Thank you for the nice time, Ingo!

After some pizza, which was really tasty, I learned about pandoc from Kurt (no link here, sorry). And with this talk, I got to learn about a tool which I can use to write my thesis, so big thanks to Kurt for this! We also had some short chats where I learned even more about Pandoc and what it is able to do! Thanks a lot!

Then I went back to the room of the lightning talks, where several LUGs presented what they are doing and so on and I was forced to talk about UnFUCK without further preparation. I don't mind it, thank you all for listening and giving me the opportunity to talk about the Unix Friends and User Campus Kamp at my University!

Then I went to a talk about Network Steganography held by my former fellow student Florian. Thank you, too, Florian, I've learned another bunch of things, so: Success!

After that I saw some notes from Joachim on nice stuff from the net and a talk about functional programming in C++ which was more or less a selling talk for Haskell. I don't mind it, of course. It convinced me even more not to get an C++ programmer, because holy shit, this language sucks!

The exit talk was nice as well and afterwards we had some more time to socialize and talk with people and so on. But then we had to drive home again. It was an absolutely awesome day and I'd really love to be there again in 2016! Hopefully this was not the last tuebix!

tags: #social #software #linux #nixos

So I'm in my praxis semester at the moment, and I have to work with fastcgi++, a C++ library for fastcgi. And it is a nightmare! Here comes why...

So first, the codebase of fastcgi++ is a mess. Code snippets like

bool foo = someFunction();
if (foo) return true;
else return false;

are everywhere. You really don't want to read that kind of code. And yes, you have to actually read this code because there is no documentation on how to use the library! There is a wonderful doxygen-generated API documentation, but that does not help you because, yeah, you know the types and the interfaces now – lucky you! How to build a fastcgi module with them – figure it out by reading through the codebase!

Secondly, you are not allowed to define your custom accept() handler. You have to inherit from a Request class template and you have to implement the virtual bool response(void) = 0; method. Okay, no problem, I can do this! But then, you want to start accepting requests. You do this by creating an instance of a class called Manager:

Fastcgipp::Manager<MyRequestInheritedClass> man();
man.handler();

or something like this (this is no real code, I just want to demonstrate how it looks like). The manager accepts one connection (through many layers of abstraction, actually), creates an instance of your request class and calls response() on it.

Well, that's not a problem, is it? Well, it gets to a big problem if you want to be able to handle multiple requests at once, speaking of multithreading/concurrency here. It is a huge mess! My codebase exists of three classes, actually. A ThreadedRequest class, a BlockingQueue where requests get stored thread-safe and a RequestDispatcher which is a singleton which runs several worker threads. These worker threads take the requests out of the queue and process them if they can.

The ThreadedRequest class puts itself into the queue, which is a member of the RequestDispatcher singleton instance. The problem is not that it is unnecessarily complicated to build these 1-N multiplexing thing, but that the library provides an interface which enforces you to couple your classes realy tightly. And this is freaking bullshit.

So, finally: I'm building a wrapper lib around fastcgi++ to be able to handle requests in a concurrent way. And it sucks. But it works.

So, my conclusion is: Stay away from this bullshit library. And even from fastcgi if you can. Apache for example offers a way to write modules, so you can simply write your own module for apache if you need to – which is faster anyways!

If you have to use fastcgi, consider writing your own library!

tags: #c++ #linux #server #open source #programming #software

Firefox – The browser we all love (or hate?) and use almost every day (or never). But what the hell is this thing doing, actually? I just wondered why this thing eats the most resources on my device – while doing nothing.

So here it goes: I just synced my complete music, movie, library and image database. I do this using git-annex. If you don't know git-annex, you should really check it out! It's a tool for keeping things in git without actually checking it in. Sounds strange, but that's it! SO, git-annex is written in Haskell by Joeh Hess, the Debian guy you probably know. It is an awesome piece of software and does a great job for me. I sync several thousand of music pieces with it (something above 42,000, actually), several hundret GiB of movies, a collection of books (including audio-books) which is about 3,000 files and my private image database, which is about 7,000 files. And I do this without worrying that I might lose something. I know I always have at least 2 copies of the stuff, for music there are always 3 copies of everything. If I want to put something on my notebook (which, of course, does not have a 3TiB drive in it but only a 256 GiB SSD) I say “git annex, get XYZ for me” and it fetches it from somewhere – I don't have to check all my drives manually.

So, that's git-annex. git-annex does some heavyish stuff when keeping track of my data. It creates hashes of the data on and on. It does a lot of IO, of course. It propably does more things I don't even know of – I'm just a user. But what does this all have to do with firefox, you might ask? Well... here it goes.

So I was just syncing my music and the other stuff to two external drives. It synced about 2,5 TiB to each drive, so we're speaking of about 5 TiB data which was checksummed, synced via slow USB2.0, etc. It was fast, anyways. While syncing, I hacked a bit on one of my projects and thought about eggs with bacon, as I still had no breakfast this morning. And on my second screen, there was the login of my owncloud opened in Firefox. Nothing more, it was just the login screen (you might know that owncloud re-loads every now and then, which results in page rendering and all this stuff – but no, there was just the login). And you know what? Firefox used more resources than the heavy git-annex syncing processes together. What the hell does this thing? I mean... it just has to display this freaking web page. There is no javascript animation, no flash plugin (uuuh, I just said an ugly word) – I don't even have flash installed – and no re-rendering because of page reload or some shit like this. Just displaying. Why the hell does this thing need more resources than another process which actually does something?

So, well ... Maybe I'll never know. If you know why Firefox needs that much resources, you're welcome to tell me!

This rant ends here. tags: #git #haskell #software #tools #network

Yes, I use chromium. And I just installed the “cvim” plugin, to be able to navigate with vim bindings in my chromium instances. And it just feels like it should! Out of the box!

Awesome!

For my daily browsing, I use dwb (but I want to switch to luakit, I just didn't find the time to do the actual switch, yet). For some pages I use firefox and lately also started using chromium for it. And, of course, I wanted chromium to behave like vim. So I installed “cvim”. I first thought “Yeah, another vim emulatro plugin, could be nice... but well... it is not really a vim” – But after installing it, I just continued with my normal workflow. It just felt right, right from the beginning. I started navigating web pages without thinking about it.

Awesome! I just wanted to share this, so if you're looking for a vim plugin for chromium, just use cvim. It is awesome.

tags: #software #vim

Really, just stop it! Nobody benefits from all your new Linux distributions, if they don't change a major thing!

Why am I posting this? Well, yesterday, another Linux distro was announced on a german news site called “heise”. OzonOS is shown as nice-looking new linux distro on top of Fedora. It comes with Atom Shell, optimized for consuming media like music, videos or games.

But well ... so what? We already have a buttload of linux distributions and these are only the ones listed at wikipedia. There are much more, I'd bet on it! But who benefits from even more linux distributions? I can tell you who: Nobody! Why not improving existing linux distributions? I mean, yeah, if you have a completely new approach on how to put together your distro, like Guix or NixOS have, I don't say a thing! But just because of user experience? It seems like a freaking waste of effort to me!

So please, people, stop making new linux distributions! Make the existing ones better, improve our beloved open source software or whatever! But don't waste your time on something like another linux distro or desktop environment or browser or office suite or whatever!

tags: #linux

This part is about running (as far as I think) insecure applications on NixOS. How'd you do that? Well... my approach is docker!

Read it here.

So, docker. I learned from docker when it was introduced. I guess it was two years ago or something like that. I never used it, though. But today, I use it. And I use it on NixOS!

The first thing you have to do is to put

  virtualisation.docker.enable = true;

into your configuration.nix file. Of course, you also have to install it. This depends on where you want to use it, so put it either in your systemPackages configuration or install it in your user profile with nix-env -i docker or, if it works (I didn't try) with nix-env -iA pkgs.docker to be a bit faster.

Be sure your user is in the "docker" group! This one is really important. I actually had a bit of an issue (well, “a bit” is well said, I couldn't run anything... so I had a big issue) with docker because I forgot to put my user into this group.

After the last step, you have to logout and login again.

So, now you should be able to run docker containers! I found a blog post by Jessie Frazelle, where she explains how she runs, for example, lynx in a docker container. She also provides examples for how to run chrome in docker, including google talk plugin!

Other stuff she shows:

  • skype
  • spotify
  • gparted (huh?)
  • tor browser
  • mutt
  • irssi

Awesome, huh? You can not run Skype as container! This is awesome. I won't do it, though. Skype is still spyware! Also remember: docker is not to run apps which are eventually evil. Especially not if these apps can access the X server!

Jess has also a github repository where she stores docker files for much more applications:

  • atom
  • chromium (I'm running chromium, not chrome, actually)
  • mailman
  • transmission

... to name a few.

tags: #linux #nixos