Reformatting Nested Markdown Lists in Editorial

For a while now I’ve wanted to write up a quick Python script to fix up numbering in a nested Markdown list. Most of the Markdown editors I use on iOS support smart list continuation, but very few (if any) will correct the numbering if you have to move lines around or insert new lines in the middle of a numbered list.

I was originally going to write this as a script to use in Pythonista, but never got around to it. The recent release of Editorial for the iPad sparked my interest in this again, and after reading Federico Viticci’s review of the app, I decided to build this as an Editorial workflow instead.

I’ll probably port this over to Pythonista in the future, but in the meantime here is a workflow to use in Editorial: Format as List

Automated pfSense Backups

Due to some hardware failures, I recently replaced my home-grown pfSense router with an off the shelf, pre-built package from Netgate. Installation and setup were quick and painless, but I quickly realized I didn’t have a backup of my previous configuration. After setting things up as best I could from memory, I decided to make sure this didn’t happen again.

Python to the Rescue

After some searching online, I came up with a solution using a few built-in Python modules (urllib/urllib2/cookielib) to authenticate with the pfSense system and then request a backup. The response is then saved to a file. I added a quick cron job and now I have nightly backups of my pfSense configuration.

I polished things up a bit and posted the code to GitHub. I hope this helps someone avoid the mistake I made of not keeping regular backups.

Update (2013-08-16): Accepted a pull request from darksoul42 to allow you to specify the output file.