Not entirely sure how I managed to hose my user directory, but I did, and it followed a boot into safe mode (reboot and SHIFT) in order to update an ancient MacPorts installation; homebrew sort of replaced that for my usage. OK, no biggie. I have back ups right? I do, but those back up in recent months have been based on Apple’s Time Machine. I changed to this from Carbon Copy Cloner by means of experiment. CCC has been bullet-proof, and I have always used it for family members, but there was something enticing about the seeming simplicity of Time Machine… something that is great for restoring files, but not so great, it turns out, for a full system restore. Suffice to say that a combination of backup solutions really is the way to go.

There’s no point in documenting the failures of Time Machine to restore my system “as was”, better to say that from a hosed user directory (specifically something with ~/Applications and ~/Library), and after several attempts to restore:

Get new drive from Amazon of the UK; not the best price, but next day delivery, and that is pretty important right now. The Old Crucial MX100 500 GB drive may or may not be fsked, but It has gone through A LOT of write cycles over the past two years, and I could do with an additional drive in case of future failures anyway, so not pissing about, got the Samsung Evo 850, 500GB, and a few dongles. Very happy with the purchases, actually.

sammy-850-evo and accessories

New, clean OS X 10.11.5 install

Hey… it’s an opportunity to clear out years of crud… old compilers, settings weird dot files all sorts of “system shit” that’s accumulated over the past 12 freaking years, and more than a couple of Macs, and to throw out apps that haven’t been used in Lord knows how long. It’s a bit of a PITA, but I think less so, perhaps, than dealing with all the quirks of years of accumulated cruft.

———
With the Sammy external, CMD+R boot into recovery mode, and select install new OS on the Sammy. OS X check the validity of the current system on disk and then goes and downloads El Cap. in this case. About 4 hours. Boot from the external drive. Create new admin user, log into iCloud with AppleID, then install:
## Apps
* Dropbox
* 1password
* HMA
* FirefoxLord only knows what add ons and such I had installed. I guess these will come back to me on an as-needed basis
¡¡¡ Carbon Copy Cloner !!!
* Alfred 2 because this is the way my fingers now work. And somewhat amazingly, and old post of mine proves to be surprisingly useful, and that is sort of the purpose of this blog thingamajig. http://stephen.yearl.us/alfred-2-workflows/* Flycut
* homebrew
brew install git (and zsh, imagemagick, lame, openssl, lua, tokyo-cabinet, urlview, npm)
brew cask install macvim
brew cask install mactex
brew install dnscrypt –with-plugins
— MUCH MUCH MORE AS AND WHEN REQUIRED

IA Writer to WordPress

0. Wha?

With the coming of the new doggie into the house, perhaps I will again add more content to the bloggy thing that I have kinda sorta not really been keeping over the last little while.

Probably this has been done by someone else on the Intertubz, but ach, why not. I have some time on my hands, so here are running notes in IA Writer that will make its way to a WordPress post by some means or other. There’s nothing special about IA writer, by the way. Well, there is, but not for the purposes of the WordPress posting. The same code should work with any plain-ish text file coming from any editor.

Why bother? Well, I think that the primary reason a lot of my notes have not made it to the blog is that it is just such a PITA to go out of my way to make a blog posting. If it all just sorta “works” from my usual workflows than that would perhaps be a very different situation. Not that I think I have anything particularly interesting or unique to say

So the process for this exercise seems clear:
1. “~~shell out” to markdown and produce an html file~~
2. process that html with nokogiri
3. post to WordPress

No need to shell out, apparently. tillsc has already built a Ruby extension library around MultiMarkdown, Ruby MultiMarkdown 4, so
I guess the awkward bit would be how best to execute the ruby script that pulls all this together… from a services menu item, maybe? And then how to deal with edits… something in the metadata at the head of the file? A call to getPost call to XML RPC to see if an existing post “matching” (on what criterion?) that about to be posted exists? But what to check on? Is the old post deleted? I suppose when one starts thinking about these things then one might just as well produce an actual interface to WordPress, but why bother when there are so many such things anyway?

Maybe I will look into that… but I am reasonably happy with the fact that this post came from iA Writer, and without too much trouble either. Next up? A horror-show of a MultiMarkdown file in iA Writer to to see how much gets translated into a decent-ish looking post.

3. Code

Posting to WordPress is pretty straightforward. All the heavy lifting is done by the rubypress gem, which makes this sort of thing doggone simple (see what I did there!). Here a block of code from that thing I wrote a while ago that scraped a Koine Greek “Word of the Day” from Ἡ Καινὴ Διαθήκη. Last post here

I keep meaning to get around to do this, but never do. This evening I took a look at exercism.io and the installation of its CLI program had a homebrew option, so then was a good a moment as any, that and with the imminent relsease of OS 42 (X.10.10)…

I’ve been playing with Hazel a bit recently, mostly so I can get a handle on it to support others’ usage of a simple file automation/ housekeeping application. I like it, but it is somewhat limited in not allowed nested conditional and other basic logic statements. Anyway, what Hazel does is not much more– and very frequently less– that what I’ve been doing with ad hoc cron scripts. These are not very tidy having built built up over the years. And so I Googled and I found a x-platform, ruby based Hazel alternative in maid.

This version corresponds to Apple’s default on early 2008 Macbook Pros which came preinstalled with Leopard (OS X 10.5). I guess this shows that although I am running Mountain Lion now on a mid-2012 MBP I have not had a clean OS install since April ’08, and I have never done so myself on my own machine. So, proof that:

I am lazy?

Upgrades work ‘plenty fine’, and Apple do a pretty good job in this regard?

I’m scared of losing all the custom build of compilers, interpreters, symlinks, scripts in odd locations doing various things, settings galore… etc, etc. that make this machine mine?

Think I’ll persist on this path through Mavericks *then* start fresh with OS XI… if I am am still using an increasingly annoying Apple OS.

$ rvm list known
$ rvm list
rvm rubies=&gt; ruby-1.9.2-p290 [ x86_64 ]
$ rvm install 1.9.1
Searching for binary rubies, this might take some time.
No binary rubies available for: osx/10.8/x86_64/ruby-1.9.1-p431.
Continuing with compilation. Please read 'rvm help mount' to get more information on binary rubies.
You requested building with '/usr/bin/gcc-4.2' but it is notin your path.
[/cc]

This will install just the bare-bones GCC compiler. It can safely be overwritten by XCode if you decide to reinstall it, or simple removed using the same command as that used for removing XCode.
reinstall RVM: http://beginrescueend.com/rvm/install/
Install the package manager “homebrew” from http://mxcl.github.com/homebrew/ and with it install libiconv.

$ brew install libiconv

This will install several files to homebrew’s home directory “/usr/local/cellar”
backup /usr/local/lib/libiconv.2.dylib, and copy /usr/local/cellar/libiconv/1.14/lib/libiconv.2.dylib into it’s place in /usr/local/lib

At this point you should have everything in place to install ruby 1.9.2 using RVM: