Hacker Newsnew | past | comments | ask | show | jobs | submit | lotheac's commentslogin

> Automatically take a snapshot every 5 minutes, and present a the user a program that broweses the filesystem at time X, probably with integration into the filemanager to restore files/folders.

Something like this? http://java.dzone.com/news/killer-feature-opensolaris-200


That sounds like it is doing something fancier then periodic snapshotting, such as using an immutable filesystem, where every fs operation is inherently lossless (up to garbage collection).

Of course, I might be reading to much into the continous nature of a slider. Does anyone have experience with that feature?


(Sorry for the late reply)

In OpenSolaris it just used cronjobs to create zfs snapshots.


This is a prime example of useless use of cat. Heredoc already means "pass this as stdin", there's no need to pipe it. Your example without cat:

    curl http://localhost -d @- <<REQUEST_BODY
    {
      "from" : 0,
      "size" : 40
    }
    REQUEST_BODY


I like modularity:

    request_body() {
        cat <<REQUEST_BODY |      
        {
            "from" : 0,
            "size" : 40
        }
        REQUEST_BODY
    }

    get_url() {
        curl http://localhost -d @-
    }

    request_body | get_url
I find it helps readability when you come back to it a year later. Of course, it's also easy to parameterize the body, if needed.

/readability sometimes trumps YAGNI


Well, maybe in that case it is. But I like to separate the commands so that the data flow looks sequential. That way it makes more sense to me.


Much as I hate the cargocult invocation of "UUOC", this is actually nicer because it reads more sanely - the HEREDOC is properly linked to the curl whereas the previous has the curl seemingly adrift on its own line unattached to the HEREDOC.


This seems to copy a bad design decision from virtualenv. Please see https://gist.github.com/datagrok/2199506


I implemented the suggestions in this gist on a new branch here:

https://github.com/ChuckHa/goenv/tree/inve

I'm not sure I like it better though because it unsets $PS1 and other variables that get set in .bash_profile.



This is pretty cool, thanks for sharing.


I don't think exporting PS1 is a good idea. Child processes don't need it and if I launch a different shell with different PS1 semantics I get a broken prompt instead of whatever the default for that shell is.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: