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 |
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 | |
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
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 | |
# 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
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 | |
# 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
# Convert millimeters to inches and then to pixels at given DPI | |
# Dimensions in millimeters | |
width_mm = 420 | |
height_mm = 594 | |
# Conversion factor from mm to inches | |
mm_to_inch = 1 / 25.4 | |
# Convert dimensions to inches |
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
:: By Paul Goldschmidt, 12-10-2023 | https://paul-goldschmidt.de/ | |
@echo off | |
start "" "C:\Program Files\eduVPN\Core\eduVPN.Client.exe" | |
:: Countdown timer for 5 seconds | |
for /l %%i in (5,-1,1) do ( | |
cls | |
echo Waiting for confirmation... (%%i seconds remaining) | |
timeout /t 1 /nobreak >nul |
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
{ | |
auto_https off | |
} | |
:80 { | |
root * /site | |
file_server | |
} |
OlderNewer