Skip to content

Instantly share code, notes, and snippets.

@iOS0x00
iOS0x00 / gist:5394146
Last active December 16, 2015 06:49
快速查找后台进程,用于终止进程很方便。
IDS=`ps ax -o pid:1,args|grep demo.py|grep -v SCREEN|cut -d " " -f 1`
if [ "$IDS" == "" ];then
echo "not running"
exit 2
else
kill $IDS
exit 1
fi
@iOS0x00
iOS0x00 / gist:5394284
Created April 16, 2013 08:13
git版本管理的打包脚本
#!/bin/bash
git archive --format zip -o wxpublic-$(git log --pretty=format:"%h" -1).zip HEAD
@iOS0x00
iOS0x00 / gist:5552561
Last active December 17, 2015 04:39
更新apk版本的脚本, 支持release和deubg双线分支。
#!/bin/bash
if [[ -z $1 ]] & [[ -z $2 ]];then
echo "Usage: ./update.sh [release|debug] [vercode]"
exit 1
fi
curver=`tail -1 APKVERSION`
curverDebug=`tail -1 APKVERSION_DEBUG`
mode=$1
@iOS0x00
iOS0x00 / gist:5552930
Created May 10, 2013 07:26
Android软件联网更新方案 你们感受一下
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.client.ClientProtocolException;
@iOS0x00
iOS0x00 / gist:5655250
Created May 27, 2013 04:57
androidTab标签页
// Copyright 2012, Google Inc. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
@iOS0x00
iOS0x00 / server.py
Created October 23, 2013 08:10 — forked from omarish/server.py
import tornado.web
class NoCacheStaticFileHandler(tornado.web.StaticFileHandler):
def set_extra_headers(self, path):
self.set_header("Cache-control", "no-cache")
class Application(tornado.web.Application):
def __init__(self):
handlers = [
# ...
import re
import urllib
from tornado.web import RequestHandler
#CAS setting
CAS_SETTINGS = {
#replace this with your cas server url
'cas_server' : 'http://cas_server',
#replace this with your website url
'service_url' : 'http://service_url/deal_with_st',
#!/bin/env python
#coding: utf-8
#
# Git hook for UEDPRJ
# tang_h@Ctrip.com
import sys
import urllib, urllib2
import re
@iOS0x00
iOS0x00 / airplayer.py
Created November 7, 2013 14:23
aireplayer
# vim: ts=4: noexpandtab
import re
import sys
import select
import socket
import requests
import urlparse
import pybonjour
import urllib
import string
#******************************************************************************
# Copyright (c) 2011 Trevor Harwell
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Eclipse Public License v1.0
# which accompanies this distribution, and is available at
# http://www.eclipse.org/legal/epl-v10.html
#
# Contributors:
# Trevor Harwell - initial implementations
#******************************************************************************