Skip to content

Instantly share code, notes, and snippets.

Avatar

Martynas Pumputis brb

View GitHub Profile
@brb
brb / dmesg
Last active Mar 8, 2019
vmalloc two failures
View dmesg
2019-03-08T19:36:39,224208+0000 tc: vmalloc: allocation failure, allocated 59392000 of 75501568 bytes, mode:0x6090c0(GFP_KERNEL|__GFP_NORETRY|__GFP_ZERO), nodemask=(null),cpuset=b389e318420d891300ad9658f8e056b59972fda9547dd566245a922c34bb9e42,mems_allowed=0
2019-03-08T19:36:39,224215+0000 CPU: 0 PID: 17378 Comm: tc Tainted: G C OE 5.0.0+ #1
2019-03-08T19:36:39,224216+0000 Hardware name: innotek GmbH VirtualBox/VirtualBox, BIOS VirtualBox 12/01/2006
2019-03-08T19:36:39,224217+0000 Call Trace:
2019-03-08T19:36:39,224233+0000 dump_stack+0x63/0x85
2019-03-08T19:36:39,224240+0000 warn_alloc+0x10b/0x190
2019-03-08T19:36:39,224242+0000 __vmalloc_node_range+0x173/0x270
2019-03-08T19:36:39,224244+0000 __vmalloc_node_flags_caller+0x47/0x50
2019-03-08T19:36:39,224246+0000 ? htab_map_alloc+0x2e4/0x4e0
2019-03-08T19:36:39,224247+0000 bpf_map_area_alloc+0x45/0x50
@brb
brb / proc-meminfo
Created Mar 8, 2019
vmalloc fails to alloc 75MB, Linux 5.0
View proc-meminfo
MemTotal: 4037048 kB
MemFree: 170752 kB
MemAvailable: 2848280 kB
Buffers: 238708 kB
Cached: 2553912 kB
SwapCached: 0 kB
Active: 1720420 kB
Inactive: 1682980 kB
Active(anon): 612384 kB
Inactive(anon): 844 kB
@brb
brb / ipvlan.patch
Created Feb 12, 2019
ipvlan-no-netfilter.patch applied to v4.15.18
View ipvlan.patch
diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig
index 0936da592..589d7f3a5 100644
--- a/drivers/net/Kconfig
+++ b/drivers/net/Kconfig
@@ -145,13 +145,15 @@ config MACVTAP
To compile this driver as a module, choose M here: the module
will be called macvtap.
+config IPVLAN_L3S
+ depends on NETFILTER
@brb
brb / main.c
Created Jan 31, 2019
bpf_num_possible_cpus
View main.c
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
static inline unsigned int bpf_num_possible_cpus(void)
{
static const char *fcpu = "/tmp/foo";
unsigned int start, end, possible_cpus = 0;
char buff[128];
View keybase.md

Keybase proof

I hereby claim:

  • I am brb on github.
  • I am martynasp (https://keybase.io/martynasp) on keybase.
  • I have a public key whose fingerprint is 26E3 A522 51B3 4AD1 C2CD E5CB 5385 B938 B74F 0D71

To claim this, I am signing this object:

View 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
@brb
brb / vagabonds-img-resize.sh
Created Apr 8, 2017
vagabonds-img-resize.sh
View 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 / tshark-esp.sh
Created Feb 10, 2017
Decrypt AES-GCM ESP (VXLAN) packets
View tshark-esp.sh
#!/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 / 2016.md
Last active Jan 9, 2017
my stats of 2016
View 2016.md

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 Nov 4, 2016
Prometheus + Kubernetes + WeaveCloud
View README.md

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.
You can’t perform that action at this time.