<?xml version="1.0" encoding="utf-8"?>
			
			<rss version="2.0">
			<channel>
			<title>Lynch Consulting Blog - Ubuntu</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>Fri, 03 Sep 2010 15:03:58 --1000</pubDate>
			<lastBuildDate>Sat, 28 Aug 2010 17:48: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>Lego Digital Designer on Ubuntu</title>
				<link>http://www.lynchconsulting.com.au/blog/index.cfm/2010/8/28/Lego-Digital-Designer-on-Ubuntu</link>
				<description>
				
				Having seen the Lego Digital Designer I wanted to see if I could get it to run on Ubuntu, as there is a distinct lack of windows machines at home for my son to use.

It was all relatively painless and it&apos;s quite amazing how far Wine has come.

&lt;h3&gt;Installing Lego Digital Designer&lt;/h3&gt;


Go to the &lt;a href=&quot;http://ldd.lego.com/&quot;&gt;Lego Digital Designer&lt;/a&gt; site and download the Windows version.

I got &lt;a href=&quot;http://cache.lego.com/downloads/ldd2.0/installer/SetupLDD-PC-3_1_3.exe
&quot;&gt;LDD 3.1.3&lt;/a&gt; which was the latest version available at the time.


Now - to make it all work you need to install Wine and I used the latest version from the wine PPA team.

Add the wine ppa:
&lt;code&gt;
sudo add-apt-repository ppa:ubuntu-wine/ppa
[sudo] password for markl: 
&lt;/code&gt;

You&apos;ll then see:
&lt;code&gt;
Executing: gpg --ignore-time-conflict --no-options --no-default-keyring --secret-keyring /etc/apt/secring.gpg --trustdb-name /etc/apt/trustdb.gpg --keyring /etc/apt/trusted.gpg --primary-keyring /etc/apt/trusted.gpg --keyserver keyserver.ubuntu.com --recv 883E8688397576B6C509DF495A9A06AEF9CB8DB0
gpg: requesting key F9CB8DB0 from hkp server keyserver.ubuntu.com
gpg: key F9CB8DB0: public key &quot;Launchpad PPA for Ubuntu Wine Team&quot; imported
gpg: Total number processed: 1
gpg:               imported: 1  (RSA: 1)
&lt;/code&gt;

Now to update the list of available software:
&lt;code&gt;
sudo apt-get update
&lt;/code&gt;

And then install wine and winetricks
&lt;code&gt;
sudo apt-get install wine winetricks
&lt;/code&gt;


Wine lets you run Windows software on other operating systems, in this case Ubuntu.

Wine tricks provides a simple way to install native versions of some of the libraries that are not 100% compatible - by looking at the &lt;a href=&quot;http://appdb.winehq.org/objectManager.php?sClass=version&amp;iId=18127&quot;&gt;Wine App DB&lt;/a&gt; I discovered that it had problems with missing font&apos;s (Tahoma) and scrolling which was fixed by installing Quartz.

&lt;code&gt;
winetricks tahoma quartz
&lt;/code&gt;

Then install double click on the install file for LDD and it should be up an running in no time.

If you get a warning about it not being Executable you may need to right click on the application and select Properties - and then from the Permissions tab select &quot;Allow executing file as program&quot;

Son is now very happy with Lego Digital Designer :-)
				
				</description>
				
				<category>Ubuntu</category>
				
				<category>Linux</category>
				
				<category>General</category>
				
				<pubDate>Sat, 28 Aug 2010 17:48:00 --1000</pubDate>
				<guid>http://www.lynchconsulting.com.au/blog/index.cfm/2010/8/28/Lego-Digital-Designer-on-Ubuntu</guid>
				
			</item>
			
		 	
			
			
			<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>Railo on Tomcat revisited - mod_proxy</title>
				<link>http://www.lynchconsulting.com.au/blog/index.cfm/2010/3/12/Railo-on-Tomcat-revisited--modproxy</link>
				<description>
				
				&lt;b&gt;Updated:&lt;/b&gt; Changed the linking between railo and tomcat to use shared.loader.

I&apos;ve been doing some more work on configuring railo to work flexibly in the numerous different environments we work in, and also making it simpler to set up.

To that end I investigated the use of mod_proxy for linking it to apache instead of mod_jk.

