Skip to content

Instantly share code, notes, and snippets.

View brb's full-sized avatar

Martynas Pumputis brb

View GitHub Profile
@brb
brb / menu.lst
Created April 15, 2015 14:59
Barrelfish menu.lst
timeout 0
# spawnd is used to control which cpus are booted
#
# "spawnd boot" will use the skb and pci to figure out and
# boot all cores in the machine
#
# "spawnd boot bootapic-x86_64=1-5" will not use the skb and
# boot the list of cores passed as argument.
# The APIC id of the cores to boot should be specified.
@brb
brb / withnetns_strace.log
Created June 24, 2016 14:51
WithNetNS bug
This file has been truncated, but you can view the full file.
execve("./prog/weaveutil/weaveutil", ["./prog/weaveutil/weaveutil", "container-addrs", "weave", "09a29216781c", "859174e2a134", "6f1b45b7ca7f", "84ce7a1efba9", "4b78fdc29e51", "69dd95e85c99", "3b6f18e9cf59", "7266af2ad316", "77f96221b996", "f2cc8f7ba6fd", "44be62695f69", "6caa9c024124", "ee1a86ede15b", "b8cf2435ed46", "f352eaf0ac97", "09fc9dca3e9e", "5c9799078a84", "660ba4a51ef9", "4f2930f97dde", "2a8034422ae8", "21ca7c97d883", "754c0571e48c", "8281423c6b3b", "19328cdafdb8", "36027a3b2639", "e75efc9eae56", "625fd8775652", "86bb47219417", "2da4dd07188b", "4b7ef00a3dac", "a9cdbd956012", "44e62ebb4194", "fc06dddedbbb", "256f08324429", "6b9825a7542a"], [/* 17 vars */]) = 0
uname({sysname="Linux", nodename="fitzroy", ...}) = 0
brk(NULL) = 0x16c7000
brk(0x16c81c0) = 0x16c81c0
arch_prctl(ARCH_SET_FS, 0x16c7880) = 0
set_tid_address(0x16c7b50) = 3357
set_robust_list(0x16c7b60, 24) = 0
rt_sigaction(SIGRTMIN, {0x72e8d0, [], SA_RESTORER|SA_
@brb
brb / widen-gh-code-sections.user.js
Last active August 12, 2016 10:25
Greasemonkey extension (Chromium) for widening Github code sections at Issues pages
// ==UserScript==
// @name widen-gh-issues
// @description Widens code sections at Github issues pages
// @version 0.0.1
//
// @match https://github.com/*/*/issues/*
// @match https://github.com/*/*/pull/*
// ==/UserScript==
WIDEN = "WIDEN";
@brb
brb / ftrace.sh
Created August 16, 2016 14:13
ftrace example for kernel call graphs
echo 0 > /sys/kernel/debug/tracing/tracing_on
echo > /sys/kernel/debug/tracing/trace
echo function_graph > /sys/kernel/debug/tracing/current_tracer
echo $KERNEL_FUNCTION > /sys/kernel/debug/tracing/set_graph_function
echo 1 > /sys/kernel/debug/tracing/tracing_on
$DO_STUFF
echo 0 > /sys/kernel/debug/tracing/tracing_on
echo > /sys/kernel/debug/tracing/set_graph_function
@brb
brb / fetch.sh
Created October 24, 2016 14:24
circleci-grep
#!/bin/bash
set -ue
API_URL="https://circleci.com/api/v1.1"
VCS_TYPE="github"
CACHE_DIR="/tmp/.circleci-grep"
PROJECT=""
BUILD=""
@brb
brb / README.md
Last active November 4, 2016 13:38
Prometheus + Kubernetes + WeaveCloud

HOWTO

  1. Get a token from Weave Cloud and set it in prometheus.yaml.
  2. Install Prometheus on Kubernetes: kubectl apply -f prometheus.yaml
  3. Goto http://NODE_IP:30900/targets to check status.
@brb
brb / 2016.md
Last active January 9, 2017 21:51
my stats of 2016

In 2016 I thoroughly logged most of my days (302/366 days; didn't log on climbing trips). Some stats:

  • 183 days when I took a cold shower in the morning.
  • 113 sessions of pilates in the morning.
  • 106 days when I meditated >5min.
  • Ran 339.39km (46 sessions).
  • Commuted 63 days by bike.
  • 114 sessions of climbing; 159hr spent indoors.
  • 65 days when I had at least one meal with meat.
  • Consumed 483 caffeine units (>20mg).
@brb
brb / tshark-esp.sh
Created February 10, 2017 16:29
Decrypt AES-GCM ESP (VXLAN) packets
#!/bin/sh
set -eu
HOST=$1
PCAP=$2
AWK_CMD='{print "\"IPv4\",\"" $2 "\",\"" substr($4, 1, length($4)-1) "\",\"" $8 "\",\"AES-GCM [RFC4106]\",\"" $19 "\",\"ANY 128 bit authentication [no checking]\",\"\""}'
ssh $HOST "sudo ip -o xfrm state" | awk "$AWK_CMD" >> $HOME/.config/wireshark/esp_sa
tshark -o esp.enable_encryption_decode:TRUE -d udp.port==6784,vxlan -nr $PCAP esp
@brb
brb / vagabonds-img-resize.sh
Created April 8, 2017 18:55
vagabonds-img-resize.sh
#!/bin/sh
DIR="$1"
#echo "Renaming JPG -> jpg ..."
#for f in $DIR/*; do
# mv "$f" $(echo "$f" | tr '[:upper:]' '[:lower:]')
#done
for f in $DIR/*; do
@brb
brb / battery.sh
Created June 3, 2017 15:41
battery.sh
#!/bin/sh
# * * * * * battery.sh /home/brb/Dropbox/battery-stats.txt
set -eu
for b in /sys/class/power_supply/BAT*; do
echo "$(basename "$b") $(date +%s) $(cat ${b}/power_now) $(cat ${b}/energy_now)" >> $1
done