This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* The MIT License (MIT) | |
* | |
* Copyright (c) 2015 Circle Internet Financial | |
* | |
* 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/bash | |
DIR=/path/to/www/public | |
DATA=/path/to/pms5003.rrd | |
TIME=$1 | |
time=$(date '+%H\:%M\:%S') | |
rrdtool graph $DIR/pm-$TIME.svg \ | |
--imgformat SVG \ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// origin: @ayanamist | |
// ==UserScript== | |
// @name Twitter Keyword Filter | |
// @namespace Twitter-Timeline-URL-Expand | |
// @description Replace t.co href of A tag with real url. | |
// @match https://twitter.com/ | |
// @version 1.1 | |
// ==/UserScript== | |
(function (window) { | |
var document = window.document; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server { | |
server_name example.com; | |
charset utf-8; | |
location ~ "/t/([^/]+)(/[^/]+)?$" { | |
alias /srv/http/paste/data/$1; | |
gunzip on; | |
gzip_static always; | |
default_type text/plain; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name 缺B乐 | |
// @namespace org.sorz.lab.queble | |
// @include http://www.acfun.tv/* | |
// @version 1 | |
// @grant none | |
// ==/UserScript== | |
String.prototype.correct = function () { | |
return this.toString() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"host": "password", | |
"sorz": "hWUVw79k" | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Modified from | |
# http://en.wikiversity.org/wiki/Reed–Solomon_codes_for_coders | |
gf_exp = [0] * 65536 * 2 # Create list of 65536 elements. In Python 2.6+, consider using bytearray | |
gf_log = [0] * 65536 | |
gf_exp[0] = 1 | |
x = 1 | |
for i in range(1, 65535): | |
x <<= 1 | |
if x & 0x10000: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
DHT22.cpp - Library for DHT22/DHT11 relative humidity & temperature sensor. | |
Created by Sorz. 2014-07-18. | |
*/ | |
#include "Arduino.h" | |
#include "DHT22.h" | |
TempHumiSensor::TempHumiSensor(int pin) | |
{ | |
pinMode(pin, INPUT_PULLUP); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# fail2ban filter configuration for Shadowsocks (python). | |
[Definition] | |
failregex = can not parse header when handling connection from <HOST>:\d{1,5}$ | |
ignoreregex = |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
PPP_IFACE="$1" | |
PPP_TTY="$2" | |
PPP_SPEED="$3" | |
PPP_LOCAL="$4" | |
PPP_REMOTE="$5" | |
PPP_IPPARAM="$6" | |
if [ "$PPP_IFACE" = "ppp0" ] |