Advantages of this approach are:
&lt;ul&gt;
&lt;li&gt;Simple - communications are in plain http&lt;/li&gt;
&lt;li&gt;Flexible - Load balancing can be easily added at the apache layer&lt;/li&gt;
&lt;li&gt;Simple - No compiling mod_jk&lt;/li&gt;
&lt;/ul&gt;

Here are the basic install instructions for Railo/Tomcat/Apache on Ubuntu.

&lt;h2&gt;Download &amp; Install Tomcat&lt;/h2&gt;

&lt;a href=&quot;http://tomcat.apache.org/download-60.cgi&quot;&gt;Download tomcat&lt;/a&gt; and extract content:

&lt;code&gt;
tar xvzf apache-tomcat-6.0.26.tar.gz
&lt;/code&gt;

Move Tomcat to a more appropriate place:
&lt;code&gt;
sudo mv apache-tomcat-6.0.26 /opt/tomcat
&lt;/code&gt;


&lt;h2&gt;Download Railo&lt;/h2&gt;

Download &lt;a href=&quot;http://www.getrailo.org/index.cfm/download/&quot;&gt;Railo custom version jars file&lt;/a&gt;

Extract and move into Tomcat lib directory:
&lt;code&gt;
tar zxvf railo-3.1.2.001-jars.tar.gz
sudo mv railo-3.1.2.001-jars /opt/railo
&lt;/code&gt;


