A script to automatically update the github's proxy IP in hosts file.

Overview

updateHostsGithub

A script to automatically update the github's proxy IP in hosts file. Now only Mac and Linux are supported. (脚本自动更新本地hosts文件,目前仅支持Mac和linux系统。)

Reference

The data comes from this repository - GitHub520.

Usage(使用)

You need to have a python3 environment and use python3 -m pip install -r requirements.txt command to install necessary third-party library.

How to run it(如何运行)

python3 main.py

Schedule it to run at any time(定时任务)

You need to create a crontab task to run it at any time. Such as:

0 */4 * * * echo [password] | sudo -S sh -c 'cd /Users/dapeng/Desktop/code/python3 && /Users/dapeng/.virtualenvs/py39/bin/python main.py >> crontask.log 2>&1'

I set this script to be run at minute 0 past every 4th hour.

Crontab Syntax(Crontab 语法)

Field Description Allowed Value
MIN Minute field 0 to 59
HOUR Hour field 0 to 23
DOM Day of Month 1 to 31
MON Month field 1 to 12
DOW Day Of Week 0 to 6
CMD Command Any command to be executed.

There are some usefull websites:

You might also like...
Compare the contents of your hosted and proxy repositories for coordinate collisions

Nexus Repository Manager dependency/namespace confusion checker This repository contains a script to check if you have artifacts containing the same n

a safe proxy over tls

TlsProxys 基于TLS协议的http流量代理 安装 ※ 需要python3.7+ linux: python3.9 -m pip install TlsProxys windows: pip install TlsProxys 基本用法 服务器端: $ tpserver [command]

sshuttle: where transparent proxy meets VPN meets ssh

Transparent proxy server that works as a poor man's VPN. Forwards over ssh. Doesn't require admin. Works with Linux and MacOS. Supports DNS tunneling.

Cobalt Strike C2 Reverse proxy that fends off Blue Teams, AVs, EDRs, scanners through packet inspection and malleable profile correlation
Cobalt Strike C2 Reverse proxy that fends off Blue Teams, AVs, EDRs, scanners through packet inspection and malleable profile correlation

Cobalt Strike C2 Reverse proxy that fends off Blue Teams, AVs, EDRs, scanners through packet inspection and malleable profile correlation

A Python library to utilize AWS API Gateway's large IP pool as a proxy to generate pseudo-infinite IPs for web scraping and brute forcing.

A Python library to utilize AWS API Gateway's large IP pool as a proxy to generate pseudo-infinite IPs for web scraping and brute forcing.

A SOCKS proxy server implemented with the powerful python cooperative concurrency framework asyncio.

asyncio-socks-server A SOCKS proxy server implemented with the powerful python cooperative concurrency framework asyncio. Features Supports both TCP a

CORS Bypass Proxy Cloud Function

CORS Bypass Proxy Cloud Function

A python tool auto change proxy or ip after dealy time set by user
A python tool auto change proxy or ip after dealy time set by user

Auto proxy Ghost This tool auto change proxy or ip after dealy time set by user how to run 1. Install required file ./requirements.sh 2.Enter command

Easy-to-use sync library for handy proxy parse

Proxy Parser About Synchronous library, for convenient and fast parsing of proxies from different sources. Uses Scrapy as a parser. At the moment the

Comments
  • Opt: 优化文件写入的时机

    Opt: 优化文件写入的时机

    代码中写死了从旧文件的第18行开始写入,这是不对的。需要分两种情况:

    1. 以要写入文件的首行作为标识,去做为起始值
    2. 如果没有要写入的文件的首行,那就直接在原文件后面追加新内容
    def write_new_content_to_hosts(self):
            logger.info('Start to write the new contents to hosts file.')
            with open(self.hosts_file_origin, 'r') as f_r:
                self.origin_hosts = f_r.readlines()
    
            hosts_length = len(self.origin_hosts)
            for i in range(18, hosts_length)[::-1]:    # 这里需要修改start value.
                del self.origin_hosts[i]
    
            self.origin_hosts.append(self.new_hosts_content)
            with open(self.hosts_file_origin, 'w') as f_w:
                f_w.writelines(self.origin_hosts)
    
            logger.info('Write done.')
    
    opened by Abeautifulsnow 0
Owner
null
This script helps us to add IP, host name entry in hosts file and create directory run nmap scan and directory scan with your favourite tools

A python script to automate your set-up for Hack The Box, It sets up Workspace, Opens TMUX session, connects to OpenVPN, Runs Nmap and many more...

Cognizance 7 Mar 25, 2022
Python port of proxy-www (https://github.com/justjavac/proxy-www)

proxy-www.py Python port of proxy-www (https://github.com/justjavac/proxy-www). Implemented additional functionalities! How to install pip install pro

Minjun Kim (Lapis0875) 20 Dec 8, 2021
Best discord webhook spammer using proxy (support all proxy type)

Best discord webhook spammer using proxy (support all proxy type)

Iтѕ_Ѵιcнч#1337 25 Nov 1, 2022
Automatic Proxy scraper and Proxy-rotating Nitro Generator.

Automatic Proxy scraper and Proxy-rotating Nitro Generator.

Tawren007 2 Nov 8, 2021
Azure-function-proxy - Basic proxy as an azure function serverless app

azure function proxy (for phishing) here are config files for using *[.]azureweb

null 17 Nov 9, 2022
A simple hosts picker for Microsoft Services

A simple Python scrip for you to select the fastest IP for Microsoft services.

Konnyaku 394 Dec 17, 2022
Search ports in multiples hosts

Search Port ✨ Multiples Searchs ✨ Create list hosts Create list targets Start Require Python 3.10.0+. python main.py Struture Function Directory load_

Tux#3634 7 Apr 29, 2022
Fast and configurable script to get and check free HTTP, SOCKS4 and SOCKS5 proxy lists from different sources and save them to files

Fast and configurable script to get and check free HTTP, SOCKS4 and SOCKS5 proxy lists from different sources and save them to files. It can also get geolocation for each proxy and check if proxies are anonymous.

Almaz 385 Dec 31, 2022
A TrueCharts automatic and bulk update utility

trueupdate A TrueCharts automatic and bulk update utility How to install run pip install trueupdate Please be aware you will need to reinstall after e

TrueCharts 125 Jan 4, 2023
Truetool - A TrueCharts automatic and bulk update utility

truetool A easy tool for frequently used TrueNAS SCALE CLI utilities. Previously

TrueCharts 125 Jan 4, 2023