Skip to content

Instantly share code, notes, and snippets.

@jackyyf
jackyyf / test.go
Created May 12, 2015 13:49
Gist by paste.py @ 2015-05-12 21:49:40.178159
package main
import (
"fmt"
)
type X *X
func main() {
var x X
@jackyyf
jackyyf / B.cc
Created May 2, 2015 18:40
Gist by paste.py @ 2015-05-03 02:40:31.905979
#include <bits/stdc++.h>
using namespace std;
namespace Solve {
template<class T> inline bool _min(T& data, const T& comp) {
if (comp < data) {
comp = data;
return true;
@jackyyf
jackyyf / shadowsocks.conf
Created May 1, 2015 22:36
Gist by paste.py @ 2015-05-02 06:36:45.049549
[Definition]
_daemon = shadowsocks
failregex = ^\s+ERROR\s+can not parse header when handling connection from <HOST>:\d+$
@jackyyf
jackyyf / fix.py
Created April 23, 2015 04:20
Gist by paste.py @ 2015-04-23 12:20:25.228771
from PIL import Image
src_color = (231, 20, 26)
target_color = (0, 0, 0xFF)
im = Image.open('9_019.png')
w, h = im.size
for x in range(w):
@jackyyf
jackyyf / linode-jp.poll.py
Created April 13, 2015 18:03
Gist by paste.py @ 2015-04-14 02:03:01.503046
import requests
import time
import datetime
api_key = 'YOUR_APIKEY_HERE'
url = 'https://api.linode.com/?api_key=%s&api_action=linode.create&PlanID=1&DatacenterID=8&PaymentTerm=1' % api_key
sess = requests.Session()
@jackyyf
jackyyf / sysctl.conf
Created April 10, 2015 15:26
Gist by paste.py @ 2015-04-10 23:26:17.734757
#
# /etc/sysctl.conf - Configuration file for setting system variables
# See /etc/sysctl.d/ for additonal system variables
# See sysctl.conf (5) for information.
#
#kernel.domainname = example.com
# Uncomment the following to stop low-level messages on console
#kernel.printk = 3 4 1 3
@jackyyf
jackyyf / <stdin>
Created April 8, 2015 10:36
Gist by paste.py @ 2015-04-08 18:35:44.703008
Start: Wed Apr 8 18:35:44 2015
HOST: Eve-PC Loss% Snt Last Avg Best Wrst StDev
1.|-- 175.186.104.1 0.0% 100 1.8 6.5 1.7 68.6 12.3
2.|-- 10.250.1.29 0.0% 100 4.3 3.9 1.3 41.2 6.3
3.|-- 10.6.0.253 0.0% 100 1.6 5.3 1.3 91.8 13.8
4.|-- 140.207.196.1 0.0% 100 1.7 3.5 1.5 29.6 3.6
5.|-- 211.95.77.29 0.0% 100 20.5 10.4 4.1 44.9 8.8
6.|-- 140.207.207.201 0.0% 100 5.3 5.3 2.8 22.4 2.9
7.|-- 139.226.195.205 0.0% 100 3.7 5.3 3.2 18.8 2.7
8.|-- 139.226.193.33 63.0% 100 23.7 8.0 3.1 47.7 8.4
@jackyyf
jackyyf / bili.conf
Created March 28, 2015 01:58
Gist by paste.py @ 2015-03-28 09:58:19.416756
server {
listen 80;
server_name interface.bilibili.com;
root /usr/share/nginx/html;
index index.html index.htm;
resolver 114.114.114.114;
@jackyyf
jackyyf / fuck.py
Created March 16, 2015 14:56
Gist by paste.py @ 2015-03-16 22:56:36.717214
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
# Author: Yifu Yu <root@jackyyf.com>
import math
import re
import sys
deg2rad = lambda deg : deg / 180.0 * math.pi
@jackyyf
jackyyf / <stdin>
Created March 12, 2015 05:21
Gist by paste.py @ 2015-03-12 13:21:11.738603
HOST: misaka.eve.moe Loss% Snt Last Avg Best Wrst StDev
1.|-- 10.8.14.105 0.0% 50 1.3 1.3 1.1 1.5 0.1
2.|-- 10ge-1.04-c86.buf1.colocr 0.0% 50 0.9 1.0 0.6 4.9 0.6
3.|-- host.colocrossing.com 0.0% 50 0.5 3.3 0.4 36.5 8.8
4.|-- 207.86.156.45 0.0% 50 0.7 3.4 0.6 35.2 7.6
5.|-- 216.156.1.126.ptr.us.xo.n 0.0% 50 49.8 51.8 49.6 74.2 5.7
6.|-- 216.156.0.253.ptr.us.xo.n 0.0% 50 51.9 51.5 49.7 53.5 1.2
7.|-- 207.88.12.28.ptr.us.xo.ne 0.0% 50 49.6 53.1 49.4 83.0 9.8
8.|-- 207.88.12.175.ptr.us.xo.n 0.0% 50 52.4 52.2 49.4 88.4 6.7
9.|-- 207.88.12.89.ptr.us.xo.ne 0.0% 50 51.6 51.8 49.6 65.1 2.2