March 1, 2014 #octopress

Here I'll show you how to recover or restore your local octopress
repository, for instance you're on a new machine, or just lost your
local copy of it.

It requries you to have a repository on github that you've deployed your
octopress posts.

First I recommend that you read this post: Clone Your Octopress to Blog From Two Places, the Recreating a local Octopress repository section.

And here is what worked for me, please replace kinopyo with your user
name.

git clone -b source [email protected]:kinopyo/kinopyo.github.com.git octopress
cd octopress

gem install bundler
bundle install

rake preview
open http://localhost:4000

Tips on Converting HTML to Markdown

Somehow the latest 3 posts are still missing after I git cloned my
remote repository. I checked in advance and saved those copies as html.
And after I restored my octopress repository I used Pandoc to convert those html to markdown.

It works like:

pandoc -f html -t markdown your_html_file.html

Thoughts on Disaster

p.s. I stored my blog octopress repository on Dropbox and somehow it
just all gone, it really shocked me. Probably it was my fault not
theirs, but still I always thought Dropbox is a safe place, but I don't
even have a clue why it happended and somehow could't see the history and
restore from their website. After I noticed it everytime I came up with
something to write I've had used it as an excuse, or maybe I was not in
the mood to deal with it(also I didn't know how...).

So I need a fallback solution about Dropbox, every disaster changes you to rethink
about current seems comfortable situation. And hope I'll write more often :)

July 8, 2012 #zsh #octopress

Square brackets in zsh

Square brackets in zsh have special meanings but in MOST circumstances maybe you just have to escape them by putting \(backslash) before them.

Here is a example for generating a new octopress post

rake new_post["Escape square bracket by default in zsh"]
zsh: no matches found: new_post[Escape square bracket by default in zsh]

rake new_post\["Escape square bracket by default in zsh"\]
mkdir -p source/_posts
Creating new post: source/_posts/2012-07-08-escape-square-bracket-by-default-in-zsh.markdown

How to escape by default?

Just setup this alias in your .zshrc.

alias rake='noglob rake'