Skip to content

Instantly share code, notes, and snippets.

View mlazzarotto's full-sized avatar

Marco Lazzarotto mlazzarotto

View GitHub Profile
@mlazzarotto
mlazzarotto / list_all_proxmox_snapshots.sh
Last active July 30, 2024 11:46
List all Proxmox snapshots
#!/usr/bin/env bash
echo "Printing VM snapshots..."
nodes=$(pvesh get /cluster/resources --type vm --output-format json |jq -r '.[] | [.vmid, .name, .node, .type] | @json')
echo "Processing data ..."
for i in $nodes; do
vmtype=$(jq -r '.[3]' <<< "$i");
if [[ "$vmtype" == "qemu" ]]; then
#printf "\n i= $i" # -- shows all iterations for troubleshooting
vmid=$(jq -r '.[0]' <<< "$i");
@mlazzarotto
mlazzarotto / duplicate_ip.py
Last active October 12, 2023 17:56 — forked from dgarros/duplicate_ip.py
Netbox Report Duplicate IP - Netbox 3.6+ compatible
from django.db.models import Q
from extras.reports import Report
from collections import defaultdict
from dcim.models import Device
from ipam.models import IPAddress
from ipam.choices import IPAddressRoleChoices
class UniqueIPReport(Report):
import calendar
def compare_calendar(curr_year, min_year, max_year):
if (curr_year >= min_year) and (curr_year <= max_year):
c = calendar.TextCalendar(calendar.MONDAY)
c_curr_year = c.formatyear(curr_year)
c_curr_year = c_curr_year[42:]
print('Current year is {}'.format(curr_year))
for y in range(min_year, max_year+1):
c_y = c.formatyear(y)