Skip to content

Instantly share code, notes, and snippets.

View baijum's full-sized avatar
🏠
Working from home

Baiju Muthukadan baijum

🏠
Working from home
  • Red Hat
  • India
View GitHub Profile
@baijum
baijum / amazon_sender.py
Created November 5, 2011 06:39 — forked from amix/amazon_sender.py
Amazon SES helper script using boto
# -*- coding: utf-8 -*-
"""
amazon_sender.py
~~~~~~~~
Python helper class that can send emails using Amazon SES and boto.
The biggest feature of this class is that encodings are handled properly.
It can send both text and html emails.
This implementation is using Python's standard library (which opens up for a lot more options).
@baijum
baijum / python-pep8.el
Created April 12, 2012 09:25 — forked from ieure/python-pep8.el
Run pep8.py on Python source in Emacs.
;;; python-pep8.el --- minor mode for running `pep8'
;; Copyright (c) 2009, 2010 Ian Eure <ian.eure@gmail.com>
;; Author: Ian Eure <ian.eure@gmail.com>
;; Keywords: languages python
;; Last edit: 2010-02-12
;; Version: 1.01
@baijum
baijum / module.sls
Created June 12, 2012 04:22 — forked from anonymous/module.sls
Apache module macro for salt
{% macro a2mod(module, enabled=true) -%}
{% if enabled %}
a2enmod {{ module }}:
cmd:
- run
- unless: test -L /etc/apache2/mods-enabled/{{ module }}.load
- require:
- pkg: apache2
- watch_in:
- service: apache2
@baijum
baijum / gist:3025019
Created June 30, 2012 18:41
Salt Development Environment
## Get OS/build dependancies
$ sudo apt-get install python2.7-dev build-essential libtool autoconf automake swig uuid-dev python-m2crypto
## Download 0MQ
$ wget http://download.zeromq.org/zeromq-2.2.0.tar.gz
## Unpack
$ tar -xvzf zeromq-2.2.0.tar.gz
## CD into dir
@baijum
baijum / redis.markdown
Created November 2, 2012 04:40 — forked from brow/redis.markdown
Running redis using upstart on Ubuntu

Running redis using upstart on Ubuntu

I've been trying to understand how to setup systems from the ground up on Ubuntu. I just installed redis onto the box and here's how I did it and some things to look out for.

To install:

##############################################################################
#
# Copyright (c) 2012 Zope Foundation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
@baijum
baijum / gitrpm.py
Created November 11, 2013 15:49 — forked from jimfulton/gitrpm.py
#!/opt/cleanpython26/bin/python
"""usage: %prog options
Automate tagging and buildoing rpms from hg python projects.
You need to run this on a centos machine.
This probably wants to be a recipe to automatically pull in
buildout-siyrce release. Or maybe this shouldn't involve source
releases.

Description

This simple script will take a picture of a whiteboard and use parts of the ImageMagick library with sane defaults to clean it up tremendously.

The script is here:

#!/bin/bash
convert $1 -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 $2

Results

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name:

// packageList returns the list of packages in the dag rooted at roots
// as visited in a depth-first post-order traversal.
func packageList(roots []*Package) []*Package {
seen := map[*Package]bool{}
all := []*Package{}
var walk func(*Package)
walk = func(p *Package) {
if seen[p] {
return