MYSQL_DOCKER_CONTAINER=${1:-sp_docker_mysql_1}
MYSQL_DOCKER_CONTAINER=${OTHER_VAR:-sp_docker_mysql_1}
#!/bin/bash
tables=("customers" "orders" "items")
for i in "${tables[@]}"
do
echo ${i}
done
if [ -z "$1" ]; then
echo "You must provide arg"
exit 1
fi
# Replace string
find . -type f \
-name '*.go' \
-exec sed -i -e "s,old_str,new_str,g" {} \;
# Remove backup files generated by sed
find . -type f -name '*.go-e' -delete
if [ ! -f "./file" ]; then
echo "file doesn't exist"
exit 1
fi
#!/bin/bash
ENV_FILE=.env
# Check existence of .env file
if [ ! -f "$ENV_FILE" ]; then
echo ".env doesn't exist. Rename example file and fill it: mv .env.example .env && nano .env"
exit 1
fi
# Load variables from .env file
source $ENV_FILE
# Parse -c option
CLEAR=false
while getopts ":c" opt; do
case ${opt} in
c )
CLEAR=true
;;
\? ) echo "Usage: ./scripts/set_webhook.sh [-c], where -c - clear existing webhook"
exit 2
;;
esac
done
# Build request params
REQ_PARAMS="url=$WEBHOOK_URL"
if [ $CLEAR = true ]; then
REQ_PARAMS='url='
fi
echo "Response from Telegram on /setWebhook request:"
curl -F $REQ_PARAMS "https://api.telegram.org/bot$TELEGRAM_API_TOKEN/setWebhook"
printf "\n"
Нужно установить mkvtoolnix
. Вызывать так: ./conv.sh .
Выходной файл будет потом в папке BDMV/STREAM
#!/bin/bash
BDMV_FOLD=`find "$1" -name "BDMV" -print0`
if [[ $BDMV_FOLD == *BDMV* ]]; then
# cd to the ./BDMV/STREAM sub folder
cd "$BDMV_FOLD/STREAM/"
# Find the biggest .M2TS file, usually the movie
BIGST_M2TS=`find . -type f | xargs ls -1S | head -n 1 | rev | cut -c 6- | rev`
# MkvMerge the file
mkvmerge -o "$BIGST_M2TS".mkv --compression -1:none "$BIGST_M2TS".m2ts
# Change MKV permission to -rw-r--r-- and move file out of STREAM folder
chmod 644 "$BIGST_M2TS".mkv
mv "$BIGST_M2TS".mkv "$1"
echo "MKV created! ("$1")"
else
echo "BDMV2Mkv: no processing"
fi
heic-to-jpg() {
# brew install imagemagick
magick mogrify -monitor -format jpg *.heic
echo "Remove .heic files? [y/n]"
read remove
if [[ "$remove" == "y" ]]; then
find . -depth 1 -name "*.heic" -delete
fi
}