Live data from Hacker News

Unix Toolbox

cb.vu

21–30 of 42 posts

Re: Unix Toolbox

#21
post #11

Bro Pages (instead of "man" pages) is a similar resource I find myself using surprisingly often http://bropages.org/browse

That project is a symptom of manual pages not having good “EXAMPLES” sections. The examples on that web page should be contributed upstream to the manuals pages of the software that they are for.

If you want a fast way to read the EXAMPLES section only for a command, here is a shell function which creates an ‘eg’ command which only displays the “EXAMPLES” section of manual pages:

  eg(){
      MAN_KEEP_FORMATTING=1 man "$@" 2>/dev/null \
          | sed --quiet --expression='/^E\(\x08.\)X\(\x08.\)\?A\(\x08.\)\?M\(\x08.\)\?P\(\x08.\)\?L\(\x08.\)\?E/{:a;p;n;/^[^ ]/q;ba}' \
          | ${MANPAGER:-${PAGER:-pager -s}}
  }
Usage:

  $ eg tar
  EXAMPLES
       Create archive.tar from files foo and bar.
             tar -cf archive.tar foo bar
       List all files in archive.tar verbosely.
             tar -tvf archive.tar
       Extract all files from archive.tar.
             tar -xf archive.tar
  $

Re: Unix Toolbox

#22
post #14

hostname -i on cb.vu says the IP address is 78.31.70.238, but if you ping a host from the interface, the pings originate from 178.33.34.4 (according to tcpdump).

On this system hostname -i says 127.0.1.1, despite this address not being set on any of my interfaces (lo0 is 127.0.0.1).

Re: Unix Toolbox

#23
post #22
post #14

hostname -i on cb.vu says the IP address is 78.31.70.238, but if you ping a host from the interface, the pings originate from 178.33.34.4 (according to tcpdump).

On this system hostname -i says 127.0.1.1, despite this address not being set on any of my interfaces (lo0 is 127.0.0.1).

It looks like hostname -i is getting its value from /etc/hosts. hostname --all-ip-addresses returns the correct result.

Re: Unix Toolbox

#24
post #18
post #5

It was on my bookmarks for a long time. I thought it would be nice to share with you guys. There are so many times I do searches on HN to recall about some nice things I've seen oh the web... Quite often, the comments are the gems!

Yeah I found this via HN a couple years ago. This along with the following links will help anyone getting into sysadmin work: https://github.com/jlevy/the-art-of-command-line | https://www.bento.io/grid | https://www.sqlteaching.com/

https://nixsrv.com/llthw is the real deal (IMHO).

Re: Unix Toolbox

#25
post #11

Bro Pages (instead of "man" pages) is a similar resource I find myself using surprisingly often http://bropages.org/browse

just tried out to install bro pages with a fresh ruby 2.2.1 from rvm on OS X and got this reproducable. Seems broken for me: $ bro curl The curl command isn't in our database.

You might have an easier time getting tldr pages to work: https://github.com/tldr-pages/tldr

Re: Unix Toolbox

#27
I used to know a lot of this stuff. With Puppet, Chef, and then Ansible, I've found myself needing to know less and less of it.

Re: Unix Toolbox

#28
post #11

Bro Pages (instead of "man" pages) is a similar resource I find myself using surprisingly often http://bropages.org/browse

Damn, I remember the HN thread about that. The derailing was phenomenal. Interesting that the project lives on.

[deleted]

Re: Unix Toolbox

#29
post #21
post #11

Bro Pages (instead of "man" pages) is a similar resource I find myself using surprisingly often http://bropages.org/browse

That project is a symptom of manual pages not having good “EXAMPLES” sections. The examples on that web page should be contributed upstream to the manuals pages of the software that they are for. If you want a fast way to read the EXAMPLES section only for a command, here is a shell function which creates an ‘eg’ command which only displays the “EXAMPLES” section of manual pages: eg(){ MAN_KEEP_FORMATTING=1 man "$@"…

Thank you, this is really helpful.

Could anyone contribute a version for OSX?

Re: Unix Toolbox

#30
post #21

Earlier quoted context omitted.

That project is a symptom of manual pages not having good “EXAMPLES” sections. The examples on that web page should be contributed upstream to the manuals pages of the software that they are for. If you want a fast way to read the EXAMPLES section only for a command, here is a shell function which creates an ‘eg’ command which only displays the “EXAMPLES” section of manual pages: eg(){ MAN_KEEP_FORMATTING=1 man "$@"…

Thank you, this is really helpful. Could anyone contribute a version for OSX?

If you have homebrew you can just install the 'gnu-sed' package and then change the function to call 'gsed' instead.
Post reply on HN