jeroen.se
by jnieuwen
a vim syntax file for my todo list format
19 June 2007 17:29 - Today I played a little with vim syntax files. So I created a simple one to have some colors in my todo list. Here it is:
syntax clear
syntax case ignore
syntax match jnieuwenPerson / [^:]*: /
syntax match jnieuwenCategory /^[^:]*/
syntax match jnieuwenDate /[0-9]*-[0-9]*-[0-9]*/
hi jnieuwenPerson ctermfg=yellow
hi jnieuwenDate ctermfg=red
hi jnieuwenCategory ctermfg=green
0 comments
using nagios to monitor your todolist
11 June 2007 17:11 - Last week I decided to monitor my todolist with nagios. This mainly because I have the tendency to delay some todos for a very very long time. To be able to do this I had to include the date of entry of a todo item to my todo list format. The original format of my todo list can be found here. I changed the format to
- <context>:<year>-<month>-<day>: <description>.
I also had to change the addfolds.pl filter to be able to ignore the date when sorting and removing duplicates. The new addfolds.pl can be found here.
For security reasons I do not want the nagios user to be able to read my todo list. Hence I use check_jnieuwen.py to read the nagios status information from a file. Which uses a simple fileformat which is probably easy to understand when looking at the code.
The next step is of course getting the status information in the status file. This is accomplished with the check_todo_age.py script. This script is run hourly from cron.
0 comments
Sun Certified System Administrator for Solaris 10 OS
11 June 2007 10:05 - After passing the Sun Solaris CX-310-202 exam on the 4th of June`,' I received today the offical letter that states that I have passed all the requirements for the Sun Solaris 10 System Administration Certification.
0 comments
irc hilights displayed in the zsh shell
07 June 2007 07:51 - zsh has another nice feature I use to display the latest hilights on irc. The zsh option I use for this is the periodic function and the PERIOD environment variable. First off all I have set PERIOD to 60 in my ~/.zshrc config file. This ensures that the periodic function is executed before a new prompt if at least 60 seconds have passed.
The periodic function is defined as:
function periodic() {
diff $HOME/.periodic/last_hilight $HOME/.periodic/last_hilight.old | grep "^<" | cut -f2- -d: | sed -e "s/:/ /" -e "s/^/IRC: /" && cp $HOME/.periodic/last_hilight $HOM E/.periodic/last_hilight.old
}
Which means that it compares the $HOME/.periodic/last_hilight file with the $HOME/.periodic/last_hiligt.old file and displays the difference.
You might wonder how the last hilight from irc now comes in the $HOME/.periodic/last_hilight file. This is accomplished by an irssi plugin I extended. More on this plugin later because I still have to document this extension.
0 comments
configuring command line completion in zsh
05 June 2007 07:29 - Sunday I wrote about configuring your prompt in zsh and I promised to write about configuring the more advanced commandline completions in zsh. This is in fact quite simple. Adding
autoload -U compinit
compinit
to ~/.zshrc takes care of most of it. However I also wanted command line completion for hosts not in my /etc/hosts file and for usernames I have on other hosts/networks.
To extend the username completion you have to add the usernames to your ~/.zshrc with the following construct:
zstyle ":completion:*" users jnieuwen root
where jnieuwen and root are of course the usernames you want autocompletion on.
The construct for the hostname completion is almost the same:
zstyle ":completion:*" hosts alberich.jeroen.se hermod.jeroen.se
0 comments
switching to the zsh shell
03 June 2007 13:49 - Last friday I read something about the better completion features of zsh compared to bash. So I gave zsh a try. In zsh I could import and use my bash aliases so the only two things left to do was configure a usefull prompt and getting the command line completion to work.
My zsh prompt
In zsh you have 2 main prompts: PS1 and RPS1. PS1 has the same function as in bash. RPS1 is an extra prompt which will be displayed on the right-hand side of the screen. I decided to set RPS1 to the current time. And after some thinking I had my prompts ready which look like:
(~blog) (jobs: 0)
[1004][jnieuwen@idunn]%                                    13:57:33
This prompt is generated with the following code:
export RPS1="%D{%H:%M:%S}"
export PS1="(%4~) (jobs: %j)
[%!][%{${fg[blue]}%}%B%n%{${fg[yellow]}%}@%{${fg[green]}%}%m%b%{${fg[default]}%}]%# "
Later this week more about configuring the commandline completion.
0 comments
Categories
Cycling (2)
Gadgets (3)
IPv6 (1)
Misc (27)
Scripting (25)
Travel (7)
Unix (24)
Archive
January 2013 (1)
October 2012 (1)
September 2012 (1)
May 2012 (1)
February 2012 (1)
January 2012 (1)
January 2011 (1)
November 2010 (1)
June 2010 (1)
April 2010 (2)
January 2010 (1)
December 2009 (1)
November 2009 (2)
May 2009 (1)
April 2009 (1)
March 2009 (1)
February 2009 (7)
January 2009 (3)
December 2008 (1)
November 2008 (4)
October 2008 (5)
September 2008 (1)
August 2008 (3)
July 2008 (2)
June 2008 (2)
May 2008 (3)
April 2008 (1)
March 2008 (1)
February 2008 (1)
January 2008 (4)
December 2007 (1)
November 2007 (7)
October 2007 (4)
September 2007 (1)
August 2007 (2)
June 2007 (6)
May 2007 (8)