This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bpftrace | |
/* | |
Watches for all ipv4 tcp accepts, displays: | |
- remote and local addresses of the accepted connection | |
- accept queue size and maximum | |
*/ | |
#include <linux/tcp.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
src/clang_parser.cpp | 14 ++++++++++++++ | |
1 file changed, 14 insertions(+) | |
diff --git a/src/clang_parser.cpp b/src/clang_parser.cpp | |
index 6adb5f0..5b47555 100644 | |
--- a/src/clang_parser.cpp | |
+++ b/src/clang_parser.cpp | |
@@ -221,10 +221,23 @@ void ClangParser::parse(ast::Program *program, StructMap &structs) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
./bpftrace /usr/share/shopiftools/acceptqfull.bt | grep -i sock_common | |
Parsed: union sock_common::(anonymous at include/net/sock.h:155:2) parent: ident: skc_addrpair | |
Parsed: sock_common::(anonymous at include/net/sock.h:157:3) parent: ident: skc_daddr | |
Parsed: sock_common::(anonymous at include/net/sock.h:157:3) parent: ident: skc_rcv_saddr | |
Parsed: union sock_common::(anonymous at include/net/sock.h:162:2) parent: ident: skc_hash | |
Parsed: union sock_common::(anonymous at include/net/sock.h:162:2) parent: ident: skc_u16hashes | |
Parsed: union sock_common::(anonymous at include/net/sock.h:167:2) parent: ident: skc_portpair | |
Parsed: sock_common::(anonymous at include/net/sock.h:169:3) parent: ident: skc_dport | |
Parsed: sock_common::(anonymous at include/net/sock.h:169:3) parent: ident: skc_num | |
Parsed: sock_common parent: sock_common ident: skc_family |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
POD_ID=$1 | |
NS_ID=$2 | |
CONTAINER_NAME=$3 | |
shift | |
shift | |
shift | |
container=$(kubectl get pod ${POD_ID} -n ${NS_ID} -o json | jq ".status.containerStatuses[] | select(.name == \"${CONTAINER_NAME}\") | .containerID" | sed -e 's/^"//' -e 's/"$//' | sed 's|docker://||g') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
POD_ID=$1 | |
NS_ID=$2 | |
CONTAINER_NAME=$3 | |
container=$(kubectl get pod ${POD_ID} -n ${NS_ID} -o json | jq ".status.containerStatuses[] | select(.name == \"${CONTAINER_NAME}\") | .containerID" | sed -e 's/^"//' -e 's/"$//' | sed 's|docker://||g') | |
echo "Container ID is ${container}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl https://storage.googleapis.com/minikube/releases/v0.16.0/minikube-darwin-amd64 > minikube | |
chmod +x minikube | |
# https://github.com/kubernetes/minikube/blob/v0.16.0/DRIVERS.md#kvm-driver | |
# Xhyve is a lot less shit to deal with than virtualbox. | |
# you might get a panic if you have virtualbox < version 5, if so just upgrade. | |
brew install docker-machine-driver-xhyve | |
# Note: this is needed because there's no other way for xhyve to get networknig to work (see xhyve repo's issues) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Enable SNMP | |
USER= | |
PASS= | |
IPMI_HOST= | |
TARGET=127.0.0.1 | |
INDEX=1 # one indexed alert to set | |
SESSION_ID=$(curl -d "name=${USER}&pwd=${PASS}" "https://${IPMI_HOST}/cgi/login.cgi" --silent --insecure -i | awk '/Set-Cookie/ && NR != 2 { print $2 }') | |
# Severity -> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Enable SNMP | |
USER= | |
PASS= | |
IPMI_HOST= | |
SESSION_ID=$(curl -d "name=${USER}&pwd=${PASS}" "https://${IPMI_HOST}/cgi/login.cgi" --silent --insecure -i | awk '/Set-Cookie/ && NR != 2 { print $2 }') | |
curl -X POST -H "Cookie: ${SESSION_ID}" --insecure "https://${IPMI_HOST}/cgi/op.cgi" -d "&op=config_snmp&en_snmp=on&ver_snmp=v2&rocommunity=public&rwcommunity=public" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
USER= | |
PASS= | |
IPMI_HOST= | |
SESSION_ID=$(curl -d "name=${USER}&pwd=${PASS}" "https://${IPMI_HOST}/cgi/login.cgi" --silent --insecure -i | awk '/Set-Cookie/ && NR != 2 { print $2 }') | |
ipmi_scrape() | |
{ | |
curl -H "Cookie: ${SESSION_ID}" --insecure "https://${IPMI_HOST}/$1" | |
} | |
time=$(ruby -e 'require "time"; require "uri"; puts URI.escape Time.now.httpdate.gsub(",", "")') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
driver: | |
name: docker | |
use_sudo: false # this depends if you need to do `sudo` to run `docker` command or not | |
disable_upstart: false | |
run_command: /sbin/init | |
provisioner: | |
name: chef_zero | |
platforms: |