<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Fred's Blog</title>
	<atom:link href="http://www.valton.com.au/feed" rel="self" type="application/rss+xml" />
	<link>http://www.valton.com.au</link>
	<description>techno-ramblings &#38; miscellanea</description>
	<lastBuildDate>Sat, 05 Dec 2009 00:22:05 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Speeding up DNS lookups with dnsmasq</title>
		<link>http://www.valton.com.au/archives/57</link>
		<comments>http://www.valton.com.au/archives/57#comments</comments>
		<pubDate>Fri, 04 Dec 2009 23:35:44 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[debian]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://www.valton.com.au/?p=57</guid>
		<description><![CDATA[Speed up DNS lookups by using dnsmasq as a DNS cache: First install dnsmasq: sudo apt-get install dnsmasq Update /etc/dnsmasq.conf to include: listen-address=127.0.0.1 Update /etc/dhcp3/dhclient.conf to include: prepend domain-name-servers 127.0.0.1; Finally, edit /etc/resolv.conf and add: nameserver 127.0.0.1 Test DNS caching: 1. dig google.com 19 msec 2. dig google.com 0 msec!!! VoilÃ ]]></description>
			<content:encoded><![CDATA[<p>Speed up DNS lookups by using dnsmasq as a DNS cache:<br />
<span id="more-57"></span></p>
<p>First install dnsmasq: <code>sudo apt-get install dnsmasq</code></p>
<p>Update /etc/dnsmasq.conf to include: <code>listen-address=127.0.0.1</code></p>
<p>Update /etc/dhcp3/dhclient.conf to include: <code>prepend domain-name-servers 127.0.0.1;</code></p>
<p>Finally, edit /etc/resolv.conf and add: <code>nameserver 127.0.0.1</code></p>
<p>Test DNS caching:<br />
1. <code>dig google.com</code> 19 msec<br />
2. <code>dig google.com</code> 0 msec!!!</p>
<p>VoilÃ </p>
]]></content:encoded>
			<wfw:commentRss>http://www.valton.com.au/archives/57/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Spring 2.5 Dependency Injection</title>
		<link>http://www.valton.com.au/archives/28</link>
		<comments>http://www.valton.com.au/archives/28#comments</comments>
		<pubDate>Sun, 21 Jun 2009 03:27:27 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[engineering]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[dependency injection]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[languages]]></category>
		<category><![CDATA[spring]]></category>

		<guid isPermaLink="false">http://www.valton.com.au/?p=28</guid>
		<description><![CDATA[Simple example of Spring dependency injection under Spring 2.5 (depends on the spring-context library): Main.java package au.com.valton; import org.springframework.beans.factory.xml.XmlBeanFactory; import org.springframework.core.io.ClassPathResource; public class Main { private SomeBean someBean; public void setSomeBean(SomeBean someBean) { this.someBean = someBean; } public SomeBean getSomeBean() { return someBean; } public static void main(String[] args) { ClassPathResource res = new ClassPathResource(&#8220;applicationContext.xml&#8221;); [...]]]></description>
			<content:encoded><![CDATA[<p>Simple example of Spring dependency injection under Spring 2.5 (depends on the <a href="http://www.springsource.org/download">spring-context</a> library):<br />
<span id="more-28"></span></p>
<p><strong>Main.java</strong></p>
<blockquote><p>package au.com.valton;</p>
<p>import org.springframework.beans.factory.xml.XmlBeanFactory;<br />
import org.springframework.core.io.ClassPathResource;</p>
<p>public class Main {</p>
<p>private SomeBean someBean;</p>
<p>public void setSomeBean(SomeBean someBean) {<br />
this.someBean = someBean;<br />
}</p>
<p>public SomeBean getSomeBean() {<br />
return someBean;<br />
}</p>
<p>public static void main(String[] args) {</p>
<p>ClassPathResource res = new ClassPathResource(&#8220;applicationContext.xml&#8221;);</p>
<p>XmlBeanFactory factory = new XmlBeanFactory(res);</p>
<p>Main main = (Main) factory.getBean(&#8220;main&#8221;);</p>
<p>System.out.println(main.getSomeBean().getName());<br />
}<br />
}</p>
<p>class SomeBean {</p>
<p>private String name;</p>
<p>public String getName() {<br />
return name;<br />
}</p>
<p>public void setName(String name) {<br />
this.name = name;<br />
}</p>
<p>}</p></blockquote>
<p><strong>applicationContext.xml</strong></p>
<blockquote><p>&lt;?xml version=&#8221;1.0&#8243; encoding=&#8221;UTF-8&#8243;?&gt;</p>
<p>&lt;beans xmlns=&#8221;http://www.springframework.org/schema/beans&#8221; 	xmlns:xsi=&#8221;http://www.w3.org/2001/XMLSchema-instance&#8221; xsi:schemaLocation=&#8221;http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd&#8221;&gt;<br />
&lt;bean id=&#8221;someBean&#8221;&gt;<br />
&lt;property name=&#8221;name&#8221;&gt;<br />
&lt;value&gt;A Name&lt;/value&gt;<br />
&lt;/property&gt;<br />
&lt;/bean&gt;<br />
&lt;bean id=&#8221;main&#8221;&gt;<br />
&lt;property name=&#8221;someBean&#8221;&gt;<br />
&lt;ref bean=&#8221;someBean&#8221; /&gt;<br />
&lt;/property&gt;<br />
&lt;/bean&gt;<br />
&lt;/beans&gt;</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.valton.com.au/archives/28/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Standalone Java SSL Client</title>
		<link>http://www.valton.com.au/archives/12</link>
		<comments>http://www.valton.com.au/archives/12#comments</comments>
		<pubDate>Sun, 14 Jun 2009 10:12:23 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[engineering]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[web]]></category>
		<category><![CDATA[languages]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[ssl]]></category>

		<guid isPermaLink="false">http://www.valton.com.au/?p=12</guid>
		<description><![CDATA[Simple standalone Java SSL client using Apache Commons HTTPClient library: package au.com.valton.sslclient; import org.apache.commons.httpclient.HttpClient; import org.apache.commons.httpclient.HttpMethod; import org.apache.commons.httpclient.methods.GetMethod; public class SSLClientMain { public static void main(String[] args) { System.setProperty(&#8220;javax.net.ssl.keyStore&#8221;, &#8220;local_keystore.p12&#8243;); System.setProperty(&#8220;javax.net.ssl.keyStorePassword&#8221;, &#8220;keystore_password&#8221;); System.setProperty(&#8220;javax.net.ssl.keyStoreType&#8221;, &#8220;PKCS12&#8243;); System.setProperty(&#8220;javax.net.ssl.trustStore&#8221;, &#8220;local_truststore.p12&#8243;); System.setProperty(&#8220;javax.net.ssl.trustStorePassword&#8221;, &#8220;trustore_password&#8221;); System.setProperty(&#8220;javax.net.ssl.trustStoreType&#8221;, &#8220;PKCS12&#8243;); System.setProperty(&#8220;javax.net.debug&#8221;, &#8220;ssl&#8221;); HttpMethod httpGet = new GetMethod(); HttpClient httpClient = new HttpClient(); try { httpClient.executeMethod(httpGet); [...]]]></description>
			<content:encoded><![CDATA[<p>Simple standalone Java SSL client using <a href="http://hc.apache.org/httpclient-3.x/">Apache Commons HTTPClient</a> library:<br />
<span id="more-12"></span></p>
<blockquote><p>package au.com.valton.sslclient;</p>
<p>import org.apache.commons.httpclient.HttpClient;<br />
import org.apache.commons.httpclient.HttpMethod;<br />
import org.apache.commons.httpclient.methods.GetMethod;</p>
<p>public class SSLClientMain {</p>
<p>    public static void main(String[] args) {</p>
<p>        System.setProperty(&#8220;javax.net.ssl.keyStore&#8221;, &#8220;local_keystore.p12&#8243;);<br />
        System.setProperty(&#8220;javax.net.ssl.keyStorePassword&#8221;, &#8220;keystore_password&#8221;);<br />
        System.setProperty(&#8220;javax.net.ssl.keyStoreType&#8221;, &#8220;PKCS12&#8243;);</p>
<p>        System.setProperty(&#8220;javax.net.ssl.trustStore&#8221;, &#8220;local_truststore.p12&#8243;);<br />
        System.setProperty(&#8220;javax.net.ssl.trustStorePassword&#8221;, &#8220;trustore_password&#8221;);<br />
        System.setProperty(&#8220;javax.net.ssl.trustStoreType&#8221;, &#8220;PKCS12&#8243;);</p>
<p>        System.setProperty(&#8220;javax.net.debug&#8221;, &#8220;ssl&#8221;);</p>
<p>        HttpMethod httpGet = new GetMethod();<br />
        HttpClient httpClient = new HttpClient();</p>
<p>        try {<br />
            httpClient.executeMethod(httpGet);<br />
            System.out.println(new String(httpGet.getResponseBody()));<br />
        } catch (Exception e) {<br />
            e.printStackTrace();<br />
        }<br />
    }<br />
}
</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.valton.com.au/archives/12/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Customising Emacs</title>
		<link>http://www.valton.com.au/archives/3</link>
		<comments>http://www.valton.com.au/archives/3#comments</comments>
		<pubDate>Sat, 01 Dec 2007 12:15:46 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[customisations]]></category>
		<category><![CDATA[editors]]></category>
		<category><![CDATA[emacs]]></category>
		<category><![CDATA[ide]]></category>
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://localhost/?p=3</guid>
		<description><![CDATA[Here&#8217;s a recent configuration geared towards Emacs in console mode (emacs -nw / emacs-nox): ;;;;;;;;;;;;;;;;; Load Paths ;;;;;;;;;;;;;;;;;;; (setq load-path (cons (expand-file-name &#8220;~/.emacs-clisp/&#8221;) load-path)) ;;;;;;;;;;;;;;;;; Require Modes ;;;;;;;;;;;;;;;;;;; ;;&#8211;automatically load packages installed through portage (require &#8216;site-gentoo nil t) ;;&#8211;mutt email editing mode for emacs (require &#8216;mutt) ;;&#8211;adds redo to emacs cf. undo &#8211; bound to [...]]]></description>
			<content:encoded><![CDATA[<p class="content">Here&#8217;s a recent configuration geared towards Emacs in console mode (emacs -nw / emacs-nox):</p>
<p><span id="more-3"></span></p>
<p>;;;;;;;;;;;;;;;;; Load Paths ;;;;;;;;;;;;;;;;;;;<br />
(setq load-path (cons (expand-file-name &#8220;~/.emacs-clisp/&#8221;) load-path))</p>
<p>;;;;;;;;;;;;;;;;; Require Modes ;;;;;;;;;;;;;;;;;;;<br />
;;&#8211;automatically load packages installed through portage<br />
(require &#8216;site-gentoo nil t)<br />
;;&#8211;mutt email editing mode for emacs<br />
(require &#8216;mutt)<br />
;;&#8211;adds redo to emacs cf. undo &#8211; bound to C-_<br />
(require &#8216;redo)<br />
;;&#8211;convert emacs faces to html<br />
(require &#8216;htmlize)<br />
;; required for saving session &#8211; cursor position in file<br />
(require &#8216;session)<br />
(add-hook &#8216;after-init-hook &#8216;session-initialize)</p>
<p>;;&#8211;load editing modes &#8211; acutally loaded by site-gentoo above<br />
;(require &#8216;ruby-mode)<br />
;(require &#8216;python-mode)<br />
;(require &#8216;php-mode)<br />
;(require &#8216;nxml-mode)<br />
;(require &#8216;css-mode)</p>
<p>;;&#8211;show contents of kill ring<br />
(require &#8216;browse-kill-ring)<br />
;;&#8211;text stats on current buffer &#8211; bound to C-ct<br />
(require &#8216;textstats)<br />
;;&#8211;highlight active line &#8211; use with highline-on<br />
;(require &#8216;highline)<br />
;;&#8211;highlight blank spaces &#8211; use with blank-mode-on<br />
;(require &#8216;blank-mode)</p>
<p>;;&#8211;muttrc<br />
(autoload &#8216;muttrc-mode &#8220;~/.emacs-clisp/muttrc-mode.elc&#8221; &#8220;muttrc-mode&#8221; t &#8216;nil)<br />
;;&#8211;html-helper-mode<br />
(autoload &#8216;html-helper-mode &#8220;html-helper-mode&#8221; &#8220;HTML major mode.&#8221; t &#8216;nil)</p>
<p>;;;;;;;;;;;;;;;;; Customisations  ;;;;;;;;;;;;;;;;;;;<br />
;;&#8211;turn on font highlighting<br />
(global-font-lock-mode t)<br />
;;&#8211;remove the startup message<br />
(setq  inhibit-startup-message t)<br />
;;&#8211;highlight selection<br />
(transient-mark-mode t)<br />
;;&#8211;highlight matching parenthesis<br />
(show-paren-mode t)<br />
;;&#8211;emulates PC delete, backspace, home, end &#8230;<br />
(pc-bindings-mode)<br />
;;&#8211;emulates PC cursor keys, next, prior, home and end keys<br />
;;(pc-selection-mode)<br />
;;&#8211;make searches case-INsensitive<br />
(setq-default case-fold-search t)<br />
;;&#8211;do not use tabs for indentation<br />
(setq-default indent-tabs-mode nil)<br />
;;&#8211;number of spaces for tab interval<br />
(setq tab-interval 2)<br />
;;&#8211;don&#8217;t automatically add new lines at end of a buffer<br />
(setq next-line-add-newlines nil)<br />
;;&#8211;make sure file ends with NEWLINE<br />
(setq require-final-newline t)<br />
;;&#8211;return to same line on a scroll back<br />
(setq scroll-preserve-screen-position t)<br />
;;&#8211;highlight search and replace matches<br />
(setq search-highlight t)<br />
;;&#8211;highlight words during query replacement<br />
(setq query-replace-highlight t)<br />
;;&#8211;turn on the column numbering in the minibuffer<br />
(setq column-number-mode t)<br />
;;&#8211;turn on the line numbering in the minibuffer<br />
(setq line-number-mode t)<br />
;;&#8211;non-nil means replace should preserve case<br />
(setq case-replace t)<br />
;;&#8211;visual bell<br />
(setq visible-bell t)<br />
;;&#8211;maximum number of entries in the mark ring<br />
(setq mark-ring-max 32)<br />
;;&#8211;turn on line wrapping in text mode<br />
(add-hook &#8216;text-mode-hook &#8216;turn-on-auto-fill)<br />
;;&#8211;turn on flyspell in text &amp; LaTeX modes<br />
(add-hook &#8216;text-mode-hook &#8216;flyspell-mode)<br />
(add-hook &#8216;LaTeX-mode-hook &#8216;flyspell-mode)<br />
;;&#8211;the column beyond which words wrap<br />
(setq default-fill-column 72)<br />
;;&#8211;scroll scroll max lines<br />
(setq scroll-step 1)<br />
;;&#8211;automatic scroll lines<br />
(setq scroll-conservatively 1)<br />
;;&#8211;show line numbers even in very big files<br />
(setq line-number-display-limit 10000000)<br />
;;&#8211;set high garbage collection threshold<br />
(setq gc-cons-threshold 5000000)<br />
;;&#8211;set maximum log size<br />
(setq message-log-max 3000)<br />
;;&#8211;history elements never deleted<br />
(setq history-length t)<br />
;;&#8211;maximum length to which the kill ring can grow &#8211; def. 30<br />
(setq kill-ring-max 200)<br />
;;&#8211;full name<br />
(setq user-full-name &#8220;Firstname Lastname&#8221;)<br />
;;&#8211;email address<br />
(setq user-mail-address &#8220;your@email.com&#8221;)<br />
;;&#8211;make all &#8220;yes or no&#8221; prompts show &#8220;y or n&#8221; instead<br />
(fset &#8216;yes-or-no-p &#8216;y-or-n-p)<br />
;;&#8211;set aspell as default spell-checker<br />
(setq-default ispell-program-name &#8220;aspell&#8221;)<br />
;;&#8211;ispell settings<br />
(autoload &#8216;ispell-word &#8220;ispell&#8221; &#8220;Check the spelling of word in buffer.&#8221; &#8216;t)<br />
(autoload &#8216;ispell-region &#8220;ispell&#8221; &#8220;Check the spelling of region.&#8221; &#8216;t)<br />
(autoload &#8216;ispell-buffer &#8220;ispell&#8221; &#8220;Check the spelling of buffer.&#8221; &#8216;t)<br />
(setq ispell-dictionary &#8220;british&#8221; ispell-skip-sgml t)<br />
;;&#8211;flyspell settings<br />
(autoload &#8216;flyspell-mode &#8220;flyspell&#8221; &#8220;On-the-fly spelling checking&#8221; t)<br />
(setq flyspell-default-dictionary &#8220;british&#8221;)<br />
;;&#8211;add flyspell to mail-mode<br />
(defun my-mail-mode-hook () (auto-fill-mode t))<br />
(add-hook &#8216;mail-mode-hook &#8216;my-mail-mode-hook)</p>
<p>;;;;;;;;;;;;;;;;; Mode Hooks ;;;;;;;;;;;;;;;;;;;<br />
(setq auto-mode-alist<br />
(append<br />
&#8216;(<br />
(&#8220;\\.txt$\\|\\.text$\\|\\.doc$&#8221;             . text-mode)<br />
(&#8220;\\.xml$\\|\\.xsl$\\|\\.rng$\\|\\.xhtml$&#8221;  . nxml-mode)<br />
(&#8220;\\.html$\\|\\.ohtml$\\|\\.phtml&#8221;          . html-helper-mode)<br />
(&#8220;\\.htm$\\|\\.asp$&#8221;                        . html-helper-mode)<br />
(&#8220;\\.php3$\\|\\.php4|\\.php$$&#8221;              . php-mode)<br />
(&#8220;\\.css\\&#8217;&#8221;                                . css-mode)<br />
(&#8220;\\.java$&#8221;                                 . java-mode)<br />
(&#8220;\\.perl$\\|\\.plx$\\|\\.pl$&#8221;              . cperl-mode)<br />
(&#8220;\\.py$&#8221;                                   . python-mode)<br />
(&#8220;\\.rb$&#8221;                                   . ruby-mode)<br />
(&#8220;^\/tmp\/mutt&#8221;                             . mail-mode)<br />
(&#8220;\\.muttrc&#8221;                                . muttrc-mode)<br />
(&#8220;\\.sh$|\\.zsh$|\\.bash$&#8221;                  . shell-script-mode)<br />
(&#8220;\\.xinitrc|\\.bashrc|\\.z?profile&#8221;        . sh-mode)<br />
) auto-mode-alist))</p>
<p>;;;;;;;;;;;;;;;;; Key Bindings ;;;;;;;;;;;;;;;;;;;<br />
;;&#8211;wrap text<br />
(global-set-key [f2]                &#8216;fill-paragraph)<br />
(global-set-key [(control f2)]      &#8216;fill-region)<br />
(global-set-key [f27]               &#8216;fill-region)<br />
;;&#8211;comment region<br />
(global-set-key [f4]                &#8216;ewd-comment-region)<br />
(global-set-key [(control f4)]      &#8216;ewd-uncomment-region)<br />
(global-set-key [f29]               &#8216;ewd-uncomment-region)<br />
;;&#8211;prepend text to region<br />
(global-set-key [f5]                &#8216;ewd-prepend)<br />
(global-set-key [(control f5)]      &#8216;ewd-unprepend)<br />
(global-set-key [f30]               &#8216;ewd-unprepend)<br />
;;&#8211;Ispell<br />
(global-set-key [f7]                &#8216;ispell-word)<br />
(global-set-key [(control f7)]      &#8216;ispell-buffer)<br />
(global-set-key [f32]               &#8216;ispell-buffer)</p>
<p>;;&#8211;browse kill ring<br />
(global-set-key &#8220;\C-xy&#8221;             &#8216;browse-kill-ring)<br />
;;&#8211;go to specific line in current buffer<br />
(global-set-key &#8220;\C-cg&#8221;             &#8216;goto-line)<br />
;;&#8211;go to specific line in current buffer<br />
(global-set-key &#8220;\C-ch&#8221;             &#8216;goto-column)<br />
;;&#8211;eat space at point up to non-space<br />
(global-set-key &#8220;\C-ce&#8221;             &#8216;fixup-whitespace)<br />
;;&#8211;display text stats for current buffer<br />
(global-set-key &#8220;\C-ct&#8221;             &#8216;textstats)</p>
<p>;;;;;;;;;;;;;;;;; Misc Functions ;;;;;;;;;;;;;;;;;;;<br />
;;&#8211;replace all ^M characters in buffer<br />
(defun fixm ()<br />
&#8220;Delete ^M from buffer.&#8221;<br />
(interactive)<br />
;;&#8211;Remember where we were<br />
(let ((old-point (point)))<br />
;;&#8211;Move to top<br />
(set-window-point (get-buffer-window (current-buffer)) 0)<br />
;;&#8211;Replace ^M&#8217;s<br />
(while (search-forward &#8220;\C-m&#8221; nil t)<br />
;; (replace-match &#8220;\n&#8221; nil t)) replace with new lines<br />
(replace-match &#8220;&#8221; nil t))<br />
;;&#8211;Move back to the old point<br />
(set-window-point (get-buffer-window (current-buffer)) old-point)))</p>
<p>;;&#8211;convert from DOS &gt; UNIX<br />
(defun dos-unix ()<br />
(interactive)<br />
(goto-char (point-min))<br />
(while (search-forward &#8220;\r&#8221; nil t) (replace-match &#8220;&#8221;)))</p>
<p>;;&#8211;convert from UNIX &gt; DOS<br />
(defun unix-dos ()<br />
(interactive)<br />
(goto-char (point-min))<br />
(while (search-forward &#8220;\n&#8221; nil t) (replace-match &#8220;\r\n&#8221;)))</p>
<p>;;&#8211;add a string in front of all lines in the region **<br />
(defun ewd-prepend (start end s)<br />
&#8220;Add a string in front of all lines in the region.&#8221;<br />
(interactive &#8220;*r\nMEnter a string: &#8220;)<br />
(save-excursion<br />
(save-restriction<br />
(narrow-to-region<br />
(progn (goto-char start) (beginning-of-line) (point))<br />
(progn (goto-char end) (end-of-line) (point)))<br />
(goto-char (point-min))<br />
(beginning-of-line)<br />
(while (not (eobp))<br />
(insert s)<br />
(forward-line 1)))))</p>
<p>;;&#8211;remove a string in front of all lines in the region **<br />
(defun ewd-unprepend (start end s)<br />
&#8220;Remove a string from the front of all lines in the region.&#8221;<br />
(interactive &#8220;*r\nMEnter a string: &#8220;)<br />
(save-excursion<br />
(save-restriction<br />
(narrow-to-region<br />
(progn (goto-char start) (beginning-of-line) (point))<br />
(progn (goto-char end) (end-of-line) (point)))<br />
(goto-char (point-min))<br />
(while (not (eobp))<br />
(if (looking-at (regexp-quote s))<br />
(delete-region (match-beginning 0) (match-end 0)))<br />
(forward-line 1)))))</p>
<p>;;&#8211;add a comment character in front of all lines in the region **<br />
(defun ewd-comment-region (start end)<br />
&#8220;Add one comment character in front of all lines in the region.&#8221;<br />
(interactive &#8220;*r&#8221;)<br />
(or comment-start (setq comment-start (read-input &#8220;Comment char?: &#8220;)))<br />
(ewd-prepend start end comment-start))</p>
<p>;;&#8211;remove a comment character from in front of all lines in the region **<br />
(defun ewd-uncomment-region (start end)<br />
&#8220;Remove one comment character from in front of all lines in the region.&#8221;<br />
(interactive &#8220;*r&#8221;)<br />
(or comment-start (setq comment-start (read-input &#8220;Comment char?: &#8220;)))<br />
(ewd-unprepend start end comment-start))</p>
<p>This configuration relies on the following modes:</p>
<p><em>muttrc-mode<br />
htmlize<br />
redo<br />
session<br />
highline<br />
browse-kill-ring<br />
textstats<br />
ruby-mode<br />
python-mode<br />
nxml-mode<br />
html-helper-mode<br />
css-mode<br />
php-mode<br />
java-mode<br />
cperl-mode<br />
python-mode<br />
ruby-mode</em></p>
<p>Most of these should be included with your favourite Linux distribution &#8211; in my case they are loaded using Gentoo&#8217;s site-gentoo mode</p>
<p>** Credit to  Elijah Daniel for the ewd-* functions.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.valton.com.au/archives/3/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Developer-centric plugins for Mozilla Firefox</title>
		<link>http://www.valton.com.au/archives/7</link>
		<comments>http://www.valton.com.au/archives/7#comments</comments>
		<pubDate>Thu, 29 Nov 2007 10:36:43 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[markup]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://localhost/?p=7</guid>
		<description><![CDATA[List of useful developer-centric plugins for Mozilla Firefox: Web Developer Adds a menu and a toolbar with various web developer tools. XML Developer Toolbar Toolbar modeled after Chris Pederick&#8217;s WebDeveloper toolbar, that allows XML Developer&#8217;s use of standard tools all from your browser. Firebug Firebug integrates with Firefox to put a wealth of development tools [...]]]></description>
			<content:encoded><![CDATA[<p>List of useful developer-centric plugins for Mozilla Firefox:<br />
<span id="more-7"></span><br />
<strong><a href="https://addons.mozilla.org/en-US/firefox/downloads/latest/60/addon-60-latest.xpi">Web Developer</a></strong><br />
Adds a menu and a toolbar with various web developer tools.</p>
<p><strong><a href="https://addons.mozilla.org/en-US/firefox/downloads/latest/2897/addon-2897-latest.xpi">XML Developer Toolbar</a></strong><br />
Toolbar modeled after Chris Pederick&#8217;s WebDeveloper toolbar, that allows XML Developer&#8217;s use of standard tools all from your browser.</p>
<p><!--more--></p>
<p><strong><a href="https://addons.mozilla.org/en-US/firefox/downloads/latest/1843/addon-1843-latest.xpi">Firebug</a></strong><br />
Firebug integrates with Firefox to put a wealth of development tools at your fingertips while you browse. You can edit, debug, and monitor CSS, HTML, and JavaScript live in any web page.</p>
<p><strong><a href="https://addons.mozilla.org/en-US/firefox/downloads/latest/3829/addon-3829-latest.xpi">Live HTTP Headers</a></strong><br />
View HTTP headers of a page and while browsing.</p>
<p><strong><a href="https://addons.mozilla.org/en-US/firefox/downloads/latest/2214/addon-2214-latest.xpi">View dependencies</a></strong><br />
View Dependencies adds a tab to the Page Info window, in which it lists all the files which were loaded to show the current page.</p>
<p><strong><a href="https://addons.mozilla.org/en-US/firefox/downloads/latest/573/addon-573-latest.xpi">Add N Edit Cookies</a></strong><br />
Cookie Editor that allows you add and edit session and saved cookies.</p>
<p><strong><a href="https://addons.mozilla.org/en-US/firefox/addons/policy/0/966/33806">Tamper Data</a></strong><br />
Use tamper data to view and modify HTTP/HTTPS headers and post parameters.</p>
<p><strong><a href="https://addons.mozilla.org/en-US/firefox/downloads/latest/216/addon-216-latest.xpi">Javascript Debugger</a></strong><br />
Venkman is the code name for Mozilla&#8217;s JavaScript Debugger. Venkman aims to provide a powerful JavaScript debugging environment for Mozilla based browsers.</p>
<p><strong><a href="https://addons.mozilla.org/en-US/firefox/downloads/latest/2079/addon-2079-latest.xpi">Selenium IDE</a></strong><br />
Selenium IDE is an integrated development environment for Selenium tests. It is implemented as a Firefox extension, and allows you to record, edit, and debug tests. Selenium IDE includes the entire Selenium Core, allowing you to easily and quickly record and play back tests in the actual environment that they will run.</p>
<p><strong><a href="https://addons.mozilla.org/en-US/firefox/downloads/latest/539/addon-539-latest.xpi">MeasureIt</a></strong><br />
Draw out a ruler to get the pixel width and height of any elements on a webpage.</p>
<p><strong><a href="https://addons.mozilla.org/en-US/firefox/downloads/latest/271/addon-271-latest.xpi">ColorZilla</a></strong><br />
Advanced Eyedropper, ColorPicker, Page Zoomer and other colorful goodies.</p>
<p><strong><a href="https://addons.mozilla.org/en-US/firefox/downloads/latest/1419/platform:5/addon-1419-latest.xpi">IE Tab</a></strong><br />
This is a great tool for web developers, since you can easily see how your web page displayed in IE with just one click and then switch back to Firefox.</p>
<p><strong><a href="https://addons.mozilla.org/en-US/firefox/downloads/latest/249/platform:5/addon-249-latest.xpi">Html Validator</a></strong><br />
HTML Validator is a Mozilla extension that adds HTML validation inside Firefox and Mozilla.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.valton.com.au/archives/7/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Madwifi configuration with PKA under Gentoo Linux 2007.0</title>
		<link>http://www.valton.com.au/archives/10</link>
		<comments>http://www.valton.com.au/archives/10#comments</comments>
		<pubDate>Sun, 25 Nov 2007 10:43:59 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[gentoo]]></category>

		<guid isPermaLink="false">http://localhost/?p=10</guid>
		<description><![CDATA[Simple madwifi configuration with PKA under Gentoo 2007.0: # emerge madwifi network drivers and wpa supplicant emerge net-wireless/madwifi-ng emerge net-wireless/madwifi-ng-tools emerge net-wireless/wpa_supplicant # update configuration, soft links and run level scripts as follows cat /etc/conf.d/net dns_search_lo=&#8221;your.domain.name.com&#8221; dns_domain_lo=&#8221;your.domain.name.com&#8221; dns_servers_lo=&#8221;your.dns.server.ip.1 your.dns.server.ip.2&#8243; essid_ath0=&#8221;your.wireless.network.essid&#8221; modules=( &#8220;wpa_supplicant&#8221; ) wpa_timeout_ath0=60 cat /etc/conf.d/net.ath0 config_ath0=( &#8220;your.machine.ip netmask your.netmask brd your.broadcast.ip&#8221; ) routes_ath0=( &#8220;default [...]]]></description>
			<content:encoded><![CDATA[<p>Simple madwifi configuration with PKA under Gentoo 2007.0:<br />
<span id="more-10"></span><br />
# emerge madwifi network drivers and wpa supplicant<br />
emerge net-wireless/madwifi-ng<br />
emerge net-wireless/madwifi-ng-tools<br />
emerge net-wireless/wpa_supplicant</p>
<p><!--more--></p>
<p># update configuration, soft links and run level scripts as follows<br />
cat /etc/conf.d/net<br />
dns_search_lo=&#8221;your.domain.name.com&#8221;<br />
dns_domain_lo=&#8221;your.domain.name.com&#8221;<br />
dns_servers_lo=&#8221;your.dns.server.ip.1 your.dns.server.ip.2&#8243;<br />
essid_ath0=&#8221;your.wireless.network.essid&#8221;<br />
modules=( &#8220;wpa_supplicant&#8221; )<br />
wpa_timeout_ath0=60</p>
<p>cat /etc/conf.d/net.ath0<br />
config_ath0=( &#8220;your.machine.ip netmask your.netmask brd your.broadcast.ip&#8221; )<br />
routes_ath0=( &#8220;default via your.wireless.router.ip&#8221; )</p>
<p>ls -l /etc/init.d/net*<br />
lrwxrwxrwx 1 root root 6 Nov 21 18:24 /etc/init.d/net.ath0 -&gt; net.lo*<br />
-rwxr-xr-x 1 root root 30522 Nov 24 14:50 /etc/init.d/net.lo*</p>
<p>rc-update show<br />
net.ath0 | default<br />
net.lo | boot</p>
<p>cat /etc/wpa_supplicant/wpa_supplicant.conf<br />
ctrl_interface=/var/run/wpa_supplicant<br />
## user must belong to &#8216;wheel&#8217; group<br />
ctrl_interface_group=wheel<br />
network={<br />
ssid=&#8221;your.wireless.network.essid&#8221;<br />
## change scan_ssid to your network channel<br />
scan_ssid=1<br />
proto=WPA<br />
key_mgmt=WPA-PSK<br />
priority=5<br />
psk=&#8221;your.wireless.network.passphrase&#8221;<br />
}</p>
<p>cat /etc/modules.autoload.d/kernel-2.6<br />
ath_hal<br />
ath_pci<br />
wlan</p>
]]></content:encoded>
			<wfw:commentRss>http://www.valton.com.au/archives/10/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Portage overlay example under Gentoo 2007.0</title>
		<link>http://www.valton.com.au/archives/9</link>
		<comments>http://www.valton.com.au/archives/9#comments</comments>
		<pubDate>Sun, 25 Nov 2007 10:39:03 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[gentoo]]></category>

		<guid isPermaLink="false">http://localhost/?p=9</guid>
		<description><![CDATA[In this example I am applying the PGP-verbose-MIME patch to Mutt 1.5.16: # first search portage for the package name emerge -s mutt this returns the following block: * mail-client/mutt Latest version available: 1.5.16 Latest version installed: 1.5.16 Size of files: 3,558 kB Homepage: http://www.mutt.org Description: a small but very powerful text-based mail client License: [...]]]></description>
			<content:encoded><![CDATA[<p>In this example I am applying the PGP-verbose-MIME patch to Mutt 1.5.16:<br />
<span id="more-9"></span><br />
# first search portage for the package name<br />
emerge -s mutt<br />
<!--more--><br />
this returns the following block:<br />
* mail-client/mutt<br />
Latest version available: 1.5.16<br />
Latest version installed: 1.5.16<br />
Size of files: 3,558 kB<br />
Homepage: http://www.mutt.org<br />
Description: a small but very powerful text-based mail client<br />
License: GPL-2<br />
where &#8216;mail-client/mutt&#8217; is the package name.</p>
<p># create overlay directory using the above package name<br />
mkdir -p /usr/local/portage/mail-client/mutt</p>
<p># from this point onwards the commands are relative to<br />
/usr/local/portage/mail-client/mutt so change to this directory<br />
cd /usr/local/portage/mail-client/mutt</p>
<p># copy ebuild script &amp; portage files to overlay directory<br />
cp /usr/portage/mail-client/mutt/mutt-1.5.16.ebuild ./<br />
cp -R /usr/portage/mail-client/mutt/files ./</p>
<p># copy patch to newly copied &#8216;files&#8217; directory -<br />
patch in this example: /src_dir/patch-1.5.4.vk.pgp_verbose_mime<br />
cp /src_dir/patch-1.5.4.vk.pgp_verbose_mime ./files</p>
<p># create an ebuild digest &#8211; checksums the content of &#8216;files&#8217;<br />
ebuild mutt-1.5.16.ebuild digest</p>
<p># edit mutt-1.5.16.ebuild &amp; add epatch intruction<br />
nano -w mutt-1.5.16.ebuild</p>
<p># first ensure that the following is included at top of the file<br />
inherit eutils</p>
<p># in the src_unpack() {} function add a new epatch instruction<br />
and save changes &#8211; in this case<br />
epatch &#8220;${FILESDIR}&#8221;/patch-1.5.4.vk.pgp_verbose_mime</p>
<p># delete any previous builds from the cache with<br />
/var/tmp/portage/mail-client/mutt-1.5.16</p>
<p># finally, run the following commands in sequence<br />
ebuild mutt-1.5.16.ebuild fetch<br />
ebuild mutt-1.5.16.ebuild unpack<br />
ebuild mutt-1.5.16.ebuild compile<br />
ebuild mutt-1.5.16.ebuild install<br />
ebuild mutt-1.5.16.ebuild qmerge</p>
<p>That&#8217;s it: the patch should now be applied.</p>
<p>With mutt you can check this with the mutt -v command.</p>
<p>The mutt patch was downloaded from:</p>
<p>http://www.doorstop.net/mutt/patch-1.5.4.vk.pgp_verbose_mime</p>
]]></content:encoded>
			<wfw:commentRss>http://www.valton.com.au/archives/9/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Importing keys into the apt keyring</title>
		<link>http://www.valton.com.au/archives/8</link>
		<comments>http://www.valton.com.au/archives/8#comments</comments>
		<pubDate>Tue, 13 Nov 2007 10:37:47 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[debian]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://localhost/?p=8</guid>
		<description><![CDATA[Simple approach to loading apt keys from a key server into the apt keyring: # import key to keyring from key server sudo gpg &#8211;keyserver subkeys.pgp.net &#8211;recv-key A040830F7FAC5991 # check key fingerprint (optional) sudo gpg &#8211;fingerprint A040830F7FAC5991 # export key to apt keyring sudo gpg &#8211;armor &#8211;export A040830F7FAC5991 &#124; sudo apt-key add - This should [...]]]></description>
			<content:encoded><![CDATA[<p>Simple approach to loading apt keys from a key server into the apt keyring:<br />
<span id="more-8"></span><br />
# import key to keyring from key server<br />
sudo gpg &#8211;keyserver subkeys.pgp.net &#8211;recv-key A040830F7FAC5991</p>
<p># check key fingerprint (optional)<br />
sudo gpg &#8211;fingerprint A040830F7FAC5991</p>
<p># export key to apt keyring<br />
sudo gpg &#8211;armor &#8211;export A040830F7FAC5991 | sudo apt-key add -</p>
<p>This should address the following apt-get / aptitude error:</p>
<p>GPG error: http://dl.google.com stable Release: The following signatures couldn&#8217;t be verified because the public key is not available: NO_PUBKEY A040830F7FAC5991</p>
]]></content:encoded>
			<wfw:commentRss>http://www.valton.com.au/archives/8/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MPlayer DVB-T under Linux for Melbourne &#8211; Australia</title>
		<link>http://www.valton.com.au/archives/6</link>
		<comments>http://www.valton.com.au/archives/6#comments</comments>
		<pubDate>Sun, 11 Nov 2007 08:26:24 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[dvb]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[shell scripts]]></category>

		<guid isPermaLink="false">http://localhost/?p=6</guid>
		<description><![CDATA[MPlayer DVB-T configuration under Linux for Melbourne &#8211; Australia: Frequency table for linuxtv&#8217;s scan tool &#8211; (see Digital Broadcasting Authority) # Australia / Melbourne (Mt Dandenong transmitter) # T freq bw fec_hi fec_lo mod transmission-mode guard-interval hierarchy # ABC T 226500000 7MHz 3/4 NONE QAM64 8k 1/16 NONE # Seven T 177500000 7MHz 2/3 NONE [...]]]></description>
			<content:encoded><![CDATA[<p>MPlayer DVB-T configuration under Linux for Melbourne &#8211; Australia:<br />
<span id="more-6"></span><br />
<strong>Frequency table for linuxtv&#8217;s scan tool</strong> &#8211; (see Digital Broadcasting Authority)</p>
<p># Australia / Melbourne (Mt Dandenong transmitter)<br />
# T freq bw fec_hi fec_lo mod transmission-mode guard-interval hierarchy<br />
# ABC<br />
T 226500000 7MHz 3/4 NONE QAM64 8k 1/16 NONE<br />
# Seven<br />
T 177500000 7MHz 2/3 NONE QAM64 8k 1/8 NONE<br />
# Nine<br />
T 191625000 7MHz 3/4 NONE QAM64 8k 1/16 NONE<br />
# Ten<br />
T 219500000 7MHz 3/4 NONE QAM64 8k 1/16 NONE<br />
# SBS<br />
T 536500000 7MHz 2/3 NONE QAM64 8k 1/8 NONE</p>
<p><strong>Minimal channels.conf</strong><br />
7 Digital:177500000:INVERSION_AUTO:BANDWIDTH_7_MHZ:FEC_2_3:FEC_2_3:QAM_64:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_8:HIERARCHY_NONE:769:770:1328<br />
Nine Digital:191625000:INVERSION_AUTO:BANDWIDTH_7_MHZ:FEC_3_4:FEC_3_4:QAM_64:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_16:HIERARCHY_NONE:519:720:1072<br />
TEN Digital:219500000:INVERSION_AUTO:BANDWIDTH_7_MHZ:FEC_3_4:FEC_1_2:QAM_64:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_16:HIERARCHY_NONE:512:650:1585<br />
ABC TV Melbourne:226500000:INVERSION_AUTO:BANDWIDTH_7_MHZ:FEC_3_4:FEC_3_4:QAM_64:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_16:HIERARCHY_NONE:512:650:561<br />
ABC2:226500000:INVERSION_AUTO:BANDWIDTH_7_MHZ:FEC_3_4:FEC_3_4:QAM_64:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_16:HIERARCHY_NONE:2309:2310:562<br />
SBS DIGITAL 1:536500000:INVERSION_AUTO:BANDWIDTH_7_MHZ:FEC_2_3:FEC_NONE:QAM_64:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_8:HIERARCHY_NONE:161:81:785</p>
<p><strong>Simple MPlayer shell script</strong> &#8211; requires zenity from the GNOME project<br />
#!/bin/sh<br />
killall mplayer &gt;/dev/null 2&gt;&amp;1<br />
killall zenity &gt;/dev/null 2&gt;&amp;1<br />
CHANNEL=$(zenity &#8211;title &#8220;Digital TV&#8221; &#8211;width 150 &#8211;height 200 &#8211;list \<br />
&#8211;column &#8220;Please select a channel:&#8221; &#8220;Channel7&#8243; &#8220;Channel9&#8243; &#8220;Channel10&#8243; &#8220;ABC&#8221; &#8220;ABC2&#8243; &#8220;SBS&#8221;)<br />
PARAMS=&#8221;-cache 8192 -autoq 100 -vf spp -ontop -quiet -zoom&#8221;<br />
if [ $CHANNEL = "Channel7" ]; then<br />
mplayer $PARAMS &#8220;dvb://7 Digital&#8221;<br />
. $0<br />
exit 0<br />
elif [ $CHANNEL = "Channel9" ]; then<br />
mplayer $PARAMS &#8220;dvb://Nine Digital&#8221;<br />
. $0<br />
exit 0<br />
elif [ $CHANNEL = "Channel10" ]; then<br />
mplayer $PARAMS &#8220;dvb://TEN Digital&#8221;<br />
. $0<br />
exit 0<br />
elif [ $CHANNEL = "ABC" ]; then<br />
mplayer $PARAMS &#8220;dvb://ABC TV Melbourne&#8221;<br />
. $0<br />
exit 0<br />
elif [ $CHANNEL = "ABC2" ]; then<br />
mplayer $PARAMS &#8220;dvb://ABC2&#8243;<br />
. $0<br />
exit 0<br />
elif [ $CHANNEL = "SBS" ]; then<br />
mplayer $PARAMS &#8220;dvb://SBS DIGITAL 1&#8243;<br />
. $0<br />
exit 0<br />
else<br />
exit 1<br />
fi</p>
]]></content:encoded>
			<wfw:commentRss>http://www.valton.com.au/archives/6/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Software Engineering Radio</title>
		<link>http://www.valton.com.au/archives/4</link>
		<comments>http://www.valton.com.au/archives/4#comments</comments>
		<pubDate>Sun, 11 Nov 2007 08:22:51 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[development]]></category>
		<category><![CDATA[engineering]]></category>

		<guid isPermaLink="false">http://localhost/?p=4</guid>
		<description><![CDATA[Recently discovered the following software engineering podcast (definitely worth a look): RSS feed: http://se-radio.net/rss Homepage: http://www.se-radio.net]]></description>
			<content:encoded><![CDATA[<p>Recently discovered the following software engineering podcast (definitely worth a look):</p>
<p>RSS feed: <a title="http://se-radio.net/rss" href="http://se-radio.net/rss">http://se-radio.net/rss</a><br />
Homepage: <a title="http://www.se-radio.net" href="http://www.se-radio.net/">http://www.se-radio.net</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.valton.com.au/archives/4/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
