Evan Martin (evan) wrote in evan_tech,
Evan Martin

two potential hacks, both ugly, one glorious

(1) To get the list of arguments a command understands (for use with, for example, tab completion in a shell), why not make an LD_PRELOAD library that wraps getopt (and maybe libpopt, or whatever people use these days).
(Yes, really the applications ought to all be able to emit argument information in the same format, but I'm not holding my breath for that one.)

(2) For my networking class, I'm supposed to write the glue between students' code (basically implementing TCP in addition to lower-level stuff) and their to-be-assigned application code. The plan is (and was when I was in the class) to run the two pieces in different processes, where the application uses an API just like the Unix sockets API, so the students get a taste for what socket programming is like both from the application and the implementation's perspective. Another nice benefit of this is that they can test their application code on top of real sockets, so it's easier to debug their application without wondering if the bug is in their TCP code.

It occurred to me that since these processes will communicate over a socket themselves, I could just as well let them write apps in C as I could in Ruby. But, going a step farther, wouldn't it be a rad hack if I could LD_PRELOAD my way underneath socket calls so they could run unmodified binaries (web browsers!) on top of their own network implementation? Unfortunately, the transfer protocol they implement only does one-way connections... I'm still thinking about that.

  • blog moved

    As described elsewhere, I've quit LiveJournal. If you're interested in my continuing posts, you should look at one of these (each contains feed…

  • dremel

    They published a paper on Dremel, my favorite previously-unpublished tool from the Google toolchest. Greg Linden discusses it: "[...] it is capable…

  • treemaps

    I finally wrote up my recent adventures in treemapping, complete with nifty clickable visualizations.

  • Post a new comment


    default userpic
    When you submit the form an invisible reCAPTCHA check will be performed.
    You must follow the Privacy Policy and Google Terms of use.