<?xml version="1.0" encoding="utf-8"?>
			
			<rss version="2.0">
			<channel>
			<title>Lynch Consulting Blog - HOWTO</title>
			<link>http://www.lynchconsulting.com.au/blog/index.cfm</link>
			<description>A blog about ColdFusion, PHP, Flash, Flex, Web Standards and a mish mash of other technologies</description>
			<language>en-us</language>
			<pubDate>Tue, 07 Sep 2010 12:52:34 --1000</pubDate>
			<lastBuildDate>Mon, 10 May 2010 23:19:00 --1000</lastBuildDate>
			<generator>BlogCFC</generator>
			<docs>http://blogs.law.harvard.edu/tech/rss</docs>
			<managingEditor>mark@lynchconsulting.com.au</managingEditor>
			<webMaster>mark@lynchconsulting.com.au</webMaster>
			
			
			
			
			
			<item>
				<title>Howto find files newer than a specific date using command line</title>
				<link>http://www.lynchconsulting.com.au/blog/index.cfm/2010/5/10/Howto-find-files-newer-than-a-specific-date-using-command-line</link>
				<description>
				
				While doing some server admin tasks the other day I needed to find all the files newer than a certain date.  Using just the command line tools it was relatively simple but not obvious, so this is a not to self.

The find utility has an option to find a file newer than another file.  By creating and empty file with a specific creation date we can do the search:
&lt;code&gt;
touch timestamp -d 2010-01-01
&lt;/code&gt;

To show all files newer than 2010-01-01 use:
&lt;code&gt;
find . -newer timestamp 
&lt;/code&gt;

Or to create a tar archive of them use xargs like so:
&lt;code&gt;
find . -newer timestamp | xargs tar -rf /root/filesnewerthan-2010-01-01.tar
&lt;/code&gt;


Easy.
Mark
				
				</description>
				
				<category>HOWTO</category>
				
				<category>Linux</category>
				
				<category>Open Source</category>
				
				<category>Systems admin</category>
				
				<category>Ubuntu</category>
				
				<pubDate>Mon, 10 May 2010 23:19:00 --1000</pubDate>
				<guid>http://www.lynchconsulting.com.au/blog/index.cfm/2010/5/10/Howto-find-files-newer-than-a-specific-date-using-command-line</guid>
				
			</item>
			
		 	
			
			
			<item>
				<title>Flex 3 to Flex 4 Migration Howto</title>
				<link>http://www.lynchconsulting.com.au/blog/index.cfm/2010/3/22/Flex-3-to-Flex-4-Migration-Howto</link>
				<description>
				
				I recently completed migrating an application from Flex3 to Flex4, and for my own reference, here&apos;s how I did it.

Note - this was done with flexsdk-4.0.0.13875, which was the most recent stable build at the time.

&lt;h2&gt;Phase 1:  Get Flex3 code compiling with Flex4&lt;/h2&gt;

&lt;h3&gt;Fix up stylesheets:&lt;/h3&gt;

If you have a current Flex3 project and you are migrating to Flex4 you need to add the following lines at the top of your stylesheet.
&lt;code&gt;
@namespace &quot;library://ns.adobe.com/flex/mx&quot;;
@namespace s &quot;library://ns.adobe.com/flex/spark&quot;;
&lt;/code&gt;

This makes the default non-namespaced items in your stylesheet refer to the MX components. eg:
&lt;code&gt;
Button{fontSize:18;}
&lt;/code&gt;
And to style up spark buttons you simply use:
&lt;code&gt;
s|Button{fontSize:18;}
&lt;/code&gt;

&lt;h3&gt;To statically link or not?&lt;/h3&gt;

Flex 4 defaults to dynamically linking runtime shared libraries.  This produces smaller files, but if you are making desktop type applications or developing code while not connected to the internet you&apos;ll probably want to statically link the files.  Add this to your compiler option:
&lt;code&gt;
-static-link-runtime-shared-libraries=true
&lt;/code&gt;


You now should have a happily compiling app, however, to use all the new goodness of flex 4 there are still some more steps to be done.

&lt;h2&gt;Phase 2: Using all of flex 4&lt;/h2&gt;

&lt;h3&gt;Update namespace to 2009&lt;/h3&gt;

To update the namespace references for flex 4 I did the following search and replace:
&lt;code&gt;
Replace:
xmlns:mx=&quot;http://www.adobe.com/2006/mxml&quot;
With:
xmlns:fx=&quot;http://ns.adobe.com/mxml/2009&quot; xmlns:mx=&quot;library://ns.adobe.com/flex/mx&quot; xmlns:s=&quot;library://ns.adobe.com/flex/spark&quot;
&lt;/code&gt;

&lt;h3&gt;Replace mx with fx namespace&lt;/h3&gt;

&lt;code&gt;
&lt;mx:Script&gt;  and &lt;/mx:Script&gt;
becomes:
&lt;fx:Script&gt;  and &lt;/fx:Script&gt;
&lt;/code&gt;

Similarly for other tags like this:
&lt;code&gt;
&lt;mx:Binding&gt;  to &lt;fx:Binding&gt;
&lt;mx:Metadata&gt;  to &lt;fx:Metadata&gt;
&lt;/code&gt;

&lt;h3&gt;Add Declarations for non visual components&lt;/h3&gt;

Wrap &lt;fx:Declarations&gt; tag around non visual compoents.  The compiler will complain about all these errors so just follow through and wrap them in 
&lt;code&gt;
&lt;fx:Declarations&gt;&lt;/fx:Declarations&gt; 
&lt;/code&gt;
tags until all the errors go away.


&lt;h3&gt;Migrate States&lt;/h3&gt;
Finally, at least for the project I migrated, I needed to convert all the state tags to the new format of inline attributes.

This shows up as the following error:
&lt;code&gt;
Error: State overrides may no longer be explicitly declared. The legacy states syntax has been deprecated.
&lt;/code&gt;

