Skip to content

Instantly share code, notes, and snippets.

@MrXermon
MrXermon / sclisteners.php
Last active April 6, 2021 02:32
munin plugin to monitor SHOUTcast Broadcaster listeners
#!/usr/bin/php
<?php
$url = 'http://127.0.0.1:8000/statistics?json=1';
if(count($argv) == 2 && $argv[1] == 'authconf') {
exit('yes');
}
$data = file_get_contents($url);
if($data != false){
@MrXermon
MrXermon / interface vlan
Created February 8, 2018 06:28
Create multiple vlan interfaces and add tagged or untagged interfaces
param (
[Parameter(Mandatory=$true)][int]$From,
[Parameter(Mandatory=$true)][int]$To,
[string]$Description = "",
[string]$Tagged = "",
[string]$Untagged = ""
)
if($From -le $To){
for($i = $From; $i -le $To; $i++){
Write-Host "interface vlan" $i
@MrXermon
MrXermon / vCenter_Portgroups_DVS_LAG.ps1
Last active September 3, 2018 09:42
Update the uplink of all portgroups on a DVS to a lag.
# Move vCenter Portgroup Uplinks to DVS LAG
# Jan Gilla / www.jangilla.de
$Settings_vCenter = ''
$Settings_vCenter_User = ''
$Settings_vCenter_Password = ''
$Settings_vCenter_DVS = 'dS-FRA1'
$Settings_vCenter_Uplink = 'lag1'
# Connect to vCenter
@MrXermon
MrXermon / dns_check.sh
Created March 11, 2019 07:15
Output SOA records of multiple zones on multiple servers
zones=(level66.network jangilla.de)
servers=(ns26.ns26.de ns27.ns27.de ns28.ns28.de)
for i in "${zones[@]}"
do
echo "================" $i "================"
for j in "${servers[@]}"
do
dig $i SOA @$j +short
done
echo
@MrXermon
MrXermon / pdns_notify.sh
Created March 11, 2019 07:17
Notify multiple zones for update in PowerDNS
zones=(level66.network jangilla.de)
for i in "${zones[@]}"
do
echo $i
/usr/bin/pdns_control notify $i
done
@MrXermon
MrXermon / netbox-graph.php
Last active September 3, 2023 15:50
Display interface graphs in Netbox fetched from LibreNMS.
<?php
/*
* Display LibreNMS interface graphs in Netbox
*
* 1. Upload this file into the plugin folder of LibreNMS.
* 2. Generate an API key in LibreNMS and insert the connection details below.
* 3. Create graphs in Netbox using the following URL scheme.
* https://nms.level66.network/plugins/netbox-graph.php?device={{ obj.device.name }}&interface={{ obj.name }}&duration=8h
* 4. Save time in your daily work!
*
@MrXermon
MrXermon / dyndns_tun.sh
Created May 24, 2020 16:25
Update VyOS Tunnel IP by fetching DNS entrys.
#!/bin/vbash
IP=`dig +short $1 A`
IF=$2
source /opt/vyatta/etc/functions/script-template
configure
set interfaces tunnel $IF remote-ip $IP
commit
save
@MrXermon
MrXermon / ooklaserver.service
Created January 10, 2021 07:06
Ookla Server systemd file
[Unit]
Description=ooklaserver
After=network.target
[Service]
User=ooklaserver
Group=ooklaserver
WorkingDirectory=/opt/ooklaserver
ExecStart=/opt/ooklaserver/OoklaServer --daemon --pidfile=/opt/ooklaserver/OoklaServer.pid
PIDFile=/opt/ooklaserver/OoklaServer.pid
#!/bin/bash
#
# Author: Jan Gilla
# Company: level66.network UG (haftungsbeschränkt)
# Description: BASH script to install snmpd daemon on Debian/Ubuntu based linux systems, generate the configuration and reload the service by using systemd.
#
# Define variables here.
SNMPD_COMMUNITY=public
SNMPD_LOCATION="Milki Way"
#
# Author: Jan Gilla
# Company: level66.network UG (haftungsbeschränkt)
# Description: PowerShell script to install snmpd daemon on windows systems, generate the configuration and reload the service.
#
# Define variables here.
$SNMPD_COMMUNITY = "public"
$SNMPD_LOCATION = "Milki Way"
$SNMPD_CONTACT = "test@example.com"