<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
    <title>Neil H Watson, Linux consultant</title>
    <link rel="alternate" type="text/html" href="http://watson-wilson.ca/" />
    <link rel="self" type="application/atom+xml" href="http://watson-wilson.ca/atom.xml" />
    <id>tag:watson-wilson.ca,2011-03-03://2</id>
    <updated>2013-05-15T18:08:52Z</updated>
    <subtitle>Traditional work ethic, using modern technology.</subtitle>
    <generator uri="http://www.sixapart.com/movabletype/">Movable Type 4.38</generator>

<entry>
    <title>Introducing Evolve Thinking</title>
    <link rel="alternate" type="text/html" href="http://watson-wilson.ca/2013/05/introducing-evolve-thinking.html" />
    <id>tag:watson-wilson.ca,2013://2.61</id>

    <published>2013-05-15T14:03:08Z</published>
    <updated>2013-05-15T18:08:52Z</updated>

    <summary>My colleagues and I have combined our resources and formed a new company, Evolve Thinking. We are stronger together. Cfengine is one of the corner stones of Evolve. To show what we are about we are releasing our own promise...</summary>
    <author>
        <name>Neil H. Watson</name>
        
    </author>
    
        <category term="cfengine" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="cfengine" label="cfengine" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://watson-wilson.ca/">
        <![CDATA[<p>My colleagues and I have combined our resources and formed a new company, <a href="http://evolvethinking.com">Evolve Thinking</a>.  We are stronger together.  Cfengine is one of the corner stones of Evolve. To show what we are about we are releasing our own promise library, the <a href="http://evolvethinking.com/evolve-thinkings-free-cfengine-library/">Evolve Thinking free Cfengine library</a>. Most of my future blogging will be on Evolve's site. You can still follow me on <a href="https://twitter.com/neil_h_watson">Twitter</a>.</p>
]]>
        
    </content>
</entry>

<entry>
    <title>Avoid the cost of renaming hundreds of hosts</title>
    <link rel="alternate" type="text/html" href="http://watson-wilson.ca/2013/02/avoid-the-cost-of-renaming-hundreds-of-hosts.html" />
    <id>tag:watson-wilson.ca,2013://2.59</id>

    <published>2013-02-22T23:57:05Z</published>
    <updated>2013-02-23T18:29:04Z</updated>

    <summary>Your hosts are named after your data centre. Now you must move hundreds of hosts to another data centre. Do you rename them or abandon the naming convention? A client of mine is facing this challenge. I&apos;ve discussed host naming...</summary>
    <author>
        <name>Neil H. Watson</name>
        
    </author>
    
    <category term="dns" label="dns" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="hostnames" label="hostnames" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://watson-wilson.ca/">
        <![CDATA[<p>Your hosts are named after your data centre.  Now you must move hundreds of
hosts to another data centre.  Do you rename them or abandon the naming
convention?</p>

<p>A client of mine is facing this challenge.
<a href="http://watson-wilson.ca/2011/03/choosing-a-host-naming-convention.html">
I've discussed host naming before.</a>.  Host are not static.  They change
functions and locations. Think ahead before naming them.</p>

]]>
        
    </content>
</entry>

<entry>
    <title>Variable references with Cfengine</title>
    <link rel="alternate" type="text/html" href="http://watson-wilson.ca/2012/10/variable-references-with-cfengine.html" />
    <id>tag:watson-wilson.ca,2012://2.58</id>

    <published>2012-10-20T01:33:23Z</published>
    <updated>2013-02-02T02:18:03Z</updated>

    <summary>Variables in Cfengine can be confusing at times. Here are some examples of variable references. References are not strictly required, but they are good practice like using the strict module in Perl....</summary>
    <author>
        <name>Neil H. Watson</name>
        
    </author>
    
        <category term="Cfengine cookbook" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="cfengine" label="cfengine" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="cfenginecookbook" label="cfengine cookbook" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="cfenginevariables" label="cfengine variables" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://watson-wilson.ca/">
        <![CDATA[<p>Variables in Cfengine can be confusing at times.  Here are some examples of variable references. References are not strictly required, but they are good practice like using the strict module in Perl.</p>
]]>
        <![CDATA[<code><pre>
bundle agent main {

	vars:
		"meta_purpose" string => "Demonstrate references";

		"my_scalar" string       => "This is a scalar typed as astring";
		"my_list" slist          => { "one", "two", "three" };
		"my_array[red]" string   => "Red element of associative array";
		"my_array[blue]" string  => "Blue element of associative array";
		"my_array[green]" string => "Green element of associative array";

	methods:
		"any" usebundle => test(
			"main.my_scalar",
			"main.my_list",
			"main.my_array"
			);
}

bundle agent test(scalarref, listref, arrayref) {

	vars:
		"local_scalar"
			string => "${${scalarref}}";

		"local_list"
			slist => { "@{${listref}}" };

		"arrayref_index"
			slist => getindices("${arrayref}");

		"local_array[${arrayref_index}]"
			string => "${${arrayref}[${arrayref_index}]}";

		"local_array_index"
			policy => 'free',
			slist => getindices("local_array");

	reports:
		cfengine::
			"scalarref         => ${${scalarref}}";
			"local_scalar      => ${local_scalar}";
			"local_list        => ${local_list}";
			"arrayref_index    => ${arrayref_index}";
			"arrayref item     => ${${arrayref}[${arrayref_index}]}";
			"local_array_index => ${local_array_index}";
			"local_array item  => ${local_array[${local_array_index}]}";
}
</pre></code>

<p>Now let's run it:</p>

<code><pre>
$ cf-agent -f ./references.cf 
R: scalarref         => This is a scalar typed as astring
R: local_scalar      => This is a scalar typed as astring
R: local_list        => one
R: local_list        => two
R: local_list        => three
R: arrayref_index    => red
R: arrayref_index    => blue
R: arrayref_index    => green
R: arrayref item     => Red element of associative array
R: arrayref item     => Blue element of associative array
R: arrayref item     => Green element of associative array
R: local_array_index => green
R: local_array_index => red
R: local_array_index => blue
R: local_array item  => Green element of associative array
R: local_array item  => Red element of associative array
R: local_array item  => Blue element of associative array
</pre></code>


]]>
    </content>
