Skip to content

Instantly share code, notes, and snippets.

@simpx
simpx / adbwifi.sh
Last active October 5, 2023 14:34 — forked from stormzhang/adbwifi.sh
shell script for adb wifi
#!/bin/bash
######
# Android wireless debugging via wifi
# Usage: 1. Connect your device via USB
# 2. run this script
# 3. there you go
######
#You usually wouldn't have to modify this
package main
import (
"fmt"
"flag"
"log"
"net"
"io"
"time"
)
@simpx
simpx / bug.py
Created September 27, 2012 13:12
Tell me why
import time
import requests
from BeautifulSoup import BeautifulSoup
if __name__ == '__main__':
fp = open('content.html', 'r')
content = fp.read()
s = time.time()
soup = BeautifulSoup(content)
@simpx
simpx / gist:3651314
Created September 6, 2012 04:41
openwrt 交叉编译 on Macos
1. 安装 homebrew
2. 使用磁盘工具,分出5G空间并挂载(日志式,区分大小写)
3. brew install coreutils gawk wget findutils gnu-getopt
3.1 macos中自带的getopt不兼容,需要手动将brew目录中的gnu-getopt link到/usr/bin中
4. 在trunk目录中执行make prereq,brew install安装依赖
@simpx
simpx / wr703n-openwrt.md
Created August 10, 2012 14:51 — forked from ninehills/wr703n-openwrt.md
wr703n刷openwrt配置、记录
@simpx
simpx / gist:2226159
Created March 28, 2012 13:26
Weibo Oauth2 use OAuth2 gem
require 'oauth2'
require 'json'
OAuth2::Response.register_parser(:text, 'text/plain') do |body|
parsed_body = JSON.parse(body)
parsed_body
end
client = OAuth2::Client.new(YOU_KEY, YOU_SECRET, :site => "https://api.weibo.com", :authorize_url => "/oauth2/authorize", :token_url => "/oauth2/access_token")
puts client.auth_code.authorize_url(:redirect_uri => YOUR_CALLBACK_URL)
token = client.auth_code.get_token('authorization_code_value', :redirect_uri => YOUR_CALLBACK_URL)
@simpx
simpx / test.py
Created January 9, 2012 12:21
Gist test
adfdf
@simpx
simpx / fabfile.py
Created December 15, 2011 09:10 — forked from cyberdelia/fabfile.py
Fabric deploy script with : south migrations, rollback and maintenance page.
from fabric.api import env, run, sudo, local, put
def production():
"""Defines production environment"""
env.user = "deploy"
env.hosts = ['example.com',]
env.base_dir = "/var/www"
env.app_name = "app"
env.domain_name = "app.example.com"
env.domain_path = "%(base_dir)s/%(domain_name)s" % { 'base_dir':env.base_dir, 'domain_name':env.domain_name }