Skip to content

Instantly share code, notes, and snippets.

jeremy avnet brainsik

Block or report user

Report or block brainsik

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
@brainsik
brainsik / terraform.log
Last active Feb 24, 2016
Reproducing Terraform GH Issue #5290
View terraform.log
$ terraform plan
Refreshing Terraform state prior to plan...
The Terraform execution plan has been generated and is shown below.
Resources are shown in alphabetical order for quick scanning. Green resources
will be created (or destroyed and then created if an existing resource
exists), yellow resources are being changed in-place, and red resources
will be destroyed.
@brainsik
brainsik / terraform.log
Last active Feb 23, 2016
Reproducing Terraform GH Issue #4488
View terraform.log
$ terraform plan
Refreshing Terraform state prior to plan...
The Terraform execution plan has been generated and is shown below.
Resources are shown in alphabetical order for quick scanning. Green resources
will be created (or destroyed and then created if an existing resource
exists), yellow resources are being changed in-place, and red resources
will be destroyed.
View tls-notes.md
@brainsik
brainsik / get_me_loggin.py
Last active Dec 30, 2015
Quick logging config for Python shell
View get_me_loggin.py
import logging; logging.basicConfig(level=logging.DEBUG)
View Python.sublime-settings
{
"color_scheme": "Packages/User/Text Ex Machina bsik.tmTheme",
"translate_tabs_to_spaces": true,
"auto_complete_triggers": [{"selector": "source.python - string - comment - constant.numeric", "characters": "."}],
"complete_parameters": true,
"pep8_ignore": ["E501"]
}
@brainsik
brainsik / Preferences.sublime-settings
Last active May 24, 2017
SublimeText 3 Preferences
View Preferences.sublime-settings
{
"always_show_minimap_viewport": true,
"auto_complete_commit_on_tab": true,
"bold_folder_labels": true,
"caret_extra_bottom": 1,
"caret_extra_top": 1,
"caret_style": "solid",
"color_scheme": "Packages/Color Scheme - Default/Solarized (Dark).tmTheme",
"create_window_at_startup": false,
"ensure_newline_at_eof_on_save": true,
@brainsik
brainsik / monocle_tx_redis_sub.py
Created Nov 14, 2013
Monocle Twisted Redis subscriber
View monocle_tx_redis_sub.py
# encoding: utf-8
import sys
import monocle
monocle.init("twisted")
from monocle import _o
from monocle.stack import eventloop
import txredis.client
from twisted.internet import reactor, protocol
@brainsik
brainsik / curlit.sh
Created Oct 31, 2013
Solves the "coding" challenge at letsrevolutionizetesting.com
View curlit.sh
x='http://letsrevolutionizetesting.com/challenge'; while :; do r=`curl -s -H "Accept: application/json" $x`; x=`echo $r | grep -E -o 'http[^"]+'`; if ! echo "$x" | grep -q http; then echo $r; break; fi; echo $x; done
@brainsik
brainsik / gist:4280136
Created Dec 13, 2012
A simple way for Python cron tasks to exit if another process is currently running. Does not use a pidfile.
View gist:4280136
import os
import subprocess
import shlex
def bail_if_another_is_running():
cmd = shlex.split("pgrep -u {} -f {}".format(os.getuid(), __file__))
pids = subprocess.check_output(cmd).strip().split('\n')
if len(pids) > 1:
pids.remove("{}".format(os.getpid()))
@brainsik
brainsik / color_log.py
Created Sep 24, 2011
ANSI colored Python logging
View color_log.py
import logging
from termcolor import colored
class ColorLog(object):
colormap = dict(
debug=dict(color='grey', attrs=['bold']),
info=dict(color='white'),
warn=dict(color='yellow', attrs=['bold']),
You can’t perform that action at this time.