DIE icon indicating copy to clipboard operation
DIE copied to clipboard

Redis Server initial setup

Open arvindk459895 opened this issue 2 years ago • 0 comments

What should be the redis server id ?

#!/usr/bin/env python3 import os import subprocess #export REDIS_URL=redis://localhost:9000

p = subprocess.Popen(["tmux", "ls"], stdout=subprocess.PIPE) out, err = p.communicate() if "ssh-tunneling" in out.decode("utf-8"): print("ssh-tunneling already exists") exit()

print("This script makes ssh-tunneling between your redis-server and this machine.")

server = input("redis-server URL : ") login = input("redis-server ID : ")

os.system("tmux new-session -s ssh-tunneling -d 'ssh -L 9000:localhost:6379 " + login + "@" + server + "'")

arvindk459895 avatar Nov 04 '22 06:11 arvindk459895