Giter Club home page Giter Club logo

hose's Introduction

hose.png

Redirect any domain to localhost for convenience or productivity!

You can use hose to redirect domains to localhost, for development purposes. See advanced usage

Also, improve your productivity by easily disabling access to domains you frequent. Set it up once, then just use hose and hose --off!

Install

Use npm.

npm i -g hose

Setup

chown your hosts file.

sudo chown user:user /etc/hosts

Usage

Here's the list of domains which are blocked off by default.

facebook.com
twitter.com
tweetdeck.twitter.com
www.newsblur.com
getpocket.com
clicky.com
blog.ponyfoo.com
bevacqua.io
www.echojs.com
news.ycombinator.com
lobste.rs

hose <domain> <domain> <domain>

Adds domains to the blacklist

hose -r <domain> <domain> <domain>

Removes domains from the blacklist

hose --remove-all

Wipes the blacklist

hose --list

Prints the blacklist

hose -H <hosts>

Change the file for hosts, which defaults to /etc/hosts

hose

Turns on the hose. Note that the hose is always turned on, unless we provide the --off parameter

hose --off

Turns off the hose

hose open

Opens the hosts file in $EDITOR, or vi if $EDITOR isn't set.

Advanced Usage

You can also use this program to redirect domains to a particular url. This is useful when testing web applications locally.

First off, I recommend creating a new profile.

hose -p site

Start off by creating an empty profile

hose -p site --set-trap 127.0.0.1

Trap on 127.0.0.1, rather than 0.0.0.0, so that you can visit those domains in your browser.

hose -p site <domain> <domain> <domain>

Provide a list of domains you want to be trapped.

Of course, you can also do all of the above in one fell swoop.

hose -p site --set-trap 127.0.0.1 <domain> <domain> <domain>

You need to specify the profile when turning it on or off, e.g:

hose -p site
hose -p site --off

That's it!

License

MIT

hose's People

Contributors

bevacqua avatar lightster avatar

Watchers

 avatar

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.