</entry>

<entry>
    <title>Join me at LISA 2012</title>
    <link rel="alternate" type="text/html" href="http://watson-wilson.ca/2012/10/join-me-at-lisa-2012.html" />
    <id>tag:watson-wilson.ca,2012://2.57</id>

    <published>2012-10-10T01:12:09Z</published>
    <updated>2012-10-10T01:16:57Z</updated>

    <summary>I&apos;m attending LISA this year in sunny San Diego. If you want to meet up please drop me a line....</summary>
    <author>
        <name>Neil H. Watson</name>
        
    </author>
    
    
    <content type="html" xml:lang="en" xml:base="http://watson-wilson.ca/">
        <![CDATA[<p>I'm attending <a href="https://www.usenix.org/conference/lisa12">LISA</a> this year in sunny San Diego.  If you want to meet up please drop me a line.
]]>
        
    </content>
</entry>

<entry>
    <title>Cfengine talk and demo at TLUG</title>
    <link rel="alternate" type="text/html" href="http://watson-wilson.ca/2012/08/cfengine-talk-and-demo-at-tlug.html" />
    <id>tag:watson-wilson.ca,2012://2.56</id>

    <published>2012-08-05T18:01:53Z</published>
    <updated>2012-08-05T18:06:23Z</updated>

    <summary>Giving a presentation and demo of Cfengine at the Toronto Linux User&apos;s Group August 14, 2012....</summary>
    <author>
        <name>Neil H. Watson</name>
        
    </author>
    
        <category term="cfengine" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="cfengine" label="cfengine" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="tlug" label="tlug" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://watson-wilson.ca/">
        <![CDATA[<p>Giving a presentation and demo of Cfengine at the <a href="http://gtalug.org/wiki/Meetings:2012-08">Toronto Linux User's Group</a> August 14, 2012. </p>
]]>
        
    </content>
</entry>

