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 | |
cd /volume1/homecloud/backup | |
CURRENT_DIR=`pwd` | |
# Remove oldest backup | |
rm -rf $CURRENT_DIR/7.tar.gz | |
# Rotate backups | |
mv $CURRENT_DIR/6.tar.gz $CURRENT_DIR/7.tar.gz |
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/python3 | |
import broadlink | |
from datetime import datetime | |
# https://github.com/mjg59/python-broadlink/blob/master/broadlink/__init__.py | |
thermostats = [ | |
{ | |
"name": "thermostat1", |
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 | |
backup_path="/storage/backup" | |
for i in `docker inspect --format='{{.Name}}' $(docker ps -q) | cut -f2 -d\/` | |
do container_name=$i | |
echo -n "$container_name - " | |
container_image=`docker inspect --format='{{.Config.Image}}' $container_name` | |
mkdir -p $backup_path/$container_name | |
save_file="$backup_path/$container_name/$container_name-image.tar" |
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
# Routing | |
*nat | |
:PREROUTING ACCEPT [2:139] | |
:INPUT ACCEPT [0:0] | |
:OUTPUT ACCEPT [0:0] | |
:POSTROUTING ACCEPT [0:0] | |
:DOCKER - [0:0] | |
-A PREROUTING -m addrtype --dst-type LOCAL -j DOCKER | |
-A OUTPUT ! -d 127.0.0.0/8 -m addrtype --dst-type LOCAL -j DOCKER | |
-A POSTROUTING -s 172.17.0.0/16 ! -o docker0 -j MASQUERADE |
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 | |
// Change to your LAN IP subnet | |
preg_match('/^192\.168\.0\.\d{1,3}$/', $_SERVER['REMOTE_ADDR'], $output); | |
if (!$output) { | |
die('Access denied'); | |
} | |
/* To generate bearer, go to Grafana confiration page, select API Keys and create Viewer API Key */ |
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
/** | |
* | |
* Pakeičiam skaičių į žodį skaičiams nuo 1 iki 99 | |
* | |
*/ | |
function number_to_literal($sk) { | |
$v_sk = array(0 => '', | |
'vieno', 'dviejų', 'trijų', 'keturių', 'penkių', 'šešių', 'septynių', 'aštuonių', 'devynių', 'dešimt', |