Skip to content

Instantly share code, notes, and snippets.

View tuxfight3r's full-sized avatar
:octocat:
Working from home

Mohan Balasundaram tuxfight3r

:octocat:
Working from home
View GitHub Profile
@tuxfight3r
tuxfight3r / 01.bash_shortcuts_v2.md
Last active May 26, 2024 22:33
Bash keyboard shortcuts

Bash Shortcuts

visual cheetsheet

Moving

command description
ctrl + a Goto BEGINNING of command line
@tuxfight3r
tuxfight3r / tcp_flags.txt
Last active May 22, 2024 02:24
tcpdump - reading tcp flags
##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 / vim-shortcuts.md
Last active May 3, 2024 05:11
VIM SHORTCUTS

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 / heredoc_erb1.rb
Created July 25, 2016 14:56
ruby DATA and __END__ heredoc method
#!/usr/bin/ruby
DATA.each_line do |line|
puts line
end
__END__
Doom
Quake
Diablo
@tuxfight3r
tuxfight3r / dialog.sh
Last active March 30, 2024 17:34
bash script to choose an option with dialog box
#!/bin/bash
HEIGHT=10
WIDTH=40
CHOICE_HEIGHT=4
BACKTITLE="Cluster Options"
TITLE="Select Cluster"
MENU="Choose one of the following options:"
ENV="${ENV:-dev}"
@tuxfight3r
tuxfight3r / s3_upload.sh
Last active March 27, 2024 08:42
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
S3KEY="XXXXXXXXXXX"
S3SECRET="XXXXXXXXXXXXXXXX"
@tuxfight3r
tuxfight3r / docker-cheat-sheet.md
Created July 28, 2016 15:30 — forked from yairark/docker-cheat-sheet.md
Docker Cheat Sheet
@tuxfight3r
tuxfight3r / json_read_sort.py
Last active February 23, 2024 17:40
python json read and sort dictionary list
#!/usr/bin/env python
#Date: 05/03/2016
#Author: Mohan Balasundaram
#Purpose: To read a json file with a dictionary list and sort the output
import json
import sys
json_filename=sys.argv[1]
#print json_filename
@tuxfight3r
tuxfight3r / slapd
Last active February 1, 2024 02:50
openldap proxy to AD with TLS
#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://127.0.0.1/ ldap://10.0.0.1:1389/ ldaps:///
SLAPD_URLS="ldap:/// ldaps:///"
@tuxfight3r
tuxfight3r / openssh-notes.txt
Created February 8, 2016 14:38
openssh - disable scp and log all sftp connections
#Disable scp and logs all sftp connections
#Disable Scp
mv /usr/local/bin/scp{,out}
#Create fake scp message
cat > /usr/local/bin/scp <<EOF
#!/bin/bash
echo "This service allows ssh/sftp connections only"
EOF