<entry>
    <title>Emacs profile</title>
    <link rel="alternate" type="text/html" href="http://watson-wilson.ca/2012/06/emacs-profile.html" />
    <id>tag:watson-wilson.ca,2012://2.55</id>

    <published>2012-06-23T17:30:09Z</published>
    <updated>2012-06-23T17:34:22Z</updated>

    <summary>I use Emacs too! I&apos;m a double agent. I use Emacs for its wonderful Orgmode. Here is a profile from when I&apos;m on the road....</summary>
    <author>
        <name>Neil H. Watson</name>
        
    </author>
    
        <category term="rc files" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="emacs" label="emacs" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="orgmode" label="orgmode" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://watson-wilson.ca/">
        <![CDATA[<p>I use Emacs too!  I'm a double agent.  I use Emacs for its wonderful Orgmode.  Here is a profile from when I'm on the road.</p>]]>
        <![CDATA[<p><code><pre>
(custom-set-variables
  ;; custom-set-variables was added by Custom.
  ;; If you edit it by hand, you could mess it up, so be careful.
  ;; Your init file should contain only one such instance.
  ;; If there is more than one, they won't work right.
  '(org-agenda-start-on-weekday nil)
)
(custom-set-faces
  ;; custom-set-faces was added by Custom.
  ;; If you edit it by hand, you could mess it up, so be careful.
  ;; Your init file should contain only one such instance.
  ;; If there is more than one, they won't work right.
 )
(require 'vimpulse)
(setq org-agenda-files (list "~/nhw.org"))
(require 'org-install)
(add-to-list 'auto-mode-alist '("\\.org$" . org-mode))
(define-key global-map "\C-cl" 'org-store-link)
(define-key global-map "\C-ca" 'org-agenda)
(setq org-log-done t)

;; For Easter calculation
(defun da-easter (year)
  "Calculate the date for Easter Sunday in YEAR. Returns the date in the
Gregorian calendar, ie (MM DD YY) format."
  (let* ((century (1+ (/ year 100)))
         (shifted-epact (% (+ 14 (* 11 (% year 19))
                              (- (/ (* 3 century) 4))
                              (/ (+ 5 (* 8 century)) 25)
                              (* 30 century))
                           30))
         (adjusted-epact (if (or (= shifted-epact 0)
                                 (and (= shifted-epact 1)
                                      (< 10 (% year 19))))
                             (1+ shifted-epact)
                           shifted-epact))
         (paschal-moon (- (calendar-absolute-from-gregorian
                           (list 4 19 year))
                          adjusted-epact)))
    (calendar-dayname-on-or-before 0 (+ paschal-moon 7))))


(defun da-easter-gregorian (year)
  (calendar-gregorian-from-absolute (da-easter year)))

(defun calendar-days-from-easter ()
"When used in a diary sexp, this function will calculate how many days
are between the current date (DATE) and Easter Sunday."
(- (calendar-absolute-from-gregorian date)
(da-easter (calendar-extract-year date))))

; For org appointment reminders
(defun djcb-popup (msg)
"Show a popup if we're on X, or echo it otherwise; TITLE is the title
of the message, MSG is the context. Optionally, you can provide an ICON and
a sound to be played"

;;(interactive)
;;    (if (eq window-system 'x)
    ;;(shell-command (concat "/usr/bin/xmessage" msg))
    (call-process "/usr/bin/xmessage" msg)
    ;; text only version
    ;;(message (concat title ": " msg)))
)
;; the appointment notification facility
(setq
  appt-message-warning-time 5 ;; warn 5 min in advance

  appt-display-mode-line t     ;; show in the modeline
  appt-display-format 'window) ;; use our func
(appt-activate 1)              ;; active appt (appointment notification)
(display-time)                 ;; time display is required for this...

 ;; update appt each time agenda opened

(add-hook 'org-finalize-agenda-hook 'org-agenda-to-appt)

;; our little façade-function for djcb-popup
 (defun djcb-appt-display (min-to-app new-time msg)
    (djcb-popup (format "Appointment in %s minute(s)" min-to-app) msg ))
  (setq appt-disp-window-function (function djcb-appt-display))
</p></code></pre>
]]>
    </content>
</entry>

<entry>
    <title>Xdefaults</title>
    <link rel="alternate" type="text/html" href="http://watson-wilson.ca/2012/06/xdefaults.html" />
    <id>tag:watson-wilson.ca,2012://2.54</id>

    <published>2012-06-23T17:22:14Z</published>
    <updated>2012-06-23T17:26:04Z</updated>

    <summary>Xdefaults for when I&apos;m on the road....</summary>
    <author>
        <name>Neil H. Watson</name>
        
    </author>
    
        <category term="rc files" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="xdefaults" label="xdefaults" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="xterm" label="xterm" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="xwindows" label="X windows" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://watson-wilson.ca/">
        <![CDATA[<p>Xdefaults for when I'm on the road.</p>]]>
        <![CDATA[<p><code><pre>
# Xterm 
xterm*faceName: Bitstream Vera Sans Mono:style=Bold
xterm*faceSize: 8
xterm*termName: xterm
xterm*background: black
xterm*foreground: white
xterm*geometry: 78x68+1+1
xterm*tn: xterm
xterm*scrollBar: false
xterm*sl: 1000
xterm*colorMode: 1
xterm*Utf8: 1
xterm*loginShell: 1
xterm*charClass: 33:48, 37:48, 42:48, 45-47:48, 58:48, 63-64:48, 126:48

# Fonts
Xft.antialias:true
Xft.dpi:120
Xft.hinting:true
Xft.hintstyle:hintslight
</p></code></pre>
]]>
    </content>
</entry>

<entry>
    <title>Shell profile</title>
    <link rel="alternate" type="text/html" href="http://watson-wilson.ca/2012/06/shell-profile.html" />
    <id>tag:watson-wilson.ca,2012://2.53</id>

    <published>2012-06-23T14:07:44Z</published>
    <updated>2012-06-23T17:22:00Z</updated>

    <summary>Some shell rc files for when I&apos;m on the road....</summary>
    <author>
        <name>Neil H. Watson</name>
        
    </author>
    
        <category term="rc files" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="bash" label="bash" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="bashrc" label="bashrc" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="profile" label="profile" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="sh" label="sh" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="shell" label="shell" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://watson-wilson.ca/">
        <![CDATA[<p>Some shell rc files for when I'm on the road.</p>]]>
        <![CDATA[<p><code><pre>

# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples

# If not running interactively, don't do anything
#[ -z "$PS1" ] && return

export PATH=${PATH}:~/bin

# don't put duplicate lines in the history. See bash(1) for more options
# don't overwrite GNU Midnight Commander's setting of `ignorespace'.
export HISTCONTROL=$HISTCONTROL${HISTCONTROL+,}ignoredups
# ... or force ignoredups and ignorespace
export HISTCONTROL=ignoreboth

# append to the history file, don't overwrite it
shopt -s histappend

# for setting history length see HISTSIZE and HISTFILESIZE in bash(1)

# check the window size after each command and, if necessary,
# update the values of LINES and COLUMNS.
shopt -s checkwinsize

# make less more friendly for non-text input files, see lesspipe(1)
#[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)"

# set variable identifying the chroot you work in (used in the prompt below)
if [ -z "$debian_chroot" ] && [ -r /etc/debian_chroot ]; then
    debian_chroot=$(cat /etc/debian_chroot)
fi

# set a fancy prompt (non-color, unless we know we "want" color)
case "$TERM" in
    xterm-color) color_prompt=yes;;
esac

# uncomment for a colored prompt, if the terminal has the capability; turned
# off by default to not distract the user: the focus in a terminal window
# should be on the output of commands, not on the prompt
#force_color_prompt=yes

if [ -n "$force_color_prompt" ]; then
    if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then
        # We have color support; assume it's compliant with Ecma-48
        # (ISO/IEC-6429). (Lack of such support is extremely rare, and such
        # a case would tend to support setf rather than setaf.)
        color_prompt=yes
    else
        color_prompt=
    fi
fi

if [ "$color_prompt" = yes ]; then
    PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
else
    PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
fi
unset color_prompt force_color_prompt

# If this is an xterm set the title to user@host:dir
case "$TERM" in
xterm*|rxvt*)
    PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1"
    ;;
*)
    ;;
esac

# Alias definitions.
# You may want to put all your additions into a separate file like
# ~/.bash_aliases, instead of adding them here directly.
# See /usr/share/doc/bash-doc/examples in the bash-doc package.

#if [ -f ~/.bash_aliases ]; then
#    . ~/.bash_aliases
#fi

# enable color support of ls and also add handy aliases
if [ -x /usr/bin/dircolors ]; then
    eval "`dircolors -b`"
    alias ls='ls --color=auto'
    alias dir='dir --color=auto'
    alias vdir='vdir --color=auto'

    alias grep='grep --color=auto'
    alias fgrep='fgrep --color=auto'
    alias egrep='egrep --color=auto'
fi

# some more ls aliases
#alias ll='ls -l'
#alias la='ls -A'
#alias l='ls -CF'

# enable programmable completion features (you don't need to enable
# this, if it's already enabled in /etc/bash.bashrc and /etc/profile
# sources /etc/bash.bashrc).
if [ -f /etc/bash_completion ]; then
    . /etc/bash_completion
fi


#######################
# shell .profile
#######################
# Source global definitions
if [ -r /etc/bashrc ]; then
	. /etc/bashrc
fi
if [ -r /etc/bash.bashrc ]; then
	. /etc/bash.bashrc
fi
if [ -r ~/.bashrc ]; then
	. ~/.bashrc
fi
if [ -r /etc/bash.bashrc ]; then
    PS1="\u@\h \[\033[01;34m\]\w\[\033[00m\] \$ "
    export PS1
fi

export PYTHONPATH=$PYTHONPATH:$HOME/lib/py-lib
export PILOTPORT=usb:

# use keychain to cache passphrase
#keychain --quiet ~/.ssh/work
#source ~/.keychain/${HOSTNAME}-sh

# needed to have remote transparency for mutt
export COLORFGBG="default;default" 

# csv
export CSV_RSH="ssh"
export EDITOR="vi"

echo " "
if [ -e /usr/share/games/fortunes/taow ]
then
    fortune taow
fi
#######################
# for cygwin
# Program Files
#    cprograms="C:\Program Files"
# VIM
#    vim="${cprograms}\Vim"
#    # $uvim used to build $PATH
#    uvim=`cygpath -u "$vim"`
#    # PATH="${PATH}:${uvim}/vim63"
#
#    # The following syntax concerns cyg-wrapper 2.0.+
#    alias vi='cyg-wrapper.sh "C:/Progra~1/Vim/vim72/gvim.exe" --fork=1 --binary-opt=-c,--cmd,-T,-t,--servername,--remote-send,--remote-expr'
#alias ntls=" /usr/local/ntlmaps/main.py"
#alias firefox='cyg-wrapper.sh "C:/Progra~1/Mozilla Firefox/firefox.exe" --fork=1 --binary-opt=-c,--cmd,-T,-t,--servername,--remote-send,--remote-expr'
#alias dot='cyg-wrapper.sh "C:/Progra~1/Graphviz/bin/dot.exe" --binary-opt=-c,--cmd,-T,-t,--servername,--remote-send,--remote-expr'
#alias mts='montage.exe -geometry 640x480'

# end of cygwin
#######################

#######################
# aliases
alias tvnc="vncviewer -compresslevel 9 -quality 5"
alias vnc="vncviewer -compresslevel 3 -quality 8"
alias bzflag="bzflag -window -geometry 1280x1024"
#alias ls="ls --color"
alias apgen="apg -m 15 -M CSN -n 1"
alias lshort='kpdf /usr/share/doc/texlive-doc/english/lshort-english/lshort.pdf'
alias journal='vim ~/neil/docs/journal/$(date +%Y).txt'
alias vm="virsh --connect qemu:///system"
#alias iexplore='wine "
set editor="vim -c 'set tw=72 et spell'"

#######################
# remind aliases
alias 1w='rem -cl+1 -b1'
alias 2w='rem -cl+2 -b1'
alias 3w='rem -cl+3 -b1'
alias 4w='rem -cl+4 -b1'
alias lsrem='rem -n -b1'   
alias rem='cd; rem'


#######################
# firefox bookmarks 
# Export bookmarks to stdout
alias bme='sqlite3 places.sqlite .dump moz_bookmarks'
#Import bookmarks table. Expects dumped table from stdin
alias bmi='sqlite3 places.sqlite "drop table moz_bookmarks"; sqlite3 places.sqlite' 

#######################
# other cli functions
kall() { 
# Kills all pids that match process name from grep.
    kill $(ps ef|grep "$@" |awk {'print $2'}); 
}

pgrep() {
# Search ps listing
    ps ef|grep "$@" ; 
}

hgrep() {
# Search history listing
    history|grep "$@" ; 
}
</pre></code></p>
]]>
    </content>
</entry>

<entry>
    <title>Availability Alert</title>
    <link rel="alternate" type="text/html" href="http://watson-wilson.ca/2012/04/availability-alert.html" />
    <id>tag:watson-wilson.ca,2012://2.52</id>

    <published>2012-04-30T19:22:07Z</published>
    <updated>2012-04-30T19:28:35Z</updated>

    <summary>Some of you have mentioned that &quot;I am rarely available&quot;. My contract just expired. Here is your chance!...</summary>
    <author>
        <name>Neil H. Watson</name>
        
    </author>
    
    
    <content type="html" xml:lang="en" xml:base="http://watson-wilson.ca/">
        <![CDATA[<p>Some of you have mentioned that "I am rarely available". My contract just expired. Here is your chance!</p>]]>
        
    </content>
</entry>

<entry>
    <title>Cfengine 3 VIM files now on Github</title>
    <link rel="alternate" type="text/html" href="http://watson-wilson.ca/2012/04/cfengine-3-vim-files-now-on-github.html" />
    <id>tag:watson-wilson.ca,2012://2.51</id>

    <published>2012-04-15T16:08:18Z</published>
    <updated>2012-04-15T16:13:08Z</updated>

    <summary>In the spirit of collaboration with my Cfengine colleagues I&apos;ve moved my Cfengine 3 VIM files to Github. I hope that others will help grow this small body of work....</summary>
    <author>
        <name>Neil H. Watson</name>
        
    </author>
    
        <category term="cfengine" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="cfengine" label="cfengine" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="cfengine3" label="cfengine 3" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="vim" label="vim" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://watson-wilson.ca/">
        <![CDATA[<p>In the spirit of collaboration with my Cfengine colleagues I've moved my Cfengine 3 VIM files to <a href="https://github.com/neilhwatson/vim_cf3">Github</a>. I hope that others will help grow this small body of work.</p>
]]>
        
    </content>
</entry>

<entry>
    <title>IPV6 migration part 5</title>
    <link rel="alternate" type="text/html" href="http://watson-wilson.ca/2012/03/ipv6-migration-part-5.html" />
    <id>tag:watson-wilson.ca,2012://2.50</id>

    <published>2012-03-10T21:29:12Z</published>
    <updated>2012-03-12T22:27:44Z</updated>

    <summary>My email server now functions on both IPV4 and IPV6 networks. Postfix is IPV6 ready but, the configuration needed some adjustments. In places like mynetworks, found in main.cf, IPV6 addresses must be enclosed in square brackets. This does not include...</summary>
    <author>
        <name>Neil H. Watson</name>
        
    </author>
    
        <category term="ipv6" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="email" label="email" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="ipv6" label="ipv6" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="postfix" label="postfix" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://watson-wilson.ca/">
        <![CDATA[<p>My email server now functions on both IPV4 and IPV6 networks.  Postfix is IPV6 ready but, the configuration needed some adjustments.</p>

<p>In places like mynetworks, found in main.cf, IPV6 addresses must be enclosed in square brackets.  This does not include the netmask.  For example: <code>[::1]/128</code></p>

In main.cf Postfix is told to use IPV6 using <code>inet_protocols</code>.  Set this to all and Postfix will listen to IPV4 and IPV6 interfaces.

<p>For more information about Postfix and IPV6 the <a href="http://www.postfix.org/IPV6_README.html">Postfix web page</a></p>

<p>In fact a lot of configuration files have special rules to accommodate IPV6 addresses because IPV6 syntax was not a consideration when the configuration syntax was first invented.  Read configuration documentation carefully.</p>
]]>
        
    </content>
</entry>

<entry>
    <title>IPV6 migration part 4</title>
    <link rel="alternate" type="text/html" href="http://watson-wilson.ca/2012/03/ipv6-migration-part-4.html" />
    <id>tag:watson-wilson.ca,2012://2.49</id>

    <published>2012-03-06T02:13:37Z</published>
    <updated>2012-03-06T03:12:32Z</updated>

    <summary>This website is now dual stacked to both IPV4 and IPV6. In part four of my IPV6 series I&apos;ll tell you what I learned during this migration....</summary>
    <author>
        <name>Neil H. Watson</name>
        
    </author>
    
        <category term="ipv6" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="ipv6" label="ipv6" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://watson-wilson.ca/">
        <![CDATA[<p>This website is now dual stacked to both IPV4 and IPV6.  In part four of my IPV6 series I'll tell you what I learned during this migration.</p>]]>
        <![CDATA[<p>This website consists of a web server, a database, an IP address and some DNS records.  Before we get to that you should know a little about hosting providers and IPV6.</p>

<p>Not all hosting providers offer IPV6.  Those that do offer IPV6 do not always offer the full service.  If you are shopping for an IPV6 ready hosting provider here is a checklist.</p>

<ul>
	<li>How many IPV6 addresses do you get?  Convention is that you should be provided with a /64 block.  That is not a typo.</li>
	<li>Is there a way to manage IPV6 PTR addresses?  </li>
	<li>Does the network allow dual stack IPV4 and IPV6 addressing?</li>
	<li>What does this all cost?</li>
</ul>

<p>My hosting provider, <a href="http://glesys.com">Glesys</a> provided me with a \64 block of IPV6 addresses and the ability to dual stack, all included in the price of my host.  Sadly at this time Glesys does not offer PTR record management for IPV6 addresses (they do for IPV4 addresses).  When I questioned Glesys about this I was told that they plan to offer IPV6 PTR management in Q2 of 2012.</p>

<p>The next step is to know what software will work with IPV6.  My site runs Debian Squeeze at this time.  The packages are quite dated.  Apache easily works on IPV4 and IPV6 interfaces.  Note that if you are using IP address virtual hosts, such as for SSL, you will need separate entries for IPV4 and IPV6 addresses.</p>

<p>Originally this site ran using MySQL.  Sadly the version that ships with Debian Squeeze had IPV6 issues.  The server seemed to work but the client did not.  Supposedly later version of MySQL work fine.  Instead I used Postgresql with no trouble.</p>

<p>The standard NTP daemon works fine dual stacked.  However, IPV6 NTP servers are hard to find.  <a href="http://www.pool.ntp.org">Pool.ntp.org</a> lacks full IPV6 support.  Only 2.pool.ntp.org appears to have working IPV6 addresses at this time.</p>

<p>Those who know me will expect my report on Cfengine and IPV6.  It works dual stacked and exclusively with IPV6 but not without an issue.  You can see my findings <a href="https://cfengine.com/bugtracker/view.php?id=988">here.</a></p>

<p>OpenSSH worked dual and single IPV6 stacked without issue.</p>

<p>When dealing directly with Linux I found no IPV6 issues including Ethernet
bonding, network bridges and KVM virtualization.  Do be aware that IPV6 allows
for addresses to be auto configured.  I did see this happen when routers
outside of my control advertised address allocation.  The solution for me
was to make change in sysctl:
<code><pre>
net.ipv6.conf.all.autoconf=0
net.ipv6.conf.all.accept_ra=0
net.ipv6.conf.default.autoconf=0
</pre></code>
This instructs the kernel to ignore any attempts to auto-configure.</p>

<p>Remember from previous parts in this series that you'll need separate IPV6 firewall rules.  With Linux, IPV6 traffic is filtered via ip6tables.  This is virtually identical to the standard iptables for IPV4 networking.  Wrappers like <a href="http://www.fwbuilder.org/">Fwbuilder</a> and <a href="http://www.shorewall.net/"</a>Shorewall</a> both support IPV6.</p>
]]>
    </content>
</entry>

<entry>
    <title>Bell Canada, where&apos;s my credit?</title>
    <link rel="alternate" type="text/html" href="http://watson-wilson.ca/2012/01/bell-canada-wheres-my-credit.html" />
    <id>tag:watson-wilson.ca,2012://3.54</id>

    <published>2012-01-12T17:42:46Z</published>
    <updated>2012-01-12T17:55:21Z</updated>

    <summary>Bell Canada: You disconnected my phone line and made me wait 20 hours before fixing it. Where&apos;s my credit?...</summary>
    <author>
        <name>Neil H. Watson</name>
        
    </author>
    
    <category term="bellcanada" label="bell canada" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="complaint" label="complaint" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://watson-wilson.ca/">
        <![CDATA[<p><a href="http://www.bell.ca">Bell Canada</a>: You disconnected my phone line and made me wait 20 hours before fixing it.  Where's my credit?</p>
]]>
        <![CDATA[<p>Last week a Bell Canada technician working on the community phone box outside my house must have disconnected my land line.  I went to the technician and told him that I had just lost my line.  He asked my number but ignored me afterward.  He left without fixing it.  I called Bell Canada to complain.  They did not sent a technician to make repairs for another twenty hours.</p>

<p>At that time the technician called me to say he&rsquo;d reconnected the phone line.  He said that the technician the day before must have disconnected it by accident.  He said that if he knew who had done it he would scold them for leaving it unfixed.</p>

<p>Today I received my phone bill.  There is no credit for the lost hours.  Bell Canada where is my credit?</p>
]]>
    </content>
</entry>

<entry>
    <title>IPV6 migration part 3</title>
    <link rel="alternate" type="text/html" href="http://watson-wilson.ca/2011/12/ipv6-migration-part-3.html" />
    <id>tag:watson-wilson.ca,2011://3.52</id>

    <published>2011-12-23T18:45:00Z</published>
    <updated>2011-12-23T18:47:43Z</updated>

    <summary>We continue in this series by having a quick look at a dual stack VPS host....</summary>
    <author>
        <name>Neil H. Watson</name>
        
    </author>
    
        <category term="ipv6" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="ipv6" label="ipv6" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://watson-wilson.ca/">
        <![CDATA[<p>We continue in this series by having a quick look at a dual stack VPS host.</p>]]>
        <![CDATA[<p>Alas many providers, including my ISP, do not yet offer IPV6 addresses.  Fortunately my hosting provider does.  I have a multipurpose VPS with them.  Before this article the VPS had one IPV4 address.  Using my provider's website I requested an IPV6 address.  It&rsquo;s worth noting that an IPV4 address costs me &euro;2.00 per month.  An IPV6 address cost only &euro;0.10 per month.</p>

<p>After I made the request, I returned a day later expecting to have to set things up.  I was surprised to see everything just worked.  IPV6 address can be assigned by stateless configuration.  This is built in to IPV6 beyond regular use of DHCPv6.  I'm not sure how my provided assigned the IP but it must have been easy and automatic.</p>

<code><pre>
venet0    Link encap:UNSPEC  HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00  
          inet addr:127.0.0.1  P-t-P:127.0.0.1  Bcast:0.0.0.0  Mask:255.255.255.255
          inet6 addr: ::1/128 Scope:Host
          inet6 addr: 2a02:750:5::464/128 Scope:Global
          UP BROADCAST POINTOPOINT RUNNING NOARP  MTU:1500  Metric:1
          RX packets:13899581 errors:0 dropped:0 overruns:0 frame:0
          TX packets:11227895 errors:0 dropped:6422 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:13392292622 (12.4 GiB)  TX bytes:1196669117 (1.1 GiB)

venet0:0  Link encap:UNSPEC  HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00  
          inet addr:46.21.104.226  P-t-P:46.21.104.226  Bcast:0.0.0.0  Mask:255.255.255.255
          UP BROADCAST POINTOPOINT RUNNING NOARP  MTU:1500  Metric:1
</pre></code>

<p>This host has one IPV4 address and one IPV6 address.  I can access the host through IPV4 and my IPV6 tunnel.</p>

<code><pre>
PING 46.21.104.226 (46.21.104.226) 56(84) bytes of data.
64 bytes from 46.21.104.226: icmp_req=1 ttl=50 time=145 ms
64 bytes from 46.21.104.226: icmp_req=2 ttl=50 time=145 ms
64 bytes from 46.21.104.226: icmp_req=3 ttl=50 time=145 ms

--- 46.21.104.226 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2001ms
rtt min/avg/max/mdev = 145.177/145.509/145.784/0.251 ms

PING 2a02:750:5::464(2a02:750:5::464) 56 data bytes
64 bytes from 2a02:750:5::464: icmp_seq=1 ttl=53 time=160 ms
64 bytes from 2a02:750:5::464: icmp_seq=2 ttl=53 time=159 ms
64 bytes from 2a02:750:5::464: icmp_seq=3 ttl=53 time=158 ms

--- 2a02:750:5::464 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2002ms
rtt min/avg/max/mdev = 158.861/159.709/160.406/0.718 ms
</pre></code>

<p>Assigning both IPV4 and IPV6 addresses is a good way to transition to IPV6.  It allows the host to access both worlds.  Most reputable network services will happily work on both types of addresses. Just be aware that services like DHCP and packet filtering are entirely separate.</p>
]]>
    </content>
</entry>

<entry>
    <title>VIM profile</title>
    <link rel="alternate" type="text/html" href="http://watson-wilson.ca/2011/12/vim-profile.html" />
    <id>tag:watson-wilson.ca,2011://3.53</id>

    <published>2011-12-22T14:58:22Z</published>
    <updated>2012-06-23T17:27:26Z</updated>

    <summary>Here is a useful record of VIM settings for when I&apos;m away from home base....</summary>
    <author>
        <name>Neil H. Watson</name>
        
    </author>
    
        <category term="rc files" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="vi" label="vi" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="vim" label="vim" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="vimrc" label="vimrc" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://watson-wilson.ca/">
        <![CDATA[<p>Here is a useful record of VIM settings for when I'm away from home base.</p>]]>
        <![CDATA[<code><pre>
" .vimrc
set history=50
set ruler
set tabstop=3
set shiftwidth=3
set smartindent
set autoindent
set undolevels=100
set showmatch
set showcmd
set number
set tw=0

" autowrite buffer on suspend, buffer switch etc...
set autowrite

" vmap sb "zdi&lt;b&gt;&lt;C-R&gt;z&lt;/b&gt;&lt;ESC&gt; : wrap &lt;b&gt;&lt;/b&gt; around VISUALLY selected Text 
"
syntax on
colorscheme slate

"for scp
set nocp
if version &gt;= 600
    filetype plugin indent on
endif

"date stamps
"Sunday January 02 2008.
iab  dmy  &lt;c-r&gt;=strftime("%A %B %d %Y")&lt;cr&gt;
"20080102
iab  ymd   &lt;c-r&gt;=strftime("%Y%m%d")&lt;cr&gt;
"02:32:22
iab  hms   &lt;c-r&gt;=strftime("%H:%M:%S")&lt;cr&gt; 

" misc abbs

" maps for inserting files
map ,int &lt;ESC&gt;:read ~/neil/docs/job_hunting/cover/intro.txt&lt;CR&gt;
map ,cov &lt;ESC&gt;:read ~/neil/docs/job_hunting/cover/cover-letter.txt&lt;CR&gt;
map ,sig &lt;ESC&gt;:read ~/neil/docs/signatures/resume&lt;CR&gt;

" Rules for different file types.
au BufRead,BufNewFile */journal/*.txt set tw=72 et spell
au BufRead,BufNewFile *.rem set ft=remind
au BufRead,BufNewFile *.cf set ft=cf3
au BufRead,BufNewFile *.xml set ft=xml

"===================================
"PERL SECTION
"===================================

:syntax match xComment /#.*/

"create perl header
map ,ph i!&lt;ESC&gt;:read !which perl&lt;CR&gt;kgJA&lt;CR&gt;&lt;CR&gt;use strict;&lt;CR&gt;use warnings;&lt;CR&gt;&lt;CR&gt;&lt;ESC&gt;ggI#&lt;ESC&gt;G&lt;C-C&gt;

"common DBI statements
iab hashref while ($ref = $sth-&gt;fetchrow_hashref){
"iab sth $sth = $dbh-&gt;prepare($statement) or die "Couldn't prepare statement: $statement ".$dbh-&gt;errstr;&lt;CR&gt;$sth-&gt;execute or die "Couldn't execute statement: $statement ".$dbh-&gt;errstr;

"===================================
"FUNCTIONS
"===================================
fun! Getchar()
  let c = getchar()
  if c != 0
    let c = nr2char(c)
  endif
  return c
endfun

fun! Eatchar(pat)
   let c = Getchar()
   return (c =~ a:pat) ? '' : c
endfun

" .gvimrc
"font
set guifont=Bitstream\ Vera\ Sans\ Mono\ Bold\ 10

"window size
set guiheadroom=20
"set columns=127
"et lines=58

" remove menus, icons and scrollbars
"set guioptions-=m
set guioptions-=T
set guioptions-=R
set guioptions-=r

</pre></code>
]]>
    </content>
</entry>

</feed>
