Skip to content

Instantly share code, notes, and snippets.

View chaeplin's full-sized avatar

chaeplin chaeplin

View GitHub Profile
UPSNAME UNIFIUPS
UPSCABLE usb
UPSTYPE usb
DEVICE
LOCKFILE /tmp
SCRIPTDIR /etc/apcupsd
PWRFAILDIR /etc/apcupsd
NOLOGINDIR /etc
ONBATTERYDELAY 6
BATTERYLEVEL 5
@chaeplin
chaeplin / Vagrantfile
Created September 7, 2017 14:28 — forked from evianzhow/Vagrantfile
Cross-compile Vagrant box for EdgeRouter
Vagrant.configure(2) do |config|
config.vm.box = "ubuntu/trusty64"
config.vm.provider "virtualbox" do |vb|
vb.memory = "1024"
end
config.vm.provision "shell", inline: <<-SHELL
@chaeplin
chaeplin / slack_webhook_post.py
Created August 20, 2017 15:42 — forked from devStepsize/slack_webhook_post.py
POST a JSON payload to a Slack Incoming Webhook using Python requests
'''
This is an example of how to send data to Slack webhooks in Python with the
requests module.
Detailed documentation of Slack Incoming Webhooks:
https://api.slack.com/incoming-webhooks
'''
import json
import requests
# /etc/init/nginx.conf - add this below the "respawn" line (line 7)
limit nofile 50000 50000
# /etc/sysctl.conf - add this to the bottom of the file
fs.file-max = 50000
net.core.somaxconn = 65536
net.ipv4.tcp_max_tw_buckets = 1440000
# /etc/security/limits.conf - add this to the bottom of the file
www-data soft nofile 50000
@chaeplin
chaeplin / nginx.conf
Created January 10, 2017 12:02 — forked from jrom/nginx.conf
nginx hack for multiple conditions
if ($request_uri = /) {
set $test A;
}
if ($host ~* teambox.com) {
set $test "${test}B";
}
if ($http_cookie !~* "auth_token") {
set $test "${test}C";
# bitcoin.py
#
# I, the copyright holder of this work, hereby release it into the public
# domain. This applies worldwide.
#
# If this is not legally possible:
# I grant any entity the right to use this work for any purpose, without any
# conditions, unless such conditions are required by law.
from tools import *
@chaeplin
chaeplin / keybase.md
Last active November 25, 2016 07:35
keybase.txt

Keybase proof

I hereby claim:

  • I am chaeplin on github.
  • I am chaeplin (https://keybase.io/chaeplin) on keybase.
  • I have a public key whose fingerprint is 0C27 188A E29B E816 DC06 8714 193C 7345 272C 3075

To claim this, I am signing this object:

@chaeplin
chaeplin / Highcharts Cheat Sheet
Created November 13, 2016 04:52 — forked from mulhoon/Highcharts Cheat Sheet
Highcharts Cheat Sheet
$('#container').highcharts({
chart: {
alignTicks: true, // When using multiple axis, the ticks of two or more opposite axes will automatically be aligned by adding ticks to the axis or axes with the least ticks.
animation: true, // Set the overall animation for all chart updating. Animation can be disabled throughout the chart by setting it to false here.
backgroundColor: '#FFF', // The background color or gradient for the outer chart area.
borderColor: '#4572A7', // The color of the outer chart border.
borderRadius: 5, // The corner radius of the outer chart border. In export, the radius defaults to 0. Defaults to 5.
borderWidth: 0, // The pixel width of the outer chart border.
className: null, // A CSS class name to apply to the charts container div, allowing unique CSS styling for each chart.
defaultSeriesType: 'line', // Alias of type.
@chaeplin
chaeplin / nginx.conf
Created August 20, 2016 17:25 — forked from oroce/nginx.conf
nginx config for using grafana, elasticsearch and graphite with authentication.
user www-data;
worker_processes 1;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
http {
sendfile on;
@chaeplin
chaeplin / nest.py
Last active July 13, 2016 12:56
nest.py
#!/usr/bin/env python2
# encoding: utf-8
import sys
import time
import httplib
import json
import re
url = "api.home.nest.com"