Skip to content

Instantly share code, notes, and snippets.

@jovimon
jovimon / openvpn-telegram.md
Last active February 18, 2024 07:08
Telegram notifications for (dis)connections to my pfSense OpenVPN Server

OpenVPN Telegram Notifier

Features

Each time a client (dis)connects to the OpenVPN server of pfSense a new Telegram notification will be sent.

pfSense WebGUI configuration

Under "VPN" > "Servers" > your server > "Advanced Configuration" > "Custom Options" add the following lines.

client-connect    /root/openvpn-telegram.sh
client-disconnect /root/openvpn-telegram.sh
@jovimon
jovimon / 00-freenas-collectd-ups-stats.md
Last active July 26, 2020 15:49
FreeNAS CollectD UPS metrics collector

FreeNAS CollectD UPS metrics collector

Quick and dirty script to get UPS stats into CollectD so you can forward them to Grafana. Tested with a Salicru UPS configured with the blazer_usb driver.

Update 2020-07-26:

At some point between the original publication of this howto and FreeNAS 13.1, default nut metrics appeeared on my InfluxDB server, so even though nut sends fewer metrics than the script on this Gist (see the default-nut-metrics.png file as opposed to the file listing at the end of the howto), I'm going to stick with the default metrics, so I don't have to mess around with installing scripts every time my FreeNAS box reboots.

Original post:

Steps:

@jovimon
jovimon / python-broadlink-howto-py3.md
Last active September 16, 2022 12:50
Python Broadlink Howto using python3
@jovimon
jovimon / 00-freenas-collectd-zpool-stats.md
Last active August 28, 2019 16:46
FreeNAS CollectD Zpool space metrics collector

FreeNAS CollectD Zpool space metrics collector

Quick and dirty script to get zpool space stats into CollectD so you can forward them to Grafana.

Steps:

  1. Create a file with the following script:
#!/bin/bash
@jovimon
jovimon / proxmox-amdgpu-workaround.md
Created June 5, 2019 20:55
Run proxmox pve 5.4 with newer AMD Athlon / Ryzen CPU

This little guide tries to solve the problems you can find to boot Proxmox 5.4.x freshly installed into newer AMD Athlon / Ryzen CPU computers/servers.

I tested this with a AMD Athlon 200GE.

0.- Install Proxmox PVE as you usually do 1.- Upon first reboot, edit the grub parameters of the default entry "Proxmox Virtual Environment GNU/Linux" with the "e" key. 2.- Locate a line that starts with something similar to (hints: starts with linux and says something about vmlinuz): linux /ROOT/pve-1@/boot/vmlinuz-4.15.18-12-pve root=ZFS=rpool/ROOT/pve-1 ro root=ZFS=rpool/ROOT/pve-1 boot=zfs quiet 3.- Add a new keyword " nomodeset" at the end of that line. 4.- Push F10 to boot the system. 5.- Edit /etc/modprobe.d/pve-blacklist.conf file, and add at the end the following line:

@jovimon
jovimon / cdmon_update.py
Last active July 6, 2023 07:37
CDMon dynamic DNS IP update script
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Python script to update CDMon dynamic DNS
#
# @author = @jovimon
# @version = 0.1.20200930
#
# Prerequisites: sudo pip install requests / sudo apt install python-requests
#
@jovimon
jovimon / mailman_getUserList.py
Last active April 17, 2018 16:33
Mailman Get User List
# Query a mailman list for all of its registered users
# Scraping part based on http://docs.python-guide.org/en/latest/scenarios/scrape/
# If you get errors, install packages:
# sudo pip install lxml
# sudo pip install requests
from lxml import html
import requests
@jovimon
jovimon / gist:524e116471f249626fd2ccd141f3fe05
Last active April 7, 2024 04:01
compile realtek network driver for pfsense 2.4.x

How to compile and install latest realtek network driver in pfSense 2.4.x (FreeBSD 11.1)

  1. Download FreeBSD 11.1 VMDK and create a VM with it as HDD.

  2. Get FreeBSD source tree for your exact FreeBSD version and uncompress it to /usr/src:

    fetch -o /tmp ftp://ftp.freebsd.org/pub/`uname -s`/releases/`uname -m`/`uname -r | cut -d'-' -f1,2`/src.txz
    tar -C / -xvf /tmp/src.txz
    
  3. Download latest Realtek network driver (you need to input an email address).

Keybase proof

I hereby claim:

  • I am jovimon on github.
  • I am jovimon (https://keybase.io/jovimon) on keybase.
  • I have a public key whose fingerprint is 733E B273 3F23 991A 350C 715C 01BD E66E 74A7 C8DB

To claim this, I am signing this object:

@jovimon
jovimon / logstash-evtx-plaso.conf
Created September 23, 2016 10:45
Logstash config to parse json files resulting from plaso processed evtx files
# Plaso is great but elasticsearch output module does not always work, so there's
# a config to parse json_line plaso output into ELK
#
# Usage (tested on Ubuntu 14.04 w/ ELK packages and Plaso git version 1.5.1_20160922):
# for i in $(ls *.evtx); do name=${i::-5}; echo $name; log2timeline.py $name.plaso $i; psort.py -o json_line -w json/$name.json $name.plaso; done
#
# Note:
# To wipe elasticsearch data: $ sudo rm -r /var/lib/elasticsearch/elasticsearch/*
# To remove logstash sincedb files so input files can be reread: $ sudo rm /var/lib/logstash/.sincedb_*