Skip to content

Instantly share code, notes, and snippets.

View leodotcloud's full-sized avatar
🎯
Focusing

Murali Paluru leodotcloud

🎯
Focusing
View GitHub Profile
@leodotcloud
leodotcloud / tunnel.sh
Created June 23, 2017 23:52 — forked from vishvananda/tunnel.sh
Script to set up an ipsec tunnel between two machines For Example: ./tunnel.sh 10.10.10.1 10.10.10.2 192.168.0.1 192.168.0.2 would set up an ipsec tunnel over 10.10.10.1 address using 192.168.0.1 as a virtual address passwordless sudo required for user on remote machine
#!/bin/bash
if [ "$4" == "" ]; then
echo "usage: $0 <local_ip> <remote_ip> <new_local_ip> <new_remote_ip>"
echo "creates an ipsec tunnel between two machines"
exit 1
fi
SRC="$1"; shift
DST="$1"; shift
@leodotcloud
leodotcloud / get_image_manifest.sh
Created August 3, 2017 22:33 — forked from alex-bender/get_image_manifest.sh
Docker Registry v2 get manifest and push\pull
#!/bin/bash
#
# Shell scripts for get image manifest from v2 registry
#
# Tested on Debian 8, curl 7.38.0, jq-1.5
#
set -e -u
# Default tag is latest
@leodotcloud
leodotcloud / get_domain_from_url.sh
Created March 9, 2018 18:55
Extract just the domain name or IP address from URL string
#!/bin/bash
get_domain_name() {
echo "$1" | awk -F/ '{print $3}' | sed 's/:.*//'
}
URLS=$(cat <<-END
http://1.1.1.1
http://1.1.1.1:8443
https://1.1.1.1
@leodotcloud
leodotcloud / cattle_cleanup_purged_instances_from_db.sql
Last active October 11, 2019 09:22
Cattle: MySQL procedures to clean up purged instances from Database
DELIMITER $$
/*
* rmsg
*
* Procedure to print messages
*/
DROP PROCEDURE IF EXISTS rmsg$$
CREATE PROCEDURE rmsg(msg VARCHAR(255))
BEGIN
@leodotcloud
leodotcloud / cleanup.sh
Last active March 18, 2022 02:32
Cleanup 2.x cluster node for reuse
docker rm -f $(docker ps -qa)
docker volume rm $(docker volume ls -q)
for mount in $(mount | grep tmpfs | grep '/var/lib/kubelet' | awk '{ print $3 }') /var/lib/kubelet /var/lib/rancher; do umount $mount; done
rm -rf /etc/ceph \
/etc/cni \
/etc/kubernetes \
@leodotcloud
leodotcloud / clean_cluster_node.sh
Created May 2, 2020 16:25
Rancher 2.x: Clean up cluster nodes
#/bin/bash
# https://rancher.com/docs/rancher/v2.x/en/cluster-admin/cleaning-cluster-nodes/
# sudo -i
docker rm -f $(docker ps -qa)
docker rmi -f $(docker images -q)
docker volume rm $(docker volume ls -q)