Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Mohan Balasundaram tuxfight3r

🏠
Working from home
View GitHub Profile
@tuxfight3r
tuxfight3r / 01.bash_shortcuts_v2.md
Last active February 7, 2023 13:15
Bash keyboard shortcuts
View 01.bash_shortcuts_v2.md

Bash Shortcuts

visual cheetsheet

Moving

command description
ctrl + a Goto BEGINNING of command line
@tuxfight3r
tuxfight3r / nginx.conf
Created August 19, 2020 20:01 — 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;
server_name www.domain.com domain.com;
return 301 https://$host$request_uri;
}
# SSL configuration
@tuxfight3r
tuxfight3r / gist:16d586f125c0e2640f26
Last active February 7, 2023 02:33
Centos-updates x86_64 Mirror via wget behind proxy
View gist:16d586f125c0e2640f26
#!/bin/bash
#Purpose:To Mirror Centos Updates x86_64 repo to local folder via
#squid proxy and also to update it periodically
#Author:Mohan
#export the squid proxy server
export http_proxy=192.168.2.100:3128
REPO_URL='http://mirror.centos.org/centos-6/6.5/updates/x86_64/Packages/'
@tuxfight3r
tuxfight3r / tcp_flags.txt
Last active February 7, 2023 02:31
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 / vim-shortcuts.md
Last active February 2, 2023 23:50
VIM SHORTCUTS
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 / slapd
Last active January 27, 2023 02:06
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://127.0.0.1/ ldap://10.0.0.1:1389/ ldaps:///
SLAPD_URLS="ldap:/// ldaps:///"
@tuxfight3r
tuxfight3r / s3_upload.sh
Last active January 23, 2023 16:46
AWS - Upload files to S3 via curl
View s3_upload.sh
#!/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 / menu.livecd.ipxe
Created May 3, 2016 13:52
ipxe linux livecd / netinstall menus
View menu.livecd.ipxe
#!ipxe
# To access this file via http use following redirection:
# http://preseed.panticz.de/ipxe/menu.livecd.ipxe
menu LiveCD
item --gap Ubuntu:
item live_ubuntu_16.04 Ubuntu Trusty 16.04 LiveCD
item live_ubuntu_14.04 Ubuntu Trusty 14.04 LiveCD
item live_ubuntu_12.04 Ubuntu Precise 12.04 LiveCD
@tuxfight3r
tuxfight3r / openshift_cli_tricks.MD
Last active January 20, 2023 18:29
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 / jump.sh
Last active January 6, 2023 10:14
kubectl jump server via kubectl port-forward
View jump.sh
#!/usr/bin/env bash
# Allows you to connect to remote endpoints via port forward
set -e
TEMP_POD_NAME=db-jump-server
LOCAL_PORT=3307
REMOTE_HOST=prod.abc123.region-1.rds.amazonaws.com
REMOTE_PORT=3306
function cleanup {