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 | |
| # Function to display usage information | |
| usage() { | |
| echo "Usage: $0 /path/to/input.mp4 [ /path/to/output_directory ]" | |
| exit 1 | |
| } | |
| # Check if at least one argument (input file) is provided | |
| if [ $# -lt 1 ]; then |
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 | |
| BOT_TOKEN="<token>" | |
| CHAT_ID="<id>" | |
| TELEGRAM_USERNAME="<username>" | |
| send_telegram_message() { | |
| local message="$1" | |
| curl -s -X POST "https://api.telegram.org/bot$BOT_TOKEN/sendMessage" \ | |
| -d chat_id="$CHAT_ID" \ |
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
| # SETUP # | |
| DOMAIN=example.com | |
| PROJECT_REPO="git@github.com:example.com/app.git" | |
| AMOUNT_KEEP_RELEASES=5 | |
| RELEASE_NAME=$(date +%s--%Y_%m_%d--%H_%M_%S) | |
| RELEASES_DIRECTORY=~/$DOMAIN/releases | |
| DEPLOYMENT_DIRECTORY=$RELEASES_DIRECTORY/$RELEASE_NAME | |
| # stop script on error signal (-e) and undefined variables (-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
| importScripts('spark-md5.min.js'); | |
| function calcMD5(f) { | |
| var blobSlice = Blob.prototype.slice; | |
| var chunkSize = 2097152; | |
| var chunks = Math.ceil(f.size/chunkSize); | |
| var spark = new SparkMD5.ArrayBuffer(); | |
| var currentChunk = 0; | |
| var fr = new FileReader(); |