May 232016

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:

Boot into guest user account and copy busted ~ dir to an external spinning platter hd.

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
* Firefox
Lord 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.
* 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

Skim PDF Reader

Grand Perspective

bundles and packages to come later
Sublime Text 3
IA Writer

Screenflow 5
Boom 2

add VMs later… win 10, win 95 (yeah, really!), PC-BSD

Maid — a gem — deal with gems later!

## “Files”
* copy over ~/.zshrc, ~/Documents, ~/Music (Launch iTunes… all good), ~/Pictures (launch Photos… all good)
And now a working system that sort of is mine, but is not. Much tweaking remains.

Parallels VMs (Win 98, Win 10, Ubuntu Gnome) — didn’t back these up. Oh well. Never really used them much anyway.

To do:

Source Tree
Newer git tools? The whole git issue is going to be interesting when I get to look at that.
Mathematica 9 — lost the license key?

Fonts — Cousine, Nitti, Yale?, Ancient Greek, Office Code Pro…Computer Modern…??
color profiles
NTFS drivers and shit
Bit torrent Sync ?
Mega ?
Cloud app ?
Google drive?
Rubies and management
Rails, pythons etc.
npm, node js etc
macports? Quite possibly the thing that got me into this mess, but then again this is a fresh install

Fluid app — protonmail, gmail,, keybr

Adobe — EEK!!

Apr 242016

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

1. This file

Is written in markdown, with metadata at the head:

Title: IA Writer to Wordpress  
Author: yearlus  
Email: [email protected]  
Date: 2016-04-26  
Format: complete  
post_status: draft  
post_date: 2016-04-26
post_title: IA Writer to Wordpress  
category: tech  
post_tag: text, editors, Ruby, code, Wordpress, workflow  

# [%Title]

2. Markdown processors

Four Ruby processors for playing with markdown are briefly alluded to here: markdown-processing-ruby

And I went ahead and played with two of these:


$ gem install redcarpet -n /usr/local/bin


$ gem install kramdown -n /usr/local/bin

But neither of these processors support (yet!) the metadata blocks of MultiMarkdown. And kramdown does not recognise the back-tick code-fence (“` “`), only the tilda code-fence (~~~ ~~~)

So, install Fletcher Penney’s MultiMarkdown, and test:

$ brew install multimarkdown
$ multimarkdown ~/_scratch/IA-Writer-to-WP-Coleman-Notes.txt > ~/_scratch/IA-Writer-to-WP-Coleman-Notes.html

Gives some very nice HTML, including interpolation of the metadata (of this file), and writing of that metadata:

    <meta charset="utf-8"/>
    <title>IA Writer to Wordpress</title>
    <meta name="author" content="yearlus"/>
    <meta name="email" content="[email protected]"/>
    <meta name="date" content="2016-04-26"/>
    <meta name="format" content="complete"/>
    <meta name="post_status" content="draft"/>
    <meta name="post_date" content="2016-04-26"/>
    <meta name="post_title" content="IA Writer to Wordpress"/>
    <meta name="category" content="tech"/>
    <meta name="post_tag" content="text, editors, Ruby, code, Wordpress, workflow"/>

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

