Security News
Weekly Downloads Now Available in npm Package Search Results
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
Block distracting sites from the command line
I built this as a replacement for SelfControl. It has the following features:
yarn global add blockr
Start by creating the file ~/blockr.json
. You can use the file in this repo as a starting point. It should contain a single hosts
key containing the URLs of sites you would like to block. This file can use JSON5 syntax, including comments and trailing commas.
Run blockr
to block all of the sites in your config file.
Run blockr unblock
to remove the block.
Run blockr unblock [sitename]
to unblock a particular site.
Blockr works by editing the hosts file at /etc/hosts
. This requires root access. You can acheive this by running sudo blockr
, however this will require you to type your password every time you use it.
You can also provide your sudo password via a flag, like blockr --password hunter2
. If you're worried about security, use a command line password manager like 1Password to echo the password. Using a literal is not recommended as your password will then be saved your shell history.
You can easily sync your config file in two ways: via a symlink, or a flag. First create your blockr.json
somewhere else like ~/code/dotfiles/blockr.json
. Then you can point to it
Via a symlink: run ln -s $HOME/code/dotfiles/blockr.json $HOME/blockr.json
Via a flag: use blockr --config-file $HOME/code/dotfiles/blockr.json
. You could also put this in an alias so you don't have to type it every time.
/etc/hosts
directly, like SelfControl does.blockr unblock
for a certain period of time.MIT
FAQs
> Block distracting sites from the command line
We found that blockr demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
Security News
A Stanford study reveals 9.5% of engineers contribute almost nothing, costing tech $90B annually, with remote work fueling the rise of "ghost engineers."
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.