Skip to content

Instantly share code, notes, and snippets.

Immanuel Potter immanuelpotter

Block or report user

Report or block immanuelpotter

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
View .zshrc
# .zshrc
# Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/
# Example format: plugins=(rails git textmate ruby lighthouse)
# Add wisely, as too many plugins slow down shell startup.
plugins=(git git-extras git-flow colored-man colorize github vagrant virtualenv virtualenvwrapper pip python brew osx docker django sublime sudo)
source $ZSH/oh-my-zsh.sh
# User configuration
View gist:91e22525d21c337f0504a814f17b38aa
### Keybase proof
I hereby claim:
* I am immanuelpotter on github.
* I am immanuelpotter (https://keybase.io/immanuelpotter) on keybase.
* I have a public key ASC6arnPIwraZCSzMt9Cvhvw1RPU-M4Jz3EQB_Ry4jGp3go
To claim this, I am signing this object:
@immanuelpotter
immanuelpotter / schedule-task.ps1
Last active Sep 4, 2019
RAM-free-cloudwatch-custom-metric-powershell
View schedule-task.ps1
$action = New-ScheduledTaskAction -Execute "powershell" -Argument " we -File C:\Users\Administrator\Documents\WindowsPowerShell\write-ram-cw-custom-metric.ps1 -ExecutionPolicy bypass"
$trigger = New-ScheduledTaskTrigger -Once -At (Get-Date) -RepetitionInterval (New-TimeSpan -Minutes 1)
Register-ScheduledTask -Action $action -Trigger $trigger -TaskName "CustomRAMCloudWatchMetricWrite" -Description "Logging percentage free memory to CloudWatch for this instance"
View cookie-signer.js
View cross-account-kms.json
//We want to allow the use of two KMS keys from Account A to an IAM User in account B.
//Attach these two SIDs to your user policy in Account B.
{
"Sid": "AllowUseOfKMSKeysFromAccountA",
"Effect": "Allow",
"Action": [
"kms:Encrypt",
"kms:Decrypt",
"kms:ReEncrypt*",
@immanuelpotter
immanuelpotter / tfonly
Last active Feb 1, 2019
If you only want to perform actions on resources in one terraform file, this will do that for you
View tfonly
#!/bin/bash
COMMAND="$1"
TF_FILE="$2"
usage(){
echo "Usage: $0 (plan|apply|destroy) [tf-filename]"
}
@immanuelpotter
immanuelpotter / ec2-quick-create.sh
Last active Jan 29, 2019
quickly launch an amazon linux 1 instance that doesn't need to be in terraform on ec2 for messing around
View ec2-quick-create.sh
#!/bin/bash
KEY_NAME=<set this>
aws ec2 run-instances --image-id
"$(aws ec2 describe-images \
--filters \
Name=name,Values='Amazon Linux*' \
Name=architecture,Values=x86_64 \
Name=root-device-type,Values=ebs \
View load-data-emr.sh
#!/bin/bash
set -ex
#####################################################################################################################
# 1. Change the aws_cmd function to match the naming of your aws credentials
# 2. Check the DATA_PATH var is where your files are ON S3 (or wherever else)
# 3. Make sure you're using the right SSH key
#####################################################################################################################
@immanuelpotter
immanuelpotter / sas-sign.sh
Last active Dec 15, 2018
Signing an Azure VHD to share on the marketplace.
View sas-sign.sh
#!/bin/bash
RESOURCE_GROUP="$1"
OS_DISK="$2"
err_and_exit(){
if [[ -z "$RESOURCE_GROUP" || -z "$OS_DISK" ]] ; then
echo "Supply the Resource Group as argument 1. Supply the VHD image argument 2, including full path in blob storage."
fi
}
View .bashrc
# .bashrc
# Colorized Prompt
BLACK="\[\033[0;30m\]"
BLUE="\[\033[0;34m\]"
GREEN="\[\033[0;32m\]"
CYAN="\[\033[0;36m\]"
RED="\[\033[0;31m\]"
PURPLE="\[\033[0;35m\]"
BROWN="\[\033[0;33m\]"
You can’t perform that action at this time.