Skip to content

Instantly share code, notes, and snippets.

Working from home

Mohan Balasundaram tuxfight3r

Working from home
View GitHub Profile



h        -   Move left
j        -   Move down
k        -   Move up
l        -   Move right
$        -   Move to end of line
0        -   Move to beginning of line (including whitespace)
tuxfight3r / tcp_flags.txt
Last active Aug 11, 2022
tcpdump - reading tcp flags
View tcp_flags.txt
Unskilled Attackers Pester Real Security Folks
Unskilled = URG = (Not Displayed in Flag Field, Displayed elsewhere)
Attackers = ACK = (Not Displayed in Flag Field, Displayed elsewhere)
Pester = PSH = [P] (Push Data)
Real = RST = [R] (Reset Connection)
Security = SYN = [S] (Start Connection)
tuxfight3r /
Last active Aug 10, 2022
Bash keyboard shortcuts

Bash Shortcuts

visual cheetsheet


command description
ctrl + a Goto BEGINNING of command line
tuxfight3r /
Created Feb 1, 2017
tcp proxy with netcat and socat
#netcat proxy to a different backed and serve requests on port80
mkfifo fifo_pipe
nc -lk -p 80 < fifo_pipe | nc 3306 >fifo_pipe
#socat doing the same with connection verbosity
socat -d -d TCP-LISTEN:80,fork TCP:
View gist:9056eb0862fdf2e8b8755b3c6ce40af1
curl -s -X GET http://localhost:8080/pdb/query/v4/facts --data-urlencode query@test --data-urlencode 'pretty=true'
curl -X POST http://localhost:8080/pdb/query/v4/facts \
-H 'Content-Type:application/json' \
-d '{"query":["and",["=","certname","FQDN"],["=","name","ipaddress"]]}'
content of file test :
tuxfight3r /
Last active Jul 15, 2022
kubectl configmap json patch

use kubectl to patch configmap via json patch operations (add/remove/replace/test)

## Add a new key to the existing configmap
$ kubectl patch cm demo-app-config --type json --patch '[{ "op": "add", "path": "/data/TEST_VALUE", "value": "test_key" }]'
configmap/demo-app-config patched

$ kubectl get cm demo-app-config -o json | jq .data.TEST_VALUE
tuxfight3r / curl_notes.txt
Last active Jul 4, 2022
openshift rest api login / json patch via curl
View curl_notes.txt
#Login to openshift and retrieve token
curl -u admin -kv -H "X-CSRF-Token: xxx" \
#It should give you a bearer token like this
#Get a configmap named configmaptest
tuxfight3r /
Last active Jun 22, 2022
AWS - Upload files to S3 via curl
#!/bin/bash -x
#Date: 21/7/2017
#Author: Mohan
#Purpose: To upload files to AWS S3 via Curl
#Uploads file at the top level folder by default
#S3 parameters
tuxfight3r / openshift_cli_tricks.MD
Last active Jun 3, 2022
openshift cli tricks - using go templates
View openshift_cli_tricks.MD

openshift list all pods and thier specs (requests/limits)

oc get pod -o jsonpath='{range .items[*]}{"SPEC:  \n  LIMITS  : "}{.spec.containers[*].resources.limits}{"\n  REQUESTS: "}{.spec.containers[*].resources.requests}{"\n"}{end}'

openshift list all pods and thier specs with name (requests /limits)

oc get pod -o jsonpath='{range .items[*]}{"NAME:  "}{}{"\nSPEC:  \n  LIMITS  : "}{.spec.containers[*].resources.limits}{"\n  REQUESTS: "}{.spec.containers[*].resources.requests}{"\n\n"}{end}'
tuxfight3r / slapd
Last active May 24, 2022
openldap proxy to AD with TLS
View slapd
#file /etc/sysconfig/slapd
# OpenLDAP server configuration
# see 'man slapd' for additional information
# Where the server will run (-h option)
# - ldapi:/// is required for on-the-fly configuration using client tools
# (use SASL with EXTERNAL mechanism for authentication)
# - default: ldapi:/// ldap:///
# - example: ldapi:/// ldap:// ldap:// ldaps:///
SLAPD_URLS="ldap:/// ldaps:///"