Skip to content

Instantly share code, notes, and snippets.

@marfillaster
marfillaster / router.cfg
Last active April 1, 2024 01:36
MikroTik RouterOS v7 dual DHCP WAN recursive failover w/ PCC load-balancing; and recursive ECMP
# feb/11/2022 11:00:55 by RouterOS 7.2rc3
# software id = 9QK9-C798
#
# model = RB5009UG+S+
# serial number = XXXXXXXXXX
/ip settings set allow-fast-path=no
/interface bridge add admin-mac=FF:FF:FF:FF:FF:FF auto-mac=no name=bridge
@marfillaster
marfillaster / dual.cfg
Last active March 28, 2024 06:32
Mikrotik dual/triple dhcp wan recursive failover w/ pcc load balancing
/interface bridge add name=bridge
/interface bridge port
add bridge=bridge interface=ether3
add bridge=bridge interface=ether2
add bridge=bridge interface=ether1
/interface list
add comment=defconf name=WAN
add comment=defconf name=LAN
@marfillaster
marfillaster / Converge-F670L.md
Last active February 12, 2024 09:40
Converge F670L Bridge mode
  1. Go to Network - WAN - WAN Connection WAN Connection
  2. Right click Type Route dropdown select and click "Inspect" in the context menu.
    In console, run the code below:
    document.getElementById('Frm_mode').options[document.getElementById('Frm_mode').options.selectedIndex].setAttribute('value', 'BRIDGE');
    Change_mode();
    
    output2
  3. Input New Connection Name. Example: Bridge. Click Create.
@marfillaster
marfillaster / unifi_container_rb5009.md
Last active December 30, 2023 14:03
Running Unifi Network Controller as a container in MikroTik ROSv7 RB5009

Requirement

  • USB flash drive - this is where the container filesystem will be persisted

Set-up docker bridge network

/interface bridge add name=docker

Set-up veth to be used by container

@marfillaster
marfillaster / gist:d34bd199b9e265ccd74af6d31fd9df85
Last active October 9, 2023 05:51
Mikrotik IPv6 dns-over-https doh cloudflare google
# https://forum.mikrotik.com/viewtopic.php?t=132657
/ipv6 dhcp-server option
add code=23 name=recursivens6 value=0xfd000000000000000000000000000001
/ipv6 dhcp-server
add dhcp-option=recursivens6 interface=bridge lease-time=30m name=dhcp6
/ipv6 pool
add name=ULA-pool6 prefix=fd00::/64 prefix-length=64
@marfillaster
marfillaster / guide.md
Last active March 8, 2023 08:36
yubikey ssh ykcs11 in osx
# ~/.ssh/config
Host *
    PKCS11Provider /usr/local/lib/libykcs11.dylib

brew install ykman yubico-piv-tool

# Generate key
ykman piv keys generate -aRSA2048 --pin-policy ONCE --touch-policy NEVER 9a public.pem
@marfillaster
marfillaster / README.md
Last active February 1, 2023 10:07
WSL Desktop Launched i3wm

WSL Desktop Launched i3wm

Requirements VcXsrv, i3wm in wsl.

The three files below must be stored in the same directory (%UserProfile%\Desktop).

  • i3.vbs - This is the entrypoint script. It runs i3.bat in the background.
  • i3.bat - Runs VcXsrv using d0.xlaunch profile then starts i3
  • d0.xlaunch - VcXsrv in "One window without titlebar" mode at DISPLAY=:0
@marfillaster
marfillaster / gist:bc79f4dc789f814f81c7b05060325469
Last active October 14, 2022 04:46
Expo.io WSL2 port-forwarding

set REACT_NATIVE_PACKAGER_HOSTNAME to host IP

wsl$ ifconfig eth0 | grep 'inet '
        inet 172.19.131.1  netmask 255.255.240.0  broadcast 172.19.143.255

PS Admministrator> netsh interface portproxy add v4tov4 listenport=19000 listenaddress=0.0.0.0 connectport=19000 connectaddress=172.19.131.1
PS Admministrator> netsh interface portproxy add v4tov4 listenport=19001 listenaddress=0.0.0.0 connectport=19001 connectaddress=172.19.131.1
@marfillaster
marfillaster / guide.md
Last active September 6, 2022 12:32
Ubiquiti UniFi Guest SSID on VLAN using MikroTik router hybrid port
  • Main network on 192.168.88.0/24
  • Guest network on 172.16.0.0/24 VLAN20
  • UniFi AP is connected to a MikroTik router ether2 via DHCP assignment
  • UniFi AP can be managed on via main network
  • MikroTik initially on default configuration
/interface bridge port
add bridge=bridge interface=ether2

Nginx configuration

listen       443 ssl;
ssl_certificate /etc/ssl/certs/nginx.cert;
ssl_certificate_key  /etc/ssl/private/nginx.key;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_prefer_server_ciphers on;
ssl_ciphers 'EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH';

Generate self signed certificate