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
# ./dav.sh 8090 /mnt/data/joplin | |
PORT=$1 | |
DATA_DIR=$2 | |
NAME=`basename $DATA_DIR` | |
CACHE_DIR=/var/cache/dav/$NAME | |
#rm -fR $CACHE_DIR | |
mkdir -p $CACHE_DIR | |
chmod -fR 777 $CACHE_DIR | |
/home/linuxbrew/.linuxbrew/bin/rclone serve webdav --htpasswd $DATA_DIR/.htpasswd --addr :$PORT $DATA_DIR --buffer-size 512M --dir-cache-time 15m --cache-dir $CACHE_DIR --vfs-cache-mode full --vfs-cache-max-size 4G --no-checksum --vfs-case-insensitive --vfs-disk-space-total-size 4G 2>&1 > /var/log/rclone.log & | |
exit 0 |
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
# ./dav.sh 8090 /mnt/data/joplin | |
PORT=$1 | |
DATA_DIR=$2 | |
NAME=`basename $DATA_DIR` | |
CACHE_DIR=/var/cache/dav/$NAME | |
#rm -fR $CACHE_DIR | |
mkdir -p $CACHE_DIR | |
chmod -fR 777 $CACHE_DIR | |
/home/linuxbrew/.linuxbrew/bin/rclone serve webdav --user $NAME --pass $NAME --addr :$PORT $DATA_DIR --buffer-size 512M --dir-cache-time 15m --cache-dir $CACHE_DIR --vfs-cache-mode full --vfs-cache-max-size 4G --vfs-cache-max-size 1G --no-checksum --vfs-case-insensitive --vfs-disk-space-total-size 4G 2>&1 > /var/log/rclone.log & | |
exit 0 |
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
# ./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 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 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 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
# Simple 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 | |
date | |
echo "Saving partition map of ${PART}..." | |
fdisk -l /dev/${PART} > ${PART}.fdisk | |
cat ${PART}.fdisk | |
echo "Saving boot sector of ${PART}..." | |
dd bs=2048 count=1 if=/dev/${PART} of=${PART}.mbr |
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
# /etc/fstab: static file system information. | |
# <file system> <mount point> <type> <options> <dump> <pass> | |
UUID=XXXX-XXXX /boot/efi vfat umask=0077,x-gvfs-show,x-gvfs-name=EFI 0 0 | |
UUID=XXXXX /mnt/f2fs f2fs rw,relatime,lazytime,background_gc=on,discard,no_heap,user_xattr,inline_xattr,inline_data,inline_dentry,flush_merge,extent_cache,mode=adaptive,active_logs=6,alloc_mode=default,fsync_mode=posix,background_gc=on,user_xattr,x-gvfs-show,x-gvfs-name=PopOs 0 0 | |
UUID=XXXXX /mnt/ext4 ext4 nofail,noatime,nodiratime,discard,commit=90,max_batch_time=50022,min_batch_time=5000,journal_ioprio=0,errors=remount-ro,x-gvfs-show,x-gvfs-name=data 0 0 | |
UUID=XXXX-XXXX /mnt/exfat exfat nofail,noatime,nodiratime,rw,allow_utime=2,nosuid,nodev,umask=0022,dmask=0022,uid=1000,gid=1000,user,x-gvfs-show,x-gvfs-name=data 0 0 | |
UUID=XXXXXXXXXXXXXX /mnt/ntfs ntfs-3g nofail,rw,relatime,umask=0022,user_id=1000,group_id=1000,user,allow_other,big_writes,lazytime,windows_names,noatime,nodiratime,x-gvfs-show,x-gvfs-name=data2-ntfs,nosuid,nodev |
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
umount $1 | |
fsck.ext4 -v -F -f -p -D -E inode_count_fullmap,optimize_extents, $1 | |
mount $1 |
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
umount $1 | |
fsck.ext4 -f -c -k -p -t -v -D -E inode_count_fullmap $1 | |
mount $1 |
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
<?php | |
/** | |
* Escape markdown text | |
* | |
* @param string $text the markdown text to escape | |
* | |
* @return string escaped text | |
*/ | |
function markdown_escape($text) { | |
return str_replace([ |
NewerOlder