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
#!/usr/bin/python3 | |
import requests | |
from sendnotify import send_telegram_message | |
cfToken = 'API Token' | |
cfEmail = 'email@address' | |
cfZoneID = 'Zone ID' | |
cfRecordID = 'Record ID' | |
cfRecordName = 'domain name' | |
header = {"X-Auth-Email": cfEmail, "X-Auth-Key": cfToken, "Content-Type": "application/json"} |
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
# Don't forget to change the "wanInterface" value below to your PPPoE interface | |
:global reconnectCount; | |
:local wanInterface "pppoe-out1"; | |
:if ($"local-address" in 100.64 .0.0/10) do={ | |
:if ($reconnectCount < 10) do={ | |
:set reconnectCount ($reconnectCount+1); | |
:log warning ("$wanInterface: Got Private IP ".$"local-address"." Reconnecting the interface..."); |
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
# Mikrotik Script for loop until get the public IP from NT | |
# and then set DNS A record to that public IP. | |
# | |
# Update WANIF to match your interface name. And all CloudFlare required key and info. | |
# | |
# Put this into the ppp profile UP script and assign to pppoe connection | |
# | |
:local WANIF "pppoe-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
:global reconnectCount; | |
:local wanInterface "pppoe-out1"; | |
:while ( $"local-address" in 100.64.0.0/10 ) do={ | |
:log warning ("$wanInterface: Got Private IP ".$"local-address"." Reconnecting the interface..."); | |
/interface pppoe-client disable $wanInterface; | |
:delay 10s; | |
/interface pppoe-client enable $wanInterface; | |
}; | |
:log info ("$wanInterface: Got IP ".$"local-address"); |
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
#=== Unifi Controller === | |
# Add this line to apt source list | |
deb http://archive.raspbian.org/raspbian stretch main contrib non-free rpi | |
# add key | |
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 9165938D90FDDD2E | |
# download installer | |
wget https://dl.ui.com/unifi/7.3.83/unifi_sysvinit_all.deb |
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 | |
### Date: December 2022 | |
### Description: Script to send a notification to Telegram about the RCLONE status. | |
### Version: | |
#### 0.1 - initial release | |
# | |
# Import global variable | |
# |
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 | |
clear | |
while : | |
do | |
cat cowfile | cowsay | |
inxi -F | |
sleep 3 | |
for TXTFILE in *.txt; do | |
cat $TXTFILE |
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
from sqlalchemy.orm import sessionmaker | |
from sqlalchemy import create_engine, MetaData, Table | |
# Using SQLAlchemy reflection example | |
engine = create_engine('connectionstringhere') | |
table1meta = MetaData(engine) | |
table1 = Table('Table_I_Want_to_Interact', table1meta, autoload=True) | |
DBSession = sessionmaker(bind=engine) | |
session = DBSession() | |
results = session.query(table1).filter(table1.columns.TimeStamp>="2019-02-26 18:00:00.000") |
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
# MikroTik – Syslog | |
source s_mikrotik { udp(port(514)); }; | |
destination d_mikrotik { file("/var/log/mikrotik.log"); }; | |
filter f_mikrotik { host("192.168.88.1"); }; | |
log { source(s_mikrotik); destination(d_mikrotik); filter(f_mikrotik); }; |
NewerOlder