Skip to content

Instantly share code, notes, and snippets.

View b-simjoo's full-sized avatar
🏠
Working from home

Behnam Simjoo b-simjoo

🏠
Working from home
View GitHub Profile
@b-simjoo
b-simjoo / ProxyAgent.py
Last active July 7, 2023 18:42
Proxy agent
#! /usr/bin/python3
# I wrote this script so that my personal computer running Ubuntu
# always has an active connection with the proxy server.
#
# Note that I am using my ssh config file, you can define a host there or
# you can type the whole command here
import notify2
import requests
@b-simjoo
b-simjoo / main.py
Created February 17, 2023 13:35
Running a process and use input and output (with reader thread) in Python
from subprocess import PIPE, Popen, run
from threading import Thread
from time import sleep
try:
from queue import Queue, Empty
except ImportError:
from Queue import Queue, Empty # python 2.x
out_q = Queue()