Skip to content

Instantly share code, notes, and snippets.

View peelman's full-sized avatar

Nick Peelman peelman

View GitHub Profile
@peelman
peelman / 25-filter-postfix.conf
Last active August 25, 2024 22:00
SMTP Error Code as YAML
# translate a note for dns if it exists
if [postfix_dsn] {
translate {
source => "postfix_dsn"
target => "postfix_dsn_description"
dictionary => {
"2.0.0" => "Success"
"2.1.5" => "Success - Filtered to folder"
"2.6.0" => "Success - Message queued for delivery"
"4.0.0" => "Unknown Failure (will retry)"
@peelman
peelman / README.md
Created December 19, 2023 20:53
SRLinux Module for Rancid

SRLinux Rancid Module

Summary

Allows using RANCID to extract platform and configuration from the Nokia IXR 7250, IXR 7220, and SXR 7350 series devices.

Currently the attached module and configuration will fetch the following:

  • show version - Retrieve basic metrics about the system
  • show platform fan-tray - Retrieve fan tray info
@peelman
peelman / how-to-restore.md
Created March 16, 2022 18:23 — forked from AmazingTurtle/how-to-restore.md
restore access to unifi controller

Restore access to a unifi controller

When you are unable to login to the unifi controller or forgot admin password, you can restore access using SSH and manipulating mongodb directly.

Warning

Do not uninstall unifi controller - most of the data is not stored in mongodb. In case you thought a mongodb backup would be sufficient, you may have fucked up already, just like me. However I managed to write this "tutorial" for anyone to not run into the same trap.

Steps

@peelman
peelman / README.md
Created December 18, 2021 18:33
Veeam VBR Trap Alert Script

Overview

Running Veeam and snmptrapd / snmptt? Want Slack notifications from Veeam for jobs? This script does the following:

  • For Jobs: Posts Success, Warning, or Failure messages to the configured Slack Channel
  • For VMs: Posts Warning or Failure messages to the configured Slack Channel
  • For any unknown messages or weird events, it'll post a generic message containing the pertinent info from the trap.

Traps

@peelman
peelman / README.md
Last active September 28, 2021 13:16
Subnet Utility Class for Javascript

Borrows liberally from the Netmask codebase, but structured to be used more readily in a browser context.

Example:

Subnet.isIP('10.0.0.0')          // true
Subnet.isIP('10.0.0.257')        // false

var subnet = new Subnet('10.0.0.0',12);
subnet.base;                     // 10.0.0.0

subnet.mask; // 255.240.0.0

@peelman
peelman / save-test-data-error
Created May 21, 2019 15:44
libre-save-test-data-error
Index /tmp/snmpsim/_opt_librenms_tests_snmpsim__ns-bsd.dbm does not exist for data file /opt/librenms/tests/snmpsim//ns-bsd.snmprec
Building index /tmp/snmpsim/_opt_librenms_tests_snmpsim__ns-bsd.dbm for data file /opt/librenms/tests/snmpsim//ns-bsd.snmprec (open flags "n")...
ERROR at line 1, value 'NS-BSD SERIAL i386': 'nextFlag'
ERROR at line 2, value '1.3.6.1.4.1.8072.3.2.8': 'nextFlag'
@peelman
peelman / LICENSE
Last active March 9, 2017 17:49
check_modified_file_count.rb
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
@peelman
peelman / README.md
Last active June 6, 2018 13:30
Send Slack Message

Send Slack Message

Simple Ruby script that sends a slack message. Like Slackcat or others, but I needed more options. Uses slack-notifier gem.

YMMV.

@peelman
peelman / README.md
Last active April 14, 2020 20:03
check_juniper_ex_virtchas_count.rb

Check count of members in a Juniper virtual chassis

@peelman
peelman / ed25519-puppet-example.pp
Last active December 30, 2016 21:43
Use puppet to generate ED25519 keys (for older systems or systems that didn't get them generated automatically)
if ($::operatingsystem == 'Ubuntu') {
package { 'openssh-server' :
ensure => latest,
}
service { 'ssh':
ensure => 'running',
enable => true,
require => Package['openssh-server'],
}