So if you had something like this before:
&lt;code&gt;
&lt;mx:State name=&quot;loading&quot;&gt; 
 &lt;mx:AddChild relativeTo=&quot;{myBox}&quot;&gt; 
  &lt;mx:Text textAlign=&quot;center&quot; text=&quot;Loading...&quot; selectable=&quot;false&quot; /&gt; 
 &lt;/mx:AddChild&gt;           
... snip ...
&lt;mx:VBox id=&quot;myBox&quot;&gt;	
&lt;/mx:VBox&gt;
&lt;/code&gt;

It would now look something like this:

&lt;code&gt;
&lt;mx:State name=&quot;loading&quot;&gt; 
... snip ...
&lt;mx:VBox id=&quot;myBox&quot;&gt;	
 &lt;mx:Text textAlign=&quot;center&quot; text=&quot;Loading...&quot; selectable=&quot;false&quot; 
	visible=&quot;false&quot; includeInLayout=&quot;false&quot;
	visible.loading=&quot;true&quot; includeInLayout.loading=&quot;true&quot;
 /&gt; 
&lt;/mx:VBox&gt;
&lt;/code&gt;


&lt;h3&gt;Migrate StyleManager References&lt;/h3&gt;

Stylemanager is not called as a global class any more and you need to use fully qualified references so:
&lt;code&gt;
thisImage.source = StyleManager.getStyleDeclaration(&quot;Image&quot;).getStyle(&quot;brokenImageSkin&quot;);
&lt;/code&gt;
becomes:
&lt;code&gt;
thisImage.source = styleManager.getStyleDeclaration(&quot;mx.controls.Image&quot;).getStyle(&quot;brokenImageSkin&quot;);
&lt;/code&gt;


When these have all been converted, your application should compile.

Then you can start leveraging the new functionality of flex4 and begin  migrating your components to spark if necessary.
				
				</description>
				
				<category>Open Source</category>
				
				<category>HOWTO</category>
				
				<category>Flex</category>
				
				<category>AIR</category>
				
				<category>Actionscript</category>
				
				<pubDate>Mon, 22 Mar 2010 09:50:00 --1000</pubDate>
				<guid>http://www.lynchconsulting.com.au/blog/index.cfm/2010/3/22/Flex-3-to-Flex-4-Migration-Howto</guid>
				
			</item>
			
		 	
			
			
			<item>
				<title>FFMpeg conversion - wmv to flv HOWTO</title>
				<link>http://www.lynchconsulting.com.au/blog/index.cfm/2010/3/12/FFMpeg-conversion--wmv-to-flv-HOWTO</link>
				<description>
				
				More of a quick note to self about converting video formats:

To convert wmv to flash video:

&lt;code&gt;
ffmpeg -i input.wmv -ar 44100 -qmax 8 out.flv
&lt;/code&gt;

This does the following:
&lt;ul&gt;
&lt;li&gt;-i input.wmv - Load input file&lt;/li&gt;
&lt;li&gt;-ar 44100 - Resample audio to 44.1kHz.&lt;/li&gt;
&lt;li&gt;-qmax 8 magic voodoo about quality.  Gave better results than not using it.&lt;/li&gt;
&lt;li&gt;out.flv  save it as an flv.&lt;/li&gt;
&lt;/ul&gt;

Easy.
				
				</description>
				
				<category>HOWTO</category>
				
				<pubDate>Fri, 12 Mar 2010 15:34:00 --1000</pubDate>
				<guid>http://www.lynchconsulting.com.au/blog/index.cfm/2010/3/12/FFMpeg-conversion--wmv-to-flv-HOWTO</guid>
				
			</item>
			
		 	
			
			
			<item>
				<title>Split first name and last name with Openoffice/Excel</title>
				<link>http://www.lynchconsulting.com.au/blog/index.cfm/2010/2/23/Split-first-name-and-last-name-with-OpenofficeExcel</link>
				<description>
				
				I&apos;ve been dealing with a lot of spreadsheets of usernames recently and sometimes you get firstname and lastname in seperate columns, and sometimes in the same column.

If you get them in the same column but need them in two columns here are two little formulae to do it:

&lt;code&gt;
FullName | FirstName   | Lastname    | 
Mark Lynch | =MID(A2,1,FIND(&quot; &quot;,A2,1)) | =MID(A2,FIND(&quot; &quot;,A2,1)+1,100) |
&lt;/code&gt;
Which will look like:
&lt;code&gt;
FullName   | FirstName  | Lastname | 
Mark Lynch | Mark       | Lynch    |
&lt;/code&gt;
This basically seperates the string on the space between the names and puts it into each column

Cheers,
Mark
				
				</description>
				
				<category>HOWTO</category>
				
				<category>General</category>
				
				<pubDate>Tue, 23 Feb 2010 21:21:00 --1000</pubDate>
				<guid>http://www.lynchconsulting.com.au/blog/index.cfm/2010/2/23/Split-first-name-and-last-name-with-OpenofficeExcel</guid>
				
			</item>
			
		 	
			
			
			<item>
				<title>Jmeter over SSH Socks proxy</title>
				<link>http://www.lynchconsulting.com.au/blog/index.cfm/2010/1/7/Jmeter-over-SSH-Socks-proxy</link>
				<description>
				
				I&apos;ve been doing some testing recently where I need to connect via SSH server to a remote network to run some load testing.

To do this I used a &lt;a href=&quot;http://www.lynchconsulting.com.au/blog/index.cfm/2009/7/1/SSH-SOCK-Proxying-and-preventing-it&quot;&gt;SSH sock proxy like I have previously blogged about&lt;/a&gt;.

So I fired this up so that I could review the site I wanted to look at.  It worked a charm through firefox but there is no where to set up the proxy in jmeter.

To make it work you need to let the JVM know what proxy to use like so:
&lt;code&gt;
java -DsocksProxyHost=localhost -DsocksProxyPort=8080 -jar ApacheJMeter.jar 
&lt;/code&gt;

No jmeter will use the socks proxy on port 8080 on my local machine.  Nice.
				
				</description>
				
				<category>Software Architecture</category>
				
				<category>Open Source</category>
				
				<category>Linux</category>
				
				<category>HOWTO</category>
				
				<category>General</category>
				
				<pubDate>Thu, 07 Jan 2010 10:25:00 --1000</pubDate>
				<guid>http://www.lynchconsulting.com.au/blog/index.cfm/2010/1/7/Jmeter-over-SSH-Socks-proxy</guid>
				
			</item>
			
		 	
			
			
			<item>
				<title>Windows File Sharing (SMB/CIFS/Samba) over SSH</title>
				<link>http://www.lynchconsulting.com.au/blog/index.cfm/2009/11/14/Windows-File-Sharing-SMBCIFSSamba-over-SSH</link>
				<description>
				
				While working with a client recently setting up a Netgear VPN so he could securely access his internal file server.   The VPN setup was straightforward but every time the VPN client connected to the VPN server the VPN server/firewall would crash - leaving no connectivity.

In order to come up with a reliable solution to this we decided to use the SSH server we had available and tunnel the windows sharing across the local port forwards, much simpler and more reliable.


Thanks to &lt;a href=&quot;http://www.blisstonia.com/eolson/notes/smboverssh.php&quot;&gt;this article&lt;/a&gt; it was a breeze to set up.

Steps are as follows:
&lt;ul&gt;
&lt;li&gt;Create loopback adapter on windows&lt;/li&gt;
&lt;li&gt;Configure loopback adapter on windows&lt;/li&gt;
&lt;li&gt;Reboot&lt;/li&gt;
&lt;li&gt;Configure SSH connection&lt;/li&gt;
&lt;li&gt;Test it all out&lt;/li&gt;
&lt;/ul&gt;


&lt;h3&gt;Create loopback adapter on windows&lt;/h3&gt;


We&apos;ll give your computer an additional (fake) IP address, and we&apos;ll port forward to that address instead of the computer&apos;s real IP. Windows XP will continue to do file sharing on the real IP address. We&apos;ll assign it an IP of 10.0.0.1 (that&apos;s what we configured putty to use above.)

&lt;ol&gt;

&lt;li&gt;System-&gt;Control Panel-&gt;Add Hardware&lt;/li&gt;
&lt;li&gt;Yes, Hardware is already connected&lt;/li&gt;
&lt;li&gt;Add a new hardware device (at bottom of list)&lt;/li&gt;
&lt;li&gt;Install the hardware that I manually select&lt;/li&gt;
&lt;li&gt;Network adapters&lt;/li&gt;
&lt;li&gt;Microsoft , Microsoft Loopback Adapter&lt;/li&gt;
&lt;li&gt;(Go through the installation procedure.)&lt;/li&gt;
&lt;/ol&gt;



&lt;h3&gt;Configure loopback adapter on windows&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Open your new fake ethernet adapter (Network Connections) , enter a made-up IP address (I suggest 10.0.0.1, which is a privately routable address that most folk don&apos;t use.)&lt;/li&gt;
&lt;li&gt;Enable Client for Microsoft Networks.&lt;/li&gt;
&lt;li&gt;Disable File and Printer Sharing for Microsoft Networks&lt;/li&gt;
&lt;li&gt;Enable Interent Protocol (TCP/IP)&lt;/li&gt;
&lt;li&gt;Click on properties for TCP/IP.&lt;/li&gt;
&lt;li&gt;Enter your chosen IP address (10.0.0.1), subnet mask (255.255.255.0).  You can leave gateway blank.&lt;/li&gt;
&lt;li&gt;Under advanced-&gt;WINS, Enable LMHosts Lookup and Disable NetBIOS over TCP/IP&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;Reboot&lt;/h3&gt;
In order to make it all work now it he appropriate time to reboot so windows initialises everything correctly.

