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 | |
# https://gist.github.com/gists/1007083 | |
# Donate: 1BdWJEUCkm6on231iX2ThXZHXZDfQny69R | |
from __future__ import division | |
import json | |
import urllib2 | |
from smtplib import SMTP | |
from email.mime.text import MIMEText | |
from cStringIO import StringIO | |
from pprint import pprint |
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 get_gist_url($id) { | |
$data = file_get_contents("https://gist.github.com/$id"); | |
$pos1 = strpos($data, "/raw/$id"); | |
$pos2 = strpos($data, "\"", $pos1); | |
$url = substr($data, $pos1, $pos2-$pos1); | |
return "https://gist.github.com$url"; | |
} | |
$url = get_gist_url($_GET["id"]); | |
ob_start('ob_gzhandler'); |
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
--- VirtualBox-4.0.8_OSE/src/VBox/Main/src-server/xpcom/server.cpp 2011-05-16 12:33:47.000000000 -0400 | |
+++ VirtualBox-4.0.8_OSE.fix/src/VBox/Main/src-server/xpcom/server.cpp 2011-05-18 18:01:04.784596001 -0400 | |
@@ -712,15 +712,23 @@ | |
} | |
} | |
-static nsresult vboxsvcSpawnDaemonByReExec(const char *pszPath) | |
+static nsresult vboxsvcSpawnDaemonByReExec(const char *pszPath, bool bAutoShutdown, const char *pszPidFile) | |
{ | |
PRFileDesc *readable = nsnull, *writable = nsnull; |
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/bash | |
BIND=/tmp/php-fcgi.sock | |
USER=frozen | |
PHP_FCGI_CHILDREN=10 | |
PHP_FCGI_MAX_REQUESTS=300 | |
PHP_CGI=/usr/bin/php-cgi | |
PHP_CGI_NAME=$(basename $PHP_CGI) | |
PHP_CGI_ARGS="- USER=$USER PATH=/usr/bin PHP_FCGI_CHILDREN=$PHP_FCGI_CHILDREN PHP_FCGI_MAX_REQUESTS=$PHP_FCGI_MAX_REQUESTS $PHP_CGI -b $BIND" | |
RETVAL=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
#!/bin/bash | |
BTC_PATH=$1 | |
REMOTE_URL=http://bitcoincharts.com/t/weighted_prices.json | |
wget -q -O $BTC_PATH.temp $REMOTE_URL | |
test $? -ne 0 && exit | |
test ! -e $BTC_PATH.temp && exit | |
test $(stat -c%s $BTC_PATH.temp) -lt 600 && exit | |
mv $BTC_PATH{.temp,} |
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
dateTimeFormat: gregorian | |
events: | |
- title: Jamestown founded | |
start: May 14 1607 | |
- title: Mayflower Compact | |
start: Nov 11 1620 | |
- title: English Civil War | |
start: 1642 |
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
"""This plugin provides test timings to identify which tests might be | |
taking the most. From this information, it might be useful to couple | |
individual tests nose's `--with-profile` option to profile problematic | |
tests. | |
This plugin is heavily influenced by nose's `xunit` plugin. | |
Add this command to the way you execute nose:: | |
--with-test-timer |
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
> pip uninstall pyyaml | |
Exception: | |
Traceback (most recent call last): | |
File "/home/kyle/testenv/lib/python2.6/site-packages/pip-1.1-py2.6.egg/pip/basecommand.py", line 104, in main | |
status = self.run(options, args) | |
File "/home/kyle/testenv/lib/python2.6/site-packages/pip-1.1-py2.6.egg/pip/commands/uninstall.py", line 41, in run | |
requirement_set.uninstall(auto_confirm=options.yes) | |
File "/home/kyle/testenv/lib/python2.6/site-packages/pip-1.1-py2.6.egg/pip/req.py", line 862, in uninstall | |
req.uninstall(auto_confirm=auto_confirm) | |
File "/home/kyle/testenv/lib/python2.6/site-packages/pip-1.1-py2.6.egg/pip/req.py", line 461, in uninstall |
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 pyev | |
def run_every_5_seconds(watcher, revents): | |
print 'foo' | |
loop = pyev.default_loop() | |
run_every_5_seconds_loop = loop.timer(0, 5, run_every_5_seconds) | |
run_every_5_seconds_loop.start() | |
loop.start() |
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 pyev | |
class FiveSecondTimer(object): | |
def __init__(self, data): | |
self.data = data | |
def __call__(self, watch, revents): | |
print 'foo', data | |
loop = pyev.default_loop() |