This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import restkit | |
import simplejson | |
YQL_URL = ('http://query.yahooapis.com', '/v1/public/yql') | |
value = '11215' | |
pmr = restkit.Resource(YQL_URL[0]) | |
query = 'SELECT * FROM geo.places WHERE text = "%s"' | |
qs = value.replace(r'"', r'\"') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
""" | |
Boilerplate Nagios check script. | |
""" | |
import os, os.path, sys, getopt, datetime | |
import yaml | |
nagios_codes = {'OK': 0, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
import os.path, datetime, sys | |
import termcolor | |
datfile = "/opt/local/var/nagios/status.dat" | |
def main(infile): | |
if os.path.exists(datfile) == False: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export VIRTUAL_ENV_DISABLE_PROMPT=1 | |
function parse_svn_branch { | |
if [ -d '.svn' ]; then | |
ref=$(svn info | grep URL | awk -F/ '{print $NF}' 2> /dev/null) || return | |
cur=$(pwd | awk -F/ '{print $NF}' 2> /dev/null) || return | |
if [ $ref != $cur ]; then | |
echo -ne "\xE2\x9C\xB6${ref}" | |
fi | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function($) { | |
var settings; | |
var methods = { | |
init: function(options){ | |
// Create some defaults, extending them with any options that were provided | |
settings = $.extend({ | |
}, options); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
df | awk 'BEGIN { FS = " +" } { print $5}' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# | |
# Called by "git commit" with the name of the file that has the | |
# commit message, followed by the description of the commit | |
# message's source. The hook's purpose is to edit the commit | |
# message file. If the hook fails with a non-zero status, | |
# the commit is aborted. | |
# This hook will append the current branch name to | |
# the commit message if it's not already there. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/sh | |
PATH=/sbin:/bin:/usr/sbin:/usr/bin | |
DAEMON=/opt/fubot/bin/hubot | |
NAME=fubot | |
DESC="Jabber Bot" | |
CONF="-a xmpp --name $NAME" | |
BOT_USER=fubot | |
BOT_GROUP=fubot |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
V = IR | |
R = V/I | |
I = V/R | |
3V / 1.4A = 2.142857142857143 ohms | |
5V / 1.4A = 3.571428571428571ohms | |
1.428571428571429 ohm resistor |