Skip to content

Instantly share code, notes, and snippets.

@crawc
crawc / rate_to_influx.sh
Last active December 24, 2021 15:27 — forked from lfdominguez/rate_to_influx.sh
Send traffics stats by ip from pfsense to influxdb
#!/bin/sh
#
# Author: Luis Felipe Domínguez Vega <ldominguezvega@gmail.com>
# https://gist.github.com/lfdominguez/08de623d9f9c0fa84e6b4d5d0d25025c
# Program to use with the rate software to send to InfluxDB the
# rate of each IP on interface
#
# rate_to_influx <influxdb_url> <influxdb_database> <local_network> <interface>
# rate_to_influx http://127.0.0.1:8086 network 192.168.0.0/24 re1
#!/usr/local/bin/bash
# pkg install bash
# add to shellcmd as "/root/push_ip_metrics.sh &" via Services/shellcmd
pushgatewayip="192.168.1.2:9091"
network="192.168.1.0/24"
interface="bce1"
interval="1"
rate -i "${interface}" -r "${interval}" -e -n -Ab -a 255 -c "${network}" -d | while read -r line; do
@acundari
acundari / traefik-auth.conf
Last active December 6, 2022 09:41
Traefik fail2ban
# /etc/fail2ban/filter.d/traefik-auth.conf
[Definition]
failregex = ^<HOST> \- \S+ \[\] \"(GET|POST|HEAD) .+\" 401 .+$
@jwalanta
jwalanta / OpenWrt detect new device and send text message.md
Last active February 10, 2024 09:16
Detect new network devices connecting to OpenWrt and send text message