Skip to content

Instantly share code, notes, and snippets.

View nithu0115's full-sized avatar
🍻
Work Hard, Have Fun “¯\_(ツ)_/¯“

Nithish Murcherla nithu0115

🍻
Work Hard, Have Fun “¯\_(ツ)_/¯“
View GitHub Profile
\n
time_namelookup: %{time_namelookup}\n
time_connect: %{time_connect}\n
time_appconnect: %{time_appconnect}\n
time_pretransfer: %{time_pretransfer}\n
time_redirect: %{time_redirect}\n
time_starttransfer: %{time_starttransfer}\n
----------\n
time_total: %{time_total}\n
\n
@nithu0115
nithu0115 / skbtracer.c
Created August 16, 2021 15:30 — forked from chendotjs/skbtracer.c
ebpf-skbtracer
#include <bcc/proto.h>
#include <uapi/linux/ip.h>
#include <uapi/linux/ipv6.h>
#include <uapi/linux/icmp.h>
#include <uapi/linux/tcp.h>
#include <uapi/linux/udp.h>
#include <uapi/linux/icmpv6.h>
#include <net/inet_sock.h>
#include <linux/netfilter/x_tables.h>
#!/bin/sh
#
# The access this gives you is rather terrifing. Use sparingly.
#
set -e -x
node=$1
trap "kubectl delete pod nodesh-$node" EXIT
#!/usr/bin/env python
# coding: utf-8
import sys
from socket import inet_ntop, AF_INET, AF_INET6
from bcc import BPF
import ctypes as ct
import subprocess
import struct
from struct import pack
#include <bcc/proto.h>
#include <uapi/linux/ip.h>
#include <uapi/linux/ipv6.h>
#include <net/inet_sock.h>
//Newer kernel bug so need to #define before including ip_fib.h
#define KBUILD_MODNAME "foo"
#include <net/ip_fib.h>
#include <linux/netfilter/x_tables.h>
#define ROUTE_EVT_IF 1
#include <bcc/proto.h>
#include <uapi/linux/ip.h>
#include <uapi/linux/ipv6.h>
#include <net/inet_sock.h>
//Newer kernel bug so need to #define before including ip_fib.h
#define KBUILD_MODNAME "foo"
#include <net/ip_fib.h>
#include <linux/netfilter/x_tables.h>
#include <net/route.h>
#/usr/bin/env python
# coding: utf-8
import sys
from socket import inet_ntop, AF_INET, AF_INET6
from bcc import BPF
import ctypes as ct
import subprocess
import struct
from struct import pack
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: ssm-agent
namespace: kube-system
labels:
k8s-app: ssm-agent
spec:
selector:
matchLabels:
@nithu0115
nithu0115 / download-docker-image.sh
Created July 28, 2020 19:02
It allows you to download a docker image in a loadable tar-format, but without using docker pull, and only relies on bash and some other CLI tools.
#!/usr/bin/env bash
## Origin: https://raw.githubusercontent.com/moby/moby/master/contrib/download-frozen-image-v2.sh
# We extend our path to include local directory to ease jq finding.
export PATH=$PATH:.
# List of external commands we need currently
NEEDCMD=(
curl jq awk sha256sum uname
@nithu0115
nithu0115 / cni-bandwidth.yaml
Created May 26, 2020 02:58
CNI bandwidth testing
apiVersion: v1
kind: Pod
metadata:
annotations:
kubernetes.io/ingress-bandwidth: 1M
kubernetes.io/egress-bandwidth: 1M
name: iperf-server
labels:
app: iperf-server
spec: