Skip to content

Instantly share code, notes, and snippets.

Markus Bukowski mrbuk

Block or report user

Report or block mrbuk

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
mrbuk /
Created May 1, 2018
Set the default sink and source
function stop_sound_system() {
echo "Stopping pulseaudion"; killall pulseaudio
echo "Waiting 10s ..."; sleep 10
mrbuk / DisplayProductID-76e7
Last active Oct 8, 2017
LG31MU97 MacOS 50Hz patched EDID
View DisplayProductID-76e7
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "">
<plist version="1.0">
# if the notebook lid is closed the the display is identified as "DisplayPort-0". If the notebook lid is open it is identified as "DisplayPort-1"
# in case of a closed lid "DisplayPort-1 disconnected" can be found in xrandr output.
# default to notebook lid is open
xrandr | grep 'DisplayPort-1 disconnected' > /dev/null
if [ "$?" == 0 ]; then
mrbuk / Dockerfile
Last active Jun 27, 2016
firehose-to-syslog build env
View Dockerfile
FROM centos:centos6
# install epel for new git version
RUN rpm -Uvh
# golang dependencies: gcc for cgo
RUN yum -y update && yum -y install \
g++ \
gcc \
libc6-dev \
mrbuk /
Created Jun 22, 2016
Check log output for skipped lines
# when checking cf logs invoke with
# awk '{print $4}' log-example.out | egrep '^[0-9]+' | sort -n | python
import sys
def checkLineConsistency(previous, current):
if previous[0]+1 != current[0]:
print "Inconsistency between line %d ('%d') and %d ('%d')" % (previous[1], previous[0], current[1], current[0])
mrbuk / refresh_pac.command
Last active May 29, 2016
Refresh PAC by disabling/enabling proxy state
View refresh_pac.command
#! /bin/sh
read -r -d '' script << _EOF_
networksetup -listallnetworkservices | awk 'NR>1' | while read SERVICE ; do
if networksetup -getautoproxyurl "\$SERVICE" | grep '^Enabled: Yes' >/dev/null; then
networksetup -setautoproxystate "\$SERVICE" off
networksetup -setautoproxystate "\$SERVICE" on
echo "\$SERVICE" bounced.
mrbuk / toggle_natural_scrolling.command
Created May 29, 2016
Toggle natural scrolling on OSX
View toggle_natural_scrolling.command
osascript <<EOF
tell application "System Preferences"
set current pane to pane ""
end tell
tell application "System Events"
tell application process "System Preferences"
tell tab group 1 of window "Trackpad"
mrbuk / four-clojure-problem-92-1.clj
Last active Nov 15, 2015
Solution for 4clojure problem 92
View four-clojure-problem-92-1.clj
;; first not so idiomatic approach to the problem to convert roman numerals to decimal.
(fn roman-to-dec [s]
(let [default-f (fn [last acc]
(+ acc))
prefixed-f (fn [prefixes]
(fn [last acc]
(if (some #(= % last) prefixes)
mrbuk /
Last active Apr 4, 2017
Sticky IP addresses with VMWare Fusion

It is possible in VMWare Fusion to ensure that a VM will always be assigned the same IP address - this is more convenient than making the VM use static IP via config of the Linux box it uses. The simplest way to achieve this is as follows (all performed on the Mac host, not the Linux guests)

sudo vim /Library/Preferences/VMware\ Fusion/vmnet8/dhcpd.conf

At the bottom of the file, after the following line:-

####### VMNET DHCP Configuration. End of "DO NOT MODIFY SECTION" #######

Before changing the configuration file it is recommended to put the vmnet service into config mode so that the file is not overwritten by Fusion itself. To do so run

mrbuk /
Created May 20, 2015
MAT headless mode
# This script parses a heap dump.
# Usage: <path/to/dump.hprof> [report]*
# The leak report has the id org.eclipse.mat.api:suspects
# The top component report has the id org.eclipse.mat.api:top_components
You can’t perform that action at this time.