Skip to content

Instantly share code, notes, and snippets.

Mohan Balasundaram tuxfight3r

Block or report user

Report or block tuxfight3r

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@tuxfight3r
tuxfight3r / ipxe_with_dhcp.txt
Last active Jan 20, 2020
ipxe kickstart over http - dhcp and static configuration
View ipxe_with_dhcp.txt
#clone the repo
git clone http://git.ipxe.org/ipxe.git
cd ipxe/src
cat >ubuntu-amd64-installer.ipxe <<EOF
#!ipxe
dhcp
echo Starting Ubuntu x64 installer for ${hostname}
set base-url http://archive.ubuntu.com/ubuntu/dists/trusty/main/installer-amd64/current/images/netboot/ubuntu-installer/amd64
kernel ${base-url}/linux
View vim-shortcuts.md

VIM KEYBOARD SHORTCUTS

MOVEMENT

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
tuxfight3r / tcp_flags.txt
Last active Jan 19, 2020
tcpdump - reading tcp flags
View tcp_flags.txt
##TCP FLAGS##
Unskilled Attackers Pester Real Security Folks
==============================================
TCPDUMP FLAGS
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
tuxfight3r / jenkins-decrypt.groovy
Created Sep 23, 2015
Decrypting Jenkins Password
View jenkins-decrypt.groovy
#To Decrypt Jenkins Password from credentials.xml
#<username>jenkins</username>
#<passphrase>your-sercret-hash-S0SKVKUuFfUfrY3UhhUC3J</passphrase>
#go to the jenkins url
http://jenkins-host/script
#In the console paste the script
hashed_pw='your-sercret-hash-S0SKVKUuFfUfrY3UhhUC3J'
@tuxfight3r
tuxfight3r / inventory.sh
Created Mar 10, 2016
Ansible dynamic inventory bash demo
View inventory.sh
#!/bin/bash
if [ "$1" == "--list" ] ; then
cat<<EOF
{
"bash_hosts": {
"hosts": [
"10.220.21.24",
"10.220.21.27"
],
@tuxfight3r
tuxfight3r / openshift_cli_tricks.MD
Last active Jan 6, 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:  "}{.metadata.name}{"\nSPEC:  \n  LIMITS  : "}{.spec.containers[*].resources.limits}{"\n  REQUESTS: "}{.spec.containers[*].resources.requests}{"\n\n"}{end}'
@tuxfight3r
tuxfight3r / bind_socket.py
Last active Jan 6, 2020
python tcp socket client / server examples
View bind_socket.py
#!/usr/bin/python
import socket #for sockets
import sys #for exit
try:
#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
tuxfight3r / sfdisk.sh
Created Mar 6, 2017
use sfdisk to create scripted partitions
View sfdisk.sh
##create one big partition
echo ';' | sfdisk /dev/sdc
##create one big partition with specific partition type
#creates W95 FAT32 (LBA)
echo ',,c;' | sfdisk /dev/sdd
#creates lvm type
echo ',,8e;' | sfdisk /dev/sdd
@tuxfight3r
tuxfight3r / 01.bash_shortcuts_v2.md
Last active Dec 28, 2019
Bash keyboard shortcuts
View 01.bash_shortcuts_v2.md

Bash

Moving

command description
ctrl + a Goto BEGINNING of command line
ctrl + e Goto END of command line
ctrl + b move back one character
@tuxfight3r
tuxfight3r / gist:51d42005694c76286e80
Created Aug 12, 2015
mirror maven repository via wget
View gist:51d42005694c76286e80
wget -P/local/target/directory -r -nH -np --reject html http://mirrors.dotsrc.org/maven2/
wget will put a maven2 repository folder under /local/target/directory on your machine, along with all the repositories artifacts.
You can’t perform that action at this time.