Skip to content

Instantly share code, notes, and snippets.

View binderclip's full-sized avatar
👨‍💻
build

clip binderclip

👨‍💻
build
  • Beijing
View GitHub Profile
@binderclip
binderclip / check_if_file_utf_8.py
Created May 11, 2016 14:52
simple python script check if file utf-8 coding
import sys
def main():
if len(sys.argv) < 2:
print 'please enter file path'
file_path = sys.argv[1]
with open(file_path, 'r') as f:
s = f.read()
try:
@binderclip
binderclip / set-mac-proxy-by-shell.md
Created April 12, 2016 06:11
Set Mac Proxy By Shell

设置 DNS 的脚本:

#!/bin/bash
# This script sets the Wi-Fi DNS to Aliyun DNS
sudo networksetup -setdnsservers Wi-Fi 223.5.5.5 223.6.6.6

设置为空:

@binderclip
binderclip / bluetooth-messy-notes.md
Created April 4, 2016 08:29
蓝牙原理的了解(杂乱的笔记)

是有看一本专门介绍蓝牙的书,看过之后对蓝牙基本的东西有了一些了解,就能轻松的知道它能干什么不能干什么,适合干什么,不适合干什么。

  • client
  • server

initiates a connection

outgoing choose a target device transport protocol

@binderclip
binderclip / change-theme-for-quiver.md
Created April 4, 2016 08:18
给 Quiver 换主题
@binderclip
binderclip / hello_basic_auth.py
Created January 25, 2016 07:24
basic auth demo - with flask
# coding: utf-8
from functools import wraps
from flask import request, Response, Flask
def check_auth(username, password):
"""This function is called to check if a username /
password combination is valid.
"""
<?xml version="1.0" encoding="ISO-8859-1" ?>
<rss version="2.0">
<channel>
<title>w3cschool Home Page</title>
<link>http://www.w3cschool.cc</link>
<description>Free web building tutorials</description>
<item>
<title>RSS Tutorial</title>
<link>http://www.w3cschool.cc/rss</link>
@binderclip
binderclip / hello_http_proxy.py
Created December 23, 2015 06:59
写一个简单的 HTTP 代理服务器
#!/usr/bin/env python
# coding: utf-8
import socket
import sys
from thread import *
try:
listening_port = int(raw_input("[*] Enter Listening Port Number: "))
except KeyboardInterrupt:
print("\n[*] User Requested An Interrupt")
@binderclip
binderclip / arduino_car.ino
Last active April 4, 2016 09:01
Arduino WiFi 小车
int led = 13;
int m1a = 5;
int m1b = 6;
int m2a = 10;
int m2b = 11;
int s1q = 220;
int s1s = 150;
int s2q = 220;
@binderclip
binderclip / catch-https.md
Last active September 20, 2018 10:05
使用 Charles 做一些抓包工作

HTTPS 抓包

普通的 HTTPS 抓包配置

一般的公开的网站用这种方式就好了。

  1. 首先装上 Charles 的根证书    1. 电脑的话:Help -> SSL Proxying -> Install Charles Root Cetificate    2. 手机的话:Help -> SSL Proxying -> Install Charles Root Cetificate on a Mobile Device or Remote Browser 会有提示       1. 大概是在手机设置了代理之后用浏览器访问 chls.pro/ssl 来下载、安装证书
@binderclip
binderclip / simple-ad-stat.html
Created October 12, 2015 04:12
简单的广告统计测试页面
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>广告统计</title>
<script src="jquery.js"></script>
</head>
<body>
<a href="http://localhost:8000/apple" ad-load-url="http://localhost:8000/apple/load" ad-click-url="http://localhost:8000/apple/click">apple</a>
<a href="http://localhost:8000/orange" ad-load-url="http://localhost:8000/orange/load" ad-click-url="http://localhost:8000/orange/click">orange</a>