This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import redis | |
import time | |
import sys | |
def producer(): | |
r = redis.Redis() | |
i = 0 | |
while True: | |
r.rpush('queue', 'Message %d' % i) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
> 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 ~ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
OlderNewer