Skip to content

Instantly share code, notes, and snippets.

@tiancheng91
tiancheng91 / chromium
Created April 16, 2018 13:20 — forked from fujimakishouten/chromium
Chromium
#!/bin/sh
export GOOGLE_API_KEY="AIzaSyCkfPOPZXDKNn8hhgu3JrA62wIgC93d44k"
export GOOGLE_DEFAULT_CLIENT_ID="811574891467.apps.googleusercontent.com"
export GOOGLE_DEFAULT_CLIENT_SECRET="kdloedMFGdGla2P1zacGjAQh"
/usr/bin/chromium
# find location in server section
location / {
# add the following, to enable CORS
# CORS OPTIONS
if ($request_method = 'OPTIONS') {
add_header 'Access-Control-Allow-Origin' '*' always;
add_header 'Access-Control-Allow-Headers' 'Range' always;
add_header 'Access-Control-Allow-Methods' 'GET, HEAD, OPTIONS' always;
add_header 'Content-Length' 0;
@tiancheng91
tiancheng91 / ip
Last active April 2, 2018 05:13
缓存服务器
101.96.10.0/24 电信上海 101.96.10.63
SNI
60.13.74.0/24
101.95.144.0/24
101.96.10.0/24
101.96.11.0/24
103.15.187.0/24
106.3.129.0/24
111.11.80.0/24
@tiancheng91
tiancheng91 / tmp
Last active September 6, 2017 07:16
jshbank_tuniu_test
http://218.26.227.108:9081/paygate/main?MerInstId=114140999000321&UID=eUIe06n1QM3XSVVJNDfK+w==&MerchantDateTime=20170906103605&transName=JSEFZF&TransAmount=0.01&ChannelId=02&MerchantBackUrl=http://115.159.35.221/test2.php&BusyFlag=1&MerchantId=114140999000321&PayType=1&Plain=UID=eUIe06n1QM3XSVVJNDfK%252Bw%253D%253D%7CtransName=JSEFZF%7CChannelId=02%7CMerInstId=114140999000321%7CMerchantId=114140999000321%7CMerchantSeqNo=T1001504665365%7CMerchantDate=20170906%7CMerchantDateTime=20170906103605%7CTransAmount=0.01%7CMerchantBackUrl=http%253A%252F%252F115.159.35.221%252Ftest2.php%7CCurrency=156%7CBusyFlag=1%7CPayType=1&Currency=156&MerchantSeqNo=T1001504665365&Signature=o6L5cg3FLX8TAP93D9EsyFfTeDaYKl4MoS4tEqPrti+/irzqbwm6/wszKuygqSylM2Gt6PqKzkd5NJdjtFvJvGN4VKkQ3D7ae/qNv0dToAqE6GlHi/BCPFobDdL1KqESh/YJZr5xMofI9XqlGrzr79xS1uwIhc93ae8bIySfBH0=&MerchantDate=20170906
@tiancheng91
tiancheng91 / tun.conf
Created August 29, 2017 05:36
ice tun
stun:cn1-stun.wilddog.com:3478
stun:stunserver.org
stun:stun.ekiga.net
stun:stun.ideasip.com
stun.l.google.com:19302
@tiancheng91
tiancheng91 / loop ping
Last active November 15, 2017 07:47
bash
for i in {16..31..1}; do ping -c 1 -w 0.3 104.$i.1.1 | grep ttl; done
for i in {1..255..1}; do ping -c 1 -w 50 104.16.$i.1 | grep ttl; done // -w ms
for i in {1..255..1}; do ping -c 1 -w 0.3 104.17.$i.1 | grep ttl; done
for i in {1..255..1}; do ping -c 1 -w 0.3 104.18.$i.1 | grep ttl; done
for i in {1..255..1}; do ping -c 1 -w 0.3 104.19.$i.1 | grep ttl; done
for i in {1..255..1}; do ping -c 1 -w 0.3 104.20.$i.1 | grep ttl; done
for i in {64..72..1}; do ping -c 1 -w 0.3 172.$i.1.1 | grep ttl; done
for i in {1..255..1}; do ping -c 1 -w 0.3 172.64.$i.1 | grep ttl; done
for i in {1..255..1}; do ping -c 1 -w 0.3 172.65.$i.1 | grep ttl; done
@tiancheng91
tiancheng91 / base62.py
Created August 18, 2017 02:04 — forked from adyliu/base62.py
Base62 encode/decode tools (convert number to string)
#!/usr/bin/env python
#-*- coding:utf-8 -*-
# Base62 tools (convert number <=> string)
# v1.0/20130109
# python 2.x/3.x supported
#
#author: Ady Liu([email protected])
#github: github.com/adyliu
import sys
@tiancheng91
tiancheng91 / tel
Created August 17, 2017 08:26
public cache service
101.96.10.58
@tiancheng91
tiancheng91 / import_to_mongo.py
Created August 17, 2017 02:54
stackoverflow dumpfile import into mongo
# coding:utf-8
import time
import datetime
import re
import logging
import json
from xml.etree import ElementTree as etree
from pymongo import MongoClient
@tiancheng91
tiancheng91 / start-celery-for-dev.py
Created July 15, 2017 09:52 — forked from chenjianjx/start-celery-for-dev.py
A python script which starts celery worker and auto reload it when any code change happens.
'''
A python script which starts celery worker and auto reload it when any code change happens.
I did this because Celery worker's "--autoreload" option seems not working for a lot of people.
'''
import time
from watchdog.observers import Observer ##pip install watchdog
from watchdog.events import PatternMatchingEventHandler
import psutil ##pip install psutil
import os