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 requests | |
from pprint import pprint | |
def r_get(url): | |
res = requests.get(url) | |
print(url) | |
print(res.text) | |
if res.status_code == 404: | |
return |
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
sudo apt install squid squid-deb-proxy squid-deb-proxy-client squidclient apache2-utils && sudo service squid start && sudo rm -rfv /etc/squid/squid.conf; | |
# Write squid.conf to /etc/squid.squid.conf | |
echo "# apt-get install squid apache2-utils" | sudo tee -a /etc/squid/squid.conf | |
echo "# htpasswd -c /etc/squid/.htpasswd user_name" | sudo tee -a /etc/squid/squid.conf | |
echo "# systemctl restart squid" | sudo tee -a /etc/squid/squid.conf | |
echo "" | sudo tee -a /etc/squid/squid.conf | |
echo "acl CONNECT method CONNECT" | sudo tee -a /etc/squid/squid.conf | |
echo "" | sudo tee -a /etc/squid/squid.conf | |
echo "# line 989: add follows for Basic auth" | sudo tee -a /etc/squid/squid.conf | |
echo "auth_param basic program /usr/lib/squid/basic_ncsa_auth /etc/squid/.htpasswd" | sudo tee -a /etc/squid/squid.conf |
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 | |
import colorlog | |
def create_log_file(log_file_name): | |
with open(log_file_name, 'w') as o: pass | |
def setup_logger(log_fmt="%(log_color)s%(asctime)s:%(levelname)s:%(message)s", log_file_name=".output.log", level='DEBUG'): | |