Skip to content

Instantly share code, notes, and snippets.

Jeff Schroeder SEJeff

Block or report user

Report or block SEJeff

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
View AuroraStuff.md

The mustache gotcha

When using “bound” objects in an .aurora file it is an absolute that you do not have spaces in the “mustaches”.

Examples:

  • Bad: {{ profile.my_var }}
  • Good: {{profile.my_var}}

Mesos Slave Constraints

When scheduling a task on aurora with Production=True, the 0.7-incubating scheduler will set a default constraint preventing more than one instance of the task on the same rack.

View .pylintrc
[MASTER]
profile=no
persistent=yes
ignore=migrations
cache-size=500
[BASIC]
# Regular expression which should only match correct module names
module-rgx=([a-z][a-z0-9_]*)$
View example.html
Choose a ticket class: <select id="tickets"></select>
<p id="ticketOutput"></p>
<script id="ticketTemplate" type="text/x-jquery-tmpl">
{{if chosenTicket}}
You have chosen <b>${ chosenTicket().name }</b>
($${ chosenTicket().price })
<button data-bind="click: resetTicket">Clear</button>
{{/if}}
View saltshell.py
#!/usr/bin/env python
'''
Drop a user into a Python shell preconfigured with a Salt environment
'''
import atexit
import atexit
import os
import pprint
import readline
import rlcompleter
View tabularize.py
def normalize_line(line):
return [piece.strip() for piece in line.split("|")[1:-1]]
def is_valid_line(line):
return "|" in line
def load(text):
lines = map(normalize_line,
filter(is_valid_line,
text.strip().splitlines()))
View whisper-clean.py
import os
import os.path
import sys
from graphite.render.hashing import ConsistentHashRing
instances = []
unwelcome_instances = []
for arg in sys.argv[1:]:
unwelcome = False
View eventWatch.py
import salt.utils.event
event = salt.utils.event.MasterEvent('/var/run/salt/master')
while True:
data = event.get_event()
print(data)
View informer.py
"""
This enables us to call the minions and search for a specific role
"""
import logging
# Import salt libs
import salt.utils
import salt.payload
View example.py
import logging
from raven import Client
client = Client()
with level(logging.INFO):
client.captureMessage("Yo info")
with level(logging.DEBUG):
You can’t perform that action at this time.