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
# setup virtualenvwrapper | |
export WORKON_HOME=~/.envs | |
mkdir -p $WORKON_HOME | |
source /usr/local/bin/virtualenvwrapper.sh |
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
* POST - create a new log item with the POSTed data. The response | |
will include a status_code, status_message and the ID of the | |
newly created log item (if one was successfully created). | |
Request must contain a valid bot key along with enough information | |
to construct a valid log item. | |
* DELETE - delete the given log item. Must include the item ID number | |
or enough information to uniquely identify the item (see GET | |
below). |
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
''' | |
Phenny module to make Phenny fetch the highest scoring HN article and post | |
it for discussion. | |
''' | |
import os, urllib, json | |
from datetime import datetime as dt | |
LOG_PATH = '.' |
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
# Generated by iptables-save v1.4.4 on Fri Jun 18 01:22:38 2010 | |
*filter | |
# WHAT THE FUCK DO THE NEXT THREE LINES DO? | |
:INPUT DROP [0:0] | |
:FORWARD ACCEPT [0:0] | |
:OUTPUT ACCEPT [27:2732] | |
-A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT | |
-A INPUT -i lo -j ACCEPT |
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
// Mutifunctional method to get and set values to a collection | |
// The value/s can optionally be executed if it's a function | |
access: function( elems, key, value, exec, fn, pass ) { | |
var length = elems.length; | |
// Setting many attributes | |
if ( typeof key === "object" ) { | |
for ( var k in key ) { | |
jQuery.access( elems, k, key[k], exec, fn, value ); | |
} |
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
attr: function( elem, name, value, pass ) { | |
var nType = elem.nodeType; | |
// don't get/set attributes on text, comment and attribute nodes | |
if ( !elem || nType === 3 || nType === 8 || nType === 2 ) { | |
return undefined; | |
} | |
if ( pass && name in jQuery.attrFn ) { | |
return jQuery( elem )[ name ]( value ); |
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
var forward = function($c) { | |
var t = window.setTimeout(function() { | |
if ($c.data('running')) { | |
goForward.call($c); | |
} | |
forward($c); | |
}, settings.delay); | |
} | |
forward($container); |
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
'******************************************************************************* | |
' software.vbs | |
' Create a list of software installed on one or more | |
' machines in TSV format. | |
' | |
' Usage: cscript.exe software.vbs [/path:<path>] [machine names] | |
' | |
' If <path> is given, the script will attempt to store logs | |
' in that location. It is treated as a relative path and must | |
' end in a backslash. |
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
mysql> SELECT c.computer_name, a.application_name, a.application_version, i.audit_date FROM installations i INNER JOIN computers c ON i.computer_id=c.computer_id INNER JOIN applications a ON i.application_id=a.application_id WHERE c.computer_name="computer01" ORDER BY c.computer_name, a.application_name, i.audit_date; | |
+---------------+-----------------------+---------------------+------------+ | |
| computer_name | application_name | application_version | audit_date | | |
+---------------+-----------------------+---------------------+------------+ | |
| computer01 | Adobe Acrobat Reader | 8.1.4 | 2011-11-09 | | |
| computer01 | Adobe Acrobat Reader | 8.1.4 | 2011-11-10 | | |
| computer01 | Microsoft Office 2007 | 12.0.1 | 2011-11-09 | | |
| computer01 | Microsoft Office 2007 | 12.0.1 | 2011-11-10 | | |
| computer01 | Mozilla Firefox | 5.0 | 2011-11-09 | | |
| computer01 | Mozilla Firefox | 7.0 | 2011-11-10 | |
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
def post(self, computer_name): | |
computer = self._get_computer(computer_name) | |
data = json.loads(self.request.body) | |
for application in data['applications']: | |
result = self.database.query( | |
''' | |
INSERT INTO applications ( | |
application_name, |
OlderNewer