Bash Shortcuts
Moving
command | description |
---|---|
ctrl + a | Goto BEGINNING of command line |
# 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 |
#!/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/' |
##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) |
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)
#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:///" |
#!/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" |
oc get pod -o jsonpath='{range .items[*]}{"SPEC: \n LIMITS : "}{.spec.containers[*].resources.limits}{"\n REQUESTS: "}{.spec.containers[*].resources.requests}{"\n"}{end}'
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}'
#!/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 { |