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 bash | |
# | |
# Description: Select .torrent file to upload to seed box. | |
# Usage: $ seedbox | |
# Author: Josué CAU <me@josuecau.com> | |
# Version: v0.1.1 | |
# Dependencies: fzf(1) | |
# Env: SEEDBOX_ADDRESS | |
set -e |
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
$if2(%albumartist%,%artist%)/$if($ne(%albumartist%,),%album%/,)$if($gt(%totaldiscs%,1),%discnumber%/,)$if($ne(%albumartist%,),$num(%tracknumber%,2) ,)%title% |
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 bash | |
# | |
# Description: Convert H.265 (HEVC) to H.264 (MPEG-4 AVC) | |
# Author: Josué Cau <me@josuecau.com> | |
# Date: 2018-02-16 | |
# Dependencies: ffmpeg(1) | |
set -e | |
if [ "$#" -ne 3 ]; 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
#!/usr/bin/env bash | |
# | |
# Convert FLAC to MP3 using ffmpeg(1) | |
# Source: https://stackoverflow.com/a/26109838/2397516 | |
set -e | |
if [ $# -lt 1 ]; then | |
echo "Usage: $(basename "$0") /files/to/convert" | |
exit 1 |
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
# search & replace with backup | |
find . -name "*.php" -print | xargs sed -i.bak 's/foo/bar/g' | |
# delete backup files | |
find . -name '*.bak' | xargs rm |
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
# Seoul oh-my-zsh theme | |
# Theme with username, hostname, relative path and git branch | |
# Inspired by Maran theme and Seoul256 color scheme | |
PROMPT='%F{173}%n%{$reset_color%}%F{252}@%{$reset_color%}%F{179}%M%{$reset_color%}%F{252}:%{$reset_color%}%F{116}%~%{$reset_color%}$(git_prompt_info) %F{252}%(!.#.$)%{$reset_color%} ' | |
ZSH_THEME_GIT_PROMPT_PREFIX="%F{252}:%{$reset_color%}%F{108}" | |
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" | |
ZSH_THEME_GIT_PROMPT_DIRTY="*" | |
ZSH_THEME_GIT_PROMPT_CLEAN="" |
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
root = true | |
[*] | |
charset = utf-8 | |
end_of_line = lf | |
indent_size = 2 | |
indent_style = space | |
insert_final_newline = true | |
max_line_length = 80 | |
trim_trailing_whitespace = 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
#!/usr/bin/env bash | |
# | |
# Convert JSON to CSV using jq(1) | |
# Source: https://stackoverflow.com/a/32967407 | |
[ $# -ge 1 -a -f "$1" ] && input="$1" || input="-" | |
jq -r '(.[0] | keys_unsorted) as $keys | $keys, map([.[ $keys[] ]])[] | @csv' $input |
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 bash | |
# | |
# Certbot with Docker and Cloudflare DNS Authenticator plugin | |
# https://certbot.eff.org | |
# https://github.com/certbot/certbot/tree/master/certbot-dns-cloudflare | |
docker run -it --rm --name certbot \ | |
-v '/etc/letsencrypt:/etc/letsencrypt' \ | |
-v '/etc/cloudflare.conf:/etc/cloudflare.conf' \ | |
-v '/var/lib/letsencrypt:/var/lib/letsencrypt' \ |
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 bash | |
input="${1:-/dev/stdin}" | |
awk '{s+=$1} END {print s}' "$input" |