Skip to content

Instantly share code, notes, and snippets.

View fstern's full-sized avatar
💭
Iä, Iä, Cthulhu fhtagn!

Falk Stern fstern

💭
Iä, Iä, Cthulhu fhtagn!
View GitHub Profile
@fstern
fstern / vlaniftovrf.sh
Last active January 25, 2018 11:40
Mapping VLAN interfaces to VRFs
egrep -i '(^interface vlan)|(ip vrf forwarding)' showstartup-config-600.txt |\
perl -e 'while (<>) { print $1,"\n" if m/^interface\sVlan(\d+)/; print $1,"\n" if m/\sip vrf forwarding (\w+)/}' |\
tail -n +6 | paste - - -d, |\
perl -e 'while (<>) { chomp; ($vl,$vrf) = split(/,/,$_); push @{$map->{$vrf}},$vl; } ; foreach (keys(%{$map})) { print $_, " ", join(",",@{$map->{$_}}),"\n" }; '
@fstern
fstern / dmcache_status.sh
Last active May 28, 2017 16:49
dm-cache status shell
#!/bin/bash
set -eo pipefail
if [ -z "$1" ]; then
echo "Usage: $0 <dm-cache device>"
exit 1
fi
/sbin/dmsetup status $1 | \
@fstern
fstern / gist:a68b215b4e01392d405bcc86cecf2f6f
Last active October 12, 2016 14:02
My journey with chef...

my chef story

(names removed to protect the guilty)

On one day, the chef-client on our opennebula hosts failed. After looking into it, someone had updated the base recipe and removed a repository which was no longer reachable. So, I'll update the environment of the application cookbook.

$ berks update

Now test it.

$ kitchen converge

@fstern
fstern / nginx.conf
Created March 24, 2014 16:29
podseed.org
user www-data;
worker_processes 4;
pid /var/run/nginx.pid;
events {
worker_connections 768;
}
http {
sendfile on;
tcp_nopush on;