Giter Site home page Giter Site logo

hostswitch's Introduction

host文件配置说明

[HostSwitch 环境切换]

用于开发工作中的环境切换,亮点:科学上网

根据需要先配置以下host文件

hosts               当前环境
hosts.develop       开发环境
hosts.google        科学上网
hosts.original      原始环境
hosts.work          工作环境

都是在这几个环境中切换

Windows环境初次使用说明

将全部hosst文件拷贝至 C:\Windows\System32\drivers\etc\

C:\Windows\System32\drivers\etc\hosts

手动备份hosts文件

C:\Windows\System32\drivers\etc\hosts.bak

hosts 和 hosts.bak 两个文件

需要管理员权限,给Users组添加完全控制权限(仅仅编辑权限还不够)

启动HostSwitch.bat

Linux环境初次使用说明

将此目录放在home目录即可,执行以下命令

$ chmod +x init.sh HostSwitch.sh
$ ./init.sh
$ ./HostSwitch.sh

更新 hosts 文件(需要定期更新)

$ chmod +x update.sh
$ ./update.sh

hosts文件保留前几行如下(注意替换主机名称):

127.0.0.1       localhost  # 本地地址(ipv4)
::1             localhost  # 本地地址(ipv6)
127.0.1.1       ubuntu  # 主机名称
255.255.255.255	broadcasthost

注意 127.0.0.1 与 127.0.1.1 的区别

否则执行sudo命令会报错(虽然不影响执行结果)

sudo:无法解析主机:ubuntu

hosts 资源

github 支持:https://github.com/racaljk/hosts

另外,关于笔记本win7环境wifi热点设置请参考PC_WIFI目录

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.