Skip to content

Instantly share code, notes, and snippets.

@mdpuma
mdpuma / voxility.sh
Created July 11, 2021 15:11
voxility.sh
#!/bin/bash -e
action=$1
argument=$2
IPS="1.1.1.1/24 2.2.2.2/24"
case "$action" in
listips)
#for i in $IPS; do
@mdpuma
mdpuma / gist:12a73204fbb9e0fa6b43ce45affdb0c9
Last active February 23, 2021 09:48
tcpdump vlan capture tag priority
#!/bin/sh
# VLANID is 10 | 0xa
# VLANID is 20 | 0x14
# VLANID is 3342 | 0x0d0e
# VLANID is 3340 | 0x0d0c
# https://www.binaryhexconverter.com/hex-to-binary-converter
# https://www.tcpdump.org/manpages/pcap-filter.7.html
@mdpuma
mdpuma / bgp_agent.map
Last active January 23, 2022 16:20
pmacctd monitor incoming traffic mismatch
bgp_ip=127.0.0.1 ip=0.0.0.0/0
@mdpuma
mdpuma / vsololt.rb
Created December 13, 2020 07:18
VSOL OLT oxidized model
class VSOLOLT < Oxidized::Model
prompt /^([\w.@()-]+[#>]\s?)$/
comment '! '
cmd :all do |cfg|
cfg.gsub! /^% Invalid input detected at '\^' marker\.$|^\s+\^$/, ''
cfg.cut_both
end
@mdpuma
mdpuma / gist:2ba5a4faa6d413fa84687a697b2799f6
Last active November 27, 2020 08:32
Giramondo Symbol MC3190
Q: Wifi cant connect
A: Disable in Wifi Options -> Regulatory -> Enable 802.11d
2x rdp client
https://kb.parallels.com/en/124103
@mdpuma
mdpuma / Filter BPDU packets on bridge
Last active August 19, 2025 12:38
Mikrotik scripts
/interface bridge filter
add action=drop chain=output comment="DROP RSTP BPDU" dst-mac-address=\
01:80:C2:00:00:00/FF:FF:FF:FF:FF:FF out-interface=ether1
add action=drop chain=output comment="DROP RSTP BPDU" dst-mac-address=\
01:80:C2:00:00:00/FF:FF:FF:FF:FF:FF out-interface=ether10
# no interface
add action=drop chain=output comment="DROP RSTP BPDU" dst-mac-address=\
01:80:C2:00:00:00/FF:FF:FF:FF:FF:FF out-interface=*45
DHCP client port 68
DHCP server port 67
client > server discover broadcast
client > server request unicast
server > client reply ACK unicast
@mdpuma
mdpuma / fix cpanel iptables rules insertion
Created April 12, 2020 06:56
Fixing cpanel cP-Firewall-1-INPUT rules insertion
crontab -e
*/5 * * * * /sbin/iptables -D INPUT -j cP-Firewall-1-INPUT 2> /dev/null && echo "cP-Firewall-1-INPUT Removed"
@mdpuma
mdpuma / gist:429a4feecd1bc29887fed9bb3fa2af43
Last active April 11, 2024 08:11
strace by process name
#!/bin/bash
strace $(pidof php-fpm | xargs -n1 | xargs -I{} echo -n ' -p {}')
strace $(ps -ef | grep lsphp | grep USER | cut -d ' ' -f2 | xargs -I{} echo -n ' -p {}')
# chatgpt generated version
# strace by user name
strace -p $(pgrep -u USER -d,)
@mdpuma
mdpuma / autostart
Last active November 19, 2024 09:41
raspberry pi automate tv
#!/bin/bash
# .config/lxsession/LXDE-pi/autostart
@lxpanel --profile LXDE-pi
@pcmanfm --desktop --profile LXDE-pi
#@xscreensaver -no-splash
chromium-browser --app=https://grafana.iphost.md/d/7gv6kakMz/tv?orgId=1\&refresh=1m\&kiosk --start-fullscreen
chromium-browser --app=https://grafana.iphost.md/d/DzTc96zGk/tv2?orgId=1\&refresh=1m\&kiosk --start-fullscreen --window-position=1920,0
xset -display :0 -dpms