View movie-stats-csv.sh
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 | |
# public domain | |
# caio begotti | |
set -euo pipefail | |
CSVFILE=$(mktemp) | |
wget https://raw.githubusercontent.com/caiobegotti/Scripts/master/rottentomatoes-ratings-exporter.csv --quiet -O ${CSVFILE} |
View volp.abl.sh
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 -eu | |
# public domain | |
# | |
# caio1982@gmail.com | |
input=${1} | |
term=$(echo ${input} | xmlstarlet esc | sed -e 's/\&\#\x/\%/;s/\;//') | |
lynx -dump http://www.academia.org.br/sistema_busca_palavras_portuguesas/volta_voca_org.asp?palavra=${term} | sed -e '1!d' -e 's/^.* \([a-z]\+\) .*/\1/g' |
View logtrap.sh
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 | |
function logtrap() { | |
local last="${BASH_COMMAND}" | |
local exitcode=${?} | |
# any format is ok but this will be printed BEFORE all commands, not after | |
echo "TRAPLOG: [$(date +%T)] [${exitcode}] [${last}]" | |
} |
View 1SE-hack
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
# an special function because it requires the IP of my iphone | |
rtw-backup-one-second-everyday () { rsync -avz --stats --progress --rsh=ssh root@${1}:/private/var/mobile/Applications/.../Documents/* ~/one-second-everyday/; } | |
# special case for the damn 1SE app on iphone | |
# which does not offer an option to disable overlays | |
# nor change the date format, nor hide its logos | |
function rtw-one-second-list() { | |
originalfile=$(find ~/one-second-everyday/ -iname '*STORED_ONE_SECOND_VIDEOS_ARRAY_FILE_PATH*' | head -1) | |
originallist=$(basename ${originalfile}) | |
indexlist=/tmp/${originallist}.plist |
View gist:2307114
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
Shell: | |
cat *.xml | sed 's/\([A-Z][[:alpha:]]\{0,\}\. [A-Z]\)/| \1/g' | tr '|' '\n' | sed 's/^\( .\{25\}\).*$/\1/g' | |
Cn. Octauii praecidi capu | |
P. Crassi | |
Sp. Albinus, homines cons | |
M. Antonii, omnium eloque | |
C. Caesaris, in quo mihi | |
C. Marius tum, cum Cimbri |