Skip to content

Instantly share code, notes, and snippets.

View SEJeff's full-sized avatar

Jeff Schroeder SEJeff

View GitHub Profile
import logging
from raven import Client
client = Client()
with level(logging.INFO):
client.captureMessage("Yo info")
with level(logging.DEBUG):
#!/usr/bin/python
# coding=utf-8
# Python version of Zach Holman's "spark"
# https://github.com/holman/spark
# by Stefan van der Walt <stefan@sun.ac.za>
"""
USAGE:
# 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:
@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
@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 = git@github.com: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:

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
from pyparsing import *
stack = {
"my_number": 4,
"my_list": []
}
script = \
"""
push 5 to my_list.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Salt returner that report error back to sentry
Pillar need something like:
deployment:
sentry_dsn: foobar
@SEJeff
SEJeff / init.sls
Created February 4, 2013 17:46 — forked from thekuffs/init.sls
mysql_dirs:
file:
- directory
- mode: 644
- makedirs: True
- names:
- /etc/mysql
- /data/mysql-data
- /data/cluster-data
- /data/cluster-data/backup
'pkg_repo.epel':
pkg.installed:
- name: 'epel-release'
- sources:
- 'epel-release': 'http://fedora-epel.mirror.lstn.net/6/i386/epel-release-6-7.noarch.rpm'