Skip to content

Instantly share code, notes, and snippets.

View dwallraff's full-sized avatar

Dave Wallraff dwallraff

View GitHub Profile
@dwallraff
dwallraff / Ruby gems china mirror
Created July 5, 2016 15:19
Ruby gems china mirror
https://ruby.taobao.org/index_en.html
@dwallraff
dwallraff / env.bosh.password.sh
Last active July 26, 2018 11:06
Generate salted hash for env.bosh.password
echo c1oudc0w | mkpasswd --method=sha-512 --salt='4gDD3aV0rdqlrKC' -s
# echo <password> | mkpasswd --method=sha-512 --salt='<salt for hash>' -s
@dwallraff
dwallraff / datadog_uaac_client.sh
Last active July 15, 2017 02:43
Add a datadog uaac client (for firehose access)
#!/bin/bash
CF_SYS_DOMAIN="sys.cf.com"
CF_UAA_ADMIN_CLIENT_SECRET="client secret from UAA section of ERT"
CF_UAA_DATADOG_CLIENT_SECRET="super_secret_that_you_should_totally_change_no_seriously"
uaac target uaa.${CF_SYS_DOMAIN} --skip-ssl-validation
uaac token client get admin -s ${CF_UAA_ADMIN_CLIENT_SECRET}
uaac client add --name datadog-firehose-nozzle \
@dwallraff
dwallraff / opsman_uaac_get_token.sh
Last active July 15, 2017 02:37
Get a uaac token from opsman
#!/bin/bash
OPSMAN=10.0.0.1
uaac target https://${OPSMAN}/uaa/
uaac token owner get
# Client ID: opsman
# Client Secret: [Press Enter]
# Username: <Ops Manager User name>
@dwallraff
dwallraff / f5_xfp.txt
Last active April 26, 2018 09:40
F5 config - X-Forward-Proto (XFP)
# Recommended solution would be:
# - Use Insert header, in the custom HTTP profile that you applied to the virtual servers.
# For HTTPS Virtuals, insert: X-Forwarded-Proto, with a value of https
# For HTTP Virtuals, insert: X-Forwarded-Proto, with a value of http
# Of course you could also use apply an iRule to the Virtual Server, something like this should work:
when HTTP_REQUEST {
if { [SSL::mode] == 1 } {
@dwallraff
dwallraff / update_uaa_hostname_update.sh
Last active September 14, 2016 16:52
Update the uaa name in OpsMan if the hostname changes (Thanks @virtmerlin)
sudo su - tempest-web -s /bin/bash -c 'psql tempest_production'
SELECT column_name, data_type
FROM information_schema.columns
WHERE table_name = 'uaa_configs';
SELECT id, hostname
FROM uaa_configs;
UPDATE uaa_configs
@dwallraff
dwallraff / bash_tcp.sh
Last active March 22, 2021 17:47
Use bash for tcp test connections on linux
exec 3<>/dev/tcp/example.com/80 && echo -e "HEAD / HTTP/1.1\r\nHost: example.com\r\nConnection: close\r\n\r\n" >&3 && cat <&3
# exec 3<>/dev/tcp/www.google.com/80
# echo -e "GET /index.html HTTP/1.1\r\nConnection: close\r\n\r\n" >&3
# cat <&3
# cat < /dev/tcp/<ip>/<port> > outfile.txt
@dwallraff
dwallraff / remote_git.md
Last active September 9, 2016 22:55
setup git remote

on remote:

git init --share --bare repo.git

on local:

git init
git remote add origin ssh://[email protected]/~/repot.git
git push orgin master
@dwallraff
dwallraff / missing_nc_exec.sh
Last active September 14, 2016 17:09
Use when you don't have netcat -e (netcat-openbsd does not have the -e option; is used in most linux variants)
rm -f /tmp/f; mkfifo /tmp/f ; cat /tmp/f | /bin/sh -i 2>&1 | nc -l 127.0.0.1 9999 > /tmp/f
# mkfifo foo
# nc -lk 2600 0<foo | /bin/bash 1>foo
@dwallraff
dwallraff / public_ip.sh
Created September 10, 2016 16:48
Get public IP
curl icanhazip.com
# curl ifconfig.me
# dig +short myip.opendns.com @resolver1.opendns.com