Skip to content

Instantly share code, notes, and snippets.

@ericwoud
ericwoud / script-downstream.sh
Created September 25, 2024 19:08
Test scripts for setting up bridge/ipforward/vlan/802.1q/802.1ad/pppoe
#!/bin/bash
intf="eth1"
o="$1"
echo 1 >/proc/sys/net/ipv4/ip_forward
echo 1 >/proc/sys/net/ipv4/conf/$intf/forwarding
ip link set $intf up
/*
Old news in this gist, development continues here:
https://github.com/ericwoud/linux/tree/net-phy-realtek-next
to create pull request to:
https://github.com/dangowrt/linux/tree/net-phy-realtek-next
@ericwoud
ericwoud / 79-hidraw-by-id-and-by-path.rules
Created November 4, 2022 19:02
Create symlinks /dev/hidraw/by-id/xxxxx and /dev/hidraw/by-path/xxxxx for all hidraw devices
# /etc/udev/rules.d/79-hidraw-by-id-and-by-path.rules
# Create symlinks /dev/hidraw/by-id/xxxxx and /dev/hidraw/by-path/xxxxx
ACTION!="add", GOTO="hidraw-by-id-and-by-path-end"
SUBSYSTEM!="hidraw", GOTO="hidraw-by-id-by-path-end"
IMPORT{builtin}="usb_id"
ENV{ID_SERIAL}=="?*", SYMLINK+="hidraw/by-id/$env{ID_BUS}-$env{ID_SERIAL}"
@ericwoud
ericwoud / etc_systemd_system_oscam.service.d_override.conf
Created July 30, 2022 06:44
Oscam helper script to restart reader on error
[Unit]
Description=A helper service to execute and monitor oscam written in Python
[Service]
Environment=PYTHONUNBUFFERED=true CONFIGPATH=/var/lib/oscam
ExecStart=
ExecStart=/usr/bin/python3 /usr/local/bin/oscam.py
SyslogIdentifier=oscam-py
Type=simple
TimeoutStopSec=1
@ericwoud
ericwoud / Hostapd - One vlan per interface or bss and use of environment variables.md
Last active December 29, 2020 12:26
Hostapd - One vlan per interface or bss and use of environment variables.

Hostapd - One vlan per interface or bss and use of environment variables.

Instead of using dynamic vlan and radius, there is another way of implementing vlan with hostapd.

It is possible to set up one vlan per interface and one vlan per bss. The interfaces and bsses need to be added to a vlan aware bridge. The only problem is to keep WPA-PSK functional,

@ericwoud
ericwoud / ssh-fix-reboot.service
Last active August 31, 2023 15:36
Improved Secure Shell session cleanup. It delays shutdown until all sessions are closed.
[Unit]
Description=Secure Shell session cleanup V2
Wants=network-online.target
After=network.target network-online.target hostapd.service
[Service]
SyslogIdentifier=ssh-fix-reboot
RemainAfterExit=yes
Type=oneshot
TimeoutSec=10