Skip to content

Instantly share code, notes, and snippets.

@jessedufrene
jessedufrene / .env
Last active April 25, 2024 21:06
Netbox docker compose
# username for login is 'admin'
SUPERUSER_EMAIL=admin@netbox.local
SUPERUSER_PASSWORD=
DB_PASSWORD=
REDIS_PASSWORD=
@jessedufrene
jessedufrene / ver.py
Last active May 3, 2023 00:58
Python Version - Decent way of auto incrementing the version of a Python script based on the tags in the Git repo
import subprocess
# what to put if version cannot be determined
_undefined_version = "undefined version"
# first, try getting version from git
_git_version = None
try:
_git_version = subprocess.check_output(["git", "describe", "--dirty"], stderr=subprocess.PIPE).strip().decode("utf-8")
except (FileNotFoundError, subprocess.CalledProcessError) as e: