Skip to content

Instantly share code, notes, and snippets.

View starkers's full-sized avatar

David Stark starkers

  • London, UK
  • 02:01 (UTC +01:00)
View GitHub Profile
@starkers
starkers / myip
Created May 17, 2014 16:57
Determine you're outbound (http) IP and reverse DNS
#!/usr/bin/env bash
# Depends on curl and dig
TIMEOUT=1
SERVER=4.2.2.3
IP=`curl -s --connect-timeout "$TIMEOUT" https://outboundip.com 2>/dev/null`
#echo :$?:
@starkers
starkers / make-bundle
Last active June 10, 2019 03:01
Generate a new client for OpenVPN, create a .ovpn file and bundle it into a zip
#!/usr/bin/env bash
# NB: I use this on centos 6 but should work on other stuff
#
# Ensure that reverse DNS works so it can lookup its IP/hostname
# Also relies on "zip" and dig
#
# ....I should probably do some more checks on:
# Destination folders existence
# client cert is correctly inserted into the index
# host lookup worked
@starkers
starkers / xpass
Last active May 17, 2021 17:41
generate password and copy it into clipboard
#!/usr/bin/env bash
# See: https://gist.github.com/starkers/234909caf153904e5428
#Check xpass exists
if [ ! -x "$(which xclip)" ]; then
echo "Please install xclip" ; exit 1
fi
#Length of string:
LEN=32