Content from 2014-04

Arch i686 container

posted on 2014-04-07

Recently, I've been wanting to build package for my not very powerful eee-pc laptop. I just have one problem: all my computers except this one are use a 64bit architecture instead of a 32bit one. So I needed to make a chroot. So, instead of doing that I decided to play a little with systemd containers. Here is what I did.

Install a 32bit arch in a folder somewhere

I've decided to do that in my home folder. First, I made a copy of my /etc/pacman.conf, called pacman-i686.conf, in my home folder with the architecture explicitely stated as i686. So I've changed this line: Architecture = i686

Then, I've installed the extra/arch-install-scripts package.

After that, I created a folder and used pacstrap to install a basic arch in it using my custom pacman-i686.conf file. I use sudo because I'm lazy but you can do that using your root account, you just need to change your paths accordingly. Also, please disable the multilib repository, it won't work.

sudo pacstrap -C ~/pacman-i686.conf -c -i -d ~/i686 base

The first option, -C ~/pacman-i686.conf will allow you to choose a pacman.conf different than your host's /etc/pacman.conf, the second one -c uses the host's cache instead of the target's so that you can remove it more easily later and managing like the rest of your package cache. The -i option will disable auto-confirmation of packages so that you can choose what you install. And last, the -d option allows you to chose a non-mountpoint directory.

Starting the container

Simply use that command, the same thing about paths, sudo and root stays valid. sudo systemd-nspawn -bD ~/i686

It is now working. Login as root, there is no password. You might now want to install stuff, build packages, etc.

For some weird reason, my guest pacman.conf architecture was set on auto and it tried to install 64bit packages, probably due to my host, be sure to change it to i686. Make sure to synchronise your pacman databses with pacman -Syy to make sure you don't have any x86_64 packages.

Managing the container

The first step we have to do is to symlink the container to /var/lib/container/. Again, paths, sudo, root.

sudo ln -s ~/.i686 /var/lib/container/i686

I had to create /var/lib/container.

Now, you can see your container using machinectl list. Don't mind my prompt.

``-> % machinectl list MACHINE CONTAINER SERVICE i686 container nspawn

1 machines listed.``

You can now do fun stuff. man machinectl

Remember that you need to launch the machine using systemd-nspawn. Like that in the case of our example :

sudo systemd-nspawn -bD ~/i686

Edit: 2014-10-26

You can also use systemctl to launch the machine. Just use sudo systemctl start systemd-nspawn@MyContainer.service, in our case, the service is systemd-nspawn@i686.service. It will start and be listed in machinectl's list. You can also enable the service to start it with your computer.

Sources

Mostly Arch's Wiki, pacstrap --help, and man machinectl

The No-Bullshit Approach

posted on 2014-04-02

Life is short, life is complicated, life is exciting yet sometimes boring. But why is that? What can possibily make your life boring and complicated? Bullshit. So here is some advice : avoid bullshit whenever you can, you don't have time for it. How? Let me present you the No-bullshit approach! Also, table of contents.

What is The No-Bullshit Approach ? {#no-bullshit}

Whenever you are trying to solve a problem, you usually try to identify possible solutions and you pick the most viable one. Your criteria may vary but usually choose the one with the efficiency/simplicity ratio the best fit for the situation.

The no-bullshit approach is simply the fact of trying to identify any possible source of bullshit and neutralizing it. It might make your problem solving more difficult but ultimately it will make your life way more pleasant.

Let me give you a few practical examples.

Practical Examples {#examples}

Documents {#documents}

PDF {#pdf}

The Portable Document Format is exactly what the letters stand for a portable document file format. It is relatively sanely documented and standardized. Even if its implementations are sometimes lacking a few bleeding edge features, they all are usable and will display your document in a non-broken fashion. Plus, everyone has a pdf reader. You cannot say the same thing about, let's say… Microsoft Office Documents. So if you need to share documents with other people. Please : use pdf, it will just make your life easier. By the way, try to avoid Adobe Reader, it's a major security breach and I'm sure you don't want your computer to be part of a spam farm. You can get a pdf reader that doesn't suck here.

LaTeX {#latex}

There are only a few things in this world that can top my hatred for Office Suites, and more specifically Word Processors. They are terribly inefficient, while being the bastard children of incompatible paradigms; everything you want to achieve with them feels like you're trying to cast some voodoo spell.

LaTeX on the other hand is a Markup Language for the TeX typesetting system, which is based upon reason. It requires mastery but every objective that you have will be achieved through logical means. Everything makes sense.

I'll probably write about all of this in a dedicated article someday but I guess I can say that LaTeX changed my life. I can now happily write documents and focus on content without being overly depressed by the amount of bullshit I had to deal with every time I wanted to do anything. There is no hope with Word Processors. Only despair.

Transportation {#transportation}

Train tickets in France {#train}

If you want to travel in France, it's likely that you will consider using trains. The company SNCF has a pretty nice monopoly and of course an excellent quality of service… However beware their website,voyages-sncf, for it is an abomination! I even knew someone who used to look at train times on the German Bann train company because of how much voyages-scnf sucks. Fortunately, there are a few companies selling train tickets, including Capitaine Train. It's a website with a clear and minimal interface that only sends train tickets, nothing less, nothing more. And it changes your life! Suddenly, buying train tickets becomes pleasant again, bullshitless.

I feel that sometimes, pictures are necessary. Here they are: voyages-sncf - Capitaine Train

As you may have not noticed, these screenshots are slightly edited. The green frames symbolises useful and necessary features, the yellow ones are for the nice yet unecessary features, red is here to show us waste and unpleasantness: none of these frames are actually useful, plus, they slow down everything by containing pictures, Bla… Darkness (yes, it is a color now) symbolizes advertisement, something that should never be on such websites, and magenta is the color I chose for editing out personal information.

I only have a few things to say: what the hell is wrong with the psychopaths that designed voyages-sncf? Are they still running free? Have they been arrested? committed? Honestly, I do not know the answers to these questions, and I am afraid to learn the truth. But one day… I will have to, if not for me, for the sake of mankind, because someone has to.

Communications {#communications}

Phone carriers in France {#phone}

As far as phone carriers goes, none of them are good. You just have to try to choose the lesser evil and hope for the best. For a very long time, there were only three MNOs in France. It's only recently that a fourth one appeared because lack of competition, politics, bullshit, etc. That fourth one is called Free Mobile. Its network is terrible, it does filtering like most phone carriers, their support isn't especially good, but they don't have plan commitment periods: you stop your contract whenever you want, they don't sell you €2 phones and then hide credit in your plan fees. It's not a no bullshit alternative, but it's certainly a less bullshit one.

Operating systems {#oses}

GNU/Linux {#gnulinux}

Imagine an operating system that would give you total control over your computer. Imagine an operating system that can make you responsible for its failures. Not some obscure sub-routine hidden deep inside its entrails but the programs you chose to run and how you failed to configure them.

When a GNU/Linux, fails, most of the time, it's your fault. When, let's say… a Windows or a Mac fails, it's some obscure arcane that you have no influence over that failed.

Debbuging linux is not some obscure voodoo, it is SCIENCE.

Do yourself a favor, read about GNU/Linux.

tl;dr {#tldr}

Whoever you are, wherever you have, whatever you do, always remember, plan to avoid bullshit. Don't choose the easy path, don't choose the cheapest path, don't choose the lazy path, or else the bullshit will come for you, or else, the bullshit will end you.

Oh by the way, this article might get edited in the future if I get more ideas.


Unless otherwise credited all material Creative Commons License by Reihar