<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom"><title>flurischt.ch</title><link href="https://flurischt.ch/" rel="alternate"></link><link href="https://flurischt.ch/feeds/all.atom.xml" rel="self"></link><id>https://flurischt.ch/</id><updated>2017-11-05T00:00:00+01:00</updated><subtitle>Software Engineer</subtitle><entry><title>Encrypted Duplicity Backup to European Amazon S3 Bucket</title><link href="https://flurischt.ch/encrypted-duplicity-backup-to-european-amazon-s3-bucket.html" rel="alternate"></link><published>2017-11-05T00:00:00+01:00</published><updated>2017-11-05T00:00:00+01:00</updated><author><name>flurin</name></author><id>tag:flurischt.ch,2017-11-05:/encrypted-duplicity-backup-to-european-amazon-s3-bucket.html</id><summary type="html">&lt;p&gt;This post documents how to configure AWS S3 and duplicity to do encrypted backups to the cloud.&lt;/p&gt;</summary><content type="html">&lt;h1&gt;Introduction&lt;/h1&gt;
&lt;p&gt;&lt;a href="http://duplicity.nongnu.org/"&gt;duplicity&lt;/a&gt; supports backups to &lt;a href="https://aws.amazon.com/s3/"&gt;AWS S3&lt;/a&gt;. There are a lot of howtos out there but most assume that you want to backup to the (default) US region. It gets more complicated for other regions and your mostly left on your own with strange errors from boto, the library that talks to AWS. Below I document how to use duplicity to do GPG encrypted backups to S3 in the &lt;strong&gt;EU (Ireland)&lt;/strong&gt; (eu-west-1) region.&lt;/p&gt;
&lt;h1&gt;Setting up S3 and IAM&lt;/h1&gt;
&lt;p&gt;We'll create an S3-bucket and an IAM user with full access to that bucket. Make sure to use &lt;strong&gt;EU (Ireland)&lt;/strong&gt; region so that the backup-script below works.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Go to the &lt;a href="https://s3.console.aws.amazon.com"&gt;S3 console&lt;/a&gt; and create a new bucket in region &lt;strong&gt;EU (Ireland)&lt;/strong&gt;. Do &lt;strong&gt;NOT&lt;/strong&gt; use dots in the bucket-name (&lt;a href="https://github.com/boto/boto/issues/2836"&gt;#2836&lt;/a&gt;). Let's say we use &lt;code&gt;MY-S3-BUCKET-NAME&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Next go to &lt;a href="https://console.aws.amazon.com/iam/home"&gt;Identity and Access Management&lt;/a&gt; (IAM), create a new user with &lt;strong&gt;programmatic access&lt;/strong&gt; and write down the &lt;code&gt;access key&lt;/code&gt; and &lt;code&gt;secret access key&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Still in IAM create a new policy with the content below and attach it to the user. Make sure to replace &lt;code&gt;&amp;lt;MY-S3-BUCKET-NAME&amp;gt;&lt;/code&gt; with the actual bucket name. &lt;/li&gt;
&lt;/ol&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;&lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="nt"&gt;&amp;quot;Version&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;2012-10-17&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;&lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="nt"&gt;&amp;quot;Statement&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;&lt;/span&gt;
&lt;span class="w"&gt;        &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;&lt;/span&gt;
&lt;span class="w"&gt;            &lt;/span&gt;&lt;span class="nt"&gt;&amp;quot;Effect&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;Allow&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;&lt;/span&gt;
&lt;span class="w"&gt;            &lt;/span&gt;&lt;span class="nt"&gt;&amp;quot;Action&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;s3:*&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;&lt;/span&gt;
&lt;span class="w"&gt;            &lt;/span&gt;&lt;span class="nt"&gt;&amp;quot;Resource&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;&lt;/span&gt;
&lt;span class="w"&gt;                &lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;arn:aws:s3:::&amp;lt;MY-S3-BUCKET-NAME&amp;gt;&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;&lt;/span&gt;
&lt;span class="w"&gt;                &lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;arn:aws:s3:::&amp;lt;MY-S3-BUCKET-NAME&amp;gt;/*&amp;quot;&lt;/span&gt;&lt;span class="w"&gt;&lt;/span&gt;
&lt;span class="w"&gt;            &lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;&lt;/span&gt;
&lt;span class="w"&gt;        &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;&lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;h1&gt;Server Setup&lt;/h1&gt;
&lt;p&gt;Assuming Ubuntu we'll install the latest duplicity version from the ppa:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;root@server:~# add-apt-repository ppa:duplicity-team/ppa
root@server:~# apt clean &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; apt update &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; apt install -y duplicity python-boto
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Next we'll need a gpg key to encrypt the backup stored in the cloud:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;user@server:~# sudo -i &lt;span class="c1"&gt;# we&amp;#39;ll run the backup as root. so make the gpg key using user root too&lt;/span&gt;
root@server:~# gpg --gen-key &lt;span class="c1"&gt;# use kind &amp;quot;RSA and RSA (default)&amp;quot;, name &amp;quot;duplicity&amp;quot; and set a passphrase&lt;/span&gt;
root@server:~# gpg --list-keys
/root/.gnupg/pubring.gpg
------------------------
pub   4096R/&amp;lt;The-GPG-Key-ID&amp;gt; &lt;span class="m"&gt;2017&lt;/span&gt;-12-05
uid                  duplicity &lt;span class="o"&gt;(&lt;/span&gt;...&lt;span class="o"&gt;)&lt;/span&gt; &amp;lt;....&amp;gt;
sub   4096R/....... &lt;span class="m"&gt;2017&lt;/span&gt;-12-05
&lt;span class="c1"&gt;# export the gpg keys and keep them at a secure location:&lt;/span&gt;
root@server:~# gpg -a --export duplicity
root@server:~# gpg -a --export-secret-key duplicity
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;AGAIN:&lt;/strong&gt; Save the gpg key at a secure location and not only on the server. If the server goes down you will not be able to restore your backups without that key!&lt;/p&gt;
&lt;h1&gt;Backup Script&lt;/h1&gt;
&lt;p&gt;On the server we'll create two files: &lt;code&gt;/root/.duplicity_secrets&lt;/code&gt; with the S3 access keys and &lt;code&gt;/root/backup_to_s3.sh&lt;/code&gt; which will be the backup script.&lt;/p&gt;
&lt;h2&gt;/root/.duplicity_secrets&lt;/h2&gt;
&lt;p&gt;This file will hold the S3 access keys and the passphrase to the gpg key:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="nb"&gt;export&lt;/span&gt; &lt;span class="nv"&gt;PASSPHRASE&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;&amp;lt;THE-PASSPHRASE-TO-YOUR-GPG-KEY&amp;gt;&amp;quot;&lt;/span&gt;
&lt;span class="nb"&gt;export&lt;/span&gt; &lt;span class="nv"&gt;AWS_ACCESS_KEY_ID&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;&amp;lt;YOUR-IAM-USERS-ACCESS-KEY&amp;gt;&amp;quot;&lt;/span&gt;
&lt;span class="nb"&gt;export&lt;/span&gt; &lt;span class="nv"&gt;AWS_SECRET_ACCESS_KEY&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;&amp;lt;YOUR-IAM-USERS-SECRET-ACCESS-KEY&amp;gt;&amp;quot;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;h2&gt;/root/backup_to_s3.sh&lt;/h2&gt;
&lt;p&gt;The backup script will source the .duplicity_secrets file and then backup to S3. Below is an example how to backup &lt;code&gt;/etc&lt;/code&gt; into a subdirectory &lt;code&gt;server-name/etc&lt;/code&gt; in the S3-bucket. Make sure to configure &lt;code&gt;&amp;lt;The-GPG-Key-ID&amp;gt;&lt;/code&gt; and &lt;code&gt;&amp;lt;MY-S3-BUCKET-NAME&amp;gt;&lt;/code&gt; in the following script: &lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="nb"&gt;source&lt;/span&gt; /root/.duplicity_secrets

&lt;span class="c1"&gt;# duplicity args&lt;/span&gt;
&lt;span class="c1"&gt;# &lt;/span&gt;
&lt;span class="nv"&gt;s3_bucket&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;s3://s3.eu-west-1.amazonaws.com/&amp;lt;MY-S3-BUCKET-NAME&amp;gt;/&lt;/span&gt;&lt;span class="si"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;HOSTNAME&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;&lt;/span&gt;
&lt;span class="nv"&gt;encrypt_key&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;&amp;lt;The-GPG-Key-ID&amp;gt;&amp;quot;&lt;/span&gt;
&lt;span class="nv"&gt;aws_args&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;--s3-european-buckets --s3-use-new-style&amp;quot;&lt;/span&gt;
&lt;span class="c1"&gt;# experimental setting that may speed up the backup: --asynchronous-upload&lt;/span&gt;

&lt;span class="c1"&gt;# backup /etc to &amp;lt;MY-S3-BUCKET-NAME&amp;gt;/hostname/etc&lt;/span&gt;
/usr/bin/duplicity &lt;span class="nv"&gt;$aws_args&lt;/span&gt; --encrypt-key &lt;span class="nv"&gt;$encrypt_key&lt;/span&gt; -v &lt;span class="m"&gt;4&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
    incr --full-if-older-than 14D &lt;span class="se"&gt;\&lt;/span&gt;
    /etc &lt;span class="si"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;s3_bucket&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;/etc

&lt;span class="nb"&gt;unset&lt;/span&gt; PASSPHRASE
&lt;span class="nb"&gt;unset&lt;/span&gt; AWS_ACCESS_KEY_ID
&lt;span class="nb"&gt;unset&lt;/span&gt; AWS_SECRET_ACCESS_KEY
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;h1&gt;Some Duplicity commands&lt;/h1&gt;
&lt;p&gt;Checkout: &lt;a href="https://help.ubuntu.com/community/DuplicityBackupHowto"&gt;https://help.ubuntu.com/community/DuplicityBackupHowto&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Some examples:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;root@server:~# &lt;span class="nb"&gt;source&lt;/span&gt; /root/.duplicity_secrets 
root@server:~# &lt;span class="nb"&gt;export&lt;/span&gt; &lt;span class="nv"&gt;S3_BUCKET&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;s3://s3.eu-west-1.amazonaws.com/&amp;lt;MY-S3-BUCKET-NAME&amp;gt;/&amp;lt;SET-YOUR-SERVER-HOSTNAME-HERE&amp;gt;&amp;quot;&lt;/span&gt;
&lt;span class="c1"&gt;# list files in the backup&lt;/span&gt;
root@server:~# duplicity list-current-files &lt;span class="nv"&gt;$S3_BUCKET&lt;/span&gt;/etc
&lt;span class="c1"&gt;# restore /etc/fstab to /tmp/restored_fstab&lt;/span&gt;
root@server:~# duplicity --file-to-restore fstab &lt;span class="nv"&gt;$S3_BUCKET&lt;/span&gt;/etc /tmp/restored_fstab 
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;h1&gt;Troubleshooting&lt;/h1&gt;
&lt;p&gt;We're connecting duplicity directly to s3.eu-west-1.amazonaws.com. This is &lt;strong&gt;EU (Ireland)&lt;/strong&gt; region and will therefore only work if you setup the bucket in the correct region. If you're using another region you may have to change the URL and/or play with &lt;code&gt;$aws_args&lt;/code&gt; in the backup script. If you're getting ACCESS DENIED errors make sure to check the IAM policy and that it is attached to the user.&lt;/p&gt;
&lt;h1&gt;Credits&lt;/h1&gt;
&lt;p&gt;A lot of this post is based on Igor Cicimov's &lt;a href="https://icicimov.github.io/blog/devops/Duplicity-encrypted-backups-to-Amazon-S3/"&gt;Duplicity encrypted backups to Amazon S3&lt;/a&gt; post. I followed the steps described there but ran into S3 upload problems with the URL-schema used there. That's why I'm using eu-west-1 and directly connect to that endpoint.&lt;/p&gt;</content><category term="tech"></category><category term="linux"></category><category term="ubuntu"></category><category term="aws"></category><category term="s3"></category></entry><entry><title>Sharir and Pnueli's TWO APPROACHES TO INTERPROCEDURAL DATA FLOW ANALYSIS</title><link href="https://flurischt.ch/sharir-and-pnuelis-two-approaches-to-interprocedural-data-flow-analysis.html" rel="alternate"></link><published>2017-08-18T00:00:00+02:00</published><updated>2017-08-18T00:00:00+02:00</updated><author><name>flurin</name></author><id>tag:flurischt.ch,2017-08-18:/sharir-and-pnuelis-two-approaches-to-interprocedural-data-flow-analysis.html</id><content type="html">&lt;p&gt;This paper is really hard to come by and all scans are either incomplete or include the empty backpages. Here's a cleaned up version: &lt;a href="https://flurischt.ch/upload/static-analysis/sharir-pnueli_two-approaches.pdf"&gt;Download&lt;/a&gt;&lt;/p&gt;</content><category term="tech"></category><category term="static analysis"></category></entry><entry><title>Spellcheck in Latex Files</title><link href="https://flurischt.ch/spellcheck-in-latex-files.html" rel="alternate"></link><published>2017-08-10T00:00:00+02:00</published><updated>2017-08-10T00:00:00+02:00</updated><author><name>flurin</name></author><id>tag:flurischt.ch,2017-08-10:/spellcheck-in-latex-files.html</id><content type="html">&lt;p&gt;I use the following snippet to spellcheck latex files:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="ch"&gt;#!/bin/bash&lt;/span&gt;
hunspell -d en_GB -t &lt;span class="nv"&gt;$1&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Put it into a spellcheck.sh file. Then &lt;code&gt;./spellcheck.sh myfile.tex&lt;/code&gt;.&lt;/p&gt;</content><category term="tech"></category><category term="LaTeX"></category><category term="hunspell"></category></entry><entry><title>Manually starting ssh-agent to use it in a (remote) terminal session</title><link href="https://flurischt.ch/manually-starting-ssh-agent-to-use-it-in-a-remote-terminal-session.html" rel="alternate"></link><published>2017-06-22T00:00:00+02:00</published><updated>2017-06-22T00:00:00+02:00</updated><author><name>flurin</name></author><id>tag:flurischt.ch,2017-06-22:/manually-starting-ssh-agent-to-use-it-in-a-remote-terminal-session.html</id><summary type="html">&lt;p&gt;ssh-agent can be used to unlock an ssh private key and therefore prevent having to enter the password multiple times. Usually your desktop environment does this for you. But if you're for example sshing into your workstation and then use ssh (e.g. for git or hg) your desktop environment …&lt;/p&gt;</summary><content type="html">&lt;p&gt;ssh-agent can be used to unlock an ssh private key and therefore prevent having to enter the password multiple times. Usually your desktop environment does this for you. But if you're for example sshing into your workstation and then use ssh (e.g. for git or hg) your desktop environment won't help you. Here's how to start ssh-agent and unlock your private key:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&amp;gt; eval `ssh-agent -s`
&amp;gt; ssh-add
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Now you can use the unlocked key to make ssh connections. And after your work is done here's how to kill ssh-agent and unlock the key again:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&amp;gt; ssh-agent -k
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;</content><category term="misc"></category><category term="linux"></category><category term="ssh"></category></entry><entry><title>Python networkx (graph library) example</title><link href="https://flurischt.ch/python-networkx-graph-library-example.html" rel="alternate"></link><published>2017-06-06T00:00:00+02:00</published><updated>2017-06-06T00:00:00+02:00</updated><author><name>flurin</name></author><id>tag:flurischt.ch,2017-06-06:/python-networkx-graph-library-example.html</id><summary type="html">&lt;p&gt;This is just for me to look it up again later:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="ch"&gt;#!/usr/bin/env python3&lt;/span&gt;

&lt;span class="sd"&gt;&amp;quot;&amp;quot;&amp;quot;&lt;/span&gt;
&lt;span class="sd"&gt;A small example that uses networkx and pyplot to create a DiGraph, &lt;/span&gt;
&lt;span class="sd"&gt;draw it and compute floyd-warshall on it.&lt;/span&gt;
&lt;span class="sd"&gt;&amp;quot;&amp;quot;&amp;quot;&lt;/span&gt;

&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;networkx&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="nn"&gt;nx&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;matplotlib.pyplot&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="nn"&gt;plt&lt;/span&gt;

&lt;span class="c1"&gt;#https://www.debian.org/vote/2013/vote_001 …&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;</summary><content type="html">&lt;p&gt;This is just for me to look it up again later:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="ch"&gt;#!/usr/bin/env python3&lt;/span&gt;

&lt;span class="sd"&gt;&amp;quot;&amp;quot;&amp;quot;&lt;/span&gt;
&lt;span class="sd"&gt;A small example that uses networkx and pyplot to create a DiGraph, &lt;/span&gt;
&lt;span class="sd"&gt;draw it and compute floyd-warshall on it.&lt;/span&gt;
&lt;span class="sd"&gt;&amp;quot;&amp;quot;&amp;quot;&lt;/span&gt;

&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;networkx&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="nn"&gt;nx&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;matplotlib.pyplot&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="nn"&gt;plt&lt;/span&gt;

&lt;span class="c1"&gt;#https://www.debian.org/vote/2013/vote_001&lt;/span&gt;
&lt;span class="c1"&gt;# The beats matrix:&lt;/span&gt;
&lt;span class="c1"&gt;#&lt;/span&gt;
&lt;span class="c1"&gt;#           1   2   3   4&lt;/span&gt;
&lt;span class="c1"&gt;#Option 1       88  62  319&lt;/span&gt;
&lt;span class="c1"&gt;#Option 2   252     141 355&lt;/span&gt;
&lt;span class="c1"&gt;#Option 3   279 210     353&lt;/span&gt;
&lt;span class="c1"&gt;#Option 4   51  24  30   &lt;/span&gt;
&lt;span class="n"&gt;BEATS_MATRIX&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
    &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;88&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;62&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;319&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
    &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;252&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;141&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;355&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
    &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;279&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;210&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;353&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
    &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;51&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;24&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;30&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="n"&gt;NUM_OPTIONS&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt;

&lt;span class="c1"&gt;# create a graph with candidates that beat each other&lt;/span&gt;
&lt;span class="n"&gt;G&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;nx&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;DiGraph&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

&lt;span class="c1"&gt;# create nodes for all options&lt;/span&gt;
&lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;option&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="nb"&gt;range&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;NUM_OPTIONS&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="n"&gt;G&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;add_node&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;option&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="c1"&gt;# connect winner to loser options&lt;/span&gt;
&lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;o1&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="nb"&gt;range&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;NUM_OPTIONS&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;o2&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="nb"&gt;range&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;o1&lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;NUM_OPTIONS&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;BEATS_MATRIX&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;o1&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="n"&gt;o2&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;BEATS_MATRIX&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;o2&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="n"&gt;o1&lt;/span&gt;&lt;span class="p"&gt;]:&lt;/span&gt;
            &lt;span class="n"&gt;u&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;o1&lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;
            &lt;span class="n"&gt;v&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;o2&lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;
            &lt;span class="n"&gt;c&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;BEATS_MATRIX&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;o1&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="n"&gt;o2&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;BEATS_MATRIX&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;o2&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="n"&gt;o1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
        &lt;span class="k"&gt;else&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
            &lt;span class="n"&gt;u&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;o2&lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;
            &lt;span class="n"&gt;v&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;o1&lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;
            &lt;span class="n"&gt;c&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;BEATS_MATRIX&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;o2&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="n"&gt;o1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;BEATS_MATRIX&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;o1&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="n"&gt;o2&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
        &lt;span class="nb"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;option &lt;/span&gt;&lt;span class="si"&gt;{}&lt;/span&gt;&lt;span class="s2"&gt; wins over &lt;/span&gt;&lt;span class="si"&gt;{}&lt;/span&gt;&lt;span class="s2"&gt; by &lt;/span&gt;&lt;span class="si"&gt;{}&lt;/span&gt;&lt;span class="s2"&gt; votes&amp;quot;&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;format&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;v&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;c&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
        &lt;span class="n"&gt;G&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;add_edge&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;v&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;weight&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;c&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;


&lt;span class="c1"&gt;# all pairs shortest path example&lt;/span&gt;
&lt;span class="n"&gt;distance&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;nx&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;floyd_warshall&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;G&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;u&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="nb"&gt;range&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;NUM_OPTIONS&lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;v&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="nb"&gt;range&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;NUM_OPTIONS&lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="nb"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;&lt;/span&gt;&lt;span class="si"&gt;{}&lt;/span&gt;&lt;span class="s2"&gt; &amp;quot;&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;format&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;distance&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="n"&gt;v&lt;/span&gt;&lt;span class="p"&gt;]),&lt;/span&gt; &lt;span class="n"&gt;end&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="nb"&gt;print&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

&lt;span class="c1"&gt;#drawing example&lt;/span&gt;
&lt;span class="n"&gt;pos&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;nx&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;spectral_layout&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;G&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="c1"&gt;# positions for all nodes&lt;/span&gt;
&lt;span class="n"&gt;nx&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;draw_networkx_nodes&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;G&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;pos&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;node_size&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;700&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;nx&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;draw_networkx_edges&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;G&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;pos&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;edgelist&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;G&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;edges&lt;/span&gt;&lt;span class="p"&gt;(),&lt;/span&gt; &lt;span class="n"&gt;width&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;nx&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;draw_networkx_labels&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;G&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;pos&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;font_size&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;15&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;font_family&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;sans-serif&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;edge_labels&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nb"&gt;dict&lt;/span&gt;&lt;span class="p"&gt;([((&lt;/span&gt;&lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="n"&gt;v&lt;/span&gt;&lt;span class="p"&gt;,),&lt;/span&gt;&lt;span class="n"&gt;d&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;weight&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;
             &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="n"&gt;v&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="n"&gt;d&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;G&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;edges&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="kc"&gt;True&lt;/span&gt;&lt;span class="p"&gt;)])&lt;/span&gt;
&lt;span class="n"&gt;nx&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;draw_networkx_edge_labels&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;G&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;pos&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;edge_labels&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;edge_labels&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;\
    &lt;span class="n"&gt;font_size&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;15&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;font_family&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;sans-serif&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="n"&gt;plt&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;axis&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;off&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;plt&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;show&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;</content><category term="misc"></category><category term="python"></category><category term="algorithms"></category><category term="graph"></category></entry><entry><title>Music for working / learning (updated)</title><link href="https://flurischt.ch/music-for-working-learning-updated.html" rel="alternate"></link><published>2017-05-27T00:00:00+02:00</published><updated>2017-05-27T00:00:00+02:00</updated><author><name>flurin</name></author><id>tag:flurischt.ch,2017-05-27:/music-for-working-learning-updated.html</id><content type="html">&lt;p&gt;Some nice music on youtube and soundcloud: &lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="http://www.youtube.com/watch?v=2O0kuoiAm2A&amp;amp;list=RDHCU6G1Mt18DlE"&gt;Nujabes (Playlist)&lt;/a&gt; and &lt;a href="http://www.youtube.com/watch?v=2sML2bq_WGw"&gt;Never ending Nujabes&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.youtube.com/watch?v=oasfi6EDhqg&amp;amp;list=RDw2NQditiTm4"&gt;Nomak&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.youtube.com/watch?v=vHgSp0_Xumk&amp;amp;list=PLpyrjJvJ7GJ7bM5GjzwHvZIqe6c5l3iF6"&gt;TheSoundYouNeed&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://soundcloud.com/aka-dj-quads/tracks"&gt;DJ Quads&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.dondiablo.com/hexagonradio/"&gt;Don Diablo: Hexagon Radio&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</content><category term="misc"></category><category term="music"></category></entry><entry><title>IntelliJ Idea application menu entry for xubuntu</title><link href="https://flurischt.ch/intellij-idea-application-menu-entry-for-xubuntu.html" rel="alternate"></link><published>2017-05-25T00:00:00+02:00</published><updated>2017-05-25T00:00:00+02:00</updated><author><name>flurin</name></author><id>tag:flurischt.ch,2017-05-25:/intellij-idea-application-menu-entry-for-xubuntu.html</id><summary type="html">&lt;p&gt;Assuming intellij has been installed to /opt/ here's how to create an application menu entry (on xubuntu). Create a file &lt;code&gt;~/.local/share/applications/intellij.desktop&lt;/code&gt; with the following content:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="k"&gt;[Desktop Entry]&lt;/span&gt;&lt;span class="w"&gt;&lt;/span&gt;
&lt;span class="na"&gt;Version&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;1.0&lt;/span&gt;&lt;span class="w"&gt;&lt;/span&gt;
&lt;span class="na"&gt;Type&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;Application&lt;/span&gt;&lt;span class="w"&gt;&lt;/span&gt;
&lt;span class="na"&gt;Name&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;IntelliJ&lt;/span&gt;&lt;span class="w"&gt;&lt;/span&gt;
&lt;span class="na"&gt;Icon&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;/opt/jetbrains/idea/bin/idea.png&lt;/span&gt;&lt;span class="w"&gt;&lt;/span&gt;
&lt;span class="na"&gt;Exec&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;/opt/jetbrains/idea/bin …&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;</summary><content type="html">&lt;p&gt;Assuming intellij has been installed to /opt/ here's how to create an application menu entry (on xubuntu). Create a file &lt;code&gt;~/.local/share/applications/intellij.desktop&lt;/code&gt; with the following content:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="k"&gt;[Desktop Entry]&lt;/span&gt;&lt;span class="w"&gt;&lt;/span&gt;
&lt;span class="na"&gt;Version&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;1.0&lt;/span&gt;&lt;span class="w"&gt;&lt;/span&gt;
&lt;span class="na"&gt;Type&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;Application&lt;/span&gt;&lt;span class="w"&gt;&lt;/span&gt;
&lt;span class="na"&gt;Name&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;IntelliJ&lt;/span&gt;&lt;span class="w"&gt;&lt;/span&gt;
&lt;span class="na"&gt;Icon&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;/opt/jetbrains/idea/bin/idea.png&lt;/span&gt;&lt;span class="w"&gt;&lt;/span&gt;
&lt;span class="na"&gt;Exec&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;/opt/jetbrains/idea/bin/idea.sh&lt;/span&gt;&lt;span class="w"&gt;&lt;/span&gt;
&lt;span class="na"&gt;NoDisplay&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;false&lt;/span&gt;&lt;span class="w"&gt;&lt;/span&gt;
&lt;span class="na"&gt;Categories&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;Development;&lt;/span&gt;&lt;span class="w"&gt;&lt;/span&gt;
&lt;span class="na"&gt;StartupNotify&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;false&lt;/span&gt;&lt;span class="w"&gt;&lt;/span&gt;
&lt;span class="na"&gt;Terminal&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;false&lt;/span&gt;&lt;span class="w"&gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;</content><category term="tech"></category><category term="xubuntu"></category><category term="linux"></category></entry><entry><title>Extend a VirtualBox guest harddisk</title><link href="https://flurischt.ch/extend-a-virtualbox-guest-harddisk.html" rel="alternate"></link><published>2017-04-18T00:00:00+02:00</published><updated>2017-04-18T00:00:00+02:00</updated><author><name>flurin</name></author><id>tag:flurischt.ch,2017-04-18:/extend-a-virtualbox-guest-harddisk.html</id><summary type="html">&lt;p&gt;I use VirtualBox for the rare cases when I need a Windows OS. The latest Win10 updates failed to install because there's not enough disk space. Apparently 30GB is not enough for a whole OS and office... ;-(&lt;/p&gt;
&lt;p&gt;Luckily that's easy to fix:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Shutdown the guest&lt;/li&gt;
&lt;li&gt;Make sure there are no …&lt;/li&gt;&lt;/ul&gt;</summary><content type="html">&lt;p&gt;I use VirtualBox for the rare cases when I need a Windows OS. The latest Win10 updates failed to install because there's not enough disk space. Apparently 30GB is not enough for a whole OS and office... ;-(&lt;/p&gt;
&lt;p&gt;Luckily that's easy to fix:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Shutdown the guest&lt;/li&gt;
&lt;li&gt;Make sure there are no snapshots of the virtual machine (I read somewhere that it doesnt work with snapshots. Didn't try it myself)&lt;/li&gt;
&lt;li&gt;Resize the disk: &lt;code&gt;VBoxManage modifyhd VIRTUAL_MACHINE_NAME.vdi --resize 40960&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Start the guest&lt;/li&gt;
&lt;li&gt;Extend the C: partition (Right click on the partition in windows disk management)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The above steps resize the disk to 40GB. Don't forget the last step. Otherwise you'll have a 40GB disk but Windows won't be using the whole drive.&lt;/p&gt;</content><category term="tech"></category><category term="windows"></category><category term="linux"></category></entry><entry><title>DD-WRT (kong) on Netgear R7000 and Fiber7 IPv6 configuration</title><link href="https://flurischt.ch/dd-wrt-kong-on-netgear-r7000-and-fiber7-ipv6-configuration.html" rel="alternate"></link><published>2017-01-21T00:00:00+01:00</published><updated>2017-01-21T00:00:00+01:00</updated><author><name>flurin</name></author><id>tag:flurischt.ch,2017-01-21:/dd-wrt-kong-on-netgear-r7000-and-fiber7-ipv6-configuration.html</id><summary type="html">&lt;p&gt;I'm a fan of Netgear's R7000 hardware. Not so much of the software. Since I bought this router I was not able to get IPv6 working with my &lt;a href="https://www.fiber7.ch/"&gt;Fiber7&lt;/a&gt; internet connection. The Netgear firmware does not support DHCPv6-PD which is what my provider requires. Anyway, not having IPv6 was not …&lt;/p&gt;</summary><content type="html">&lt;p&gt;I'm a fan of Netgear's R7000 hardware. Not so much of the software. Since I bought this router I was not able to get IPv6 working with my &lt;a href="https://www.fiber7.ch/"&gt;Fiber7&lt;/a&gt; internet connection. The Netgear firmware does not support DHCPv6-PD which is what my provider requires. Anyway, not having IPv6 was not a big problem (yet). But the latest security vulnerability debacle (see &lt;a href="http://www.cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2016-6277"&gt;CVE-2016-6277&lt;/a&gt; and &lt;a href="http://www.cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-5521"&gt;CVE-2017-5521&lt;/a&gt;) was too much. Let's switch to DD-WRT.&lt;/p&gt;
&lt;h2&gt;Performance side remarks&lt;/h2&gt;
&lt;p&gt;According to the &lt;a href="https://dd-wrt.com/wiki/index.php/DD-WRT_on_R7000"&gt;DD-WRT wiki&lt;/a&gt; Netgear uses proprietary hardware acceleration for IPv4 NAT. If you use a free firmware you'll lose this hardware acceleration and the throughput will be lower. So with a fast internet connection &amp;gt;= 500 Mbit/s you'll notice this. I have a fast internet connection but don't care about it. We don't get the full speed over W-Lan anyway and I'd rather get rid of the Netgear firmware than have a higher throughput, no IPv6 and all the security udpates...&lt;/p&gt;
&lt;h2&gt;Which version?&lt;/h2&gt;
&lt;p&gt;Apparently there are two different versions of DD-WRT for the R7000. There's &lt;a href="http://www.desipro.de/ddwrt/K3-AC-Arm/"&gt;Kong's mod&lt;/a&gt; and then there are the builds on the &lt;a href="ftp://ftp.dd-wrt.com/betas/2016/11-14-2016-r30880/netgear-r7000/"&gt;DD-WRT website&lt;/a&gt;. I decided to use Kong's mod because they seem to be the dev who brought R7000 support to DD-WRT and their firmware has some additional features (like for example a cli update program).&lt;/p&gt;
&lt;h2&gt;DD-WRT Installation&lt;/h2&gt;
&lt;p&gt;I use &lt;code&gt;dd-wrt.K3_R7000.chk&lt;/code&gt; (dated 18th of January 2017) from &lt;a href="http://www.desipro.de/ddwrt/K3-AC-Arm/"&gt;Kong's website&lt;/a&gt;. This assumes that currently the official netgear firmware is installed.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Reset router to factory defaults using the admin interface&lt;/li&gt;
&lt;li&gt;Use the admin interface to upload the new firmware&lt;/li&gt;
&lt;li&gt;There might be a warning about installing the same or an older firmware. Just accept it.&lt;/li&gt;
&lt;li&gt;As soon as the router is available visit &lt;a href="http://192.168.1.1"&gt;http://192.168.1.1&lt;/a&gt; and set a DD-WRT admin username and passwort&lt;/li&gt;
&lt;li&gt;Now head to &lt;a href="http://192.168.1.1/Factory_Defaults.asp"&gt;http://192.168.1.1/Factory_Defaults.asp&lt;/a&gt; and &lt;code&gt;Restore Factory Defaults&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Router will reboot and again you need to set username and password on &lt;a href="http://192.168.1.1"&gt;http://192.168.1.1&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Since it's not clear (at least for me) whether Restore Factory Defaults also deletes the nvram I did this manually:&lt;ul&gt;
&lt;li&gt;telnet 192.168.1.1&lt;/li&gt;
&lt;li&gt;username: root&lt;/li&gt;
&lt;li&gt;password: THE_ADMIN_PASSWORD_YOU_SET_BEFORE&lt;/li&gt;
&lt;li&gt;&lt;code&gt;nvram erase&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;reboot&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Now for the last time set a username and password on &lt;a href="http://192.168.1.1"&gt;http://192.168.1.1&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;DD-WRT is now installed and you can start configuring it. I mainly set the Wireless Regulatory Domain to Switzerland, configured wireless and port forwarding and enabled IPV6.&lt;/p&gt;
&lt;h2&gt;Fiber7 IPv6 settings&lt;/h2&gt;
&lt;p&gt;To get IPv6 with my provider working I enabled it here: &lt;a href="http://192.168.1.1/IPV6.asp"&gt;http://192.168.1.1/IPV6.asp&lt;/a&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;IPv6: enable&lt;/li&gt;
&lt;li&gt;IPv6 Type: DHCPv6 with Prefix Delegation&lt;/li&gt;
&lt;li&gt;Prefix Length: 48&lt;/li&gt;
&lt;li&gt;Static DNS 1: leave empty&lt;/li&gt;
&lt;li&gt;Static DNS 2: leave empty&lt;/li&gt;
&lt;li&gt;Remaining settings: default&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;After Save, Apply Settings and a Router reboot IPv6 was working on router and clients.&lt;/p&gt;
&lt;h2&gt;Further links&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="http://www.dd-wrt.com/phpBB2/viewtopic.php?t=264152"&gt;Kong R7000 Configuration Best Practices or Working Solutions&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.dd-wrt.com/phpBB2/viewtopic.php?t=306845"&gt;New firmware: DD-WRT v3.0-r31160M kongac (01/18/17)&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</content><category term="tech"></category><category term="dd-wrt"></category><category term="fiber7"></category></entry><entry><title>Cups printers do not show up in Firefox (Arch)</title><link href="https://flurischt.ch/cups-printers-do-not-show-up-in-firefox-arch.html" rel="alternate"></link><published>2017-01-02T00:00:00+01:00</published><updated>2017-01-02T00:00:00+01:00</updated><author><name>flurin</name></author><id>tag:flurischt.ch,2017-01-02:/cups-printers-do-not-show-up-in-firefox-arch.html</id><content type="html">&lt;p&gt;If your CUPS printers do not show up in the Firefox printing dialog (but they do for example in Google Chrome) you may be missing the following package: &lt;a href="https://bbs.archlinux.org/viewtopic.php?pid=1664877#p1664877"&gt;gtk3-print-backends&lt;/a&gt;. Installing this solved that very annoying problem for me.&lt;/p&gt;</content><category term="tech"></category><category term="arch"></category><category term="linux"></category></entry><entry><title>USB Keyboard not working at boot (between GRUB and disk decryption)</title><link href="https://flurischt.ch/usb-keyboard-not-working-at-boot-between-grub-and-disk-decryption.html" rel="alternate"></link><published>2016-12-18T00:00:00+01:00</published><updated>2016-12-18T00:00:00+01:00</updated><author><name>flurin</name></author><id>tag:flurischt.ch,2016-12-18:/usb-keyboard-not-working-at-boot-between-grub-and-disk-decryption.html</id><summary type="html">&lt;p&gt;On my thinkpad I have an encrypted Arch installation setup similarly to &lt;a href="https://flurischt.ch/arch-linux-on-toshiba-cb30-102-chromebook.html"&gt;my chromebook setup&lt;/a&gt;. Since I bought my a new wireless usb keyboard this thing never worked for decrypting the system. It perfectly works once Arch has started up, but for entering the password at boot I had to …&lt;/p&gt;</summary><content type="html">&lt;p&gt;On my thinkpad I have an encrypted Arch installation setup similarly to &lt;a href="https://flurischt.ch/arch-linux-on-toshiba-cb30-102-chromebook.html"&gt;my chromebook setup&lt;/a&gt;. Since I bought my a new wireless usb keyboard this thing never worked for decrypting the system. It perfectly works once Arch has started up, but for entering the password at boot I had to use the notebook keyboard.&lt;/p&gt;
&lt;h2&gt;Add missing modules to initramsfs&lt;/h2&gt;
&lt;p&gt;Turns out my initramfs was missing the necessary modules.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Checkout the &lt;a href="https://wiki.archlinux.org/index.php/Minimal_initramfs#Keyboard_modules"&gt;Arch wiki&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Find the relevant keyboard modules. In my case it was &lt;code&gt;hid_generic&lt;/code&gt; and &lt;code&gt;usbhid&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Edit /etc/mkinitcpio.conf and set &lt;code&gt;MODULES="hid_generic usbhid"&lt;/code&gt; (or whatever your modules are)&lt;/li&gt;
&lt;li&gt;&lt;code&gt;mkinitcpio -p linux&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Reboot&lt;/li&gt;
&lt;/ul&gt;</content><category term="tech"></category><category term="arch"></category><category term="linux"></category></entry><entry><title>Gitlab CE setup</title><link href="https://flurischt.ch/gitlab-ce-setup.html" rel="alternate"></link><published>2016-11-02T00:00:00+01:00</published><updated>2016-11-02T00:00:00+01:00</updated><author><name>flurin</name></author><id>tag:flurischt.ch,2016-11-02:/gitlab-ce-setup.html</id><summary type="html">&lt;p&gt;The latest addition to my server at home is a Gitlab Community Edition instance. I use the docker image provided by Gitlab behind a nginx reverse proxy. Below are some notes for setting up, configuring and troubleshooting the installation.&lt;/p&gt;
&lt;h2&gt;Docker command&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="ch"&gt;#!/bin/bash&lt;/span&gt;

sudo docker run --detach &lt;span class="se"&gt;\&lt;/span&gt;
    --publish &lt;span class="m"&gt;11180&lt;/span&gt;:80 …&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;</summary><content type="html">&lt;p&gt;The latest addition to my server at home is a Gitlab Community Edition instance. I use the docker image provided by Gitlab behind a nginx reverse proxy. Below are some notes for setting up, configuring and troubleshooting the installation.&lt;/p&gt;
&lt;h2&gt;Docker command&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="ch"&gt;#!/bin/bash&lt;/span&gt;

sudo docker run --detach &lt;span class="se"&gt;\&lt;/span&gt;
    --publish &lt;span class="m"&gt;11180&lt;/span&gt;:80 --publish &lt;span class="m"&gt;11122&lt;/span&gt;:22 &lt;span class="se"&gt;\&lt;/span&gt;
    --name gitlab &lt;span class="se"&gt;\&lt;/span&gt;
    --restart always &lt;span class="se"&gt;\&lt;/span&gt;
    --volume /var/docker/volumes/gitlab/config:/etc/gitlab:Z &lt;span class="se"&gt;\&lt;/span&gt;
    --volume /var/docker/volumes/gitlab/logs:/var/log/gitlab:Z &lt;span class="se"&gt;\&lt;/span&gt;
    --volume /var/docker/volumes/gitlab/data:/var/opt/gitlab:Z &lt;span class="se"&gt;\&lt;/span&gt;
    gitlab/gitlab-ce:latest
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;See &lt;a href="https://github.com/flurischt/dockerfiles/blob/master/images/gitlab/run.sh"&gt;run.sh&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;Gitlab config&lt;/h2&gt;
&lt;p&gt;Open a shell in the docker container (&lt;code&gt;sudo docker exec -it gitlab /bin/bash&lt;/code&gt;) then edit &lt;code&gt;/etc/gitlab/gitlab.rb&lt;/code&gt;. The following subsections show the parts I changed or added. After changing the config &lt;code&gt;gitlab-ctl reconfigure&lt;/code&gt; can be run (still in the docker container) to restart gitlab.&lt;/p&gt;
&lt;h3&gt;external_url and relative root&lt;/h3&gt;
&lt;p&gt;The goal was to run Gitlab over SSL/TLS behind a reverse proxy. Instead of running Gitlab under / it should be accessible under /gitlab. This requires some extra effort:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;external_url &amp;#39;https://SOMEDOMAIN/gitlab&amp;#39; # default: http://hostname
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;(note httpS and /gitlab). Also setting RAILS_RELATIVE_URL_ROOT was necessary:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;gitlab_rails[&amp;#39;env&amp;#39;] = {
&amp;#39;RAILS_RELATIVE_URL_ROOT&amp;#39; =&amp;gt; &amp;quot;/gitlab&amp;quot;
}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;h3&gt;Email Configuration&lt;/h3&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;gitlab_rails[&amp;#39;smtp_enable&amp;#39;] = true
gitlab_rails[&amp;#39;smtp_address&amp;#39;] = &amp;quot;**.**.ch&amp;quot;
gitlab_rails[&amp;#39;smtp_port&amp;#39;] = 465
gitlab_rails[&amp;#39;smtp_authentication&amp;#39;] = &amp;quot;plain&amp;quot;
gitlab_rails[&amp;#39;smtp_enable_starttls_auto&amp;#39;] = true
gitlab_rails[&amp;#39;smtp_ssl&amp;#39;] = true
gitlab_rails[&amp;#39;smtp_tls&amp;#39;] = false
gitlab_rails[&amp;#39;smtp_openssl_verify_mode&amp;#39;] = &amp;#39;peer&amp;#39;
gitlab_rails[&amp;#39;smtp_user_name&amp;#39;] = &amp;quot;**@**.ch&amp;quot;
gitlab_rails[&amp;#39;smtp_password&amp;#39;] = **
gitlab_rails[&amp;#39;smtp_domain&amp;#39;] = **
gitlab_rails[&amp;#39;gitlab_email_from&amp;#39;] = &amp;#39;gitlab@**.ch&amp;#39;
gitlab_rails[&amp;#39;gitlab_email_reply_to&amp;#39;] = &amp;#39;noreply@**.ch&amp;#39;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;h3&gt;Settings for running behind a reverse proxy&lt;/h3&gt;
&lt;p&gt;SSL is terminated at the reverse proxy. The communication between nginx and Gitlab will be HTTP.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;nginx[&amp;#39;listen_port&amp;#39;] = 80
nginx[&amp;#39;listen_https&amp;#39;] = false
nginx[&amp;#39;proxy_set_headers&amp;#39;] = {
  &amp;quot;X-Forwarded-Proto&amp;quot; =&amp;gt; &amp;quot;https&amp;quot;,
  &amp;quot;X-Forwarded-Ssl&amp;quot; =&amp;gt; &amp;quot;on&amp;quot;
}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;h2&gt;NGINX Reverse proxy configuration&lt;/h2&gt;
&lt;p&gt;The following snippet proxies requests to /gitlab on nginx back to the locally running Gitlab container.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="nt"&gt;server&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;&lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="err"&gt;.....&lt;/span&gt;&lt;span class="w"&gt;&lt;/span&gt;

&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="err"&gt;location&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;^~&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;/gitlab/&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;{&lt;/span&gt;&lt;span class="w"&gt;&lt;/span&gt;
&lt;span class="w"&gt;      &lt;/span&gt;&lt;span class="err"&gt;client_max_body_size&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="w"&gt;&lt;/span&gt;
&lt;span class="w"&gt;      &lt;/span&gt;&lt;span class="err"&gt;gzip&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;off&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="w"&gt;&lt;/span&gt;
&lt;span class="w"&gt;      &lt;/span&gt;&lt;span class="err"&gt;##&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;https&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="o"&gt;//&lt;/span&gt;&lt;span class="n"&gt;github&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;com&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;gitlabhq&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;gitlabhq&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;issues&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="mi"&gt;694&lt;/span&gt;&lt;span class="w"&gt;&lt;/span&gt;
&lt;span class="w"&gt;      &lt;/span&gt;&lt;span class="err"&gt;##&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;Some&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;requests&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;take&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;more&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;than&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;30&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;seconds&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="w"&gt;&lt;/span&gt;
&lt;span class="w"&gt;      &lt;/span&gt;&lt;span class="n"&gt;proxy_read_timeout&lt;/span&gt;&lt;span class="w"&gt;      &lt;/span&gt;&lt;span class="mi"&gt;300&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="w"&gt;&lt;/span&gt;
&lt;span class="w"&gt;      &lt;/span&gt;&lt;span class="err"&gt;proxy_connect_timeout&lt;/span&gt;&lt;span class="w"&gt;   &lt;/span&gt;&lt;span class="err"&gt;300&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="w"&gt;&lt;/span&gt;
&lt;span class="w"&gt;      &lt;/span&gt;&lt;span class="err"&gt;proxy_redirect&lt;/span&gt;&lt;span class="w"&gt;          &lt;/span&gt;&lt;span class="err"&gt;off&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="w"&gt;&lt;/span&gt;
&lt;span class="w"&gt;      &lt;/span&gt;&lt;span class="err"&gt;proxy_http_version&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;1.1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="w"&gt;&lt;/span&gt;
&lt;span class="w"&gt;      &lt;/span&gt;&lt;span class="err"&gt;proxy_set_header&lt;/span&gt;&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="err"&gt;Host&lt;/span&gt;&lt;span class="w"&gt;                &lt;/span&gt;&lt;span class="err"&gt;$http_host&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="w"&gt;&lt;/span&gt;
&lt;span class="w"&gt;      &lt;/span&gt;&lt;span class="err"&gt;proxy_set_header&lt;/span&gt;&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="err"&gt;X-Real-IP&lt;/span&gt;&lt;span class="w"&gt;           &lt;/span&gt;&lt;span class="err"&gt;$remote_addr&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="w"&gt;&lt;/span&gt;
&lt;span class="w"&gt;      &lt;/span&gt;&lt;span class="err"&gt;proxy_set_header&lt;/span&gt;&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="err"&gt;X-Forwarded-Ssl&lt;/span&gt;&lt;span class="w"&gt;     &lt;/span&gt;&lt;span class="err"&gt;on&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="w"&gt;&lt;/span&gt;
&lt;span class="w"&gt;      &lt;/span&gt;&lt;span class="err"&gt;proxy_set_header&lt;/span&gt;&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="err"&gt;X-Forwarded-For&lt;/span&gt;&lt;span class="w"&gt;     &lt;/span&gt;&lt;span class="err"&gt;$proxy_add_x_forwarded_for&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="w"&gt;&lt;/span&gt;
&lt;span class="w"&gt;      &lt;/span&gt;&lt;span class="err"&gt;proxy_set_header&lt;/span&gt;&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="err"&gt;X-Forwarded-Proto&lt;/span&gt;&lt;span class="w"&gt;   &lt;/span&gt;&lt;span class="err"&gt;$scheme&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="w"&gt;&lt;/span&gt;
&lt;span class="w"&gt;      &lt;/span&gt;&lt;span class="err"&gt;proxy_pass&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;http&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="o"&gt;//&lt;/span&gt;&lt;span class="mf"&gt;127.0.0.1&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;&lt;span class="mi"&gt;11180&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="w"&gt;&lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;&lt;/span&gt;
&lt;span class="err"&gt;}&lt;/span&gt;&lt;span class="w"&gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;h2&gt;Assets not found&lt;/h2&gt;
&lt;p&gt;Since Gitlab is run under /gitlab it's possible that some fonts, icons and images cannot be found. Running the following commands inside the docker container should fix this:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;gitlab-ctl reconfigure
NO_PRIVILEGE_DROP=true USE_DB=false gitlab-rake assets:clean assets:precompile
gitlab-ctl restart
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;&lt;a href="https://gitlab.com/gitlab-org/gitlab-ce/issues/13727#note_3924229"&gt;Source&lt;/a&gt;&lt;/p&gt;</content><category term="tech"></category><category term="nginx"></category><category term="gitlab"></category><category term="docker"></category></entry><entry><title>Ugly fonts in IntelliJ IDEA on Arch Linux</title><link href="https://flurischt.ch/ugly-fonts-in-intellij-idea-on-arch-linux.html" rel="alternate"></link><published>2016-10-11T00:00:00+02:00</published><updated>2016-10-11T00:00:00+02:00</updated><author><name>flurin</name></author><id>tag:flurischt.ch,2016-10-11:/ugly-fonts-in-intellij-idea-on-arch-linux.html</id><summary type="html">&lt;h1&gt;UPDATE&lt;/h1&gt;
&lt;p&gt;&lt;code&gt;intellij-jdk&lt;/code&gt; is now marked orphaned in AUR. I therefore stopped using this package and switched to a manual install of IntelliJ IDEA. This way the bundled jdk by Jetbrains is used automatically.&lt;/p&gt;
&lt;h1&gt;Old Post&lt;/h1&gt;
&lt;p&gt;Java fonts on Linux have been ugly for a while. Especially in an IDE it's …&lt;/p&gt;</summary><content type="html">&lt;h1&gt;UPDATE&lt;/h1&gt;
&lt;p&gt;&lt;code&gt;intellij-jdk&lt;/code&gt; is now marked orphaned in AUR. I therefore stopped using this package and switched to a manual install of IntelliJ IDEA. This way the bundled jdk by Jetbrains is used automatically.&lt;/p&gt;
&lt;h1&gt;Old Post&lt;/h1&gt;
&lt;p&gt;Java fonts on Linux have been ugly for a while. Especially in an IDE it's very annoying. It seems Jetbrains started to ship a patched JDK with IntelliJ 2016. Make sure to use this JDK on Arch to run IntelliJ!&lt;/p&gt;
&lt;h2&gt;Install&lt;/h2&gt;
&lt;p&gt;Install &lt;code&gt;intellij-jdk&lt;/code&gt; from AUR.&lt;/p&gt;
&lt;h2&gt;Configuration&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Start IntelliJ&lt;/li&gt;
&lt;li&gt;&lt;code&gt;CTRL+SHIFT+A&lt;/code&gt; to enter action&lt;/li&gt;
&lt;li&gt;enter "switch JDK"&lt;/li&gt;
&lt;li&gt;chose "Switch IDE boot JDK"&lt;/li&gt;
&lt;li&gt;point IntelliJ to /opt/intellij-jdk and restart&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Notes&lt;/h2&gt;
&lt;p&gt;I only use this JDK for running the IDE. For development I'm still using the opendjk packages provided by Arch.
Besides installing this new JDK I also force my java application to use anti-aliasing. To do so add the following to &lt;code&gt;/etc/environment&lt;/code&gt;:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;_JAVA_OPTIONS=&amp;#39;-Dawt.useSystemAAFontSettings=on&amp;#39;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;</content><category term="tech"></category><category term="intellij"></category><category term="arch"></category></entry><entry><title>Atom editor notes</title><link href="https://flurischt.ch/atom-editor-notes.html" rel="alternate"></link><published>2016-08-11T00:00:00+02:00</published><updated>2016-08-11T00:00:00+02:00</updated><author><name>flurin</name></author><id>tag:flurischt.ch,2016-08-11:/atom-editor-notes.html</id><summary type="html">&lt;p&gt;Some notes on my atom editor setup. Will be expanded throughout time.&lt;/p&gt;
&lt;h2&gt;Plugins&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;apm install atom-runner
apm install linter
apm install linter-flake8
apm install linter-gcc
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;h3&gt;flake8&lt;/h3&gt;
&lt;p&gt;linter-flake8 needs a flake8 binary. We'll install this into a virtualenv used for atom.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="nv"&gt;mkvirtualenv&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;atom&lt;/span&gt;&lt;span class="w"&gt;&lt;/span&gt;
#&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;make&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;sure&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;you&lt;/span&gt;&lt;span class="err"&gt;&amp;#39;re in the new virtualenv …&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;</summary><content type="html">&lt;p&gt;Some notes on my atom editor setup. Will be expanded throughout time.&lt;/p&gt;
&lt;h2&gt;Plugins&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;apm install atom-runner
apm install linter
apm install linter-flake8
apm install linter-gcc
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;h3&gt;flake8&lt;/h3&gt;
&lt;p&gt;linter-flake8 needs a flake8 binary. We'll install this into a virtualenv used for atom.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="nv"&gt;mkvirtualenv&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;atom&lt;/span&gt;&lt;span class="w"&gt;&lt;/span&gt;
#&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;make&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;sure&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;you&lt;/span&gt;&lt;span class="err"&gt;&amp;#39;re in the new virtualenv. then run:&lt;/span&gt;
&lt;span class="err"&gt;pip install flake8&lt;/span&gt;
&lt;span class="err"&gt;pip install flake8-docstrings&lt;/span&gt;&lt;span class="w"&gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;h4&gt;Modify Atom's env.PATH&lt;/h4&gt;
&lt;p&gt;Open Atom and go to Edit -&amp;gt; Init Script...
Add the following line and make sure '/home/USERNAME/.virtualenvs/atom/bin' points to your atom virtualenv directory:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="k"&gt;proc&lt;/span&gt;&lt;span class="nv"&gt;ess.env.PATH&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s"&gt;&amp;#39;/home/USERNAME/.virtualenvs/atom/bin&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;process.env.PATH&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="nv"&gt;.join&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#39;:&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="w"&gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;h2&gt;Settings&lt;/h2&gt;
&lt;p&gt;Go to Editor -&amp;gt; Preferences
 * enable Soft Tabs
 * set tab length to 4 spaces&lt;/p&gt;
&lt;h2&gt;Shortcuts&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;ALT+r run file using atom-runner&lt;/li&gt;
&lt;li&gt;CTR+SHIFT+m show rendered markdown&lt;/li&gt;
&lt;/ul&gt;</content><category term="tech"></category><category term="editor"></category><category term="atom"></category><category term="python"></category></entry><entry><title>Encrypted Ubuntu 14.04 LTS Installation (RAID, LLVM, LUKS)</title><link href="https://flurischt.ch/encrypted-ubuntu-1404-lts-installation-raid-llvm-luks.html" rel="alternate"></link><published>2016-04-07T00:00:00+02:00</published><updated>2016-04-07T00:00:00+02:00</updated><author><name>flurin</name></author><id>tag:flurischt.ch,2016-04-07:/encrypted-ubuntu-1404-lts-installation-raid-llvm-luks.html</id><summary type="html">&lt;p&gt;Google drive notes I took when setting up my encrypted Ubuntu 14.04 LTS home server (RAID, LLVM and LUKS).&lt;/p&gt;</summary><content type="html">&lt;p&gt;I meant to document the setup procedure of my home server for a long time here. Since I never got to write up an article (and probably neverl will) I'll just share my google drive notes here. Maybe you'll find something useful below or on the &lt;a href="https://docs.google.com/document/d/1iEebM2Lv5HhjN1UnvFjmotx62WXp-a1QIsTYjaHxE50/pub"&gt;direct link&lt;/a&gt;.&lt;/p&gt;
&lt;iframe width="100%" height="100%" src="https://docs.google.com/document/d/1iEebM2Lv5HhjN1UnvFjmotx62WXp-a1QIsTYjaHxE50/pub?embedded=true"&gt;&lt;/iframe&gt;</content><category term="tech"></category><category term="linux"></category><category term="ubuntu"></category></entry><entry><title>Guided Static Analysis slides</title><link href="https://flurischt.ch/guided-static-analysis-slides.html" rel="alternate"></link><published>2015-10-22T00:00:00+02:00</published><updated>2015-10-22T00:00:00+02:00</updated><author><name>flurin</name></author><id>tag:flurischt.ch,2015-10-22:/guided-static-analysis-slides.html</id><summary type="html">&lt;p&gt;Checkout the slides of my presentation about the Guided Static Analysis paper by Denis Gopan and Thomas Reps.&lt;/p&gt;</summary><content type="html">&lt;p&gt;It took so much effort to create these slides so why keep them private? Here's my &lt;a href="http://www.pm.inf.ethz.ch/education/seminars/ResearchTopicsinSoftwareEngineering.html"&gt;Research Topics in Software Engineering&lt;/a&gt; Talk about Guided Static Analysis by Denis Gopan and Thomas Reps: &lt;/p&gt;
&lt;script async class="speakerdeck-embed" data-id="8fa7e00696554a6abcfad890867b0c17" data-ratio="1.77777777777778" src="//speakerdeck.com/assets/embed.js"&gt;&lt;/script&gt;

&lt;p&gt;The paper is available &lt;a href="http://research.cs.wisc.edu/wpis/abstracts/sas07.guided.abs.html"&gt;here&lt;/a&gt;.&lt;/p&gt;</content><category term="tech"></category><category term="static analysis"></category><category term="ethz"></category><category term="seminar"></category><category term="talk"></category></entry><entry><title>Downloading a website for reading offline</title><link href="https://flurischt.ch/downloading-a-website-for-reading-offline.html" rel="alternate"></link><published>2015-07-28T00:00:00+02:00</published><updated>2015-07-28T00:00:00+02:00</updated><author><name>flurin</name></author><id>tag:flurischt.ch,2015-07-28:/downloading-a-website-for-reading-offline.html</id><content type="html">&lt;p&gt;I needed a way to download all papers and exercises of one of my lectures. Here's a good wget snippet to mirror the website:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;wget --mirror --convert-links --adjust-extension --page-requisites -np -nH -N --cut-dirs&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="m"&gt;1&lt;/span&gt; http://www.ita.inf.ethz.ch/alscpr15/
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Source: Tweet by &lt;a href="https://twitter.com/doublec/status/625421321443262464"&gt;@doublec&lt;/a&gt; (tweets are protected now)&lt;/p&gt;</content><category term="tech"></category><category term="linux"></category><category term="wget"></category><category term="university"></category></entry><entry><title>Prevent Firefox from reloading pinned tabs at startup</title><link href="https://flurischt.ch/prevent-firefox-from-reloading-pinned-tabs-at-startup.html" rel="alternate"></link><published>2015-07-08T00:00:00+02:00</published><updated>2015-07-08T00:00:00+02:00</updated><author><name>flurin</name></author><id>tag:flurischt.ch,2015-07-08:/prevent-firefox-from-reloading-pinned-tabs-at-startup.html</id><content type="html">&lt;p&gt;Firefox has a setting "&lt;strong&gt;Don't load tabs until selected&lt;/strong&gt;". But enabling this will not prevent Firefox from reloading every pinned tab at startup. Fortunately there seems to be a specific preference for this one too:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;open about:config&lt;/li&gt;
&lt;li&gt;set &lt;strong&gt;browser.sessionstore.restore_pinned_tabs_on_demand&lt;/strong&gt; to &lt;strong&gt;true&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;</content><category term="tech"></category><category term="firefox"></category></entry><entry><title>Arch Linux on Toshiba CB30-102 (Chromebook)</title><link href="https://flurischt.ch/arch-linux-on-toshiba-cb30-102-chromebook.html" rel="alternate"></link><published>2015-06-21T00:00:00+02:00</published><updated>2015-06-21T00:00:00+02:00</updated><author><name>flurin</name></author><id>tag:flurischt.ch,2015-06-21:/arch-linux-on-toshiba-cb30-102-chromebook.html</id><summary type="html">&lt;p&gt;The &lt;a href="https://wiki.archlinux.org/index.php/Beginners%27_guide"&gt;Beginners guide&lt;/a&gt; in the wiki is straightforward. Here are just some additional notes on setting up Arch Linux on my chromebook.&lt;/p&gt;
&lt;h2&gt;Planned setup&lt;/h2&gt;
&lt;p&gt;My device has a 16GB ssd. I'm planning to wipe ChromeOS and partition the disk into two partitions: 2GB /boot (ext4) and a 14GB encrypted partition …&lt;/p&gt;</summary><content type="html">&lt;p&gt;The &lt;a href="https://wiki.archlinux.org/index.php/Beginners%27_guide"&gt;Beginners guide&lt;/a&gt; in the wiki is straightforward. Here are just some additional notes on setting up Arch Linux on my chromebook.&lt;/p&gt;
&lt;h2&gt;Planned setup&lt;/h2&gt;
&lt;p&gt;My device has a 16GB ssd. I'm planning to wipe ChromeOS and partition the disk into two partitions: 2GB /boot (ext4) and a 14GB encrypted partition (dm-crypt + LUKS). A 2GB swapfile will be created inside the encrypted partition.&lt;/p&gt;
&lt;h2&gt;Preparations&lt;/h2&gt;
&lt;p&gt;Check the Arch wiki for chrome device specific preparations. My device has an alternative boot loader so I just need to press &lt;code&gt;CTR+L&lt;/code&gt; at the splash screen to boot from usb-stick or (later) GRUB.&lt;/p&gt;
&lt;h2&gt;Installation steps&lt;/h2&gt;
&lt;p&gt;Follow the beginners guide. After creating the two partitions and making the /boot partition bootable, proceed to setup the encrypted partions. &lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="c1"&gt;# assuming /dev/sda2 is the 14GB partition that will be encrypted&lt;/span&gt;
cryptsetup -v --cipher twofish-xts-plain64 --key-size &lt;span class="m"&gt;512&lt;/span&gt; --hash sha512 --iter-time &lt;span class="m"&gt;5000&lt;/span&gt; --use-random --verify-passphrase luksFormat /dev/sda2
&lt;span class="c1"&gt;# now open the LUKS partition&lt;/span&gt;
cryptsetup open --type luks /dev/sda2 root
&lt;span class="c1"&gt;# the decrypted partition is now available at /dev/mapper/root&lt;/span&gt;
mkfs.ext4 /dev/mapper/root
mount /dev/mapper/root /mnt
&lt;span class="c1"&gt;# proceed with installation according to the beginners guide&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Check &lt;a href="https://wiki.archlinux.org/index.php/Dm-crypt/Device_encryption"&gt;Device_encryption&lt;/a&gt; for encryptions settings etc.&lt;/p&gt;
&lt;h3&gt;Before the first reboot&lt;/h3&gt;
&lt;p&gt;Assuming GRUB is used as a boot loader we'll need to make sure that it finds the root device and that the initramfs contains everything necessary to decrypt the partition.&lt;/p&gt;
&lt;p&gt;Edit &lt;strong&gt;/etc/default/grub&lt;/strong&gt; and configure cryptdevice in GRUB_CMDLINE_LINUX_DEFAULT:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;GRUB_CMDLINE_LINUX_DEFAULT=&amp;quot;quiet cryptdevice=UUID=6364123f-3052-4745-bb79-ee60416b4309:root:allow-discards&amp;quot;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;The UUID should in my case point to /dev/sda2. :root: will make the decrypted partition available at /dev/mapper/root and allow-discards is needed to make the discard mount-option work through disk-encryption. Note: allow-discards may be a security risk. I'm using it anyway. After configuring update the grub configuration with &lt;code&gt;grub-mkconfig -o /boot/grub/grub.cfg&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;At last make sure to add &lt;strong&gt;encrypt&lt;/strong&gt; to &lt;strong&gt;/etc/mkinitcpio.conf&lt;/strong&gt; before the filesystems hook:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;HOOKS=&amp;quot;base udev autodetect modconf block encrypt filesystems keyboard fsck&amp;quot;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;and update the initramfs:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;mkinitcpio -k &lt;span class="m"&gt;4&lt;/span&gt;.0.5-1-ARCH  -g /boot/initramfs-linux.img
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;(the -k 4.0.5-1-ARCH argument was only needed in my case, because the installed kernel was newer than the one running on the usb-stick. Try it without -k and if it doesn't work, check /lib/modules/ for the correct kernel-version)
You're now ready to exit chroot and reboot (do not forget to install all necessary modules and firmware for the network to work... check the wiki!).&lt;/p&gt;
&lt;h2&gt;Configuration&lt;/h2&gt;
&lt;p&gt;After the first reboot we should now have a working arch installation. I set up x11, gdm and cinnamon following the wiki instructions. GDM can be enabled at boot with &lt;code&gt;systemctl enable gdm.service&lt;/code&gt; &lt;/p&gt;
&lt;h3&gt;ChromeOS Buttons&lt;/h3&gt;
&lt;p&gt;I used sxhkd to make the ChromeOS Buttons work. &lt;/p&gt;
&lt;p&gt;~/.config/sxhkd/sxhkdrc&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;# Web browser Back/Forward shortcuts
{@F1,@F2}
  xte &amp;#39;keydown Alt_L&amp;#39; &amp;#39;key {Left,Right}&amp;#39; &amp;#39;keyup Alt_L&amp;#39;

# Web browser Refresh shortcut
@F3
  xte &amp;#39;keydown Control_L&amp;#39; &amp;#39;key r&amp;#39; &amp;#39;keyup Control_L&amp;#39;

# Awesome WM maximize current window
# Adjust as necessary for different window managers
#@F4
#  xte &amp;#39;keydown Super_L&amp;#39; &amp;#39;key m&amp;#39; &amp;#39;keyup Super_L&amp;#39;

# Awesome WM move one desktop right
@F5
  xte &amp;#39;keydown Super_L&amp;#39; &amp;#39;key Right&amp;#39; &amp;#39;keyup Super_L&amp;#39;

{F6,F7}
  xbacklight -{dec,inc} 10

F8
  amixer set Master toggle

{F9,F10}
  amixer set Master 5%{-,+} unmute
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Then add /usr/bin/sxhkd to the autostart of your desktop env. For cinnamon I used gnome-session-properties (installable from AUR). You'll need alsa-utils, xorg-backlight, xautomation for the config above to work. The config above is a modified version from the wiki (% for F9, F10). Check &lt;a href="https://wiki.archlinux.org/index.php/Chrome_OS_devices#Sxhkd_configuration"&gt;Chrome_OS_devices#Sxhkd_configuration&lt;/a&gt;. &lt;/p&gt;
&lt;h3&gt;Swapfile&lt;/h3&gt;
&lt;p&gt;I use a swapfile inside the encrypted partition. Create a 2GB swapfile with:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;dd &lt;span class="k"&gt;if&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;/dev/zero &lt;span class="nv"&gt;of&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;/swapfile &lt;span class="nv"&gt;bs&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;1M &lt;span class="nv"&gt;count&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="m"&gt;2000&lt;/span&gt;
chmod &lt;span class="m"&gt;600&lt;/span&gt; /swapfile
mkswap /swapfile
swapon /swapfile
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;and enable it in /etc/fstab:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;cat &amp;gt;&amp;gt; /etc/fstab
/swapfile   swap    swap    defaults    &lt;span class="m"&gt;0&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt;

CTRL+D
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;h3&gt;Hibernation&lt;/h3&gt;
&lt;p&gt;For hibernate to work, the resume= and resume_offset= (only when a swapfile is used) kernel params must be set and the resume hook in initramfs must be enabled. &lt;/p&gt;
&lt;p&gt;add &lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;resume=/dev/mapper/root resume_offset=OFFSET_NO
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;to &lt;strong&gt;GRUB_CMDLINE_LINUX_DEFAULT&lt;/strong&gt; in /etc/default/grub and update the grub config. OFFSET_NO is the first row of physical_offset in &lt;code&gt;filefrag -v /swapfile&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Then add &lt;strong&gt;resume&lt;/strong&gt; to HOOKS in /etc/mkinitcpio.conf &lt;strong&gt;after&lt;/strong&gt; the encrypt hook (otherwise it would try to resume before decrypting the partition) and update initramfs with &lt;code&gt;mkinitcpio -p linux&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Hibernation should now work with &lt;code&gt;systemctl hibernate&lt;/code&gt;.&lt;/p&gt;
&lt;h3&gt;AUR packages&lt;/h3&gt;
&lt;p&gt;Checkout &lt;a href="https://wiki.archlinux.org/index.php/Yaourt"&gt;yaourt&lt;/a&gt;. Quite useful for installing AUR packages.&lt;/p&gt;</content><category term="tech"></category><category term="arch"></category><category term="chromebook"></category><category term="linux"></category></entry><entry><title>OS X: Reinstall OS stuck at "2 minutes left"</title><link href="https://flurischt.ch/os-x-reinstall-os-stuck-at-2-minutes-left.html" rel="alternate"></link><published>2015-03-21T00:00:00+01:00</published><updated>2015-03-21T00:00:00+01:00</updated><author><name>flurin</name></author><id>tag:flurischt.ch,2015-03-21:/os-x-reinstall-os-stuck-at-2-minutes-left.html</id><summary type="html">&lt;p&gt;You probably have used homebrew. Haven't you? 
In the last step of the reinstallation the installer moves / checks files in /usr/local. If you have a lot of files over there (for example because you used homebrew), this takes forever.&lt;/p&gt;
&lt;p&gt;Do not abort the installation. Press &lt;code&gt;cmd+L&lt;/code&gt; to see …&lt;/p&gt;</summary><content type="html">&lt;p&gt;You probably have used homebrew. Haven't you? 
In the last step of the reinstallation the installer moves / checks files in /usr/local. If you have a lot of files over there (for example because you used homebrew), this takes forever.&lt;/p&gt;
&lt;p&gt;Do not abort the installation. Press &lt;code&gt;cmd+L&lt;/code&gt; to see the logs.&lt;/p&gt;</content><category term="tech"></category><category term="osx"></category></entry><entry><title>Using git for SVN repos</title><link href="https://flurischt.ch/using-git-for-svn-repos.html" rel="alternate"></link><published>2015-03-21T00:00:00+01:00</published><updated>2015-03-21T00:00:00+01:00</updated><author><name>flurin</name></author><id>tag:flurischt.ch,2015-03-21:/using-git-for-svn-repos.html</id><summary type="html">&lt;p&gt;We're forced to use SVN for some projects at the university. It's OK but when working on the go (Train) and offline it's a pain. Here are the steps for using git.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;# initialize repo
git svn clone https://svn-server-address/repo/path
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Now you can work and commit to your local …&lt;/p&gt;</summary><content type="html">&lt;p&gt;We're forced to use SVN for some projects at the university. It's OK but when working on the go (Train) and offline it's a pain. Here are the steps for using git.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;# initialize repo
git svn clone https://svn-server-address/repo/path
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Now you can work and commit to your local git branches.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="nv"&gt;git&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;checkout&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nv"&gt;b&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;myFeature&lt;/span&gt;&lt;span class="w"&gt;&lt;/span&gt;
#&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;do&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;some&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;stuff&lt;/span&gt;&lt;span class="w"&gt;&lt;/span&gt;
&lt;span class="nv"&gt;git&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;commit&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nv"&gt;m&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;whatever&amp;quot;&lt;/span&gt;&lt;span class="w"&gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;To publish my new feature to svn I use the following steps:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;# fetch the latest svn updates to my master branch
git checkout master
git svn rebase

# rebase my new feature to master
git checkout myFeature 
git rebase master

# merge my feature and force git to always make a merge commit
git checkout master
git merge myFeature --no-ff

# commit changes to svn
git svn dcommit
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Yes, its dcommit and not commit.&lt;/p&gt;</content><category term="tech"></category><category term="git"></category><category term="svn"></category></entry><entry><title>x86 assembly on OSX</title><link href="https://flurischt.ch/x86-assembly-on-osx.html" rel="alternate"></link><published>2015-03-21T00:00:00+01:00</published><updated>2015-03-21T00:00:00+01:00</updated><author><name>flurin</name></author><id>tag:flurischt.ch,2015-03-21:/x86-assembly-on-osx.html</id><summary type="html">&lt;p&gt;During last terms compiler design course I learned x86 assembly "the hard way"... Here's some stuff that I "found out" while developing x86 assembly on OSX 10.10.&lt;/p&gt;
&lt;h2&gt;Read this first&lt;/h2&gt;
&lt;p&gt;I'm writing this post a couple of months after the course. I did not lookup the instructions and I'm …&lt;/p&gt;</summary><content type="html">&lt;p&gt;During last terms compiler design course I learned x86 assembly "the hard way"... Here's some stuff that I "found out" while developing x86 assembly on OSX 10.10.&lt;/p&gt;
&lt;h2&gt;Read this first&lt;/h2&gt;
&lt;p&gt;I'm writing this post a couple of months after the course. I did not lookup the instructions and I'm justing writing what I can remember. It's therefore possible that some instructions below are incorrect. Better look them up yourself instead of copying from here...&lt;/p&gt;
&lt;h2&gt;Tools&lt;/h2&gt;
&lt;p&gt;I used gcc (compiler/assembler) and gdb (debugger). Place your assembly code in a .s file and assemble it with &lt;code&gt;gcc -m32 -ggdb yoursourcefile.s -o programname&lt;/code&gt;. gcc is useful to have a look at generated assembly code too. Just write a c programm and then compile it with the -S flag to generate assembly output. &lt;/p&gt;
&lt;h2&gt;Stack alignment on OSX&lt;/h2&gt;
&lt;p&gt;There's this sentence &lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;The stack is 16-byte aligned at the point of function calls&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;in the &lt;a href="https://developer.apple.com/library/mac/documentation/DeveloperTools/Conceptual/LowLevelABI/130-IA-32_Function_Calling_Conventions/IA32.html"&gt;IA-32 Function Calling Conventions&lt;/a&gt; that gave us in the beginning so much pain. What does it mean? Before calling anything make sure that the stack is aligned to 16 bytes. The annoying thing is, that &lt;strong&gt;inside each function there are already four bytes on the stack (the return-address)&lt;/strong&gt;. After the normal function prologue (enter / push %ebp) there will be 8 bytes on the stack. &lt;/p&gt;
&lt;p&gt;Example&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;.globl _main

_main:
    enter $8, $0                     
    # stack is now 16 byte aligned. 
    # 4 + 4 + 8
    # return-address + old %ebp value + 8 bytes because of &amp;quot;enter $8..&amp;quot;

    leave ret
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;So, make sure to always increase the stack size by a multiple of 16. The hard part was, that the alignment is only enforced when using systemcalls. In the beginning our programs jumped around a couple of times with a misaligned stack without any problems and then just blew up when printing or reading something. Quite hard to debug but very educational... (learn the hard way indeed).&lt;/p&gt;
&lt;h2&gt;Some tricks&lt;/h2&gt;
&lt;p&gt;Below are just some tricks I learned. If you've programmed assembly before you'll be bored.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;; inside your assembly func you should backup the ebp
; either do
push %ebp 
movl %esp, %ebp

; or use the enter instruction:
enter $0, $0

; after the steps above there will be 8 bytes on the stack.
; align it with
subl $8, %esp
; or use enter $8,$0 

; because we set %ebp as the first step, we can now use it to 
; address stuff in our stack frame. 
; some examples:
movl $4, (%ebp)    ; write 4 into the stack address where %ebp points to 
movl $5, -4(%ebp)  ; write 5 into the address four bytes below
movl 8(%ebp), -8(%ebp) ; move the value of a parameter (higher stack address) into a local variable (lower stack address)

; to create local variables, just make space by reducing the esp
subl $4, %esp     ; create a 4 byte &amp;quot;variable&amp;quot; on the stack 
movl $42, 4(%esp) ; write something to this variable
addl $4, %esp     ; free/forget the variable

; instead of subl %esp you can also: 
pushl $42         ; decrease %esp by 4
popl %eax         ; read the previously pushed $42 to %eax and increase the stack pointer again

; set eax to zero (eax is used as the return value when exiting the program)
xor %eax, %eax

; no example but a tipp: checkout the leal instruction! it is useful for example when using scanf and writing to the stack

; there are instructions for leaving your function
leave
ret
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;</content><category term="tech"></category><category term="osx"></category><category term="code"></category><category term="assembly"></category></entry><entry><title>Run IntelliJ IDEA 14 on OSX with Java 8</title><link href="https://flurischt.ch/run-intellij-idea-14-on-osx-with-java-8.html" rel="alternate"></link><published>2015-02-21T00:00:00+01:00</published><updated>2015-02-21T00:00:00+01:00</updated><author><name>flurin</name></author><id>tag:flurischt.ch,2015-02-21:/run-intellij-idea-14-on-osx-with-java-8.html</id><summary type="html">&lt;p&gt;Starting with Yosemite Apple finally stopped shipping Java 6 with OSX. It's recommended to install the latest Java version directly from Oracle. Unfortunately IntelliJ IDEA needs Java 6 (!) to start. Here is the recommended way to run IntelliJ IDEA with Java 8.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;# first, install IntelliJ to /Applications
mkdir ~/Library/Preferences …&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;</summary><content type="html">&lt;p&gt;Starting with Yosemite Apple finally stopped shipping Java 6 with OSX. It's recommended to install the latest Java version directly from Oracle. Unfortunately IntelliJ IDEA needs Java 6 (!) to start. Here is the recommended way to run IntelliJ IDEA with Java 8.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;# first, install IntelliJ to /Applications
mkdir ~/Library/Preferences/IntelliJIdea14/
cp /Applications/IntelliJ\ IDEA\ 14.app/Contents/bin/idea.properties ~/Library/Preferences/IntelliJIdea14/
# now modify ~/Library/Preferences/IntelliJIdea14/idea.properties and change the JVMVersion from 1.6* to 1.6+
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;The steps for WebStorm and PyCharm are similar and you can find the directory names &lt;a href="https://intellij-support.jetbrains.com/entries/23358108"&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;In my case the directories were:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;~/Library/Preferences/WebStorm9&lt;/li&gt;
&lt;li&gt;~/Library/Preferences/PyCharm40&lt;/li&gt;
&lt;/ul&gt;</content><category term="tech"></category><category term="osx"></category><category term="intellij"></category><category term="java"></category></entry><entry><title>Move/Copy mails between different IMAP accounts</title><link href="https://flurischt.ch/movecopy-mails-between-different-imap-accounts.html" rel="alternate"></link><published>2014-11-15T00:00:00+01:00</published><updated>2014-11-15T00:00:00+01:00</updated><author><name>flurin</name></author><id>tag:flurischt.ch,2014-11-15:/movecopy-mails-between-different-imap-accounts.html</id><summary type="html">&lt;p&gt;I decided to switch back to Gmail/Inbox by Gmail. Copying thousands of mails in Thunderbird is a pain and after a couple of unsuccessful tries I started to search a better working alternative. &lt;a href="http://superuser.com/a/771506"&gt;mutt to the rescue&lt;/a&gt;!&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="err"&gt;#&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;login&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;to&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;your&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;old&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;imap&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;account&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt;&lt;/span&gt;
&lt;span class="n"&gt;mutt&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;imaps&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="o"&gt;//&lt;/span&gt;&lt;span class="n"&gt;username&lt;/span&gt;&lt;span class="nv"&gt;@oldmailserver&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;INBOX …&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;</summary><content type="html">&lt;p&gt;I decided to switch back to Gmail/Inbox by Gmail. Copying thousands of mails in Thunderbird is a pain and after a couple of unsuccessful tries I started to search a better working alternative. &lt;a href="http://superuser.com/a/771506"&gt;mutt to the rescue&lt;/a&gt;!&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="err"&gt;#&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;login&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;to&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;your&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;old&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;imap&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;account&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt;&lt;/span&gt;
&lt;span class="n"&gt;mutt&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;imaps&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="o"&gt;//&lt;/span&gt;&lt;span class="n"&gt;username&lt;/span&gt;&lt;span class="nv"&gt;@oldmailserver&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;INBOX&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;folder&lt;/span&gt;&lt;span class="w"&gt;&lt;/span&gt;
&lt;span class="err"&gt;#&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;mark&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="ow"&gt;all&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;messages&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="ow"&gt;in&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;that&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;folder&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;otherwise&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;use&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="ss"&gt;&amp;quot;t&amp;quot;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;to&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;select&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;single&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;messages&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="w"&gt;&lt;/span&gt;
&lt;span class="n"&gt;enter&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="ss"&gt;&amp;quot;T&amp;quot;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="ow"&gt;and&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;then&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="ss"&gt;&amp;quot;~A&amp;quot;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;
&lt;span class="err"&gt;#&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;either&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;copy&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;(;&lt;/span&gt;&lt;span class="n"&gt;C&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="ow"&gt;or&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;move&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;(;&lt;/span&gt;&lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;the&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;messages&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;will&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;mark&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;them&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;as&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;deleted&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;on&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;the&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;old&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;account&lt;/span&gt;&lt;span class="err"&gt;!&lt;/span&gt;&lt;span class="w"&gt;&lt;/span&gt;
&lt;span class="n"&gt;enter&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="ss"&gt;&amp;quot;;C&amp;quot;&lt;/span&gt;&lt;span class="w"&gt;&lt;/span&gt;
&lt;span class="err"&gt;#&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;as&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;target&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;directory&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nf"&gt;choose&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;your&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;gmail&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;account&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt;&lt;/span&gt;
&lt;span class="nl"&gt;imaps&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="o"&gt;//&lt;/span&gt;&lt;span class="n"&gt;gmailusername&lt;/span&gt;&lt;span class="nv"&gt;@imap&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;googlemail&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;com&lt;/span&gt;&lt;span class="o"&gt;/[&lt;/span&gt;&lt;span class="n"&gt;Gmail&lt;/span&gt;&lt;span class="o"&gt;]/&lt;/span&gt;&lt;span class="n"&gt;folder&lt;/span&gt;&lt;span class="w"&gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;You may want to start mutt in a "screen" session and then let it run for a while. On linux systems mutt should already be installed. On OSX you can find it in homebrew.&lt;/p&gt;</content><category term="tech"></category><category term="osx"></category><category term="linux"></category><category term="imap"></category><category term="gmail"></category></entry><entry><title>Manually installing Boost 1.55 on OSX</title><link href="https://flurischt.ch/manually-installing-boost-155-on-osx.html" rel="alternate"></link><published>2014-10-19T00:00:00+02:00</published><updated>2014-10-19T00:00:00+02:00</updated><author><name>flurin</name></author><id>tag:flurischt.ch,2014-10-19:/manually-installing-boost-155-on-osx.html</id><summary type="html">&lt;p&gt;Boost 1.56.0 which is currently installed by homebrew is broken. Just try to compile the following C++ program. It will fail.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="cp"&gt;#include&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="cpf"&gt;&amp;lt;boost/graph/adjacency_matrix.hpp&amp;gt;&lt;/span&gt;&lt;span class="cp"&gt;&lt;/span&gt;

&lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nf"&gt;main&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Here are the steps to manually install Boost 1.55:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Download Boost 1.55 &lt;a href="http://sourceforge.net/projects/boost/files/boost/1.55.0/"&gt;here&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Extract the source and &lt;code&gt;cd …&lt;/code&gt;&lt;/li&gt;&lt;/ul&gt;</summary><content type="html">&lt;p&gt;Boost 1.56.0 which is currently installed by homebrew is broken. Just try to compile the following C++ program. It will fail.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="cp"&gt;#include&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="cpf"&gt;&amp;lt;boost/graph/adjacency_matrix.hpp&amp;gt;&lt;/span&gt;&lt;span class="cp"&gt;&lt;/span&gt;

&lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nf"&gt;main&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Here are the steps to manually install Boost 1.55:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Download Boost 1.55 &lt;a href="http://sourceforge.net/projects/boost/files/boost/1.55.0/"&gt;here&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Extract the source and &lt;code&gt;cd&lt;/code&gt; into the directory&lt;/li&gt;
&lt;li&gt;Compile: &lt;code&gt;./bootstrap.sh &amp;amp;&amp;amp; ./b2&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Create a directory where Boost will be installed: &lt;code&gt;mkdir /usr/share/boost&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Install: &lt;code&gt;./b2 install --prefix=/usr/share/boost/&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Link the include files to /usr/local/include: &lt;code&gt;ln -s /usr/share/boost/include/boost /usr/local/include&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;You might need administrator privileges for the last three steps.&lt;/p&gt;</content><category term="tech"></category><category term="osx"></category><category term="homebrew"></category><category term="boost"></category><category term="c++"></category></entry><entry><title>Enable homebrew for non admin users</title><link href="https://flurischt.ch/enable-homebrew-for-non-admin-users.html" rel="alternate"></link><published>2014-10-18T00:00:00+02:00</published><updated>2014-10-18T00:00:00+02:00</updated><author><name>flurin</name></author><id>tag:flurischt.ch,2014-10-18:/enable-homebrew-for-non-admin-users.html</id><summary type="html">&lt;p&gt;Even on OSX you should not be working with an admin account. Here are the steps to make &lt;a href="http://brew.sh"&gt;homebrew&lt;/a&gt; usable for non admin users.&lt;/p&gt;
&lt;h2&gt;Assumptions&lt;/h2&gt;
&lt;p&gt;I assume brew has already been installed by an administrator and it's login is admin. Change admin below to the name of your admin account …&lt;/p&gt;</summary><content type="html">&lt;p&gt;Even on OSX you should not be working with an admin account. Here are the steps to make &lt;a href="http://brew.sh"&gt;homebrew&lt;/a&gt; usable for non admin users.&lt;/p&gt;
&lt;h2&gt;Assumptions&lt;/h2&gt;
&lt;p&gt;I assume brew has already been installed by an administrator and it's login is admin. Change admin below to the name of your admin account.&lt;/p&gt;
&lt;h2&gt;Steps&lt;/h2&gt;
&lt;p&gt;Under System Preferences create a new group "brew" and add your user to it. Then open the terminal and:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;su - admin
sudo chgrp -R brew /usr/local
sudo chgrp -R brew /Library/Caches/Homebrew
sudo chmod -R g+w /usr/local
sudo chmod -R g+w /Library/Caches/Homebrew

&lt;span class="c1"&gt;# and if you plan to use caskroom too:&lt;/span&gt;
sudo mkdir -p /opt/homebrew-cask/Caskroom
sudo chgrp -R brew /opt/homebrew-cask
sudo chmod -R g+w /opt/homebrew-cask
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;(this logs in as the admin user and allows the members of the "brew" group to write to /usr/local and the Caches directory)&lt;/p&gt;
&lt;p&gt;With your user account you can now run &lt;code&gt;brew doctor&lt;/code&gt; to check if everything is working as it should.&lt;/p&gt;
&lt;p&gt;Credits: Visit &lt;a href="http://blog.strug.de/2012/06/my-homebrew-multi-user-setup/"&gt;this&lt;/a&gt; for some more detailed instructions.&lt;/p&gt;</content><category term="tech"></category><category term="osx"></category><category term="homebrew"></category></entry><entry><title>OSX 10.10 (yosemite): configure: error: C compiler cannot create executables</title><link href="https://flurischt.ch/osx-1010-yosemite-configure-error-c-compiler-cannot-create-executables.html" rel="alternate"></link><published>2014-10-18T00:00:00+02:00</published><updated>2014-10-18T00:00:00+02:00</updated><author><name>flurin</name></author><id>tag:flurischt.ch,2014-10-18:/osx-1010-yosemite-configure-error-c-compiler-cannot-create-executables.html</id><summary type="html">&lt;p&gt;Problem:
brew fails with "configure: error: C compiler cannot create executables" &lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;==&amp;gt; Upgrading 1 outdated package, with result:
python3 3.4.2_1
==&amp;gt; Upgrading python3
==&amp;gt; Downloading https://www.python.org/ftp/python/3.4.2/Python-3.4.2.tar.xz
Already downloaded: /Library/Caches/Homebrew/python3-3.4.2.tar.xz
==&amp;gt; ./configure --prefix …&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;</summary><content type="html">&lt;p&gt;Problem:
brew fails with "configure: error: C compiler cannot create executables" &lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;==&amp;gt; Upgrading 1 outdated package, with result:
python3 3.4.2_1
==&amp;gt; Upgrading python3
==&amp;gt; Downloading https://www.python.org/ftp/python/3.4.2/Python-3.4.2.tar.xz
Already downloaded: /Library/Caches/Homebrew/python3-3.4.2.tar.xz
==&amp;gt; ./configure --prefix=/usr/local/Cellar/python3/3.4.2_1 --enable-ipv6 --datar
checking for gcc... clang
checking whether the C compiler works... no
configure: error: in /private/tmp/python3-av3R7L/Python-3.4.2:
configure: error: C compiler cannot create executables
See config.log for more details
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Solution:
Download and install Xcode 6.1 and the Command line tools (CLT) for OSX 10.10. With the release of Yosemite Xcode 6.1 should show up in the App Store sooner or later. Then a manual download will be unnecessary. &lt;/p&gt;</content><category term="tech"></category><category term="osx"></category><category term="homebrew"></category></entry><entry><title>Hello</title><link href="https://flurischt.ch/hello.html" rel="alternate"></link><published>2014-07-17T00:00:00+02:00</published><updated>2014-07-17T00:00:00+02:00</updated><author><name>flurin</name></author><id>tag:flurischt.ch,2014-07-17:/hello.html</id><summary type="html">&lt;p&gt;Welcome to the new website. I've created the new page mainly as an excuse for not learning during the current exam preparations... So you should not expect any updates soon. There'll hopefully be some updated stuff here after the exam session in august. Have a nice summer and come back …&lt;/p&gt;</summary><content type="html">&lt;p&gt;Welcome to the new website. I've created the new page mainly as an excuse for not learning during the current exam preparations... So you should not expect any updates soon. There'll hopefully be some updated stuff here after the exam session in august. Have a nice summer and come back later! ;-) &lt;/p&gt;</content><category term="misc"></category></entry></feed>