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 / 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.

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
@tracphil
tracphil / excludeWSL.ps1
Last active January 28, 2021 10:48 — forked from noelbundick/LICENSE
Exclude WSL installations from Windows Defender realtime protection
############
# This script will add your WSL environments to the Windows Defender exclusion list so that
# realtime protection does not have an adverse effect on performance.
#
# You should be aware that this could make your system less secure. Use at your own risk.
# Note: This should be run from an administrative PowerShell prompt
# MIT License
#
# Copyright (c) 2018 Noel Bundick
@tracphil
tracphil / ducky.md
Created January 29, 2021 11:20 — forked from rizalgowandy/ducky.md
Programming media keys on the Ducky One 2 Skyline

Programming Media Keys on the Ducky One 2

To use media keys on the Ducky One 2, you must record a macro to bind the media function to a hotkey combination, i.e. Fn plus some key.

Example

Important: In the instructions below, "Press X+Y+Z" means press and hold key X, press and hold key Y, press and hold key Z in that order, and then release all three.

As an example, to bind Fn+PgUp to the play/pause media function:

@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)
@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")