Originally from https://github.com/leftnode/get-shit-done.
Just move work
and play
to /usr/bin
and run them as root.
Remember to change ini_local
in work
to an appropriate path.
- This script is for Linux with
nscd
installed.nscd
will monitor configuration files including/etc/hosts
, so you don't need to manually flush DNS cache after updating the hosts file. - I split the python version into two seperate files just to save some keystrokes...
- The format of config file (see the example
sites.conf
):- One site per line, because this is more readable, and easy to add new sites in the middle, which helps keeping the config file organized.
- Allow comments starting with '#'.
Some simple sanity checks are also added.
If you are using other platforms, you should make some modifications accordingly.