<?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 &#187; Ubuntu</title>
	<atom:link href="http://rforge.org/category/ubuntu/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 &#187; Ubuntu</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>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>Setup FTP on Amazon EC2</title>
		<link>http://rforge.org/2010/09/19/setup-ftp-on-amazon-ec2/</link>
		<comments>http://rforge.org/2010/09/19/setup-ftp-on-amazon-ec2/#comments</comments>
		<pubDate>Sun, 19 Sep 2010 16:10:35 +0000</pubDate>
		<dc:creator>rforge</dc:creator>
				<category><![CDATA[Amazon Web Services]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://rforge.org/?p=579</guid>
		<description><![CDATA[If your Amazon EC2 instance is finally running &#8211; which is another story &#8211; one would want to have ftp access to upload files and documents. I got the inspiration to use vsftpd from curiousdeveloper.blogspot.com Open port 21 for ftp access on you running instances: ec2-authorize default -p 21 Connect to your instance via ssh [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rforge.org&amp;blog=7577563&amp;post=579&amp;subd=rforge&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>If your <a href="http://aws.amazon.com/ec2/">Amazon EC2</a> instance is finally running &#8211; which is another story &#8211; one would want to have ftp access to upload files and documents.</p>
<p>I got the inspiration to use <em>vsftpd</em> from <a href="http://curiousdeveloper.blogspot.com/2008/07/setting-up-ftp-server-on-ubuntu-amazon.html">curiousdeveloper.blogspot.com</a></p>
<ol>
<li>Open port 21 for ftp access on you running instances:<br />
<code>ec2-authorize default -p 21</code></li>
<li>Connect to your instance via ssh<br />
<code>ip=`ec2din | grep I | cut -f17`<br />
ssh -i /path/to/yourkey.pem ubuntu@$ip</code></li>
<li>Install vsftpd<br />
<code>sudo aptitude install vsftpd</code></li>
<li>Start the demon<br />
<code>sudo /etc/init.d/vsftpd start</code></li>
</ol>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/rforge.wordpress.com/579/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/rforge.wordpress.com/579/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/rforge.wordpress.com/579/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/rforge.wordpress.com/579/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/rforge.wordpress.com/579/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/rforge.wordpress.com/579/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/rforge.wordpress.com/579/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/rforge.wordpress.com/579/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/rforge.wordpress.com/579/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/rforge.wordpress.com/579/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/rforge.wordpress.com/579/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/rforge.wordpress.com/579/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/rforge.wordpress.com/579/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/rforge.wordpress.com/579/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rforge.org&amp;blog=7577563&amp;post=579&amp;subd=rforge&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://rforge.org/2010/09/19/setup-ftp-on-amazon-ec2/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>Replacing capitals with normal letters using SED</title>
		<link>http://rforge.org/2010/05/30/replacing-capitals-with-normal-letters-using-sed/</link>
		<comments>http://rforge.org/2010/05/30/replacing-capitals-with-normal-letters-using-sed/#comments</comments>
		<pubDate>Sun, 30 May 2010 06:51:11 +0000</pubDate>
		<dc:creator>rforge</dc:creator>
				<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[capitals]]></category>
		<category><![CDATA[lowercase]]></category>
		<category><![CDATA[sed]]></category>

		<guid isPermaLink="false">http://rforge.org/?p=557</guid>
		<description><![CDATA[Needed to change CAPITAL variable names to normal in a long SQL-syntax file. Sourceforge had a way to do it with SED. GSED 4.+ supports the \L&#38; and \U&#38; switches to transform everything to lowercase or uppercase respectively: sed 's/MyRegExp/\L&#38;/g' changes the regular expression MyRegExp into lowercase.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rforge.org&amp;blog=7577563&amp;post=557&amp;subd=rforge&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><a href="http://sed.sourceforge.net/sedfaq4.html">Needed to change CAPITAL variable names to normal in a long SQL-syntax file. Sourceforge had a way to do it with SED.</a></p>
<p>GSED 4.+ supports the <em>\L&amp;</em> and <em>\U&amp;</em> switches to transform everything to lowercase or uppercase respectively:</p>
<p><code>sed 's/MyRegExp/\L&amp;/g'</code></p>
<p>changes the regular expression <em>MyRegExp</em> into lowercase.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/rforge.wordpress.com/557/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/rforge.wordpress.com/557/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/rforge.wordpress.com/557/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/rforge.wordpress.com/557/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/rforge.wordpress.com/557/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/rforge.wordpress.com/557/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/rforge.wordpress.com/557/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/rforge.wordpress.com/557/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/rforge.wordpress.com/557/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/rforge.wordpress.com/557/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/rforge.wordpress.com/557/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/rforge.wordpress.com/557/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/rforge.wordpress.com/557/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/rforge.wordpress.com/557/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rforge.org&amp;blog=7577563&amp;post=557&amp;subd=rforge&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://rforge.org/2010/05/30/replacing-capitals-with-normal-letters-using-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>Using gammu to connect to a mobile phone</title>
		<link>http://rforge.org/2010/05/28/using-gammu-to-connect-to-a-mobile-phone/</link>
		<comments>http://rforge.org/2010/05/28/using-gammu-to-connect-to-a-mobile-phone/#comments</comments>
		<pubDate>Fri, 28 May 2010 13:20:27 +0000</pubDate>
		<dc:creator>rforge</dc:creator>
				<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[gammu]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[mobile phone]]></category>
		<category><![CDATA[shell]]></category>

		<guid isPermaLink="false">http://rforge.org/2010/05/28/using-gammu-to-connect-to-a-mobile-phone/</guid>
		<description><![CDATA[After switching between mobile phones several times I always lost some data, contacts, media, so on&#8230; There is a Linux tool called Gammu which allows to connect a selection of mobile phones. It seems that Gammus functionality is maximal for Nokia and Siemens, but I will give it a try on my Sony Ericsson&#8230; The [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rforge.org&amp;blog=7577563&amp;post=556&amp;subd=rforge&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>After switching between mobile phones several times I always lost some data, contacts, media, so on&#8230;</p>
<p>There is a Linux tool called <em>Gammu</em> which allows to connect a selection of mobile phones. It seems that Gammus functionality is maximal for Nokia and Siemens, but I will give it a try on my Sony Ericsson&#8230;</p>
<p>The configuration is not trivial and I found some hints on <a href="http://john.mcclumpha.org/linux/Build_your_own_SMS_gateway_with_Ubuntu_Linux_and_Gammu/">JohnMcClumpha.org</a>:</p>
<h3>Install Gammu</h3>
<p>Installing gammu is surprisingly easy (once again thanks to the wonders of apt-get), just use the following command:</p>
<pre>sudo apt-get install gammu</pre>
<p>Hard wasn&#8217;t it? <img src='http://s1.wp.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>OK now it&#8217;s time to plug your phone in and see if we can get things talking. With the phone connected, type the following command:</p>
<pre>lsusb</pre>
<p>you should now see your phone listed as a device &#8211; for example:</p>
<pre>Bus 001 Device 002: ID 0421:0802 Nokia Mobile Phones</pre>
<p>if not &#8211; make sure your cables and power are all good and try again.</p>
<p>The gammu installation comes with some example configuration files which are worth using as a starting point &#8211; if nothing else they help you to understand how gammu can be configured so that you can tailor a solution for your needs. These are located in<strong><br />
/usr/share/doc/gammu/examples</strong> (in gZip archives).</p>
<p>Copy the gammurc file to /etc/gammurc :</p>
<pre>sudo cp /usr/share/doc/gammu/examples/config/gammurc /etc/gammurc</pre>
<p>Now edit /etc/gammurc to specify your port and connection type (this will vary based upon where/how you have things plugged in and what sort of cable/interface your phone is using). The settings for mine are:</p>
<pre>port = /dev/ttyACM0
connection = dku5</pre>
<p>Save this config and from the shell type:</p>
<pre>gammu --identify</pre>
<p>you should now be presented with some information regaqrding your phone such as:</p>
<pre>Manufacturer : Nokia
Model : 7200 (RH-23)
Firmware : 3.110 T (18-03-04)
Hardware : 0903
IMEI : 353363000813894
Original IMEI : 353363/00/081389/4
Manufactured : 04/2004
Product code : 0514143
UEM : 16
</pre>
<p>If this is the case then you have got gammu up and running and can send yourself a test message with the following command:</p>
<pre> echo &quot;boo&quot; | gammu --sendsms TEXT [recipient mobile number]</pre>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/rforge.wordpress.com/556/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/rforge.wordpress.com/556/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/rforge.wordpress.com/556/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/rforge.wordpress.com/556/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/rforge.wordpress.com/556/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/rforge.wordpress.com/556/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/rforge.wordpress.com/556/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/rforge.wordpress.com/556/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/rforge.wordpress.com/556/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/rforge.wordpress.com/556/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/rforge.wordpress.com/556/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/rforge.wordpress.com/556/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/rforge.wordpress.com/556/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/rforge.wordpress.com/556/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rforge.org&amp;blog=7577563&amp;post=556&amp;subd=rforge&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://rforge.org/2010/05/28/using-gammu-to-connect-to-a-mobile-phone/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>Restructuring the filetree &#8211; moving files from multiple directories</title>
		<link>http://rforge.org/2010/04/29/restructuring-the-filetree-moving-files-from-multiple-directories/</link>
		<comments>http://rforge.org/2010/04/29/restructuring-the-filetree-moving-files-from-multiple-directories/#comments</comments>
		<pubDate>Thu, 29 Apr 2010 15:35:54 +0000</pubDate>
		<dc:creator>rforge</dc:creator>
				<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[filetree]]></category>
		<category><![CDATA[find]]></category>
		<category><![CDATA[restructure]]></category>

		<guid isPermaLink="false">http://rforge.org/?p=550</guid>
		<description><![CDATA[I am considering changing the structure of my /home directory, maybe completely changing my data organisation habbits. I found this post on ubuntuforums very useful: You need to use find For this example I`m going to assume that all the .txt files are located in directories and subdirectories of your Documents folder and you want [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rforge.org&amp;blog=7577563&amp;post=550&amp;subd=rforge&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I am considering changing the structure of my /home directory, maybe completely changing my data organisation habbits.</p>
<p>I found <a href="http://swiss.ubuntuforums.org/showthread.php?p=9130071">this post on ubuntuforums</a> very useful:</p>
<blockquote><p>
You need to use <strong>find</strong></p>
<p>For this example I`m going to assume that all the .txt files are located in directories and subdirectories of your Documents folder and you want to move them to a directory in your home called scripts<br />
Code:<br />
<code>find ~/Documents -name '*.txt' -exec mv '{}' ~/scripts \;</code>
</p></blockquote>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/rforge.wordpress.com/550/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/rforge.wordpress.com/550/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/rforge.wordpress.com/550/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/rforge.wordpress.com/550/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/rforge.wordpress.com/550/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/rforge.wordpress.com/550/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/rforge.wordpress.com/550/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/rforge.wordpress.com/550/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/rforge.wordpress.com/550/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/rforge.wordpress.com/550/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/rforge.wordpress.com/550/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/rforge.wordpress.com/550/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/rforge.wordpress.com/550/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/rforge.wordpress.com/550/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rforge.org&amp;blog=7577563&amp;post=550&amp;subd=rforge&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://rforge.org/2010/04/29/restructuring-the-filetree-moving-files-from-multiple-directories/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>Remove U3 System from SanDisk</title>
		<link>http://rforge.org/2010/04/16/remove-u3-system-from-sandisk/</link>
		<comments>http://rforge.org/2010/04/16/remove-u3-system-from-sandisk/#comments</comments>
		<pubDate>Fri, 16 Apr 2010 11:34:24 +0000</pubDate>
		<dc:creator>rforge</dc:creator>
				<category><![CDATA[Backup]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[sandisk]]></category>
		<category><![CDATA[shell]]></category>
		<category><![CDATA[smart software]]></category>
		<category><![CDATA[u3]]></category>

		<guid isPermaLink="false">http://rforge.org/?p=543</guid>
		<description><![CDATA[Bought a SanDisk Cruzer 16GB and found some smart software preinstalled which did not consider smart at all. Everytime I inserted the drive on any computer a CD drive with label U3 System&#8220;was mounted containing some funny .exe files. The whole &#8220;CD drive&#8221; took several MB of diskspace. I wanted to get rid of it. [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rforge.org&amp;blog=7577563&amp;post=543&amp;subd=rforge&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Bought a SanDisk Cruzer 16GB and found some <em>smart software</em> preinstalled which did not consider smart at all. Everytime I inserted the drive on any computer a CD drive with label <em>U3 System</em>&#8220;was mounted containing some funny <em>.exe</em> files. The whole &#8220;CD drive&#8221; took several MB of diskspace.</p>
<p>I wanted to get rid of it. Fortunately, <a href="http://www.tomshardware.co.uk/forum/243608-14-remove-smart-software-sandisk-flash-drive">I was not the first one beeing disturbed</a>.</p>
<p>Sourceforge has a u3-tool which did the job:</p>
<ol>
<li><a href="http://sourceforge.net/projects/u3-tool/files/u3-tool/0.3/u3-tool-0.3.tar.gz/download">Download the tool</a> to a place where you remember it</li>
<li>Unpack the .tar.gz archive (I just rightclicked it and chose &#8220;extract here&#8221;). This creates a folder like /MyPathTo/u3-tool-0.3/</li>
<li>open a terminal and type: <code>cd /MyPathTo/u3-tool-0.3/<br />
./configure<br />
make<br />
sudo make install</code><br />
Now <em>u3-tool</em> is installed and can be used.</li>
<li>To remove the CD-like partition containing the firmware crap you need the device name of the USB disk: <code>sudo fdisk -l</code> gives the answer. In my case it is <code>/dev/sdb1</code>. Make shure you remember the right one.</li>
<li>Remove the U3 partition with <code>u3-tool -p 0 /dev/sdb1</code>where /dev/sdb1 is the device name remembered from the previous step and the option -p is followed by a zero.</li>
</ol>
<p>Done.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/rforge.wordpress.com/543/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/rforge.wordpress.com/543/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/rforge.wordpress.com/543/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/rforge.wordpress.com/543/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/rforge.wordpress.com/543/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/rforge.wordpress.com/543/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/rforge.wordpress.com/543/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/rforge.wordpress.com/543/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/rforge.wordpress.com/543/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/rforge.wordpress.com/543/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/rforge.wordpress.com/543/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/rforge.wordpress.com/543/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/rforge.wordpress.com/543/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/rforge.wordpress.com/543/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rforge.org&amp;blog=7577563&amp;post=543&amp;subd=rforge&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://rforge.org/2010/04/16/remove-u3-system-from-sandisk/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>Passing an external variable to AWK</title>
		<link>http://rforge.org/2010/02/09/passing-an-external-variable-to-awk/</link>
		<comments>http://rforge.org/2010/02/09/passing-an-external-variable-to-awk/#comments</comments>
		<pubDate>Tue, 09 Feb 2010 13:02:32 +0000</pubDate>
		<dc:creator>rforge</dc:creator>
				<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[awk]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[unix]]></category>

		<guid isPermaLink="false">http://rforge.org/?p=533</guid>
		<description><![CDATA[Confronted with a heap of colon separated text files which had to be merged and cleaned of unrelated lines and columns, i tryed my luck inside Excel and spend a lot of time doing it manually, but finally got fed up. So I decided to use AWK on the task. A FOR-loop lists the files [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rforge.org&amp;blog=7577563&amp;post=533&amp;subd=rforge&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Confronted with a heap of colon separated text files which had to be merged and cleaned of unrelated lines and columns, i tryed my luck inside Excel and spend a lot of time doing it manually, but finally got fed up.</p>
<p>So I decided to use AWK on the task.</p>
<p>A FOR-loop lists the files in the folder into the UNIX pipe.</p>
<p>AWK selects the non-empty observations and adds the name of the file as a classifier to the beginning of the line (the result is a repeated measure dataset).</p>
<p>This is the code:</p>
<p><code>for CSV in `ls`<br />
do<br />
  cat $CSV | awk -F ";" '{<br />
    if ($2 ~ /[0-9]+/) {print CSV , FS , $0;}}'<br />
done</code></p>
<p>Remark: <code>-F ";"</code> option specifies how to distinguish the columns/fields of the lines/records in the file(default is &#8221; &#8221; or empty space).</p>
<p>BUT: The variable CSV gets not passed to AWK by default it has to be fed into AWK.</p>
<p>Solution:<br />
The<br />
<code>-v CATEGORY=$CSV</code><br />
option feeds the external variable CSV into the AWK-variable CATEGORY.</p>
<p>This gives:<br />
<code>for CSV in `ls`<br />
do<br />
  cat $CSV | awk -F ";" -v CATEGORY=$CSV '{<br />
    if ($2 ~ /[0-9]+/) {print CATEGORY , FS , $0;}}'<br />
done</code><br />
.. and works <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Hat tip:<a href="http://www.unix.com/unix-dummies-questions-answers/12473-pass-variable-awk.html#post45374">fpmurphy</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/rforge.wordpress.com/533/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/rforge.wordpress.com/533/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/rforge.wordpress.com/533/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/rforge.wordpress.com/533/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/rforge.wordpress.com/533/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/rforge.wordpress.com/533/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/rforge.wordpress.com/533/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/rforge.wordpress.com/533/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/rforge.wordpress.com/533/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/rforge.wordpress.com/533/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/rforge.wordpress.com/533/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/rforge.wordpress.com/533/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/rforge.wordpress.com/533/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/rforge.wordpress.com/533/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rforge.org&amp;blog=7577563&amp;post=533&amp;subd=rforge&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://rforge.org/2010/02/09/passing-an-external-variable-to-awk/feed/</wfw:commentRss>
		<slash:comments>1</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>
