Skip to content

Instantly share code, notes, and snippets.

View SEJeff's full-sized avatar

Jeff Schroeder SEJeff

View GitHub Profile
from pyparsing import *
stack = {
"my_number": 4,
"my_list": []
}
script = \
"""
push 5 to my_list.
import re
from django.utils.text import compress_string
from django.utils.cache import patch_vary_headers
from django import http
try:
import settings
XS_SHARING_ALLOWED_ORIGINS = settings.XS_SHARING_ALLOWED_ORIGINS
@SEJeff
SEJeff / pr.md
Created March 25, 2013 15:21 — forked from piscisaureus/pr.md

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = [email protected]:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

@SEJeff
SEJeff / iptables
Created April 25, 2013 18:49 — forked from UtahDave/iptables
# Firewall configuration written by system-config-firewall
# Manual customization of this file is not recommended.
*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
-A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
-A INPUT -p icmp -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT
# State
include:
- users.sudo
{% for name, user in pillar.get('users', {}).items() %}
{% set home = user.get('home', "/home/%s" % name) %}
{% for group in user.get('groups', []) %}
{{ group }}_group:
group:
#!/usr/bin/python
# coding=utf-8
# Python version of Zach Holman's "spark"
# https://github.com/holman/spark
# by Stefan van der Walt <[email protected]>
"""
USAGE:
import logging
from raven import Client
client = Client()
with level(logging.INFO):
client.captureMessage("Yo info")
with level(logging.DEBUG):
"""
This enables us to call the minions and search for a specific role
"""
import logging
# Import salt libs
import salt.utils
import salt.payload
import salt.utils.event
event = salt.utils.event.MasterEvent('/var/run/salt/master')
while True:
data = event.get_event()
print(data)
import os
import os.path
import sys
from graphite.render.hashing import ConsistentHashRing
instances = []
unwelcome_instances = []
for arg in sys.argv[1:]:
unwelcome = False