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
-- **User command to insert a decision template at the current line** -- | |
vim.api.nvim_create_user_command("Decision", function() | |
local template = [[ | |
**Mental/physical state:** | |
- [ ] Energized | |
- [ ] Focused | |
- [ ] Relaxed | |
- [ ] Confident | |
- [ ] Tired |
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
-- Command to create a new zettelkasten style note in 0-inbox of your second brain | |
vim.api.nvim_create_user_command("Zet", function() | |
local directory = os.getenv("SECOND_BRAIN") .. "/0-inbox" or os.getenv("HOME") .. "secondbrain/0-inbox/" | |
-- Get the file name from the user | |
local status, result = pcall(function() | |
Fname = vim.fn.input("File name: ", "", "file") | |
end) | |
-- Handle error (e.g. keyboard interrupt) | |
if not status 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
# Settings | |
:local backupPath path/to/mikrotik.backup | |
:local healthchecksURL https://hc-ping.com/example | |
:local ftpAddress 192.168.1.10 | |
:local ftpFullPath path/to/ftpserver/mikrotik.backup | |
:local ftpUser ftpuser | |
:local ftpPassword password | |
# Check if router can ping WAN | |
if ([/ping 8.8.8.8 count=5]=5) do={ |
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 | |
FILE="/source/" | |
HEALTHCHECKSURL="" | |
RETENTION=10 | |
FILEAGE=1 | |
#### Display command usage ######## | |
usage() | |
{ | |
cat << EOF |
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
import requests | |
payload = {"params": "now"} | |
while True: | |
for ip in range (1, 255): | |
try: | |
print("working on 172.16.31.{}".format(ip)) | |
response = requests.post("http://172.16.31.{}:8008/setup/reboot".format(ip), json=payload, timeout=1.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
import requests | |
payload = {"settings":{"control_notifications":2}} | |
while True: | |
for ip in range (1, 255): | |
try: | |
print("working on 172.16.31.{}".format(ip)) | |
response = requests.post("http://172.16.31.{}:8008/setup/set_eureka_info".format(ip), json=payload, timeout=1.0) |