Skip to content

Instantly share code, notes, and snippets.

Avatar

chaeplin chaeplin

  • South Korea
View GitHub Profile
@chaeplin
chaeplin / netpps.sh
Created Sep 12, 2017 — forked from joemiller/netpps.sh
shell: quick linux scripts for showing network bandwidth or packets-per-second
View netpps.sh
#!/bin/bash
if [ -z "$1" ]; then
echo
echo usage: $0 network-interface
echo
echo e.g. $0 eth0
echo
echo shows packets-per-second
@chaeplin
chaeplin / io.adafruit.com-bridge.conf
Created Sep 7, 2017 — forked from tdack/io.adafruit.com-bridge.conf
Bridge Mosquitto MQTT broker to io.adafruit.com MQTT broker to use with io.adafruit.com
View io.adafruit.com-bridge.conf
# Connection name
connection adafruit
# Secure SSL/TLS
address io.adafruit.com:8883
# adjust path as approriate to point to directory with PEM encoded .crt CA files
bridge_capath /etc/ssl/certs/
# Insecure
#address io.adafruit.com:1883
@chaeplin
chaeplin / Vagrantfile
Created Sep 7, 2017 — forked from EvianZhow/Vagrantfile
Cross-compile Vagrant box for EdgeRouter
View Vagrantfile
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 Aug 20, 2017 — forked from devStepsize/slack_webhook_post.py
POST a JSON payload to a Slack Incoming Webhook using Python requests
View slack_webhook_post.py
'''
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
View Nginx C10K Configuration
# /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 / installation.md
Created Mar 1, 2017 — forked from guillaumevincent/installation.md
A simple guide to install PyQt5 on Mac OS X 10.9 (Maverick) and use python 3.4 on a virtualenv.
View installation.md

Guide to install PyQt5 on Mac OS X with python 3.4 virtualenv

Description

A simple guide to install PyQt5 on Mac OS X 10.9 (Maverick) and use python 3.4 on a virtualenv.

Requirements

  • xcode 5.1.1
  • python 3.4.0
  • Qt libraries 5.2.1
View mcsentinel.py
#!/usr/bin/env python
import os
import sys
import math
import random
NSECONDS = 5*3600
NNODES = 4000
@chaeplin
chaeplin / Documentation.md
Created Feb 7, 2017 — forked from KartikTalwar/Documentation.md
Rsync over SSH - (40MB/s over 1GB NICs)
View Documentation.md

The fastest remote directory rsync over ssh archival I can muster (40MB/s over 1gb NICs)

This creates an archive that does the following:

rsync (Everyone seems to like -z, but it is much slower for me)

  • a: archive mode - rescursive, preserves owner, preserves permissions, preserves modification times, preserves group, copies symlinks as symlinks, preserves device files.
  • H: preserves hard-links
  • A: preserves ACLs
@chaeplin
chaeplin / nginx.conf
Created Jan 10, 2017 — forked from jrom/nginx.conf
nginx hack for multiple conditions
View nginx.conf
if ($request_uri = /) {
set $test A;
}
if ($host ~* teambox.com) {
set $test "${test}B";
}
if ($http_cookie !~* "auth_token") {
set $test "${test}C";
View bitcoin.py
# 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 *
You can’t perform that action at this time.