Skip to content

Instantly share code, notes, and snippets.

View einarnn's full-sized avatar

Einar Nilsen-Nygaard einarnn

View GitHub Profile
@einarnn
einarnn / yt2mp4
Last active August 19, 2022 15:00
YT Download
#!/bin/bash
#
# download a youtube URL using yt-dlp
#
# before using:
#
# - create Python virtual environment
# - `pip install yt-dlp`
#
URL="$1"
@einarnn
einarnn / add-serial-port.sh
Last active September 12, 2021 21:00
Add Serial Port To VM
#!/bin/bash
#
#
# simple function to check for existence of a binary on the current
# path
#
checkExists() {
bin=`command -v $1`
if [ -z "$bin" ]
then
@einarnn
einarnn / jxmlease-netconf-sample.py
Created July 26, 2016 21:06
Simple use of jxmlease to make XML seem more like JSON
#
# Get running config from an IOS-XR device and print out some
# interface information. Shows how to use the jxmlease library
# for when you'd rather have JSON but have to deal with XML!
#
from ncclient import manager
import jxmlease
HOST = '127.0.0.1'
PORT = 8303
@einarnn
einarnn / rename-by-revision.py
Last active January 12, 2016 15:35
Rename a list of yang files with revision numbers
#!/usr/bin/env python
import pyang
import argparse
import os
parser = argparse.ArgumentParser(description='rename a list of yang model files by the revision information')
parser.add_argument('yang_files', type=str, nargs='+',
help='list of yang files')
args = parser.parse_args()