Skip to content

Instantly share code, notes, and snippets.

View dijeesh's full-sized avatar
😎

Dijeesh Padinharethil dijeesh

😎
View GitHub Profile
@dijeesh
dijeesh / get list of mysql users and grants
Last active March 9, 2017 13:19
get list of mysql users and grants
root@db-001:~# mygrants $@ mygrants()
{
mysql -BN $@ -e "SELECT DISTINCT CONCAT('SHOW GRANTS FOR ''',user,'''@''',host,''';') AS query FROM mysql.user" | \
mysql $@ | \
sed 's/\(GRANT .*\)/\1;/;s/^\(Grants for .*\)/## \1 ##/;/##/{x;p;x;}'
}
This will generate GRANTS for each user in your MySQL database server.
@dijeesh
dijeesh / IPSec VPN between Amazon VPC and Juniper SRX
Last active September 29, 2022 10:22
SRX Rules for creating IPSec Tunnel between Amazon VPC and Juniper SRX
Tunnel 1
===================================
set security ike proposal ike-prop-vpn-to-aws-1 authentication-method pre-shared-keys
set security ike proposal ike-prop-vpn-to-aws-1 authentication-algorithm sha1
set security ike proposal ike-prop-vpn-to-aws-1 encryption-algorithm aes-128-cbc
set security ike proposal ike-prop-vpn-to-aws-1 lifetime-seconds 28800
set security ike proposal ike-prop-vpn-to-aws-1 dh-group group2
set security ike policy ike-pol-vpn-to-aws-1 mode main
@dijeesh
dijeesh / XenServer Pool patching script
Last active August 15, 2016 13:30
Bash Script to install XenServer patches
#! /bin/bash
# XenServer Pool Patching Script
set -euo pipefail
readonly PATCHFILE=$1
pushd /root/hotfix >/dev/null || exit 1
readonly HOSTS=$(xe host-list --minimal |tr , ' ')
UUID=$(xe patch-upload file-name="$PATCHFILE")