Skip to content

Instantly share code, notes, and snippets.

View danitool's full-sized avatar

Daniel González Cabanelas danitool

  • Pontevedra
View GitHub Profile
@danitool
danitool / rt5392-WDS-script.sh
Created December 23, 2020 18:41
WDS script to set this mode the TD-W8968 v2 router
#!/bin/sh
while [[ -z "$(ifconfig | awk '$1 == "apcli0" {print $1}')" ]] || [[ -z "$(ifconfig | awk '$1 == "ra0" {print $1}')" ]]; do
sleep 66
done
RTCONFIG="/var/Wireless/RT2860AP/RT2860AP.dat"
wait=9
while true; do
@danitool
danitool / broadcom_wl-WDS.txt
Created November 29, 2018 14:41
commands to configure the broadcom propietary driver in WDS pure bridge mode (no stations allowed)
-- remove the driver to clean up --
wlctl -i wl0 down
rmmod wl
insmod wl
-- set WPA2-AES encryption --
wlctl -i wl0 wsec 4
wlctl -i wl0 wpa_auth 128
wlctl -i wl0 wsec_restrict 1
wlctl -i wl0 eap 0
@danitool
danitool / rt5392-WDS.txt
Last active December 4, 2020 14:19
Configure manually WDS with the proprietary rt5390 driver, found in routers like Tplink TD-W8968 v2
*************************************************************************
First router
*************************************************************************
Configure WDS on the first router (MAC address=00:11:11:11:11:11):
ifconfig ra0 down
ifconfig apcli0 down
ifconfig wds0 down
rmmod rt5390ap
@danitool
danitool / gist:3999cca3c8f415e8e1defc70226d5b90
Created June 11, 2018 09:54
Generate md5 encrypted password for passwd file with blank salt
openssl passwd -salt "" -1 "mipassword"
@danitool
danitool / build-wget.sh
Created June 10, 2018 22:25
Cross compile static wget for mips
#!/bin/bash
export CROSS_COMPILE=/opt/trendchip/mips-linux-uclibc/usr/bin/mips-linux
export AR=${CROSS_COMPILE}-ar
export AS=${CROSS_COMPILE}-as
export LD=${CROSS_COMPILE}-ld
export RANLIB=${CROSS_COMPILE}-ranlib
export CC=${CROSS_COMPILE}-gcc
export CPP=${CROSS_COMPILE}-cpp
export NM=${CROSS_COMPILE}-nm
export LIBS="-static"
@danitool
danitool / nanostationfix
Last active July 4, 2018 15:17
nanostation 2 (bg) port forwarding fix
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
@danitool
danitool / mac-watchdog.sh
Created December 21, 2016 12:26
check if a MAC device exists on the local network and alerts by sending an email
#!/bin/sh
# MAC watchdog, checks if a MAC device exists on the local network and alerts by sending an email
# 2016 by danitool, Tki2000, txutxy
CORREO="mi correo@gmail.com"
MAC="00:11:22:33:44:55"
RANGO_IP=192.168.3.1-254
FLAG=0
while :
do
@danitool
danitool / brcm63268-irqfind.sh
Created December 21, 2016 12:20
find external IRQs at GPIO lines in broadcom BCM63268
#!/bin/sh
GPIOBASE=`cat /sys/class/gpio/gpiochip*/base | head -n1`
nums=`seq 0 51`
cd /sys/class/gpio
for i in $nums; do
GPIO=`expr $i + $GPIOBASE`
echo
echo "[GPIO$i] testing ext IRQ"
echo $GPIO > export; echo out > gpio$GPIO/direction