Skip to content

Instantly share code, notes, and snippets.

@tomoconnor
tomoconnor / miner.py
Last active August 29, 2015 13:57
Unicoin Miner script
# REPLACE YOUR FKEY value. You need to load a stack site, view the source, Ctrl-F and find your fkey, then put it into the command line as argv[1].
# so run it as python miner.py <your fkey>
# It also relies on Google Chrome's cookie lib to find the auth cookies.
import requests
import sqlite3
import os
from urlparse import urlparse
# fattener.py
import sys
import os
import envoy
import json
resolved = {}
def resolve_dependencies(gem_name):
@tomoconnor
tomoconnor / cisco_backup_running_config
Created September 3, 2013 15:30
Neat little script I wrote to copy the running-config from a Cisco router using SNMP and TFTP
#!/bin/bash
##### You will need the CISCO-CONFIG-COPY-MIB File from ftp://ftp.cisco.com/pub/mibs/v2/CISCO-CONFIG-COPY-MIB.my #####
##### You will also need to set the value of TFTP_IP
export MIBDIRS=~/mibs
echo $MIBDIRS
export MIBS=CISCO-CONFIG-COPY-MIB
export IPADDR=$1
export HOSTNAME=$2
export COMMUNITY=$3
#applications/mod_abstraction
#applications/mod_avmd
#applications/mod_blacklist
#applications/mod_callcenter
#applications/mod_cidlookup
#applications/mod_cluechoo
applications/mod_commands
applications/mod_conference
#applications/mod_curl
applications/mod_db
// ==UserScript==
// @name t.co securifier
// @version 0.2
// @description replace t.co link with https variant
// @match https://twitter.com/*
// @copyright 2013, Tom O'Connor
// ==/UserScript==
// a function that loads jQuery and calls a callback function when jQuery has finished loading
function addJQuery(callback) {
var script = document.createElement("script");
@tomoconnor
tomoconnor / jenkins-site-check.sh
Created November 12, 2012 18:27
Simple way to check a site's availability from jenkins jobs
URL="http://tomoconnor.eu"
HTTP_STATUS=$(curl -o /dev/null -s -if --write-out "%{http_code}\n" $URL)
if [ $HTTP_STATUS -ne 200 ]; then `which false`; else `which true`; fi
"""
jQuery templates use constructs like:
{{if condition}} print something{{/if}}
This, of course, completely screws up Django templates,
because Django thinks {{ and }} mean something.
Wrap {% verbatim %} and {% endverbatim %} around those
blocks of jQuery templates and this will try its best
@tomoconnor
tomoconnor / uri.js
Created October 9, 2012 22:05 — forked from jlong/uri.js
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"
@tomoconnor
tomoconnor / gist:2413446
Created April 18, 2012 13:07
Puppeting Pip Python Packages.
exec {"/usr/bin/pip install lxml":
unless => "python -c import lxml",
require => Package['python-pip'],
}
@tomoconnor
tomoconnor / wdaemon.conf
Created April 2, 2012 16:06
wdaemon.conf
#wdaemon upstart script
description "Wdaemon for Wacom"
start on runlevel [2345]
respawn
expect fork
pre-start exec modprobe uinput
exec /usr/local/bin/wdaemon -s -c /etc/wdaemon.conf -f