GithubHelp home page GithubHelp logo

hosts's Introduction

Hosts

提示

由于最近steam被工信部拉黑了。直接改Hosts文件可能作用不大;需要配合一下措施!

  1. 在steam启动快捷方式上右键打开属性;
  2. 在属性 --> 快捷方式 --> 目标 尾部加上参数 ' -tcp' or '-websocket';(参数前必须预留一个空格) 一下图为例:

image

项目介绍

  1. 目标:

    • 添加 epic无法登录和领取免费游戏 hosts。
    • 第一次写python,练手学习.....

脚本介绍

python依赖导出

python引入各种依赖库,使用脚本前需:

  • 安装requirements导出器: pip install pipreqs
  • 导出当前项目的requirements.txt: pipreqs ./ --encoding=utf8

不推荐使用pip freeze 因为这个命令会生成所有依赖项 包括项目之外的 不利于CICD

python依赖安装

  • 本地调试: pip install -r ./requirements.txt
  • workflow: pip install -i <https://pypi.tuna.tsinghua.edu.cn/simple> -r ./workingDir/requirements.txt

命令介绍

cd 至 workingDir 文件夹后 执行以下操作;

  1. python ph.py -a domain domain ... -a命令,在默认domain列表后加入需要解析的域名;
  2. python ph.py -d domain domain ... -d命令,使用自定义域名替换默认解析列表;
  3. python ph.py -f file -f 命令,接收文本文件。 解析文本文件中的域名;

以上命令将在当前文件夹中生成hosts.txt文件。 使用 -o 命令自定义输出文件名;(-o outputFile)

hosts

本仓库 hosts文件介绍

  1. hosts.txt 文件包含 GitHub hosts,Epic hosts;
  2. Github 和 Epic 分别有单独 hosts文件;

hosts本仓库在线同步地址

  1. Github https://github.com/JohyC/Hosts/blob/main/hosts.txt

  2. Gitee https://gitee.com/yuchi-shentang/GithubHosts/blob/main/hosts.txt

  3. Gitea https://www.foul.trade:3000/Johy/Hosts/raw/branch/main/hosts.txt

  4. 服务器 由于安全问题,不再提供服务链接,请使用gitea链接同步;

仓库同步地址

  1. gitea https://www.foul.trade:3000/Johy/Hosts
  2. gitee https://gitee.com/yuchi-shentang/GithubHosts

使用方式

通过 SwitchHosts! 自动更新 推荐

推荐使用 SwitchHosts 配置hosts,操作简单,支持跨平台。

详细介绍 : SwitchHosts! 还能这样管理hosts,后悔没早点用

  1. 打开 SwitchHosts ,点击左上角加号 添加hosts同步规则。
  2. 规则配置:

image

手动配置hosts

macOS

hosts文件位置:/etc/hosts

macOS系统下修改需要按照如下方式:

  1. 打开(访达)Finder
  2. 组合键Shift+Command+G打开"前往文件夹"
  3. 输入框中输入/etc/hosts;跳转到hosts文件位置

注意:VS Code可以直接修改和保存,不需要以下步骤。

  1. 复制hosts文件到桌面,右键点击文件,「打开方式」—「文本编辑」,复制本仓库提供的hosts文件内容至最下方。

  2. 使用修改之后的hosts文件替换掉原本/etc/hosts 文件。

注意:如果弹出密码输入框,你需要输入你当前登录账号对应的密码。

  1. 最后刷新缓存:
sudo killall -HUP mDNSResponder

Windows

hosts文件位置:C:/windows/system32/drivers/etc/hosts

将前文hosts内容追加到hosts文件,然后刷新DNS缓存:

# win键 + r键;输入cmd,回车;在cmd命令行窗口中输入以下!
ipconfig /flushdns

TODO

  • GitHub Actions自动更新hosts内容;
  • GitHub Actions自动更新本仓库代码至Gitee;(可从Gitee获取最新hosts文件)
  • 自建git服务器,并同步仓库内容;(解决Gitee hosts.txt文件违规问题)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.