<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Rforge</title>
	<atom:link href="http://rforge.org/feed/" rel="self" type="application/rss+xml" />
	<link>http://rforge.org</link>
	<description>open source tools and statistical computing ++</description>
	<lastBuildDate>Thu, 12 Jan 2012 11:03:07 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='rforge.org' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Rforge</title>
		<link>http://rforge.org</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://rforge.org/osd.xml" title="Rforge" />
	<atom:link rel='hub' href='http://rforge.org/?pushpress=hub'/>
		<item>
		<title>Data Backup in the AWS Cloud with rsync</title>
		<link>http://rforge.org/2011/11/16/data-backup-in-the-aws-cloud-with-rsync/</link>
		<comments>http://rforge.org/2011/11/16/data-backup-in-the-aws-cloud-with-rsync/#comments</comments>
		<pubDate>Wed, 16 Nov 2011 21:20:39 +0000</pubDate>
		<dc:creator>rforge</dc:creator>
				<category><![CDATA[Amazon Web Services]]></category>
		<category><![CDATA[Backup]]></category>
		<category><![CDATA[BASH]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[amazon]]></category>
		<category><![CDATA[AWS]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[demon]]></category>
		<category><![CDATA[ebs]]></category>
		<category><![CDATA[ec2]]></category>
		<category><![CDATA[rsync]]></category>

		<guid isPermaLink="false">http://rforge.org/?p=722</guid>
		<description><![CDATA[After admitting that of all things Microsoft offers 25GB cloud storage for its Windows Live subscribers I will walk through my latest preliminary experiments regarding backup of important data using the using the Amazon Advanced Web Services. The storage is not free but quite cheap at around 0.1$ per GB and month. If you use [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rforge.org&amp;blog=7577563&amp;post=722&amp;subd=rforge&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>After admitting that of all things Microsoft offers <a href="http://explore.live.com/skydrive">25GB cloud storage</a> for its Windows Live subscribers I will walk through my latest preliminary experiments regarding backup of important data using the using the Amazon <a href="aws.amazon.com">Advanced Web Services</a>. The storage is not free but quite cheap at around 0.1$ per GB and month.</p>
<p>If you use Windows and MS Office a lot use <a href="http://explore.live.com/skydrive">Skydrive</a> and don&#8217;t read on <img src='http://s1.wp.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />  There are posts which describe how to map the Skydrive like a local harddisk using MS Word.</p>
<p>On the long run I would like to mount a EBS storage like a local file tree, probably using WebDAV, but this is my first successful preliminary solution. <tt>s3cmd</tt> does not work for me.</p>
<p>Using Ubuntu/Linux <tt>rsync</tt> is a well established, reliable and easy to use tool to keep data between locations in sync. The following post marries <tt>rsync</tt> with an <a href="http://aws.amazon.com/ec2/">Elastic Cloud (EC2)</a> server instance for an hour or some. One has to set up the so called rsync daemon and attach a persistent <a href="http://aws.amazon.com/ebs/">Elastic Block Storage</a>.</p>
<p>This is another post. I will link to it later. There will also be a small script. There are some holes in this tutorial, only the direct configuration of the rsync daemon (including the script) is complete and working. I filled in some hints how to get to this stage. But will write follow ups on that.</p>
<p><a href="http://a1979shakedown.wordpress.com/2009/01/19/set-up-an-rsync-server-in-ubuntu-for-file-syncing-between-machines/">System Out</a> provided a nice tutorial of how to set up the rsync in demon mode on a server which listens for clients to sync their data.</p>
<p>Here is my version of it, with a short script at the end which should do the job.</p>
<h1>Prerequisites</h1>
<p>Of course  you need to have <tt>rsync</tt> on both machines (the server and the client); since both are Ubuntu this is the case.</p>
<p>I will write another post on how to start the server. It is completely possible and quite intuitive to achieve it in the <a href="http://aws.amazon.com">Amazon web interface</a>. When the server is running and an <em>extra</em> EBS harddisk is attached you have to connect to the server using <tt>ssh</tt><br />
<code>ssh -i PATH/TO/YOUR/PEM-KEY-FILE ubuntu@ec2-xxx-xx-xxx-xxx.compute-1.amazonaws.com</code></p>
<h1>Mount the persistent drive</h1>
<p>There are some posts about the advantages of the xfs filesystem, so I sticked to it. <a href="">Alestic</a> recommends it for all persistent EC2 cloud disks and I trust they know what they are doing. But <tt>xfs</tt> is not per default included in the Ubuntu micro instance I use for my backups. That said, in the <tt>SSH</tt> shell:</p>
<p><code>sudo apt-get install -y xfsprogs<br />
sudo modprobe xfs</code></p>
<p>If the backup volume is newly created then format it:<br />
<code>sudo mkfs.xfs /dev/xvdb</code><br />
<strong>Note:</strong> Only the <em>first</em> time. Otherwise you wipe your data, of course. Note also the device name. I attached it as <tt>/dev/sdb</tt>. Though it showed up in the Ubuntu Oneiric i386 t1.micro instance as <tt>/dev/xvdb</tt>.</p>
<p>Now mount the volume<br />
<code>echo "/dev/xvdb /media/backup xfs noatime 0 0" | sudo tee -a /etc/fstab<br />
sudo mkdir /media/backup<br />
sudo mount /media/backup<br />
sudo chown ubuntu:ubuntu /media/backup<br />
sudo chmod 777 /media/backup</code></p>
<h1>Configuration files</h1>
<p>On the server machine you need to set up a daemon to run in the background and host the <tt>rsync</tt> services.</p>
<p>Before you start the daemon you need to create some <tt>rsync</tt> daemon configuration files in the <tt>/etc</tt> directory.</p>
<p>Three files are necessary:</p>
<ol>
<li><tt>/etc/rsyncd.conf</tt>, the actual configuration file,</li>
<li><tt>/etc/rsyncd.motd</tt>, <strong>M</strong>essage <strong>O</strong>f <strong>T</strong>he <strong>D</strong>ay file (the contents of this file will be displayed by the server when a client machine connects) and </li>
<li><tt>/etc/rsyncd.scrt</tt>, the username and password pairs.</li>
</ol>
<p>To create the files on the server:<br />
<code>sudo nano /etc/rsyncd.conf</code></p>
<p>Now enter the following information into the <tt>rsyncd.conf</tt> file:</p>
<p><code>motd file = /etc/rsyncd.motd<br />
[backup]<br />
path = /media/backup<br />
comment = the path to the backup directory on the server<br />
uid = ubuntu<br />
gid = ubuntu<br />
read only = false<br />
auth users = ubuntu<br />
secrets file = /etc/rsyncd.scrt</code></p>
<p>Hit <tt>Ctrl-o</tt> to save and <tt>Ctrl-x</tt> to close nano.</p>
<p>The <tt>uid, gid, auth users</tt> are the users on the server. In the ssh session on the ec2 instance the user is <tt>ubuntu</tt>.</p>
<p>The format for the <tt>/etc/rsync.scrt</tt> file is<br />
<code>username:whatever_password_you_want</code></p>
<p>Use <tt>nano</tt> to put some arbitrary text into the <tt>/etc/rsync.motd</tt>.</p>
<p>Now you should have all the configuration information necessary, all that&#8217;s left to do is open the <tt>rsync</tt> port and start the daemon.</p>
<p>To open the port, open the <tt>/etc/default/rsync</tt> file, i.e.,</p>
<p><code>sudo nano /etc/default/rsync</code></p>
<p>and set <tt>RSYNC_ENABLE=true</tt>.</p>
<p>Here you might also specify another port than the default 873. Remember to open the port in the security group. Either with the AWS web interface in your browser or in the shell using the <tt>ec2-api-tools</tt>:<br />
<code>ec2-authorize default -p 873</code></p>
<p>Now to start the daemon,<br />
<code>sudo /etc/init.d/rsync restart</code><br />
and exit the <tt>SSH</tt> session.</p>
<h1>Syncing a folder</h1>
<p>Now you can use your local shell to push some folders or files to the server. Update the server side from the client machine with ec2-api-tools installed:<br />
<code>EXIP=`ec2din | grep INSTANCE | grep -v terminated |awk '{print $4}'`<br />
rsync -auv /home/rforge/articles ubuntu@$EXIP::backup/</code><br />
<tt>$EXIP</tt> would be the server ip address</p>
<p>This gets the IP of the server from the <tt>ec2-api-tool</tt> and passes it to <tt>RSYNC</tt>.</p>
<p>Otherwise you have to remember the IP of your instance from the web interface and substitut it for <tt>xxx.xxx.xxx.xxx</tt>:<br />
<code>rsync -auv /PATH/TO/FOLDER/ ubuntu@$xxx.xxx.xxx.xxx::backup/</code></p>
<p><tt>::backup</tt> has to match <tt>[backup]</tt> in the <tt>/etc/rsyncd.conf</tt> file. You will see the <tt>rsyncd.motd</tt> message and get prompted for the password in the <tt>rsyncd.scrt</tt> file. Then rsync starts the upload.</p>
<h1>A Script</h1>
<p>The following script should do the daemon setup after connecting to the server via <tt>ssh</tt> and mounting the volume. Keep me posted if something does not work.</p>
<p><code>echo "motd file = /etc/rsyncd.motd<br />
[backup]<br />
path = /media/backup<br />
comment = the path to the backup directory on the server<br />
uid = ubuntu<br />
gid = ubuntu<br />
read only = false<br />
auth users = ubuntu<br />
secrets file = /etc/rsyncd.scrt" &gt; rsyncd.conf<br />
sudo mv rsyncd.conf /etc/<br />
#<br />
sudo echo "Greetings! Give me the right password! Me want's it!" &gt; rsyncd.motd<br />
sudo mv rsyncd.motd /etc/<br />
#<br />
sudo echo "ubuntu:YourSecretPassword" &gt; rsyncd.scrt<br />
sudo mv rsyncd.scrt /etc/<br />
#<br />
sudo chmod 640 /etc/rsyncd.*<br />
sudo chown root:root /etc/rsyncd.*<br />
#<br />
## enable demon mode in the /etc/default/rsync file<br />
sudo cat /etc/default/rsync | sed 's/RSYNC_ENABLE=false/RSYNC_ENABLE=true/g' &gt; rsync<br />
sudo mv rsync /etc/default/<br />
sudo chown root:root /etc/default/rsync<br />
sudo chmod 644 /etc/default/rsync<br />
#<br />
sudo /etc/init.d/rsync restart # start the demon</code></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/rforge.wordpress.com/722/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/rforge.wordpress.com/722/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/rforge.wordpress.com/722/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/rforge.wordpress.com/722/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/rforge.wordpress.com/722/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/rforge.wordpress.com/722/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/rforge.wordpress.com/722/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/rforge.wordpress.com/722/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/rforge.wordpress.com/722/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/rforge.wordpress.com/722/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/rforge.wordpress.com/722/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/rforge.wordpress.com/722/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/rforge.wordpress.com/722/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/rforge.wordpress.com/722/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rforge.org&amp;blog=7577563&amp;post=722&amp;subd=rforge&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://rforge.org/2011/11/16/data-backup-in-the-aws-cloud-with-rsync/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/2a4cc3be2c3e1c3b1442535ef7a46f42?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">rforge</media:title>
		</media:content>
	</item>
		<item>
		<title>R function to transform continuous variable to categorical factor cut at n-tiles</title>
		<link>http://rforge.org/2011/11/06/r-function-to-transform-continuous-variable-to-categorical-factor-cut-at-n-tiles/</link>
		<comments>http://rforge.org/2011/11/06/r-function-to-transform-continuous-variable-to-categorical-factor-cut-at-n-tiles/#comments</comments>
		<pubDate>Sun, 06 Nov 2011 20:45:13 +0000</pubDate>
		<dc:creator>rforge</dc:creator>
				<category><![CDATA[Statistics]]></category>
		<category><![CDATA[Use R!]]></category>
		<category><![CDATA[categorical]]></category>
		<category><![CDATA[continuous]]></category>
		<category><![CDATA[n-tiles]]></category>
		<category><![CDATA[quantiles]]></category>
		<category><![CDATA[R]]></category>
		<category><![CDATA[transform]]></category>

		<guid isPermaLink="false">http://rforge.org/2011/11/06/r-function-to-transform-continuous-variable-to-categorical-factor-cut-at-n-tiles/</guid>
		<description><![CDATA[The cut() function can be used to transform a continuous variable into a categorical factor variable. The syntax is quite lengthy and if one wishes to cut at quartiles, quintiles or other n-tiles one has to include the quantile() function into the call. This is not very newbee friendly and if included into a model-call [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rforge.org&amp;blog=7577563&amp;post=715&amp;subd=rforge&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>The <tt>cut()</tt> function can be used to transform a continuous variable into a categorical factor variable. The syntax is quite lengthy and if one wishes to cut at quartiles, quintiles or other n-tiles one has to include the <tt>quantile()</tt> function into the call.</p>
<p>This is not very newbee friendly and if included into a model-call nearly ufnreadable.</p>
<p>The function in the code box <tt>cut.at.n.tile()</tt> does the job.</p>
<p><code><br />
cut.at.n.tile &lt;- function(X , n = 4){ cut( X , breaks = quantile( X , probs = (0:n)/n , na.rm = TRUE ) , include.lowest = TRUE )}<br />
</code></p>
<p>In order to cut the continuous variable <tt>Creatinine</tt> in the dataset <tt>Patients</tt> into deciles (n=10) the syntax is:<br />
<code>cut.at.n.tile( Patients$Creatinine , n = 10 )</code></p>
<p>No big deal, but maybe useful&#8230;</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/rforge.wordpress.com/715/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/rforge.wordpress.com/715/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/rforge.wordpress.com/715/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/rforge.wordpress.com/715/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/rforge.wordpress.com/715/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/rforge.wordpress.com/715/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/rforge.wordpress.com/715/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/rforge.wordpress.com/715/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/rforge.wordpress.com/715/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/rforge.wordpress.com/715/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/rforge.wordpress.com/715/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/rforge.wordpress.com/715/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/rforge.wordpress.com/715/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/rforge.wordpress.com/715/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rforge.org&amp;blog=7577563&amp;post=715&amp;subd=rforge&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://rforge.org/2011/11/06/r-function-to-transform-continuous-variable-to-categorical-factor-cut-at-n-tiles/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/2a4cc3be2c3e1c3b1442535ef7a46f42?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">rforge</media:title>
		</media:content>
	</item>
		<item>
		<title>Find BIOS version in Ubuntu</title>
		<link>http://rforge.org/2011/10/04/find-bios-version-in-ubuntu/</link>
		<comments>http://rforge.org/2011/10/04/find-bios-version-in-ubuntu/#comments</comments>
		<pubDate>Tue, 04 Oct 2011 10:45:42 +0000</pubDate>
		<dc:creator>rforge</dc:creator>
				<category><![CDATA[BASH]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[BIOS]]></category>
		<category><![CDATA[dmidecode]]></category>
		<category><![CDATA[number]]></category>
		<category><![CDATA[revision]]></category>
		<category><![CDATA[shell]]></category>

		<guid isPermaLink="false">http://rforge.org/?p=712</guid>
		<description><![CDATA[The dmidecode command line utility dumps a list of SMBIOS specifications to the standard output. In order to get the version number of the currently installed BIOS open a shell and sudo dmidecode --type 0 &#124; grep Revision The &#8211;type 0 option restricts the output to BIOS specific information and grep fishes for the revision [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rforge.org&amp;blog=7577563&amp;post=712&amp;subd=rforge&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>The dmidecode command line utility dumps a list of SMBIOS specifications to the standard output. In order to get the version number of the currently installed BIOS open a shell and<br />
<code>sudo dmidecode --type 0 | grep Revision</code></p>
<p>The &#8211;type 0 option restricts the output to BIOS specific information and grep fishes for the revision number.</p>
<p>On my X61s Thinkpad the resulting output is<br />
<code>BIOS Revision: 2.19<br />
Firmware Revision: 1.3</code></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/rforge.wordpress.com/712/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/rforge.wordpress.com/712/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/rforge.wordpress.com/712/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/rforge.wordpress.com/712/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/rforge.wordpress.com/712/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/rforge.wordpress.com/712/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/rforge.wordpress.com/712/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/rforge.wordpress.com/712/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/rforge.wordpress.com/712/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/rforge.wordpress.com/712/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/rforge.wordpress.com/712/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/rforge.wordpress.com/712/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/rforge.wordpress.com/712/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/rforge.wordpress.com/712/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rforge.org&amp;blog=7577563&amp;post=712&amp;subd=rforge&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://rforge.org/2011/10/04/find-bios-version-in-ubuntu/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/2a4cc3be2c3e1c3b1442535ef7a46f42?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">rforge</media:title>
		</media:content>
	</item>
		<item>
		<title>BASH: Convert Uppercase to Lowercase letters</title>
		<link>http://rforge.org/2011/09/12/bash-convert-uppercase-to-lowercase-letters/</link>
		<comments>http://rforge.org/2011/09/12/bash-convert-uppercase-to-lowercase-letters/#comments</comments>
		<pubDate>Mon, 12 Sep 2011 08:24:14 +0000</pubDate>
		<dc:creator>rforge</dc:creator>
				<category><![CDATA[BASH]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[lowercase]]></category>
		<category><![CDATA[tr]]></category>
		<category><![CDATA[transform]]></category>
		<category><![CDATA[uppercase]]></category>

		<guid isPermaLink="false">http://rforge.org/?p=710</guid>
		<description><![CDATA[Vivek Gite on nixCraft suggests tr to tranform uppercase letters in the textfile input.txt to lowercase and output the transformed text to output.txt. tr '[:upper:]' '[:lower:]' output.txt I needed to clean up a messy old scriptfile where I lost track of my variable naming convention. Very useful indeed<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rforge.org&amp;blog=7577563&amp;post=710&amp;subd=rforge&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.cyberciti.biz/faq/linux-unix-shell-programming-converting-lowercase-uppercase/" target="_blank">Vivek Gite on nixCraft</a> suggests <em>tr</em> to tranform uppercase letters in the textfile <em>input.txt</em> to lowercase and output the transformed text to <em>output.txt</em>.</p>
<p><code>tr '[:upper:]' '[:lower:]'  output.txt</code></p>
<p>I needed to clean up a messy old scriptfile where I lost track of my variable naming convention.</p>
<p>Very useful indeed <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/rforge.wordpress.com/710/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/rforge.wordpress.com/710/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/rforge.wordpress.com/710/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/rforge.wordpress.com/710/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/rforge.wordpress.com/710/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/rforge.wordpress.com/710/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/rforge.wordpress.com/710/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/rforge.wordpress.com/710/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/rforge.wordpress.com/710/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/rforge.wordpress.com/710/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/rforge.wordpress.com/710/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/rforge.wordpress.com/710/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/rforge.wordpress.com/710/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/rforge.wordpress.com/710/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rforge.org&amp;blog=7577563&amp;post=710&amp;subd=rforge&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://rforge.org/2011/09/12/bash-convert-uppercase-to-lowercase-letters/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/2a4cc3be2c3e1c3b1442535ef7a46f42?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">rforge</media:title>
		</media:content>
	</item>
		<item>
		<title>Add public key behind a firewall in Ubuntu Shell</title>
		<link>http://rforge.org/2011/09/07/add-public-key-behind-a-firewall-in-ubuntu-shell/</link>
		<comments>http://rforge.org/2011/09/07/add-public-key-behind-a-firewall-in-ubuntu-shell/#comments</comments>
		<pubDate>Wed, 07 Sep 2011 12:03:10 +0000</pubDate>
		<dc:creator>rforge</dc:creator>
				<category><![CDATA[BASH]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[Use R!]]></category>
		<category><![CDATA[apt-key]]></category>
		<category><![CDATA[cran]]></category>
		<category><![CDATA[firewall]]></category>
		<category><![CDATA[GPG]]></category>
		<category><![CDATA[keyserver]]></category>
		<category><![CDATA[port 80]]></category>
		<category><![CDATA[public key]]></category>
		<category><![CDATA[repository]]></category>

		<guid isPermaLink="false">http://rforge.org/?p=704</guid>
		<description><![CDATA[In short: Use sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80/ --recv-key E084DAB9 instead of sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-key E084DAB9 This way you force port 80 which is usually clear. I got the idea from the answer of Phil Bradley on the superuser.com forum. He claimed that this would be fixed in Natty, but it isn&#8217;t [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rforge.org&amp;blog=7577563&amp;post=704&amp;subd=rforge&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>In short: Use<br />
<code>sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80/ --recv-key E084DAB9</code><br />
instead of<br />
<code>sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-key E084DAB9</code><br />
This way you force port 80 which is usually clear.</p>
<p>I got the idea from the answer of <a href="http://superuser.com/questions/64922/how-to-work-around-blocked-outbound-hkp-port-for-apt-keys">Phil Bradley</a> on the superuser.com forum. He claimed that this would be fixed in Natty, but it isn&#8217;t although the configuration file he mentions has the port80 specification added by default, apt-key does not use it. The above snippet solves that.</p>
<p>For those Ubuntu users who have no idea what I am talking about:</p>
<p>Installing the newest R-version in Ubuntu requires to append the CRAN repository to you /etc/apt/sources.list. One might hit Alt+F2 and enter<br />
<code>gksu gedit /etc/apt/sources.list</code></p>
<p>With Xubuntu you would use mousepad instead of gedit. In any distro you can use<br />
<code>sudo nano /etc/apt/sources.list</code><br />
in a terminal.</p>
<p>Usually I add the line<br />
<code>deb http://cran.uib.no/bin/linux/ubuntu natty/</code><br />
at the end of the file and update with<br />
<code>sudo apt-get update</code>.</p>
<p>CRAN at University of Bergen is closest to me. You might want another one (check the r-project.org site for mirrors).</p>
<p>apt-get update answers with a warning<br />
<code>GPG error: http://cran.uib.no nat/ Release: The folowing signatures coldn't be verified because the public key is not abailable</code></p>
<p>That is not a problem. One can install R and packages anyway, but it is better to have the public key.</p>
<p>Behind a firewall (and many public and open hotspots block several ports) it is not possible to use</p>
<p><code>sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-key E084DAB9</code></p>
<p>since the port through which the keyserver is contacted is blocked on most firewalls. You have to force port 80 by:<br />
<code>sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80/ --recv-key E084DAB9</code></p>
<p>After the key is added<br />
<code>sudo apt-get update<br />
sudo apt-get install R-recommended emacs ess</code><br />
proceeds without warning nor error.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/rforge.wordpress.com/704/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/rforge.wordpress.com/704/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/rforge.wordpress.com/704/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/rforge.wordpress.com/704/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/rforge.wordpress.com/704/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/rforge.wordpress.com/704/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/rforge.wordpress.com/704/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/rforge.wordpress.com/704/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/rforge.wordpress.com/704/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/rforge.wordpress.com/704/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/rforge.wordpress.com/704/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/rforge.wordpress.com/704/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/rforge.wordpress.com/704/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/rforge.wordpress.com/704/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rforge.org&amp;blog=7577563&amp;post=704&amp;subd=rforge&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://rforge.org/2011/09/07/add-public-key-behind-a-firewall-in-ubuntu-shell/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/2a4cc3be2c3e1c3b1442535ef7a46f42?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">rforge</media:title>
		</media:content>
	</item>
		<item>
		<title>Move a table between MySQL databases</title>
		<link>http://rforge.org/2011/09/02/move-a-table-between-mysql-databases/</link>
		<comments>http://rforge.org/2011/09/02/move-a-table-between-mysql-databases/#comments</comments>
		<pubDate>Fri, 02 Sep 2011 13:19:46 +0000</pubDate>
		<dc:creator>rforge</dc:creator>
				<category><![CDATA[Database]]></category>
		<category><![CDATA[alter table]]></category>
		<category><![CDATA[mysql]]></category>

		<guid isPermaLink="false">http://rforge.org/?p=701</guid>
		<description><![CDATA[Having organized a lot of datasets in severeal MySQL databases on the same (local)-server the I needed to move a table to another database. The posted solution is copy-paste from Eric Bergen on the MySQL forum: Alter table can be used to move tables from one db to another. alter table old_db.foo rename new_db.foo<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rforge.org&amp;blog=7577563&amp;post=701&amp;subd=rforge&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Having organized a lot of datasets in severeal MySQL databases on the same (local)-server the I needed to move a table to another database. The posted solution is copy-paste from <a href="http://forums.mysql.com/read.php?22,206174,206188#msg-206188" target="_blank">Eric Bergen on the MySQL forum</a>:</p>
<blockquote><p>Alter table can be used to move tables from one db to another. </p>
<p><code>alter table old_db.foo rename new_db.foo</code></p></blockquote>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/rforge.wordpress.com/701/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/rforge.wordpress.com/701/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/rforge.wordpress.com/701/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/rforge.wordpress.com/701/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/rforge.wordpress.com/701/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/rforge.wordpress.com/701/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/rforge.wordpress.com/701/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/rforge.wordpress.com/701/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/rforge.wordpress.com/701/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/rforge.wordpress.com/701/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/rforge.wordpress.com/701/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/rforge.wordpress.com/701/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/rforge.wordpress.com/701/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/rforge.wordpress.com/701/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rforge.org&amp;blog=7577563&amp;post=701&amp;subd=rforge&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://rforge.org/2011/09/02/move-a-table-between-mysql-databases/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/2a4cc3be2c3e1c3b1442535ef7a46f42?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">rforge</media:title>
		</media:content>
	</item>
		<item>
		<title>Sane PATH variable in Emacs on Mac OS X</title>
		<link>http://rforge.org/2011/08/16/sane-path-variable-in-emacs-on-mac-os-x/</link>
		<comments>http://rforge.org/2011/08/16/sane-path-variable-in-emacs-on-mac-os-x/#comments</comments>
		<pubDate>Tue, 16 Aug 2011 09:12:51 +0000</pubDate>
		<dc:creator>rforge</dc:creator>
				<category><![CDATA[BASH]]></category>
		<category><![CDATA[Database]]></category>
		<category><![CDATA[Emacs]]></category>
		<category><![CDATA[/usr/local/mysql/bin]]></category>
		<category><![CDATA[Mac OS X]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[path variable]]></category>

		<guid isPermaLink="false">http://rforge.org/?p=680</guid>
		<description><![CDATA[On Mac OS X the system PATH variable is not recognized by emacs. This means that one can not simply type in the emacs shell to get into the database. The emacs shell complains about &#8220;binary not found&#8221;. Indeed reveals that emacs just looks into /bin, /usr/bin, /sbin and /usr/sbin. To set the $PATH variable [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rforge.org&amp;blog=7577563&amp;post=680&amp;subd=rforge&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>On Mac OS X the system PATH variable is not recognized by emacs. This means that one can not simply type <pre class="brush: plain;">mysql</pre> in the emacs shell to get into the database. The emacs shell complains about &#8220;binary not found&#8221;.</p>
<p>Indeed<br />
<pre class="brush: plain;">echo $PATH</pre><br />
reveals that emacs just looks into /bin, /usr/bin, /sbin and /usr/sbin.</p>
<p>To set the $PATH variable inside emacs one can append the following lines to the .emacs file (found on <a href="https://github.com/al3x/emacs/blob/master/customizations/my-shell.el" target="_blank">github</a>, hattip Alex Payne):</p>
<p><pre class="brush: plain;">; sane path
(setq path &quot;/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin:/usr/local/mysql/bin&quot;)
(setenv &quot;PATH&quot; path)</pre></p>
<p>Next time Emacs starts one can go to the shell and<br />
<pre class="brush: plain;">mysql</pre><br />
presents the database prompt.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/rforge.wordpress.com/680/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/rforge.wordpress.com/680/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/rforge.wordpress.com/680/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/rforge.wordpress.com/680/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/rforge.wordpress.com/680/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/rforge.wordpress.com/680/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/rforge.wordpress.com/680/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/rforge.wordpress.com/680/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/rforge.wordpress.com/680/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/rforge.wordpress.com/680/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/rforge.wordpress.com/680/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/rforge.wordpress.com/680/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/rforge.wordpress.com/680/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/rforge.wordpress.com/680/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rforge.org&amp;blog=7577563&amp;post=680&amp;subd=rforge&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://rforge.org/2011/08/16/sane-path-variable-in-emacs-on-mac-os-x/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/2a4cc3be2c3e1c3b1442535ef7a46f42?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">rforge</media:title>
		</media:content>
	</item>
		<item>
		<title>Compressed backup of MySQL database</title>
		<link>http://rforge.org/2011/07/20/compressed-backup-of-mysql-database/</link>
		<comments>http://rforge.org/2011/07/20/compressed-backup-of-mysql-database/#comments</comments>
		<pubDate>Wed, 20 Jul 2011 10:34:34 +0000</pubDate>
		<dc:creator>rforge</dc:creator>
				<category><![CDATA[Backup]]></category>
		<category><![CDATA[BASH]]></category>
		<category><![CDATA[Database]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[mysql]]></category>

		<guid isPermaLink="false">http://rforge.org/?p=674</guid>
		<description><![CDATA[Wrote several posts on this topic, but none was 100% right. The following is a blockquote from webcheatsheet.com and looks much better researched then my previous tries: Back up your MySQL Database with Compress If your mysql database is very big, you might want to compress the output of mysqldump. Just use the mysql backup [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rforge.org&amp;blog=7577563&amp;post=674&amp;subd=rforge&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Wrote several posts on this topic, but none was 100% right. The following is a <a href="http://www.webcheatsheet.com/SQL/mysql_backup_restore.php" target="_blank">blockquote from webcheatsheet.com</a> and looks much better researched then my previous tries:</p>
<blockquote><h3>Back up your MySQL Database with Compress</h3>
<p>If your mysql database is very big, you might want to compress the output of mysqldump. Just use the mysql backup command below and pipe the output to gzip, then you will get the output as gzip file.</p>
<p><code>$ mysqldump -u [uname] -p[pass] [dbname] | gzip -9 &gt; [backupfile.sql.gz]</code><br />
If you want to extract the .gz file, use the command below:</p>
<p><code>$ gunzip [backupfile.sql.gz]</code></p>
<h3>Restoring your MySQL Database</h3>
<p>Above we backup the Tutorials database into tut_backup.sql file. To re-create the Tutorials database you should follow two steps:</p>
<p>Create an appropriately named database on the target machine<br />
Load the file using the mysql command:<br />
<code>$ mysql -u [uname] -p[pass] [db_to_restore] &lt; [backupfile.sql]</code><br />
Have a look how you can restore your tut_backup.sql file to the Tutorials database.</p>
<p><code>$ mysql -u root -p Tutorials &lt; tut_backup.sql</code><br />
To restore compressed backup files you can do the following:</p>
<p><code>gunzip &lt; [backupfile.sql.gz] | mysql -u [uname] -p[pass] [dbname]</code></p></blockquote>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/rforge.wordpress.com/674/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/rforge.wordpress.com/674/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/rforge.wordpress.com/674/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/rforge.wordpress.com/674/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/rforge.wordpress.com/674/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/rforge.wordpress.com/674/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/rforge.wordpress.com/674/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/rforge.wordpress.com/674/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/rforge.wordpress.com/674/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/rforge.wordpress.com/674/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/rforge.wordpress.com/674/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/rforge.wordpress.com/674/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/rforge.wordpress.com/674/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/rforge.wordpress.com/674/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rforge.org&amp;blog=7577563&amp;post=674&amp;subd=rforge&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://rforge.org/2011/07/20/compressed-backup-of-mysql-database/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/2a4cc3be2c3e1c3b1442535ef7a46f42?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">rforge</media:title>
		</media:content>
	</item>
		<item>
		<title>Remove empty lines with SED</title>
		<link>http://rforge.org/2011/06/30/remove-empty-lines-with-sed/</link>
		<comments>http://rforge.org/2011/06/30/remove-empty-lines-with-sed/#comments</comments>
		<pubDate>Thu, 30 Jun 2011 07:56:08 +0000</pubDate>
		<dc:creator>rforge</dc:creator>
				<category><![CDATA[BASH]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[sed]]></category>

		<guid isPermaLink="false">http://rforge.org/?p=668</guid>
		<description><![CDATA[Raw data is often delivered in Excel-sheets with a lot of noise and formating around. For analysis in R or other packages the real raw data is required. Scripting the &#8220;deformating&#8221; in plain text / csv files using shell tools like SED, AWK or Pearl to remove excess text in the datasheets makes it possible [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rforge.org&amp;blog=7577563&amp;post=668&amp;subd=rforge&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Raw data is often delivered in Excel-sheets with a lot of noise and formating around. For analysis in R or other packages the <em>real</em> raw data is required. Scripting the &#8220;deformating&#8221; in plain text / csv files using shell tools like <em>SED</em>, <em>AWK</em> or <em>Pearl</em> to remove excess text in the datasheets makes it possible to rerun the procedure or track systematic errors.</p>
<p>Removing empty lines from a file containing code in plain text (like .csv, .html, .php, etc&#8230;) is very easy with SED in a UNIX/ MAC OS shell and even possible in the Windows CMD (after installing SED). The following is a blockquote from <a href="http://soft.zoneo.net/Linux/remove_empty_lines.php" target="_blank">ZoneO-tips for Mandriva Linux</a> which I found really useful and well written:</p>
<blockquote><p>So, open up a konsole and move into the directory where your file resides (cd MyDirectory). And here we go with the two lines that&#8217;ll do the job </p>
<p><code>sed '/^$/d' myFile &gt; tt<br />
mv tt myFile </code> </p>
<p>Here is what happens: </p>
<p><code>sed '/^$/d' myFile</code> removes all empty lines from the file myFile and outputs the result in the console, <code>&gt; tt</code> redirects the output into a temporary file called tt,<br />
<code>mv tt myFile</code> moves the temporary file tt to myFile.</p>
<p>Now, you may have 100 html files to correct at the same time. That&#8217;s where foreach comes in&#8230; Let&#8217;s say you want to correct all files ending with .html, here is what you should do: </p>
<p>Open up a konsole, move into the directory where your html files reside, type the following commands:</p>
<p><code>foreach file (*html)<br />
sed '/^$/d' $file &gt; tt<br />
mv tt $file<br />
end</code></p>
<p>Finished! </p></blockquote>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/rforge.wordpress.com/668/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/rforge.wordpress.com/668/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/rforge.wordpress.com/668/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/rforge.wordpress.com/668/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/rforge.wordpress.com/668/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/rforge.wordpress.com/668/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/rforge.wordpress.com/668/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/rforge.wordpress.com/668/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/rforge.wordpress.com/668/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/rforge.wordpress.com/668/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/rforge.wordpress.com/668/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/rforge.wordpress.com/668/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/rforge.wordpress.com/668/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/rforge.wordpress.com/668/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rforge.org&amp;blog=7577563&amp;post=668&amp;subd=rforge&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://rforge.org/2011/06/30/remove-empty-lines-with-sed/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/2a4cc3be2c3e1c3b1442535ef7a46f42?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">rforge</media:title>
		</media:content>
	</item>
		<item>
		<title>MySQL tables must have indexes</title>
		<link>http://rforge.org/2011/06/16/mysql-tables-must-have-indexes/</link>
		<comments>http://rforge.org/2011/06/16/mysql-tables-must-have-indexes/#comments</comments>
		<pubDate>Thu, 16 Jun 2011 10:16:30 +0000</pubDate>
		<dc:creator>rforge</dc:creator>
				<category><![CDATA[Database]]></category>
		<category><![CDATA[index]]></category>
		<category><![CDATA[indexes]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[performance]]></category>
		<category><![CDATA[slow]]></category>

		<guid isPermaLink="false">http://rforge.org/?p=663</guid>
		<description><![CDATA[A newbee to MySQL myself I had a rather odd experience: A simple inner join of three research tables took severeal hours. I posted the problem on the forum.mysql.com and the following is the result of the post. To give the conclusion first: Always create indexes for each key-variable in each and every MySQL table, [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rforge.org&amp;blog=7577563&amp;post=663&amp;subd=rforge&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>A newbee to MySQL myself I had a rather odd experience: A simple inner join of three research tables took severeal hours. I posted the problem on the forum.mysql.com and the following is the result of the post.</p>
<p>To give the conclusion first:</p>
<ol>
<li><em>Always</em> create indexes for each key-variable in each and every MySQL table, no matter how small or big.<br />
<code>ALTER TABLE MyTable ADD INDEX(MyID)</code><br />
where MyTable is a Table in the database and MyID is one of the key variables.</p>
<li><em>Never</em> use brackets in consecutive joint statements! The right way is:<br />
<code>select * from Table_A A inner join Table_B B on A.id = B.id inner join Table_C on A.id = C.id;</code><br />
Brackets force the creation of temporary tables and increase execution time</li>
<p>The first one is the most important. It reduced the time for a join from more then 10 hours to a couple of minutes.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/rforge.wordpress.com/663/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/rforge.wordpress.com/663/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/rforge.wordpress.com/663/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/rforge.wordpress.com/663/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/rforge.wordpress.com/663/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/rforge.wordpress.com/663/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/rforge.wordpress.com/663/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/rforge.wordpress.com/663/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/rforge.wordpress.com/663/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/rforge.wordpress.com/663/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/rforge.wordpress.com/663/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/rforge.wordpress.com/663/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/rforge.wordpress.com/663/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/rforge.wordpress.com/663/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rforge.org&amp;blog=7577563&amp;post=663&amp;subd=rforge&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://rforge.org/2011/06/16/mysql-tables-must-have-indexes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/2a4cc3be2c3e1c3b1442535ef7a46f42?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">rforge</media:title>
		</media:content>
	</item>
	</channel>
</rss>
