Skip to content

Instantly share code, notes, and snippets.

Victor Ng crankycoder

Block or report user

Report or block crankycoder

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
Run this with:
env flask run
|'.._ __......._ _.-'.
\M\ ^'.-' ''-/ /
View gist:64566d8c6de1243890c85ba80eb96c0e
-bash-4.2$ pytest
========================================= test session starts ==========================================
platform linux2 -- Python 2.7.12, pytest-3.2.3, py-1.4.34, pluggy-0.4.0
rootdir: /home/hadoop/taar, inifile:
plugins: cov-2.5.1
collected 24 items .... ... ....
crankycoder /
Created Jun 8, 2016 — forked from arminwasicek/
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 / building-static-nginx.txt
Created May 26, 2016 — forked from rjeczalik/building-static-nginx.txt
Notes on building nginx as a static binary.
View building-static-nginx.txt
# 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
tar xf nginx-1.5.6.tar.gz; cd nginx-1.5.6
crankycoder / gist:34d11a9f8202a10f3adb
Created Oct 1, 2014
Bootstrap Ubuntu 14.04 into a workable MozStumbler buildbox
View gist:34d11a9f8202a10f3adb
sudo apt-get -qqy update
sudo apt-get install -y unzip git make openjdk-7-jdk
# Everybody loves that android needs x86 stuff
sudo dpkg --add-architecture i386
sudo apt-get -qqy install libncurses5:i386 libstdc++6:i386 zlib1g:i386

Save books out of Safari Books Online


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.


  1. iPad.
  2. Safari To Go (the Safari Books Online iPad app).
View gist:7606731
-- This Source Code Form is subject to the terms of the Mozilla Public
-- License, v. 2.0. If a copy of the MPL was not distributed with this
-- file, You can obtain one at
-- Original grok filters
-- POSINT \b(?:[0-9]+)\b
-- HOUR (?:2[0123]|[01][0-9])
-- MINUTE (?:[0-5][0-9])
-- SECOND (?:(?:[0-5][0-9]|60)(?:[.,][0-9]+)?)
crankycoder / gist:7606676
Created Nov 22, 2013
TOML config to debug syslog over UDP problems
View gist:7606676
address = ""
parser_type = "packet"
decoder = "syslog_sandbox"
type = "SandboxDecoder"
script_type = "lua"
filename = "/tmp/syslog_decoder.lua"
timestamp_field = "syslog_ts"
crankycoder / gist:7606664
Created Nov 22, 2013 example
View gist:7606664
import socket
import time
'kern': 0, 'user': 1, 'mail': 2, 'daemon': 3,
'auth': 4, 'syslog': 5, 'lpr': 6, 'news': 7,
'uucp': 8, 'cron': 9, 'authpriv': 10, 'ftp': 11,
'local0': 16, 'local1': 17, 'local2': 18, 'local3': 19,
crankycoder / gist:6302667
Last active Dec 21, 2015
Ubuntu Discourse install docs
View gist:6302667

Official Discourse Install Guide

Recommended Server Hardware

  • 2 GB of RAM
  • 2 GB of swap
  • 2 processor cores

With 2 GB of memory and dual cores, you can run two instances of the thin server (NUM_WEBS=2), and easily host anything but the largest of forums.

You can’t perform that action at this time.