<?xml version="1.0" encoding="utf-8" ?>

<rss version="2.0" 
   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
   xmlns:admin="http://webns.net/mvcb/"
   xmlns:dc="http://purl.org/dc/elements/1.1/"
   xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
   xmlns:wfw="http://wellformedweb.org/CommentAPI/"
   xmlns:content="http://purl.org/rss/1.0/modules/content/"
   >
<channel>
    <title>Simone 'Wiz' Tellini - Tips'n'Tricks</title>
    <link>http://tellini.info/blog/</link>
    <description>To strive, to seek, to find, and not to yield.</description>
    <dc:language>en</dc:language>
    <generator>Serendipity 1.3 - http://www.s9y.org/</generator>
    <pubDate>Fri, 25 Jan 2008 07:46:10 GMT</pubDate>

    <image>
        <url>http://tellini.info/blog/templates/default/img/s9y_banner_small.png</url>
        <title>RSS: Simone 'Wiz' Tellini - Tips'n'Tricks - To strive, to seek, to find, and not to yield.</title>
        <link>http://tellini.info/blog/</link>
        <width>100</width>
        <height>21</height>
    </image>

<item>
    <title>Attributes, reflection and PHP</title>
    <link>http://tellini.info/blog/archives/46-Attributes,-reflection-and-PHP.html</link>
            <category>Software Development</category>
            <category>Tips'n'Tricks</category>
    
    <comments>http://tellini.info/blog/archives/46-Attributes,-reflection-and-PHP.html#comments</comments>
    <wfw:comment>http://tellini.info/blog/wfwcomment.php?cid=46</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://tellini.info/blog/rss.php?version=2.0&amp;type=comments&amp;cid=46</wfw:commentRss>
    

    <author>nospam@example.com (Simone)</author>
    <content:encoded>
    After a long exposure to .NET, when I get back to PHP I sometimes find myself missing some cool functionality (and a good IDE too... none of those I&#039;ve tried so far can compete with the comfort of VisualStudio + ReSharper).&lt;br /&gt;
&lt;br /&gt;
Among these missing features, &lt;a href=&quot;http://msdn2.microsoft.com/en-us/library/xtwkdas5.aspx&quot; title=&quot;Attributes Overview&quot;&gt;attributes&lt;/a&gt; are what I needed in order to solve a certain problem in an elegant way.&lt;br /&gt;
&lt;br /&gt;
Looking at what the &lt;a href=&quot;http://www.php.net/oop5.reflection&quot;&gt;reflection API&lt;/a&gt; was offering, I came up with a simple way to decorate my properties/methods/classes with attributes: through the documentation comments!&lt;br /&gt;
&lt;br /&gt;
Let&#039;s see an example:&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;php&quot; style=&quot;text-align: left&quot;&gt;&lt;br /&gt;&amp;lt;pre&amp;gt;&lt;br /&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;&amp;lt;?&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;class&lt;/span&gt; A&lt;br /&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;/**&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160;&amp;#160; * @attr&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160;&amp;#160; * @attr2&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160;&amp;#160; */&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; protected &lt;span style=&quot;color: #0000ff;&quot;&gt;$foo&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; protected &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;function&lt;/span&gt; GetPropAttrs&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;$property&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #0000ff;&quot;&gt;$class&lt;/span&gt;&amp;#160; &amp;#160;= &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;new&lt;/span&gt; ReflectionClass&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt; &lt;a href=&quot;http://www.php.net/get_class&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;get_class&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;$this&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #0000ff;&quot;&gt;$prop&lt;/span&gt;&amp;#160; &amp;#160; = &lt;span style=&quot;color: #0000ff;&quot;&gt;$class&lt;/span&gt;-&amp;gt;&lt;span style=&quot;color: #006600;&quot;&gt;getProperty&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;$property&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #0000ff;&quot;&gt;$doc&lt;/span&gt;&amp;#160; &amp;#160; &amp;#160;= &lt;span style=&quot;color: #0000ff;&quot;&gt;$prop&lt;/span&gt;-&amp;gt;&lt;span style=&quot;color: #006600;&quot;&gt;getDocComment&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #0000ff;&quot;&gt;$attrs&lt;/span&gt;&amp;#160; &amp;#160;= &lt;a href=&quot;http://www.php.net/array&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;array&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #0000ff;&quot;&gt;$matches&lt;/span&gt; = &lt;a href=&quot;http://www.php.net/array&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;array&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;a href=&quot;http://www.php.net/preg_match_all&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;preg_match_all&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt; &lt;span style=&quot;color: #ff0000;&quot;&gt;&#039;/@([a-zA-Z_][a-zA-Z_0-9]*)&lt;span style=&quot;color: #000099; font-weight: bold;&quot;&gt;\s&lt;/span&gt;/m&#039;&lt;/span&gt;,&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #0000ff;&quot;&gt;$doc&lt;/span&gt;, &lt;span style=&quot;color: #0000ff;&quot;&gt;$matches&lt;/span&gt;, PREG_SET_ORDER &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #b1b100;&quot;&gt;foreach&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;$matches&lt;/span&gt; &lt;span style=&quot;color: #b1b100;&quot;&gt;as&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;$m&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #0000ff;&quot;&gt;$attrs&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#93;&lt;/span&gt; = &lt;span style=&quot;color: #0000ff;&quot;&gt;$m&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#91;&lt;/span&gt; &lt;span style=&quot;color: #cc66cc;&quot;&gt;1&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#93;&lt;/span&gt;;&lt;br /&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #b1b100;&quot;&gt;return&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;$attrs&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; public &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;function&lt;/span&gt; test&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #0000ff;&quot;&gt;$attrs&lt;/span&gt; = &lt;span style=&quot;color: #0000ff;&quot;&gt;$this&lt;/span&gt;-&amp;gt;&lt;span style=&quot;color: #006600;&quot;&gt;GetPropAttrs&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt; &lt;span style=&quot;color: #ff0000;&quot;&gt;&#039;foo&#039;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;a href=&quot;http://www.php.net/print_r&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;print_r&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;$attrs&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;class&lt;/span&gt; B&lt;br /&gt;extends A&lt;br /&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;/**&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160;&amp;#160; * @attr3&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160;&amp;#160; */&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; protected &lt;span style=&quot;color: #0000ff;&quot;&gt;$foo&lt;/span&gt;;&lt;br /&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$obj&lt;/span&gt; = &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;new&lt;/span&gt; A&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;http://www.php.net/print&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;print&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt; &lt;span style=&quot;color: #ff0000;&quot;&gt;&#039;Test A:&amp;lt;br&amp;gt;&#039;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$obj&lt;/span&gt;-&amp;gt;&lt;span style=&quot;color: #006600;&quot;&gt;test&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$obj&lt;/span&gt; = &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;new&lt;/span&gt; B&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;http://www.php.net/print&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;print&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt; &lt;span style=&quot;color: #ff0000;&quot;&gt;&#039;&amp;lt;p&amp;gt;Test B:&amp;lt;br&amp;gt;&#039;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$obj&lt;/span&gt;-&amp;gt;&lt;span style=&quot;color: #006600;&quot;&gt;test&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;br /&gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;&amp;#160;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
Running the above script you&#039;ll see the following output, confirming that everything works as desired:&lt;br /&gt;
&lt;pre&gt;&lt;br /&gt;
Test A:&lt;br /&gt;
Array&lt;br /&gt;
(&lt;br /&gt;
    [0] =&gt; attr&lt;br /&gt;
    [1] =&gt; attr2&lt;br /&gt;
)&lt;br /&gt;
&lt;br /&gt;
Test B:&lt;br /&gt;
Array ( [0] =&gt; attr3 ) &lt;br /&gt;
&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
If you&#039;re using the /** */ comments for real documentation, you might want to use another escape character rather than @, to avoid problems.&lt;br /&gt;
&lt;br /&gt;
Happy coding &lt;img src=&quot;http://tellini.info/blog/templates/default/img/emoticons/smile.png&quot; alt=&quot;:-)&quot; style=&quot;display: inline; vertical-align: bottom;&quot; class=&quot;emoticon&quot; /&gt; 
    </content:encoded>

    <pubDate>Sun, 13 Jan 2008 12:16:00 -0800</pubDate>
    <guid isPermaLink="false">http://tellini.info/blog/archives/46-guid.html</guid>
    <category>php</category>
<category>reflection</category>
<category>software development</category>
<category>tips'n'tricks</category>

</item>
<item>
    <title>Note to self: what to do when the hard disk fails (Linux)</title>
    <link>http://tellini.info/blog/archives/33-Note-to-self-what-to-do-when-the-hard-disk-fails-Linux.html</link>
            <category>Tips'n'Tricks</category>
    
    <comments>http://tellini.info/blog/archives/33-Note-to-self-what-to-do-when-the-hard-disk-fails-Linux.html#comments</comments>
    <wfw:comment>http://tellini.info/blog/wfwcomment.php?cid=33</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://tellini.info/blog/rss.php?version=2.0&amp;type=comments&amp;cid=33</wfw:commentRss>
    

    <author>nospam@example.com (Simone)</author>
    <content:encoded>
    It&#039;s been a bad day.&lt;br /&gt;
&lt;br /&gt;
One of my Linux box hard drives decided to fail this morning. Luckily, it&#039;s not totally failed, but the superblock is gone AWOL. Let&#039;s recap what I did to revive it until a replacement can be mounted.&lt;br /&gt;
&lt;br /&gt;
&lt;ol&gt;&lt;br /&gt;
  &lt;li&gt; The first thing I&#039;ve noticed was that my /storage partition had been re-mounted as read-only when the kernel intercepted an error. So I simply umount&#039;ed it and tried a &lt;strong&gt;fsck.ext3 /dev/hda1&lt;/strong&gt;. Too bad it couldn&#039;t read the superblock, thus it failed...&lt;/li&gt;&lt;br /&gt;
&lt;br /&gt;
 &lt;li&gt; So I ran &lt;strong&gt;mke2fs -n /dev/hda1&lt;/strong&gt;: the &lt;em&gt;-n&lt;/em&gt; switch means &quot;don&#039;t create a filesystem, just tell me where the superblock backups will be stored&quot;. As long as the other parameters are the same as those used when creating the filesystem, this will correctly locate the superblock backups. The first one reported in my case was at block 32768. &lt;/li&gt;&lt;br /&gt;
&lt;br /&gt;
 &lt;li&gt; At this point I&#039;ve been able to repair the filesystem using &lt;strong&gt;fsck.ext3 -b 32768 /dev/hda1&lt;/strong&gt;. &lt;/li&gt;&lt;br /&gt;
&lt;br /&gt;
 &lt;li&gt; Finally, I tried to remount the partition with &lt;strong&gt;mount /storage&lt;/strong&gt;, but obviously it would have been too easy... the first superblock is currently sitting on a Really Dead Sector (TM) &lt;img src=&quot;http://tellini.info/blog/templates/default/img/emoticons/sad.png&quot; alt=&quot;:-(&quot; style=&quot;display: inline; vertical-align: bottom;&quot; class=&quot;emoticon&quot; /&gt; &lt;/li&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;li&gt; Knowing that the backup at block 32768 was working, I&#039;ve finally been able to finish the job with &lt;strong&gt;mount -t ext3 -o sb=131072 /dev/hda1 /storage&lt;/strong&gt; (where 131072 is 32768 * 4, as the filesystem uses 4k blocks, while mount uses 1k units) &lt;/li&gt;&lt;br /&gt;
&lt;/ol&gt;&lt;br /&gt;
&lt;br /&gt;
Phew! Everything looked good at this point. Good enough to backup a lot of data, anyway. 
    </content:encoded>

    <pubDate>Sun, 05 Aug 2007 21:53:54 -0700</pubDate>
    <guid isPermaLink="false">http://tellini.info/blog/archives/33-guid.html</guid>
    
</item>
<item>
    <title>Resizing your Parallels 3.0 disk image</title>
    <link>http://tellini.info/blog/archives/30-Resizing-your-Parallels-3.0-disk-image.html</link>
            <category>Tips'n'Tricks</category>
    
    <comments>http://tellini.info/blog/archives/30-Resizing-your-Parallels-3.0-disk-image.html#comments</comments>
    <wfw:comment>http://tellini.info/blog/wfwcomment.php?cid=30</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://tellini.info/blog/rss.php?version=2.0&amp;type=comments&amp;cid=30</wfw:commentRss>
    

    <author>nospam@example.com (Simone)</author>
    <content:encoded>
    You&#039;ve just upgraded to Parallels 3.0 but you realize that your virtual HD is almost full. Well, no problem: luckily there&#039;s this ImageTool that allows you to resize disk images... uhm... no, wait... can&#039;t find it... but... but... I was 100% sure it was here! &lt;img src=&quot;http://tellini.info/blog/templates/default/img/emoticons/eek.png&quot; alt=&quot;:-O&quot; style=&quot;display: inline; vertical-align: bottom;&quot; class=&quot;emoticon&quot; /&gt;&lt;br /&gt;
&lt;br /&gt;
Know the feeling? &lt;img src=&quot;http://tellini.info/blog/templates/default/img/emoticons/wink.png&quot; alt=&quot;;-)&quot; style=&quot;display: inline; vertical-align: bottom;&quot; class=&quot;emoticon&quot; /&gt;&lt;br /&gt;
&lt;br /&gt;
Sadly, in version 3.0 they removed this useful tool. Too bad that the disk image format has changed as well since v2.5, thus you can&#039;t even downgrade just to do the resizing if you started your virtual OS with the new version.&lt;br /&gt;
&lt;br /&gt;
Well, yesterday a certain Randyp posted &lt;a href=&quot;http://forum.parallels.com/thread13738.html&quot; &gt;an easy solution to this problem&lt;/a&gt;, which does the trick while the Parallels team works on the next update (which should provide a new ImageTool). Even if it requires a lot of space, it works flawlessly.&lt;br /&gt;
&lt;br /&gt;
Kudos to Randyp! &lt;img src=&quot;http://tellini.info/blog/templates/default/img/emoticons/smile.png&quot; alt=&quot;:-)&quot; style=&quot;display: inline; vertical-align: bottom;&quot; class=&quot;emoticon&quot; /&gt; 
    </content:encoded>

    <pubDate>Wed, 27 Jun 2007 20:27:37 -0700</pubDate>
    <guid isPermaLink="false">http://tellini.info/blog/archives/30-guid.html</guid>
    
</item>
<item>
    <title>Updating your website using rsync</title>
    <link>http://tellini.info/blog/archives/6-Updating-your-website-using-rsync.html</link>
            <category>Tips'n'Tricks</category>
    
    <comments>http://tellini.info/blog/archives/6-Updating-your-website-using-rsync.html#comments</comments>
    <wfw:comment>http://tellini.info/blog/wfwcomment.php?cid=6</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://tellini.info/blog/rss.php?version=2.0&amp;type=comments&amp;cid=6</wfw:commentRss>
    

    <author>nospam@example.com (Simone)</author>
    <content:encoded>
    Since I&#039;ve moved my website to a new hosting, I&#039;ve begun to use &lt;strong&gt;rsync&lt;/strong&gt; instead of ftp to maintain it. There are a couple of major gains in doing so:&lt;br /&gt;
&lt;ul&gt;&lt;br /&gt;
&lt;li&gt;it&#039;s more secure: rsync is tunnelled through an SSH connection. My previous hoster only supported plain FTP, meaning that everything was in cleartext, including username and password.&lt;/li&gt;&lt;br /&gt;
&lt;li&gt;it&#039;s &lt;em&gt;waaay&lt;/em&gt; more comfortable: I can do any change I wish on my local copy of the site and when everything is ready I can just launch a mini-script to go live. I don&#039;t have to worry about forgetting something anymore &lt;img src=&quot;http://tellini.info/blog/templates/default/img/emoticons/wink.png&quot; alt=&quot;;-)&quot; style=&quot;display: inline; vertical-align: bottom;&quot; class=&quot;emoticon&quot; /&gt;&lt;/li&gt;&lt;br /&gt;
&lt;/ul&gt;&lt;br /&gt;
So how do I do it?&lt;br /&gt;
&lt;br /&gt;
I&#039;ve created a simple &lt;em&gt;sync_my_site.sh&lt;/em&gt; script like this:&lt;br /&gt;
&lt;blockquote&gt;&lt;code&gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
&lt;br /&gt;
rsync -rltuO \&lt;br /&gt;
          --progress \&lt;br /&gt;
          --delay-updates \&lt;br /&gt;
          --delete --delete-after \&lt;br /&gt;
          -e &#039;ssh -i /home/wiz/.ssh/my_hosting_id&#039; \&lt;br /&gt;
          --exclude-from=/www/site/.rsyncignore \&lt;br /&gt;
          /www/site/ user@host:/home/user/site/&lt;br /&gt;
&lt;br /&gt;
ssh -i /home/wiz/.ssh/my_hosting_id user@host &#039;chmod -R o+r site&#039;&lt;br /&gt;
&lt;/code&gt;&lt;/blockquote&gt;&lt;br /&gt;
&lt;br /&gt;
The first parameters (&lt;em&gt;rltuO&lt;/em&gt;) tell rsync to recursively update the site, preserving file times and symbolic links and skipping files newer than the local copy.&lt;br /&gt;
&lt;br /&gt;
&lt;em&gt;--delay-updates&lt;/em&gt; is useful to replace all the files when the upload is complete, to minimize the probabilities of breaking the site while some users are browsing on it &lt;img src=&quot;http://tellini.info/blog/templates/default/img/emoticons/wink.png&quot; alt=&quot;;-)&quot; style=&quot;display: inline; vertical-align: bottom;&quot; class=&quot;emoticon&quot; /&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;em&gt;--delete&lt;/em&gt; tells rsync to remove files on the remote host that are not present on your local system&lt;br /&gt;
&lt;br /&gt;
&lt;em&gt;-e&lt;/em&gt; is needed in my case to specify the identity I wish to use for the SSH connection.&lt;br /&gt;
&lt;br /&gt;
&lt;em&gt;--exclude-from&lt;/em&gt; points to a text file which contains a list of files that rsync should not consider. It&#039;s useful to avoid it from uploading your local configuration files overwriting the production values &lt;img src=&quot;http://tellini.info/blog/templates/default/img/emoticons/wink.png&quot; alt=&quot;;-)&quot; style=&quot;display: inline; vertical-align: bottom;&quot; class=&quot;emoticon&quot; /&gt;&lt;br /&gt;
&lt;br /&gt;
Finally, after rsync completes its job, I launch another command on the remote server to fix the file permissions so that the webserver can read all the files. If your production and development servers have the same configuration, you can also skip that line and add &lt;em&gt;-p&lt;/em&gt; on rsync&#039;s command line, so that it will preserve the file permissions as well. 
    </content:encoded>

    <pubDate>Sat, 27 Jan 2007 15:31:52 -0800</pubDate>
    <guid isPermaLink="false">http://tellini.info/blog/archives/6-guid.html</guid>
    
</item>

</channel>
</rss>