Skip to content

Instantly share code, notes, and snippets.

View crankycoder's full-sized avatar

Victor Ng crankycoder

View GitHub Profile
@crankycoder
crankycoder / smartplug.py
Created June 8, 2016 21:46 — forked from arminwasicek/smartplug.py
Simple library/command-line-utility to control a EDIMAX Smart Plug Switch (SP-1101W) from Python
##
# The MIT License (MIT)
#
# Copyright (c) 2014 Stefan Wendler
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
@crankycoder
crankycoder / building-static-nginx.txt
Created May 26, 2016 01:36 — forked from rjeczalik/building-static-nginx.txt
Notes on building nginx as a static binary.
# Building static nginx for teh lulz
#
# basic dependencies
sudo apt-get install libxslt1-dev libxml2-dev zlib1g-dev libpcre3-dev libbz2-dev libssl-dev
# download nginx and openssl
wget http://nginx.org/download/nginx-1.5.6.tar.gz
tar xf nginx-1.5.6.tar.gz; cd nginx-1.5.6

Save books out of Safari Books Online

From http://objectivesea.tumblr.com/post/9033067018/safaribooks

This is hard. I spent way too much time figuring this out, because I was annoyed that a book I bought (Addison-Wesley) was available online for free, except only for 45 days after which payment was required. So I made this hack... probably useful to no one else, but here it is.

Requirements:

  1. iPad.
  2. Safari To Go (the Safari Books Online iPad app).
@crankycoder
crankycoder / gist:6181211
Last active December 20, 2015 19:09 — forked from surrealroad/gist:5146661
Digital Ocean Discourse production install with LAMP (using Apache)
#create & deploy lamp droplet
#login via ssh as root
#initial setup (ref: http://library.linode.com/getting-started#sph_logging-in-for-the-first-time)
# update /etc/hosts (to "thalassophobia.surrealroad.com")
nano /etc/hosts
#
@crankycoder
crankycoder / es.sh
Last active December 16, 2015 09:28
cd ~
sudo apt-get update
sudo apt-get install openjdk-7-jre-headless -y
### Check http://www.elasticsearch.org/download/ for latest version of ElasticSearch and replace wget link below
# NEW WAY / EASY WAY
wget https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-0.20.6.deb
sudo dpkg -i elasticsearch-0.20.6.deb
#!/bin/bash
# node.js using PPA (for statsd)
sudo apt-get install python-software-properties
sudo apt-add-repository ppa:chris-lea/node.js
sudo apt-get update
sudo apt-get install nodejs npm
# Install git to get statsd
sudo apt-get install git
@crankycoder
crankycoder / bash
Created April 9, 2012 16:51 — forked from haf/bash
Installing graphite Ubuntu 11.10
####################################
# BASIC REQUIREMENTS
# http://graphite.wikidot.com/installation
# http://geek.michaelgrace.org/2011/09/how-to-install-graphite-on-ubuntu/
# Last tested & updated 10/13/2011
####################################
sudo apt-get update
sudo apt-get upgrade
@crankycoder
crankycoder / README.rst
Created December 15, 2011 20:26 — forked from wolever/README.md
EMPMYMIP: Easily Maintain a PyPI Mirror of Your Important Packages!

EMPMYMIP: Easily Maintain a PyPI Mirror of Your Important Packages!

Status

EMPMYMIP seems to mostly kind of work for me. It might even do the same for you!

The implementation is kind of a huge hack, though, and it might very well

@crankycoder
crankycoder / install-pygtk.sh
Created December 7, 2011 14:29 — forked from ches/install-pygtk.sh
Install PyGTK via Homebrew and virtualenv
# This LOOKS pretty straightforward, but it took awhile to sort out issues with
# py2cairo and pygobject, so I hope I've saved you some time :-)
#
# This assumes you already subscribe to a nice clean virtualenvwrapper workflow
# -- see https://gist.github.com/771394 if you need advice on getting there.
# There are some optional dependencies omitted, so if you're going to be doing
# heavy development with these libs, you may want to look into them.
#
# We go to some configure option pains to avoid polluting the system-level
# Python, and `brew link`ing Cairo which is keg-only by default.
@crankycoder
crankycoder / python26.rb
Created November 23, 2011 15:48 — forked from gabesmed/python26.rb
Python 2.6.4 homebrew formula
require 'formula'
# This formula for Python 2.6.4
# Based on Python 2.7.1 formula at:
# https://github.com/mxcl/homebrew/blob/master/Library/Formula/python.rb
class Distribute < Formula
url 'http://pypi.python.org/packages/source/d/distribute/distribute-0.6.24.tar.gz'
md5 '17722b22141aba8235787f79800cc452'
end