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 | |
# Telegram Bot API Token and Chat ID | |
TELEGRAM_API_TOKEN="YOUR_TELEGRAM_BOT_API_TOKEN" | |
CHAT_ID="YOUR_CHAT_ID" | |
# Set the threshold for used storage in percentage | |
THRESHOLD=85 | |
# Function to check used storage |
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
containterName="nextcloud" | |
sudo docker exec --user www-data $containterName php occ -V | |
docker-compose stop && docker-compose rm --force && docker-compose pull && docker-compose build --pull && docker-compose up -d | |
docker exec $containterName /bin/bash -c 'apt update && apt install -y libmagickcore-6.q16-6-extra' | |
sudo docker exec --user www-data $containterName php occ db:add-missing-indices | |
sudo docker exec --user www-data $containterName php occ db:convert-filecache-bigint -q | |
sudo docker exec --user www-data $containterName php occ -V |
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 | |
# AUTO-TESTER FOR HDDs - Logs a S.M.A.R.T.-Test and Benchmark to a file with date and drive UUID. By Paul Goldschmidt, 2023-06-26 (HEIDELBERG) | |
# Ask for a HDD to test | |
read -p "Enter HDD to test (e.g., /dev/sdb): " HDD | |
# Perform a short smarttest | |
echo "Starting S.M.A.R.T. short test on $HDD..." | |
sudo smartctl -t short $HDD |
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
import os | |
import qrcode | |
import time | |
# Define the range of five-digit numbers to generate | |
start_number = 10000 | |
end_number = 99999 | |
# Create the export folder if it doesn't exist | |
export_folder = './export' |
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 | |
if [ $# -eq 0 ] | |
then | |
echo "No dump file specified. Usage: ./extract_dbs.sh dumpfile.sql" | |
exit 1 | |
fi | |
# Extract database names from the dump file | |
databases=$(grep -oE '^CREATE DATABASE( IF NOT EXISTS)?( .*)? `[^`]+`(.*)?;' "$1" | sed -r 's/^CREATE DATABASE( IF NOT EXISTS)?( .*)? `(.*)`(.*)?;/\3/') |
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
version: '2.0' | |
services: | |
piaware: | |
image: mikenye/piaware:latest | |
tty: true | |
container_name: piaware | |
mac_address: de:ad:be:ef:13:37 | |
restart: always |
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 | |
today=`date '+%Y-%m-%d_'`; | |
basedir=/some/path/ | |
for filename in $basedir*.jpg; do | |
cutfilename=$(basename $filename) | |
new_filename=$basedir$today$cutfilename | |
mv -v $filename $new_filename | |
done |
NewerOlder