Skip to content

Instantly share code, notes, and snippets.

View dwallraff's full-sized avatar

Dave Wallraff dwallraff

View GitHub Profile
@dwallraff
dwallraff / merlins_ssl_gen_script.sh
Last active September 7, 2016 20:40
@virtmerlin's SSL Certificate script
#!/bin/bash
#[email protected]
set -e
SYS_DOMAIN=$1
APP_DOMAIN=$2
VIP=$3
SSL_FILE=sslconf-${SYS_DOMAIN}.conf
@dwallraff
dwallraff / ami_cleaning.sh
Created March 29, 2016 21:25
Clean an AMI before publishing
find /root/.*history /home/*/.*history -exec rm -f {} \;
find / -name "authorized_keys" –exec rm –f {} \;
find /root/ /home/*/ -name .cvspass –exec rm –f {} \;
find /root/.subversion/auth/svn.simple/ /home/*/.subversion/auth/svn.simple/ -exec rm –rf {} \;
rm /etc/syslog.conf
service rsyslog restart
@dwallraff
dwallraff / IRC client in pure bash
Created March 29, 2016 22:22 — forked from anonymous/IRC client in pure bash 4
IRC client written in pure bash using only bash builtin commands and no other binaries.
#!/bin/bash
#no PATH, no way to accidently run any programs
PATH=''
#useful variables
term_height=0
term_width=0
term_scroll_height=0
status_line_row=0
@dwallraff
dwallraff / grep_ip_address.sh
Last active May 9, 2017 18:26
Grep for valid ip address
grep -oE "(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)" file.txt
# for 0.0.0.0 to 999.999.999.999
# grep -oE "([0-9]{1,3}[\.]){3}[0-9]{1,3}"
@dwallraff
dwallraff / MSFT Azure DC IP List
Last active May 26, 2016 17:41
MSFT Azure DC IP List
https://www.microsoft.com/en-us/download/details.aspx?id=41653
@dwallraff
dwallraff / screen_as_other_user.sh
Created May 13, 2016 16:08
Command to allow you to su as another user and run screen
# su - <user>
# run this before running screen
script /dev/null
@dwallraff
dwallraff / bosh postgres db
Last active May 26, 2016 17:41
Command to run on bosh director to access the bosh postgres db
/var/vcap/packages/postgres/bin/psql -h 127.0.0.1 -p 5432 -U postgres bosh
# $\dt; to list tables
@dwallraff
dwallraff / env.bosh.password.yml
Created May 19, 2016 22:46
CF manifest - env.bosh.password. Thanks @allomov
default_env:
# Default vcap & root password on deployed VMs (ie c1oudc0w)
# Generated using mkpasswd -m sha-512
bosh:
password: (( merge || "$6$4gDD3aV0rdqlrKC$2axHCxGKIObs6tAmMTqYCspcdvQXh3JJcvWOY2WGb4SrdXtnCyNaWlrf3WEqvYR2MYizEGp3kMmbpwBC6jsHt0" ))
# From https://github.com/starkandwayne/cf-pipeline/blob/master/try-anything/pipeline/cf-release/cf-deployment.yml#L9-L10
@dwallraff
dwallraff / uaac_curl.sh
Last active December 1, 2016 14:38
Commands to get uaac access token and us in curl
#!/usr/bin/env bash
token="$(uaac context | awk '/^ *access_token\: *([a-zA-Z0-9.\/+\-_]+) *$/ {print $2}' -)"
curl -H"Authorization: bearer $token" "$@"
@dwallraff
dwallraff / generate public key from private key
Created May 31, 2016 15:15
generate public key from private key
ssh-keygen -y -f ~/.ssh/id_rsa > ~/.ssh/id_rsa.pub