Skip to content

Instantly share code, notes, and snippets.

View pletch's full-sized avatar

Tim pletch

  • Carmel, IN
View GitHub Profile
@sajalshres
sajalshres / deadsnakes-python39-ubuntu-bionic.md
Created August 13, 2021 08:49
Deadsnakes python 3.9 on Ubuntu 18.04 LTS

Deadsnakes python 3.9 on Ubuntu 18.04 LTS

The deadsnakes PPA make the latest stable versions of python available on Ubuntu 18.04 LTS (3.9 is already in the official apt repo for 20.04). I now find it preferable to installing from source.

The following was tested on a Ubuntu 18.04.5 LTS desktop with python 3.6.9 as the system python version ("python3").

The latest python available from deadsnakes as of July, 2021 is 3.9.6.

Installation Procedure

@lfdominguez
lfdominguez / rate_to_influx.sh
Last active June 28, 2023 14:15
Send traffics stats by ip from pfsense to influxdb
#!/bin/sh
#
# Author: Luis Felipe Domínguez Vega <ldominguezvega@gmail.com>
#
# 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
# Code adapted from Tensorflow Object Detection Framework
# https://github.com/tensorflow/models/blob/master/research/object_detection/object_detection_tutorial.ipynb
# Tensorflow Object Detection Detector
import numpy as np
import tensorflow as tf
import cv2
import time
@pletch
pletch / scrape_pfsense_dhcp_leases.py
Last active April 12, 2024 03:02
Scrape PFSense DHCP Leases Status Page and Export Results to JSON
#!/usr/bin/env python3
# # This python script provides a function to query the pfsense (+v2.4) dhcp leases status page and return a list of tuples including
# ip, hostname, and mac address. To use, ensure LXML is installed via package manager or via pip.
#
# 16-Dec-2016 - Original release
# 3-Sep-2020 - Minor update to match formatting of leases page in latest pfSense version (2.4.5).
# 9-Sep-2020 - Backported improvements to handle table rows with missing data, use global variables for user/pass/server_ip,
# and return list from scrape function as implemented by fryguy04 in fork here:
# https://gist.github.com/fryguy04/7d12b789260c47c571f42e5bc733a813
@pletch
pletch / get_pfqueue_data.sh
Last active September 9, 2020 16:43
Scrape pf QOS metrics for forwarding to InfluxDB
#!/bin/sh
#
# Shell script: get_pfqueue_data.sh
# Date: 21-Dec-2016
#
# Script to scrape queue metrics from pfctl
# and output in influxdb line protocol with interface name &
# q name as tags and q bytes & q drops as data.
#
# Copy this script to a directory on your pfsense machine and ensure