Notepad 20170302PM

Search Key process and kill that.

ps -ef |grep "XXXX"|grep -v "grep"|awk '{ print $2 }'|xargs kill -9

Monitor process and child process

while true; do ps -ef |grep "cats-server"|grep -v "grep"|awk 'pstree -p -g -h -n $2';sleep 0.5;clear; done

Repeated 10 times some action

for i in {1..10}; do echo $i; done

Qrcode

# prcode
wget https://launchpad.net/qr-tools/trunk/1.2/+download/python-qrtools_1.2_all.deb
sudo gdebi python-qrtools_1.2_all.deb

sudo -E easy_install pyqrcode
sudo -E easy_install pypng

adb shell

pm list packages -f
dumpsys activity
settings put global airplane_mode_on 1
settings put global verifier_verify_adb_installs 1
sqlite3 /data/data/com.android.providers.settings/databases/settings.db "update system set value='1' where name='airplane_mode_on';"
dumpsys window|grep mCurrentFocus
service call hwc.info 2 i32 0
dumpsys display|grep mBaseDisplayInfo
wm density 213

wm size 480x800
wm density 186
wm overscan reset

wm size 800x480
wm density 240
wm overscan rese

adb shell 'settings get global package_verifier_enable'
adb shell 'settings put global package_verifier_enable 0'
adb shell 'settings get system screen_off_timeout'
adb shell 'settings put system screen_off_timeout 600000'
adb shell 'settings get secure install_non_market_apps'
adb shell 'settings put secure install_non_market_apps 1'
adb shell 'pm grant com.test.xxx android.permission.READ_EXTERNAL_STORAGE'
adb shell 'pm grant com.test.xxx android.permission.WRITE_EXTERNAL_STORAGE'
adb shell 'pm grant com.test.xxx android.permission.CAMERA'
adb shell 'pm grant com.test.xxx android.permission.RECORD_AUDIO'
adb shell 'pm grant com.test.xxx android.permission.READ_CALENDAR'
adb shell 'pm grant com.test.xxx android.permission.WRITE_CALENDAR'



#system log
adb logcat -v threadtime -d *:V
#event log
adb logcat -b events -v threadtime -d *:V
#radio log
adb logcat -b radio -v threadtime -d *:V

pylint check

git diff --cached --name-only|grep .py|xargs pylint

uiautomator

d(scrollable=True).scroll.vert.to(textContains='XXX')

git commands

git log --prety=oneline

git reset -hard xxx

git checkout --file

Mysql

# Mysql Create guest user
>>CREATE USER 'guest'@'%' IDENTIFIED BY '123456';
>>GRANT SELECT ON xxx.* TO 'guest'@'%';
>>GRANT CREATE ROUTINE ON xxx.* TO 'guest'@'%';
>>GRANT EXECUTE ON PROCEDURE xxx.* TO 'guest'@'%';
>>GRANT ALL ON xxx.* TO 'guest'@'%';
>>FLUSH PRIVILEGES;
>>SHOW GRANTS FOR 'guest'@'%';

# Mysql Table column flag
[intrinsic column flags]
- PK: primary key (column is part of a pk)
- NN: not null (column is nullable)
- UQ: unique (column is part of a unique key)
- AI: auto increment (the column is auto incremented when rows are inserted)
[additional data type flags, depend on used data type]
- BIN: binary (if dt is a blob or similar, this indicates that is binary data, rather than text)
- UN: unsigned (for integer types, see docs: "10.2. Numeric Types")
- ZF: zero fill (rather a display related flag, see docs: "10.2. Numeric Types") 

source line count

>>find . -name '*.py' | xargs wc -l
# Jquery dump
console.dir(row); 
alert(JSON.stringify(row));
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章