Skip to content

Instantly share code, notes, and snippets.

View kroteau's full-sized avatar
🌴
On vacation

Stas Krotov kroteau

🌴
On vacation
View GitHub Profile
@kroteau
kroteau / ddns-access-ip-whitelist.rsc
Created February 21, 2024 22:50
Simple ip whitelisting mikrotik
/ip firewall address-list add list=mobile address=my_mobile_mobile_phone.duckdns.org comment=sane_comment_here
# address is a fqdn you'll get from your ddns provider, your phone should have something to send rest requests to ddns provider
/ip firewall nat add chain=dstnat action=dst-nat in-interface=ether1 to-addresses=192.168.88.2 to-ports=443 protocol=tcp src-address-list=mobile
# in-interface=ether1 is just a common case, one can make use of in-interface-list=WAN if interface lists are configured
# to-addresses - LAN ip of your computer here, single IP
# src-address-list - value shoul match to the "list" from the first line
# Move the rule above your deny rules like this
# /ip firewall nat print
@kroteau
kroteau / ddns.rsc
Last active June 19, 2022 13:03
Mikrotik DuckDns Updater w/IPv6 support
# inspired by https://github.com/beeyev/Mikrotik-Duckdns-Dynamic-IP-Updater
# DuckDNS Sub Domain
:local duckdnsSubDomain "CHANGEME"
# DuckDNS Token
:local duckdnsToken "CHANGEME"
# Online services which respond with your IPv4
:local ipv4detectList {"https://api4.my-ip.io/ip.txt"; "http://v4.ipv6-test.com/api/myip.php"}
# Online services which respond with your IPv6
@kroteau
kroteau / win-ssh-git-keepass-pageant.md
Last active May 30, 2022 19:34
windows ssh & git with keys from keepass using keeagent (and scoop.sh)

Windows

to simplify the process I'm using scoop, one can replace scoop steps with manual installs

  1. Install win32-openssh Add-WindowsCapability -Online -Name OpenSSH.Client~~~~0.0.1.0
  2. Install scoop from https://scoop.sh
  3. Enable extras bucket in scoop scoop bucket add extras
  4. Install keepass and keeagent scoop install keepass keepass-plugin-keeagent
  5. Add a ssh privatekey to an entry in keepass
  6. Enable the file in the entry to be visible for keeagent
  7. Make sure it is visible in the tools->keeagent menu and ssh-add -l
  8. Check for system ssh.exe available under path with where ssh or cmd /c where ssh(if executed from powershell), you should see C:\Windows\System32\OpenSSH\ssh.exe