Tag Archives: http

rfc and httpdoc: Two terminal references

I have a couple of simple but related tools today, both from the same author. At left is rfc, and at right is httpdoc.

2015-04-25-6m47421-rfc 2015-04-25-6m47421-httpdoc

I’ve known about rfc for a while, but got a reminder about httpdoc earlier this week via e-mail. Since they both have the same style and same creator, it makes sense to lump them together.

rfc, when supplied with a number or a topic line, will pull the text of that RFC from the web and dump it into your $PAGER. No fancy formatting, no color-coded document histories, just one-shot quick access to RFCs all the way back to … well, back to number 1.

The home page has a three-step process for “installing” rfc into your $HOME directory, although I daresay it could be rearranged to allow for more than just one person to use. In any case, it takes very little effort and rfc itself won’t bog down your system, seeing as it’s just a bash creation.

As an added bonus, rfc will keep its documents stored locally, so you don’t have to re-download a request. If you rely on rfc frequently, you’ll probably be interested in some of the built-in actions — like update or list, which give rfc a little more oomph, and search, which … well, you should be able to figure that one out. πŸ™„

httpdoc is similar, in a way. As you can see above, httpdoc becomes an offline reference tool for HTTP documentation. In the screenshot above, I only showed the 404 status code, but httpdoc can also return documentation on header fields, if you need that.

I can see where httpdoc is still being updated even in the past few days, so I expect there will be more references to come.

httpdoc is written in go, so you’ll need that installed before it will play along. There are also some environment variables that you’ll want to adjust before using it, but it’s nothing complicated.

Both of these tools might strike you as too simple to be noteworthy, but that will depend a lot on your perspective. I use things like dict on a daily basis, and even have it hot-wired for thesaurus entries as part of my .bashrc.

If you have a similar need for RFC or HTTP documentation at the command line, then you might find both of these install-worthy. Necessity is the mother of invention. Or is it the other way around … ? πŸ˜‰

boa: Run a server from anywhere

Usually I steer away from server daemons on this site; I don’t have enough experience setting them up and the configuration can be a little tricky.

boa was fairly straightforward though, even when I added the complication of yanking the Debian binary and jamming it down the craw of my Arch installation.

2015-04-10-lr-0xtbe-boa

No major accomplishment in the grand scheme of things, but I at least have a real screenshot to show off. :\

Everything I know about boa is off the Debian page or the help flags, with a little more added in the configuration file. If you point everything at the current directory when boa runs, it will serve up its own folder, much like you see above.

On the one hand, that might be preferable to some of the complexities for members of the high-end server market.

Apparently boa runs on an exceptionally small amount of resources, and can even do its business on Pentium-grade equipment. I don’t have a Pentium machine now that I can put that claim to the test, but perhaps the next one that comes along, I’ll try. (Actually I do have one now, but it’s so badly battered that I’m considering setting it free.)

That’s about all I can say about boa, but that’s mostly because I’m fairly ignorant about web servers to start with. If you’re in that racket and need something with a smaller profile, boa might be for you.

In Debian. Not in Arch. πŸ˜‰

ngincat: Four lines of bash, plus netcat

Sometimes I run across small feats of wizardry that don’t really impress much as a solid and whole application, but are worth mention anyway.

Lonnie sent a note about ngincat, a tiny http server written in bash around netcat.

2014-11-06-2sjx281-ngincat

It’s not bulletproof, it’s not secure and probably not a great idea outside your home network or maybe as an intra-office gizmo. But doggone it, that’s pretty darned cool for four lines of bash.

And in part it’s no surprise, since netcat is only the ultra-wickedest network tool out there, save maybe socat or nmap.

As for a true case use, I’ll see if I can combine this with vee, and end up with the leanest functional in-house blogging site known to man. And I’ll surf it with the world’s smallest graphical browser, just to be sassy. πŸ˜‰