Make Tomcat load the railo jars by editing catalina.properties to change the shared loader path:
&lt;code&gt;
shared.loader=/opt/railo/*.jar
&lt;/code&gt;

Make Tomcat and Railo work together by modifying the web config file:
&lt;code&gt;
sudo nano -w /opt/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;


Start up tomcat:
&lt;code&gt;
/opt/tomcat/bin/startup.sh
&lt;/code&gt;
Once this is done you should be able to access the railo admin by going to the following URL:
&lt;code&gt;
http://127.0.0.1:8080/railo-context/admin/server.cfm
&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 (/opt/tomcat/conf/server.xml )
&lt;code&gt;
&lt;Host name=&quot;testsite.railo&quot; appBase=&quot;webapps&quot;&gt;
    &lt;Context path=&quot;&quot; docBase=&quot;/vhosts/testsite.railo/www&quot;/&gt;
&lt;/Host&gt;
&lt;/code&gt; 

&lt;h2&gt;Linking with Apache via Mod Proxy&lt;/h2&gt;

Ensure the modules proxy and proxy_http are enabled.  On Ubuntu this is done as follows:
&lt;code&gt;
sudo a2enmod proxy
sudo a2enmod proxy_http
sudo /etc/init.d/apache2 restart
&lt;/code&gt;

&lt;h2&gt;Create vhost&lt;/h2&gt;
Now we need to create a virtual host entry in Apache as well:
&lt;code&gt;
&lt;VirtualHost *:80&gt;
        DocumentRoot /vhosts/testsite.railo/www
        ServerName testsite.railo
        DirectoryIndex index.cfm
	#Proxy .cfm requests to railo
	&lt;IfModule mod_proxy.c&gt;
		&lt;Proxy *&gt;
		Order deny,allow
		Allow from all
		&lt;/Proxy&gt;
		ProxyPassMatch ^/(.*\.cfm)$ http://testsite.railo:8080/$1
		ProxyPassReverse  /  http://testsite.railo:8080/
	&lt;/IfModule&gt;

	#Deny access to admin except for local/portforwarded clients
	&lt;Location /railo-context/&gt;
		Order deny,allow
		Deny from all
		Allow from 127.0.0.1
	&lt;/Location&gt;
&lt;/VirtualHost&gt;
&lt;/code&gt;

This tells apache to forward all requests for CFM files to the railo instance.

Finally restart apache and railo and you should be good to go.

&lt;code&gt;
sudo /opt/tomcat/bin/shutdown.sh 
sudo /opt/tomcat/bin/startup.sh 
sudo /etc/init.d/apache2 restart
&lt;/code&gt;
				
				</description>
				
				<category>Ubuntu</category>
				
				<category>Systems admin</category>
				
				<category>Railo</category>
				
				<category>ColdFusion</category>
				
				<pubDate>Fri, 12 Mar 2010 11:01:00 --1000</pubDate>
				<guid>http://www.lynchconsulting.com.au/blog/index.cfm/2010/3/12/Railo-on-Tomcat-revisited--modproxy</guid>
				
			</item>
			
		 	
			
			
			<item>
				<title>MySQL 5.1 logging changes - Log to DB and runtime config</title>
				<link>http://www.lynchconsulting.com.au/blog/index.cfm/2010/1/29/MySQL-51-logging-changes</link>
				<description>
				
				While browsing around the MySQL site last night I discovered a number of nice new features of mysql 5.1 that relate to logging.

These are:

&lt;ul&gt;
&lt;li&gt;Logging to DB instead of log files&lt;/li&gt;
&lt;li&gt;Runtime configuration of logging.&lt;/li&gt;
&lt;/ul&gt;


&lt;h3&gt;Logging to DB instead of log files&lt;/h3&gt;

Coming from a web development background rather than a sysadmin background I&apos;m far more comfortable manipulating and analysing data using SQL.  So to be able to log all the queries or just the slow queries for an application to the db during application development or load testing is a huge benefit.

To enable logging to DB you can add the following to your my.cnf
&lt;code&gt;
log_output = TABLE
&lt;/code&gt; 

The logs will be written to the &apos;slow_log&apos; and &apos;general_log&apos; tables in the mysql database.

Note - logging to tables has more overhead than logging to file, so would suggest using it primarily for development purposes.

Full details of the options are on the &lt;a href=&quot;http://dev.mysql.com/doc/refman/5.1/en/log-tables.html&quot;&gt;mysql manual on log tables&lt;/a&gt;


&lt;h3&gt;Runtime configuration of logging.&lt;/h3&gt;

This allows you to turn on and off logging without restarting MySQL - which just saves a little bit of time and makes it much nicer for debugging problems.

To turn on the logging of all queries run:
&lt;code&gt;
SET GLOBAL general_log = &apos;ON&apos;;
&lt;/code&gt;
And for just the slow query log:
&lt;code&gt;
SET GLOBAL slow_query_log = &apos;ON&apos;;
&lt;/code&gt;

And to turn them both off use:
&lt;code&gt;
SET GLOBAL general_log = &apos;OFF&apos;;
SET GLOBAL slow_query_log = &apos;OFF&apos;;
&lt;/code&gt;

If you also want to see queries not using indexes in the slow query log you can set the following variable:

&lt;code&gt;
SET GLOBAL log_queries_not_using_indexes = &apos;ON&apos;;
&lt;/code&gt;


Hope it helps,
Mark
				
				</description>
				
				<category>Ubuntu</category>
				
				<category>Systems admin</category>
				
				<category>Open Source</category>
				
				<category>mysql</category>
				
				<category>Linux</category>
				
				<category>Database</category>
				
				<pubDate>Fri, 29 Jan 2010 08:15:00 --1000</pubDate>
				<guid>http://www.lynchconsulting.com.au/blog/index.cfm/2010/1/29/MySQL-51-logging-changes</guid>
				
			</item>
			
		 	
			
			
			<item>
				<title>Removing silence from audio using sox</title>
				<link>http://www.lynchconsulting.com.au/blog/index.cfm/2009/11/25/Removing-silence-from-audio-using-sox</link>
				<description>
				
				I&apos;ve had a look at this a few times before and each time I&apos;ve gotten a little bit further and then gotten frustrated and failed.

However, this time I finally managed to get past all the hurdles and jump through all the hoops to make this work.

&lt;img src=&quot;http://www.lynchconsulting.com.au/blog/enclosures/audacity_screenshot.png&quot; align=&quot;right&quot; alt=&quot;Audio before and after&quot;&gt;

Scenario is a follows.  Audio file is comes in in alaw or ulaw format and we want to trim any silence before and after it.


First step is to convert it from alaw to pcm encoded wav file &lt;a href=&quot;http://old.nabble.com/Empty-result-file-when-removing-silence-td23445456.html&quot;&gt;as SOX has issues filtering silence in alaw files&lt;/a&gt;
&lt;code&gt;
sox -t alaw in.alaw -c1 -2 -r8000 -e signed-integer temp.wav
&lt;/code&gt;

Then we do the trimming in one fell swoop.  
&lt;code&gt;
sox temp.wav out.wav silence 1 0.1 0.1% reverse silence 1 0.1 0.1% reverse
&lt;/code&gt;

A huge thanks to this article for giving such a &lt;a href=&quot;http://digitalcardboard.com/blog/2009/08/25/the-sox-of-silence/&quot;&gt;thorough overview of the how silence detection works in sox&lt;/a&gt;.

Too easy, when you know how :-)
				
				</description>
				
				<category>Asterisk</category>
				
				<category>Linux</category>
				
				<category>Open Source</category>
				
				<category>Ubuntu</category>
				
				<pubDate>Wed, 25 Nov 2009 22:11:00 --1000</pubDate>
				<guid>http://www.lynchconsulting.com.au/blog/index.cfm/2009/11/25/Removing-silence-from-audio-using-sox</guid>
				
			</item>
			
		 	
			
			
			<item>
				<title>Apache Deflate Howto</title>
				<link>http://www.lynchconsulting.com.au/blog/index.cfm/2009/11/15/Apache-Deflate-howto</link>
				<description>
				
				For my own reference, settings to turn on apache mod_deflate.

This sets turns it on for everything except gif,jpeg,png or mp3, as these are already well compressed.

&lt;code&gt;
        SetOutputFilter DEFLATE
	SetEnvIfNoCase Request_URI \
		\.(?:gif|jpe?g|png|mp3)$ no-gzip dont-vary
&lt;/code&gt;

Cheers,
Mark
				
				</description>
				
				<category>Ubuntu</category>
				
				<category>Systems admin</category>
				
				<category>Linux</category>
				
				<pubDate>Sun, 15 Nov 2009 19:15:00 --1000</pubDate>
				<guid>http://www.lynchconsulting.com.au/blog/index.cfm/2009/11/15/Apache-Deflate-howto</guid>
				
			</item>
			
		 	
			
			
			<item>
				<title>cp &quot;No space left on device&quot; problem - Solved</title>
				<link>http://www.lynchconsulting.com.au/blog/index.cfm/2009/11/14/cp-No-space-left-on-device-problem--Solved</link>
				<description>
				
				One of my backup scripts started reporting errors recently about running out of space:

&lt;code&gt;
cp: cannot create regular file `filename in here&apos;: No space left on device
&lt;/code&gt;

Running the command &lt;strong&gt;df&lt;/strong&gt; was showing lots of free space.

However, a quick google on &lt;strong&gt;cp &quot;no space left on device&quot;&lt;/strong&gt; turned up the suggestion to try:

&lt;code&gt;
df -i
&lt;/code&gt;

This showed up the problem straight away - I had run out of inodes.

Once the problem is identified it is generally easy to resolve, so I figured out that there was a cron job that was running a wget task and not discarding the output, and so had saved 600,000+ files in their home directory.

However, when I tried to delete them I encountered another problem:

&lt;code&gt;
# rm filepattern*
bash: /bin/rm: Argument list too long
&lt;/code&gt;

There were so many files that I couldn&apos;t use standard delete commands.

Another quick google turned up &lt;a href=&quot;http://www.thothdata.com/news-items/tips-and-tricks/too-many-arguments&quot;&gt;this gem&lt;/a&gt;:

I ran the following command to check that I was going to delete the correct files:
&lt;code&gt;
find . | grep filepattern
&lt;/code&gt;
And then added the command to actually do the delete:
&lt;code&gt;
find . | grep filepattern | xargs rm
&lt;/code&gt;

One final thing was to fix up the cron job that was causing the problem. Adding the parameter &lt;strong&gt;--delete-after&lt;/strong&gt; to wget kept the directory nice and clean.


All fixed.  One of the things this has reinforced for me is how important it is to have /home on a seperate partition.  If this had not been the case then the problem would have taken longer to happen (due to larger filesystem) but would have been more destructive - as all systems and processes would not have been able to create new files.
				
				</description>
				
				<category>Ubuntu</category>
				
				<category>Systems admin</category>
				
				<category>Linux</category>
				
				<pubDate>Sat, 14 Nov 2009 13:12:00 --1000</pubDate>
				<guid>http://www.lynchconsulting.com.au/blog/index.cfm/2009/11/14/cp-No-space-left-on-device-problem--Solved</guid>
				
			</item>
			
		 	
			
			
			<item>
				<title>Chinese characters not working cfdocument for PDF exports - fixed</title>
				<link>http://www.lynchconsulting.com.au/blog/index.cfm/2009/10/26/Chinese-characters-not-working-cfdocument-for-PDF-exports--fixed</link>
				<description>
				
				I&apos;ve just spent quite a few hours grappling with an annoying PDF export issue where the font&apos;s were not displaying correctly.  This is on a CFMX 7 (7.0.2) on Ubuntu Linux system.

All the DB storage and application was using UTF8 throughout, but the PDF exports were showing nothing when they should have been showing Chinese characters.

To fix this up you need to do the following:

&lt;h3&gt;1. Need fonts installed on system:&lt;/h3&gt;
&lt;code&gt;
sudo apt-get install ttf-arphic-bsmi00lp ttf-arphic-gbsn00lp
&lt;/code&gt;

&lt;h3&gt;2. Need fonts installed in CFAdmin&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Go to CFAdmin and Font Management&lt;/li&gt;
&lt;li&gt;Select directory /usr/share/fonts/truetype/arphic&lt;/li&gt;
&lt;li&gt;Select &quot;Add&quot; and you should see 2 new fonts added.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;3: CFdocument Hotfix for CF7.0.2&lt;/h3&gt;
The CFDocument hotfix for 7.0.2 provides some essential fixes and makes this work - Follow the instructions to install: &lt;a href=&quot;http://kb2.adobe.com/cps/402/kb402093.html&quot;&gt;http://kb2.adobe.com/cps/402/kb402093.html&lt;/a&gt;

&lt;h3&gt;Configure cffont.properties file&lt;/h3&gt;
The final step is to set the cffont.properties file so that it will check additional font sets for any characters it doesn&apos;t know about - i.e. Chinese characters.  Each line in the file is like a CSS font-family rule, i.e. it will start at the left and look for the correct font to render the text.  I appended the two extra font names to ensure they are checked, so the file looks like this:

&lt;code&gt;
defaultbasefont=
dialog=Arial, Helvetica, AR PL SungtiL GB,AR PL Mingti2L Big5
dialog.bold=Arial Bold, Helvetica-Bold, AR PL SungtiL GB,AR PL Mingti2L Big5
dialog.italic=Arial Italic, Helvetica-Oblique, AR PL SungtiL GB, AR PL Mingti2L Big5
dialog.bolditalic=Arial Bold Italic, Helvetica-BoldOblique, AR PL SungtiL GB, AR PL Mingti2L Big5
dialoginput=Courier New, Courier, AR PL SungtiL GB, AR PL Mingti2L Big5
dialoginput.bold=Courier New Bold, Courier-Bold, AR PL SungtiL GB, AR PL Mingti2L Big5
dialoginput.italic=Courier New Italic, Courier-Oblique, AR PL SungtiL GB, AR PL Mingti2L Big5
dialoginput.bolditalic=Courier New Bold Italic, Courier-BoldOblique, AR PL SungtiL GB, AR PL Mingti2L Big5
serif=Times New Roman, Times-Roman, AR PL SungtiL GB, AR PL Mingti2L Big5
serif.bold=Times New Roman Bold, Times-Bold, AR PL SungtiL GB, AR PL Mingti2L Big5
serif.italic=Times New Roman Italic, Times-Italic, AR PL SungtiL GB, AR PL Mingti2L Big5
serif.bolditalic=Times New Roman Bold Italic, Times-BoldItalic, AR PL SungtiL GB, AR PL Mingti2L Big5
sansserif=Arial, Helvetica, AR PL SungtiL GB, AR PL Mingti2L Big5
sansserif.bold=Arial Bold, Helvetica-Bold, AR PL SungtiL GB, AR PL Mingti2L Big5
sansserif.italic=Arial Italic, Helvetica-Oblique, AR PL SungtiL GB, AR PL Mingti2L Big5
sansserif.bolditalic=Arial Bold Italic, Helvetica-BoldOblique, AR PL SungtiL GB, AR PL Mingti2L Big5
monospaced=Courier New, Courier, AR PL SungtiL GB, AR PL Mingti2L Big5
monospaced.bold=Courier New Bold, Courier-Bold, AR PL SungtiL GB, AR PL Mingti2L Big5
monospaced.italic=Courier New Italic, Courier-Oblique, AR PL SungtiL GB, AR PL Mingti2L Big5
monospaced.bolditalic=Courier New Bold Italic, Courier-BoldOblique, AR PL SungtiL GB, AR PL Mingti2L Big5
&lt;/code&gt;

The cffont.properties file is located in /opt/jrun4/servers/{instance name}/cfusion.ear/cfusion.war/WEB-INF/cfusion/lib on the jrun multiserver version.

&lt;h3&gt;5. Restart CF&lt;/h3&gt;

Once you restart CF you documents should be coming out with their Chinese fonts intact.

I&apos;m sure there are additional fonts to add to get it working natively with all the other asian languages, so I&apos;ll add to this as and when I need/discover them.  Please feel free to post a comment if you find any more font&apos;s that should be added to the list.
				
				</description>
				
				<category>ColdFusion</category>
				
				<category>Linux</category>
				
				<category>Open Source</category>
				
				<category>Railo</category>
				
				<category>Ubuntu</category>
				
				<pubDate>Mon, 26 Oct 2009 16:38:00 --1000</pubDate>
				<guid>http://www.lynchconsulting.com.au/blog/index.cfm/2009/10/26/Chinese-characters-not-working-cfdocument-for-PDF-exports--fixed</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 Dell OpenManage Server Administrator on Ubuntu 32bit</title>
				<link>http://www.lynchconsulting.com.au/blog/index.cfm/2009/8/4/Installing-Dell-OpenManage-Server-Administrator-on-Ubuntu-32bit</link>
				<description>
				
				&lt;p&gt;I found this article on &lt;a href=&quot;http://www.keithscode.com/linux-tutorials/installing-dell-openmanage-server-administrator-on-ubuntu.html#josc41&quot;&gt;Installing Dell OpenManage Server Administrator on Ubuntu x64 on Keith&apos;s Code&lt;/a&gt; and am posting here with modifications for 32 bit for my own reference&lt;/p&gt;


&lt;p&gt;
Dell&apos;s OpenManage Server Administrator is a powerful tool for keeping track of your server&apos;s health and making sure everything is running as it should. Unfortunately, Dell only released packages for RedHat and SuSE, so installing the software on Ubuntu can be tricky, at best. 
&lt;/p&gt;
&lt;p&gt;
There is some information on the Internet about getting the package to install on exotic distributions, but I never found anything definitive. This tutorial will guide you through installing the software and getting the web access up and running.&amp;nbsp;
&lt;/p&gt;
&lt;p&gt;
My setup is: Dell 2950 with 1 Intel 2.2GHz Processor, 2GB RAM, PERC 5/i SCSI Raid Controller with 2 73GB 15K RPM SAS disks running Ubuntu 8.04.2 LTS 32-bit. 
&lt;/p&gt;


&lt;h3&gt;1. Install the kernel modules&lt;/h3&gt; 

&lt;p&gt;
The first step is installing the needed kernel modules to support IPMI:
&lt;br /&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;code&gt;
sudo modprobe ipmi_msghandler
sudo modprobe ipmi_devintf
sudo modprobe ipmi_si&lt;/code&gt;
&lt;/p&gt;
&lt;p&gt;
Next,you will want to add those modules to the end of the /etc/modules file. This will allow them to be loaded at boot time.
&lt;/p&gt;

&lt;h3&gt;2. Setup Apt to get the OMSA package &lt;/h3&gt;
&lt;p&gt;
As stated before, Dell only released the OpenManage Server Administrator for RedHat and SuSE. However, someone was kind enough to create an installable Debian based package for us. In order to get access to that package, you will need to add the following line to /etc/apt/sources.list:&lt;br /&gt;
&lt;/p&gt;
&lt;p&gt;

&lt;code&gt;deb ftp://ftp.sara.nl/pub/sara-omsa dell sara&lt;/code&gt;
&lt;/p&gt;
&lt;p&gt;
Then, you will need to install the Pulic Key for that repository. To do that, create a temporary directory in your home folder and run the following commands from that folder:&lt;br /&gt;
&lt;code&gt;
wget http://ftp.sara.nl/debian_sara.asc

sudo apt-key add debian_sara.asc&lt;/code&gt;
&lt;/p&gt;

&lt;h3&gt;3. Install the needed packages&lt;/h3&gt; 
&lt;p&gt;

Now it&apos;s time to install all the packages that will be needed:&lt;br /&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;code&gt;sudo apt-get update
sudo apt-get install snmp snmpd
sudo apt-get install openipmi
sudo apt-get install ipmitool
sudo apt-get install dellomsa
&lt;/code&gt;
&lt;/p&gt;
&lt;h3&gt;4. Start SNMP&lt;/h3&gt;
&lt;p&gt;
The following commands will enable SNMP and get it going:&lt;br /&gt;
&lt;code&gt;
sudo /etc/init.d/snmpd restart
sudo /etc/init.d/dataeng start
&lt;/code&gt;

If you get and error like:
&lt;code&gt;
Starting dsm_sa_datamgr32d: /opt/dell/srvadmin/dataeng/bin/dsm_sa_datamgr32d: error while loading shared libraries: libdcsmil32.so.5: cannot open shared object file: No such file or directory 
Starting dsm_sa_eventmgr32d: /opt/dell/srvadmin/dataeng/bin/dsm_sa_eventmgr32d: error while loading shared libraries: libdcsupt32.so.5: cannot open shared object file: No such file or directory
&lt;/code&gt;

You may need to reconfigure the dynamic linker so that it knows the new libraries are.&lt;br /&gt;

&lt;code&gt;
sudo ldconfig&lt;/code&gt;
&lt;/p&gt;


&lt;h3&gt;
5. Start the web services&lt;/h3&gt;
&lt;p&gt;
Start the Dell OMSA web interface:&lt;br /&gt;
&lt;code&gt;
sudo /etc/init.d/dsm_om_connsvc start&lt;/code&gt;
&lt;/p&gt;


&lt;h3&gt;
6. Add a user to access the OMSA site
&lt;/h3&gt;
&lt;p&gt;
If your system is setup properly, you shouldn&apos;t have a password for the root user. To access the OpenManage client, you need to have root access. There is a way to do this without giving the root user a password. I created a user called dellroot that will be able to access the OMSA client:&lt;br /&gt;
&lt;samp&gt;
sudo useradd dellroot&lt;br /&gt;
sudo usermod -g root dellroot&lt;br /&gt;
sudo passwd dellroot&lt;/samp&gt;
&lt;/p&gt;
&lt;p&gt;
Enter a secure password for the user when prompted. 
&lt;/p&gt;

&lt;h3&gt;
7. Check it out&lt;/h3&gt;
&lt;p&gt;
Now you should be able to access the OpenManage web interface by going to https://&amp;lt;servername&amp;gt;:1311 (e.g., https://www.example.com:1311)
&lt;/p&gt;
&lt;p&gt;
Make sure you are using https and you add the port number of 1311 to the end of the URL. You can login using the dellroot user you just created.&amp;nbsp; 
&lt;/p&gt;
&lt;p&gt;
If you are using firefox, you will have to add a security exception for the self-signed certificate the server is using. 

&lt;/p&gt;
&lt;p&gt;


Thanks Keith for the helpful reference.

Cheers,
Mark
				
				</description>
				
				<category>Systems admin</category>
				
				<category>Ubuntu</category>
				
				<pubDate>Tue, 04 Aug 2009 11:27:00 --1000</pubDate>
				<guid>http://www.lynchconsulting.com.au/blog/index.cfm/2009/8/4/Installing-Dell-OpenManage-Server-Administrator-on-Ubuntu-32bit</guid>
				
			</item>
			
		 	
			
			
			<item>
				<title>HOWTO find files that are not world readable</title>
				<link>http://www.lynchconsulting.com.au/blog/index.cfm/2009/5/18/HOWTO-find-files-that-are-not-world-readable</link>
				<description>
				
				I ran across some permissions errors on content that some users uploaded to a website.  The files uploaded were not world readable so were coming up as forbidden:

This simple find command shows the offending files:

&lt;code&gt;
/usr/bin/find . -type f ! -perm -004
&lt;/code&gt;

A quickie but a goodie.

Cheers,
Mark
				
				</description>
				
				<category>Linux</category>
				
				<category>Mac OSX</category>
				
				<category>Open Source</category>
				
				<category>Systems admin</category>
				
				<category>Ubuntu</category>
				
				<pubDate>Mon, 18 May 2009 21:47:00 --1000</pubDate>
				<guid>http://www.lynchconsulting.com.au/blog/index.cfm/2009/5/18/HOWTO-find-files-that-are-not-world-readable</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>Remote collection of vmstat log files</title>
				<link>http://www.lynchconsulting.com.au/blog/index.cfm/2008/12/2/Remote-collection-of-vmstat-log-files</link>
				<description>
				
				We&apos;ve been doing a lot of load testing recently and are planning on doing a lot more, so we&apos;ve developed a simple little script to make the collection of the vmstat (performance statistics) a bit quicker.

multivmstat is a php command line script which makes it easy to collect the statistics.  &lt;a href=&quot;http://www.lynchconsulting.com.au/blog/enclosures/multivmstat.zip&quot;&gt;Download the script&lt;/a&gt;

To run it you specify a list of servers to check:
&lt;code&gt;
./multivmstat server1,server2,server3 5
&lt;/code&gt;

This will run vmstat on each of the servers with a 5 second interval between samples.

It will create the following files:
&lt;code&gt;
server1-vmstat.log
server2-vmstat.log
server3-vmstat.log
&lt;/code&gt;

Note: You mush have ssh access to each machine - ideally with a certificate so that no interactive authentication is required.

&lt;a href=&quot;http://www.lynchconsulting.com.au/blog/enclosures/multivmstat.zip&quot;&gt;Download the script&lt;/a&gt;
				
				</description>
				
				<category>ColdFusion</category>
				
				<category>General</category>
				
				<category>Linux</category>
				
				<category>Open Source</category>
				
				<category>Systems admin</category>
				
				<category>Ubuntu</category>
				
				<pubDate>Tue, 02 Dec 2008 09:42:00 --1000</pubDate>
				<guid>http://www.lynchconsulting.com.au/blog/index.cfm/2008/12/2/Remote-collection-of-vmstat-log-files</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>Choppy sound on Twinkle Softphone on Ubuntu Linux - Solved</title>
				<link>http://www.lynchconsulting.com.au/blog/index.cfm/2008/11/7/Choppy-sound-on-Twinkle-Softphone-on-Ubuntu-Linux</link>
				<description>
				
				I just reinstalled my system with the latest Ubuntu 8.10 x64 and one of the apps I use regularly for testing and developing Asterisk applications is &lt;a href=&quot;http://www.xs4all.nl/~mfnboer/twinkle/index.html&quot;&gt;Twinkle, which is a great VOIP softphone&lt;/a&gt;.

&lt;img src=&quot;http://www.lynchconsulting.com.au/blog/enclosures/Twinkle-System-Settings.png&quot; align=&quot;right&quot; /&gt;
It works great, but when I tried it in my new install the sound was all choppy, i.e. I would get every half of each second of the audio.  

A bit of fiddling about with the settings and I got it solved.  Posting it here so when I forget about it and run into the same problem again I&apos;ll know how to fix it.

The solutions is as simple as:
&lt;ul&gt;
&lt;li&gt;From the menu select Edit -&gt; System Settings.&lt;/li&gt;
&lt;li&gt;Select Audio on the left&lt;/li&gt;
&lt;li&gt;Change the audio devices to use the most approriate device that is NOT &quot;ALSA: default: Default Device&quot; - in my case it was &quot;ALSA: plughw:0,0: HDA Intel (AD193x Analog)&quot;&lt;/li&gt;
&lt;/ul&gt;

I do like the very friendly naming scheme for devices :-)
Hope it helps,
Mark
				
				</description>
				
				<category>Ubuntu</category>
				
				<category>Open Source</category>
				
				<category>Linux</category>
				
				<category>General</category>
				
				<category>Asterisk</category>
				
				<pubDate>Fri, 07 Nov 2008 08:53:00 --1000</pubDate>
				<guid>http://www.lynchconsulting.com.au/blog/index.cfm/2008/11/7/Choppy-sound-on-Twinkle-Softphone-on-Ubuntu-Linux</guid>
				
			</item>
			
		 	
			</channel></rss>