View docker-compose.yml
version: '3'
services:
proxy:
image: jwilder/nginx-proxy:alpine
labels:
- "com.github.jrcs.letsencrypt_nginx_proxy_companion.nginx_proxy=true"
container_name: nextcloud-proxy
networks:
- nextcloud_default
View copydir.go
package main
import (
"fmt"
"io"
"io/ioutil"
"os"
"path/filepath"
)
View check-smart-errors.sh
#/bin/bash
TMP_FILE=/tmp/check-smart-errors.log
for I in $(ls /sys/block); do
smartctl -a /dev/$I > $TMP_FILE
if [ "$?" -ne "1" ]; then
DEVICE_MODEL="$(smartctl -a /dev/$I | grep -i 'device model')"
echo "DISK $I - $DEVICE_MODEL"
cat "$TMP_FILE" | grep -v "\- 0" | grep Raw_Read_Error_Rate
View tree-folder.sh
#!/bin/sh
FOLDER="/mnt"
MAIL="root"
tree -ah -H $FOLDER --nolinks -- $FOLDER > /tmp/tree-folder.html
echo "See attachment." | mutt -a "/tmp/tree-folder.html" -s "Tree of $FOLDER on `hostname`" -- $MAIL
View retry-function.sh
#! /bin/sh
MAX_RETRIES=3
function sayHelloTo() {
echo "Hello $1!"
if [ -z "$2" ]; then local retry=0; else local retry=$2; fi
# Make something and test
if [ -d "/tmp/" ]
View wget-file-list-recursively.sh
#! /bin/sh
function wgetFind() {
local host="$1"
local path="$2"
local files=$(wget -q -O - "$host$path" | grep -o 'ftp:[^"]*')
while read -r line
do
local file=$(echo "$line" | sed "s#&\#32;#%20#g" | sed "s#$host# #g" | cut -c2-)
if [ "${file#${file%?}}" == "/" ]
View wget-file-size.sh
#! /bin/sh
echo wget -S --spider -O - "http://www.foo.com/file" >&1 2>&1 | grep '^213' | awk '{print $2}'
View filter-wget-progress
#! /bin/sh
function wgetFilter() {
local flag=2 c count cr=$'\r' nl=$'\n'
while IFS='' read -d '' -rn 1 c
do
if [ $flag == 1 ]
then
printf '%c' "$c"
if [[ "$c" =~ (s$) ]]
View rebuild-path.sh
#! /bin/sh
function rebuildPath() {
local path="$1"
local len=${#path}-1
if [ "${path:len}" != "/" ]; then path="$path/"; fi
if [ "${path:0:1}" != "/" ]; then path="/$path"; fi
echo "$path"
}
View url-decode.sh
#! /bin/sh
echo "http%3A%2F%2Fwww.foo.com%2Findex.php%3Fid%3Dqwerty" | sed -e "s/%\([0-9A-F][0-9A-F]\)/\\\\\x\1/g" | xargs -0 echo -e
# http://www.foo.com/index.php?id=qwerty