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
| fab -Rcompute -- "for core in \$(ls /var/crashes); do gdb /root/contrail-vrouter-agent /var/crashes/\$core -ex 'bt' --batch; done" |
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
| 1) From VM to the Vrf of the VN (only first pkt would be punted to create flow table entry) | |
| 2) From VN VRF to ip-fabric VRF (sent via vhost0 with dst port as the proxy service port(which is 51819 in our case)) | |
| 3) Agent would receive the packet and change the src/dst ip/port and forward it out | |
| 4) Reply would be received back by the same proxy service hosted in agent | |
| 5) Agent would again change back the 4 tuples and send it in vhost0 | |
| 6) vrouter would receive the same in fabric-vrf and do the reverse flow lookup |
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
| sshpass -p c0ntrail123 ssh -T -N -L 8085:localhost:8085 99.1.1.11 -g -l root | |
| ssh -L 9143:10.2.4.27:8143 root@10.87.74.74 |
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
| from lxml import etree | |
| class XmlDrv(object): | |
| def load(self, url): | |
| return etree.fromstring(requests.get(url).text) | |
| class inspect(object): | |
| def __init__(self, ip, port, drv=XmlDrv, **kwargs): | |
| super(inspect, self).__init__() | |
| self.ip = 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
| find . -name '*.py' -printf "%T+\t%p\n" | sort |
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
| sudo -u contrail jmap -histo:live <pid> |
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
| Source: https://albertomolina.wordpress.com/2016/12/02/shrinking-qcow2-images/ | |
| virt-df -h image.raw | |
| Filesystem Size Used Available Use% | |
| image.raw:/dev/sda1 1.9G 1020M 837M 52% | |
| guestfish | |
| ><fs> add image.raw | |
| ><fs> run | |
| ><fs> list-filesystems |
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
| Execute backdoor script to set password auth: | |
| ./backdoor-image --user msenthil --password contrail123 --password-auth xenial-server-cloudimg-amd64-disk1.img | |
| moved to https://gist.github.com/smoser/8c65b8771d5ab1d99c44c285323dfff6 | |
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
| Install packages: | |
| # yum install -y libguestfs-tools qemu-img | |
| Create the target image | |
| # qemu-img create -f qcow2 target.qcow2 256G | |
| Expand the new image and resize the partitions | |
| # virt-resize --expand /dev/sda1 ubuntu.qcow2 target.qcow2 | |
| If CentOS, do xfs_growfs inside the VM after boot |
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
| #pip install remote_pdb | |
| import remote_pdb | |
| remote_pdb.set_trace() # you'll see the port number in the logs | |
| remote_pdb.RemotePdb('127.0.0.1', 4444).set_trace() |