Skip to content

Instantly share code, notes, and snippets.

@Swind
Last active August 3, 2019 16:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Swind/80110b73e54dc4e02e7e25c21adb7e16 to your computer and use it in GitHub Desktop.
Save Swind/80110b73e54dc4e02e7e25c21adb7e16 to your computer and use it in GitHub Desktop.
description

This is for pet

[[snippets]]
description = "Install android system images"
command = "sdkmanager 'system-images;android-<api=23>;default;<abi=x86_64>'"
tag = ["android", "sdkmanager"]
output = ""
[[snippets]]
description = "Install android platforms"
command = "sdkmanager 'platforms;android-<api=23>'"
tag = ["android", "sdkmanager"]
output = ""
[[snippets]]
description = "Create android emulator avd"
command = "avdmanager create avd -k 'system-images;android-<api=23>;default;<abi=x86_64>' -n <name=Android6> -b <abi=x86_64> -d \"<device=Nexus 5>\""
tag = ["android", "avdmanager"]
output = ""
[[snippets]]
description = "Start android emulator"
command = "$ANDROID_HOME/tools/emulator @<avd=Android6> -use-system-libs -gpu host -accel on -skin 1080x1920"
tag = ["android", "emulator"]
output = ""
[[snippets]]
description = "Build WebDriverAgent by xcodebuild"
command = "xcodebuild -project WebDriverAgent.xcodeproj -scheme WebDriverAgentRunner -sdk iphonesimulator<version=10.3>"
tag = ["osx", "webdriveragent"]
output = ""
[[snippets]]
description = "Delete a avd"
command = "avdmanager delete avd -n <name=Android6>"
tag = ["android", "avdmanager"]
output = ""
[[snippets]]
description = "Get the model of the Android device"
command = "adb shell getprop ro.product.model"
tag = ["android", "adb"]
output = ""
[[snippets]]
description = "Add public key to remote server"
command = "cat mkdir .ssh/id_rsa.pub | ssh swind@dev-he.cloudmosa.com 'cat >> .ssh/authorized_keys'"
tag = ["linux", "ssh"]
output = ""
[[snippets]]
description = "Remove all stopped containers"
command = "docker rm $(docker ps -a -q)"
tag = ["linux", "docker"]
output = ""
[[snippets]]
description = "Remove all untagged docker images"
command = "docker rmi $(docker images | grep \"^<none>\" | awk \"{print $3}\")"
tag = ["linux", "docker"]
output = ""
[[snippets]]
description = "List all installed packages"
command = "adb shell pm list packages -f"
tag = ["android", "adb"]
output = ""
[[snippets]]
description = "Use ffmpeg to merge two videos side by side"
command = "ffmpeg -i puffin6_no_flickering.mp4 -vf \"[in] pad=2*iw:ih [left]; movie=puffin7_flickering.mp4 [right];[left][right] overlay=main_w/2:0 [out]\" output.mp4"
output = ""
[[snippets]]
description = "Clear all user data"
command = "adb shell pm clear <packageName=com.cloudmosa.puffinFree>"
tag = ["android", "adb"]
output = ""
[[snippets]]
description = "Kill defunct processes"
command = "ps -ef | grep defunct | awk '{print $2}' | xargs kill "
tag = ["alias"]
output = ""
[[snippets]]
description = "Use cat to replace git default pager"
command = "git config --global core.pager cat"
tag = ["alias"]
output = ""
[[snippets]]
description = "Remove old kernel images with one command"
command = "dpkg -l linux-{image,headers}-\"[0-9]*\" | awk '/^ii/{ print $2}' | grep -v -e `uname -r | cut -f1,2 -d\"-\"` | grep -e '[0-9]' | xargs sudo apt-get -y purge"
tag = ["kernel"]
output = ""
[[snippets]]
description = "Remove all __pycache__, pyc and pyo"
command = "find . -regex '.*\\(__pycache__\\|\\.py[co]\\)' -delete"
output = ""
[[snippets]]
description = "Copy all dependencies libraries"
command = "ldd url_filter_tester | grep '=> /' | awk '{print $3}' | xargs -I '{}' cp -v '{}' test/"
output = ""
[[snippets]]
description = "Use xdotool to display mouse cursor location"
command = "while true; do clear; xdotool getmouselocation; sleep 0.5; done"
output = ""
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment