# virt-builder ubuntu-14.04 --size 5G --hostname cacti --root-password password:<mypassword> --format qcow2 -o cacti.qcow2
# virt-install --import --name cacti --ram 1024 --disk $HOME/imgs/cacti.qcow2,format=qcow2,bus=virtio,cache=none --os-type linux --os-variant ubuntutrusty
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # /etc/nslcd.conf | |
| # nslcd configuration file. See nslcd.conf(5) | |
| # for details. | |
| # The user and group nslcd should run as. | |
| uid nslcd | |
| gid nslcd | |
| # The location at which the LDAP server(s) should be reachable. | |
| uri ldaps://myadserver.rtp.example.test |
- Allowing virsh shutdown to work.
Update packages versions in package.json
npm update --save
Install a new package into dependencies
npm install [pkgname] --save
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ! add current user to kvm group | |
| usermod -a -G kvm skamithi | |
| ! create root password file | |
| cat 'mypass' > /tmp/rootpw | |
| ! update soon with run-command to run 'dpkg-reconfigure openssh-server' to regenerate ssh keys | |
| ! without this you get a ssh reset peer message | |
| virt-builder ubuntu-14.04 --root-password file:/tmp/rootpw -o ubuntu1404.qcow2 --format qcow2 --size 10G --hostname ubuntu1404 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @mock.patch('clshow.cliface.CumulusIface.print_name') | |
| @mock.patch('clshow.cliface.CumulusIface.print_ip_details') | |
| @mock.patch('clshow.cliface.CumulusIface.print_counters') | |
| @mock.patch('clshow.cliface.CumulusIface.print_lldp_info') | |
| @mock.patch('clshow.cliface.CumulusIface.print_arp') | |
| def test_print_l3_access(self, | |
| mock_arp, | |
| mock_lldp, | |
| mock_counters, | |
| mock_ip, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import re | |
| from itertools import groupby | |
| from collections import OrderedDict | |
| # define list of interfaces | |
| a = ['swp2100', 'bond12.100', 'swp22', 'br20', | |
| 'bond0', 'bond22', 'port-channel5'] | |
| b = OrderedDict() | |
| # group ports based on int name before digit |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def dict_merge(list1, list2): | |
| """ Trick is to use the .__dict__ keyword. This puts all the attrs associated with | |
| this library's instance are part of the mergin algorithm | |
| _keys = list2.keys() | |
| try _key in keys: | |
| try: | |
| list1[key].__dict__.update(list2[__key].__dict__) | |
| except: | |
| list[_key] = list2[_key] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # Script to create ansible playbook directories | |
| # define your roles here | |
| roles=(upgrade packages) | |
| directories=(tasks handlers files default vars templates) | |
| # create playbook | |
| mkdir global_vars |
-
Shutdown Virtualbox VM.
-
Convert the vdi to a raw disk images. Note: vdi are compressed and raw images are not and so you will need to leave enough disk space for entire uncompressed disk.
VBoxManage clonehd --format RAW win7.vdi win7.img
- Then on your KVM host: