Greg Lake, Epitaph

King Crimson’s In the Court of the Crimson King is the album that made me fall in love with Prog Rock. Greg Lake‘s powerful vocals on the track Epitaph have much to do with this.

Written around 1969, the lyrics (by Pete Sinfield) are almost prophetic:

The wall on which the prophets wrote
Is cracking at the seams
Upon the instruments of death
The sunlight brightly gleams
When every man is torn apart
With nightmares and with dreams,
Will no one lay the laurel wreath
As silence drowns the screams


Knowledge is a deadly friend
If no one sets the rules
The fate of all mankind I see
Is in the hands of fools

Greg Lake passed away this week, at 69.

Tip: typing a long Google password into a new Android device

I use a password manager and create very long passwords where possible, including for my Google account. The problem? when setting up a new Android phone, I can’t download the password manager app until I’ve logged into my Google account, which is nearly impossible without the password manager app.

The workaround? Enable USB debugging on the phone, and use ADB to enter the password:

./adb shell input text "LONG COMPLICATED PASSWORD"

Is it safe enough? Probably not. Use at your own risk 🙂

A boy walking down the street

Today was Jonathan’s first day of Kindergarten. On the way home, as the radio played Eli Mohar and Yoni Rechter’s “As Long”, I burst into tears.

While it doesn’t do the original any justice, here’s my attempt to translate the lyrics to English:

A boy walking down the street
On a clear September morning
To the school the children go out again
A man walks behind him
Watches, sees – unseen
And only later he stands there, witnessing

How another year starts there
Like every year, in the fall,
How a son walks alone
With a father in his steps

A man sees, hiding
How his son enters the classroom
A man stands like a child left outside
And inside they sing already
An hymn for the new year
Oh how it all starts over again

Once more they sing of the rain
Once more they sing of the fall
And once more the letters are written on the board


A man midmorning
A man mid life
At the school gate he stands alone
He remembers his own dad
Once walked behind him
He tries to hear his steps

But the children still sing
A song of the first rain and autumn flowers
And the man lips are whispering too:
As I walk through the valley of the shadow of death
I will fear not
Even if I suddenly fall
My heart will sing

As long as the morning comes
As long as the letters are written
As long as a son walks
With his father in his steps
As long as the children sing
Of the new year
As long as it all starts over again

As long as the sea awakes
As long as the wind rises
As long as on the blackboard
A word will be drawn


WP-CLI live presentation, like a pro

I recently gave a talk about WP-CLI at WordCamp Israel 2016. I thought it would be interesting to actually demo WP-CLI in real time, rather than use boring slides.

I used OS X split screen mode, with a terminal window on one side, and a browser on the other showing the site I’m creating and editing:

The tricky part was to not have to type the commands I wanted to demo (which would be boring, and slow). Luckily, I’ve found doitlive, which takes a bash script and types the commands in a simulated window.

By default doitlive echos the characters one by one: the presenter just has to type randomly on his keyboard (like a Madman!).

But I wanted to be able to move on stage, and control the presentation using a remote. So I set doitlive’s speed option to a large number, and each command appeared with a single key press. I still needed a return to execute the command, a key not present on my remote. I worked around this by using TextExpander to replace ‘b’ (from the ‘Black Screen’ button) with a newline.

The result: each command required just two button presses. (The truth: I forgot to turn on TextExpander,  so I had to go back to the lectern for every single command. Bah.)

Some tips that might help if you’re planning to do something similar:

  • Use the `-g` param when opening a url in the browser to keep the focus on the terminal window
  • Write a cleanup/prep script that sets up your environment the way you need it before the demo (empty the db, delete or rename files, etc)
  • Rehearse. A lot. This is true for every presentation, but is a must with live demos.

Here’s the script I’ve used, split into commented sections. I’ll link to the video once it’s up on

#doitlive shell: /bin/bash
#doitlive prompt: l33t {}{r_angle.yellow}{}
#doitlive commentecho: true
#doitlive speed: 1000
cat name.txt
cat wp-cli.txt
open -g

open -g

curl -O

