Skip to content

Instantly share code, notes, and snippets.

View adamshamsudeen's full-sized avatar
🎯
Focusing

Adam Shamsudeen adamshamsudeen

🎯
Focusing
View GitHub Profile
@adamshamsudeen
adamshamsudeen / redis-producer-consumer.py
Last active November 18, 2021 07:26 — forked from igniteflow/redis-producer-consumer.py
A very simple implementation of a Redis producer-consumer messaging queue in Python3
import redis
import time
import sys
def producer():
r = redis.Redis()
i = 0
while True:
r.rpush('queue', 'Message %d' % i)
@adamshamsudeen
adamshamsudeen / creating ssh keys.txt
Created March 27, 2020 14:12
ssh keys generation
> on the local server do the following:
mkdir ~.ssh
chmod 750 ~
chmod 700 ~/.ssh
ssh-keygen -t rsa -b 2048
cat id_rsa_<server_name>.pub
> On the remote server do the following:
mkdir ~.ssh
chmod 750 ~
import logging
logger = logging.getLogger('name')
logger.setLevel(logging.DEBUG)
formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s')
# create file handler which logs even debug messages
fh = logging.FileHandler('name.log')
fh.setLevel(logging.WARNING)
fh.setFormatter(formatter)
logger.addHandler(fh)
import pyautogui
import time
#enable accssibilty permssion to terminal
#first get the position to click.
# pos = pyautogui.position()
# print(pos)
# x=1388, y=667
while True:
pyautogui.moveTo(1372, 670) # move mouse to the window
pyautogui.dragTo(1372, 670, button = 'left') # focus the window