Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env bash
if [ -z $1 ]; then
echo
echo "Usage:"
echo " otp google"
echo
echo "Configuration: $HOME/.otpkeys"
echo "Format: name=key"
exit
fi
#!/usr/bin/env bash
main() {
local role_arn=$(aws --profile "$AWS_PROFILE" configure get role_arn)
if [[ $? != 0 || $role_arn == "" ]]; then
exec terraform "$@"
exit 0
fi
credentials=($(
@stfnhh
stfnhh / bulk_update_cognito_users.sh
Created May 9, 2019 15:35
Bulk update Cognito user attributes
#!/bin/bash
POOL_ID=""
QUERY=""
REGION=""
ATTRIBUTES=(
"key:value"
"key2:value2"
)
@stfnhh
stfnhh / cognito-signup.sh
Last active May 9, 2019 14:45
Creates and confirms an AWS Cognito user with custom attributes
#!/bin/bash
CLIENT_ID=""
POOL_ID=""
JOBS=""
EMAIL=""
PASSWORD=""
REGION=""
ATTRIBUTES=(
"key:value"
@stfnhh
stfnhh / on_lambda.py
Created October 22, 2018 14:21
Check to see if code is running on AWS Lambda
if os.environ.get("AWS_EXECUTION_ENV") is not None:
# Running on Lambda
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Ansi 0 Color</key>
<dict>
<key>Color Space</key>
<string>sRGB</string>
<key>Blue Component</key>
<real>0.23137254901960785</real>
" Base16 Ocean (https://github.com/chriskempson/base16)
" Scheme: Chris Kempson (http://chriskempson.com)
" This enables the coresponding base16-shell script to run so that
" :colorscheme works in terminals supported by base16-shell scripts
" User must set this variable in .vimrc
" let g:base16_shell_path=base16-builder/output/shell/
if !has('gui_running')
if exists("g:base16_shell_path")
execute "silent !/bin/sh ".g:base16_shell_path."/base16-ocean.".&background.".sh"
#!/bin/bash
wget --mirror --convert-links --adjust-extension --page-requisites --no-parent $1
#!/bin/bash
# Takes one parameter: a remote git repository URL.
#
# This is the stuff this script does:
#
# 1. Clones the repository
# 2. Fetches all remote branches
# 3. Compresses the folder
# 4. Deletes the cloned folder.
@stfnhh
stfnhh / share.sh
Last active November 1, 2022 02:20
Command line interface for file.io
#!/bin/bash
WEEKS=0
ENCRYPTION=false
FILE=$1
usage() {
cat <<EOF
Usage: $0 FILE [options]