Skip to content

Instantly share code, notes, and snippets.

View Ricky-Wilson's full-sized avatar
💭
Writing an ADB Lib

Ricky Wilson Ricky-Wilson

💭
Writing an ADB Lib
View GitHub Profile
@Ricky-Wilson
Ricky-Wilson / strip_scripts.py
Created March 13, 2014 04:10
remove scripts from html with python beautiful soup 4
from bs4 import BeautifulSoup as bs
def remove_scripts(soup):
[s.extract() for s in soup('script')]
@Ricky-Wilson
Ricky-Wilson / dictionary.py
Created March 14, 2014 08:19
Scrape word definitions from dictionary.com with python
#!/usr/bin/python
from bs4 import BeautifulSoup as bs
import re
from requests import get
class dictionary:
def remove_non_ascii(self,text):
return re.sub(r'[^\x00-\x7F]+','', text)
@Ricky-Wilson
Ricky-Wilson / adbwifi.sh
Created March 24, 2020 05:00
Android ADB Helpers
#!/bin/sh
ip=$( adb shell ifconfig wlan0 | cut -f 3 -d ' ' )
port=5555
adb tcpip $port
adb connect $ip:$port
@Ricky-Wilson
Ricky-Wilson / adb-sendkey
Created March 24, 2020 06:23 — forked from for2ando/adb-sendkey
Automate key input to Android applications and system utilities using input command on any Android device via adb
#!/bin/bash
pnam=$(basename "$0")
usage="$pnam [-b] [-n] [-v] KeySequence
$pnam {-h|--help}
"
adb_shell_input_keyevent() {
$verbose && echo "adb shell input keyevent $1"
$dryrun || adb shell -n input keyevent $1
}
@Ricky-Wilson
Ricky-Wilson / poweroff.sh
Created March 24, 2020 05:11
ADB helper to turn off a device
#!/bin/bash
adb shell svc power shutdown
@Ricky-Wilson
Ricky-Wilson / AdbCommands
Created March 22, 2020 03:45 — forked from Pulimet/AdbCommands
Adb useful commands list
adb help // List all comands
== Adb Server
adb kill-server
adb start-server
== Adb Reboot
adb reboot
adb reboot recovery
adb reboot-bootloader
@Ricky-Wilson
Ricky-Wilson / backup.sh
Last active March 20, 2020 07:09
Create a full backup of an android device using ADB
#!/bin/bash
adb backup -apk -shared -all -f $1
@Ricky-Wilson
Ricky-Wilson / random-mac.sh
Created March 20, 2020 07:01
Generate a random MAC address
#!/bin/bash
MAC=`(date; cat /proc/interrupts) | \
md5sum | sed -r 's/^(.{10}).*$/\1/; s/([0-9a-f]{2})/\1:/g; s/:$//;'`
echo "$MAC"
@Ricky-Wilson
Ricky-Wilson / mirror.sh
Created March 20, 2020 07:00
Mirror a website
#!/bin/bash
wget \
--mirror \
--convert-links \
--adjust-extension \
--page-requisites \
-e robots=off \
--html-extension \
-U Mozilla \
@Ricky-Wilson
Ricky-Wilson / fix-names.sh
Created March 20, 2020 06:59
Replace white space in file names
#!/bin/bash
find $1 -name "*.apk" -type f -print0 | \
while read -d $'\0' f
do mv -v "$f" "${f// /-}"
done