Skip to content

Instantly share code, notes, and snippets.

Thomas Witt thomaswitt

Block or report user

Report or block thomaswitt

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile

Keybase proof

I hereby claim:

  • I am thomaswitt on github.
  • I am thomas_witt ( on keybase.
  • I have a public key ASDd6BzSb0TMTRzkv_0yh6Vy0yzZ0NRbzKk2J8ADRo2fcgo

To claim this, I am signing this object:

thomaswitt / VPNConfigurationProfiles.mobileconfig
Last active Apr 25, 2020
An OnDemand VPN iOS profile for iPad and iPhone that automatically connects you to different VPNs (e.g. Meraki, FRITZ!Box and Streisand) | Blog-Entry:
View VPNConfigurationProfiles.mobileconfig
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "">
<plist version="1.0">
<!-- Home: Manual -->
thomaswitt / amex_travel_expenses_to_pdf.rb
Created Dec 23, 2016
Convert AmEx travel expense CSV output to PDF files
View amex_travel_expenses_to_pdf.rb
#!/usr/bin/env ruby
require 'rubygems'
require 'csv'
require 'bigdecimal'
require 'prawn' # gem install prawn
require 'prawn/measurement_extensions'
require 'prawn/table' # gem install prawn-table
raise "No CSV file given" if ARGV[0].nil?
thomaswitt /
Created Oct 25, 2016
Switch HDMI output of Raspberry Pi devices off and on and preserve the X11 output
if [ $# -lt 1 ]; then
echo "Syntax: $0 (on|off)"
if [ $1 == "on" ]; then
tvservice -p
sleep 2
thomaswitt /
Last active Oct 21, 2016
Get IP ranges of AWS in Europe
curl -s | jq -r '.prefixes[] | select(.region=="eu-west-1" or .region == "eu-central-1" or .region == "GLOBAL") | .ip_prefix' | sort -u | sort -n
thomaswitt / test_api_ssl_endpoints.rb
Created Mar 11, 2015
View test_api_ssl_endpoints.rb
#!/usr/bin/env ruby
require 'openssl'
require 'socket'
require 'uri'
puts "Downloading ca-bundle.crt from github to local file"
thomaswitt / VPN_FritzBox_OnDemand.mobileconfig
Last active Oct 7, 2017
iOS VPN configuration file: Connect to FritzBox VPN if connected to the internet through any insecure WiFi Network (all except than trusted) … customize all strings starting with REPLACE_
View VPN_FritzBox_OnDemand.mobileconfig
Check out the newer version of this gist at:
and the corresponding blog post:
View upload_cert_alias.bash
# upload-cert www_myserver_com.crt aws_profile_name SSL123_SecondaryCA.crt SSL123_PrimaryCA.crt
function upload-cert() {
NAME=`echo "$1" | cut -d'.' -f1`
END=`openssl x509 -in $NAME.crt -noout -enddate | cut -f2 -d= | while read x; do date -j -f '%b %d %T %Y %Z' "$x" '+%Y-%m-%d'; done`
cat $3 $4 $5 >certchain.pem
aws --profile $2 iam upload-server-certificate --server-certificate-name ${NAME}-${END} \
--certificate-body file://$NAME.crt --private-key file://$NAME.key.rsa --certificate-chain file://certchain.pem
thomaswitt / create_route53_domains.rb
Last active Aug 29, 2015
Mass Create Route 53 Domains at AWS
View create_route53_domains.rb
require 'aws-sdk'
access_key_id: ENV['AWSAccessKeyId'].strip,
secret_access_key: ENV['AWSSecretKey'].strip,
region: 'eu-west-1',
use_ssl: true,
r53 =
thomaswitt / crawl_sipgate.rb
Last active Aug 29, 2015
As the sipgate guys appearently don't have an API to fetch all users and SIP credentials for provisioning, you have to crawl their web-site. Ugly, but it works. The crawl may take quite some time, so you're better off caching it. If there's somebody listening from @sipgate: please provide a clean API …
View crawl_sipgate.rb
require 'mechanize'
m =
users = []
rooms = []
login = m.get('')
login.form do |f|
f.username = ''
f.password = 'secret_password'
You can’t perform that action at this time.