Skip to content

Instantly share code, notes, and snippets.

@alexgottscha
alexgottscha / Terraform sns_topic_subscription error
Last active April 15, 2020 22:20
sns_topic_subscription failure - terraform v0.12.24 aws provider v2.57.0
$ TF_LOG=DEBUG terraform apply
2020/04/15 15:16:50 [WARN] Log levels other than TRACE are currently unreliable, and are supported only for backward compatibility.
Use TF_LOG=TRACE to see Terraform's internal logs.
----
2020/04/15 15:16:50 [INFO] Terraform version: 0.12.24
2020/04/15 15:16:50 [INFO] Go runtime version: go1.12.13
2020/04/15 15:16:50 [INFO] CLI args: []string{"/usr/local/bin/terraform-0.12.24", "apply"}
2020/04/15 15:16:50 [DEBUG] Attempting to open CLI config file: /home/invertigo/.terraformrc
2020/04/15 15:16:50 [DEBUG] File doesn't exist, but doesn't need to. Ignoring.
2020/04/15 15:16:50 [DEBUG] checking for credentials in "/home/invertigo/.terraform.d/plugins"
@alexgottscha
alexgottscha / bumpme
Last active March 20, 2019 23:51
bumpme
Wed Mar 20 23:51:31 UTC 2019
@alexgottscha
alexgottscha / tetris.py
Created November 3, 2018 17:24 — forked from silvasur/tetris.py
Tetris implementation in Python
#!/usr/bin/env python2
#-*- coding: utf-8 -*-
# NOTE FOR WINDOWS USERS:
# You can download a "exefied" version of this game at:
# http://hi-im.laria.me/progs/tetris_py_exefied.zip
# If a DLL is missing or something like this, write an E-Mail (me@laria.me)
# or leave a comment on this gist.
# Very simple tetris implementation
#!/usr/bin/env python
'''clear "ssh-temp" and create a new rule for all traffic from current IP'''
def get_my_public_ip():
'''returns outbound (public) IP address in string format'''
from httplib import HTTPConnection
ipconn = HTTPConnection('icanhazip.com')
ipconn.request('GET', '/')
myip = ipconn.getresponse()
@alexgottscha
alexgottscha / phonetic.py
Created January 13, 2015 01:20
Terrible Phonetics
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
# thanks to /u/Qurtys_Lyn
'''Convert words into phonetic alphabet'''
import sys
def get_opts():
def is_ip4addr(some_string):
'''True if some_string is an IPv4 address'''
try:
octets = [int(o) for o in some_string.split('.')]
except ValueError: # because some element cannot be cast to integer
return False
# ip addresses have between one and four octets
if len(octets) > 4:
@alexgottscha
alexgottscha / aws-sg-fixer.py
Last active August 29, 2015 14:12
SSH Security Group fixer
#!/usr/bin/env python
'''clear "ssh-temp" and create a new rule for all traffic from current IP'''
def get_my_public_ip():
'''returns outbound (public) IP address in string format'''
from httplib import HTTPConnection
ipconn = HTTPConnection('icanhazip.com')
ipconn.request('GET', '/')
myip = ipconn.getresponse()
@alexgottscha
alexgottscha / smile.sh
Created October 29, 2014 23:15
Smiley prompt
BLACK="\[\033[0;30m\]"
BLACKBOLD="\[\033[1;30m\]"
RED="\[\033[0;31m\]"
REDBOLD="\[\033[1;31m\]"
GREEN="\[\033[0;32m\]"
GREENBOLD="\[\033[1;32m\]"
YELLOW="\[\033[0;33m\]"
YELLOWBOLD="\[\033[1;33m\]"
BLUE="\[\033[0;34m\]"
BLUEBOLD="\[\033[1;34m\]"