Skip to content

Instantly share code, notes, and snippets.

Avatar

Turtle Kalus tkalus

  • San Francisco
View GitHub Profile
@tkalus
tkalus / aws_assume_role.sh
Created Jun 29, 2020
Friendlier AWS AssumeRole for Shell
View aws_assume_role.sh
#!/usr/bin/env bash
assume_role_sh() {
local AWSCLI_PYTHON
# Grab the shebang from the awscli
AWSCLI_PYTHON="$(sed -n '/^#!/s/^#!\([^ ]*\).*$/\1/p' "$(command -v aws)")"
"${AWSCLI_PYTHON:-command python3}" - "${@}" << EOD
"""AssumeRole for Shell"""
@tkalus
tkalus / delete_default_vpc.py
Created Jun 3, 2020
AWS: Attempt to delete all default VPCs in all active regions, provided they appear unused and unmodified.
View delete_default_vpc.py
#!/usr/bin/env python3
"""AWS: Safely delete all default VPCs in all active regions."""
import logging
import sys
from functools import partial
from itertools import chain
from typing import Callable
from boto3.session import Session
@tkalus
tkalus / delete_iam_user.py
Created Aug 17, 2019
Delete an IAM User from an AWS Account
View delete_iam_user.py
#!/usr/bin/env python3
"""Delete an IAM User from an AWS Account"""
import sys
from boto3.session import Session
def delete_iam_user(session, user_name):
"""For a given boto3.session.Session, delete the IAM User"""
@tkalus
tkalus / Notes_Export.scpt
Created Aug 1, 2019
Export an entire Folder in Apple Notes to a single text file via TextEdit.
View Notes_Export.scpt
-- Export an entire Folder in Apple Notes to single TextEdit document.
-- Strips HTML Tags.
-- Pairs nicely with command line tooling (I.E. met my basic need)
tell application "TextEdit"
activate
make new document
end tell
@tkalus
tkalus / Notes_Export.scpt
Created Aug 1, 2019
Export an entire Folder in Apple Notes to a single text file via TextEdit
View Notes_Export.scpt
tell application "TextEdit"
activate
make new document
end tell
tell application "Notes"
if folder "Stuff" exists then
set output to ""
@tkalus
tkalus / main.go
Created Jan 8, 2018 — forked from enricofoltran/main.go
A simple golang web server with basic logging, tracing, health check, graceful shutdown and zero dependencies
View main.go
package main
import (
"context"
"flag"
"fmt"
"log"
"net/http"
"os"
"os/signal"
@tkalus
tkalus / main.go
Created Jan 8, 2018 — forked from enricofoltran/main.go
A simple golang web server with basic logging, tracing, health check, graceful shutdown and zero dependencies
View main.go
package main
import (
"context"
"flag"
"fmt"
"log"
"net/http"
"os"
"os/signal"
@tkalus
tkalus / minimal-debian-jessie-x64-DO.sh
Last active Nov 26, 2016
Minimal Debian Jessie x64 Digital Ocean
View minimal-debian-jessie-x64-DO.sh
#/bin/sh
# Slight modify from https://gist.github.com/gjuric/1aaadb6f9fc9c18312bc
apt-mark showauto | egrep "^(grub|linux)" | xargs apt-mark manual
apt-get purge -y \
apt-listchanges apt-utils aptitude aptitude-common aptitude-doc-en arping \
bc bind9-host ca-certificates cloud-init cloud-initramfs-growroot cloud-utils \
console-setup console-setup-linux debian-faq dh-python dictionaries-common \
discover discover-data distro-info distro-info-data dnsutils doc-debian docutils-common \
docutils-doc eject emacsen-common euca2ools exim4 exim4-base exim4-config exim4-daemon-light \
fontconfig fontconfig-config fonts-dejavu-core ftp geoip-database \
@tkalus
tkalus / play_loud.py
Created Oct 5, 2015
Play Loud - Flask App/SoundBoard to Play Wave files through a pre-determined Sound Device
View play_loud.py
#!/usr/bin/env python
import glob
import pyaudio
import wave
from flask import Flask, redirect, url_for
app = Flask(__name__)
@tkalus
tkalus / keybase.md
Created Nov 13, 2014
Keybase Verification
View keybase.md

Keybase proof [50/4110]

I hereby claim:

  • I am tkalus on github.
  • I am turtleish (https://keybase.io/turtleish) on keybase.
  • I have a public key whose fingerprint is 4A2E D677 FB1E E4FA E18C 26D3 62CF B7A3 1509 BC51

To claim this, I am signing this object:

You can’t perform that action at this time.