# Permission and move to path as 'wp'
chmod +x wp-cli.phar

sudo mv wp-cli.phar /usr/local/bin/wp

# Test
wp --info
cd mdocs
mv index.html index.old

wp core download

ls -l

open -g

wp core config --dbname=wpcli --dbuser=root --dbpass=root --dbhost=localhost --dbprefix=wpcli_

cat wp-config.php

wp core install --url="" --title="WP-CLI Demo" --admin_user=yoav --admin_password=mypassword

open -g

wp core language install he_IL --activate

open -g

wp core update

wp core language activate en_US

wp option update blogname "l33t wp-cli demo"

open -g

wp package install aaemnnosttv/wp-cli-http-command

wp package list

wp http get --scheme=https > theme-unit-test-data.xml

wp import theme-unit-test-data.xml --authors=create

wp plugin install wordpress-importer --activate

wp import theme-unit-test-data.xml --authors=create --skip=attachment

open -g

wp option get sticky_posts

wp option update sticky_posts [] --format=json

open -g

wp post generate --count=2

open -g


wp http get | wp post generate --post_content --count=1

open -g
wp search-replace Lorem WordPress

open -g


wp scaffold child-theme wpcli-child --parent_theme=twentysixteen --author="Yoav Farhi" --author_uri= --activate

ls -l wp-content/themes/

ls -l wp-content/themes/wpcli-child

cat wp-content/themes/wpcli-child/style.css

open -g

wp scaffold _s wpcli_s --theme_name=wpcli-s --author="Yoav Farhi" --sassify --activate

ls -l wp-content/themes/

ls -l wp-content/themes/wpcli_s
wp theme list

wp theme activate twentyfourteen

open -g

# wp plugin

wp plugin list

wp plugin install jetpack --activate

wp jetpack

wp jetpack module list

wp export

wp db export l33t-backup.sql

wp core multisite-convert

mv ms-rewrite-rules.txt .htaccess

wp site create --slug=msdemo

open -g

wp theme activate twentyfifteen --url=

open -g

nano example-command.php

mkdir wp-content/mu-plugins
cp example-command.php wp-content/mu-plugins/

wp example hello "Wordcamp Israel 2016"

cd ../

cat thankyou.txt

# Thanks for following! Questions?
# Typed using doitlive

Download the full script.

Trigger actions on OS X using NFC on Android

Having recently started using a treadmill desk, I wanted to automate actions on OS X as I switched from the regular desk to the treadmill. For example, turn on Bluetooth, switch the audio output device, etc. Sure, I can do that by creating an Automator script I’d run somehow, but I was curious to see if I could make it happen just by placing my phone on the treadmill desk.

Here’s how I do that using a few apps and utilities.




  1. Connect to the Maker and Dropbox channels.
  2. Note your Maker channel secret key
  3. Create a recipe with Maker’s receive a web request trigger and Dropbox’s create a text file action. You can use this recipe as a template. The file name’s and contents don’t matter. Choose a meaningful event name.
  4. Test your maker trigger url in the terminal with
    curl -X POST{event}/with/key/{key}


  1. Launch Trigger and add a new task.
  2. Add an NFC trigger and (in the following screen) any applicable restrictions.
  3. Add an action, and select “Open a URL/URI” under Applications & Shortcuts.
  4. Enter your trigger url, and mark “Open in background”.
  5. When prompted, program your sticker.
    Note: I’ve tried placing the sticker on the mac itself, but that didn’t work. I’m guessing there’s too much RF interference.

    This slideshow requires JavaScript.


Setup Hazel as follows:

  1. Add your new dropbox sub folder (in ifttt/maker/event_name, by default) to the Hazel folder list
  2. Add a folder rule for new files (see screenshot below). Add any actions you’d like to run: I move the file to the trash, and run an embedded shell script to launch some apps and command line utilities.

That’s it! Every time you’ll place your phone on the NFC sticker, it’ll make an HTTP request, which will cause a file to be created in a dropbox folder. After the brief sync delay, Hazel will recognize the file and launch any actions you’ve told it too.