<?xml version="1.0" encoding="UTF-8"?><!-- generator="WordPress/2.9.1" -->
<rss version="0.92">
<channel>
	<title>Open Sourcery</title>
	<link>http://www.opensourcery.co.uk</link>
	<description>Open Source Support and Consultancy</description>
	<lastBuildDate>Wed, 27 Aug 2008 12:45:47 +0000</lastBuildDate>
	<docs>http://backend.userland.com/rss092</docs>
	<language>en</language>
	
	<item>
		<title>Preserve formatting when pasting in vi/vim</title>
		<description><![CDATA[When copy and pasting into vi or vim, you can often end up with badly formatted text. This is often referred to as &#8220;the staircase effect&#8221;. It&#8217;s easily prevented by entering :set paste before you paste, when you have finished turn it off again with :set nopaste.
a
<p>a</p>
]]></description>
		<link>http://www.opensourcery.co.uk/2008/07/preserve-formatting-when-pasting-in-vivim/</link>
			</item>
	<item>
		<title>Handling temporary files in BASH shell scripts</title>
		<description><![CDATA[Temporary files left over from shell scripts clutter up your /tmp directory and may result in information leakage. Below are a pair of functions we use to gracefully handle the creation and removal of temporary files in shell scripts.
The first function is used to create a temporary file:
function os_mktemp {
&#160;[[ ! $1 ]] &#038;&#038; echo [...]<p>a</p>
]]></description>
		<link>http://www.opensourcery.co.uk/2008/06/handling-temporary-files-in-bash-shell-scripts/</link>
			</item>
	<item>
		<title>Automatically backing up files before making changes</title>
		<description><![CDATA[It&#8217;s best practice (and common sense) to make a backup of a file before you edit it. Unfortunately it&#8217;s easy to forget to do this. We use this simple script below to make a time/date stamped copy of a file before launching the editor (in this case vim). We create it as /usr/local/bin/bvi.

#!/bin/bash
[[ -r $1 [...]<p>a</p>
]]></description>
		<link>http://www.opensourcery.co.uk/2008/06/backing-up-files-before-making-changes/</link>
			</item>
	<item>
		<title>Check, repair and optimize all MySQL databases</title>
		<description><![CDATA[The following command will check, repair and optimize all databases on your MySQL server.
mysqlcheck -u root -p --auto-repair --check --optimize --all-databases
It is the equivalent of calling CHECK TABLE, REPAIR TABLE, ANALYZE TABLE and OPTIMZE TABLE for each table in each database on your server.
We tend to run this command directly after our scheduled backups.
a
<p>a</p>
]]></description>
		<link>http://www.opensourcery.co.uk/2008/05/check-repair-and-optimize-all-mysql-databases/</link>
			</item>
	<item>
		<title>BASH quick tip: Change to last directory</title>
		<description><![CDATA[You can change to the previous working directory in BASH by using the command:
cd - 
a
<p>a</p>
]]></description>
		<link>http://www.opensourcery.co.uk/2008/05/bash-change-to-last-director/</link>
			</item>
	<item>
		<title>Using mod_rewrite to prevent hotlinking</title>
		<description><![CDATA[Hotlinking is the practice of linking to an object (generally an image file) from one site (the donor site) onto another (the linking site). We&#8217;re frequently asked by our hosting clients if there is a way to stop people doing this as it&#8217;s consuming their bandwidth or server resources. This is easily done with the [...]<p>a</p>
]]></description>
		<link>http://www.opensourcery.co.uk/2008/05/using-mod_rewrite-to-prevent-hotlinking/</link>
			</item>
	<item>
		<title>Installing VMware Tools on Debian Etch</title>
		<description><![CDATA[VMware don&#8217;t provide a packaged version of VMware tools for Debian, but they do provide the source and a script to build and install it. Installation is started in the usual way, but right clicking the virtual machine in Virtual Centre and choosing &#8220;Install/Upgrade VMware Tools&#8221;. This will mount a CD image containing the required [...]<p>a</p>
]]></description>
		<link>http://www.opensourcery.co.uk/2008/04/vmware-tools-debian-etch/</link>
			</item>
	<item>
		<title>Scheduled maintenance with mod_rewrite</title>
		<description><![CDATA[A public sector customer recently had a requirement to redirect visitors to one of their applications to a holding page overnight while the company who support the application carried out some maintenance work. The work was being carried out between 1am and 7am to minimize disruption to the members of public who use the application.
Keen [...]<p>a</p>
]]></description>
		<link>http://www.opensourcery.co.uk/2008/04/scheduled-maintenance-with-mod_rewrite/</link>
			</item>
	<item>
		<title>Parsing parameters in a BASH shell script</title>
		<description><![CDATA[This is a simple alternative to using getopts to parse parameters in a BASH shell script which makes use of the powerful parameter substitution functions in BASH. It should be sufficient for most scripts:

until [[ ! "$*" ]]; do
&#160;&#160;if [[ ${1:0:2} = '--' ]]; then
&#160;&#160;&#160;&#160;PAIR=${1:2}
&#160;&#160;&#160;&#160;PARAMETER=`echo ${PAIR%=*} &#124; tr [:lower:] [:upper:]`
&#160;&#160;&#160;&#160;eval P_$PARAMETER=${PAIR##*=}
&#160;&#160;fi
&#160;&#160;shift
done


The script processes parameters in [...]<p>a</p>
]]></description>
		<link>http://www.opensourcery.co.uk/2008/04/parsing-parameters-bash-shell-script/</link>
			</item>
	<item>
		<title>New website</title>
		<description><![CDATA[Our new website is now online.
As you would expect, the site is created wholly using Open Source software. It has been created using the excellent WordPress software and is
hosted on our own LAMP (Linux/Apache/MySQL/PHP)  servers.
a
<p>a</p>
]]></description>
		<link>http://www.opensourcery.co.uk/2008/04/new-website/</link>
			</item>
</channel>
</rss>
