<?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/"
	>

<channel>
	<title>SpaziDigitali &#187; Technology</title>
	<atom:link href="http://spazidigitali.com/cat/tech/feed/" rel="self" type="application/rss+xml" />
	<link>http://spazidigitali.com</link>
	<description>Luca Mearelli's Blog</description>
	<lastBuildDate>Tue, 25 Jan 2011 17:14:14 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1</generator>
		<item>
		<title>Internet is Freedom</title>
		<link>http://spazidigitali.com/2010/03/12/lessigs-internet-is-freedom/</link>
		<comments>http://spazidigitali.com/2010/03/12/lessigs-internet-is-freedom/#comments</comments>
		<pubDate>Fri, 12 Mar 2010 16:52:39 +0000</pubDate>
		<dc:creator>lm</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[internet]]></category>
		<category><![CDATA[italy]]></category>
		<category><![CDATA[lessig]]></category>
		<category><![CDATA[politics]]></category>

		<guid isPermaLink="false">http://spazidigitali.com/?p=171</guid>
		<description><![CDATA[Lawrence Lessig&#8217;s speech at Italian Parliament: Internet is Freedom]]></description>
			<content:encoded><![CDATA[<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="480" height="390" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="src" value="http://blip.tv/play/lG2BzMozAg" /><param name="allowfullscreen" value="true" /><embed type="application/x-shockwave-flash" width="480" height="390" src="http://blip.tv/play/lG2BzMozAg" allowfullscreen="true"></embed></object></p>
<p>Lawrence Lessig&#8217;s speech at Italian Parliament: Internet is Freedom</p>
]]></content:encoded>
			<wfw:commentRss>http://spazidigitali.com/2010/03/12/lessigs-internet-is-freedom/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Invisible Applications</title>
		<link>http://spazidigitali.com/2009/03/24/invisible-applications/</link>
		<comments>http://spazidigitali.com/2009/03/24/invisible-applications/#comments</comments>
		<pubDate>Tue, 24 Mar 2009 15:56:42 +0000</pubDate>
		<dc:creator>lm</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[adaptive interfaces]]></category>
		<category><![CDATA[invisible applications]]></category>
		<category><![CDATA[ux]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://spazidigitali.com/?p=154</guid>
		<description><![CDATA[As developers we fight with the desire to build useful new services and applications which can attract many users while at the same time reducing the friction that makes it difficult for our average user to try and keep using our creations. I started observing how people usually hate learning and using too many different [...]]]></description>
			<content:encoded><![CDATA[<p>As developers we fight with the desire to build useful new services and applications which can attract many users while at the same time reducing the friction that makes it difficult for our average user to try and keep using our creations.</p>
<p>I started observing how people usually hate learning and using too many different tools (except possibly for us geeks), this happens because we have limited resources and look for the maximum utility (this happens most at the cross of the business and consumer markets).</p>
<p>Uncertainty also plays a role in forming our decisions as users, where the perceived value of a new application is decreased by the lack of knowledge about how well it can fit the problems that we need to solve.</p>
<p>This has a few consequences: resistance in adopting new tools since it takes a too big effort to learn and <a href="http://www.bricklin.com/tailwagsdog.htm">preference for generic tools</a> since they are perceived as more flexible and adaptable to our needs.</p>
<p>To overcome this we may reduce the visible part of the application to a level where the user stops noticing while making sure the user can easily reach the value we add. In the end it will all be about finding a way to give increasing returns for the same effort.</p>
<p>One way to follow this path is leveraging the tools that people are already using, integrating into or with them thus giving new ways to use those “old” and generic applications to do new things. Our invisible application will integrate within the flow of information that the user is receiving, it will remove modality from the interactions and augment the context around the documents and data that the users already handle to enrich the interaction with the same old services. Also, an important role will be played by allowing deep adaptation of the interface, whether automatically or via manual customization by the user (for the italian readers, look also at <a href="http://www.slideshare.net/lucamascaro/strutture-e-interfacce-adattative">this presentation</a> by Luca Mascaro).</p>
]]></content:encoded>
			<wfw:commentRss>http://spazidigitali.com/2009/03/24/invisible-applications/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Parallels 4.0 is fast</title>
		<link>http://spazidigitali.com/2009/03/19/parallels-40-is-fast/</link>
		<comments>http://spazidigitali.com/2009/03/19/parallels-40-is-fast/#comments</comments>
		<pubDate>Thu, 19 Mar 2009 12:37:01 +0000</pubDate>
		<dc:creator>lm</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[osx]]></category>
		<category><![CDATA[parallels]]></category>

		<guid isPermaLink="false">http://spazidigitali.com/?p=148</guid>
		<description><![CDATA[Just when I was losing to the idea of configuring my macbook for dual boot (or even getting a new machine) to be able to use Windows XP with more ease. I am using Parallels to be able to do testing of the apps I&#8217;m writing on IE (one site I&#8217;m working on has more [...]]]></description>
			<content:encoded><![CDATA[<p>Just when I was losing to the idea of configuring my macbook for dual boot (or even getting a new machine) to be able to use Windows XP with more ease.</p>
<p>I am using Parallels to be able to do testing of the apps I&#8217;m writing on IE (one site I&#8217;m working on has more than 1/3rd of users still IE6&#8230;) and to be able to recompile and package an old J2EE application using a proprietary framework and builder that works only on Windows :-(</p>
<p>Until upgrading to Parallels 4.0 (which I did yesterday), generating the EAR for said application was taking more than 25 minutes, now it&#8217;s just down to less than 5 minutes! The big improvement seem to be in the (shared) filesystem access but also everything else seems snappier and the VM feels lighter on the system.</p>
<p>Overall a highly recommended upgrade to anyone using the product.</p>
]]></content:encoded>
			<wfw:commentRss>http://spazidigitali.com/2009/03/19/parallels-40-is-fast/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Controlling an EC2 instance with python</title>
		<link>http://spazidigitali.com/2009/03/17/controlling-an-ec2-instance-with-python/</link>
		<comments>http://spazidigitali.com/2009/03/17/controlling-an-ec2-instance-with-python/#comments</comments>
		<pubDate>Tue, 17 Mar 2009 21:24:32 +0000</pubDate>
		<dc:creator>lm</dc:creator>
				<category><![CDATA[Python]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[amazon]]></category>
		<category><![CDATA[aws]]></category>
		<category><![CDATA[boto]]></category>
		<category><![CDATA[ec2]]></category>
		<category><![CDATA[redis]]></category>

		<guid isPermaLink="false">http://spazidigitali.com/?p=140</guid>
		<description><![CDATA[One of the selling points of EC2 is that it enables elastic provisioning of computing infrastructure; this allows following novel usage patterns where a server is used only for the time required to do some work. The key to reach this flexibility is the API that gives developers the ability to startup a server, configure [...]]]></description>
			<content:encoded><![CDATA[<p>One of the selling points of EC2 is that it enables elastic provisioning of computing infrastructure; this allows following novel usage patterns where a server is used only for the time required to do some work.</p>
<p>The key to reach this flexibility is the API that gives developers the ability to startup a server, configure it, use it and shut it down. There are libraries for many programming languages but I like the way the boto python library makes it really simple do these things (and a lot more).</p>
<p>Here I&#8217;ll show how to use <a href="http://code.google.com/p/boto/">boto</a> to start a server instance then how to send a file to the instance and execute a command on the remote server, and finally I&#8217;ll show how to terminate the instance.<br />
<span id="more-140"></span><br />
To use the boto library you&#8217;ll need to install it locally (on your computer) and to use the EC2 api you&#8217;ll need to import them:</p>
<pre class="brush: python; title: ;">
from boto.ec2.connection import EC2Connection
</pre>
<p>As with  other AWS services you&#8217;ll need to pass the access key and the secret access key to the library (in this case when creating a connection). You can get the keys from the Amazon Web Services &#8220;Access Identifiers&#8221; page. It&#8217;s possible to just set two environment variables holding the keys or you can pass them in to the method calls, I&#8217;ll assume for this example that the keys are written inside the script and passed to the methods:</p>
<pre class="brush: python; title: ;">
AWS_ACCESS_KEY_ID = 'yourkey'
AWS_SECRET_ACCESS_KEY = 'yoursecret'

conn = EC2Connection(AWS_ACCESS_KEY_ID,
AWS_SECRET_ACCESS_KEY)
</pre>
<p>First step is to make the connection, Once the connection is created we can use the run_instance to start an instance of an EC2 server image. You can think of a server image as a pre-built virtual server that&#8217;s idle waiting to be run. There are public images we can choose from (I&#8217;ll use the base Linux Fedora for this example), but any user can customize a running instance and build a private image from that ready to be used.</p>
<pre class="brush: python; title: ;">
reservation = conn.run_instances('ami-5647a33f',
                               instance_type='m1.small',
                               key_name='mykey')

instance = reservation.instances[0]

while not instance.update() == 'running':
  time.sleep(5)
</pre>
<p>the run_instances can take various parameters but only the image is required. Here I&#8217;m passing in also the instance type (in this case the &#8220;Small&#8221; instance type) and a key to use. The key to be used should have been previously generated and/or uploaded to EC2 (e.g. using the AWS Management Console).</p>
<p>The run_instances methods returns a reservation object representing the instance(s) startup request. This also holds the list of instances that are going to be started (we may launch more than one instance in a single run_instances call), in this case (since we are launching just one) we take the first one.</p>
<p>Each instance object has an attribute status which returns its current status, to check for the current status we need to call the update method (which itself returns the current status). When the instance is running it is given a public IP and a public dns name, which we may use to connect.</p>
<p>EC2 has a very flexible shared firewall whose rules and permissions may be manipulated via the API, for instance to enable or disable  connecting via SSH. Different security groups may be defined, to partition our instances into different logical sets e.g. web servers versus backend databases, and each group can be assigned different permissions. All the instances are assigned the &#8216;default&#8217; security group if not otherwise specified.</p>
<p>With a call to the authorize_security_group method we can allow a specific connection for a given group. E.g. with the following call we  allow SSH to any instance in the default group from the specified IP.</p>
<pre class="brush: python; title: ;">
conn.authorize_security_group('default',
                ip_protocol='tcp',
                from_port='22',
                to_port='22',
                cidr_ip='%s/32' % our_ip)
</pre>
<p>with the following call we can revoke the SSH permission</p>
<pre class="brush: python; title: ;">
conn.revoke_security_group('default',
                ip_protocol='tcp',
                from_port='22',
                to_port='22',
                cidr_ip='%s/32' % our_ip)
</pre>
<p>Once the instance is running and the permissions are setup to allow connecting via ssh, we can connect to it and to run a script on the instance we may simply scp the script and then connect via ssh to run it.</p>
<p>When we are done with the work we can stop use the stop method of the instance object to shut it down:</p>
<pre class="brush: python; title: ;">
instance.stop()
</pre>
<p>For a simple, yet complete example here is a script that can be used to run the benchmarks for the <a href="http://code.google.com/p/redis/">redis key-value store</a> on EC2. In the archive, together with the python script there is a shell script which is copied to the server which downloads the redis code, compiles it and runs the benchmarks:</p>
<p><a href="http://spazidigitali.com/wp-content/uploads/2009/03/redis-bench-ec2.zip">redis-bench-ec2.zip</a></p>
<p>That&#8217;s all!</p>
<p><a href="http://spazidigitali.com/wp-content/uploads/2009/03/redis-bench-ec2.zip"><br />
</a></p>
]]></content:encoded>
			<wfw:commentRss>http://spazidigitali.com/2009/03/17/controlling-an-ec2-instance-with-python/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

