pimped out zsh prompt
[ link: pimping-out-zsh-prompt | tags: git zsh shell | updated: Thu, 25 Feb 2010 11:11:38 ]
Here is yet another update to the series. I've updated my git prompt again,
now using the zsh 4.3.7 built in vcs_info module. This time the motivation came
from Zsh Prompt Magic article.
Here is what it looks like now:

Everything is now self contained in one file: S60_prompt. Grab it and source it into your zsh config.
The features are:
- name of current branch,
- git repo state (
rebase,am,bisect,merge, etc), - markers indicating staged/unstaged changes,
- little
1after branch name indicates dirty working tree, - little
2after branch name indicates staged changes,
- little
- highlight depth decended into the repository on the right,
- show failure of commands via prompt background change,
- show command/insert mode when using vi mode (
set -o vi).
live termcasting of your terminal over telnet
[ link: live-termcast | tags: shell linux screen | updated: Sun, 21 Feb 2010 19:27:58 ]
I mentioned earlier that I will be giving a talk at Flourish Conf next month. While preparing for the talk I decided to I wanted to share my terminal with the participants of the Workshop via telnet. The more popular alternative would be to use screen built in sharing, or maybe vnc, which would require more memory and CPU overhead... and additional accounts using the former method. I only have a SheevaPlug to work with, so I am trying to be as conservative as possible.
running really nice
[ link: 20091205130455 | tags: zsh shell | updated: Fri, 15 Jan 2010 22:27:56 ]
Everyone that uses the shell eventually learns about nice -- the tool that runs a process at a reduced priority.
Well, there is also ionice that allows you to tweak processes from taking over all disk IO.
I added a vnice() function into my ZSH config so I can run or mark processes for lower priority for
both nice and ionice levels.
how would you read a file into an array of lines
[ link: 20090610150039 | tags: bash shell zsh | updated: Fri, 15 Jan 2010 22:27:56 ]
I was working on a shell script that needed to look at some lines in a bunch of files and perform some data mining. I started it in bash, so I am writing it in bash even though dave0 notes that I should have started in in perl. Point taken... I suffer for my mistake.
After a quick google I learned that a nice way to do what the topic of this post describes can be done using
IFS='
'
declare -a foo=( $(cat $file) )
Which is great! Right?
mark-yank-urls: fix bug allowing shell to interpret the url
[ link: 20090530223801 | tags: urxvt shell desktop | updated: Fri, 15 Jan 2010 22:27:56 ]
I committed a fix for an annoying bug in the urxvt mark-yank-urls script.
This has been reported by several people. I have finally fixed it, but the credit should go to Hans Dieter Pearcey, Daniel Danner and Olof Johansson for reporting it.
two terminals one PWD
[ link: xpwd+xcd | tags: shell | updated: Fri, 15 Jan 2010 22:27:56 ]
I often find myself needing multiple terminals (urxvt) with shells (zsh) in the same directory. The step of entering that directory is teadieous, especially if there are many terminals involved. I have a few tricks that I use to make this faster.
shrinking URLs
[ link: shorturl | tags: script bash shell | updated: Sat, 13 Feb 2010 12:35:12 ]
I wrote a short script to shrink URLs:
% shorturl http://www.jukie.net/~bart/shorturl
http://2tu.us/ce8
% shorturl
Type in some urls and I'll try to shrink them for you...
http://www.jukie.net/~bart/shorturl
http://2tu.us/ce8
http://www.jukie.net/~bart/20090320214228
http://2tu.us/ce9
I am doing this as part of my new identi.ca addiction^W
usage and extending GregKH's command line micro blogging tool.
UPDATE: also picked up by @vando for use with mcabber.
readlater
[ link: 20090304004744 | tags: shell | updated: Fri, 15 Jan 2010 22:27:56 ]
Instapaper is a quick way to stash things to read later. Here is a script that lets you post from the command line: readlater.
$ readlater http://www.jukie.net/
This URL has been successfully added to this Instapaper account.
Don't forget to fill in the USER and PASS fields in the script :)
Next, I wanted to call on this from vimperator. I wrote this vimpeator plugin to do that.
show more git info on zsh prompt
[ link: zsh-git-prompt | tags: git zsh shell | updated: Thu, 25 Feb 2010 10:52:24 ]
This is my third post on the topic. I have harshly assimulated MadCoder's configuration. Here is my new zsh prompt:

UPDATE: I've updated my prompt again.
show current git branch on zsh prompt (2)
[ link: zsh-git-branch2 | tags: git zsh shell | updated: Fri, 15 Jan 2010 22:27:55 ]
NOTE: This post has been updated (again).
I previously wrote about showing the git branch name on the zsh prompt. Caio Marcelo pointed out that
it didn't work very well because the git branch was being queried before the command was executed, and it should
be after to catch git commands that change the branch, like git branch and git checkout.
He was right, here is a repost.
