Category Archives: command line

Command Line JSON

I just stumbled across a wonderful tool: command line JSON validation/pretty-print.

I often work with JSON with our routers. I use curl to read from our API endpoints which return JSON. Getting back large blobs of JSON is useful but hard to read all jumbled together.

% curl –basic –user admin:${CP_PASSWORD}

Command line output of router wifi survey api output.

Now instead I can pipe to python3 -m json.tool and the JSON will be cleanly formatted and humanly readable.


I love GNU autoconf. I remember the days of downloading a .zip or a .tar.Z of source and having to manually edit a config.h, full of symbols I didn’t understand. GNU autoconf came along and now we just ./configure && make && make install.

Building Kismet from source, I had a difficulty with libusb which is not installed on my linux laptop. I hadn’t installed libusb because I hadn’t needed it yet. Building Kismet on another machine worked fine (libusb installed).

checking for libusb... no
configure: error: Package requirements (libusb-1.0) were not met:

Package 'libusb-1.0', required by 'virtual:world', not found

I was curious about Kismet’s modularity. OK, probably just need to check the configure flags. Usually a properly modular program would allow me to disable USB.

% ./configure --help...
 --disable-usb Disable libUSB support

However, “./configure -disable-usb” still gave me the libusb error. Puzzling. I finally noticed the ./configure was reporting an error, right after starting.

% ./configure --disable-usb
configure: WARNING: unrecognized options: --disable-usb

Debugging the generated configure script is a pain. Time to dust off my ancient autoconf knowledge. The configure script starts with the I opened that up and searched for the disable-usb;

  AS_HELP_STRING([--disable-usb], [Disable libUSB support]),

The help string is there. But why doesn’t it work? Is it something simple?

- AS_HELP_STRING([--disable-usb], [Disable libUSB support]),
+ AS_HELP_STRING([--disable-libusb], [Disable libUSB support]),

It might be this simple. Now how do I rebuild the configure script from the It’s been a long time but I remember a magic ‘autoreconf’.

% sudo dnf install autoconf automake
% autoreconf

The autoreconf failed with a complaint about AC_PYTHON_MODULE macro. (I’ve lost the actual message to the mists of scrollback.) Autoconf is built around m4. A quick Google search for AC_PYTHON_MODULE leads to an m4 macro library:

Download the tarball, ./configure && make && make install and then try autoreconf again. Works! git diff shows the Kismet configure script updated. Run the configure again with –disable-libusb and no complaints.


Download your Yahoo Email, Unix Edition

First Off.

I am providing this information because I found it useful. I was inspired by Iain Thompson of The Register ( to retrieve and delete my 15+ years of email.

Disclaimer: Computers suck. Also, I could be a complete idiot. I’m just some rando blog on the internets. Do the following at your own risk and please don’t hurt me if something goes wrong.

Prepare Your Account

Disable Two-Step Verification

Enable “Allow apps that use less secure sign in”.


Remember to turn them back once email download is done. Then delete your Yahoo account anyway.


Need to have fetchmail and maildrop installed. I’m an Ubuntu user so I just did:

sudo apt install fetchmail maildrop




   service 995
   protocol POP3
   user ""
   password "mypassword"
   mda "/usr/bin/maildrop"

Verify with ‘fetchmail -v -c’  (verbose and check). Should see a successful login to your Yahoo email.

NOTE: fetchmail’s default behavior over POP3 is to *DELETE* your email once retrieved. I’ve left this behavior in place. If that’s not what you want, consult the fetchmail man page.



Enable DEFAULT=”$HOME/Maildir” to push mail straight to my account instead of through a MDA.


Not needed.

Build a Maildir

From home directory, run

maildirmake.maildrop Maildir

Will create the necessary Maildir tree. Use Maildir rather than mbox format because writing to a single file (mbox) is risky; could be corrupted in event of a crash. Maildir writes every email to a separate file.

Test Test Test!

Run  fetchmail -v -B 1

Will fetch verbose ONE message for testing the configuration. Should see login and one message downloaded. (deep-thought is my hostname)

Here’s me after downloading three messages:

…deep-thought:~% find Maildir



Release the Hounds.

Let’s go for it. Run

fetchmail -v | tee log.txt

|tee log.txt to save a log of the run in case anything goes wrong.