Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
ThingHandlerFactory

wdullaer

🏠
ThingHandlerFactory
View GitHub Profile
View keybase.md

Keybase proof

I hereby claim:

  • I am wdullaer on github.
  • I am wdullaer (https://keybase.io/wdullaer) on keybase.
  • I have a public key ASDhhLdKJQA77jQA0r6XHyUhDt7pMtq5WN9LGZGYji4QXQo

To claim this, I am signing this object:

@wdullaer
wdullaer / git-oneliners.sh
Last active Mar 21, 2021
Useful git scripts / onelines
View git-oneliners.sh
#!/bin/bash
# Checkout remote branch to new local branch
git checkout -b newbranch remotename/remotebranch
# Reset a file to a version from a few commits ago
# https://stackoverflow.com/questions/9751928/git-best-way-to-remove-all-changes-from-a-given-file-for-one-branch
BASE_REV=$(git merge-base old-branch current-branch)
git filter-branch --tree-filter "git checkout ${BASE_REV} -- path-to-restore" old-branch..current-branch
@wdullaer
wdullaer / bunyan-log.clj
Created Feb 5, 2018
A bunyan configuration for the Clojure Timbre logger
View bunyan-log.clj
(ns wdullaer.bunyan-log
(:require [clojure.data.json :as json]
[clojure.string :as string]
[taoensso.timbre :as log]))
(def bunyan-levels
"Maps a logging level keyword into a bunyan integer level"
{:trace 10
:debug 20
:info 30
@wdullaer
wdullaer / update-docker-config.sh
Last active Jul 12, 2017
Expose docker socket over unsecure TCP with systemd
View update-docker-config.sh
#!/bin/bash
mkdir -p /etc/systemd/system/docker.service.d
cat <<EOF > /etc/systemd/system/docker.service.d/override.conf
[Service]
ExecStart=
ExecStart=/usr/bin/dockerd -H fd:// -H tcp://0.0.0.0:2375
EOF
sudo systemctl daemon-reload
sudo service docker restart
View a2dp.py
#! /usr/bin/env python3.5
"""
Fixing bluetooth stereo headphone/headset problem in ubuntu 16.04 and also debian jessie, with bluez5.
This version is adapted to work on ubuntu 16.10
Workaround for bug: https://bugs.launchpad.net/ubuntu/+source/indicator-sound/+bug/1577197
Run it with python3.5 or higher after pairing/connecting the bluetooth stereo headphone.
View batman.js
(''+(+'⇹')).repeat(8) + ' BATMAN!'
@wdullaer
wdullaer / bubbleupnpserver.service
Created May 26, 2015
BubbleUPnP Server Systemd Unit
View bubbleupnpserver.service
[Unit]
Description=BubbleUPnP Server
Requires=network-online.target
After=network-online.target
[Service]
Type=simple
Environment=DEFAULTFILE=/etc/default/bubbleupnpserver
Restart=on-failure
ExecStartPre=/usr/share/bubbleupnpserver/startService.sh
@wdullaer
wdullaer / syntax.css
Created Apr 25, 2015
Monokai Syntax CSS theme
View syntax.css
/* Adjusted to give override background and text colour */
.highlight pre, pre, .highlight .hll {
background-color: #49483E;
border: 1px solid #ccc;
padding: 6px 10px;
border-radius: 3px;
color: #FFFFFF;
}
.gist pre {
@wdullaer
wdullaer / Monokai.colorscheme
Last active Mar 15, 2019
Monokai Konsole Colourscheme
View Monokai.colorscheme
[Background]
Color=40,40,40
[BackgroundIntense]
Color=40,40,40
[Color0]
Color=73,72,62
[Color0Intense]
@wdullaer
wdullaer / docker-cleanup
Last active Mar 5, 2021
Cleanup unused Docker images and containers
View docker-cleanup
#!/bin/sh
# Cleanup docker files: untagged containers and images.
#
# Use `docker-cleanup -n` for a dry run to see what would be deleted.
untagged_containers() {
# Print containers using untagged images: $1 is used with awk's print: 0=line, 1=column 1.
# NOTE: "[0-9a-f]{12}" does not work with GNU Awk 3.1.7 (RHEL6).
# Ref: https://github.com/blueyed/dotfiles/commit/a14f0b4b#commitcomment-6736470
docker ps -a | tail -n +2 | awk '$2 ~ "^[0-9a-f]+$" {print $'$1'}'