Skip to content

Instantly share code, notes, and snippets.

View ileathan's full-sized avatar

Spinelli Valentinuzzi ileathan

View GitHub Profile
@ileathan
ileathan / android-man-install.sh
Last active January 29, 2018 00:34
Install man pages without or with conflicting binaries
#!/bin/bash
# This script assumes you have an ssh server running on your rooted android.
# USAGE:
# ./android-man-install.sh binaryName
# Locate the man page you want. From a computer that already has it:
location=$(sudo find / * | grep -P "$1\\..*\\.gz")
# Now scp over the file you just found (from remote pc to android).
scp $location yourAndroidDevice:$location
@ileathan
ileathan / remote-sudo.sh
Last active January 29, 2018 00:33
Run sudo command on remote machine non-interactively
#!/bin/bash
# USAGE:
# ./remote-sudo.sh password hostname command
HOST=$2;
PASSWORD=$1;
COMMAND="${@:3}"
ssh -T $HOST "echo $PASSWORD | sudo -S su -c \"$COMMAND\""
true|0**0 === 1; // true
NaN|0**0 === 1; // true
false|0**0 === 1; // true
// ...
add=(_=>n=>_+=n)(0)
add(5) // => 5
add(10) // => 15
add(7) // -> 22