Skip to content

Instantly share code, notes, and snippets.

@rammanokar
rammanokar / Keytool_commands.md
Last active April 24, 2020 13:22
Keytoool Commands

Keytoool Commands

Listing :

Check a stand-alone certificate:

keytool -printcert -v -file mydomain.crt

Check which certificates are in a Java keystore:

# Top memory usage processes
top -b -o +%MEM | head -n 22
# search the logs for messages of out of memory alerts.
sudo grep -i -r 'out of memory' /var/log/
#Current resource usage
free -h
#!/usr/bin/env bash
#usage:
# rsync_folder_with_retry_sleep.sh /usr/hdp /data/usr/
#/usr/hdp folder will be synced to /data/usr/hdp
src=$1
dest=$2
RC=1
while [[ $RC -ne 0 ]]
@rammanokar
rammanokar / bulk_rename.ps
Created December 27, 2019 11:38
Bulk renaming windows powershell
Get-ChildItem C:/temp/ -Recurse -Filter *Goop* | Rename-Item -NewName { $_.name -replace 'Goop', 'gooey2'} -verbose
@rammanokar
rammanokar / update_terraform.sh
Last active April 20, 2020 12:53
Automatic update Terraform
#!/usr/bin/env bash
#Defining Terrafrom Directory
INSTALL_DIR="/opt/terraform"
#Terrafrom URL
URL="https://releases.hashicorp.com/terraform"
#Getting local version
LOCAL_VER="0"
if [ -x "$(command -v terraform)" ]; then
LOCAL_VER=$(terraform -version | grep -v "+" | awk -Fv '{print $2}')
fi
@rammanokar
rammanokar / server.conf
Created December 10, 2019 06:09 — forked from laurenorsini/server.conf
OpenVPN configuration for /etc/openvpn/server.conf
local 192.168.2.0 # SWAP THIS NUMBER WITH YOUR RASPBERRY PI IP ADDRESS
dev tun
proto udp #Some people prefer to use tcp. Don't change it if you don't know.
port 1194
ca /etc/openvpn/easy-rsa/keys/ca.crt
cert /etc/openvpn/easy-rsa/keys/Server.crt # SWAP WITH YOUR CRT NAME
key /etc/openvpn/easy-rsa/keys/Server.key # SWAP WITH YOUR KEY NAME
dh /etc/openvpn/easy-rsa/keys/dh1024.pem # If you changed to 2048, change that here!
server 10.8.0.0 255.255.255.0
# server and remote endpoints
@rammanokar
rammanokar / lb-check.sh
Created November 28, 2019 08:14
Bash script to check Loadbalancer scheduling
#!/bin/bash
server1=0
server2=0
for i in {1..10}
do
lsb=$(wget -qO - https://x.x.x.x/server.text --no-check-certificate --no-cookies)
# server.text hold different value for different server
if [ $lsb == "server-1" ]
then
let "server1++"
@rammanokar
rammanokar / Deploy-xen.yml
Created October 22, 2019 03:13
Deploay Xen server using ansible
Machines:
Connectors:
- hostname: CCConn-0001
num_cpus: 4
num_cpu_cores_per_socket: 2
memory_mb: 8192
- hostname: CCConn-0002
num_cpus: 4
num_cpu_cores_per_socket: 2
memory_mb: 8192
@rammanokar
rammanokar / ansible-summary.md
Created October 18, 2019 06:22 — forked from andreicristianpetcu/ansible-summary.md
This is an ANSIBLE Cheat Sheet from Jon Warbrick

An Ansible summary

Jon Warbrick, July 2014, V3.2 (for Ansible 1.7)

Configuration file

intro_configuration.html

First one found from of

@rammanokar
rammanokar / README.md
Created October 1, 2019 08:22 — forked from leonardofed/README.md
A curated list of AWS resources to prepare for the AWS Certifications


A curated list of AWS resources to prepare for the AWS Certifications

A curated list of awesome AWS resources you need to prepare for the all 5 AWS Certifications. This gist will include: open source repos, blogs & blogposts, ebooks, PDF, whitepapers, video courses, free lecture, slides, sample test and many other resources.