Skip to content

Instantly share code, notes, and snippets.

@MrXermon
MrXermon / ntp.level66.network.bat
Created September 26, 2022 06:33
Set NTP Server in Windows via Batch Script.
@echo off
echo Stoppting W32Time Service...
net stop w32time
echo Setting ntp.level66.network as primary NTP Server...
w32tm /config /manualpeerlist:"ntp.level66.network",0x8 /syncfromflags:MANUAL
w32tm /config /reliable:yes
echo Starting W32Time Service...
net start w32time
@MrXermon
MrXermon / nic_lldp_link-state.sh
Created March 1, 2022 19:34
Bash script to disable lldp and enable link-state on intel nics.
#
# 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"
#!/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"
@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
@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 / 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 / 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 / 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 / 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