Skip to content

Instantly share code, notes, and snippets.

View smurugap's full-sized avatar

Senthilnathan Murugappan smurugap

View GitHub Profile
@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.

@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 / vimdiff_cheet.md
Last active April 21, 2020 16:05 — forked from roothybrid7/vimdiff_cheet.md
vimdiff cheet sheets.

Vimdiff cheet sheets.

##Git mergetool.

$ git config --global merge.tool=vimdiff

##vimdiff key mappings.

@smurugap
smurugap / Setup.local
Last active December 21, 2019 05:57
Setup.local file for python compilation
root@msenthil-ub16:~/Python-2.7.16# cat Modules/Setup.local | grep -v '^#' | grep -v '^$'
DESTLIB=$(LIBDEST)
MACHDESTLIB=$(BINLIBDEST)
DESTPATH=
SITEPATH=
TESTPATH=
MACHDEPPATH=:$(PLATDIR)
EXTRAMACHDEPPATH=
TKPATH=:lib-tk
OLDPATH=:lib-old
@smurugap
smurugap / cirros
Last active December 21, 2019 06:14
Cirros Image creation
Base Image:
Edit /lib/cirros/ds/ec2 or /etc/cirros-init/ds-ec2 based on image (MAX_TRIES=5, SLEEP_TIME=2)
v6 support (How dhcpcd was built is not captured here):
scp cirros@10.87.118.117:/sbin/dhcpcd /sbin/
scp cirros@10.87.118.117:/sbin/cirros-dhcpc /sbin/cirros-dhcpc
scp -r cirros@10.87.118.117:/libexec /
dhcpcd-run-hooks 100% 8436 8.2KB/s 00:00
10-wpa_supplicant 100% 2866 2.8KB/s 00:00
30-hostname 100% 3450 3.4KB/s 00:00
@smurugap
smurugap / ansible_module_debugging
Created June 6, 2019 21:26
Debug ansible module failures
1) Set ANSIBLE_KEEP_REMOTE_FILES env before executing the playbook and run the playbook with -vvvv
for eg:
ANSIBLE_KEEP_REMOTE_FILES=1 ansible-playbook -i inventory/ playbooks/install_contrail.yml -vvvv
2) Look for PUT message in the logs corresponding to the task...
for eg:
<10.87.69.8> (0, 'sftp> put /root/.ansible/tmp/ansible-local-279680i0RrK/tmpXVp8uT /root/.ansible/tmp/ansible-tmp-1559855484.58-20011953793704/AnsiballZ_docker_service.py\n'
3) On the remote host cd to the directory and unzip the file
for eg:
cd /root/.ansible/tmp/ansible-tmp-1559855484.58-20011953793704/
@smurugap
smurugap / Build Contrail
Last active March 21, 2019 03:19
Build Contrail
571 git clone git@github.com:Juniper/contrail-dev-env
572 cd contrail-dev-env/
573 ./vm-dev-env/init.sh
596 cd ../contrail/third_party/
610 yum group install -y "Development tools"
611 python fetch_packages.py
616 cd ../contrail-dev-env/
617 make sync
618 make fetch_packages
619 make setup
@smurugap
smurugap / screen-rename.txt
Last active March 25, 2019 04:23
disable auto rename of screen titles
touch /etc/sysconfig/bash-prompt-screen
chmod +x /etc/sysconfig/bash-prompt-screen
on each host you want to ssh into
ansible all -i 10.0.0.5,10.0.0.6,10.0.0.7,10.0.0.8,10.0.0.9,10.0.0.10,10.0.0.11,10.0.0.12,10.0.0.13 -m shell -e 'ansible_ssh_pass=c0ntrail123' -a 'touch /etc/sysconfig/bash-prompt-screen; chmod +x /etc/sysconfig/bash-prompt-screen'
@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