Skip to content

Instantly share code, notes, and snippets.

View yakatz's full-sized avatar

Yehuda Katz yakatz

View GitHub Profile
@luckman212
luckman212 / v6test.sh
Last active October 23, 2023 02:38
script for pfSense to detect IPv6 router advertisements coming from a WAN interface
#!/bin/sh
# set the variable below to your FIOS interface
IF=igb0
/usr/bin/timeout 5m /usr/sbin/tcpdump -ni ${IF} 'icmp6 && ip6[40] == 134' >/tmp/${IF}_RAs.out
FSIZE=$(/usr/bin/stat -f '%z' /tmp/${IF}_RAs.out)
if [ "$FSIZE" -gt 1 ]; then
echo '<?php include("notices.inc"); $msg = "IPv6 RAs detected on interface '$IF'"; notify_via_smtp($msg);?>' | /usr/local/bin/php -q
fi
@elomatreb
elomatreb / LogSqlProvider.php
Created February 6, 2016 19:22
Laravel Service Provider that logs all SQL queries (with bindings).
<?php
namespace App\Providers;
use Illuminate\Support\ServiceProvider;
use DB;
use Log;
/**
@praseodym
praseodym / hubot.service
Last active May 10, 2017 15:39
Hubot systemd service file
[Unit]
Description=Hubot
Requires=network.target
After=network.target
[Service]
Type=simple
WorkingDirectory=/opt/hubot
User=hubot
@ccpz
ccpz / gist:6960941
Created October 13, 2013 11:01
Define of backdoor string ( DBACKDOOR_SIGNATURE & DXMLSET_BACKDOOR_USER_AGENT) at DLink DI-524 UP GPL source code http://tsd.dlink.com.tw/downloads2008list.asp?t=1&OS=GPL&SourceType=download GPL_Di524up\user\xsupplicant-1.2.2\config.log
configure:2243: /opt/toolchain_mips_nofpu/bin/mips-linux-gcc -Os -mips1 -msoft-float -fPIC -Dlinux -D__linux__ -Dunix -DEMBED -I/opt/20051017/RealTek865x_062/include -nostdinc -I/opt/20051017/RealTek865x_062/lib/uClibc/include -I/opt/20051017/RealTek865x_062/lib/libcrypt -I/opt/20051017/RealTek865x_062/lib/uClibc/include -I/opt/20051017/RealTek865x_062/lib/libcrypt -I/opt/20051017/RealTek865x_062 -idirafter /opt/toolchain_mips_nofpu/usr/bin/../lib/gcc-lib/mips-linux-uclibc/3.3.3//include -I/opt/20051017/RealTek865x_062/linux-2.4.x/include -DPRODUCT_NAME="\"DI-724UP+A\"" -DUSB_LED_GPIO_A5 -DDI524UP=1 -DUSER_DEFINE_DAYLIGHT_SAVING=1 -DDONT_TOUCH_TTL -DALOG_NOTICE=224 -DALOG_DROP=216 -DALOG_ATTACK=208 -DALOG_DEBUG=200 -DALOG_SYSACT=192 -DXMLSETC_SEP_CHAR=0x07 -DCONFIG_WIRELESS_CARD_REALTEK=1 -DCONFIG_ALPHA_SMRTNTKY=1 -DUSB_DEVICE=1 -DUSE_PRINTER=1 -DCONFIG_WAN_BIGPOND=1 -I/opt/20051017/RealTek865x_062/user/goahead-2.1.4/LINUX -I/opt/20051017/RealTek865x_062/user/alpha_websrv -I/opt/20051017/RealTek865x_0
@admackin
admackin / mysql-backup.sh
Last active October 25, 2022 08:54
Rolling MySQL database backups
#!/bin/sh
# use with cron entries such as:
#3 */2 * * * $HOME/bin/mysql-backup.sh dbname backupname hourly H
#8 1 * * * $HOME/bin/mysql-backup.sh dbname backupname daily a
#33 2 1,8,15,23 * * $HOME/bin/mysql-backup.sh dbname backupname weekly d
#33 2 28 * * $HOME/bin/mysql-backup.sh dbname backupname monthly b
DB_NAME="$1"
BACK_ROOT="$2"