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 bash | |
set -euo pipefail | |
# --- Argument Parsing --- | |
BUILD_PYTHON_FLAG=false | |
PLUGIN_TYPE="all" # Default to building all plugins | |
while [[ $# -gt 0 ]]; do | |
case $1 in | |
--build-python) |
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 bash | |
# checck if pidof exists | |
PIDOF="$(which pidof)" | |
# and if not - install it | |
(test "${PIDOF}" && test -f "${PIDOF}") || brew install pidof | |
# find app in default paths | |
CO_PWD=~/Applications/CrossOver.app/Contents/MacOS | |
test -d "${CO_PWD}" || CO_PWD=/Applications/CrossOver.app/Contents/MacOS |
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
# export COVER=/path/to/cover | |
# organizes wav + vtt to flac(embedded lrc & cover) + lrc | |
for wav in *.wav; do [ -f "$wav" ] && ffmpeg -i "$wav" -compression_level 12 "${wav%.wav}.flac" -y && rm "$wav"; done && for vtt in *.vtt; do [ -f "$vtt" ] && lrc="${vtt%.vtt}.lrc" && echo -e "[ti:]\n[ar:]\n[al:]\n[by:]\n[00:00.00]" > "$lrc" && grep -n "^[0-9][0-9]:[0-9][0-9]:[0-9][0-9]" "$vtt" | while IFS=: read -r ln line; do start=$(echo "$line" | awk '{print $1}') && h=$(echo "$start" | cut -d: -f1) && m=$(echo "$start" | cut -d: -f2) && s=$(echo "$start" | cut -d: -f3 | cut -d. -f1) && ms=$(echo "$start" | cut -d: -f3 | cut -d. -f2 | cut -c1-2) && tm=$((10#$h*60+10#$m)) && txt=$(sed -n "$((ln+1))p" "$vtt") && printf "[%02d:%02d.%s]%s\n" "$tm" "$s" "$ms" "$txt" >> "$lrc"; done && rm "$vtt"; done && for flac in *.flac; do [ -f "$flac" ] && metaflac --import-picture-from="$COVER" "$flac" && lrc="${flac%.flac}.lrc" && [ -f "$lrc" ] && metaflac --set-tag="LYRICS=$(cat "$lrc" | tr '\n' '|' | sed 's/|/\\n/g')" "$flac"; 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
#include <iostream> | |
#include <vector> | |
#include <set> | |
#include <string> | |
#include <sstream> | |
#include <arpa/inet.h> | |
#include <cstdint> | |
#include <iomanip> | |
#include <regex> |