Skip to main content



git unhg

·2 mins
I should tidy up my $HOME/bin directory, some of actually useful scripts and configurations were scattered here and there. Anyway, I’ve been using this one script when I work with shreds: #! /usr/bin/env bash interim_branch=default rollgit() { [[ $# -ne 1 ]] && { echo 'wrong number of arguments, USAGE:' printf "\tgit roll <branch>\n" exit 1 } git rebase $1 && git checkout $1 && git rebase $interim_branch && git branch -D $interim_branch } unhg() { [[ $# -ne 2 ]] && { echo 'wrong number of arguments, USAGE:' printf "\tgit unhg <remote> <branch>\n" exit 1 } git-hg fetch $1 && git checkout -b $interim_branch FETCH_HEAD && git roll $2 } self=$(basename $0) case $self in git-unhg) unhg $* ;; git-roll) rollgit $* ;; *) echo 'Invalid command specified' ;; esac Shreds source revisions is actually tracked on mercurial.


The Hook

·1 min
Referring to previous post, this is the post-receive script I used for the blog. Actually I forgot to attach this to the previous post, so I decide to just create another post for this. {% include_code post-receive lang:sh post-receive %} The locale entries is needed by jekyll, since it’s not set at git/www user environment Also don’t forget to add this entry to sudoers git ALL=(www) NOPASSWD: ALL Basically, it tells sudo to allow git to act as www without any password.

Site Moved

·3 mins
A bit of rants here first. So my previous vps provider decides to acting up, suspending my server for overdue payment. Except that I paid in-time. I’m not sure whether this is purely coincidence mistakes or some sort. My invoice was dated due to 6th each month. Of course, as a good service provider, they sent me reminder for the payment at the end of the month by 29th, and at the 3rd of the next month.


New shell Prompt

·1 min
So I begin using zsh (again) recently and plug some accessories from oh-my-zsh. Inspired by this and my previous bash prompt here: PS1=":\[\033[01;36m\]\W \[\033[01;35m\]ยป\[\033[00m\] " I made my own theme. Basically, I prefer a prompt with minimal yet useful information, so typical theme with two lines prompt is very much a no no. {% include_code lang:bash fudanchii.zsh-theme %} In addition, here is my tmux configuration, which I used to show user@host at its bottom-left status bar: