Skip to content

Instantly share code, notes, and snippets.

View awfki's full-sized avatar

Dave awfki

  • Atlanta, GA
View GitHub Profile
@joxz
joxz / _01.md
Last active December 19, 2022 18:56
Netbox LetsEncrypt and SSO with OpenResty

Netbox LetsEncrypt and SSO with OpenResty

sudo apt-get -y install --no-install-recommends wget gnupg ca-certificates
wget -O - https://openresty.org/package/pubkey.gpg | sudo apt-key add -

echo "deb http://openresty.org/package/ubuntu $(lsb_release -sc) main" \
    | sudo tee /etc/apt/sources.list.d/openresty.list

sudo apt-get update
@joxz
joxz / _01.md
Last active December 19, 2022 18:56
Netbox SSO with Okta, Vouch and Nginx

Netbox SSO with Okta, Vouch and Nginx

@4410287
4410287 / postgres-backup.sh
Created January 9, 2019 16:32
Shell script for daily postgres database backup with basic archiving.
#!/bin/bash
# Written 2018-11-15 by 4410287
# This script will create a backup file of a postgres database and compress it. It is capable of access a local or remote server to pull the backup. After creating a new backup, it will delete backups that are older than 15 days, with the exception of backups created the first of every month. It is recommended to create a seperate database user specifically for backup purposes, and to set the permissions of this script to prevent access to the login details. Backup scripts for different databases should be run in seperate folders or they will overwrite each other.
HOSTNAME=
USERNAME=
PASSWORD=
DATABASE=
@jbrown123
jbrown123 / readme.md
Last active May 5, 2024 20:57
Reference bookmarklet - generate a string containing the page title, URL and any selected text

Reference bookmarklet

This bookmarklet will grab 2 or 3 bits of info from the currently viewed webpage and put them into an 'alert' so you can copy & paste into another document.

It should work in any desktop browser (chrome, firefox, ect.) on any OS but I've only personally tested it in Chrome on Windows.

You can press either enter or escape after copying the text. It doesn't make any difference which one you use.

For example, the above URL points to the bookmarklet entry on Wikipedia. If you used the reference bookmarklet on that page it would return the following:

@awfki
awfki / pynetbox_examples.md
Last active November 16, 2023 22:19
pynetbox examples

pynetbox examples

Long time network engineer, did some perl a long time ago and am liking python pretty well but the pynetbox documentation is badly lacking IMO. If I were a python wizard I'm sure it would all be obvious but I'm not and it's really frustrating that more example weren't provided.

Many of the following examples were cadged from various places on the interwebs and HAVE NOT BEEN TESTED.

Prereqs

import pynetbox
NETBOX = 'https://netbox.fq.dn/'
nb = pynetbox.api(NETBOX, get_token('nb'))
@dgarros
dgarros / duplicate_ip.py
Created October 25, 2018 16:35
Netbox Report Duplicate IP
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.constants import IPADDRESS_ROLE_ANYCAST, IPADDRESS_ROLE_VIP
class UniqueIPReport(Report):
@mutin-sa
mutin-sa / Top_Public_Time_Servers.md
Last active July 17, 2024 01:35
List of Top Public Time Servers

Google Public NTP [AS15169]:

time.google.com

time1.google.com

time2.google.com

time3.google.com

@judas-christ
judas-christ / fix-refresh-rate.sh
Last active November 6, 2023 15:15
How to change refresh rate on an external display on macOS
# install homebrew
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
# install cscreen
brew cask install cscreen
# list displays
cscreen -l
# find your external screen in the list and write the number (not the ID) down somewhere
# in the following instructions, use that number instead of <SCREEN>
@linuxsimba
linuxsimba / netbox-ansible.py
Created December 10, 2016 06:12
Ansible Netbox Integration Example
#!/usr/bin/python
""" Ansible Inventory Generated From Netbox
Author: Stanley Karunditu <stanley@linuxsimba.com>
License: MIT
Requirements:
* use netbox device roles that result in hyphenated role names. E.g
@v0lkan
v0lkan / how-to-write.md
Last active December 24, 2020 15:15
How to Write

This is a copy of this presentation by Michael Covington

Why?

  • People who write are powerful.
  • In science, technology, or management, you influence people by writing things for them to read.
  • Clear writing leads to clear thinking.
  • You don’t know what you know until you try to express it.
  • If your writing is nonsense, maybe your thoughts are nonsense too!