Skip to content

Instantly share code, notes, and snippets.

View brb's full-sized avatar

Martynas Pumputis brb

View GitHub Profile
@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 / 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 / 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 / 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 / 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 / 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
@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 / ec2-update-etchosts.sh
Last active August 29, 2015 14:08
poor man's Elastic IP
#!/bin/bash
# Update /etc/hosts with public non-elastic IPs of EC2 instances.
# Assumes that a name is set for each instance and there is only one value inside tags section.
PREFIX="aws_"
FILTER=".Reservations[].Instances[] |
select(.PublicIpAddress != null) |
.PublicIpAddress + \" $PREFIX\" + .Tags[].Value"
@brb
brb / pinentry-gtk2-0.8.3_paste.patch
Created June 6, 2014 13:10
a hack to enable paste from clipboard for pinentry (gtk2, based on 0.8.3 vsn). fcks up the security (!)
diff --git a/gtk+-2/pinentry-gtk-2.c b/gtk+-2/pinentry-gtk-2.c
index 421bc02..91a9fbf 100644
--- a/gtk+-2/pinentry-gtk-2.c
+++ b/gtk+-2/pinentry-gtk-2.c
@@ -186,7 +186,7 @@ button_clicked (GtkWidget *widget, gpointer data)
gtk_spin_button_get_value_as_int (GTK_SPIN_BUTTON (time_out)));
#endif
- s = gtk_secure_entry_get_text (GTK_SECURE_ENTRY (entry));
+ s = gtk_entry_get_text (GTK_ENTRY (entry));
@brb
brb / area14_2014_challenge_writeup.md
Last active November 23, 2020 14:35
area41 2014 challenge writeup

Intro

Being a cheapass student, I couldn't resist to try to win a free entrance to [Area41 Security Conference][3] (don't mix with Alcoholics Anonymous Area 41 in Nebraska) after spotting @gandro23 retweet about the conference and the challenge.

Level 01

The challenge starts after downloading and extracting a [binary][1]. A quick look