Skip to content

Instantly share code, notes, and snippets.

View nyrahul's full-sized avatar
🐞

Rahul Jadhav nyrahul

🐞
  • AccuKnox
View GitHub Profile
@nyrahul
nyrahul / example markdown for plantuml
Created July 5, 2019 11:48
Using plantuml to host the call flows
![QUIC/ngtcp2 handshake flow](http://www.plantuml.com/plantuml/proxy?src=https://raw.githubusercontent.com/nyrahul/ngtcp2-helper/master/res/ngtcp2-handshake.puml?cache=no)
@nyrahul
nyrahul / gdb.cmd
Last active July 22, 2019 11:52
runtime watch a global var ... cmd to use gdb -x gdb.cmd --arg <executable>
b StreamSetUserData
r
n
n
n
eval "watch *(int *)%p", &strm->userData
c
c
c
c
@nyrahul
nyrahul / cfg_delayer.sh
Last active September 4, 2019 05:13
Use 'tc netem' to set delay/latency and loss parameters on an interface
#!/bin/bash
usage()
{
cat << EOF
USAGE: $0 [-hc] [-a <adapter>] [-d <delay-param>] [-l <loss-param>]
OPTIONS:
-h Show this message
-a <adapter> Set the adapter
-d <delay> Set delay/latency parameters (as accepted by netem[1])
@nyrahul
nyrahul / stackup.sh
Created December 11, 2019 14:08
Stack up two videos side-by-side using ffmpeg
ffmpeg -i SVID_20191211_220354_1.mp4 -i SVID_20191211_220355_1.mp4 -filter_complex hstack out.mp4

Keybase proof

I hereby claim:

  • I am nyrahul on github.
  • I am rahuljadhav (https://keybase.io/rahuljadhav) on keybase.
  • I have a public key ASAMztGGPNImzJtw0dB_sZsMOL3zTEFoTt8wFfDwA1Stngo

To claim this, I am signing this object:

@nyrahul
nyrahul / disable touchpad on ubuntu
Created March 4, 2020 11:57
disable touchpad on ubuntu using gnome gsettings
gsettings set org.gnome.desktop.peripherals.touchpad send-events 'disabled'
@nyrahul
nyrahul / log_timestamp_perf.c
Created May 27, 2020 02:10
Measures impact of fancy timestamps in logging
/*
gtd format: ss:usec ... raw time of day format .. difficult to read ..
whitefield format: ss:ms .. eases timestamp reading cuz ms format used
cooja format: hh:mm:ss.ms ... most easiest to read
./a.out 7 // show sample test of all timestamps with print
./a.out 1 1 // perf-test gettimeofday only
./a.out 2 1 // perf-test whitefield style
./a.out 4 1 // perf-test cooja style
❯ sudo perf stat -e 'syscalls:sys_enter_*' iperf -c localhost 2>&1 | awk '$1 != 0'
------------------------------------------------------------
Client connecting to localhost, TCP port 5001
TCP window size: 2.50 MByte (default)
------------------------------------------------------------
[ 3] local 127.0.0.1 port 41332 connected with 127.0.0.1 port 5001
[ ID] Interval Transfer Bandwidth
[ 3] 0.0-10.0 sec 66.0 GBytes 56.7 Gbits/sec
Performance counter stats for 'iperf -c localhost':
@nyrahul
nyrahul / gitswitch.sh
Last active December 22, 2020 06:18
Switch all the remotes from https to git
#!/bin/bash
# Switch all the remotes from https to git
# e.g, https://github.com/username/reponame.git -> [email protected]:username/reponame.git
switch4remote()
{
url=`git remote get-url $1`
[[ ! $url =~ ^https ]] && echo "Remote [$1] might be on git already" && return 0
path=`echo $url | sed -Ene 's#https://github.com/(.*)#\1#p'`
@nyrahul
nyrahul / idspoof.py
Created December 31, 2020 11:51
Spoofing Cilium identity value in vxlan tunneled mode
#! /usr/bin/env python
# Aim of this script is to send a vxlan tunneled HTTP request with spoofed
# identity and pass through the authz checks implemented in cilium-ebpf.
# Configuration you need to set correct:
# 1. The target pod address (dip, dport) to which you want to make unauthorized access
# 2. The source identity (identity = 8849 below) to spoof. Use `cilium identity
# list` to check valid identity values.
# 3. The target node's vxlan IP address (vxlan_ip) and port (vxlan_port = 8472