Skip to content

Instantly share code, notes, and snippets.

View nerdalert's full-sized avatar
🐈
🦀 🐿

Brent Salisbury nerdalert

🐈
🦀 🐿
View GitHub Profile
  • Yaml from PR:
created_by: ae2015
task_description: >
  Understand when a bullet list of items means that the items are needed
  jointly rather than separately.
seed_examples:
- context: >
    To apply for public benefit XYZ, provide the following:
@nerdalert
nerdalert / Netfilter-IPTables-Diagrams.md
Last active April 9, 2024 09:18
Linux NetFilter, IP Tables and Conntrack Diagrams

Linux NetFilter, IP Tables and Conntrack Diagrams

IPTABLES TABLES and CHAINS

IPTables has the following 4 built-in tables.

1) Filter Table

Filter is default table for iptables. So, if you don’t define you own table, you’ll be using filter table. Iptables’s filter table has the following built-in chains.

Experimental Docker Libnetwork DHCP Driver

The DHCP driver is intended for users to be able to integrate Docker IP address management with their existing IPAM strategies that use DHCP for dynamic address assignment. DHCP enables users to allocate addresses in an organized fashion that will prevent overlapping IP address assignment by associating a unique MAC address from the container eth0 Ethernet interface to an IP address as determined by the DHCP pools defined in the DHCP configuration.

This driver only provides the DHCP client functionality. It does not include a DHCP server. The default driver offers single-host IPAM or for distributed multi-host orchestrated IPAM see the libnetwork overlay driver.

Getting Started

Login Safari vs. Chrome CORS

Chrome:

{"level":"debug","ts":1707200712.9637318,"caller":"oidcagent/handlers.go:125","msg":"Handling login end request"}
{"level":"debug","ts":1707200712.9637408,"caller":"oidcagent/handlers.go:150","msg":"Login success"}
{"level":"debug","ts":1707200712.9637647,"caller":"oidcagent/handlers.go:153","msg":"Unable to access state cookie","error":"http: named cookie not present"}
{"level":"info","ts":1707200712.9637878,"caller":"zap@v0.2.0/zap.go:91","msg":"/web/login/end","status":500,"method":"POST","path":"/web/login/end","query":"","ip":"10.244.1.142","user-agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36","latency":0.000351556,"time":"2024-02-06T06:25:12Z","traceID":"0f0dadd1b81c4b365077a4cd8a802801"}
{"level":"debug","ts":1707200713.0213583,"caller":"oidcagent/handlers.go:104","msg":"Received login end request","requestBody":"POST /web/login/end HTTP/1.1\r\nHost: api.try.nexodus.127.0.0.1.ni

Geneve tunnels using netlink examples

Scenario A - pointing to an interface as the next hop

Host A configuration (eth0 - 192.168.1.191):

# Remote Address is the IP of Host B eth0
sudo ip link add name geneve0 type geneve id 1000 remote 192.168.1.192
sudo ip link set geneve0 up
sudo ip addr add 10.200.1.1/32 dev geneve0

# Final Working with fwmark set on the interface Configuration

REMOTE_KEY=6/CwH/gzz9jdKnxeVpWFivycFQMBkniLeBNFQq0+f04=
sudo wg set wg0 peer $REMOTE_KEY allowed-ips 0.0.0.0/0 persistent-keepalive 25  endpoint 54.227.102.183:41823

# This command enables the src_valid_mark functionality for all network interfaces. This is required for routing marked packets properly with WireGuard.
sudo sysctl -q net.ipv4.conf.all.src_valid_mark=1
# This command adds a rule to the routing policy database (RPDB) that says, "If a packet does not have the firewall mark 51820, look up the routing table 51820."
@nerdalert
nerdalert / vim-cheatsheet.md
Last active November 8, 2023 23:38
VIM Cheatsheet

VIM Cheatsheet

Cursor movement

h - move cursor left
j - move cursor down
k - move cursor up
l - move cursor right

w - jump forwards to the start of a word

# Gist is at https://gist.github.com/nerdalert/9dcb14265a3aea336f40
#
# Macvlan/Ipvlan Manual Driver Tests
# -Bash script form at: https://github.com/nerdalert/dotfiles/blob/master/ipvlan-macvlan-it.sh
############################################################################################
# Macvlan IPv4 802.1q VLAN Tagged Bridge Mode Tests
#
### Network w/o explicit mode to default to -o macvlan_mode=bridge VLAN ID:33
docker network create -d macvlan \
--subnet=192.168.33.0/24 \