Skip to content

Instantly share code, notes, and snippets.

View tracphil's full-sized avatar
👊
Hang tough!

Tracy Phillips tracphil

👊
Hang tough!
View GitHub Profile
@tracphil
tracphil / pyenv-setup.md
Last active May 28, 2021 13:50
PyEnv Setup

PyEnv Setup

PyEnv Install

macOS

brew install pyenv pyenv-virtualenv pyenv-virtualenvwrapper
@tracphil
tracphil / tfswitch.md
Created January 28, 2020 13:36
Install Terraform with tfswitch

tfswitch

Install tfswitch

brew install warrensbox/tap/tfswitch

Install terraform

tfswitch
@tracphil
tracphil / awsinfo.py
Created January 30, 2020 15:02
awsinfo
#!/usr/bin/env python
"""Returns account number, region, account alias
Author: Tracy Phillips
"""
import boto3
IAM_CLIENT = boto3.client("iam")
@tracphil
tracphil / do_boot2.sh
Created February 13, 2020 09:17 — forked from leucos/do_boot2.sh
Bootstrap your DO infrastructure unsing Ansible without dynamic inventory (version for Ansible v2.0+ and DO API v2.0)
#!/bin/bash
#
# What is that
# ============
#
# This script will help you setting up your digital ocean
# infrastructure with Ansible v2.0+ and DO API v2
#
# Usually, when working with DO, one is supposed to use digital_ocean.py
# inventory file, and spin up instances in a playbook.
@tracphil
tracphil / auth.sh
Created February 23, 2020 15:47 — forked from stumyp/auth.sh
simple bash script for getting STS credentials exported as env variables
#!/usr/bin/env bash
unset AWS_ACCESS_KEY_ID
unset AWS_SECRET_ACCESS_KEY
unset AWS_SECURITY_TOKEN
unset AWS_SESSION_TOKEN
while getopts "e:u:p:s:t:f:" arg ; do
case $arg in
p)

Installing SSHPASS

SSHPass is a tiny utility, which allows you to provide the ssh password without using the prompt. This will very helpful for scripting. SSHPass is not good to use in multi-user environment. If you use SSHPass on your development machine, it don't do anything evil.

Installing on Ubuntu

apt-get install sshpass

Installing on OS X

@tracphil
tracphil / proxyclient.service
Last active July 29, 2020 12:31 — forked from basoro/proxyclient.service
Creating new systemd service unit
# vi /etc/systemd/system/proxyclient.service
[Unit]
Description=Proxy Client
After=network.target
[Service]
Type=simple
ExecStart=/usr/sbin/proxy_client -s metro.basoro.id -p 4900 -k key
TimeoutStartSec=0
@tracphil
tracphil / setup_dotfiles.sh
Last active August 13, 2020 12:53
Script to symlink my dotfiles from iCloud
#!/bin/bash
# cd ~/Library/Mobile\ Documents/com~apple~CloudDocs/Settings/dotfiles
if [[ ! -d ~/Library/Mobile\ Documents/com~apple~CloudDocs/Settings/dotfiles ]]
then
echo "${HOME}/Library/Mobile\ Documents/com~apple~CloudDocs/Settings/dotfiles does not exist!"
exit 1
fi
#!/bin/bash
############################################################################
## This is an unofficial nym-mixnode installer, which downloads, configures
## and runs the Nym mixnode in less than 1 minute.
## It creates a nym user which runs the node with a little help of
## a systemd. It automates even the systemd.service creation, so
## everytime you change your node config, simply just do it with this script
## to make sure your Nym-mixnode is running and mixin' packets!
## -------------------------------------------------------------------------
## All credits go to the Nym team, creators of BASH, other FOSS used
@tracphil
tracphil / samlapi_formauth.py
Created January 5, 2021 17:29 — forked from gene1wood/samlapi_formauth.py
How to Implement a General Solution for Federated API/CLI Access Using SAML 2.0
#!/usr/bin/python
# Source : https://s3.amazonaws.com/awsiammedia/public/sample/SAMLAPICLIADFS/samlapi_formauth.py
# Referenced from : https://aws.amazon.com/blogs/security/how-to-implement-a-general-solution-for-federated-apicli-access-using-saml-2-0/
import sys
import boto.sts
import boto.s3
import requests
import getpass