Giter Club home page Giter Club logo

get-shit-done's Introduction

get-shit-done

get-shit-done is an easy to use command line program that blocks websites known to distract us from our work.

After cloning this repository, put it in your $PATH and ensure it is executable.

Execute it as root because it modifies your hosts file and restarts your network daemon.

To get-shit-done

$ sudo get-shit-done work

To no longer get-shit-done

$ sudo get-shit-done play

$siteList

Add or remove elements of this array for sites to block or unblock.

~/.config/get-shit-done.ini

Appends additional sites to block. Duplicates will be removed, and www is prepended.

sites = foo.com, bar.com, baz.com

$restartNetworkingCommand

Update this variable with the path to your network daemon along with any parameters needed to restart it.

$hostsFile

Update this variable to point to the location of your hosts file. Make sure it is an absolute path.

Updates

It's amazing how fast this repository has grown, I had never expected a single link on Hacker News would have caused that! I love it.

I'd really love if anyone wanted to follow some of my other repositories, including jolt or dbmigrator. I think both are promising projects and I know I could use some help on them.

Thanks!

-Vic Cherubini

get-shit-done's People

Contributors

bradp avatar captn3m0 avatar flakas avatar hobart avatar icco avatar jmhobbs avatar jory avatar jrhorn424 avatar lericson avatar luqmana avatar massive avatar mlafeldt avatar mlloreda avatar pentaphobe avatar retr0h avatar roopeshvaddepally avatar streeter avatar timmow avatar yprez avatar zacharydanger avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

get-shit-done's Issues

Sed issues and duplication in /etc/hosts

I am getting the following error when trying to go to play-mode:

[.bin]=> sudo bash get-shit-done.sh work
[.bin]=> sudo bash get-shit-done.sh work
[.bin]=> cat /etc/hosts
              ## start-gsd
              127.0.0.1 reddit.com
              127.0.0.1 www.reddit.com
              (...)
              ## end=gsd
              ## start-gsd
              127.0.0.1 reddit.com
              127.0.0.1 www.reddit.com
              (...)
              ## end=gsd
[.bin]=> sudo bash get-shit-done.sh play
sed: illegal option -- -
usage: sed script [-Ealn] [-i extension] [file ...]
       sed [-Ealn] [-i extension] [-e script] ... [-f script_file] ... [file ...]

So there is duplicates in the /etc/hosts-file and the play-script is not working.

How to use it?

Little more instruction on how to use this software would be helpful for people with less knowledge.

Inifile hardcoded location is unpractical

How is the inifile supposed to be useful if run as root?

The inifile is placed under ~/.config. If the script is run as root, then the inifile must be placed under /root/.config. I find that unpractical. The inifile path should be passed on the command line and not be hardcoded.

sed: illegal option -- -

After installing get-shit-done, I received the following error when I tried "sudo get-shit-done play":

sed: illegal option -- -
usage: sed script [-Ealn] [-i extension] [file ...]
       sed [-Ealn] [-i extension] [-e script] ... [-f script_file] ... [file ...]

The only thing I did differently from the suggested installation is that, rather than adding the get-shit-done directory to my path, I created an alias to it.

alias get-shit-done="~/environment/submodules/get-shit-done/get-shit-done.sh"

Using get-shit-done requires sudo, though, which required this additional addition to process aliases (https://wiki.archlinux.org/index.php/Sudo#Passing_aliases):

alias sudo='sudo '

I apologize if that's a red herring, but I wanted to note the difference in case it's relevant.

I was able to fix the error by changing line 112 of get-shit-done.sh:

OLD: sed --in-place -e "$sed_script" $file
NEW: sed -i -e "$sed_script" $file

Anyone have any insight on this? Do I have a different version of sed than the script expects?

Needs locally editable list of blocked sites

The blocked sites that come with the script by default are lacking.

Needs locally modifiable, installation specific lists.

If I get time, I will work on it and submit a patch, but I believe it needs to be done regardless.

domain endings other than .com

Sadly, "get-shit-done" does not work with domain endnings other than ".com". For example, there is no way to block "lemonde.fr".

Could you do something about this?

I need it badly :-) Thanks!

restart network command should be /etc/init.d/network not /etc/init.d/networking

At least on my computer running fedora, the command to restart the network is this.

$ sudo /etc/init.d/network restart
Restarting network (via systemctl): [ OK ]
$ uname -a
Linux hh-desktop.1aauto.local 3.8.4-102.fc17.x86_64 #1 SMP Sun Mar 24 13:09:09 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux

That seems to be the case in other linux flavors.
http://blog.hpxn.net/2009/01/29/restart-network-service-in-redhat-centos-fedora/comment-page-1/

Shell script does not follow links

If I hard link the wrapper script get-shit-done to my path and reload, calling the script yields the following:

jeffreyhorn@hook:~/src/get-shit-done 2011-05-17 08:35:22 git:master
>> get-shit-done work
/Users/jeffreyhorn/bin/get-shit-done: line 14: /Users/jeffreyhorn/bin/get-shit-done.php: No such file or directory

Symllinking instead of hard linking fails to make bash aware of the script.

init.d/networking isn't portable.

That's some ubuntu/debian magick. Say, arch has only /etc/rc.d/network, and it's not really needed, as far as I can tell, and I think that line's redundant and should be removed. (I'm talking about the line 34, of course.)

    % sudo get-shit-done play
    sh: /etc/init.d/networking: No such file or directory

How do I add new sites to be blocked?

I want to also block the site "instructables.com" (for example).

When I extract the downloaded zip-File in Ubuntu, I get these files:
get-shit-done
get-shit-done.php
get-shit-done.py
get-shit-done.sh
README.md
sites.ini

So I figured that I just have to open sites.ini with gedit and add "instructables.com" to block it. However, this does not work. So what do I have to do instead?

Thanks.

HTTP Proxy

Why not just make use of an HTTP proxy? No need for sudo, and it can be used on a multi-user system, as well as be configured per-application.

Can't turn off work mode

I installed get-shit-done on my mac and turned on work mode with "sudo get-shit-done work". Distracting sites are being blocked and work is getting done, but I can't turn it off.

Can't...stop...working! This is more hardcore than I expected!

Anyhow, so "sudo get-shit-done play" executes without response and doesn't turn it off. "sudo get-shit-done work" replies with "Work mode already set.", so the path configuration to the executable would seem to be set properly. Any idea what could be going wrong? Thanks!

Demonize

surely this should be a demon >:D

(this is a joke)

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.