This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if [ -f ~/.bashrc ]; then | |
source ~/.bashrc | |
fi | |
# User @ Host - working dir | |
export PS1="ryno: \w: " | |
export PS1="[\[\033[0;37m\]\u\[\033[0m\]] \w\n-> " | |
export TERM='xterm-color' | |
export CLICOLOR=1 | |
export LC_CTYPE='en_US.UTF-8' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Below is a brief summary of the resources I mentioned in my talk. | |
Contact me on LinkedIn or Twitter (@ryan_blunden) if you want more info. | |
## Development environment | |
- virtualenv, virtualenvwrapper | |
- SSL for Django runserver (via django_extensions) - `./manage.py runserver_plus --cert conf/localhost 8081` | |
- SSL required if you have an iOS native app hitting your server and you don't want the iOS Devs to hack their Info.plist | |
- Run a local mailserver in your shell - `python -m smtpd -n -c DebuggingServer localhost:1025` | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct DateUtils { | |
static let isoDateFormatter: NSDateFormatter = NSDateFormatter() | |
static func toISO8601(date: NSDate) -> String { | |
isoDateFormatter.locale = NSLocale(localeIdentifier: "en_US_POSIX") // Why en_US_POSIX? - https://developer.apple.com/library/mac/qa/qa1480/ | |
isoDateFormatter.dateFormat = "yyyy-MM-dd'T'HH:mm:ssZZZZZ" // ISO8601 format | |
return isoDateFormatter.stringFromDate(date) | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env bash | |
# --------------------------------------------------------------------- | |
# [Author] Ryan Blunden and Aaron Addleman | |
# Convenience script for AWS CLI authentication requriing MFA | |
# --------------------------------------------------------------------- | |
VERSION=0.1.0 | |
UPDATED=2017-11-07 | |
USAGE="Usage: . ./bin/$(basename "$0") -a <account-number> -u <username> -t <mfa-token>" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# Check required environment vars are set | |
required_vars=(DJANGO_SECRET_KEY DB_NAME DB_USER DB_PASSWORD DB_HOST DB_PORT CACHE_HOST CACHE_PORT) | |
missing_vars=() | |
for i in "${required_vars[@]}" | |
do | |
test -n "${!i+set}" || missing_vars+=("$i") | |
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM python:3-alpine3.6 | |
RUN apk update && \ | |
apk upgrade && \ | |
apk add git | |
# Install pipenv from master | |
RUN pip install pip --upgrade && \ | |
pip install pipenv |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Simple bash function for running a throw-away Dockert container for experimentation purposes | |
rund() { docker container run --rm -it $@; } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -n means don't do hostname lookups for ip addresses | |
# -i is the protocol we're targetting (e.g. 6 (ipv6) or UDP) | |
# -P because we don't want host names as we want to search by port numbers (e.g. 8080 has a host name of "http-alt"). | |
# If you want everything | |
lsof -n -P -iTCP | grep LISTEN | |
# Or if you want to limit it to a specfic port | |
lsof -n -P -iTCP:8080 | grep LISTEN |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
K8S_DASHBOARD_PORT=30000 | |
k8s-dashboard-up () { | |
kubectl apply -f https://raw.githubusercontent.com/kubernetes/dashboard/master/src/deploy/recommended/kubernetes-dashboard.yaml | |
until kubectl get pods --namespace=kube-system | grep kubernetes-dashboard &> /dev/null | |
do | |
sleep 1 |