This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add=(_=>n=>_+=n)(0) | |
add(5) // => 5 | |
add(10) // => 15 | |
add(7) // -> 22 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
true|0**0 === 1; // true | |
NaN|0**0 === 1; // true | |
false|0**0 === 1; // true | |
// ... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
encode = (n, a) => { | |
var r = []; | |
do { | |
n = (n - (r[r.length] = n % a.length)) / a.length | |
} while(n); | |
return r.map(n=>a[n]).reverse().join('') | |
}; | |
encode(4095, 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/') | |
// Outputs "//" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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\"" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Dependencies | |
sudo apt-get install libicu63 | |
sudo apt-get install liblttng-ust0 | |
# Download closest thing to kali | |
# Its updated constantly so just get the latest debian file. | |
# https://github.com/PowerShell/PowerShell/releases/tag/v7.1.0 | |
wget https://github.com/PowerShell/PowerShell/releases/download/v7.1.0/powershell_7.1.0-1.debian.11_amd64.deb | |
# Install |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set -o errexit -o nounset | |
# The idea is simple, the format Aurora uses is #GameID_DatabaseID where the GameID stays the same and the DatabaseID changes, so we check only the first 8 chars of the backup and the new and if they match we copy over the backups cover file to the new gamedata. | |
for file in GameData.bak/*; do | |
# Remove the following as they arnt games? | |
for file2 in GameData/*; do | |
if [ "${file2:9:8}" == "00000000" ]; then | |
continue | |
fi | |
if [ "${file2:9:2}" == "FF" ]; then |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# USAGE: RetroArchRenameBoilerPoint.sh ./Nintendo\ -\ Nintendo\ Entertainment\ System.lp | |
IFS=$'\n' | |
for filename in $(cat "$1" | grep -oP '.*"path": ".*/\K.*\.[^"]*'); do | |
romname=$(echo $filename | perl -pe 's/([[\]()+\$^{}])/\\$1/g') | |
romname=$(cat "$1" | grep -zoP "(/|\\\)$romname"'",\s{7}\"label\": \"\K[^"]*') | |
romname=$(echo "$romname" | perl -pe 's/[&*\/:`<>?\|]/_/g') | |
if [[ "${filename:0:-4}" == "$romname" ]]; then | |
: | |
else |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# Renames all retroarch thumbnails names, roms names, and reupdates the playlist.lpl files with said information. | |
# | |
# If your playlists names match your rom directories this will rename all cusom images and roms according to the lpl | |
# file passed in. Copy all your playlists over to where this script is located and from a wsl (windows subsystem for linus) console | |
# and ussage would be: | |
# | |
# bash rename.sh "PlaylistFile.lpl" "/your/retroarch/thumbnails/folder" "/your/retroarch/roms/folder" "/your/retroarch/playlists/folder" | |
# | |
# To update your entire retroarch at once you can follow the above advice and run: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Just move the images. | |
# Usage: bash rename2.sh "playlistfile.lpl" "/retroarch/thumbnails/folder" | |
IFS=$'\n' | |
for file in $(cat "$1" | grep -oP '.*"path":.*/\K.*\.([^"]*)'); do | |
ext=${file##*.} | |
escfile=$(echo $file | perl -pe 's/([[\]()+\$^{}])/\\$1/g') | |
newname=$(cat "$1" | grep -zoP "(/|\\\)$escfile"'",\s*\"label\": \"\K[^"]*') | |
newname=$(echo "$newname" | perl -pe 's/[&*\/:`<>?\|]/_/g') | |
dir="${1:0:-4}" | |
if [[ "${file:0:-((${#ext}+1))}" != "$newname" ]]; then |
OlderNewer