Skip to content

Instantly share code, notes, and snippets.

@xmeng1
xmeng1 / wsl2-network.ps1
Created July 14, 2019 06:50
WSL2 Port forwarding port to linux
$remoteport = bash.exe -c "ifconfig eth0 | grep 'inet '"
$found = $remoteport -match '\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}';
if( $found ){
$remoteport = $matches[0];
} else{
echo "The Script Exited, the ip address of WSL 2 cannot be found";
exit;
}
@lanbugs
lanbugs / cisco_wlc_ap_grabber.py
Created June 22, 2018 21:45
Commandline Tool to export AP inventory from an Cisco Wireless LAN Controller WLC
#!/usr/bin/env python
# Need following pip packages
# - easysnmp
# - tabulate
# Checkout blog article to tool
# https://lanbugs.de/netzwerktechnik/hersteller/cisco/cli-tool-export-ap-inventory-from-an-cisco-wireless-lan-controller-wlc/
@simonw
simonw / python-virtual-environment-howto.md
Created July 18, 2017 23:53
How to set up a Python virtual environment

How to set up a Python development environment

A Python development environment is a folder which you keep your code in, plus a "virtual environment" which lets you install additional library dependencies for that project without those polluting the rest of your laptop.

mkdir my-new-python-project
cd my-new-python-project
virtualenv --python=python2.7 venv

This will create a my-new-python-project/venv folder

@ktbyers
ktbyers / threading_csv.py
Created February 24, 2017 20:10
Netmiko Threading from a CSV file
import csv
import threading
from Queue import Queue
from getpass import getpass
from netmiko import ConnectHandler
from datetime import datetime
USER = 'pyclass'
PASSWORD = getpass()