Skip to content

Instantly share code, notes, and snippets.

@jellyjellyrobot
jellyjellyrobot / CiscoKeyGen.py
Created February 28, 2018 08:50 — forked from paalfe/CiscoKeyGen.py
Cisco IOU License Generator. Originally found at http://www.routingloops.co.uk/cisco/gns3-v1-1-install-on-ubuntu-14-04-lts/, I have done a few changes to it. Make the file executable with " chmod +x CiscoKeyGen.py " and execute it " ./CiscoKeyGen.py ".
#! /usr/bin/python
print "\n*********************************************************************"
print "Cisco IOU License Generator - Kal 2011, python port of 2006 C version"
import os
import socket
import hashlib
import struct
# get the host id and host name to calculate the hostkey
hostid=os.popen("hostid").read().strip()
hostname = socket.gethostname()
@jellyjellyrobot
jellyjellyrobot / _lxc
Created January 5, 2018 05:30 — forked from sabottenda/_lxc
lxc zsh completion
#compdef lxc-start lxc-stop lxc-console lxc-restart lxc-create lxc-destroy lxc-monitor lxc-cgroup lxc-checkpoint lxc-execute lxc-freeze lxc-unfreeze lxc-info lxc-netstat lxc-ps lxc-wait
#=====================================================================================================
# original source is here: https://lists.linuxcontainers.org/pipermail/lxc-devel/2010-April/001172.html
#=====================================================================================================
_lxc_containers() {
local -a containers
containers=( $(/bin/ls /var/lib/lxc) )
compadd "$@" -a containers