You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@apr.apache.org by Graham Leggett <mi...@sharp.fm> on 2021/01/18 10:43:08 UTC

Re: Proposal: apr-tools project

On 27 Jul 2019, at 21:29, William A Rowe Jr <wr...@rowe-clan.net> wrote:

> I'd think that the APT Project (Apache Portable Tools?) would be a good community to kick off, and it should be independent and self organizing. It should follow its own versioning and release schema, since what is best practice for an API might not map 1:1 for a toolchain.
> 
> Fastest track, kick off a labs demo. Then one or two paths as a community unfolds around the code, either through the incubator (great for new and less familiar contributors) or sponsored by the APR project. Either way, several mentors and build a group of committees and it should be very successful.
> 
> I mentioned Windows up top, but I've had just as many headaches with small variances in toolchains between Linux, AIX, HPUX, BSD(s) and Solaris. This is a great proposal IMO.

Moving from the theory to making this real:

https://github.com/minfrin/apr-tools

The first tool is called “endec”[1], and exposes all the APR apr_encode.h and apr_escape.h functions.  Generated man page is here:

https://github.com/minfrin/apr-tools/blob/main/endec/README.md

The tool’s party trick is that it can chain transformations. Here we un-base64 something, then we immediately entity escape the just-decoded-and-possibly-binary thing appropriately to safely appear on a web page or be passed as a payload into a curl request, all without messing around trying to get a shell to be safe around possibly binary data.

~$ endec --base64-decode --entity-escape "VGhpcyAmIHRoYXQK"
This &amp; that

My need was for automation that could be understood by ops people, where I don’t want to depend on some sledgehammer like python or perl for a one line command in a shell script.

[1] I googled for ages trying to find a name that didn’t clash. Any pithy alternatives welcome.

Regards,
Graham
—


Re: Proposal: apr-tools project

Posted by Graham Leggett <mi...@sharp.fm>.
On 18 Jan 2021, at 12:43, Graham Leggett <mi...@sharp.fm> wrote:

> Moving from the theory to making this real:
> 
> https://github.com/minfrin/apr-tools
> 
> The first tool is called “endec”[1], and exposes all the APR apr_encode.h and apr_escape.h functions.  Generated man page is here:
> 
> https://github.com/minfrin/apr-tools/blob/main/endec/README.md

More tools!

The second tool is called nmbe, for “native messaging browser extensions”.

NMBE replaces browser plugins, and involves browsers chatting to spawned processes via stdin and stdout. The protocol used over stdin and stdout is simple, but binary, involving a native integer length followed by data. The nmbe tool turns data (a string, or binary) into the correct format for piping to an nmbe plugin, so that development / testing can be done from the command line.

https://github.com/minfrin/apr-tools/blob/main/nmbe/README.md

The third tool is called dbd, and exposes the apr_dbd API.

The tool allows you to execute SQL statements and queries with complete control over formatting, and is ideal for scripting. Also useful for times when you’re trying to import/export non trivial data (like certificates, signatures or blobs) and the native database tools start fighting with you.

https://github.com/minfrin/apr-tools/blob/main/dbd/README.md

Regards,
Graham
—