Skip to content

Instantly share code, notes, and snippets.

View andrewleo's full-sized avatar
🎯
Focusing

Liu Xiao andrewleo

🎯
Focusing
  • Netease
  • Hangzhou, Zhejiang, China
View GitHub Profile
@andrewleo
andrewleo / gitignore
Created September 22, 2013 04:59
gitignore
# Ignore bundler config
/.bundle
# Ignore the default SQLite database.
/db/*.sqlite3
# Ignore all logfiles and tempfiles.
/log/*.log
/tmp
@andrewleo
andrewleo / gist:ea4dfda9b4a0eb89e29014fe82048eb2
Created September 19, 2017 06:05
Android Accessibility Bug
09-19 11:21:06.237 E/AccessibilityInteractionClient(28814): Error while calling remote findAccessibilityNodeInfoByAccessibilityId
09-19 11:21:06.237 E/AccessibilityInteractionClient(28814): android.os.DeadObjectException
09-19 11:21:06.237 E/AccessibilityInteractionClient(28814): at android.os.BinderProxy.transactNative(Native Method)
09-19 11:21:06.237 E/AccessibilityInteractionClient(28814): at android.os.BinderProxy.transact(Binder.java:515)
09-19 11:21:06.237 E/AccessibilityInteractionClient(28814): at android.accessibilityservice.IAccessibilityServiceConnection$Stub$Proxy.findAccessibilityNodeInfoByAccessibilityId(IAccessibilityServiceConnection.java:301)
09-19 11:21:06.237 E/AccessibilityInteractionClient(28814): at android.view.accessibility.AccessibilityInteractionClient.findAccessibilityNodeInfoByAccessibilityId(AccessibilityInteractionClient.java:290)
09-19 11:21:06.237 E/AccessibilityInteractionClient(28814): at android.view.accessibility.AccessibilityInteractionClient.getRootInActiveWindow(Ac
@andrewleo
andrewleo / adbwifi.sh
Created September 27, 2017 07:05 — forked from stormzhang/adbwifi.sh
shell script for adb wifi
#!/bin/bash
#Modify this with your IP range
MY_IP_RANGE="192\.168\.1"
#You usually wouldn't have to modify this
PORT_BASE=5555
#List the devices on the screen for your viewing pleasure
adb devices
<?xml version='1.0' encoding='UTF-8' standalone='yes' ?>
<hierarchy rotation="0">
<node index="0" text="" resource-id="" class="android.widget.FrameLayout" package="com.android.systemui" content-desc="" checkable="false" checked="false" clickable="false" enabled="true" focusable="true" focused="false" scrollable="false" long-clickable="false" password="false" selected="false" bounds="[0,0][1080,69]">
<node index="0" text="" resource-id="com.android.systemui:id/status_bar" class="android.widget.FrameLayout" package="com.android.systemui" content-desc="" checkable="false" checked="false" clickable="false" enabled="true" focusable="true" focused="false" scrollable="false" long-clickable="false" password="false" selected="false" bounds="[0,0][1080,69]">
<node index="0" text="" resource-id="com.android.systemui:id/ticker" class="android.widget.LinearLayout" package="com.android.systemui" content-desc="" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false"
<?xml version='1.0' encoding='UTF-8' standalone='yes' ?>
<hierarchy rotation="0">
<node index="0" text="" resource-id="" class="android.widget.FrameLayout" package="com.android.systemui" content-desc="" checkable="false" checked="false" clickable="false" enabled="true" focusable="true" focused="false" scrollable="false" long-clickable="false" password="false" selected="false" bounds="[0,0][1080,69]">
<node index="0" text="" resource-id="com.android.systemui:id/status_bar" class="android.widget.FrameLayout" package="com.android.systemui" content-desc="" checkable="false" checked="false" clickable="false" enabled="true" focusable="true" focused="false" scrollable="false" long-clickable="false" password="false" selected="false" bounds="[0,0][1080,69]">
<node index="0" text="" resource-id="com.android.systemui:id/ticker" class="android.widget.LinearLayout" package="com.android.systemui" content-desc="" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false"
@andrewleo
andrewleo / 提问的智慧.md
Created October 20, 2017 06:36 — forked from zer4tul/提问的智慧.md
Simplified Chinese edition of "How To Ask Questions The Smart Way"
def matchedJobs = Jenkins.instance.items.findAll { job ->
job.name =~ /20180410/
}
matchedJobs.each { job ->
println job.name
//job.delete()
}

How to install OpenSTF in Ubuntu 14.04

  1. Add Add RethinkDB key

     source /etc/lsb-release && echo "deb http://download.rethinkdb.com/apt $DISTRIB_CODENAME main" | sudo tee /etc/apt/sources.list.d/rethinkdb.list
     wget -qO- https://download.rethinkdb.com/apt/pubkey.gpg | sudo apt-key add -
    
  2. Install packages

sudo apt-get update && sudo apt-get install -y git nodejs nodejs-legacy npm rethinkdb android-tools-adb python autoconf automake libtool build-essential ninja-build libzmq3-dev libprotobuf-dev git graphicsmagick yasm stow

@andrewleo
andrewleo / tcpproxy.js
Created May 31, 2019 05:17 — forked from kfox/tcpproxy.js
A basic TCP proxy written in node.js
var net = require("net");
process.on("uncaughtException", function(error) {
console.error(error);
});
if (process.argv.length != 5) {
console.log("usage: %s <localport> <remotehost> <remoteport>", process.argv[1]);
process.exit();
}