Skip to content

Instantly share code, notes, and snippets.

@monkeydone
monkeydone / find_fast_ip.sh
Created July 27, 2016 05:42
根据一个ip的列表文件,找到这个文件中那个ip访问最快
#!/bin/bash
dest_file="/tmp/my/a.txt"
all_ip_file="/tmp/my/ip.txt"
result_ip_file="/tmp/my/result.txt"
function allIP() {
cat $dest_file | awk -F" " '{print $NF}' > $all_ip_file
}
http://libre-free.com/detail?id=903
class FindWebView extends WebView {
private static final String LOGTAG ="FindWebView";
public ActionMode.Callback callback;
private OnScrollChangedListener mOnScrollChangedListener;
@monkeydone
monkeydone / python_learn
Last active May 19, 2016 08:23
一些python的学习笔记
#一个矩阵
G = [[randrange(2) for i in range(n)] for i in range(n)]
@monkeydone
monkeydone / rdesktop example
Last active April 10, 2016 14:08
rdesktop的一些用法
rdesktop -r disk:documents=/home/dean/Documents my.remoteserver.net
访问 \\tsclient\documents
./rdesktop -A -s "C:\seamlessrdp\seamlessrdpshell.exe
C:\seamlessrdp\RAM.exe"
<IP address>
@monkeydone
monkeydone / issue
Last active April 7, 2016 09:14
问题记录
1.编译时第三方提示警告,某些类有问题。
AGPBI: {"kind":"SIMPLE","text":"\tat com.android.dx.cf.direct.DirectClassFile.parse0(DirectClassFile.java:472)","position":{},"original":"\tat com.android.dx.cf.direct.DirectClassFile.parse0(DirectClassFile.java:472)"}
http://stackoverflow.com/questions/29255682/execution-failed-for-task-apppredexdebug
2.使用命令行打包多个库的aar
http://hugozhu.myalert.info/2014/11/05/52-assemble-aar-with-all-dependencies-with-gradle.html
@monkeydone
monkeydone / python_issue
Created April 5, 2016 03:13
from PyQt4 import QtGui, QtCore ImportError: No module named PyQt4
brew info pyqt
Python modules have been installed and Homebrew's site-packages is not
in your Python sys.path, so you will not be able to import the modules
this formula installed. If you plan to develop with these modules,
please run:
mkdir -p /Users/lijunjie/Library/Python/2.7/lib/python/site-packages
echo 'import site; site.addsitedir("/usr/local/lib/python2.7/site-packages")' >> /Users/lijunjie/Library/Python/2.7/lib/python/site-packages/homebrew.pth
@monkeydone
monkeydone / get_td_ip
Created April 3, 2016 15:00
get_td_ip
ctds=document.getElementsByTagName("td");
var b="";
function a(ctds) {
for(i=0;i<ctds.length;i++) {
text=ctds[i].innerText;
// alert(text);
if(ValidateIPaddress(text)) {
// alert(text);
b=text+";";
console.info(b);
@monkeydone
monkeydone / move_string_to_my_application.sh
Created March 20, 2016 14:35
find some string from cm and move them to myself application
#!/bin/bash
search_key=$1
tmp_file=/tmp/my/a.txt
tmp_b_file=/tmp/my/b.txt
function writeStrToFile() {
str=$1
str_file=$2
@monkeydone
monkeydone / python_some_technology
Created March 15, 2016 10:34
编写一个支持管道的脚本
1.管道
# script reverse.py
#!/usr/bin/env python
import sys
for l in sys.stdin.readlines():
sys.stdout.write(l[::-1])
cat reverse.py | ./reverse.py
@monkeydone
monkeydone / bug
Created March 9, 2016 03:09
记录自己遇到的一些奇葩问题,找到最终的解决方案
Q:Too many bind arguments. 5 arguments were provided but the statement needs 4 arguments
A:sql中的?加了双引号