Skip to content

Instantly share code, notes, and snippets.

View 1stvamp's full-sized avatar
:shipit:

Wes Mason 1stvamp

:shipit:
View GitHub Profile
@bloodearnest
bloodearnest / md5_check.py
Created August 4, 2014 16:32
md5_check.py
import os
import hashlib
class FilterModule(object):
def filters(self):
return {
'md5_check': self.md5_check,
}
wavy@shredder:~/canonical/dev/sso$ cat ~/bin/juju-sync-charm
#!/bin/bash
if [ -z "$1" ]
then
echo "You must provide a unit name" >&2
exit 1
fi
UNIT=$1
DIR=${2:-.}
@benatkin
benatkin / fabfile.py
Last active March 16, 2017 18:01
mining dogecoin in the cloud
from fabric.api import env, task, run, sudo, cd, local
from fabric.decorators import with_settings
from fabric.operations import put
env.user = 'ec2-user'
env.hosts = [
'ec2-your-address-1.us-west-2.compute.amazonaws.com',
'ec2-your-address-2.us-west-2.compute.amazonaws.com',
'ec2-your-address-3.us-west-2.compute.amazonaws.com',
'ec2-your-address-4.us-west-2.compute.amazonaws.com',
@rxaviers
rxaviers / gist:7360908
Last active May 6, 2024 11:18
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
@1stvamp
1stvamp / bootstrap.py
Last active December 12, 2015 10:49
zc.buildout 1.x bootstrap that uses the version of zc.buildout from your buildout.cfg, if set
##############################################################################
#
# Copyright (c) 2006 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
@1stvamp
1stvamp / gplus_unf.css
Last active October 13, 2015 13:27
User stylesheet to make Google+ UI usable again by removing excess dross
div.Nj.mu.a-f-e.bR > div.ZNa.aS
{
display: none;
}
div[componentid="13"], div[componentid="4"], div[componentid="14"], div[componentid="34"], div[componentid="33"], div[componentid="56"], div[componentid="6"], div[componentid="5"], div[componentid="7"], div[componentid="76"],
div[componentid="81"]
{
display: none;
}
@rgreenjr
rgreenjr / postgres_queries_and_commands.sql
Last active May 6, 2024 12:37
Useful PostgreSQL Queries and Commands
-- show running queries (pre 9.2)
SELECT procpid, age(clock_timestamp(), query_start), usename, current_query
FROM pg_stat_activity
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%'
ORDER BY query_start desc;
-- show running queries (9.2)
SELECT pid, age(clock_timestamp(), query_start), usename, query
FROM pg_stat_activity
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%'
@jlong
jlong / uri.js
Created April 20, 2012 13:29
URI Parsing with Javascript
var parser = document.createElement('a');
parser.href = "http://example.com:3000/pathname/?search=test#hash";
parser.protocol; // => "http:"
parser.hostname; // => "example.com"
parser.port; // => "3000"
parser.pathname; // => "/pathname/"
parser.search; // => "?search=test"
parser.hash; // => "#hash"
parser.host; // => "example.com:3000"
@chooper
chooper / statsd_instrument.py
Created March 11, 2012 22:04
Decorator to quickly add statsd (graphite) instrumentation to Celery task functions.
"""Decorator to quickly add statsd (graphite) instrumentation to Celery
task functions.
With some slight modification, this could be used to instrument just
about any (non-celery) function and be made abstract enough to customize
metric names, etc.
Stats reported include number of times the task was accepted by a worker
(`started`), the number of successes, and the number of times the task
raised an exception. In addition, it also reports how long the task took
@wayhome
wayhome / tornado_patch.py
Created August 5, 2011 05:00
profile patch for tornado
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Monkey Patch for tornado
"""
import cProfile as profile
from tornado.options import options
from tornado.web import HTTPError