Skip to content

Instantly share code, notes, and snippets.

View rexdivakar's full-sized avatar
🎯
Focusing

rex_divakar rexdivakar

🎯
Focusing
View GitHub Profile
@rexdivakar
rexdivakar / redis_cluster_migration.py
Created January 16, 2023 01:48
Redis Cluster migration Script
#Working Solution with the runtime of 2:30 mins
from rediscluster import RedisCluster
from multiprocessing import Pool
# Connect to source Redis cluster
src_redis = RedisCluster(startup_nodes=[{"host": "xxxx.xxxxxx.clustercfg.xxxx.cache.amazonaws.com", "port": "6379"}], decode_responses=True,skip_full_coverage_check=True)
# Connect to destination Redis cluster
dst_redis = RedisCluster(startup_nodes=[{"host": "xxxx.xxxxxx.clustercfg.xxxx.cache.amazonaws.com", "port": "6379"}], decode_responses=True,skip_full_coverage_check=True)
################################
## our HTTP server at port 80 ##
################################
server {
listen 80;
server_name <website_url>;
# HTTP STS
add_header Strict-Transport-Security "max-age=31533600; includeSubDomians; preload" always;
@rexdivakar
rexdivakar / auto_deploy_nginx.sh
Last active December 31, 2021 01:01
Nginx Auto Config Updater
#!/bin/bash
# ------------------------------------------------------------------#
# Auto Nginx deploys #
# Description: #
# This script automatically deploys nginx Services #
# #
#Input Arguments: #
# sudo bash enginX.sh <service_name> <port-no> #
# Dependency: #
# sudo apt install Nginx #
#!/bin/bash
# Takes a full backup of the database and stores it in the backup folder
# Run this script as the postgres user
DATE=`date +%Y-%M-%d-%H-%M-%S`
logged_in_user=$USER
FILE=snapshot_$DATE.tar
start=`date +%s`
@rexdivakar
rexdivakar / cloudSettings
Last active February 11, 2022 02:02
Auto Deploy Nginx Services
{"lastUpload":"2022-02-11T02:02:54.357Z","extensionVersion":"v3.4.3"}