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
# ./dlna.sh 8080 /mnt/data/audio | |
PORT=$1 | |
DATA_DIR=$2 | |
NAME=`basename $DATA_DIR` | |
CACHE_DIR=/var/cache/dlna/$NAME | |
#rm -fR $CACHE_DIR | |
mkdir -p $CACHE_DIR | |
chmod -fR 777 $CACHE_DIR | |
/home/linuxbrew/.linuxbrew/bin/rclone serve dlna --addr :$PORT $DATA_DIR --buffer-size 1G --dir-cache-time 24h --cache-dir $CACHE_DIR --vfs-cache-mode full --vfs-cache-max-size 1G --vfs-cache-max-size 16M --no-checksum --no-modtime --vfs-case-insensitive --vfs-disk-space-total-size 4G --name $NAME 2>&1 > /var/log/rclone.log & | |
exit 0 |
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
[Unit] | |
Description=rclone dlna service | |
Documentation=man:rclone(1) | |
After=network.target auditd.service | |
[Service] | |
ExecStart=rclone serve dlna --addr :8080 \ | |
--vfs-cache-mode full \ | |
--vfs-cache-max-age 60m \ | |
--vfs-cache-max-size 32768 \ |
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
[Unit] | |
Description=rclone sftp service | |
Documentation=man:rclone(1) | |
After=network.target auditd.service | |
[Service] | |
ExecStart=rclone serve sftp --no-auth --addr :2022 \ | |
--vfs-cache-mode full \ | |
--vfs-cache-max-age 10m \ | |
--vfs-cache-max-size 32768 \ |
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
# Improved Windows 10 backup script to backup a Windows 10 installation (EFI or MBR) using the /dev/ name, e.g. if on sda run "sh win10backup.sh sda" | |
PART=$1 | |
# Check if partition is provided | |
if [ -z "$PART" ]; then | |
echo "Error: Partition not specified" | |
exit 1 | |
fi |
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 | |
# Check if the user has provided a device argument | |
if [ -z "$1" ]; then | |
echo "Usage: $0 <device>" | |
exit 1 | |
fi | |
DEVICE=$1 |
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 | |
# Check if the user has provided a device or partition argument | |
if [ "$#" -ne 1 ]; then | |
echo "Usage: $0 <device>" | |
exit 1 | |
fi | |
DEVICE=$1 |
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
<?php | |
/** | |
* Escape markdown text | |
* | |
* @param string $text The markdown text to escape | |
* | |
* @return string Escaped text | |
*/ | |
function markdown_escape($text) { | |
// Define a regex pattern for all special characters in markdown |
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 <new-hostname>" | |
exit 1 | |
} | |
# Check if the user has provided a hostname argument | |
if [ $# -eq 0 ]; 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 | |
# Function to handle errors and log them | |
handle_error() { | |
echo "Error: $1" >> backup.log | |
exit 1 | |
} | |
# Check if adb is available | |
command -v adb >/dev/null 2>&1 || { |
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/php | |
<?php | |
// show and optionally rename files and dirs to transliterated unaccented ascii from current working folder | |
// 2019-12-24 Vijay Mahrra [email protected] | |
// code is public domain | |
define('DEBUG', true); // use pre-generated file list | |
define('VERBOSE', true); | |
define('RENAME', false); // allow renaming | |
define('RENAME_FILES', false); |