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
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.
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.
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.
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
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.
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.