Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@simonbru
simonbru / webremote.py
Last active October 4, 2017 14:32
mpd-web-remote
#!/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
simonbru / redditbackup.sh
Last active July 7, 2016 14:47
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
simonbru / README.md
Created June 6, 2016 09:29 — forked from cdhowie/README.md
DNS proxy to fix Netflix stupidity

fix-netflix-dns

This is a DNS server that intentionally returns an empty result set for any AAAA query for netflix.com 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 netflix.com/proxy.

@simonbru
simonbru / dkms
Created February 23, 2016 09:19
ALPM (pacman) hook compiling dkms modules when necessary
#!/bin/bash
list_installed_kernels() {
for i in /usr/lib/modules/*/build/Kconfig; do
sed -rn 's#/usr/lib/modules/(.*)/build/Kconfig#\1#p' <<< "$i"
done
}
build_all_modules() {
while read kernel; do
@simonbru
simonbru / localepurge.hook
Created February 12, 2016 02:15
ALPM (pacman) hook for localepurge
[Trigger]
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/*
@simonbru
simonbru / log-extracts.txt
Created August 21, 2015 21:27
owncloud-config
## 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: domain.com, request: "HEAD /remote.php/webdav/ HTTP/1.1", upstream: "uwsgi://unix:/var/run/uwsgi/app/owncloud/socket:", host: "domain.com"
## nginx access logs ##
2001:xxxx::x
@simonbru
simonbru / Readme.txt
Last active January 6, 2024 13:05 — forked from endolith/Readme.txt
This is a Python script to extract GNOME/GTK's color scheme and apply it to Wine, so that the themes (approximately) match.
Instructions:
1. Set your Gnome theme as you would like it
2. Run with a command like "python wine_colors_from_gtk.py"
3. Restart any apps running in Wine. They should match the Gnome theme colors now.
Better description with screenshots here: http://www.endolith.com/wordpress/2008/08/03/wine-colors/
This is also stored on https://code.launchpad.net/~endolith/+junk/wine-color-scraper