This file contains hidden or 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 | |
for dir in * do # join MP4 per subdir | |
txt="$dir.txt"; gfind $dir/*.mp4 -fprintf $txt "file '%p'\\n" | |
ffmpeg -f concat -safe 0 -i $txt -c copy $dir.mp4; rm -v $txt | |
done | |
# ffmpeg -f concat -safe 0 -i <(printf "file '$PWD/%s'\n" ./*.mp4) -c copy output.mp4 |
This file contains hidden or 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 | |
shopt -s expand_aliases; fb=https://m.facebook.com; open $fb/$1/photos; sleep 10 | |
function safari-cli { eval osascript -e \'tell application \"Safari\" to $1\'; } | |
alias sst='safari-cli "get source of current tab of front window"' | |
alias sct='safari-cli "close current tab of front window"' | |
sst | tr \" \\n | grep ^/.*42$ | cut -d\& -f1 | xargs -I {} open $fb{}; sleep 10 | |
mkdir $1; cd $1; for page in {01..40}; do URL=$(sst | tr \" \\n | grep -B1 Size\ | |
| sed -E "s/amp;|\\\//g;q"); curl -v -o $(basename ${URL%\?*}) "$URL"; sct; done |
This file contains hidden or 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 | |
DeRez -only icns $1/Icon$'\r' > icon.rsrc; Rez -a icon.rsrc -o $2/Icon$'\r' | |
SetFile -a C $2; SetFile -a V $2/Icon$'\r'; rm icon.rsrc | |
# mkdir $2;cd $2;touch Icon$'\r';chflags hidden Icon$'\r';CA="com.apple" | |
# xattr -wx $CA.FinderInfo "$(xattr -p -x $CA.FinderInfo $1)" . | |
# xattr -px $CA.ResourceFork $1/Icon$'\r'|xxd -p -r ->Icon$'\r'/..namedfork/rsrc |
This file contains hidden or 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 | |
# Download EwaSonnet's videos and photos. | |
# for i in $(cat cred.txt); do curl -L -s 3wasonnet.com/tour/do_member_login_acms4.php \ | |
# -d "$(echo $i|sed -E 's/^| / username=/;s/:/\&pass=/')&btn=++Login++"; echo $i; done \ | |
# | sed -n '/already/s/.*>//p' | |
for n in {1..24};do | |
curl -Lsu 'odinboy:thebobby' www.3wasonnet.com/members/latest-videos/page/$n/|tr\ |
This file contains hidden or 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 | |
cd $1; convert 'xc:none[1024x1024]' folder.png; folderify -x 10.8 folder.png | |
mv folder.iconset/icon_512x512\@2x.png .; rm -frv folder.{ic{,o}ns{,et},png} | |
find $1 -name Icon^M; cd $dir; icns2png -x -s 1024 Icon^M | |
convert -transparent white <(compare -fuzz 16% Icon^M_1024x1024x32.png \ | |
$1/icon_512x512\@2x.png -compose src -highlight-color black png:) logo.png | |
folderify logo.png .; chflags hidden ./Icon^M; rm logo.png |
This file contains hidden or 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 | |
VB="https://dropbox.com/s/mkcyo53m15ktbnp/nuovovocabolariodibase.pdf" | |
HW=$(curl -s $VB | pdftotext -layout - - | gawk -v RS=', [0-9]?|\n' \ | |
'/^[^A-Z]+$/{if($1~/^[a-z][^\.]+$/)print $1}' | sed -n '/-$/N; s/-\n//; 1!p') | |
WD="https://it.wiktionary.org/w/index.php?action=raw&title="; PT="parole.txt" | |
for w in $HW; do echo "$w|${${$(curl -s "$WD$w" | gawk -v RS='{|}' \ | |
'/Link|Tab/{print $1; exit}')#*|}:-$w}"; done > $PT | |
WP=https://dumps.wikimedia.org/itwiki/latest/itwiki-latest-all-titles-in-ns0.gz |
This file contains hidden or 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 SH="${SHELL##*/}" | |
export SHRC="$HOME/.${SH}rc" | |
export CORRECT_IGNORE="_*" |
This file contains hidden or 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/local/bin/bash | |
# Edit video with ffmpeg | |
I=$1; F=${1##*/}; B=${F%.*}; shift; T=($@) | |
for p in ${T[@]}; do P=(${p/-/ }); N=${B}_[$p].ts | |
eval "ffmpeg -i $I -ss ${P[0]} -to ${P[1]} -c copy $N"; done | |
cat $B_*.ts > $B.ts; ffmpeg -i $B.ts -c copy ${B}_edit.mp4; rm -v $B*.ts |
This file contains hidden or 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 | |
# Grep WikiPedia titles | |
URL="http://tools.wmflabs.org/grep/index.php"; PAT="(^| |\W)$1(\W| |$)" | |
curl -G -d "lang=it" -d "project=wikipedia" -d "namespace=0" \ | |
-d "redirects=on" --data-urlencode "pattern=$PAT" "$URL" | \ | |
awk -F'<|>' '/^<li/{print $5}' | tr "[A-Z] [[:punct:]]" "[a-z]\n" | sort -u |
This file contains hidden or 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 | |
airport="/System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport" | |
security find-generic-password -w -a $($airport -I | awk '/ SSID: /{print $2}') |