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/zsh | |
# Fix Safari Favorites Icons | |
CS="cache_settings"; TIC="Touch Icons Cache"; DIR="$HOME/Library/Safari/$TIC/Images" | |
DB="$DIR/../${${TIC// }%%s*}${${(C)CS}//_}.db"; SQL=$(sqlite3 "$DB" "SELECT host FROM $CS") | |
sqlite3 "$DB" "UPDATE $CS SET ${${${(L)TIC// /_}#*_}//s/_is_in}=1, download_status_flags=1" | |
for png in "$1"/*.png; do URL="$(plutil -convert xml1 -o - "$DIR/../../Bookmarks.plist" | \ | |
awk -F '[</>]' -v name="${${png##*/}%%.*}" '$3~name{getline;getline;getline;print $5}')"; \ | |
cp -f -v "$png" "$DIR/${(U)$(md5 -q -s $URL)}.png"; done; chflags -v uappnd $DIR $DB* |
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
#!/usr/bin/env zsh | |
# ZSH configuration | |
# Set shell options. | |
export CORRECT_IGNORE="_*" | |
setopt RC_EXPAND_PARAM | |
setopt CORRECT |
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/sh | |
BIN="/usr/local/bin/askpass"; touch $BIN; chmod 755 $BIN | |
security add-generic-password -a $USER -s login -T "" -w | |
echo "#!/bin/sh\\nsecurity find-generic-password -a $USER -s login -w" > $BIN | |
echo "\\n# Set sudo helper.\\nexport SUDO_ASKPASS=$BIN" >> ~/.${SHELL##/*/}rc |
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/sh | |
sudo dscl . read /Users/$USER ShadowHashData | tail -1 | xxd -p -r | plutil -convert xml1 - -o - | sed s/data/string/ | plutil -convert json - -o $USER.json | |
ITERATIONS=$(jq '."SALTED-SHA512-PBKDF2".iterations' $USER.json) | |
SALT=$(jq '."SALTED-SHA512-PBKDF2".salt' $USER.json | sed -E 's/"?\\n\\t\\t"?//g' | base64 -D | xxd -c 256 -p) | |
ENTROPY=$(jq '."SALTED-SHA512-PBKDF2".entropy' $USER.json | sed -E 's/"?\\n\\t\\t"?//g' | base64 -D | xxd -c 256 -p | cut -c -128) | |
echo "\$ml\$$ITERATIONS\$$SALT\$$ENTROPY" > $USER.hash | |
hashcat -m 7100 --example-hashes | awk '/HASH/{print $2}' > example.hash | |
hashcat -a 3 -m 7100 example.hash "?l?l?l?l?l?l?l" |
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/zsh | |
# Play the last video watched on YouTube in MPV with subtitles. | |
L="${2-${${LANG%.*}%_*}}"; SIZE="${3-48}"; EXT="${4-vtt}"; FMT="${5-135+140}" # Set variables. | |
ID=$(yt-dlp -v --get-id --playlist-items ${1-1} \ | |
--cookies-from-browser chrome+gnomekeyring :ythistory) # Set the video's ID. | |
SUB=$(yt-dlp youtu.be/$ID --write-subs --sub-format vtt --sub-langs $L \ | |
--print '%(requested_subtitles)j' | jq -M -r '.[]|.url') # Set the subtitles' URL. |
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/zsh | |
# Saves '$1' secs of the RTV38 stream. | |
URL="webtools\ | |
-845d8509d2cb4f249dd0b2ae5755b6c2\ | |
.msvdn.net/embed/CXHH7K39hg9K/" | |
DATE="$(date +%F)" | |
NAME="RTV38_$DATE" |
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/sh | |
BASE="FrontRow.png"; LOGO="Kodi.png"; PNG="${LOGO%.*}-$BASE" | |
ICNS=${PNG/.png/.icns}; SIZE=$(file "$BASE" | cut -d' ' -f5) | |
for n in {0..3}; do eval S$n="$[$SIZE/(2**$n)]"; done | |
DIM="${S2}x${S2}"; POS="+$[($S2+$S3)]+$[($S0/3)-$S3]" | |
convert $BASE \( $LOGO -geometry $DIM$POS \) \ | |
-compose soft-light -composite $PNG |
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/zsh | |
# Extract logos from folder icons | |
DL="Downloads"; G="Generic" | |
U="Utilities"; c="compare" | |
SB="Sidebar"; f="format" | |
I="Icon"; F="Folder" | |
mkdir -v Core |
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/zsh | |
# Rogue Bunnies Trading Cards DownLoader | |
URL="https://tradingcards.roguebunnies.com" | |
API="https://api.gigantik.io\ | |
/marketplace/tokens/[1738371-1775895]" | |
PT='function glpf4() {getline; print $4}; \ | |
/"type/{glpf4(); glpf4()}' |
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/sh | |
SD="Foto/Persone/VIP/TeleVisione/RTV38/Carlotta_Comparini" | |
GDD="/Volumes/Misc Stuff/Google Drive/$USER/MultiMedia/Immagini" | |
ID=$(youtube-dl --get-id ytsearch:tadà_$(date -v-mon -v-0w +%d/%m)) | |
VURL=$(curl -s "$(youtube-dl -g -f 135 youtu.be/$ID)" | gawk -v RS='<|>' '/"135"/{while($0!~/\/\//)getline; print}') | |
AURL=$(curl -s "$(youtube-dl -g -f 140 youtu.be/$ID)" | gawk -v RS='<|>' '/"140"/{while($0!~/\/\//)getline; print}') | |
cd $HOME/Pictures/$SD; youtube-dl --id --skip-download --write-auto-sub --sub-format=ttml --sub-lang=it youtu.be/$ID |
NewerOlder