# ========== Post to Wordpress ==========
if options[:wordpress_write] == 'yes'
  wp =
    host:      "#{config['wp']['host']}",
    username:  "#{config['wp']['username']}",
    password:  "#{config['wp']['password']}",
    path:      "#{config['wp']['path']}")

    blog_id:    '0',
    content:    {
      post_status:   'draft',
      post_title:    "#{html_title}",
      terms_names:  {
        post_tag:     ['greek', 'koine', 'κοινή', 'language'],
        category:     ['Greek']
      post_content:  "#{wp_content}"
# ========== END WP Post ==========


posted with wpiawriter v. 0.1
Sep 232014

I keep meaning to get around to do this, but never do. This evening I took a look at 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)…

$brew -v

==> 0.9.5

$sudo chown -R `whoami` /usr/local
$cd /usr/local
$git fetch origin
$git reset --hard origin/master
$brew cleanup
$brew upgrade

==> ALL OK!

$brew update

==> Err. re. tap … but mostly OK.
–exercism install–

$brew tap homebrew/binary
$brew install exercism

==> Err 🙁 “no available formula for exercism” “searching taps…”

$brew untap homebrew/binary
$brew upgrade
$brew update
$brew tap homebrew/binary
$brew install exercism

==> DICE

$exercism configure --key=MY_API_KEY

==>config at ~/.exercism.json
==> API key is in accounts at


Jul 222013

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.

$ gem install maid

Well I get a slew of errors, so:

$ which ruby
$ ruby -v
ruby 1.8.6 (2007-03-13 patchlevel 0) [i686-darwin8.10.1]

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:

  1. I am lazy?
  2. Upgrades work ‘plenty fine’, and Apple do a pretty good job in this regard?
  3. 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.

$ ls -la /usr/bin | grep ruby
lrwxr-xr-x     1 root   wheel        76 Jul 27  2012 ruby -&gt; ../../System/Library/Frameworks/Ruby.framework/Versions/Current/usr/bin/ruby
-rwxr-xr-x     1 root   wheel       450 Nov 18  2011 sqlite3_ruby

$ rvm -v
rvm 1.9.0 by Wayne E. Seguin ( []
$ ls -la /Users/yearlus/.rvm/rubies/
drwxr-xr-x   8 yearlus  yearlus  272 Oct 26  2011 ruby-1.9.2-p290

update rvm:

$ cd ~/.rvm/
$ \curl -L | bash -s -- --version latest
$ rvm -v
A RVM version 1.21.13 is installed yet 1.9.0 is loaded.
 Please do one of the following:
  * 'rvm reload'
  * open a new shell

$ rvm reload
RVM reloaded!

$ rvm -v
rvm 1.21.13 (latest) by Wayne E. Seguin &lt;;, Michal Papis &lt;; []

$ rvm use 1.9.2
Using /Users/yearlus/.rvm/gems/ruby-1.9.2-p290
$ which ruby

I could fsck with .profile, but will keep flexible for now. Could also use the default flag:

$ rvm use 1.9.2 --default
$sudo gem install maid
dyld: Library not loaded: /Users/sjy2/.rvm/rubies/ruby-1.9.2-p290/lib/libruby.1.9.1.dylib Referenced from: /Users/yearlus/.rvm/rubies/ruby-1.9.2-p290/bin/ruby
Reason: image not found

oh brother!

$ 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 not in your path.


[cc_dos]$ sudo rvm requirements
Error: Failure while executing: git pull -q origin refs/heads/master:refs/remotes/origin/master
Failed to update Homebrew, follow instructions here: <a href=""></a> and make sure `brew update` works before continuing.
Requirements installation failed with status: 1

Following worked (outputs omitted):

$ chown -R yearlus $(brew --prefix)/.git
$ sudo chgrp -R admin /usr/local
$ sudo chmod -R g+rwx /usr/local
$ sudo chmod -R o-w /usr/local
$ cd /usr/local &amp;&amp; git reset --hard &amp;&amp; git clean -d -f/
$rvm requirements
$brew update
$ sudo gem install maid
$ sudo gem update


Oct 282011

Remove RVM, thus making for a cleaner install later:

$ RVM implode

Remove XCode:

$ sudo /Developer/Library/uninstall-devtools –mode=all

XCode is removed since in 4.2, at least, all references to gcc are linked to llvm-gcc (Apple’s) own fork of gcc. llvm will NOT compile ruby.

(One can always re-install from the AppStore later)
download and install GCC-10.7-v2.pkg from

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:
Install the package manager “homebrew” from 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:

CC=gcc-4.2 rvm install 1.9.2-p290 --with-iconv-dir=/usr/local/Cellar/libiconv/1.14.1

(RVM does not actually support –with-iconv-dir, if you check the config.log file, but it might someday… in which case the copying of libiconv will be unnecessary)

Now go install gems and rails and anything else you might need.


{my stack overflow comment}

Social Widgets powered by