Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/python
import sys
import time
import socket
import struct
import logging
import binascii
import subprocess
@ericpulvino
ericpulvino / vagrant.log
Created May 4, 2016 04:25
vagrant debug output
(eric@xenial1)-(12:24 AM Wed May 04)->
-(12 files, 836Kb)--> cat ./vagrant.log
INFO global: Vagrant version: 1.8.1
INFO global: Ruby version: 2.2.3
INFO global: RubyGems version: 2.4.5.1
INFO global: VAGRANT_OLD_ENV_QT_ACCESSIBILITY="1"
INFO global: VAGRANT_OLD_ENV_SESSION_MANAGER="local/xenial1:@/tmp/.ICE-unix/1639,unix/xenial1:/tmp/.ICE-unix/1639"
INFO global: VAGRANT_OLD_ENV_QT_IM_MODULE="ibus"
INFO global: VAGRANT_OLD_ENV_PWD="/home/eric/repos/topology_converter_phone"
INFO global: VAGRANT_OLD_ENV_QT_QPA_PLATFORMTHEME="appmenu-qt5"
@ericpulvino
ericpulvino / 99cumulus_defaults.conf
Last active December 14, 2022 01:31
Sysctl Settings for Hosts
# /etc/sysctl.d/99quagga_defaults.conf
# Place this file at the location above and reload the device.
# or run the sysctl -p /etc/sysctl.d/99quagga_defaults.conf
#Required if we're to work as a router
net.ipv4.conf.all.rp_filter = 0
net.ipv4.conf.default.rp_filter = 0
net.ipv4.conf.lo.rp_filter = 0
net.ipv4.conf.all.forwarding = 1
net.ipv4.conf.default.forwarding = 1
@ericpulvino
ericpulvino / window_open.py
Last active September 26, 2016 00:37
Quick flask app to tell me if I can leave my window open...
#!/usr/bin/python
from flask import Flask, render_template
app = Flask(__name__)
import os
import json
import nest
from nest import utils as nest_utils
@ericpulvino
ericpulvino / index.html
Created September 26, 2016 00:33
Template for window_open.py flask app...
<!doctype html>
<html>
<title>Window Open?</title>
<head>
<style>
table {
font-family: arial, sans-serif;
border-collapse: collapse;
width: 100%;
}
@ericpulvino
ericpulvino / dhcp_snooping.sh
Last active June 3, 2019 14:28
Quick Script to Emulate Basic DHCP Trusted Ports / DHCP Snooping / DHCP Filtration
#!/bin/bash
# Root Check
if [ $(whoami) != 'root' ]; then
echo "ERROR: Must be root to run $0"
exit 1;
fi
TRUSTED_PORTS=( swp1 swp3 )
@ericpulvino
ericpulvino / err_disabled.py
Last active April 17, 2017 13:50
Quick script to enable ports which have been set to err-disabled by mstpctl
#!/usr/bin/python
# Quick Script to Recover Error-Disabled Ports
# Originally written by Eric Pulvino (2017-04-17)
import time
import json
import subprocess
import logging
@ericpulvino
ericpulvino / custom_syslog.py
Created May 10, 2017 14:27
Quick Script to Send New Parameters to Syslog
#!/usr/bin/python
import time
import json
import subprocess
import logging
import logging.handlers
# Log to CLI and Syslog or just CLI
log_to_syslog=True
@ericpulvino
ericpulvino / OverDriveMediaConsole.md
Last active March 22, 2018 00:22 — forked from alghanmi/OverDriveMediaConsole.md
Install OverDrive Media Console on Linux

OverDrive Media Console

OverDrive is a very common provider for eBooks and Audiobooks for the many public libraries. The ODMC is the application used to download resources.

OD now supports MP3 for all its audio-books and epub for their ebooks. This allows you to use it on Linux.

Install and Setup

Step 1. Dependencies

To use ODMC on Linux, you need to install wine and winetricks. On a debian-based system, you can do:

sudo apt-get install wine-stable winetricks -qy
@ericpulvino
ericpulvino / LLDP Interface Description Playbook
Created April 11, 2018 15:03
LLDP Interface Description Playbook
(eric@xenial3)-(09:27 PM Sun Dec 10)->
-(17 files, 344Kb)--> cat ./test.yml
- name: LLDP LABELER
hosts: all
become: yes
tasks:
- name: COLLECT LLDP INFO in JSON Format
shell: net show lldp json
register: lldp_info_json