<?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>Federico Maggi</title>
	<atom:link href="http://maggi.cc/feed/" rel="self" type="application/rss+xml" />
	<link>http://maggi.cc</link>
	<description>Personal page and random thoughts about the Web</description>
	<lastBuildDate>Wed, 27 May 2009 05:36:11 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>iWebSkel: The Ultimate Website Skeleton</title>
		<link>http://maggi.cc/2009/05/14/iwebskel-the-ultimate-website-skeleton/</link>
		<comments>http://maggi.cc/2009/05/14/iwebskel-the-ultimate-website-skeleton/#comments</comments>
		<pubDate>Thu, 14 May 2009 16:53:29 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Projects]]></category>
		<category><![CDATA[Standards]]></category>
		<category><![CDATA[Void]]></category>
		<category><![CDATA[Web]]></category>

		<guid isPermaLink="false">http://www.maggi.cc/2009/05/14/iwebskel-the-ultimate-website-skeleton/</guid>
		<description><![CDATA[When you start implementing a website design in the modern world, you seldom begin from scratch. Many of the Javascript frameworks, for instance, are part of everyday work for many web designers. The same happens for CSS initialization rules.
Sometimes is just boring to create the directory skeleton, just because it&#8217;s always the same. I know, [...]]]></description>
			<content:encoded><![CDATA[<p>When you start implementing a website design in the modern world, you seldom begin from scratch. Many of the Javascript frameworks, for instance, are part of everyday work for many web designers. The same happens for CSS initialization rules.</p>
<p>Sometimes is just boring to create the directory skeleton, just because it&#8217;s always the same. I know, I am a lazy one! That&#8217;s why I created <a href="http://iwebskel.com">iWebSkel</a>, which is more for me than for the community.</p>
<p>However, I thought it was a good idea to share it. Let me know if you like it: feedback is always appreciated!</p>
<p>iWebSkel is the ultimate ready to use kit for website design. It features only the latest version essential components to start developing quickly using XHTML, CSS, and Javascript. Elegantly packed together.</p>
<h2>Before iWebSkel</h2>
<p>Suppose you are about to implement the design of a new website called <strong>foobar</strong>. Here is what you do normally:</p>
<pre class="brush: bash">
$ mkdir fooweb
$ cd fooweb/
$ mkdir -p images/icons js style
$ cd style
$ edit style.css
</pre>
<p>At this point you realize that you need to reset style definitions. You code it and after having spent a few minutes you find out this <a href="http://meyerweb.com/eric/thoughts/2008/01/15/resetting-again/">Resetting Again</a>: you have just thrown away your time.</p>
<p>Not too bad. You get back to your work:</p>
<pre class="brush: bash">
$ cd ../
$ edit index.html
</pre>
<p>Same story. You have to write the code you write every single time. Isn&#8217;t that just annoying?</p>
<h2>After iWebSkel</h2>
<p>How do you do the same things with iWebSkel? Much more easy!</p>
<pre class="brush: bash">
$ wget http://iwebskel.com/get
$ unzip iwebskel.zip
$ mv iwebskel foobar
#Done!
</pre>
<p>What you do from this point on is just creation. No more repetitive typing. But there is more!</p>
<p>You have all the best icons at your disposal, style is already reset, and a nice HTML template is ready to be filled.</p>
<pre class="brush: html">
&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot;
	&quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&gt;

&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;
	&lt;head profile=&quot;http://gmpg.org/xfn/11&quot;&gt;

		&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=UTF-8&quot; /&gt;
		&lt;meta name=&quot;distribution&quot; content=&quot;global&quot; /&gt;
		&lt;meta name=&quot;robots&quot; content=&quot;follow, all&quot; /&gt;
		&lt;meta name=&quot;language&quot; content=&quot;en&quot; /&gt;

		&lt;!--meta--&gt;
		&lt;meta name=&quot;keywords&quot; content=&quot;&quot; /&gt;
		&lt;meta name=&quot;author&quot; content=&quot;iWebSkel: The Ultimate Website Skeleton! By Federico Maggi http://iwebskel.com&quot; /&gt;
		&lt;meta name=&quot;description&quot; content=&quot;&quot; /&gt;

		&lt;!--style--&gt;
		&lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; media=&quot;all&quot; href=&quot;style/main.css&quot; /&gt;

		&lt;!--behavior--&gt;
		&lt;script type=&quot;text/javascript&quot; src=&quot;behavior/scriptaculous/lib/prototype.js&quot;&gt;&lt;/script&gt;
		&lt;script type=&quot;text/javascript&quot; src=&quot;behavior/scriptaculous/src/scriptaculous.js&quot;&gt;&lt;/script&gt;
		&lt;script type=&quot;text/javascript&quot; src=&quot;behavior/main.js&quot;&gt;&lt;/script&gt;

		&lt;!--google analytics--&gt;
		&lt;!--CODE--&gt;

		&lt;!--feeds--&gt;
		&lt;!--CODE--&gt;

		&lt;title&gt;Title&lt;/title&gt;
	&lt;/head&gt;
</pre>
<p>And what about JavaScript? Same story: the two best frameworks are just right there along with a nice event handling template:</p>
<pre class="brush: javascript">
/* Example - main.js */
Event.observe(window, 'load', function() {
		//event handling goes here
});
</pre>
<p>To conclude, let&#8217;s take a closer look a the directory tree:</p>
<pre class="brush: bash">
$ find iwebskel -maxdepth 2
  iwebskel
  iwebskel/behavior    #js files go here
  iwebskel/behavior/main.js
  iwebskel/behavior/mootools
  iwebskel/behavior/scriptaculous
  iwebskel/design    #design sketches go here
  iwebskel/images    #site images go here
  iwebskel/images/icons    #tons of icon packs already here
  iwebskel/index.html
  iwebskel/style    #style files go here
  iwebskel/style/images    #style images go here
  iwebskel/style/main.css
  iwebskel/style/reset.css
</pre>
]]></content:encoded>
			<wfw:commentRss>http://maggi.cc/2009/05/14/iwebskel-the-ultimate-website-skeleton/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Fine Border for Your Photos: ImageMagick and Exiv2 to the rescue!</title>
		<link>http://maggi.cc/2009/02/16/fine-border-for-your-photos-imagemagick-and-exiv2-to-the-rescue/</link>
		<comments>http://maggi.cc/2009/02/16/fine-border-for-your-photos-imagemagick-and-exiv2-to-the-rescue/#comments</comments>
		<pubDate>Mon, 16 Feb 2009 12:10:14 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Life]]></category>
		<category><![CDATA[Mac]]></category>
		<category><![CDATA[Photography]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[imagemagick pictures border frame framing metadata exif exiv2 iptc]]></category>

		<guid isPermaLink="false">http://www.maggi.cc/?p=52</guid>
		<description><![CDATA[Photos without a frame are like out from their living space. Would you put your favorite pictures on the desktop or on the wall with no frame? Even digital images have found their own form of framing.
So, why not adding a fine border to your pictures before publishing on Flickr, for example? I am not [...]]]></description>
			<content:encoded><![CDATA[<p>Photos without a frame are like out from their living space. Would you put your favorite pictures on the desktop or on the wall with no <a href="http://en.wikipedia.org/wiki/Picture_frame">frame</a>? Even <a href="http://en.wikipedia.org/wiki/Digital_photo_frame">digital images have found their own form of framing</a>.</p>
<p>So, why not adding a fine border to your pictures before publishing on <a href="http://flickr.com">Flickr</a>, for example? I am not talking about obtrusive, noisy, complicated and bumped borders: I am talking about (sort of) fine art! :)</p>
<p><a href="href://imagemagick.org">ImageMagick</a> and <a href="http://exiv2.org/sample.html">Exiv2</a> (<a href="http://linux.die.net/man/1/exiv2">man exiv2</a>) are the perfect combination to create fancy, black and white borders along with a professional signature. Also, instead of having your visitors figure out the settings you used, why not adding them (e.g., aperture, shutter and ISO speed, focal length) right at the bottom of the picture? Take a look a the sample below.</p>
<div class="cn"><img class="cn-item" src="http://farm4.static.flickr.com/3485/3280237717_bffef8300e.jpg?v=0" /></div>
<p>And here is the details.</p>
<div class="cn">
<img class="cn-item" src="http://www.maggi.cc/wp-content/uploads/2009/02/picture-1.png" alt="EXIF data on the signature." title="Signature detail (left)" width="190" height="95" class="size-full wp-image-55" />
</div>
<div class="cn">
<img class="lr-item" src="http://www.maggi.cc/wp-content/uploads/2009/02/picture-2.png" alt="My name and year at the right of the picture." title="Signature detail (right)" width="190" height="95" class="size-full wp-image-56" />
</div>
<p>If not installed, you would need to install exiv2 and ImageMagick. With MacPorts this is as easy as typing:</p>
<pre class="brush: bash">$ sudo port install imagemagick exiv2</pre>
<p>Second, let&#8217;s build two tiny scripts to extract the metadata of interest. In my case, I created <code>~/bin/exiv_data</code> and <code>~/bin/exiv_year</code> which return an empty string if something goes wrong. For instance, if you forget to embed metadata on your picture we want the scripts to fail in an educate manner.</p>
<pre class="brush: bash">
#!/bin/sh
#File: $HOME/bin/exiv_data
time=$(exiv2 -PEkt pr $1 2 >/dev/null | tr -s " " " " | grep -E "\.ExposureTime" | awk '{print $2}')
focal=$(exiv2 -PEkt pr $1 2 >/dev/null | tr -s " " " " | grep -E "\.FocalLength" | awk '{print $2}')
aperture=$(exiv2 -PEkt pr $1 2 >/dev/null | tr -s " " " " | grep -E "\.ApertureValue" | awk '{print $2}')
iso=$(exiv2 -PEkt pr $1 2 >/dev/null | tr -s " " " " | grep -E "\.ISOSpeedRatings" | awk '{print $2}')

if [ -n "$time" -a -n "$focal" -a -n "$aperture" -a -n "$iso" ]
then
	echo $focal"mm, "$time" @ "$aperture" (ISO " $iso")"
fi
</pre>
<p>The second script is super tiny:</p>
<pre class="brush: bash">
#!/bin/sh
#File: $HOME/bin/exiv_year

exiv2 $1 2>/dev/null | grep timestamp | grep -oE '[0-9]{4}'
</pre>
<p>Don&#8217;t forget to make them executable with:</p>
<pre class="brush: bash">$ chmod +x ~/bin/exiv_*</pre>
<p>At this point you are ready to try them out with your own pictures. For instance:</p>
<pre class="brush: bash">
$ ~/bin/exiv_data foo.jpg
105.0mm, 1/400 @ F11 (ISO  100)
</pre>
<p>What about the borders? If you want to obtain a border like the above one, you can re-use my <code>~/bin/lr_border</code>script. Or, you can modify it as you please.</p>
<pre class="brush: bash">
#!/bin/sh
#File: ~/bin/lr_border

year=$($HOME/bin/exiv_year $1)
data=$($HOME/bin/exiv_data $1)

name="Federico Maggi"

if [ -n "$year" ]
then
	name=$name", "$year
fi

mogrify -border 5x5 -bordercolor black $1
mogrify -border 1x1 -bordercolor grey $1
mogrify -border 20x20 -bordercolor black $1

if [ -n "$data" ]
then
	mogrify -pointsize 9 -fill gray -gravity SouthEast -annotate +25+6 "$name" -gravity SouthWest -annotate +25+6 "$data" $1
else
	mogrify -pointsize 9 -fill gray -gravity SouthEast -annotate +25+6 "$name" $1
fi
</pre>
<p>Remember that this script will <strong>modify the original image file</strong>! So, if unsure, I&#8217;d <strong>recommend a backup</strong> before.</p>
<pre class="brush: bash">
$ ls *.jpg | while read file; do cp $file $file.bak &#038;&#038; ~/bin/lr_border $file; done
</pre>
<p>Just add a simple loop and you are done!</p>
]]></content:encoded>
			<wfw:commentRss>http://maggi.cc/2009/02/16/fine-border-for-your-photos-imagemagick-and-exiv2-to-the-rescue/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>Follow my soup</title>
		<link>http://maggi.cc/2009/01/24/follow-my-soup/</link>
		<comments>http://maggi.cc/2009/01/24/follow-my-soup/#comments</comments>
		<pubDate>Sat, 24 Jan 2009 21:03:41 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Life]]></category>
		<category><![CDATA[Services]]></category>
		<category><![CDATA[Web]]></category>

		<guid isPermaLink="false">http://www.maggi.cc/?p=46</guid>
		<description><![CDATA[
Since today, I am giving a try to the http://soup.io mashup service.
Give it a skim on http://soup.maggi.cc
]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.maggi.cc/wp-content/uploads/2009/01/1705v1-max-250x250.png" alt="Soup.io badge" title="Soup.io badge" width="150" height="150" class="size-full wp-image-47" /></p>
<p>Since today, I am giving a try to the <a href="http://soup.io">http://soup.io</a> mashup service.</p>
<p>Give it a skim on <a href="http://soup.maggi.cc">http://soup.maggi.cc</a></p>
]]></content:encoded>
			<wfw:commentRss>http://maggi.cc/2009/01/24/follow-my-soup/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>YearBookYourself.com and ImageMagick</title>
		<link>http://maggi.cc/2008/08/26/yearbookyourselfcom-and-imagemagick/</link>
		<comments>http://maggi.cc/2008/08/26/yearbookyourselfcom-and-imagemagick/#comments</comments>
		<pubDate>Tue, 26 Aug 2008 01:52:16 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Geek]]></category>
		<category><![CDATA[Life]]></category>
		<category><![CDATA[Mac]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[composition]]></category>
		<category><![CDATA[imagemagick]]></category>
		<category><![CDATA[montage]]></category>
		<category><![CDATA[mosaic]]></category>
		<category><![CDATA[overlays]]></category>
		<category><![CDATA[polaroid]]></category>
		<category><![CDATA[yearbook]]></category>
		<category><![CDATA[yourself]]></category>

		<guid isPermaLink="false">http://www.maggi.cc/?p=32</guid>
		<description><![CDATA[I&#8217;ve ]]></description>
			<content:encoded><![CDATA[<p><a style="float: left; margin-right: 20px;" href="http://flickr.com/photos/phretor/2797808937/"><img style="width: 190px; border: 0;" src="http://www.maggi.cc/wp-content/uploads/2008/08/1970.png" alt="Created with YearBookYourself.com" title="Me, in the 1970" class="size-thumbnail wp-image-33" /></a>I&#8217;ve <a href="http://flickr.com/photos/vortexmind/2796163252/"recently found</a> this funny Flash application </a><a href="http://yearbookyourself.com">YearBookYourself.com</a> that allows you to bring your face back to the good ages (from the 50s to nowdays): it&#8217;s really funny to see how your look gets perfectly morphed getting the real aspect of an old portrait. You can then share the pictures and/or download &#8216;em.</p>
<p>With a bit of bash scripting and <a href="http://imagemagick.org">ImageMagick</a> I got a really aged-looking Polaroid composition, that is just ready to be printed and frameworked! <a href="http://flickr.com/photos/phretor/2797808937/">Here is my result</a>.</p>
<p>I took screenshots of each image: if you use a Mac or a smart screen capturing application then you should be able to give each screenshot a custom, progressive name such as:</p>
<pre class="brush: bash">$ ls
Picture 1.png   Picture 2.png  Picture 3.png  ... Picture 26.png</pre>
<h4>Renaming and resizing</h4>
<p>So you just have to do the math to automagically rename &#8216;em to obtain</p>
<pre class="brush: bash">$ ls
1950.png   1952.png  1954.png  ... 2000.png

$ mkdir orig
$ cp *.png orig/
$ mogrify -resize 220x -antialias *.png
</pre>
<h4>Adding a caption and a Polaroid look</h4>
<p>And now ImageMagick comes into play; I gues this can be performed in one step (please let me know how) but a two phases processing is fine as well:</p>
<pre class="brush: bash">$ mkdir polaroids

$ find *.png | while read img; do montage \
-caption "$(basename $img .png)" -font Arial \
-geometry 220x -polaroid 0 $img \
polaroids/$(basename $img); done</pre>
<p>Of course these are my settings, you may want to add variations but this is a good starting.</p>
<h4>Let&#8217;s compose &#8216;em!</h4>
<p>And now, ImageMagick is used to compose the 26 pictures:</p>
<pre class="brush: bash">$ montage $(ls poloaroids/*.png) yearbook.png</pre>
<p>Done!</p>
]]></content:encoded>
			<wfw:commentRss>http://maggi.cc/2008/08/26/yearbookyourselfcom-and-imagemagick/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>California here I come!</title>
		<link>http://maggi.cc/2008/08/09/california-here-i-come/</link>
		<comments>http://maggi.cc/2008/08/09/california-here-i-come/#comments</comments>
		<pubDate>Sat, 09 Aug 2008 03:18:02 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Life]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[blogs]]></category>
		<category><![CDATA[california]]></category>
		<category><![CDATA[santa barbara]]></category>
		<category><![CDATA[traveling]]></category>
		<category><![CDATA[trip]]></category>
		<category><![CDATA[ucsb]]></category>

		<guid isPermaLink="false">http://www.maggi.cc/?p=31</guid>
		<description><![CDATA[As most of my friend and colleagues already know, I am about to go to UCSB to spend the last year of my PhD studies. I&#8217;ll work with the security group managed by Prof. Giovanni Vigna at Seclab (I&#8217;ll continue on my main research topic: anomaly detection). So, from September 1st to the end of [...]]]></description>
			<content:encoded><![CDATA[<p>As most of my friend and colleagues already know, I am about to go to <a href="http://cs.ucsb.edu/~seclab">UCSB</a> to spend the last year of my PhD studies. I&#8217;ll work with the security group managed by <a href="http://cs.ucsb.edu/~vigna">Prof. Giovanni Vigna</a> at Seclab (I&#8217;ll continue on my main research topic: anomaly detection). So, from September 1st to the end of June, 2009, I&#8217;ll live in the beautiful Santa Barbara, working on cool stuff with cool people! Cannot wait to be there! This is the end of the academic part of the story.</p>
<p>How about the fun?</p>
<p>I prepared a <a href="http://ca.maggi.cc">little web based journal</a>, to keep track of the trip and to share pictures, videos and stories my parents and friends. Stay tuned at <a href="http://ca.maggi.cc">CA @ maggi.cc</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://maggi.cc/2008/08/09/california-here-i-come/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
