Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dunderrrrrr/hostf
Manage /etc/hosts with Python3 faster than lightning :zap: :sparkles:
https://github.com/dunderrrrrr/hostf
etchosts hostf hostname hosts hostsfile python python3
Last synced: about 1 month ago
JSON representation
Manage /etc/hosts with Python3 faster than lightning :zap: :sparkles:
- Host: GitHub
- URL: https://github.com/dunderrrrrr/hostf
- Owner: dunderrrrrr
- Created: 2020-02-12T18:35:18.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2020-02-12T18:35:51.000Z (almost 5 years ago)
- Last Synced: 2023-08-20T14:37:27.058Z (over 1 year ago)
- Topics: etchosts, hostf, hostname, hosts, hostsfile, python, python3
- Language: Python
- Size: 5.86 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
![hostf](/img/hostf.png?raw=true)
Sometimes you need to manage your hosts file `/etc/hosts`.
Some do it on a daily basis.This Python script will do it for you faster than lightning :zap: :sparkles:
## Installing
Clone and cd into dir.
```sh
$ git clone [email protected]:dunderrrrrr/hostf.git && cd hostf/
```Add to `~/.bashrc`.
```shell
alias hostf='sudo /usr/bin/python3 /home/user/path/hostf/hostf.py'
```Reload shell or restart terminal.
```
$ source ~/.bashrc
```## Usage
### Add / delete / show records
```sh
$ hostf -a 10.1.1.50 example.com
```
```sh
$ hostf -d 10.1.1.50
```
```sh
$ hostf
127.0.0.1 localhost
10.1.1.5 test-serv
10.10.1.7 example.com
```## Help
```sh
$ hostf -h
usage:
[ADD] hostf -a
[DEL] hostf -dhostf will manage /etc/hosts faster than lightning.
optional arguments:
-h, --help show this help message and exit
-a 10.1.1.5 test.com Add to hosts.
-d 10.1.1.5 Delete from hosts.
```