30.11.2020: Updated with the new patchseries and instructions for Windows
02.12.2020: Added tweaks
08.12.2020: Updated with patchseries v4
31.01.2020: Updated with patchseries v6
exec - Returns last line of commands output
passthru - Passes commands output directly to the browser
system - Passes commands output directly to the browser and returns last line
shell_exec - Returns commands output
\`\` (backticks) - Same as shell_exec()
popen - Opens read or write pipe to process of a command
proc_open - Similar to popen() but greater degree of control
pcntl_exec - Executes a program
# Goto android source code root and then execute following commands | |
# Keep the logcat.log in the root | |
export ANDROID_BUILD_TOP=$(pwd) | |
./external/selinux/prebuilts/bin/audit2allow -p out/target/product/{devicename}/root/sepolicy < logcat.log | |
# Copy the generated rules in respective files in the device tree |
netsh advfirewall firewall set rule group="remote administration" new enable=yes | |
netsh advfirewall firewall add rule name="Open Port 5985" dir=in action=allow protocol=TCP localport=5985 | |
winrm quickconfig -q | |
winrm quickconfig -transport:http | |
winrm set winrm/config '@{MaxTimeoutms="7200000"}' | |
winrm set winrm/config/winrs '@{MaxMemoryPerShellMB="0"}' | |
winrm set winrm/config/winrs '@{MaxProcessesPerShell="0"}' | |
winrm set winrm/config/winrs '@{MaxShellsPerUser="0"}' | |
winrm set winrm/config/service '@{AllowUnencrypted="true"}' |
#!/bin/bash | |
if [ $# -ne 3 ]; then | |
echo "usage: $0 <unix socket file> <host> <listen port>" | |
exit | |
fi | |
SOCK=$1 | |
HOST=$2 | |
PORT=$3 |
RECAPTCHA_PUBLIC_KEY = '<public key>' | |
RECAPTCHA_PRIVATE_KEY = '<private key>' | |
def checkRecaptcha(response, secretkey): | |
url = 'https://www.google.com/recaptcha/api/siteverify?' | |
url = url + 'secret=' + str(secretkey) | |
url = url + '&response=' +str(response) |
xhost + ${hostname}
to allow connections to the macOS host *export HOSTNAME=`hostname`
* environment:
# Example of getting file content | |
def getFileContent(pathAndFileName): | |
with open(pathAndFileName, 'r') as theFile: | |
# Return a list of lines (strings) | |
# data = theFile.read().split('\n') | |
# Return as string without line breaks | |
# data = theFile.read().replace('\n', '') | |
import csv | |
import pprint | |
# opens csv file and assingns it to an object | |
with open('data-text.csv') as csvfile: | |
# Use Sniffer to figure out csv dialect | |
dialect = csv.Sniffer().sniff(csvfile.read(1024)) | |
csvfile.seek(0) | |
# pass the dialect to filereader to read the file | |
reader = csv.reader(csvfile, dialect) |