Skip to content

Instantly share code, notes, and snippets.

@mikej312
mikej312 / checksums.md
Last active August 11, 2020 18:34
Create a file of checksums for the files in a directory

find ****** -type f -exec sha256sum {} ; > checksums.sha256

#!/bin/sh
#
# OpenBSD Memory Plugin for Nagios
#
# The original verion of ths cscript was found here:
# https://exchange.nagios.org/directory/Plugins/Operating-Systems/BSD/OpenBSD/OpenBSD-Memory/details
#
# Updated the way the memory values are collected since top now outputs values in gigabytes
#
# Copyright 2008 - [email protected]
@mikej312
mikej312 / openvpn.md
Created July 3, 2020 00:21
Associate usernames with IP addresses of OpenVPN clients

Tested on an OpenBSD system using OpenVPN LDAP authentication:

sed -n '/Virtual/,/GLOBAL/{//!p;}' /var/log/openvpn-status.log | awk -F'[,:]' '{print $3}' | while read -r r; do echo -n $r; fgrep $r /var/log/openvpn | fgrep -m 1 username | awk -F\' '{ print " - " $2}' ; done

@mikej312
mikej312 / vnc-password.md
Last active July 3, 2020 00:22
Ubuntu 18.04 schreen sharing (VNC) password retrieval

To retrieve the Ubuntu screen sharing (VNC) password:

  • gsettings get org.gnome.Vino vnc-password

Note: this returns a Base64 encoded value