Skip to content

Instantly share code, notes, and snippets.

View ianphil's full-sized avatar
🛸
Rust

Ian Philpot ianphil

🛸
Rust
View GitHub Profile

Keybase proof

I hereby claim:

  • I am tripdubroot on github.
  • I am tripdubroot (https://keybase.io/tripdubroot) on keybase.
  • I have a public key ASAS1ZYJHAadrYhpVq-oDNpdkU5EQNYZav7D8xzi0cSbFQo

To claim this, I am signing this object:

@ianphil
ianphil / DockerNetworkHack.sh
Created June 23, 2016 20:03
I was in meetings all day and used that time to learn a little about Docker Networks.
#
# Learn About Docker Networks
# github/tripdubroot
# Docker version 1.12.0-rc2
# build 906eacd
# experimental
#
# https://docs.docker.com/engine/userguide/networking/dockernetworks/#docker-embedded-dns-server
# https://docs.docker.com/engine/userguide/networking/configure-dns/
# https://github.com/docker/libnetwork/blob/ed311d050fda7821f2e7c53a7e08a0205923aef5/resolver.go
@ianphil
ianphil / SecurePasswords.ps1
Created June 27, 2016 15:06
Read and Write passwords securely from PowerShell
function New-PasswordFile {
param($cert)
try {
$secureString = Read-Host -Prompt 'Enter password...' -AsSecureString
$rng = [System.Security.Cryptography.RNGCryptoServiceProvider]::Create()
$key = New-Object byte[](32)
$rng.GetBytes($key)
$encryptedSecureString = ConvertFrom-SecureString -SecureString $secureString -Key $key
$encryptedKey = New-Object psobject -Property @{
# Setting up gist
#
# https://github.com/defunkt/gist
docker run -itd -v c:/src/gist:/src --name ruby tripdubroot/ruby
gem install gist
<#
@ianphil
ianphil / tls-certs.sh
Created April 21, 2017 15:24
Generate TLS cert/keys for Docker
#!/bin/bash
# Create CA key
openssl genrsa -aes256 -passout pass:asdfasdf -out keys/ca-key.pem 4096
# Create CA cert
openssl req -subj "/CN=$AZ_DNSPATH/O=Microsoft/C=US" -new -x509 -days 365 -passin pass:asdfasdf -key keys/ca-key.pem -sha256 -out keys/ca.pem
# Create CSR for server cert
openssl genrsa -out keys/server-key.pem 4096
@ianphil
ianphil / docker-server.sh
Created April 21, 2017 15:34
Create a UbuntuLTS Docker Host manually with TLS certs
#!/bin/bash
export AZ_HOSTNAME='dockervm'
export AZ_RGROUP='fluentd-azure'
export AZ_DNSNAME=$AZ_HOSTNAME
export AZ_DNSPATH='eastus.cloudapp.azure.com'
export AZ_DNSFQDN="$AZ_DNSNAME.$AZ_DNSPATH"
log () {
echo "$1"
@ianphil
ianphil / scp-certs.sh
Created April 21, 2017 15:39
Copy TLS certs up to Docker host
#!/bin/bash
scp keys/server-key.pem tdr@$AZ_DNSFQDN:~/certs/server/key.pem
scp keys/server-cert.pem tdr@$AZ_DNSFQDN:~/certs/server/cert.pem
scp keys/ca.pem tdr@$AZ_DNSFQDN:~/certs/ca.pem
scp keys/cert.pem tdr@$AZ_DNSFQDN:~/certs/client/cert.pem
scp keys/key.pem tdr@$AZ_DNSFQDN:~/certs/client/key.pem
@ianphil
ianphil / Dockerfile
Created September 8, 2017 11:29
Combining Two Docker Images using Docker multi-stage build
FROM docker:dind
FROM azuresdk/azure-cli-python:latest
@ianphil
ianphil / setup.sh
Last active November 3, 2017 00:24
My Fedora Workstation Setup Script
#!/bin/bash
read -n1 -r -p $'SSH Keys? Press space to continue\n' key
if [ "$key" = '' ]; then
echo $'Continuing...\n'
else
echo $'Exiting...\n'
exit 1
fi
@ianphil
ianphil / znc_az_container.sh
Last active July 15, 2019 11:48
Run ZNC in Azure Containers
#!/bin/sh
# Variables
RESOURCE_GROUP='ianphil-znc'
LOCATION='eastus'
STORAGE_NAME='ianphilznc'
STORAGE_SKU='Standard_LRS'
SHARE_NAME='config'
CONTAINER_NAME=$RESOURCE_GROUP
CONTAINER_PORT=6697