&lt;h3&gt;Configure SSH connection&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Download Putty&lt;/li&gt;
&lt;li&gt;Enter IP address&lt;/li&gt;
&lt;li&gt;Enter Auth Key (if using SSH keys)&lt;/li&gt;
&lt;li&gt;Enter Port forwards for: (these connect the ports on you local machine to 
&lt;ul&gt;
&lt;li&gt;10.0.0.1:137 to 127.0.0.1:137&lt;/li&gt;
&lt;li&gt;10.0.0.1:138 to 127.0.0.1:138&lt;/li&gt;
&lt;li&gt;10.0.0.1:139 to 127.0.0.1:139&lt;/li&gt;
&lt;li&gt;10.0.0.1:445 to 127.0.0.1:445&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Save the config.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;Test it all out&lt;/h3&gt;
Now to connect you need to do the following steps:

&lt;ul&gt;
&lt;li&gt;Open putty, load the settings and connect.&lt;/li&gt;
&lt;li&gt;Open Exporer and type in:  \\10.0.0.1\&lt;/li&gt;
&lt;/ul&gt;

You should now be connected to your remote windows system over a secure encrypted tunnel.

Cheers,
Mark
				
				</description>
				
				<category>Windows</category>
				
				<category>Systems admin</category>
				
				<category>Linux</category>
				
				<category>HOWTO</category>
				
				<pubDate>Sat, 14 Nov 2009 13:35:00 --1000</pubDate>
				<guid>http://www.lynchconsulting.com.au/blog/index.cfm/2009/11/14/Windows-File-Sharing-SMBCIFSSamba-over-SSH</guid>
				
			</item>
			
		 	
			
			
			<item>
				<title>Two quick server tips</title>
				<link>http://www.lynchconsulting.com.au/blog/index.cfm/2009/8/15/Two-quick-server-tips</link>
				<description>
				
				Here are two quick tips that I&apos;ve recently found for server admins:

&lt;ul&gt;
&lt;li&gt;Automatically fixing file system errors&lt;/li&gt;
&lt;li&gt;Ignoring directories from updatedb&lt;/li&gt;
&lt;/ul&gt;


&lt;h3&gt;&lt;a name=&quot;auto&quot;&gt;&lt;/a&gt;Automatically fixing file system errors&lt;/h3&gt;

If you have a remote server, i.e. at a data center 10km or 1000km away this should prevent some panic when rebooting the server remotely.

Ext2/3 will do a filesystem check after a certain number of reboots or time.  Most of the time any errors are fixed automatically, but certain errors by default require the root shell and the administrator to fix them.  I&apos;ve seen a few of these happen, but I have always replied yes to the prompts as I don&apos;t know enough about file systems to fix it I said no.

So, to prevent the need to rush to a data center and plug in a keyboard and mouse just to press the &quot;Y&quot; key there is and option to automatically assume yes.

On Ubuntu in the file /etc/default/rcS you need to change the following:
&lt;code&gt;
FSCKFIX=no
to 
FSCKFIX=yes
&lt;/code&gt;


&lt;h3&gt;&lt;a name=&quot;ignore&quot;&gt;&lt;/a&gt;Ignoring directories from updatedb&lt;/h3&gt;
If you have a backup server you may not want it to update the locate db for all your backup files, as it can take a very long time.

To tell locate to ignore a directory you need to add it to the PRUNEPATHS line in the /etc/updatedb.conf file like so:

&lt;code&gt;
PRUNE_BIND_MOUNTS=&quot;yes&quot;
PRUNEPATHS=&quot;/tmp /var/spool /media /srv&quot;
PRUNEFS=&quot;NFS nfs nfs4 afs binfmt_misc proc smbfs autofs iso9660 ncpfs coda devpts ftpfs devfs mfs shfs sysfs cifs lustre_lite tmpfs usbfs udf rpc_pipefs&quot;
&lt;/code&gt;

In the above code I have added the &lt;b&gt;/srv&lt;/b&gt; entry to make it ignore all my backups which are held under the /srv directory.

Note: These tips were tested on Ubuntu linux, other distributions will have similar functionality but the file locations may vary.

Cheers,
Mark
				
				</description>
				
				<category>Ubuntu</category>
				
				<category>Systems admin</category>
				
				<category>Open Source</category>
				
				<category>Linux</category>
				
				<category>HOWTO</category>
				
				<category>General</category>
				
				<pubDate>Sat, 15 Aug 2009 08:12:00 --1000</pubDate>
				<guid>http://www.lynchconsulting.com.au/blog/index.cfm/2009/8/15/Two-quick-server-tips</guid>
				
			</item>
			
		 	
			
			
			<item>
				<title>Installing Railo on Tomcat via Apache on Leopard - Step by Step</title>
				<link>http://www.lynchconsulting.com.au/blog/index.cfm/2009/3/27/Installing-Railo-on-Tomcat-via-Apache-on-Leopard--Step-by-Step</link>
				<description>
				
				After a bit of fiddling and head scratching I managed to install Railo on Tomcat via Apache on my laptop running on OS X 10.5.6.
&lt;h2&gt;Tomcat&lt;/h2&gt;
Firstly, download &lt;a href=&quot;http://tomcat.apache.org/download-60.cgi&quot;&gt;Tomcat 6&lt;/a&gt;

extract content:
&lt;code&gt;
tar xvzf apache-tomcat-6.0.18.tar.gz
&lt;/code&gt;

Move Tomcat to a more secure place:
&lt;code&gt;
sudo mv apache-tomcat-6.0.18 /usr/local/tomcat
&lt;/code&gt;

&lt;h2&gt;Railo&lt;/h2&gt;
Download &lt;a href=&quot;http://www.railo-technologies.com/down.cfm?item=/railo/remote/download/3.0.2.001/custom/all/railo-3.0.2.001-jars.tar.gz&quot;&gt;Railo custom version&lt;/a&gt;

extract and move into Tomcat lib directory:
&lt;code&gt;
tar zxvf railo-3.0.2.001-jars.tar.gz
sudo mv railo-3.0.2.001-jars/* /usr/local/tomcat/lib
&lt;/code&gt;

Make Tomcat and Railo work together by modifying the web config file:
&lt;code&gt;
sudo nano /usr/local/tomcat/conf/web.xml
&lt;/code&gt;

add the following inside the &amp;lt;web-app&amp;gt; element:
&lt;code&gt;
&lt;servlet&gt;
&lt;servlet-name&gt;CFMLServlet&lt;/servlet-name&gt;
&lt;servlet-class&gt;railo.loader.servlet.CFMLServlet&lt;/servlet-class&gt;
   &lt;init-param&gt;
      &lt;param-name&gt;configuration&lt;/param-name&gt;
      &lt;param-value&gt;{web-root-directory}/WEB-INF/railo/&lt;/param-value&gt;
      &lt;description&gt;Configuraton directory&lt;/description&gt;
   &lt;/init-param&gt;
   &lt;load-on-startup&gt;1&lt;/load-on-startup&gt;
&lt;/servlet&gt;
&lt;servlet-mapping&gt;
   &lt;servlet-name&gt;CFMLServlet&lt;/servlet-name&gt;
   &lt;url-pattern&gt;*.cfm&lt;/url-pattern&gt;
&lt;/servlet-mapping&gt;
&lt;servlet-mapping&gt;
   &lt;servlet-name&gt;CFMLServlet&lt;/servlet-name&gt;
   &lt;url-pattern&gt;*.cfml&lt;/url-pattern&gt;
&lt;/servlet-mapping&gt;
&lt;servlet-mapping&gt;
   &lt;servlet-name&gt;CFMLServlet&lt;/servlet-name&gt;
   &lt;url-pattern&gt;*.cfc&lt;/url-pattern&gt;
&lt;/servlet-mapping&gt;
&lt;/code&gt;

add the following inside &amp;lt;welcome-file-list&amp;gt; element:
&lt;code&gt;
&lt;welcome-file&gt;index.cfm&lt;/welcome-file&gt;
&lt;welcome-file&gt;index.cfml&lt;/welcome-file&gt;
&lt;/code&gt;

&lt;h2&gt;Apache&lt;/h2&gt;
Leopard OS comes with Apache 2, so you don&apos;t have to worry about installing it.  However, you need to download &lt;a href=&quot;http://tomcat.apache.org/connectors-doc/&quot;&gt;The Apache Tomcat Connector&lt;/a&gt; source code.

Next you need to compile the source so that the resulting binary file is compatible with your Intel Mac architecture.  I got this from &lt;a href=&quot;http://blog.lo-fi.net/2007/10/leopard-for-web-developer-installing.html&quot;&gt;Eric Rank&apos;s blog&lt;/a&gt;

cd into tomcat source:
&lt;code&gt;
cd tomcat-connectors-1.2.27-src/native
&lt;/code&gt;

Edit the apache-2.0/Makefile.apxs.in file.

Replace
&lt;code&gt;
mod_jk.la:
 $(APXS)  -c -o $@ -Wc,&quot;${APXSCFLAGS} ${JK_INCL}&quot; &quot;${JAVA_INCL}&quot; &quot;${APXSLDFLAGS}&quot; mod_jk.c ${APACHE_OBJECTS}
&lt;/code&gt;

with:

&lt;code&gt;
mod_jk.la:
 $(APXS) -c -o $@ -Wc,&quot;${APXSCFLAGS} -arch x86_64 ${JK_INCL}&quot; &quot;${JAVA_INCL}&quot; &quot;${APXSLDFLAGS} -arch x86_64 &quot; mod_jk.c ${APACHE_OBJECTS}
&lt;/code&gt;

configure the build files:
&lt;code&gt;
./configure --with-apxs=/usr/sbin/apxs
&lt;/code&gt;

now go into apache-2.0 directory and build:
&lt;code&gt;
cd apache-2.0
make -f Makefile.apxs
&lt;/code&gt;

Finally install
&lt;code&gt;
sudo make install
&lt;/code&gt;

Now specify the connection between Apache and Tomcat.  To do this you need to create workers.properties file.  I created mine in /etc/apache2.
&lt;code&gt;
sudo nano /etc/apache2/workers.properties
&lt;/code&gt;

Paste the following:
&lt;code&gt;
worker.list=default

worker.default.port=8009
worker.default.host=localhost
worker.default.type=ajp13
worker.default.lbfactor=1
&lt;/code&gt;

Now we need to modify the Apache httpd.conf file:
&lt;code&gt;
sudo nano /etc/apache2/httpd.conf
&lt;/code&gt;

Enable The Apache Tomcat Connector:
&lt;code&gt;
LoadModule jk_module    libexec/apache2/mod_jk.so
&lt;/code&gt;

Underneath that tell Apache where your workers.properties file is located and add some logging info (could be useful):
&lt;code&gt;
# Mod_jk settings                                            
JkWorkersFile /etc/apache2/workers.properties
JkLogFile /var/log/apache2/mod_jk.log
JkLogLevel debug
DirectoryIndex index.html index.htm index.cfm index.cfml
&lt;/code&gt;

&lt;h2&gt;Back to Tomcat&lt;/h2&gt;
To test our Railo installation, let&apos;s create a test site by adding a new virtual host in both Tomcat and Apache.  We do this by modifying Tomcat server.xml file (/usr/local/tomcat/conf/server.xml )
&lt;code&gt;
&lt;Host name=&quot;railo.local&quot; appBase=&quot;webapps&quot;&gt;
    &lt;Context path=&quot;&quot; docBase=&quot;/Library/Webserver/Documents&quot;/&gt;
&lt;/Host&gt;
&lt;/code&gt; 

&lt;h2&gt;Apache&lt;/h2&gt;
Now we need to create a virtual host entry in Apache as well:
&lt;code&gt;
&lt;VirtualHost *:80&gt;
        JkMount /*.cfm default
        ServerName railo.local
        DirectoryIndex index.cfm
&lt;/VirtualHost&gt;
&lt;/code&gt;

&lt;code&gt;
JkMount /*.cfm default
&lt;/code&gt;
Tells mod_jk to use the connector specified in your workers.properties file when it encounters a .cfm extension.

&lt;h2&gt;Important&lt;/h2&gt;
Notice that in my Apache VirtualHost entry there is no DocumentRoot.  I originally had it in there and it was breaking my Apache-Tomcat connection.  It was driving me mad.  It&apos;s probably because document root is already specified in /usr/local/tomcat/conf/server.xml.

One last thing, to start your Tomcat server type in this command:
&lt;code&gt;
/usr/local/tomcat/bin/startup.sh 
&lt;/code&gt;

shut down

&lt;code&gt;
/usr/local/tomcat/bin/shutdown.sh
&lt;/code&gt;

My assumption is that the above steps would be very similar on other operating systems as long as you use the correct file paths.

Good luck :-)

Marko
				
				</description>
				
				<category>Systems admin</category>
				
				<category>Railo</category>
				
				<category>Mac OSX</category>
				
				<category>HOWTO</category>
				
				<pubDate>Fri, 27 Mar 2009 14:45:00 --1000</pubDate>
				<guid>http://www.lynchconsulting.com.au/blog/index.cfm/2009/3/27/Installing-Railo-on-Tomcat-via-Apache-on-Leopard--Step-by-Step</guid>
				
			</item>
			
		 	
			
			
			<item>
				<title>GZIP encoding in Adobe AIR/Flex - HOWTO</title>
				<link>http://www.lynchconsulting.com.au/blog/index.cfm/2009/3/6/GZIP-encoding-in-Adobe-AIRFlex-HOWTO</link>
				<description>
				
				If you use HTTPService component in Flex or AIR to retrieve data from a server, you might want to consider gzipping the response.  This can significantly reduce the packet size you get from the server, which results in a much better application performance.

This means that response packet is compressed by Apache web server and your client will need to decompress it.  Fortunately, both Flex and AIR 1.5.1 natively support GZIP compression.  However there are a couple of things you need to watch out for.

Firstly, you need to enable &lt;a href=&quot;http://httpd.apache.org/docs/2.0/mod/mod_deflate.html&quot;&gt;Apache Module mod_deflate&lt;/a&gt; in your virtual host.

In your AIR application, you need to tell HTTPService component to accept gzip encoding and AIR will take care of the rest:
&lt;code&gt;
&lt;mx:HTTPService id=&quot;service&quot; resultFormat=&quot;e4x&quot; /&gt;
this.service.headers = {&apos;Accept-Encoding&apos;:&apos;gzip&apos;};
&lt;/code&gt;

If you are in a Flex project, specifying gzip encoding will throw the following error:
&lt;code&gt;
ArgumentError: Error #2096: The HTTP request header Accept-Encoding cannot be set via ActionScript.
&lt;/code&gt;

This is because Flex apps run in a browser and the browser is responsible for determining encoding type and decompression (if required).  Therefore, you cannot specify encoding type in Flex apps.

Our problem is that we use one core library for AIR and Flex applications.  So the issue above can be avoided by conditionally specifying encoding type depending on the framework used.  This can be done in 2 lines of code:
&lt;code&gt;
if(Capabilities.playerType == &quot;Desktop&quot;)
   this.service.headers = {&apos;Accept-Encoding&apos;:&apos;gzip&apos;};
&lt;/code&gt;

&lt;p&gt;&lt;strong&gt;Note: this is not the complete solution - &lt;a href=&quot;http://www.lynchconsulting.com.au/blog/index.cfm/2009/3/19/More-of-AIR-Gzip-compression&quot;&gt;check out this entry for the rest of it&lt;/a&gt; :-)&lt;/strong&gt;&lt;/p&gt;

Cheers
Marko
				
				</description>
				
				<category>HOWTO</category>
				
				<category>Flex</category>
				
				<category>AIR</category>
				
				<category>Actionscript</category>
				
				<pubDate>Fri, 06 Mar 2009 12:27:00 --1000</pubDate>
				<guid>http://www.lynchconsulting.com.au/blog/index.cfm/2009/3/6/GZIP-encoding-in-Adobe-AIRFlex-HOWTO</guid>
				
			</item>
			
		 	
			
			
			<item>
				<title>HOWTO generate diff files from subversion</title>
				<link>http://www.lynchconsulting.com.au/blog/index.cfm/2009/3/3/HOWTO-generate-diff-files-from-subversion</link>
				<description>
				
				Here&apos;s a nice and quick way to generate a diff file from subversion and store it on your local machine. 

&lt;code&gt;
svn diff filepath/myFile.ext &gt; saveDirPath/myFile.ext.diff
&lt;/code&gt;

Where filePath is the local path to your working directory in which your file is located.  And saveDirPath is the path where you want to save your diff file.

Diff files can be very useful when contributing to open source projects.

You can also get a &lt;a href=&quot;http://www.lynchconsulting.com.au/blog/index.cfm/2009/1/16/SVN--Get-list-of-files-changed-between-revisions&quot;&gt;list of files changed between revisions&lt;/a&gt;.

Marko
				
				</description>
				
				<category>HOWTO</category>
				
				<category>General</category>
				
				<category>Open Source</category>
				
				<category>Systems admin</category>
				
				<pubDate>Tue, 03 Mar 2009 11:46:00 --1000</pubDate>
				<guid>http://www.lynchconsulting.com.au/blog/index.cfm/2009/3/3/HOWTO-generate-diff-files-from-subversion</guid>
				
			</item>
			
		 	
			
			
			<item>
				<title>Non-case sensitive filesystem on Linux - HOWTO</title>
				<link>http://www.lynchconsulting.com.au/blog/index.cfm/2009/2/2/Noncase-sensitive-filesystem-on-Linux--HOWTO</link>
				<description>
				
				I was setting up a ColdFusion web application on my dev machine and ran into lots of errors because of the case sensitivity of Linux (which i was using) versus the non-case sensitivity of windows (where the application was developed).

I had a quick look to see if I could fix it up but quickly figured out that there were too many occurrences and so it was likely not worth fixing up at this point.  To that end I set up a loopback vfat filesystem so that I could have a directory on my machine mounted as non-case sensitive. 

Note: this is not recommended for production systems - but is a handy fix for a temporary development problem.

&lt;h3&gt;Create a virtual disk&lt;/h3&gt;
&lt;code&gt;
dd if=/dev/zero of=virtual.dsk bs=1048576 count=150
&lt;/code&gt;
&lt;h3&gt;Format it&lt;/h3&gt;
&lt;code&gt;
mkfs.vfat virtual.dsk
&lt;/code&gt;
&lt;h3&gt;Mount it&lt;/h3&gt;

&lt;code&gt;
sudo mkdir /mnt/vfat
sudo mount virtual.dsk /mnt/vfat -t vfat -o loop,owner,group,umask=000
&lt;/code&gt;

You can set this up to mount every time by putting the following line in your /etc/fstab

&lt;code&gt;
/path/to/virtual.dsk /mnt/vfat  vfat  loop,owner,group,umask=000  0 0
&lt;/code&gt;

Note - the same trick works on OSX in reverse.  I.e. if you are developing on a mac, but deploying to a linux production environment you can create a virtual disk with a case-sensitive filename, which will mean that any case sensitive issues get picked up on your dev machine, and not on your production/staging machines.

Cheers,
Mark
				
				</description>
				
				<category>ColdFusion</category>
				
				<category>HOWTO</category>
				
				<category>Linux</category>
				
				<category>Systems admin</category>
				
				<pubDate>Mon, 02 Feb 2009 20:58:00 --1000</pubDate>
				<guid>http://www.lynchconsulting.com.au/blog/index.cfm/2009/2/2/Noncase-sensitive-filesystem-on-Linux--HOWTO</guid>
				
			</item>
			
		 	
			
			
			<item>
				<title>SVN - Get list of files changed between revisions</title>
				<link>http://www.lynchconsulting.com.au/blog/index.cfm/2009/1/16/SVN--Get-list-of-files-changed-between-revisions</link>
				<description>
				
				For my own reference, here is how to get the list of files that have changed between any two subversion revisions.

&lt;code&gt;
svn diff --summarize -r5:10 http://svn.example.com/trunk
&lt;/code&gt;

This will give something like:

&lt;code&gt;
A      http://svn.example.com/trunk/file1.txt
A      http://svn.example.com/trunk/file2.txt
M      http://svn.example.com/trunk/file3.txt
&lt;/code&gt;

If you want to get the revisions from a revision to the latest then you can change the 10 to HEAD - eg:

&lt;code&gt;
svn diff --summarize -r5:HEAD http://svn.example.com/trunk
&lt;/code&gt;

Cheers,
Mark
				
				</description>
				
				<category>Systems admin</category>
				
				<category>Open Source</category>
				
				<category>HOWTO</category>
				
				<category>General</category>
				
				<pubDate>Fri, 16 Jan 2009 13:18:00 --1000</pubDate>
				<guid>http://www.lynchconsulting.com.au/blog/index.cfm/2009/1/16/SVN--Get-list-of-files-changed-between-revisions</guid>
				
			</item>
			
		 	
			
			
			<item>
				<title>Load Testing Asterisk Applications - HOWTO</title>
				<link>http://www.lynchconsulting.com.au/blog/index.cfm/2009/1/6/Load-Testing-Asterisk-Applications--HOWTO</link>
				<description>
				
				I&apos;ve been working on Load Testing some of our asterisk applications and thought I&apos;d document the process here so I can find it when I need to do it again.

There is a bit of setup to be done but when you get the whole picture is it&apos;s actually very easy.  To do it you need at least 2 asterisk boxes - the one you are load testing (lets call it &apos;stressbox&apos; for this example) and a another one to drive load to it which we&apos;ll call &apos;driver&apos;.


We need to do the following steps:
&lt;ul&gt;
&lt;li&gt;Create an sip account on stressbox for driver to connect to&lt;/li&gt;
&lt;li&gt;Register the account from the driver machine&lt;/li&gt;
&lt;li&gt;Create a dial plan which simulates a call&lt;/li&gt;
&lt;li&gt;Create a call file for the call&lt;/li&gt;
&lt;li&gt;Start you system monitoring&lt;/li&gt;
&lt;li&gt;Create lots of call files&lt;/li&gt;
&lt;/ul&gt;

So here is the step by step:

&lt;h3&gt;Create an sip account on stressbox for driver to connect to&lt;/h3&gt;

In the sip.conf file on stressbox (the one we are testing) add the following:
&lt;code&gt;
[loadtest]
type=friend
username=loadtest                                     
secret=1111
context=test
host=dynamic
&lt;/code&gt;
Do a &apos;sip reload&apos; in the asterisk console to register this change.

&lt;h3&gt;Register the account from the driver machine&lt;/h3&gt;
Then to register the account from the driver machine add the following to sip.conf on driver:
&lt;code&gt;
register =&gt; loadtest:1111@xxx.xxx.xxx.xxx
&lt;/code&gt;
Where xxx.xxx.xxx.xxx is the ip address of the stressbox server.

Your driver machine should now be able to make calls to the stressbox machine and you should see a line that looks like this if you were watching the console:
&lt;code&gt;
-- Registered SIP &apos;loadtest&apos; at yyy.yyy.yyy.yyy port 9350 expires 120
&lt;/code&gt;


&lt;h3&gt;Create a dial plan which simulates a call&lt;/h3&gt;
Then on the driver machine we need to create a dial plan which simulates the call we want to do and place it in extensions.conf.  Here&apos;s an example dial plan:

&lt;code&gt;
[dialplan-loadtest1]
exten =&gt; s,1,Answer
;wait for welcome to play
exten =&gt; s,n,Wait(10)
;enter username
exten =&gt; s,n,SendDTMF(1234)
exten =&gt; s,n,Wait(4)
;enter password
exten =&gt; s,n,SendDTMF(0000)
;listen to menu
exten =&gt; s,n,Wait(10)
;select menu option 1
exten =&gt; s,n,SendDTMF(1)
exten =&gt; s,n,Wait(3)
;select menu option 2
exten =&gt; s,n,SendDTMF(2)
exten =&gt; s,n,Wait(4)

;Play some audio
exten =&gt; s,n,Playback(sampleaudio1)
;Hangup
exten =&gt; s,n,Hangup
&lt;/code&gt;
This example does a login to a phone system and then selects some options and plays some audio and hangs up.  The dial plan can be as simple or as complex as you like.

&lt;h3&gt;Create a call file for the call&lt;/h3&gt;
Last config step is to create a call file which will tell asterisk on driver to call asterisk on stressbox.  Create a file test.call with the following:
&lt;code&gt;
Channel: SIP/6@xxx.xxx.xxx.xxx
MaxRetries: 1
RetryTime: 5
WaitTime: 10
Context: dialplan-loadtest1
Extension: s
Priority: 1
&lt;/code&gt;

A bit of explanation of these lines:
&lt;strong&gt;Channel: SIP/6@xxx.xxx.xxx.xxx&lt;/strong&gt; - the 6 is the extension to dial on the stressbox server - change as necessary.  The ip adress should be the stressbox one.
&lt;strong&gt;Context: dialplan-loadtest1&lt;/strong&gt; - this is the dial plan that will be run for this call.

&lt;h3&gt;Start you system monitoring&lt;/h3&gt;
If you are going to do some load testing then you probably want to monitor the load on the machine - it is recommended to record the load of all machines involved - i.e. stressbox and driver to ensure that driver is not the bottleneck in the load test.

For this I use a vmstat on linux via a little script I wrote which makes it &lt;a href=&quot;http://www.lynchconsulting.com.au/blog/index.cfm/2008/12/1/Remote-collection-of-vmstat-log-files&quot;&gt;easy to collect stats from multiple machines&lt;/a&gt;

It would be used as follows:
&lt;code&gt;
./multivmstat stressbox,driver 5
&lt;/code&gt;
This will connect via ssh to each box and run vmstat on them every five seconds.  This can be graphed later - I&apos;ll post the scripts for this shortly.



&lt;h3&gt;Create lots of call files&lt;/h3&gt;

You are not ready to test you system.  To do this you need to create copies the test.call file and move them into /var/spool/asterisk/outgoing on the driver machine.

I use a little script to do this:

&lt;code&gt;
#!/bin/sh
#usage: makecalls callfile count delaybetween

callfile=$1
count=$2
delaybetween=$3

callnumber=0
asteriskcalldir=/var/spool/asterisk/outgoing/
asteriskuser=asterisk

echo &quot;Using $callfile for $count iterations with a $delaybetween second delay&quot;

while [ $callnumber -lt $count ];
do
	callnumber=`expr $callnumber + 1`
	echo &quot;Call Number: $callnumber&quot;
	cp $callfile $callfile.tmp
	chown $asteriskuser:$asteriskuser $callfile.tmp
	mv $callfile.tmp $asteriskcalldir
	sleep $delaybetween
done
&lt;/code&gt;

This is used as follows:
&lt;code&gt;
sudo ./makecalls test.call 5 2
&lt;/code&gt;

This will make 5 calls with a 2 second delay between the start of each call.  

Note: It needs to be run as sudo so it can change the ownership correctly.

Credits: Thanks to &lt;a href=&quot;http://www.stuartelvish.com/&quot;&gt;Stuart Elvish&lt;/a&gt; for his help with getting this working so nicely.

Happy load testing.
Cheers,
Mark
				
				</description>
				
				<category>Ubuntu</category>
				
				<category>Systems admin</category>
				
				<category>Open Source</category>
				
				<category>Linux</category>
				
				<category>Learnosity</category>
				
				<category>HOWTO</category>
				
				<category>Asterisk</category>
				
				<pubDate>Tue, 06 Jan 2009 14:00:00 --1000</pubDate>
				<guid>http://www.lynchconsulting.com.au/blog/index.cfm/2009/1/6/Load-Testing-Asterisk-Applications--HOWTO</guid>
				
			</item>
			
		 	
			
			
			<item>
				<title>Ubuntu Server upgrade howto</title>
				<link>http://www.lynchconsulting.com.au/blog/index.cfm/2008/11/16/Ubuntu-Server-upgrade-howto</link>
				<description>
				
				One of the nice things about Ubuntu is how easy it makes it to upgrade between versions - typically start up update-manager and it will prompt you if there is a new version available and handle all the details of the upgrade for you.  I&apos;ve done numerous upgrades this way and never had any issues.

However, I have a number of ubuntu servers which I manage and previously I have upgraded them by changing the /etc/apt/sources.list and then running &quot;sudo apt-get dist-upgrade&quot;

Today &lt;a href=&quot;http://ubuntu-tutorials.com/2007/10/20/how-to-upgrade-ubuntu-704-to-ubuntu-710-on-ubuntu-server/&quot;&gt;I discovered that there is an automated script to handle&lt;/a&gt; it - which I presume is what powers the gui version behind the scenes.

You need to make sure you have update-manager-core installed:

&lt;code&gt;
sudo apt-get install update-manager-core
&lt;/code&gt;

Then you simply run do-release-upgrade

&lt;code&gt;
sudo do-release-upgrade
&lt;/code&gt;

I&apos;ve just upgraded two different servers from Feisty as it has recently stopped being supported.  I upgraded them to Gutsy and then to Hardy which is a Long Term Supported version.  The whole process took about an hour of which it took about 5 minutes of my attention to answer a few simple questions.

Who said Linux is hard :-)
Cheers,
Mark
				
				</description>
				
				<category>Ubuntu</category>
				
				<category>Systems admin</category>
				
				<category>Open Source</category>
				
				<category>Linux</category>
				
				<category>HOWTO</category>
				
				<pubDate>Sun, 16 Nov 2008 19:53:00 --1000</pubDate>
				<guid>http://www.lynchconsulting.com.au/blog/index.cfm/2008/11/16/Ubuntu-Server-upgrade-howto</guid>
				
			</item>
			
		 	
			
			
			<item>
				<title>Howto refresh /dev/disk/by-uuid on Ubuntu</title>
				<link>http://www.lynchconsulting.com.au/blog/index.cfm/2008/8/16/Howto-refresh-devdiskbyuuid-on-Ubuntu</link>
				<description>
				
				I was recently setting up a Ubuntu server and was partitioning it after it had been installed.

There was lots of free space on the drives as the root partition was only using a small portion of the disk.  After running fdisk to partition it and mkfs.ext3 on the partitions to format them I couldn&apos;t see them in /dev/disk/by-uuid.

A quick google presented the solution:
&lt;code&gt;
sudo udevtrigger
&lt;/code&gt;

According to the man page this makes udev request the kernel device uevents, which in essence makes it read the disk info again and show it all up so you can mount it happily.

Cheers,
Mark
				
				</description>
				
				<category>HOWTO</category>
				
				<category>Linux</category>
				
				<category>Open Source</category>
				
				<category>Ubuntu</category>
				
				<pubDate>Sat, 16 Aug 2008 09:08:00 --1000</pubDate>
				<guid>http://www.lynchconsulting.com.au/blog/index.cfm/2008/8/16/Howto-refresh-devdiskbyuuid-on-Ubuntu</guid>
				
			</item>
			
		 	
			</channel></rss>