Skip to content

Instantly share code, notes, and snippets.

View pasindujw's full-sized avatar
:octocat:
Talk is Cheap; Show me the Code

Pasindu Jayaweera pasindujw

:octocat:
Talk is Cheap; Show me the Code
  • Advisory-ThreeSixty° GmbH
  • Germany
View GitHub Profile
@pasindujw
pasindujw / BastionSSH.sh
Created February 20, 2019 07:25
Shell script to SSH via bastion instance
bastion=3.90.133.110
node=10.0.1.188
key_pem=/home/pasindu/Downloads/key.pem
#Assumption: bastion OS is Ubuntu/ Node OS is CentOS
set -x
echo "Bastion login";
scp -o StrictHostKeyChecking=no -i ${key_pem} ${key_pem} ubuntu@${bastion}:/home/ubuntu/key.pem
#Copy file from node instance to local machine
ssh -o StrictHostKeyChecking=no -i ${key_pem} ubuntu@${bastion} "scp -o StrictHostKeyChecking=no -i key.pem centos@${node}:/var/log/product_logs.zip ."&&
@pasindujw
pasindujw / .gitignore
Created March 25, 2019 08:30
Update .gitignore file to avoid IDEA IDE files
#IDEA files
*.iml
*.ipr
*.iws
.idea/
@pasindujw
pasindujw / Puppet remove certs
Created April 8, 2019 04:29
Remove existing certs of an agent
#In puppet agent
find /var/lib/puppet/ssl -name <nameofclient>.pem -delete
#In puppet master
puppet cert clean <nameofclient>
Then execute following in agent.
puppet agent -vt
#!/bin/bash
if [ "$#" -ne 3 ]; then
echo "usage: sh thread-analyze.sh <pid> <number-of-dumps> <interval>"
exit
fi
count=$2
for i in `seq 1 $count`;
do
jstack -l $1 > thread_dump_`date "+%F-%T"`.txt &
@pasindujw
pasindujw / WSO2-EI-650-permission-tree.csv
Created February 18, 2020 10:11
WSO2-EI-650-permission tree
Permission Description
All Permissions
Admin Permissions Configure Configure Data Sources Internal Configurations relating to EI databases
Discovery Internal Configurations for message flows
Inbound Endpoints
Configure ntask integration
Configure ESB ntask
Priority Executor
Schedule Tasks
Security Identity Management Password Management Receives permission to enable/disable password/profile/user managments to other users