<?xml version="1.0" encoding="utf-8"?>
			
			<rss version="2.0">
			<channel>
			<title>Lynch Consulting Blog - Linux</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:48:33 --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>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>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>Learnosity are looking for a Web Ninja at a Mid to Senior level</title>
				<link>http://www.lynchconsulting.com.au/blog/index.cfm/2009/12/4/Learnosity-are-looking-for-a-Web-Ninja-at-a-Mid-to-Senior-level</link>
				<description>
				
				4 December 2009, Learnosity are looking for a Web Ninja at a Mid to Senior level.


&lt;h3&gt;About Learnosity&lt;/h3&gt;
Learnosity develop cutting edge tools for teachers and educators.  Our flagship product Learnosity Voice uses the telephone to enable language students and teachers to interact on a one to one level. 

&lt;img src=&quot;http://www.learnosity.com/wsimages/learnosity-logo-1.png&quot; align=&quot;right&quot;&gt;
Our service:
&lt;ul&gt;
&lt;li&gt;Makes it practical for students to practice Oral and Aural skills&lt;/li&gt;
&lt;li&gt;Is efficient and effective for teachers, as they can listen to each student individually at a time to suit them&lt;/li&gt;
&lt;li&gt;Can be used for homework assignments or “High Stakes Assessments”&lt;/li&gt;
&lt;/ul&gt;


We are continuing to grow our core development team and we need another great developer to help us keep up with demand.


&lt;h3&gt;We need someone who can:&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Use Javascript or Actionscript to create great user interfaces&lt;/li&gt;
&lt;li&gt;Develop highly scalable web applications&lt;/li&gt;
&lt;li&gt;Cut code with the best in the world&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;You will also need to be:&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;energetic with a butt kicking attitude&lt;/li&gt;
&lt;li&gt;ready to create cutting edge web 2.0 apps&lt;/li&gt;
&lt;li&gt;keen to continue learning new technologies&lt;/li&gt;
&lt;li&gt;able to have a conversation with non technical people&lt;/li&gt;
&lt;/ul&gt;


&lt;h3&gt;You&apos;ll need:&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;3 or more years of programming experience&lt;/li&gt;
&lt;li&gt;Expert in at least on Client side language (Actionscript or AJAX)&lt;/li&gt;
&lt;li&gt;Expert in at least one Server side language (eg PHP, Java, ColdFusion, etc)&lt;/li&gt;
&lt;li&gt;Understanding of Object Oriented design&lt;/li&gt;
&lt;li&gt;Understanding of XHTML and CSS&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;It would be good if you have:&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;A degree in Computer Science, Engineering or similar.&lt;/li&gt;
&lt;li&gt;been working with open source tools&lt;/li&gt;
&lt;li&gt;been playing around with iPhone/Android applications&lt;/li&gt;
&lt;li&gt;experience with some of Linux/VOIP/SIP/Asterisk/Jabber/XMPP&lt;/li&gt;
&lt;/ul&gt;

This is a full time role and you will be working in a casual workplace with flexible hours in the Sydney CBD.

If this sounds like the job for you, email a covering letter explaining why you&apos;ll be great and your resume to mark@learnosity.com - no agencies please.
				
				</description>
				
				<category>PHP</category>
				
				<category>Open Source</category>
				
				<category>Linux</category>
				
				<category>Learnosity</category>
				
				<category>Jobs</category>
				
				<category>Javascript</category>
				
				<category>iPhone</category>
				
				<category>ColdFusion</category>
				
				<pubDate>Fri, 04 Dec 2009 16:03:00 --1000</pubDate>
				<guid>http://www.lynchconsulting.com.au/blog/index.cfm/2009/12/4/Learnosity-are-looking-for-a-Web-Ninja-at-a-Mid-to-Senior-level</guid>
				
			</item>
			
		 	
			
			
			<item>
				<title>Normalising audio with sox</title>
				<link>http://www.lynchconsulting.com.au/blog/index.cfm/2009/11/25/Normalising-audio-with-sox</link>
				<description>
				
				&lt;b&gt;Update - as of sox 14.3.0 it is much simpler than described below - simply do:  sox --norm before.wav after.wav &lt;/b&gt;

Seem to be on a roll with Sox tonight.  Also figured out how to normalise audio files nicely.

The first thing to do with sox is to get it to calculate the max volume adjustment possible:

&lt;img src=&quot;http://www.lynchconsulting.com.au/blog/enclosures/sox_normalize.png&quot; align=&quot;right&quot; alt=&quot;Audio waveform before and after Normalisation&quot;&gt;

&lt;code&gt;
sox before.wav -n stat -v 
&lt;/code&gt;

This will return a number like: 4.234

You can then call sox again using this number:
&lt;code&gt;
sox -v 4.234 before.wav after.wav
&lt;/code&gt;

And if you&apos;re feeling particularly good you can put the whole command on a single line as follows:

&lt;code&gt;
sox -v `sox before.wav -n stat -v 2&gt;&amp;1` before.wav after.wav
&lt;/code&gt;

Easy when you know how.
				
				</description>
				
				<category>Open Source</category>
				
				<category>Linux</category>
				
				<category>Asterisk</category>
				
				<pubDate>Wed, 25 Nov 2009 22:48:00 --1000</pubDate>
				<guid>http://www.lynchconsulting.com.au/blog/index.cfm/2009/11/25/Normalising-audio-with-sox</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>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>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>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>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>Formatting XML for easier reading with Tidy</title>
				<link>http://www.lynchconsulting.com.au/blog/index.cfm/2009/1/28/Formatting-XML-for-easier-reading-with-Tidy</link>
				<description>
				
				I&apos;ve been working on performance tuning a clients application which makes heavy use of XML and in order to get my head around the structure of the XML I wanted to have a browse through the XML data.

So I did a &lt;a href=&quot;http://www.charlesproxy.com/&quot;&gt;Charles capture&lt;/a&gt; of the data to have a look.  Unfortunately the data was formatted in a single line with no line breaks and as it was just under 1MB it upset all my usual editors (Eclipse &amp; Gedit) and made them become completely unresponsive.  

After a bit of hunting I finally found the right tool for the job - &lt;a href=&quot;http://tidy.sourceforge.net/&quot;&gt;HTML Tidy&lt;/a&gt;.

With the following command I was able to get the XML formatted nicely which made my editors play nice and made it a lot easier to get an understanding of the data in the XML packet.

&lt;code&gt;
tidy -xml -i input.xml &gt; formatted.xml
&lt;/code&gt;

This takes the input.xml and indents it nicely and saves it as formatted.xml.

Cheers,
Mark
				
				</description>
				
				<category>Linux</category>
				
				<category>Open Source</category>
				
				<pubDate>Wed, 28 Jan 2009 07:49:00 --1000</pubDate>
				<guid>http://www.lynchconsulting.com.au/blog/index.cfm/2009/1/28/Formatting-XML-for-easier-reading-with-Tidy</guid>
				
			</item>
			
		 	
			</channel></rss>