Skip to content

Instantly share code, notes, and snippets.

Simon Brulhart simonbru

Block or report user

Report or block simonbru

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile

Keybase proof

I hereby claim:

  • I am simonbru on github.
  • I am simonbru ( on keybase.
  • I have a public key whose fingerprint is D671 15C4 621A 5826 0F3C 181B 4151 AA35 EEEE 1E46

To claim this, I am signing this object:

simonbru /
Created Jan 24, 2019
Set a different default browser for every workspace

Custom browser launcher


  • Install xdotool
  • Modify to use the right browser for the right workspace
  • Change the path to in launch-browser.desktop
  • Copy launch-browser.desktop into ~/.local/share/applications/
  • Set this script as the default browser: xdg-settings set default-web-browser launch-browser.desktop
simonbru /
Created Apr 26, 2018
Stream pickled python objects through TCP (unsafe)
#!/usr/bin/env python3
import pickle
import socket
import sys
def server():
serversocket = socket.socket(
socket.AF_INET, socket.SOCK_STREAM
simonbru /
Last active Mar 31, 2018
GNOME: Use alternative notification service

GNOME: Use alternative notification service

The GNOME-Shell process hosts its own notification service, which makes it a bit tricky to use a different one. The following hacks worked fine for GNOME 3.26.


Find and install a notification daemon that is able to steal the notification bus name from GNOME-Shell, and make it start with the session. I used the daemon from the notification-daemon package with the --replace parameter. I start the daemon from an infinite loop because it exits after a few minutes of inactivity. To use the same setup as mine, copy notification-daemon.desktop into ~/.config/autostart/.

If your notifications daemon only implements the org.freedesktop.Notifications D-BUS interface, you need to prevent GNOME-Shell to own the org.gtk.Notifications bus name.

simonbru /
Last active Oct 4, 2017
#!/usr/bin/env python3
import re
from subprocess import check_call, check_output
from bottle import get, post, run, redirect, request
def retrieve_volume():
output = check_output(['mpc', 'volume'])
simonbru /
Last active Jul 7, 2016
Script using curl and jq to backup reddit saved links/comments
#!/bin/bash -eu
# This script requires curl and jq>=1.5
export LC_ALL=C
curl='curl --user-agent RedditBackup -L'
fetch_saved() {
# Try to load credentials.conf if FEED_URL is not set
simonbru /
Created Jun 6, 2016 — forked from cdhowie/
DNS proxy to fix Netflix stupidity


This is a DNS server that intentionally returns an empty result set for any AAAA query for or any subdomain thereof. The intent is to force Netflix to use IPv4 in cases where Netflix has blocked IPv6 access -- specifically, for Hurricane Electric users who find Netflix giving them the error:

You seem to be using an unblocker or proxy. Please turn off any of these services and try again. For more help, visit

simonbru / dkms
Created Feb 23, 2016
ALPM (pacman) hook compiling dkms modules when necessary
View dkms
list_installed_kernels() {
for i in /usr/lib/modules/*/build/Kconfig; do
sed -rn 's#/usr/lib/modules/(.*)/build/Kconfig#\1#p' <<< "$i"
build_all_modules() {
while read kernel; do
simonbru / localepurge.hook
Created Feb 12, 2016
ALPM (pacman) hook for localepurge
View localepurge.hook
Operation = Install
Operation = Upgrade
Type = File
Target = usr/share/doc/kde/HTML/*
Target = usr/share/gnome/help/*
Target = usr/share/locale/*
Target = usr/share/man/*
Target = usr/share/omf/*
View log-extracts.txt
## uwsgi log ##
[pid: 22084|app: -1|req: -1/347] 2001:xxxx::x () {30 vars in 412 bytes} [Tue Aug 18 22:38:06 2015] GET /status.php => generated 95 bytes in 107 msecs (HTTP/1.1 200) 10 headers in 560 bytes (0 switches on core 0)
[pid: 22084|app: -1|req: -1/348] 2001:xxxx::x () {30 vars in 429 bytes} [Tue Aug 18 22:38:06 2015] HEAD /remote.php/webdav/ => generated 0 bytes in 155 msecs (HTTP/1.1 401) 11 headers in 626 bytes (0 switches on core 0)
[pid: 22084|app: -1|req: -1/349] 2001:xxxx::x () {32 vars in 477 bytes} [Tue Aug 18 22:38:21 2015] HEAD /remote.php/webdav/ => generated 0 bytes in 452 msecs (HTTP/1.1 500) 0 headers in 0 bytes (0 switches on core 0)
## nginx error logs ##
2015/08/18 22:38:22 [error] 10647#0: *178914 upstream prematurely closed connection while reading response header from upstream, client: 2001:xxxx::x, server:, request: "HEAD /remote.php/webdav/ HTTP/1.1", upstream: "uwsgi://unix:/var/run/uwsgi/app/owncloud/socket:", host: ""
## nginx access logs ##
You can’t perform that action at this time.