Skip to content

Instantly share code, notes, and snippets.

Working from home

Mohan Balasundaram tuxfight3r

Working from home
View GitHub Profile
tuxfight3r /
Last active Sep 19, 2020
Bash keyboard shortcuts



command description
ctrl + a Goto BEGINNING of command line
ctrl + e Goto END of command line
ctrl + b move back one character



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 / 01.trust_policy.MD
Last active Sep 6, 2020
Importing a VM into AWS EC2 from S3 Bucket
View 01.trust_policy.MD

NOTE: Assuming .vhd image is already uploaded to s3 bucket, the following is the process to import the image when the vmimport role is missing

#create a role policy json file

tuxfight3r / tcp_flags.txt
Last active Sep 6, 2020
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 / nginx.conf
Created Aug 19, 2020 — forked from nrollr/nginx.conf
NGINX config for SSL with Let's Encrypt certs
View nginx.conf
# UPDATED 17 February 2019
# Redirect all HTTP traffic to HTTPS
server {
listen 80;
listen [::]:80;
return 301 https://$host$request_uri;
# SSL configuration
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 / jenkins-decrypt.groovy
Created Sep 23, 2015
Decrypting Jenkins Password
View jenkins-decrypt.groovy
#To Decrypt Jenkins Password from credentials.xml
#go to the jenkins url
#In the console paste the script
tuxfight3r /
Last active Aug 3, 2020
python tcp socket client / server examples
import socket #for sockets
import sys #for exit
#create an AF_INET, STREAM socket (TCP)
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
except socket.error, msg:
print 'Failed to create socket. Error code: ' + str(msg[0]) + ' , Error message : ' + msg[1]
tuxfight3r / openshift_cli_tricks.MD
Last active Aug 3, 2020
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 / ipxe_with_dhcp.txt
Last active Jul 31, 2020
ipxe kickstart over http - dhcp and static configuration
View ipxe_with_dhcp.txt
#clone the repo
git clone
cd ipxe/src
cat >ubuntu-amd64-installer.ipxe <<EOF
echo Starting Ubuntu x64 installer for ${hostname}
set base-url
kernel ${base-url}/linux
You can’t perform that action at this time.