Skip to content

Instantly share code, notes, and snippets.

View smurugap's full-sized avatar

Senthilnathan Murugappan smurugap

View GitHub Profile
@smurugap
smurugap / virt-install
Created March 11, 2018 21:04
Virt Install to start a VM with macvtap interface
virt-install \
--name=centos-compute-$i \
--ram=32768 \
--vcpus=16 \
--cpu host-model-only \
--os-type linux \
--os-variant centos7.0 \
--import \
--disk path=/var/lib/libvirt/images/centos74-compute-$i.qcow2,bus=virtio,cache=none,format=qcow2,bus=virtio \
--network type=direct,source=enp6s0f0,source_mode=bridge,model=virtio \
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
@smurugap
smurugap / wireshark.md
Created April 12, 2023 04:17 — forked from EddiG/wireshark.md
How to decrypt SSL/TLS traffic in Wireshark on MacOS

The main point is to save the SSL/TLS keys those used by the web browser (SSLKEYLOGFILE=/tmp/tmp-google/.ssl-key.log).
In the example below we run brand new instance of Google Chrome (--user-data-dir=/tmp/tmp-google do the trick):
SSLKEYLOGFILE=/tmp/tmp-google/.ssl-key.log /Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --user-data-dir=/tmp/tmp-google
Then run the Wireshark and open the Preferences -> Protocols -> SSL, where we put the path to the SSL keys log file into the (Pre)-Master-Secret log filename field.
Now all SSL/TLS traffic from this browser instance will be decrypted.

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
@smurugap
smurugap / Self-Signed-Certificates-With-x509-extensions.md
Last active November 5, 2022 01:42
Generate Self Signed Certificates with x509 extensions

openssl.cnf

[ req ]
distinguished_name = req_distinguished_name
policy             = policy_match
x509_extensions     = v3_ca

# For the CA policy
[ policy_match ]
as sudo user
sh-3.2# scutil
> list
subKey [0] = Plugin:IPConfiguration
subKey [1] = Plugin:InterfaceNamer
subKey [2] = Plugin:KernelEventMonitor
subKey [3] = Setup:
subKey [4] = Setup:/
subKey [5] = Setup:/Network/Global/IPv4
@smurugap
smurugap / changes reqd for ovsdb over ssl with contrail
Created October 16, 2015 18:53
changes reqd for ovsdb over ssl with contrail
To generate certs:
apt-get install openvswitch-common
ovs-pki init
ovs-pki req+sign vtep
scp vtep-cert.pem root@<tor>:/var/db/certs
scp vtep-privkey.pem root@<tor>:/var/db/certs
QFX Config:
set protocols ovsdb controller <ha proxy vip> protocol ssl port <port>
(remove the passive option)
@smurugap
smurugap / selenium-grid.txt
Last active March 14, 2022 13:05
Selenium grid installation and testing (python) with chrome on ubuntu 16.04
Ubuntu Desktop environment:
* apt-get update && sudo apt-get upgrade
* apt-get install ubuntu-desktop gnome-panel gnome-settings-daemon metacity nautilus gnome-terminal
Setup VNC server environment:
* apt-get install vnc4server
* adduser sanity (passwd: c0ntrail123)
* usermod -G sudo sanity​
As user sanity do the below
* vncserver
@smurugap
smurugap / virsh-dump-xml
Last active September 17, 2020 06:05
Virsh dump XML file to launch a VM with virsh
virsh net-define <below xml>
<network>
<name>macvtap-net</name>
<forward mode="bridge">
<interface dev="eth1"/>
</forward>
</network>
<domain type='kvm'>
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