Skip to content

Instantly share code, notes, and snippets.

@johngidt
johngidt / encdec.py
Created June 13, 2016 21:25 — forked from jforr/encdec.py
2 way encryption decryption based on pycrypto
# Inspired and adopted from https://gist.github.com/sekondus/4322469
# COMES WITH ABOSLUTELY NO WARRANTY OF ANY KIND.
# TOTAL FREEWARE, NO CLAIMS MADE OF ANY SORT.
# SELL IT, BURN IT, PRETEND ITS YOUR OWN.
# RELEASED UNDER NOBODY CARES LICENSE.
import os
import base64
from Crypto.Cipher import AES
@johngidt
johngidt / pretty.py
Created May 13, 2016 21:04 — forked from jeffskinnerbox/pretty.py
A library that provides a Python print, stdout, and string wrapper that makes colored terminal (Xterm/VT100 type terminals) text easier to use (e.g. without having to mess around with ANSI escape sequences).
#!/usr/bin/env python
"""pretty.py will color text for Xterm/VT100 type terminals using ANSI Escape Sequences
A library that provides a Python print, stdout, and string wrapper that makes colored terminal
text easier to use(e.g. without having to mess around with ANSI escape sequences).
Referance Materials:
Colored text in Python using ANSI Escape Sequences
http://nezzen.net/2008/06/23/colored-text-in-python-using-ansi-escape-sequences/
@johngidt
johngidt / user-data.sh
Created May 13, 2016 15:06 — forked from codeinthehole/user-data.sh
Get the value of an EC2 instance's tag
#!/usr/bin/env bash
#
# Get the value of a tag for a running EC2 instance.
#
# This can be useful within bootstrapping scripts ("user-data").
#
# Note the EC3 instance needs to have an IAM role that lets it read tags. The policy
# JSON for this looks like:
#
# {
@johngidt
johngidt / colors.py
Created May 11, 2016 22:00 — forked from arulrajnet/colors.py
python coloring for linux, based on this answer http://stackoverflow.com/a/26445590/3191896 and modified to make it more usable in a pythonic way.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
class Color(object):
"""
reference from https://gist.github.com/Jossef/0ee20314577925b4027f and modified bit.
"""
def __init__(self, text, **user_styles):