Skip to content

Instantly share code, notes, and snippets.

@pkuphy
pkuphy / fanfou.py
Created June 21, 2013 14:51 — forked from zhasm/fanfou.py
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
#author: rex
#blog: http://iregex.org
#filename test.py
#created: 2010-12-18 22:42
import re
import pycurl
import json
@pkuphy
pkuphy / dabblet.css
Created September 16, 2014 10:53
The first commented line is your dabblet’s title
/**
* The first commented line is your dabblet’s title
*/
body {
background: #f06;
background: linear-gradient(45deg, #f06, yellow);
min-height: 100%;
}
.tri {

##RPM Packages##

sudo yum install qt-devel protobuff-devel qrencode-devel

##Switch to user bitcoind##

sudo useradd bitcoind
sudo su - bitcoind
mkdir bitcoind

mkdir bitcoind/deps

@pkuphy
pkuphy / Server configuration.md
Last active June 19, 2016 08:58
Things to do after launching a new server

服务器基础环境配置

1. 配置 ssh 登陆

服务器端

此时我们的初始条件是以 root 身份登陆到了远程服务器,远程服务器地址是 server_ip。 接下来要配置的是禁止以 root 身份登陆,并改变 ssh 服务的端口号。

  1. 新建用户 insight 并将其添加到 sudo 用户组
@pkuphy
pkuphy / flask-cookie.py
Created March 19, 2015 04:41
Set cookie
#!flask/bin/python
from flask import Flask, jsonify, abort, request, make_response, url_for
from flask.ext.httpauth import HTTPBasicAuth
app = Flask(__name__, static_url_path = "")
auth = HTTPBasicAuth()
@auth.get_password
def get_password(username):
if username == 'miguel':
@pkuphy
pkuphy / gist:4d463f14dbecd35ceef5
Created October 10, 2015 11:13 — forked from tonymtz/gist:d75101d9bdf764c890ef
Uninstall nodejs from OSX Yosemite
# First:
lsbom -f -l -s -pf /var/db/receipts/org.nodejs.pkg.bom | while read f; do sudo rm /usr/local/${f}; done
sudo rm -rf /usr/local/lib/node /usr/local/lib/node_modules /var/db/receipts/org.nodejs.*
# To recap, the best way (I've found) to completely uninstall node + npm is to do the following:
#go to /usr/local/lib and delete any node and node_modules
cd /usr/local/lib
sudo rm -rf node*
@pkuphy
pkuphy / surge_main.conf
Created October 26, 2015 04:46 — forked from jason5ng32/surge.conf
Surge Configs
// DON'T FORGET TO IMPORT proxy.conf TOO
[General]
loglevel = notify
skip-proxy = 192.168.0.0/16, 10.0.0.0/8, 172.16.0.0/12,127.0.0.0/24
bypass-tun = 192.168.0.0/16, 10.0.0.0/8, 172.16.0.0/12,127.0.0.0/24
// DNS OVERRIDE, REMOVE # IF YOU NEED
# dns-server = 223.6.6.6,223.5.5.5,114.114.114.114,114.114.115.115
@pkuphy
pkuphy / gist:7c99af3b24be447688e0
Created March 22, 2016 09:51
微信测试号验证服务器
# encoding: utf-8
from flask import Flask, request
app = Flask(__name__)
@app.route('/config')
def config():
echostr = request.args.get('echostr')
return echostr
@pkuphy
pkuphy / gist:ef2f3f2eec11c8800af4
Created March 22, 2016 09:52
nginx 反向代理配置
server {
listen 80;
server_name a.fasdasdfc.com;
location / {
proxy_pass http://localhost:8888;
proxy_next_upstream error timeout invalid_header http_500 http_502 http_503;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;