start new:
tmux
start new with session name:
tmux new -s myname
from jinja2.environment import Environment | |
from jinja2 import FileSystemLoader, StrictUndefined | |
from ansible_collections.ansible.netcommon.plugins.filter.ipaddr import ipmath | |
from ansible_collections.ansible.netcommon.plugins.filter.ipaddr import ipaddr | |
env = Environment(undefined=StrictUndefined) | |
env.loader = FileSystemLoader(['.', './templates/']) | |
env.filters["ipmath"] = ipmath |
>>> import pprint | |
>>> import requests | |
>>> MAC_URL = 'http://macvendors.co/api/%s' | |
>>> r = requests.get(MAC_URL % 'BC:92:6B:A0:00:01') | |
>>> pprint.pprint(r.json()) | |
{'result': {'address': '1 Infinite Loop Cupertino CA US 95014 ', | |
'company': 'Apple, Inc.', | |
'mac_prefix': 'BC:92:6B'}} |
#! /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() |
# add the following line to your ansible.cfg | |
connection_plugins = /usr/share/ansible_plugins/connection_plugins:/etc/ansible/connection_plugins |