<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/atom10full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><feed xmlns="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearch/1.1/" xmlns:georss="http://www.georss.org/georss" xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr="http://purl.org/syndication/thread/1.0" gd:etag="W/&quot;CkcEQH8_fCp7ImA9WhdUEk0.&quot;"><id>tag:blogger.com,1999:blog-5998114554635012438</id><updated>2011-09-28T09:53:21.144+01:00</updated><category term="Software" /><category term="Various" /><category term="About" /><category term="HTML/CSS" /><category term="Bash" /><category term="Humour" /><category term="Hacks" /><title>The Unbearable Lightness of Bit</title><subtitle type="html">...and weightness of meaning. Bits - these so simple entities - have the power to completely change a meaning, and a life. This is a personal blog about informatics, with "bits" of other things.</subtitle><link rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml" href="http://binaryunit.blogspot.com/feeds/posts/default" /><link rel="alternate" type="text/html" href="http://binaryunit.blogspot.com/" /><link rel="next" type="application/atom+xml" href="http://www.blogger.com/feeds/5998114554635012438/posts/default?start-index=26&amp;max-results=25&amp;redirect=false&amp;v=2" /><author><name>Narcolessico</name><uri>http://www.blogger.com/profile/04935543128240934969</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><generator version="7.00" uri="http://www.blogger.com">Blogger</generator><openSearch:totalResults>27</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/atom+xml" href="http://feeds.feedburner.com/ULB" /><feedburner:info xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" uri="ulb" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><link rel="license" type="text/html" href="http://creativecommons.org/licenses/by-nc-nd/3.0/" /><logo>http://creativecommons.org/images/public/somerights20.gif</logo><entry gd:etag="W/&quot;DkEDRX08cSp7ImA9WhZaFUw.&quot;"><id>tag:blogger.com,1999:blog-5998114554635012438.post-1024323278230767598</id><published>2011-07-01T10:58:00.002+01:00</published><updated>2011-07-01T11:04:34.379+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-07-01T11:04:34.379+01:00</app:edited><title>9gag ad remover</title><content type="html">&lt;span style="font-weight: bold;"&gt;There is always &lt;/span&gt;a first time. This is my first extension ever. Very, very simple; just one line of CSS code. Link: &lt;a href="https://chrome.google.com/webstore/detail/khcncgifpkgfnllkphicgepgmfackkbo"&gt;9gag banner remover&lt;/a&gt;. &lt;span style="font-weight: bold; color: rgb(102, 0, 0);"&gt;And I learned that one has to pay (una tantum) &lt;/span&gt;to publish stuff on chrome extension store... nevermind.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;img src="http://2.bp.blogspot.com/-GTd_swyOr7A/Tg2bd-2LaTI/AAAAAAAACMg/UMqIc6d2qgY/s400/store%2Bscrenshot.png" style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 98px;" border="0" alt="" id="BLOGGER_PHOTO_ID_5624322449044367666" /&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5998114554635012438-1024323278230767598?l=binaryunit.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://binaryunit.blogspot.com/feeds/1024323278230767598/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://binaryunit.blogspot.com/2011/07/9gag-ad-remover.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5998114554635012438/posts/default/1024323278230767598?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5998114554635012438/posts/default/1024323278230767598?v=2" /><link rel="alternate" type="text/html" href="http://binaryunit.blogspot.com/2011/07/9gag-ad-remover.html" title="9gag ad remover" /><author><name>Narcolessico</name><uri>http://www.blogger.com/profile/04935543128240934969</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://2.bp.blogspot.com/-GTd_swyOr7A/Tg2bd-2LaTI/AAAAAAAACMg/UMqIc6d2qgY/s72-c/store%2Bscrenshot.png" height="72" width="72" /><thr:total>0</thr:total></entry><entry gd:etag="W/&quot;DkEMQXozeCp7ImA9Wx5WEEo.&quot;"><id>tag:blogger.com,1999:blog-5998114554635012438.post-7060818871998197009</id><published>2010-09-21T14:10:00.002+01:00</published><updated>2010-09-21T14:11:20.480+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-09-21T14:11:20.480+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Humour" /><title>Google is touchy</title><content type="html">&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_dWpCGfU56J8/TJiu6tamY4I/AAAAAAAACI4/1bO8qUAnomc/s1600/googlessister.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 398px; height: 162px;" src="http://3.bp.blogspot.com/_dWpCGfU56J8/TJiu6tamY4I/AAAAAAAACI4/1bO8qUAnomc/s400/googlessister.png" border="0" alt="" id="BLOGGER_PHOTO_ID_5519353666989351810" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5998114554635012438-7060818871998197009?l=binaryunit.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://binaryunit.blogspot.com/feeds/7060818871998197009/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://binaryunit.blogspot.com/2010/09/google-is-touchy.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5998114554635012438/posts/default/7060818871998197009?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5998114554635012438/posts/default/7060818871998197009?v=2" /><link rel="alternate" type="text/html" href="http://binaryunit.blogspot.com/2010/09/google-is-touchy.html" title="Google is touchy" /><author><name>Narcolessico</name><uri>http://www.blogger.com/profile/04935543128240934969</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://3.bp.blogspot.com/_dWpCGfU56J8/TJiu6tamY4I/AAAAAAAACI4/1bO8qUAnomc/s72-c/googlessister.png" height="72" width="72" /><thr:total>0</thr:total></entry><entry gd:etag="W/&quot;CkIHQH48eyp7ImA9WxFWEkk.&quot;"><id>tag:blogger.com,1999:blog-5998114554635012438.post-6207208231885962600</id><published>2010-05-30T18:28:00.001+01:00</published><updated>2010-05-30T18:28:51.073+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-05-30T18:28:51.073+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Humour" /><title>Emacs users</title><content type="html">&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_dWpCGfU56J8/TAKgQ4kbnSI/AAAAAAAACH8/4edCH5C7emA/s1600/emacs+user.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 280px; height: 320px;" src="http://3.bp.blogspot.com/_dWpCGfU56J8/TAKgQ4kbnSI/AAAAAAAACH8/4edCH5C7emA/s400/emacs+user.png" border="0" alt="" id="BLOGGER_PHOTO_ID_5477116308759485730" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5998114554635012438-6207208231885962600?l=binaryunit.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://binaryunit.blogspot.com/feeds/6207208231885962600/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://binaryunit.blogspot.com/2010/05/emacs-users.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5998114554635012438/posts/default/6207208231885962600?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5998114554635012438/posts/default/6207208231885962600?v=2" /><link rel="alternate" type="text/html" href="http://binaryunit.blogspot.com/2010/05/emacs-users.html" title="Emacs users" /><author><name>Narcolessico</name><uri>http://www.blogger.com/profile/04935543128240934969</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://3.bp.blogspot.com/_dWpCGfU56J8/TAKgQ4kbnSI/AAAAAAAACH8/4edCH5C7emA/s72-c/emacs+user.png" height="72" width="72" /><thr:total>0</thr:total></entry><entry gd:etag="W/&quot;CkUCQn05fSp7ImA9WxFXGEU.&quot;"><id>tag:blogger.com,1999:blog-5998114554635012438.post-2946498097525746219</id><published>2010-05-26T14:23:00.002+01:00</published><updated>2010-05-26T14:24:23.325+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-05-26T14:24:23.325+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Humour" /><title>You're doing it wrong</title><content type="html">&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_dWpCGfU56J8/S_0g3peS0xI/AAAAAAAACH0/lIxFp6ljs2M/s1600/hdcleaning.png"&gt;&lt;img style="display: block; margin: 0px auto 10px; text-align: center; cursor: pointer; width: 400px; height: 300px;" src="http://4.bp.blogspot.com/_dWpCGfU56J8/S_0g3peS0xI/AAAAAAAACH0/lIxFp6ljs2M/s400/hdcleaning.png" alt="" id="BLOGGER_PHOTO_ID_5475568862350201618" border="0" /&gt;&lt;/a&gt;My first &lt;span style="font-style: italic;"&gt;You're doing it wrong&lt;/span&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5998114554635012438-2946498097525746219?l=binaryunit.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://binaryunit.blogspot.com/feeds/2946498097525746219/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://binaryunit.blogspot.com/2010/05/youre-doing-it-wrong.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5998114554635012438/posts/default/2946498097525746219?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5998114554635012438/posts/default/2946498097525746219?v=2" /><link rel="alternate" type="text/html" href="http://binaryunit.blogspot.com/2010/05/youre-doing-it-wrong.html" title="You're doing it wrong" /><author><name>Narcolessico</name><uri>http://www.blogger.com/profile/04935543128240934969</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://4.bp.blogspot.com/_dWpCGfU56J8/S_0g3peS0xI/AAAAAAAACH0/lIxFp6ljs2M/s72-c/hdcleaning.png" height="72" width="72" /><thr:total>0</thr:total></entry><entry gd:etag="W/&quot;CEICQXsycCp7ImA9WxRRGUk.&quot;"><id>tag:blogger.com,1999:blog-5998114554635012438.post-1786786290529451419</id><published>2008-10-02T00:00:00.000+01:00</published><updated>2008-10-02T11:16:00.598+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-10-02T11:16:00.598+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Various" /><title>Recovering data from a "wet" Nokia</title><content type="html">&lt;span style="font-weight: bold;"&gt;Let's ignore now&lt;/span&gt; why a phone fell in the seawater; it's enough saying that 2 years old kids don't know much about electronics. This and the following happened about one year ago, but I think it's still worth telling...&lt;br /&gt;&lt;br /&gt;So, a Nokia 6101 had a bath on the beach and suddenly stopped working (how to blame it?); unfortunately, that model hasn't an external memory card, but an integrated chip. The owner, who wasn't me, had some important stuff in the memory of the phone, and she she was &lt;span style="font-weight: bold;"&gt;willing to pay&lt;/span&gt; to recover that stuff.&lt;br /&gt;&lt;br /&gt;She first asked to a couple of electricians and phone shops, but they all said it was &lt;span style="font-weight: bold;"&gt;impossible&lt;/span&gt; to recover data from an oxidized phone. Then, I suggested calling a data-recovery company or Nokia itself; but &lt;span style="font-weight: bold;"&gt;three companies&lt;/span&gt; (yes, those companies who can recover data from a burnt hard disk for thousands dollars) said that they couldn't recover data from a proprietary chip, and at Nokia they gently said they don't deal with reparations nor recoveries. Neither a Nokia official repairman could help finding a solution.&lt;br /&gt;&lt;br /&gt;Before throwing in the towel, I disassembled the phone to see what was inside. Nothing was really oxidized, but maybe some sea salt was still on the circuits. So, as &lt;a href="http://www.google.com/"&gt;the master&lt;/a&gt; told me, I put the phone into distilled water for some minutes, then I dried it with a hairdryer. The LCD display was gone, and no signal came from the USB cable (DKU-5). Here's a picture of the dismantled phone (click for a larger view):&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_dWpCGfU56J8/SOSaIbXMCUI/AAAAAAAAB1Y/wkYF0UukI5M/s1600-h/img_7467.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://4.bp.blogspot.com/_dWpCGfU56J8/SOSaIbXMCUI/AAAAAAAAB1Y/wkYF0UukI5M/s320/img_7467.jpg" alt="" id="BLOGGER_PHOTO_ID_5252492534995487042" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;However, that little tiny battery (highlited in red) caught my attention. The battery was &lt;span style="font-weight: bold;"&gt;soldered&lt;/span&gt; on the circuit and, standing at my tester, it was exhausted. Maybe that was the real problem? I broke the soldering and replaced the battery with a new one (cost: 3€). Let's replug the phone battery (with some tape) to see if the patient is alive again...&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_dWpCGfU56J8/SOSagI-hrTI/AAAAAAAAB1g/jyY1WP2yfms/s1600-h/img_7464.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://4.bp.blogspot.com/_dWpCGfU56J8/SOSagI-hrTI/AAAAAAAAB1g/jyY1WP2yfms/s320/img_7464.jpg" alt="" id="BLOGGER_PHOTO_ID_5252492942377069874" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Ant it is! With &lt;a href="http://europe.nokia.com/pcsuite"&gt;Nokia PC Suite&lt;/a&gt; and &lt;a href="http://www.gnokii.org/"&gt;gnokii&lt;/a&gt;, through the USB cable could pass all the survivor data.&lt;br /&gt;&lt;br /&gt;And this was the simple story of the owner of a phone, who was about to &lt;span style="font-weight: bold;"&gt;lose all the data&lt;/span&gt; in the phone because of a lousy &lt;span style="font-weight: bold;"&gt;3€ battery&lt;/span&gt;, who was &lt;span style="font-weight: bold;"&gt;willing to pay&lt;/span&gt; - God knows how much - to recover all, and who was &lt;span style="font-weight: bold;"&gt;completely abandoned&lt;/span&gt; by Nokia and by a bounch of professional (???) recovering data companies.&lt;br /&gt;&lt;br /&gt;The moral of the tale is different depending on who you are in the story:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;If you are the owner of the phone, and your phone absolutely has to fall in seawater, do not despair: it's still possible to recover your data, somewhere, somehow, for just 3€;&lt;/li&gt;&lt;li&gt;If you are one of the recovering-data companies: go and find another job;&lt;/li&gt;&lt;li&gt;If you are Nokia: do &lt;span style="font-weight: bold;"&gt;not&lt;/span&gt; design phones with little, tiny, lousy, soldered batteries without telling it even to official technical support partners.&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5998114554635012438-1786786290529451419?l=binaryunit.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://binaryunit.blogspot.com/feeds/1786786290529451419/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://binaryunit.blogspot.com/2008/07/recovering-data-from-wet-nokia.html#comment-form" title="4 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5998114554635012438/posts/default/1786786290529451419?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5998114554635012438/posts/default/1786786290529451419?v=2" /><link rel="alternate" type="text/html" href="http://binaryunit.blogspot.com/2008/07/recovering-data-from-wet-nokia.html" title="Recovering data from a &quot;wet&quot; Nokia" /><author><name>Narcolessico</name><uri>http://www.blogger.com/profile/04935543128240934969</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://4.bp.blogspot.com/_dWpCGfU56J8/SOSaIbXMCUI/AAAAAAAAB1Y/wkYF0UukI5M/s72-c/img_7467.jpg" height="72" width="72" /><thr:total>4</thr:total></entry><entry gd:etag="W/&quot;DEIFRXo-fCp7ImA9WxRRGU4.&quot;"><id>tag:blogger.com,1999:blog-5998114554635012438.post-4895654953346764139</id><published>2008-10-01T22:37:00.008+01:00</published><updated>2008-10-02T09:35:14.454+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-10-02T09:35:14.454+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Various" /><title>Strange perspectives on Google Maps</title><content type="html">&lt;span style="font-weight: bold;"&gt;Sometimes pictures&lt;/span&gt; taken from a satellite have to deal with strong perspective problems. What about this two buildings, in Milan, that seem to be about to fall down?&lt;br /&gt;&lt;br /&gt;&lt;iframe style="margin: 0px auto 0px; display: block; text-align: center;" marginheight="0" marginwidth="0" src="http://maps.google.com/maps?f=q&amp;amp;hl=it&amp;amp;geocode=&amp;amp;q=&amp;amp;ie=UTF8&amp;amp;t=k&amp;amp;s=AARTsJoviRdJifeqU5gHccCsIi-ahrDK3A&amp;amp;ll=45.477259,9.195787&amp;amp;spn=0.001128,0.001609&amp;amp;z=18&amp;amp;output=embed" frameborder="0" height="300" scrolling="no" width="300"&gt;&lt;/iframe&gt;&lt;br /&gt;&lt;small&gt;&lt;a style="margin: 0px auto 0px; display: block; text-align: center;" href="http://maps.google.com/maps?f=q&amp;amp;hl=it&amp;amp;geocode=&amp;amp;q=&amp;amp;ie=UTF8&amp;amp;t=k&amp;amp;ll=45.477259,9.195787&amp;amp;spn=0.001128,0.001609&amp;amp;z=18&amp;amp;source=embed" style="color: rgb(0, 0, 255); text-align: left;"&gt;Original link&lt;/a&gt;&lt;/small&gt;&lt;br /&gt;&lt;br /&gt;The "falling" effect is due to the fact that the pictures merged into the global map are (almost) assonometric projections taken in two different directions. Of course, the higher are the buildings in the map the stronger is this kind of mental (rather than optical) illusion. Here are a view on Milan and another one on NY, Empire State Building:&lt;br /&gt;&lt;br /&gt;&lt;iframe style="margin: 0px auto 0px; display: block; text-align: center;" marginheight="0" marginwidth="0" src="http://maps.google.com/maps?f=q&amp;amp;hl=it&amp;amp;geocode=&amp;amp;q=&amp;amp;ie=UTF8&amp;amp;t=k&amp;amp;s=AARTsJoviRdJifeqU5gHccCsIi-ahrDK3A&amp;amp;ll=45.479306,9.173552&amp;amp;spn=0.000564,0.001207&amp;amp;z=19&amp;amp;output=embed" frameborder="0" height="300" scrolling="no" width="450"&gt;&lt;/iframe&gt;&lt;br /&gt;&lt;small&gt;&lt;a style="margin: 0px auto 0px; display: block; text-align: center;" href="http://maps.google.com/maps?f=q&amp;amp;hl=it&amp;amp;geocode=&amp;amp;q=&amp;amp;ie=UTF8&amp;amp;t=k&amp;amp;ll=45.479306,9.173552&amp;amp;spn=0.000564,0.001207&amp;amp;z=19&amp;amp;source=embed" style="color: rgb(0, 0, 255); text-align: left;"&gt;Original link&lt;/a&gt;&lt;/small&gt;&lt;br /&gt;&lt;iframe style="margin: 0px auto 0px; display: block; text-align: center;" width="400" height="270" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="http://maps.google.it/maps?hl=it&amp;amp;ie=UTF8&amp;amp;t=k&amp;amp;s=AARTsJql-Gi7BCSmxZJ54FcHqZjqGFpxoQ&amp;amp;ll=40.748054,-73.986558&amp;amp;spn=0.002276,0.003219&amp;amp;z=17&amp;amp;output=embed"&gt;&lt;/iframe&gt;&lt;br /&gt;&lt;small&gt;&lt;a style="margin: 0px auto 0px; display: block; text-align: center;" href="http://maps.google.it/maps?hl=it&amp;amp;ie=UTF8&amp;amp;t=k&amp;amp;ll=40.748054,-73.986558&amp;amp;spn=0.002276,0.003219&amp;amp;z=17&amp;amp;source=embed" style="color:#0000FF;text-align:left"&gt;Original link&lt;/a&gt;&lt;/small&gt;&lt;br /&gt;&lt;br /&gt;I collected some other Milan maps (&lt;a href="http://maps.google.com/maps?f=q&amp;amp;hl=it&amp;amp;geocode=&amp;amp;q=&amp;amp;ie=UTF8&amp;amp;t=h&amp;amp;ll=45.476928,9.201396&amp;amp;spn=0.000901,0.002275&amp;amp;z=19"&gt;one&lt;/a&gt;, &lt;a href="http://maps.google.com/maps?f=q&amp;amp;hl=it&amp;amp;geocode=&amp;amp;q=&amp;amp;ie=UTF8&amp;amp;t=h&amp;amp;ll=45.480197,9.188382&amp;amp;spn=0.000901,0.002275&amp;amp;z=19"&gt;two&lt;/a&gt;, &lt;a href="http://maps.google.com/maps?f=q&amp;amp;hl=it&amp;amp;geocode=&amp;amp;q=&amp;amp;ie=UTF8&amp;amp;t=h&amp;amp;ll=45.480357,9.184321&amp;amp;spn=0.000901,0.002275&amp;amp;z=19"&gt;three&lt;/a&gt;) with the same problem. But anywhere around the world maps there are tons of similar views, far more interesting than these...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5998114554635012438-4895654953346764139?l=binaryunit.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://binaryunit.blogspot.com/feeds/4895654953346764139/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://binaryunit.blogspot.com/2008/10/strange-perspectives-on-google-maps.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5998114554635012438/posts/default/4895654953346764139?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5998114554635012438/posts/default/4895654953346764139?v=2" /><link rel="alternate" type="text/html" href="http://binaryunit.blogspot.com/2008/10/strange-perspectives-on-google-maps.html" title="Strange perspectives on Google Maps" /><author><name>Narcolessico</name><uri>http://www.blogger.com/profile/04935543128240934969</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total></entry><entry gd:etag="W/&quot;DkQHRng-fip7ImA9WxdWFk8.&quot;"><id>tag:blogger.com,1999:blog-5998114554635012438.post-2677832112652035115</id><published>2008-07-09T18:20:00.003+01:00</published><updated>2008-07-09T18:25:37.656+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-07-09T18:25:37.656+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Bash" /><title>HTML page with pictures</title><content type="html">&lt;span style="font-weight: bold;"&gt;&lt;/span&gt;Quick and simple: a short bash script to create a HTML page with all the pictures you have in the current directory.&lt;br /&gt;&lt;pre class="code"&gt;&lt;span style="font-weight: bold; color: rgb(136, 0, 136);"&gt;echo&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; -e &lt;/span&gt;&lt;span style="color: rgb(221, 0, 0);"&gt;"&amp;lt;html&amp;gt;&amp;lt;head&amp;gt;&amp;lt;title&amp;gt;Icons&amp;lt;/title&amp;gt;&amp;lt;/head&amp;gt;&amp;lt;body&amp;gt;\n"&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="font-weight: bold; color: rgb(34, 51, 136);"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; file.html&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(204, 0, 204);"&gt;ls&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; -1 *.png &lt;/span&gt;&lt;span style="font-weight: bold; color: rgb(0, 0, 0);"&gt;|&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="font-weight: bold; color: rgb(0, 0, 0);"&gt;while&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="font-weight: bold; color: rgb(136, 0, 136);"&gt;read&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt;a&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;; &lt;/span&gt;&lt;span style="font-weight: bold; color: rgb(0, 0, 0);"&gt;do&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="font-weight: bold; color: rgb(136, 0, 136);"&gt;echo&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; -e &lt;/span&gt;&lt;span style="color: rgb(221, 0, 0);"&gt;"&amp;lt;img src='./&lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt;$a&lt;/span&gt;&lt;span style="color: rgb(221, 0, 0);"&gt;'/&amp;gt;\n"&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="font-weight: bold; color: rgb(34, 51, 136);"&gt;&amp;gt;&amp;gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; file.html; &lt;/span&gt;&lt;span style="font-weight: bold; color: rgb(0, 0, 0);"&gt;done&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(136, 0, 136);"&gt;echo&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; -e &lt;/span&gt;&lt;span style="color: rgb(221, 0, 0);"&gt;"&amp;lt;/body&amp;gt;&amp;lt;/html&amp;gt;\n"&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="font-weight: bold; color: rgb(34, 51, 136);"&gt;&amp;gt;&amp;gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; file.html&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;Just add different wildcards for every image format you want to include.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5998114554635012438-2677832112652035115?l=binaryunit.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://binaryunit.blogspot.com/feeds/2677832112652035115/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://binaryunit.blogspot.com/2008/07/html-page-with-pictures.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5998114554635012438/posts/default/2677832112652035115?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5998114554635012438/posts/default/2677832112652035115?v=2" /><link rel="alternate" type="text/html" href="http://binaryunit.blogspot.com/2008/07/html-page-with-pictures.html" title="HTML page with pictures" /><author><name>Narcolessico</name><uri>http://www.blogger.com/profile/04935543128240934969</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total></entry><entry gd:etag="W/&quot;CU8BQHo_eCp7ImA9WxdWFk8.&quot;"><id>tag:blogger.com,1999:blog-5998114554635012438.post-7535351053545716923</id><published>2008-07-09T17:57:00.003+01:00</published><updated>2008-07-09T18:17:31.440+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-07-09T18:17:31.440+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Bash" /><title>Online vs. offline hashes</title><content type="html">Someone asked me why the hash of any string produced by &lt;a href="http://www.hashemall.com"&gt;Hash'em'all!&lt;/a&gt; is different from the hash of the same string produced in bash by&lt;br /&gt;&lt;br /&gt;&lt;pre class='code'&gt;echo "string" | md5sum&lt;/pre&gt;&lt;br /&gt;The reason is simple: the "echo" command automatically adds a newline at the end of the input string. The "-n" option tells the command not to add it. So&lt;br /&gt;&lt;br /&gt;&lt;pre class='code'&gt;echo -n "string" | md5sum&lt;/pre&gt;&lt;br /&gt;will give the same result as &lt;a href="http://www.hashemall.com/"&gt;Hash'em'all!&lt;/a&gt;. So simple... But someone was going crazy for this.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5998114554635012438-7535351053545716923?l=binaryunit.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://binaryunit.blogspot.com/feeds/7535351053545716923/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://binaryunit.blogspot.com/2008/07/online-vs-offline-hashes.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5998114554635012438/posts/default/7535351053545716923?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5998114554635012438/posts/default/7535351053545716923?v=2" /><link rel="alternate" type="text/html" href="http://binaryunit.blogspot.com/2008/07/online-vs-offline-hashes.html" title="Online vs. offline hashes" /><author><name>Narcolessico</name><uri>http://www.blogger.com/profile/04935543128240934969</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total></entry><entry gd:etag="W/&quot;CEEBSXwyfip7ImA9WxdWFk8.&quot;"><id>tag:blogger.com,1999:blog-5998114554635012438.post-8808456987436935171</id><published>2008-04-28T17:27:00.007+01:00</published><updated>2008-07-09T17:57:38.296+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-07-09T17:57:38.296+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="HTML/CSS" /><title>Open in new windows with HTML 4.01 Strict</title><content type="html">As every web-programmer should know, in HTML 4.01 strict the "target" property of the &lt;a&gt; tags is no longer allowed. I would like to personally thank the WWW consortium for this, because I hate links that automatically open in a new window (while my best friend Firefox helps me keeping them in new tabs instead of new windows). However, under certain circumstances (?) may be desiderable to disturb the user by forcing the browser not to change the address of the current page (i.e. you don't want users to go away from your page); strange but true, you don't care about breaking the user's browsing history, but you would feel as a profanation to break the W3C standards. Here comes to help Javascript: just replace every&lt;br /&gt;&lt;br /&gt;&lt;pre class="code"&gt;&lt;span style="font-weight: bold; color: rgb(0, 0, 0);"&gt;&amp;lt;a&lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt; href=&lt;/span&gt;&lt;span style="color: rgb(170, 0, 0);"&gt;"http://..."&lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt; target=&lt;/span&gt;&lt;span style="color: rgb(170, 0, 0);"&gt;"_blank"&lt;/span&gt;&lt;span style="font-weight: bold; color: rgb(0, 0, 0);"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;with&lt;br /&gt;&lt;br /&gt;&lt;pre class="code"&gt;&lt;span style="font-family: mon;"&gt;&lt;span style="font-weight: bold;"&gt;&amp;lt;a&lt;/span&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt; href=&lt;/span&gt;&lt;span style="color: rgb(170, 0, 0);"&gt;"http://..."&lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt; onclick=&lt;/span&gt;&lt;span style="color: rgb(170, 0, 0);"&gt;"window.open(this.href); return false;"&lt;/span&gt;&lt;span style="font-weight: bold; color: rgb(0, 0, 0);"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Welcome to the dark side of standard compliance!&lt;br /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5998114554635012438-8808456987436935171?l=binaryunit.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://binaryunit.blogspot.com/feeds/8808456987436935171/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://binaryunit.blogspot.com/2008/04/open-in-new-windows-with-html-401.html#comment-form" title="26 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5998114554635012438/posts/default/8808456987436935171?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5998114554635012438/posts/default/8808456987436935171?v=2" /><link rel="alternate" type="text/html" href="http://binaryunit.blogspot.com/2008/04/open-in-new-windows-with-html-401.html" title="Open in new windows with HTML 4.01 Strict" /><author><name>Narcolessico</name><uri>http://www.blogger.com/profile/04935543128240934969</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>26</thr:total></entry><entry gd:etag="W/&quot;CUUFQH8-eCp7ImA9WxZTFko.&quot;"><id>tag:blogger.com,1999:blog-5998114554635012438.post-8750165414510886303</id><published>2008-01-18T15:29:00.000Z</published><updated>2008-01-18T16:20:11.150Z</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-01-18T16:20:11.150Z</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Bash" /><title>FS-independent bash backup</title><content type="html">&lt;span style="font-weight: bold;"&gt;&lt;/span&gt;&lt;span style="font-weight: bold;"&gt;Dirty and quick&lt;/span&gt;, a little script to backup an entire hard drive from bash:&lt;br /&gt;&lt;br /&gt;&lt;pre class="code"&gt;#!/bin/bash&lt;br /&gt;# License: do what you want but cite my blog ;)&lt;br /&gt;# http://binaryunit.blogspot.com&lt;br /&gt;#&lt;br /&gt;# *** superSalva 1.0 by Eugenio Rustico ***&lt;br /&gt;# Backup utility for ALL types of partitions&lt;br /&gt;#&lt;br /&gt;# FEATURES&lt;br /&gt;# - Easy disk/partition image *even of unknown filesystems*&lt;br /&gt;# - On the fly compression: no need for temporary files&lt;br /&gt;# - Customizeable process&lt;br /&gt;#&lt;br /&gt;# LIMITS&lt;br /&gt;# - May be more speedy&lt;br /&gt;# - No fs-specific support&lt;br /&gt;# - Reads and compress even zero-zones&lt;br /&gt;#&lt;br /&gt;# TODO:&lt;br /&gt;# - Support for decompressor without zcat equivalent&lt;br /&gt;# - Support for creating (better if bootable) iso images&lt;br /&gt;# - Support for md5sum integrity verification (!)&lt;br /&gt;# - Free space checking&lt;br /&gt;# - Wizard&lt;br /&gt;# - Final statistics and estimated time&lt;br /&gt;# - Trap for CTRL+C&lt;br /&gt;&lt;br /&gt;# Device to be backupped, even if NTFS or unknown. May be a partition or a whole disk&lt;br /&gt;export DEVICE=/dev/hda6&lt;br /&gt;&lt;br /&gt;# AUTOMATIC: device capability, in kb&lt;br /&gt;export DEVICE_DIM=`df -k | grep $DEVICE | awk {'print $2'}`&lt;br /&gt;&lt;br /&gt;# Actually unused&lt;br /&gt;export DEVICE_FREE=`df -k | grep $DEVICE | awk {'print $4'}`&lt;br /&gt;&lt;br /&gt;# Destination/source directory. If destination, should have $(dim of $DEVICE) space free&lt;br /&gt;# Do NOT locate destination on the same drive you're backupping!&lt;br /&gt;# export DIR=/d/ripristino/e&lt;br /&gt;export DIR=/pozzo&lt;br /&gt;&lt;br /&gt;# Destination/source base filename. During backup files are overwritten.&lt;br /&gt;export FILENAME=Immagine_E_20_6_2006&lt;br /&gt;&lt;br /&gt;# On the fly compression commands. Shoud support reading from stdin and writing on stdout&lt;br /&gt;# DEFAULT: gzip, well-known&lt;br /&gt;# EXPERIMENTAL: 7zip, slower but better compression. YOU MUST HAVE 7zip ALREADY INSTALLED. But does "7cat" exist?&lt;br /&gt;export COMPRESSOR=gzip&lt;br /&gt;export DECOMPRESSOR=zcat&lt;br /&gt;&lt;br /&gt;# Compression parameters&lt;br /&gt;# Actually, only a compression level sent to gzip&lt;br /&gt;export COMPRESSOR_PARAMS=-9&lt;br /&gt;&lt;br /&gt;# Compressed file extension. Optional but useful&lt;br /&gt;export EXTENSION=gz&lt;br /&gt;&lt;br /&gt;# Number of piecese to skip while backuppin/restoring&lt;br /&gt;# Useful for testing and for resuming interrupted backups&lt;br /&gt;# CHANGE THIS ONLY IF YOU KNOW WHAT YOU ARE DOING&lt;br /&gt;# Default: 0&lt;br /&gt;export SKIP=0&lt;br /&gt;&lt;br /&gt;# Block size. NOTE: from it depend default piece dimensions!&lt;br /&gt;# CHANGE THIS ONLY IF YOU KNOW WHAT YOU ARE DOING&lt;br /&gt;export BLOCK_SIZE=1024&lt;br /&gt;&lt;br /&gt;# Dimension of pieces to compress and backup, in kb.&lt;br /&gt;# Too small = too many pieces, not useful&lt;br /&gt;# Too large = unefficient compression&lt;br /&gt;# MAX = 4194303 (if dest fs is not FAT, may be higher), few pieces&lt;br /&gt;# MEDIUM VALUES:&lt;br /&gt;#   524288 (512 Mb)&lt;br /&gt;#   262144 (256Mb)&lt;br /&gt;#   131072 (128 Mb), many pieces&lt;br /&gt;#   65536  (64 Mb)&lt;br /&gt;#   32768  (32 Mb), definitely too much pieces!&lt;br /&gt;# MIN = 1 (nonsense)&lt;br /&gt;# DEFAULT = 1048576 (1 Gb, RECOMMENDED)&lt;br /&gt;# NOTE: this values are block-size dependent (in this case, we use 1024 bytes blocks)&lt;br /&gt;export PIECE_DIM=32768&lt;br /&gt;&lt;br /&gt;# AUTOMATIC: number of pieces&lt;br /&gt;# Should be plus one, but it's zero based so no matter&lt;br /&gt;export NUM=$(($DEVICE_DIM/$PIECE_DIM))&lt;br /&gt;&lt;br /&gt;# Action: BACKUP or RESTORE&lt;br /&gt;export ACTION=BACKUP&lt;br /&gt;&lt;br /&gt;# Want to see what I'm doing?&lt;br /&gt;export VERBOSE=1&lt;br /&gt;&lt;br /&gt;echo&lt;br /&gt;echo&lt;br /&gt;echo " *** superSalva 1.0 *** "&lt;br /&gt;echo&lt;br /&gt;echo&lt;br /&gt;echo "Device: $DEVICE ($DEVICE_DIM kb)"&lt;br /&gt;echo Compressor: $COMPRESSOR&lt;br /&gt;echo Decompressor: $DECOMPRESSOR&lt;br /&gt;echo Parameters: $COMPRESSOR_PARAMS&lt;br /&gt;echo Destination: $DIR/$FILENAME.NUM.TOT.$EXTENSION&lt;br /&gt;echo Device: $DEVICE&lt;br /&gt;echo Pieces: $(($NUM+1)) pieces, $PIECE_DIM kb each&lt;br /&gt;echo Action: $ACTION&lt;br /&gt;echo&lt;br /&gt;echo Ready? CTRL+C to abort, ENTER to start. May take LONG time.&lt;br /&gt;read&lt;br /&gt;echo&lt;br /&gt;echo&lt;br /&gt;&lt;br /&gt;export SUM=0&lt;br /&gt;for i in `seq $SKIP $NUM`&lt;br /&gt;do&lt;br /&gt;export FILEN="$DIR/$FILENAME.$(($i+1)).$(($NUM+1)).$EXTENSION"&lt;br /&gt;export SK=$(($i*$PIECE_DIM))&lt;br /&gt;#export&lt;br /&gt;#if [  ]&lt;br /&gt;#then&lt;br /&gt;#fi&lt;br /&gt;if [ "$ACTION" == "RESTORE" ]&lt;br /&gt;then&lt;br /&gt; echo "*  Decompressing and writing piece $(($i+1)) of $(($NUM+1)) (kb $(($SK+1)) to $((($i+1)*$PIECE_DIM)))..."&lt;br /&gt; export COMMAND="$DECOMPRESSOR $FILEN | dd of=$DEVICE seek=$SK count=$PIECE_DIM bs=$BLOCK_SIZE"&lt;br /&gt; if [ $VERBOSE == 1 ]; then echo $COMMAND; fi&lt;br /&gt; $COMMAND&lt;br /&gt; echo "*    Successfully restored $FILEN"&lt;br /&gt; echo&lt;br /&gt;else&lt;br /&gt; echo "*  Reading and compressing piece $(($i+1)) of $(($NUM+1)) (kb $(($SK+1)) to $((($i+1)*$PIECE_DIM)))..."&lt;br /&gt; export COMMAND="dd if=$DEVICE skip=$SK count=$PIECE_DIM bs=$BLOCK_SIZE | $COMPRESSOR $COMPRESSOR_PARAMS &gt; $FILEN"&lt;br /&gt; if [ $VERBOSE == 1 ]; then echo $COMMAND; fi&lt;br /&gt; $COMMAND&lt;br /&gt; export LAST_DIM=$((`ls -l $FILEN | awk {'print $5'}`/1000))&lt;br /&gt; echo "*    Saved $FILEN ($LAST_DIM kb, ratio $(((100*$LAST_DIM)/$PIECE_DIM))%)"&lt;br /&gt; export SUM=$(($SUM+$LAST_DIM))&lt;br /&gt; echo&lt;br /&gt;fi&lt;br /&gt;done&lt;br /&gt;&lt;br /&gt;echo&lt;br /&gt;if [ $ACTION == "RESTORE" ]&lt;br /&gt;then&lt;br /&gt;echo "Finished. $DEVICE seems to be restored."&lt;br /&gt;else&lt;br /&gt;echo "Finished. $(($NUM+1)) files, tot $SUM kb ($((100*$SUM/$DEVICE_DIM))% of original $DEVICE size)"&lt;br /&gt;fi&lt;br /&gt;echo Bye!&lt;br /&gt;echo&lt;/pre&gt;&lt;br /&gt;Thanks to &lt;a href="http://www.gnu.org/software/coreutils/manual/html_node/dd-invocation.html#dd-invocation"&gt;dd&lt;/a&gt;. Features:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;On the fly compression&lt;/li&gt;&lt;li&gt;Non need for temporary files&lt;/li&gt;&lt;li&gt;File-system independent&lt;/li&gt;&lt;li&gt;Backup and restore facilities&lt;/li&gt;&lt;li&gt;Keeps master boot records&lt;/li&gt;&lt;li&gt;...&lt;/li&gt;&lt;/ul&gt;TODO: lots of things (checksumming facilities, configuring wizard, free space checking, command tests...); the complete TODO list is inside the script.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5998114554635012438-8750165414510886303?l=binaryunit.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://binaryunit.blogspot.com/feeds/8750165414510886303/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://binaryunit.blogspot.com/2008/01/fs-independent-bash-backup.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5998114554635012438/posts/default/8750165414510886303?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5998114554635012438/posts/default/8750165414510886303?v=2" /><link rel="alternate" type="text/html" href="http://binaryunit.blogspot.com/2008/01/fs-independent-bash-backup.html" title="FS-independent bash backup" /><author><name>Narcolessico</name><uri>http://www.blogger.com/profile/04935543128240934969</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total></entry><entry gd:etag="W/&quot;CEcDQXg-fyp7ImA9WxdWFk8.&quot;"><id>tag:blogger.com,1999:blog-5998114554635012438.post-4028208718978183739</id><published>2008-01-15T14:23:00.001Z</published><updated>2008-07-09T17:47:50.657+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-07-09T17:47:50.657+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="HTML/CSS" /><title>Call for developers: stop designing for IE!</title><content type="html">&lt;span style="font-weight: bold;"&gt;There's one big&lt;/span&gt; truth you learn if you have a little experience in web designing and/or developing: you &lt;span style="font-weight: bold;"&gt;have to&lt;/span&gt; get stuck with Internet Explorer bugs.&lt;br /&gt;&lt;br /&gt;The work of web developers is nowadays made of two parts:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Write the website and test it (usually one test is enough for Firefox 1, Firefox 2, Opera, Safari, Camino, Konqueror, etc. on any platform)&lt;/li&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;Rewrite&lt;/span&gt; the CSS and test it again with Internet Explorer 6 and 7&lt;/li&gt;&lt;/ol&gt;Internet Explorer (any version) is &lt;span style="font-weight: bold;"&gt;not&lt;/span&gt; standard compliant. Yes, we're talking about &lt;a href="http://www.w3.org/"&gt;W3C&lt;/a&gt; standards, the ones made with efforts by the &lt;a href="http://www.w3.org/Consortium/Member/List"&gt;members&lt;/a&gt; of this worldwide consortium aiming to give a bit of order to the chaos of internet technologies and to improve websites usability. Ironically, Microsoft is a W3C member despite its known attitude not to comply with many international standards.&lt;br /&gt;&lt;br /&gt;Now, what's the problem? Simply, because of Microsoft whims in fact of standards (especially for &lt;a href="http://en.wikipedia.org/wiki/CSS"&gt;CSS&lt;/a&gt;) most web developers have to do the &lt;span style="font-weight: bold;"&gt;double work&lt;/span&gt;. Personally, I'm tired of wasting time (and money) to double-debug my works. And because so many people use (mainly &lt;span style="font-style: italic;"&gt;not intentionally&lt;/span&gt;) Internet Explorer, noone would pay for a website not viewable with IE.&lt;br /&gt;&lt;br /&gt;A solution? If you can decide about your website (read: if it's not committed, or you can talk about it with your boss) do the right thing: do not test and redesign your CSS for IE. Just leave a warning like this one:&lt;br /&gt;&lt;br /&gt;&lt;div  style="border: 1px solid rgb(102, 0, 0); margin: 1em auto; padding: 10px; background: rgb(255, 239, 255) none repeat scroll 0% 50%; display: table; width: 60%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;font-size:96%;"&gt;&lt;span style="font-weight: bold;"&gt;Warning&lt;/span&gt;: due to a bug in Internet Explorer, this website may look like &lt;span style="font-style: italic;"&gt;ugly&lt;/span&gt;. To view this page correctly, please use a standard compliant browser. Thanks.&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;This may seem rough, but it's a bit ironic to smart readers and, above all, it's perfect if you're tired or wasting your worktime for IE. Adding a sponsored link to Firefox (one like "&lt;span style="font-style: italic;"&gt;Get Firefox for better browsing&lt;/span&gt;", you know what I'm talking about) below the warning makes it even more useful.&lt;br /&gt;&lt;br /&gt;Please note that this way you won't loose all your IE users: they should just see the website &lt;span style="font-style: italic;"&gt;ugly&lt;/span&gt;, as IE naturally renders it, and they should be informed about the cause of that (while being anyway able to use it). Moreover, if they'll start using Firefox (or Opera, or...) they'll experience a better browsing experience (especially people who still use &lt;span style="font-weight: bold;"&gt;primitive&lt;/span&gt; non-tabbed broswers like IE6). And they'll be &lt;span style="font-style: italic;"&gt;thankful&lt;/span&gt; to you.&lt;br /&gt;&lt;br /&gt;Web developers (and their bosses) should keep in mind that if a standard compliant website is not correctly displayed on IE this is &lt;span style="font-weight: bold;"&gt;not&lt;/span&gt; a problem of the website itself: this is a problem of IE. And the users, both geek and inexperienced ones, have &lt;span style="font-weight: bold;"&gt;the right&lt;/span&gt; to know that someone gave them a buggy browser. Hiding this, by building a separate style just for IE, will feed users' ignorance, keeping web development tedious and time wasting.&lt;br /&gt;&lt;br /&gt;A live example of this philosophy is &lt;a href="http://www.hashemall.com/"&gt;Hash'em all!&lt;/a&gt;, one of my &lt;a href="http://binaryunit.blogspot.com/2008/01/hashem-all-free-online-text-and-file.html"&gt;last&lt;/a&gt; &lt;a href="http://binaryunit.blogspot.com/2007/05/watching-local-flv-videos-with-your.html"&gt;works&lt;/a&gt;: IE is the only browser in which the central DIVs are not correctly sized and cover all the window from left to right. I'll add some screenshots &lt;span style="font-style: italic;"&gt;asap&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;You probably don't need a proof that IE brings so many problems for developers, but in case you do here are some references:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;a href="http://www.positioniseverything.net/ie-primer.html"&gt;Internet Explorer vs. The Standards&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.positioniseverything.net/explorer.html"&gt;Collection of Internet Explorer bugs&lt;/a&gt; (tens of bugs)&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.positioniseverything.net/gecko.html"&gt;Collection of Gecko (Firefox engine) bugs&lt;/a&gt; (2 bugs)&lt;br /&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.gtalbot.org/BrowserBugsSection/MSIE7Bugs/"&gt;100 bugs in IE7 for Windows&lt;/a&gt; (note: some of them have been solved)&lt;br /&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.devarticles.com/c/a/Web-Style-Sheets/CSS-Standards-Compliance-in-Internet-Explorer-7/3/"&gt;CSS Standards compliance in IE7&lt;/a&gt; (page 4)&lt;br /&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://css-discuss.incutio.com/?page=IE7"&gt;IE7 discussion&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://blogs.msdn.com/ie/archive/2006/02/02/523679.aspx#524457"&gt;IE7 will never support &lt;span style="font-style: italic;"&gt;display: table&lt;/span&gt;&lt;/a&gt; (on IEblog)&lt;/li&gt;&lt;li&gt;&lt;a href="http://en.wikipedia.org/wiki/Comparison_of_web_browsers"&gt;Comparison of web browsers&lt;/a&gt; (Wikipedia)&lt;/li&gt;&lt;/ul&gt;Similar initiatives:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;a href="http://web.archive.org/web/20020204082330/www.alistapart.com/stories/tohell/"&gt;To hell with bad browsers&lt;/a&gt; (not active anymore, on webarchive)&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span style="font-weight: bold;"&gt;UPDATE&lt;/span&gt;: I added to &lt;a href="http://www.hashemall.com/"&gt;Hash'em all!&lt;/a&gt; the link to a campaign called "Ugly on IE, not for my fault". If you wish to do the same don't hesitate to add the same image (or another better) linking to this post.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5998114554635012438-4028208718978183739?l=binaryunit.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://binaryunit.blogspot.com/feeds/4028208718978183739/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://binaryunit.blogspot.com/2008/01/call-for-developers-stop-designing-for.html#comment-form" title="2 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5998114554635012438/posts/default/4028208718978183739?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5998114554635012438/posts/default/4028208718978183739?v=2" /><link rel="alternate" type="text/html" href="http://binaryunit.blogspot.com/2008/01/call-for-developers-stop-designing-for.html" title="Call for developers: stop designing for IE!" /><author><name>Narcolessico</name><uri>http://www.blogger.com/profile/04935543128240934969</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>2</thr:total></entry><entry gd:etag="W/&quot;A0QBRX46eyp7ImA9WxRbGEg.&quot;"><id>tag:blogger.com,1999:blog-5998114554635012438.post-226997165020297438</id><published>2008-01-13T17:58:00.000Z</published><updated>2008-12-09T21:49:14.013Z</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-12-09T21:49:14.013Z</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Various" /><title>Hash'em all: free online text and file hashing</title><content type="html">&lt;span style="font-weight: bold;"&gt;I couldn't find&lt;/span&gt; an online hashing service which allowed to hash text strings and &lt;span style="font-weight: bold;"&gt;files&lt;/span&gt; using several different algorithms (MD5, SHA1, SHA512, RIPMED, Whirlpool, HAVAL, etc.); so, I made one. And after hours and hours of creative efforts, here's the name I conceived: &lt;a href="http://www.hashemall.com/"&gt;Hash'em all!&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://www.hashemall.com/"&gt;&lt;img style="margin: 0pt 0pt 10px 10px; float: right; cursor: pointer;" src="http://4.bp.blogspot.com/_dWpCGfU56J8/R4pZSJCfWTI/AAAAAAAABdA/aW8vURtKK-M/s200/shot.png" alt="" id="BLOGGER_PHOTO_ID_5155030891677833522" border="0" /&gt;&lt;/a&gt;Layout is really simple but (big surprise!) there's a rendering problem with Internet Explorer (any verision). The central DIVs are correctly sized in Firefox, Opera, Safari, Konqueror, Camino and every other standard-compliant web-browser; unfortunately, IE is not in this list (while MS is part of W3C consortium... bah!).&lt;br /&gt;&lt;br /&gt;I will *never* redisign the site to fit IE bugs with a CSS selector and a separate stylesheet: I have no intention to do again the work because of Microsoft's whims.&lt;br /&gt;Using IE &lt;a href="http://www.hashemall.com/"&gt;Hash'em all!&lt;/a&gt; is still usable, but ugly. If you want a nice interface, please use a W3C-compliant browser. And, if you'd like to know what's the problem: it seems that in IE there's no way to have a centered auto-adaping DIV, because IE totally ignores &lt;span style="font-style: italic;"&gt;display: table;&lt;/span&gt; CSS attribute.&lt;br /&gt;&lt;br /&gt;Features in brief:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;It's free&lt;/li&gt;&lt;li&gt;It's fast (less than 0.1 second for most queries)&lt;br /&gt;&lt;/li&gt;&lt;li&gt;There's no limit on the number of queries&lt;br /&gt;&lt;/li&gt;&lt;li&gt;It allows to hash files up to 10Mb&lt;/li&gt;&lt;li&gt;You can choose up to 35 different digests&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Allows empty strings&lt;/li&gt;&lt;li&gt;It's cute (but that's subjective...)&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;Yes, there are just a few google ads. But it's free (as in &lt;span style="font-style: italic;"&gt;free beer&lt;/span&gt;, for now) ;]&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5998114554635012438-226997165020297438?l=binaryunit.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://binaryunit.blogspot.com/feeds/226997165020297438/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://binaryunit.blogspot.com/2008/01/hashem-all-free-online-text-and-file.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5998114554635012438/posts/default/226997165020297438?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5998114554635012438/posts/default/226997165020297438?v=2" /><link rel="alternate" type="text/html" href="http://binaryunit.blogspot.com/2008/01/hashem-all-free-online-text-and-file.html" title="Hash'em all: free online text and file hashing" /><author><name>Narcolessico</name><uri>http://www.blogger.com/profile/04935543128240934969</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://4.bp.blogspot.com/_dWpCGfU56J8/R4pZSJCfWTI/AAAAAAAABdA/aW8vURtKK-M/s72-c/shot.png" height="72" width="72" /><thr:total>0</thr:total></entry><entry gd:etag="W/&quot;CEEBSHczeCp7ImA9WxZTFko.&quot;"><id>tag:blogger.com,1999:blog-5998114554635012438.post-30116896363996909</id><published>2008-01-13T17:17:00.001Z</published><updated>2008-01-18T16:10:59.980Z</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-01-18T16:10:59.980Z</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Hacks" /><title>Workaround: dpkg goes Segmentation Fault</title><content type="html">&lt;span style="font-weight: bold;"&gt;So, your apt-get [dist-]upgrade&lt;/span&gt; stops when a post/pre-installation script goes in Segmentation Fault. The strange thing is that the same script, extracted from your favourite deb package, works if launched standalone. That's probably a &lt;a href="http://packages.debian.org/debconf"&gt;debconf&lt;/a&gt; or &lt;a href="http://packages.debian.org/dpkg"&gt;dpkg&lt;/a&gt; bug but, frankly, I didn't even google to find if it's really a known bug: I get this problem quite often on my Debian testing (especially while upgrading libc6, tzdatam console_common), so I chose to spend my time looking for a workaround. And, finally, I found a very simple one.&lt;br /&gt;&lt;br /&gt;That's, more or less, the error I get (note: my system is localized in italian):&lt;br /&gt;&lt;br /&gt;&lt;pre class="code"&gt;(Lettura del database ... 184524 file e directory attualmente installati.)&lt;br /&gt;Mi preparo a sostituire libc6 2.7-3 (con libc6 2.7-5) ...&lt;br /&gt;Spacchetto il sostituto di libc6 ...&lt;br /&gt;Configuro libc6 (2.7-5) ...&lt;br /&gt;dpkg: errore processando libc6 (--install):&lt;br /&gt;il sottoprocesso post-installation script è stato terminato dal segnale (Segmentation fault)&lt;br /&gt;Sono occorsi degli errori processando:&lt;br /&gt;libc6&lt;/pre&gt;&lt;br /&gt;In a nutshell, my solution is:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Unpack the .deb package causing the problem and grab the meta-files&lt;/li&gt;&lt;li&gt;Clear the pre/post-installation script (depending on which one causes the segmentation fault)&lt;/li&gt;&lt;li&gt;Pack a new .deb package with these fake scripts and install it&lt;/li&gt;&lt;li&gt;Run manually the scripts you modified (do this before the installation if it was a &lt;span style="font-style: italic;"&gt;preinst&lt;/span&gt; or &lt;span style="font-style: italic;"&gt;pre/post-rm&lt;/span&gt;)&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Done: you can go on with your dist-upgrade&lt;/li&gt;&lt;/ul&gt;That's easy to do within a bash shell if you know the right commands. And they are:&lt;br /&gt;&lt;br /&gt;&lt;pre class="code"&gt;# Make a copy of crashing package&lt;br /&gt;cp /var/cache/apt/archives/crashing_pkg_x.y.z.deb ./crashing_package.deb&lt;br /&gt;&lt;br /&gt;# Extracts package data&lt;br /&gt;dpkg-deb -x crashing_package.deb ./temp_dir&lt;br /&gt;&lt;br /&gt;# Extracts package meta-files&lt;br /&gt;dpkg-deb -e crashing_package.deb ./temp_dir/DEBIAN&lt;br /&gt;&lt;br /&gt;# Make fake post/pre installation scripts&lt;br /&gt;echo "echo Fake" &gt; ./temp_dir/DEBIAN/postinst&lt;br /&gt;&lt;br /&gt;# Pack a new modified package&lt;br /&gt;dpkg-deb -b ./temp_dir/ mod_package.deb&lt;br /&gt;&lt;br /&gt;# Install the hacked package (should not go in segfault)&lt;br /&gt;dpkg -i mod_package.deb&lt;br /&gt;&lt;br /&gt;# Manually run postinst script&lt;br /&gt;./temp_dir/DEBIAN/postinst&lt;br /&gt;&lt;br /&gt;# Clean&lt;br /&gt;rm -rf ./temp_dir&lt;br /&gt;rm crashing_package.deb mod_package.deb&lt;/pre&gt;Dirty and functional, as usual. But pay attention to the manual execution of scripts: they may crash, or refuse to go on, or they may contain debconf commands that bash can't execute; so my advice is: take a look inside and try to manually do, step by step, what the script was supposed to do (uninstalling packages, stopping processes, restarting daemons, upgrading configurations, and so on).&lt;br /&gt;&lt;br /&gt;I guess you're experienced enough to change them to suit your needs (and, above all, I'm in a hurry now!). So, good luck and may the GNU-force be with you =)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5998114554635012438-30116896363996909?l=binaryunit.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://binaryunit.blogspot.com/feeds/30116896363996909/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://binaryunit.blogspot.com/2008/01/dist-upgrade-goes-segmentation-fault.html#comment-form" title="2 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5998114554635012438/posts/default/30116896363996909?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5998114554635012438/posts/default/30116896363996909?v=2" /><link rel="alternate" type="text/html" href="http://binaryunit.blogspot.com/2008/01/dist-upgrade-goes-segmentation-fault.html" title="Workaround: dpkg goes Segmentation Fault" /><author><name>Narcolessico</name><uri>http://www.blogger.com/profile/04935543128240934969</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>2</thr:total></entry><entry gd:etag="W/&quot;A0QBRX89fCp7ImA9WxRbGEg.&quot;"><id>tag:blogger.com,1999:blog-5998114554635012438.post-1035710221756074776</id><published>2007-12-21T12:50:00.000Z</published><updated>2008-12-09T21:49:14.164Z</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-12-09T21:49:14.164Z</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="HTML/CSS" /><title>Clearer active tab in Firefox</title><content type="html">&lt;span style="font-weight: bold;"&gt;Firefox is great&lt;/span&gt;, and one of its coolest features is the use of &lt;a href="http://en.wikipedia.org/wiki/Cascading_Style_Sheets"&gt;CSS&lt;/a&gt; in combination with &lt;a href="http://en.wikipedia.org/wiki/Xul"&gt;XUL&lt;/a&gt; to manage styles and themes.&lt;br /&gt;My favourite theme is &lt;a href="https://addons.mozilla.org/it/firefox/addon/1905"&gt;Mostly Crystal&lt;/a&gt; with small toolbar icons and &lt;a href="http://www.tom-cat.com/mozilla/firefox/userchrome.html"&gt;some other hacks&lt;/a&gt;, which allow me to change many theme details. The only thing I still have to change manually is the tabs' aspect: extensions like &lt;a href="https://addons.mozilla.org/it/firefox/addon/3707"&gt;Firefox-plus&lt;/a&gt; need ot overwrite other themes' settings and among Mostly Crystal hacks for tabs there's no one which just make current tab clearer (at least, no one platform-independent: on Win &lt;a href="http://www.tom-cat.com/mozilla/firefox/userchrome.html#nativetabs"&gt;default o.s. tabs&lt;/a&gt; may be clear enough).&lt;br /&gt;If you'd like to have clearer tabs with any theme, just append these lines to your &lt;a href="http://www.mozilla.org/support/firefox/edit#css"&gt;userChrome.css&lt;/a&gt;:&lt;br /&gt;&lt;pre class="code"&gt;&lt;br /&gt;/* userChrome.css mod for a clearer current tab&lt;br /&gt;* http://binaryunit.blogspot.com&lt;br /&gt;*/&lt;br /&gt;.tab-image-left[selected="true"] {&lt;br /&gt;border-left: solid 1px #006 !important;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;.tab-image-right[selected="true"] {&lt;br /&gt;border-right: solid 1px #006 !important;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;.tabbrowser-tab[selected="true"] &gt; hbox,&lt;br /&gt;.tabbrowser-tab[selected="true"] &gt; .tab-close-button {&lt;br /&gt;background-color: #FFF !important;&lt;br /&gt;background-image: none !important;&lt;br /&gt;color: #005 !important;&lt;br /&gt;border-top: solid 1px #006 !important;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;.tabbrowser-tab[selected="true"]:hover &gt; hbox,&lt;br /&gt;.tabbrowser-tab[selected="true"]:hover &gt; .tab-close-button {&lt;br /&gt;color: #009 !important;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;.tabbrowser-tab[selected="false"]:hover &gt; hbox,&lt;br /&gt;.tabbrowser-tab[selected="false"]:hover &gt; .tab-close-button {&lt;br /&gt;padding-top: -2px !important;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;.tabbrowser-tab[selected="false"] &gt; hbox,&lt;br /&gt;.tabbrowser-tab[selected="false"] &gt; .tab-close-button {&lt;br /&gt;background-color: #666 !important;&lt;br /&gt;}&lt;/pre&gt;What these lines do in detail it's easy to understand. Suggestion: use &lt;a href="http://webdesigns.ms11.net/chromeditp.html"&gt;ChromEdit&lt;/a&gt; to modify your userChrome.css.&lt;br /&gt;&lt;br /&gt;By using Mostly Crystal and this mod, this (approximately) will be the result:&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_dWpCGfU56J8/R2u_gZCfWHI/AAAAAAAABaw/VEPvztg5G5g/s1600-h/clearerTabsPreview.png"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer;" src="http://2.bp.blogspot.com/_dWpCGfU56J8/R2u_gZCfWHI/AAAAAAAABaw/VEPvztg5G5g/s400/clearerTabsPreview.png" alt="" id="BLOGGER_PHOTO_ID_5146417562398972018" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5998114554635012438-1035710221756074776?l=binaryunit.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://binaryunit.blogspot.com/feeds/1035710221756074776/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://binaryunit.blogspot.com/2007/12/firefox-is-great-and-one-of-its-coolest.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5998114554635012438/posts/default/1035710221756074776?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5998114554635012438/posts/default/1035710221756074776?v=2" /><link rel="alternate" type="text/html" href="http://binaryunit.blogspot.com/2007/12/firefox-is-great-and-one-of-its-coolest.html" title="Clearer active tab in Firefox" /><author><name>Narcolessico</name><uri>http://www.blogger.com/profile/04935543128240934969</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://2.bp.blogspot.com/_dWpCGfU56J8/R2u_gZCfWHI/AAAAAAAABaw/VEPvztg5G5g/s72-c/clearerTabsPreview.png" height="72" width="72" /><thr:total>0</thr:total></entry><entry gd:etag="W/&quot;CEEBQH47fip7ImA9WxZTFko.&quot;"><id>tag:blogger.com,1999:blog-5998114554635012438.post-8776832854915813735</id><published>2007-11-19T14:11:00.001Z</published><updated>2008-01-18T16:10:51.006Z</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-01-18T16:10:51.006Z</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Bash" /><title>Organize your pictures by EXIF tags with bash</title><content type="html">&lt;span style="font-weight: bold;"&gt;Just a&lt;/span&gt; simple script to order your thousands of pictures by putting them in subdirectories on the basis of EXIF shot date:&lt;br /&gt;&lt;br /&gt;&lt;pre class="code"&gt;#!/bin/bash&lt;br /&gt;# BashButler 1.0 - 11/2007 by Eugenio Rustico&lt;br /&gt;# Bash script to organize your pictures in folders by date&lt;br /&gt;#&lt;br /&gt;# GPL v3 license http://www.gnu.org/licenses/gpl-3.0.html&lt;br /&gt;&lt;br /&gt;ls -1 *.jpg | while read fn&lt;br /&gt;do&lt;br /&gt;export dt=`exiv2 "$fn" | grep timestamp | awk '{ print $4 }' | tr ":" "-"`&lt;br /&gt;if test ! -e ./$dt&lt;br /&gt;then&lt;br /&gt; mkdir $dt&lt;br /&gt;fi&lt;br /&gt;mv "$fn" ./$dt&lt;br /&gt;echo File "$fn" moved in "$dt"&lt;br /&gt;done&lt;br /&gt;&lt;br /&gt;echo Good job!&lt;/pre&gt;&lt;br /&gt;I wrote it to setup 4.900 pictures which were all in the same directory, and it was really fast and useful. My unstoppable sense of humor conceived this amazing script name: &lt;span style="font-style: italic;"&gt;Bash Butler&lt;/span&gt;. I'm very sorry for this. =)&lt;br /&gt;&lt;br /&gt;Notes:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Of course you need exiv2 package on your system, but you can use other cli exif tools by modifying only one row;&lt;/li&gt;&lt;li&gt;With very little changes, you can modify the script to organize your pictures by different EXIF tags (e.g. different folders for different digital cameras);&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Filenames with spaces are treated correctly;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;By default mv does'nt overwrite destination files: so all remaining files in current directory are copies, and can be deleted.&lt;/li&gt;&lt;/ul&gt;GPL license v.3, of course.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5998114554635012438-8776832854915813735?l=binaryunit.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://binaryunit.blogspot.com/feeds/8776832854915813735/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://binaryunit.blogspot.com/2007/11/just-simple-script-to-order-your.html#comment-form" title="4 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5998114554635012438/posts/default/8776832854915813735?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5998114554635012438/posts/default/8776832854915813735?v=2" /><link rel="alternate" type="text/html" href="http://binaryunit.blogspot.com/2007/11/just-simple-script-to-order-your.html" title="Organize your pictures by EXIF tags with bash" /><author><name>Narcolessico</name><uri>http://www.blogger.com/profile/04935543128240934969</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>4</thr:total></entry><entry gd:etag="W/&quot;CEEARXw5fyp7ImA9WxZTFko.&quot;"><id>tag:blogger.com,1999:blog-5998114554635012438.post-678543292786310340</id><published>2007-11-13T21:37:00.000Z</published><updated>2008-01-18T16:10:44.227Z</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-01-18T16:10:44.227Z</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Hacks" /><title>NVIDIA 1.0-9629 on Debian testing</title><content type="html">Being on the testing branch of Debian is cool; you have recent software, fresh updates, and plenty of little problems to solve.&lt;br /&gt;&lt;br /&gt;Some days (weeks?) ago, after an apt-get dist-upgrade, graphic acceleration on my laptop stopped working. I didn't play with 3D things for a long time, so I realized just some days ago that the nvidia driver was not loaded anymore.&lt;br /&gt;&lt;br /&gt;Why? Well... Who could say? Probably something changed (gcc, kernel subversion, xorg) and nvidia driver got angry for that. So, again and again:&lt;br /&gt;&lt;br /&gt;&lt;pre class="code"&gt;aer:/pozzo# sh ./NVIDIA-Linux-x86-100.14.19-pkg1.run&lt;br /&gt;...&lt;/pre&gt;&lt;br /&gt;But xorg couldn't find any "nvidia" driver. Among my tries, there was:&lt;br /&gt;&lt;br /&gt;&lt;pre class="code"&gt;aer:/pozzo# cp /usr/X11R6/lib/modules/drivers/* /usr/lib/xorg/modules/drivers/&lt;br /&gt;aer:/pozzo#&lt;/pre&gt;&lt;br /&gt;Yeah, I know, it was rough: soft linking would have been much more efficient (and more elegant). Anyway, after this, all worked.&lt;br /&gt;&lt;br /&gt;One day later I found out a new driver version was available (100.14.19), and this latter one didn't require any workaround. Too late...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5998114554635012438-678543292786310340?l=binaryunit.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://binaryunit.blogspot.com/feeds/678543292786310340/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://binaryunit.blogspot.com/2007/11/nvidia-10-9629-on-debian-testing.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5998114554635012438/posts/default/678543292786310340?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5998114554635012438/posts/default/678543292786310340?v=2" /><link rel="alternate" type="text/html" href="http://binaryunit.blogspot.com/2007/11/nvidia-10-9629-on-debian-testing.html" title="NVIDIA 1.0-9629 on Debian testing" /><author><name>Narcolessico</name><uri>http://www.blogger.com/profile/04935543128240934969</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total></entry><entry gd:etag="W/&quot;A0QBRX0_fCp7ImA9WxRbGEg.&quot;"><id>tag:blogger.com,1999:blog-5998114554635012438.post-2320817710602921566</id><published>2007-10-13T12:13:00.000+01:00</published><updated>2008-12-09T21:49:14.344Z</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-12-09T21:49:14.344Z</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Software" /><title>FractalJ: java renderer for IFS fractals</title><content type="html">If you want to render an &lt;a href="http://en.wikipedia.org/wiki/Iterated_function_system"&gt;IFS&lt;/a&gt; to a raster image, you can use the &lt;a href="http://en.wikipedia.org/wiki/Chaos_game"&gt;chaos game&lt;/a&gt; or a deterministic algorithm.&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_dWpCGfU56J8/RxD6tgn9pTI/AAAAAAAABZg/AXeLq2KKGQU/s1600-h/FractalJ16.png"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer;" src="http://2.bp.blogspot.com/_dWpCGfU56J8/RxD6tgn9pTI/AAAAAAAABZg/AXeLq2KKGQU/s200/FractalJ16.png" alt="" id="BLOGGER_PHOTO_ID_5120868436078863666" border="0" /&gt;&lt;/a&gt;Most IFS rendering softwares use the first alternative (e.g. &lt;a href="http://wmi.math.u-szeged.hu/xaos/"&gt;XaoS&lt;/a&gt; and &lt;a href="http://www.apophysis.org/"&gt;Apophysis&lt;/a&gt;), because of its simplicity and speed; but if you prefer watching your IFS while it grows, step after step, or you don't need to get 1,000 steps while drawings, or simply you're interested in a very simple IFS rendering program for didactic purposes... FractalJ is for you.&lt;br /&gt;&lt;br /&gt;FractalJ is a very simple Java application coded by me and C. Russo; to describe IFSs (called "seeds" by the program), a scripting language similar to &lt;a href="http://en.wikipedia.org/wiki/Logo_%28programming_language%29"&gt;Logo&lt;/a&gt; is used. When FractalJ implementation was finished, I met &lt;a href="http://en.wikipedia.org/wiki/L-system"&gt;L-System&lt;/a&gt; grammars. Too late... But quite similar to the grammar I used.&lt;br /&gt;&lt;br /&gt;There's an extra command-line parameter to render multiple images of an interpolation between two different seeds. Below on the right, there's an animation I made with FractalJ and MEncoder.&lt;br /&gt;&lt;div style="text-align: center; float: right;"&gt;&lt;br /&gt;&lt;object style="margin: 0pt auto;" height="213" width="250"&gt;&lt;br /&gt;&lt;param name="movie" value="http://www.youtube.com/v/gXVj2SLSnSc"&gt;&lt;br /&gt;&lt;param name="wmode" value="transparent"&gt;&lt;br /&gt;&lt;embed src="http://www.youtube.com/v/gXVj2SLSnSc" type="application/x-shockwave-flash" wmode="transparent" height="213" width="250"&gt;&lt;/embed&gt;&lt;br /&gt;&lt;/object&gt;&lt;br /&gt;&lt;/div&gt;&lt;a href="http://galileo.dmi.unict.it/utenti/bidduni/FractalJ/IFSInterpolationsXvid.avi"&gt;Here&lt;/a&gt; you can download an high resolution version (Xvid, 5.4Mb) of the same video.&lt;br /&gt;&lt;br /&gt;In a nutshell:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;FractalJ&lt;/span&gt; IFS renderer&lt;/li&gt;&lt;li&gt;No installation required&lt;/li&gt;&lt;li&gt;&lt;a href="http://galileo.dmi.unict.it/utenti/bidduni/FractalJ/screenshots/"&gt;Screenshots&lt;/a&gt;&lt;/li&gt;&lt;li&gt;Written in Java (for Linux, MacOsX, Windows, ...)&lt;/li&gt;&lt;li&gt;GNU &lt;a href="http://www.gnu.org/licenses/gpl.html"&gt;GPLv3&lt;/a&gt; license (it's free)&lt;/li&gt;&lt;li&gt;&lt;a href="http://galileo.dmi.unict.it/utenti/bidduni/FractalJ/FractalJ.tar.gz"&gt;Direct download link&lt;/a&gt; (~28 Kb)&lt;/li&gt;&lt;/ul&gt;Inside the compressed archive you'll find:&lt;br /&gt;&lt;ul&gt;&lt;li&gt; Java source code&lt;/li&gt;&lt;li&gt; Scripting language brief description&lt;/li&gt;&lt;li&gt; Several scripting examples&lt;/li&gt;&lt;li&gt; Readme.txt&lt;/li&gt;&lt;/ul&gt; As written inside the "readme" file:&lt;br /&gt;&lt;blockquote style="font-style: italic;"&gt; Please note: this software was NOT ment to be distributed. So, code is not well commented; usability is low; there is almost no error checking. It's just for didactic purposes.&lt;/blockquote&gt;&lt;br /&gt;So, I don't need to be sorry because of its terrible interface =)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5998114554635012438-2320817710602921566?l=binaryunit.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://binaryunit.blogspot.com/feeds/2320817710602921566/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://binaryunit.blogspot.com/2007/10/fractalj-java-renderer-for-ifs-fractals.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5998114554635012438/posts/default/2320817710602921566?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5998114554635012438/posts/default/2320817710602921566?v=2" /><link rel="alternate" type="text/html" href="http://binaryunit.blogspot.com/2007/10/fractalj-java-renderer-for-ifs-fractals.html" title="FractalJ: java renderer for IFS fractals" /><author><name>Narcolessico</name><uri>http://www.blogger.com/profile/04935543128240934969</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://2.bp.blogspot.com/_dWpCGfU56J8/RxD6tgn9pTI/AAAAAAAABZg/AXeLq2KKGQU/s72-c/FractalJ16.png" height="72" width="72" /><thr:total>0</thr:total></entry><entry gd:etag="W/&quot;A0QBRXs5fyp7ImA9WxRbGEg.&quot;"><id>tag:blogger.com,1999:blog-5998114554635012438.post-6798445066894034248</id><published>2007-10-12T22:19:00.000+01:00</published><updated>2008-12-09T21:49:14.527Z</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-12-09T21:49:14.527Z</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Humour" /><title>Universal algorithm</title><content type="html">Ladies and gentleman, here is the only and original &lt;span style="font-weight: bold;"&gt;universal problem solver&lt;/span&gt;. Just one algorithm correct and complete for *all* kinds of problems you can run into.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_dWpCGfU56J8/RxKM3An9pVI/AAAAAAAABZw/AfvLFE2Ip-Q/s1600-h/Universal+algorithm.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://2.bp.blogspot.com/_dWpCGfU56J8/RxKM3An9pVI/AAAAAAAABZw/AfvLFE2Ip-Q/s400/Universal+algorithm.png" alt="" id="BLOGGER_PHOTO_ID_5121310602961986898" border="0" /&gt;&lt;/a&gt;Click on it to get the full resolution image - maybe you need it!&lt;br /&gt;Merit (and shame) are not all for me: &lt;a href="http://sevencapitalsins.wordpress.com/2007/10/09/metodo-universale-per-la-soluzione-dei-problemi/"&gt;here&lt;/a&gt;'s the orginal diagram I just translated.&lt;br /&gt;Trust me: it works!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5998114554635012438-6798445066894034248?l=binaryunit.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://binaryunit.blogspot.com/feeds/6798445066894034248/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://binaryunit.blogspot.com/2007/10/universal-algorithm.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5998114554635012438/posts/default/6798445066894034248?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5998114554635012438/posts/default/6798445066894034248?v=2" /><link rel="alternate" type="text/html" href="http://binaryunit.blogspot.com/2007/10/universal-algorithm.html" title="Universal algorithm" /><author><name>Narcolessico</name><uri>http://www.blogger.com/profile/04935543128240934969</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://2.bp.blogspot.com/_dWpCGfU56J8/RxKM3An9pVI/AAAAAAAABZw/AfvLFE2Ip-Q/s72-c/Universal+algorithm.png" height="72" width="72" /><thr:total>0</thr:total></entry><entry gd:etag="W/&quot;A0QBRH49eip7ImA9WxRbGEg.&quot;"><id>tag:blogger.com,1999:blog-5998114554635012438.post-2639707404806395530</id><published>2007-07-04T19:08:00.000+01:00</published><updated>2008-12-09T21:49:15.062Z</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-12-09T21:49:15.062Z</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Hacks" /><title>Out from the proxy in 60 seconds</title><content type="html">&lt;span style="font-weight: bold;"&gt;So, in your&lt;/span&gt; university, you can surf internet only behind a proxy, within a limited surfing area. If your situation is like the following:&lt;ul&gt;&lt;li&gt;IP-level web proxy&lt;/li&gt;&lt;li&gt;Only educational domains accessible&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Personal Linux account without any administrative privileges&lt;/li&gt;&lt;/ul&gt;then there could be a way to go out. I'll briefly explain how I did in my university, but most probably with a few adaptations the same procedure could work in very different environments. Please note that this is &lt;span style="font-style: italic;"&gt;not &lt;/span&gt;a guide for dummies: I'll just list the necessary steps, without going deep in details (e.g. how to use a hex editor or how to set up a configuration file).&lt;br /&gt;&lt;br /&gt;Have you ever heard about &lt;a href="http://en.wikipedia.org/wiki/PlanetLab"&gt;Planetlab&lt;/a&gt; platform and its proxy service &lt;a href="http://en.wikipedia.org/wiki/Codeen"&gt;Codeen&lt;/a&gt;? If not, please inform yourself through Wikipedia before continuing :) Let's just say there's a free http proxy service available in some educational domains (especially universities); most of them are accessible also from limited surfing proxies, so all we have to do is to configure our system so that a Codeen proxy is used to surf. How to reach that proxy? Through your ordinary proxy, of course; but how to use two proxies in a chain? Most of web browsers don't allow to set up a proxy chain, so we must use additional softwares like &lt;a href="http://proxychains.sourceforge.net/"&gt;proxychains&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_dWpCGfU56J8/RpOw2oLphsI/AAAAAAAABYA/IhmBMy13WLU/s1600-h/mirrors.jpg"&gt;&lt;img style="margin: 8px; float: left; cursor: pointer;" src="http://1.bp.blogspot.com/_dWpCGfU56J8/RpOw2oLphsI/AAAAAAAABYA/IhmBMy13WLU/s200/mirrors.jpg" alt="" id="BLOGGER_PHOTO_ID_5085602856777123522" border="0" /&gt;&lt;/a&gt;Most probably you can access at least the package mirrors of the distro you're using; for example, I could access &lt;a href="http://packages.ubuntu.com/"&gt;http://packages.ubuntu.com&lt;/a&gt; and some of its download mirrors from behind my proxy, so I could download the package with the same computer. Otherwise, I would just have had to download the same package through another machine and then to copy it in the behind-proxy-machine.&lt;br /&gt;&lt;br /&gt;Once we have a .deb (or .rpm or whatever) package, we can open it with an archive manager to unpack just the files we need: the executable(s), eventual local configuration files and the required libraries (tipically to be unpacked in a ./lib subdirectory). We cannot install new shared libraries because we don't have administrative privileges, but we know &lt;a href="http://tldp.org/HOWTO/Program-Library-HOWTO/shared-libraries.html"&gt;other ways&lt;/a&gt; to use non-installed libraries. For example:&lt;pre class="code"&gt;user@lab:~/proxy$ export LD_LIBRARY_PATH=./lib&lt;br /&gt;user@lab:~/proxy$ export LD_PRELOAD=`pwd`/lib/libproxychains.so&lt;br /&gt;user@lab:~/proxy$ ./proxychains /usr/bin/firefox&lt;br /&gt;ERROR: ld.so: object '/usr/lib/libproxychains.so' from LD_PRELOAD cannot be preloaded: ignored.&lt;br /&gt;ERROR: ld.so: object '/usr/lib/libproxychains.so' from LD_PRELOAD cannot be preloaded: ignored.&lt;br /&gt;user@lab:~/proxy$&lt;/pre&gt;Unfortunately, setting LD_LIBRARY_PATH or LD_PRELOAD doesn't work, because proxychains executable overwrites the latter one. &lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_dWpCGfU56J8/RpOyCoLphuI/AAAAAAAABYQ/IL8y1CVzK3Y/s1600-h/edit_before.jpg"&gt;&lt;img style="margin: 8px; float: right; cursor: pointer;" src="http://1.bp.blogspot.com/_dWpCGfU56J8/RpOyCoLphuI/AAAAAAAABYQ/IL8y1CVzK3Y/s200/edit_before.jpg" alt="" id="BLOGGER_PHOTO_ID_5085604162447181538" border="0" /&gt;&lt;/a&gt;Two choices: modifying proxychains source and compiling it again (but we may need other "&lt;span style="font-style: italic;"&gt;dev&lt;/span&gt;" packages to install), or modifying the proxychains executable with a hexadecimal editor. We choose the second one, and if we don't have a hex editor on our machine, we can download also another app like &lt;a href="http://people.mandriva.com/%7Eprigaux/hexedit.html"&gt;hexedit&lt;/a&gt;; it allows us to modify the only text string we care about: "/usr/lib/libproxychains.so", that we're going to change in a local path (with the same length like "././/lib/libproxychains.so" or "./tmplib/libproxychains.so".&lt;br /&gt;&lt;br /&gt;At this point, we should have proxychains working. Let's choose from &lt;a href="http://fall.cs.princeton.edu/codeen/"&gt;this list&lt;/a&gt; a Codeen proxy accessible from our usual proxy; from an italian university, a proxy ending with ".uni**.it" should be fine. On my machine, setting a 2-proxies chain doesn't work; for some reasons, the only way to make it work is to set up proxychains.conf with the "internal" proxy (the university proxy) and the browser (Firefox, of course) with the Codeen proxy. And the result is...&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_dWpCGfU56J8/RpO2b4LphvI/AAAAAAAABYY/iOozP-BI-bQ/s1600-h/google.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://2.bp.blogspot.com/_dWpCGfU56J8/RpO2b4LphvI/AAAAAAAABYY/iOozP-BI-bQ/s200/google.jpg" alt="" id="BLOGGER_PHOTO_ID_5085608994285389554" border="0" /&gt;&lt;/a&gt;Google! Good job. But there's another point to consider: if you're not surfing from a Planetlab IP, as you probably aren't, HTTPS traffic is disabled. This means: no Gmail, Yahoo Mail, nor other SSL logins or transactions. Unfortunately, some forums are managed via https protocol; to reach these forums (e.g. your university forum), you have to disable the use of Codeen proxy and to change Firefox settings again. The fastest way to do this is probably to keep two separate profiles in Firefox with different settings; supposing you named the "special" profile &lt;span style="font-style: italic;"&gt;freefox&lt;/span&gt;, a bash script to open a free Firefox will be like this:&lt;br /&gt;&lt;pre class="code"&gt;#!/bin/bash&lt;br /&gt;cd ~/proxy&lt;br /&gt;./proxychains /usr/bin/firefox -P freefox $* &amp;amp;&lt;/pre&gt;Other solutions to have HTTPS support:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Finding an external, free proxy which supports HTTPS traffic tunneling, and adding this proxy to the chain;&lt;/li&gt;&lt;li&gt;Setting up a machine with public or dynamic IP with SSH server in http tunneling (with -X extension enabled); but if you can do this, then you don't need to read this lousy "tutorial" ;)&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;In a nutshell:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Download &lt;a href="http://proxychains.sourceforge.net/"&gt;proxychains&lt;/a&gt; and a &lt;a href="http://people.mandriva.com/%7Eprigaux/hexedit.html"&gt;hexadecimal editor&lt;/a&gt; (from their website or from your favourite distro repository);&lt;/li&gt;&lt;li&gt;Replace the absolute library path inside the proxychains executable with a (valid) local one;&lt;/li&gt;&lt;li&gt;Find in &lt;a href="http://fall.cs.princeton.edu/codeen/"&gt;the list&lt;/a&gt; a Codeen proxy you can reach from behind your proxy;&lt;/li&gt;&lt;li&gt;Setup proxychains to use your usual proxy, and Firefox (or another program you need) to use the Codeen proxy;&lt;/li&gt;&lt;li&gt;You're out!&lt;/li&gt;&lt;/ol&gt; 60 seconds should be enough, once you know what to do and you have a little practive.&lt;br /&gt;&lt;br /&gt;From great powers come great responsabilities... Spread this trick and you won't find a free place in your laboratory anymore. And, of course, all this is only intended to help you reaching external websites for educational purposes only... like The &lt;a href="http://binaryunit.blogspot.com/"&gt;Unbearable Lightness of Bit&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Have a nice (didactic) free web browsing!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5998114554635012438-2639707404806395530?l=binaryunit.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://binaryunit.blogspot.com/feeds/2639707404806395530/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://binaryunit.blogspot.com/2007/07/out-in-60-seconds.html#comment-form" title="6 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5998114554635012438/posts/default/2639707404806395530?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5998114554635012438/posts/default/2639707404806395530?v=2" /><link rel="alternate" type="text/html" href="http://binaryunit.blogspot.com/2007/07/out-in-60-seconds.html" title="Out from the proxy in 60 seconds" /><author><name>Narcolessico</name><uri>http://www.blogger.com/profile/04935543128240934969</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://1.bp.blogspot.com/_dWpCGfU56J8/RpOw2oLphsI/AAAAAAAABYA/IhmBMy13WLU/s72-c/mirrors.jpg" height="72" width="72" /><thr:total>6</thr:total></entry><entry gd:etag="W/&quot;A0QBRH84fCp7ImA9WxRbGEg.&quot;"><id>tag:blogger.com,1999:blog-5998114554635012438.post-6186058553564670934</id><published>2007-07-04T18:52:00.000+01:00</published><updated>2008-12-09T21:49:15.134Z</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-12-09T21:49:15.134Z</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Humour" /><title>The safest boat in the world</title><content type="html">&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_dWpCGfU56J8/RovfOh6UoQI/AAAAAAAABVU/wYONj-4SOy4/s1600-h/ssl.jpg"&gt;&lt;img style="margin: 0pt 0pt 10px 10px; float: right; cursor: pointer;" src="http://4.bp.blogspot.com/_dWpCGfU56J8/RovfOh6UoQI/AAAAAAAABVU/wYONj-4SOy4/s320/ssl.jpg" alt="" id="BLOGGER_PHOTO_ID_5083402045131890946" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Which is the safest boat in the world?&lt;br /&gt;It's easy: &lt;span style="font-style: italic;"&gt;SSL&lt;/span&gt;...&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;(I took this picture during my stay in Turku, Finland)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5998114554635012438-6186058553564670934?l=binaryunit.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://binaryunit.blogspot.com/feeds/6186058553564670934/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://binaryunit.blogspot.com/2007/07/safest-boat-in-world.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5998114554635012438/posts/default/6186058553564670934?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5998114554635012438/posts/default/6186058553564670934?v=2" /><link rel="alternate" type="text/html" href="http://binaryunit.blogspot.com/2007/07/safest-boat-in-world.html" title="The safest boat in the world" /><author><name>Narcolessico</name><uri>http://www.blogger.com/profile/04935543128240934969</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://4.bp.blogspot.com/_dWpCGfU56J8/RovfOh6UoQI/AAAAAAAABVU/wYONj-4SOy4/s72-c/ssl.jpg" height="72" width="72" /><thr:total>0</thr:total></entry><entry gd:etag="W/&quot;CUIAQX89fyp7ImA9WB5XEUk.&quot;"><id>tag:blogger.com,1999:blog-5998114554635012438.post-5603882809229165848</id><published>2007-07-01T14:44:00.000+01:00</published><updated>2007-07-11T09:45:40.167+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2007-07-11T09:45:40.167+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Humour" /><title>Rumours</title><content type="html">&lt;span style="font-weight: bold;"&gt;&lt;/span&gt;Do you know who will &lt;a href="http://www.sun.com/"&gt;Sun Microsystems&lt;/a&gt; sponsor during next Formula 1 season?&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;J. Button&lt;/span&gt;...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5998114554635012438-5603882809229165848?l=binaryunit.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://binaryunit.blogspot.com/feeds/5603882809229165848/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://binaryunit.blogspot.com/2007/07/rumours.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5998114554635012438/posts/default/5603882809229165848?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5998114554635012438/posts/default/5603882809229165848?v=2" /><link rel="alternate" type="text/html" href="http://binaryunit.blogspot.com/2007/07/rumours.html" title="Rumours" /><author><name>Narcolessico</name><uri>http://www.blogger.com/profile/04935543128240934969</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total></entry><entry gd:etag="W/&quot;CEEGR3o7cCp7ImA9WxZTFko.&quot;"><id>tag:blogger.com,1999:blog-5998114554635012438.post-3421287956201716296</id><published>2007-06-21T22:54:00.000+01:00</published><updated>2008-01-18T16:10:26.408Z</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-01-18T16:10:26.408Z</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Bash" /><title>MD5FRACT: partial md5 checksum proposal</title><content type="html">&lt;span style="font-weight: bold;"&gt;Though BitTorrent&lt;/span&gt; is nowadays a preferred protocol to share and download big files like Linux distribution iso images, &lt;span style="font-style: italic;"&gt;http:// &lt;/span&gt;and &lt;span style="font-style: italic;"&gt;ftp://&lt;/span&gt; protocols are definitely still alive and well used. Although they already have their integrity check algorithms, different kind of  errors may occur at different levels of the protocol stack, resulting in corrupted data saved on your hard disk. Here come to help us MD5 and SHA1 algorithms: reasonably fast hash functions useful to check the integrity of the files we downloaded.&lt;br /&gt;&lt;br /&gt;What happens if we detect a file is corrupted? We have to download it again. The whole file, despite its size. While this is not a problem for most high-speed connection users, we shouldn't forget that many people can't access yet the internet in a very fast way (or with a "flat" rate). Any way, for everyone (service providers, high and low speed connection users) a such situation leads to a waste of time, money and bandwidth.&lt;br /&gt;&lt;br /&gt;What could we do to reduce the negative impact of these common situations?&lt;br /&gt;&lt;br /&gt;A cheap and fast solution could be to use &lt;span style="font-style: italic;"&gt;partial checksums&lt;/span&gt;, as most peer-to-peer protocols already do. If there's only one wrong byte in my file, why should I download the entire file again? Both &lt;span style="font-style: italic;"&gt;http://&lt;/span&gt; and &lt;span style="font-style: italic;"&gt;ftp://&lt;/span&gt; protocols support file download resuming with random access&lt;sup&gt;1&lt;/sup&gt;, so that we can download again just the corrupted part.&lt;br /&gt;&lt;br /&gt;To achieve this goal, my proposal is to use a replacement of the common md5sum *nix command allowing partial checksumming.&lt;br /&gt;I wrote a possible replacement (a bash script) which uses &lt;span style="font-style: italic;"&gt;dd&lt;/span&gt; and &lt;span style="font-style: italic;"&gt;md5sum&lt;/span&gt; to checksum just file chunks, instead of the entire given file. The aim of the script is to be completely compatible with md5sum: the replacement should be almost transparent for system administrators, and should recognize "standard" .md5 files and pass them directly to the standard md5sum utility. New .md5 files would have &lt;span style="font-style: italic;"&gt;.md5f&lt;/span&gt; extension, because informations on partial checksum can't be compatible with normal .md5 files.&lt;br /&gt;&lt;br /&gt;The script version is 0.5, and it's just a demonstration script - not the final version. It's capable of checksumming partial chunks of the given file, and checking the correctness of a file given a .md5f checksum list. It's &lt;span style="font-weight: bold;"&gt;open source&lt;/span&gt;, you can take it and modify it and redistribute it; just cite me and/or this blog, please. See below for download link.&lt;br /&gt;&lt;br /&gt;Its functioning is really simple: &lt;span style="font-style: italic;"&gt;dd&lt;/span&gt; reads a chunk of the given files and passes it on a pipe to &lt;span style="font-style: italic;"&gt;md5sum&lt;/span&gt;; the hash is written to stdout. Here's an example about how it works:&lt;br /&gt;&lt;br /&gt;&lt;pre class="code"&gt;&lt;b&gt;eu@aer:/d/progetti/md5fract$&lt;/b&gt; ./md5fract.sh Gatc.avi&lt;br /&gt;e54b1acf481f307ae22ac32bbc6ce5df 1:Gatc.avi&lt;br /&gt;a04871e4362c38c1243b2dd165bcfa07 2:Gatc.avi&lt;br /&gt;9f1721ff9bac5facb986cc0964e24a60 3:Gatc.avi&lt;br /&gt;a8230976234a97a4e11465eb1bb850d6 4:Gatc.avi&lt;br /&gt;e8f3ef6ffa56292dfae0dc50f06712b5 5:Gatc.avi&lt;br /&gt;368f6d1ae0106c49b71e2d9c0ab05e96 6:Gatc.avi&lt;br /&gt;66e3d9107c0cf40dbafa09bb6cac38a3 7:Gatc.avi&lt;br /&gt;7f8fd01e16b6900661f8d4aac2cee7f5 8:Gatc.avi&lt;br /&gt;1eb25dc5d3e239ba247c94f1614588fd 9:Gatc.avi&lt;br /&gt;5f96e9f4e7fdf92172a8f36d265a5070 10:Gatc.avi&lt;br /&gt;&lt;b&gt;eu@aer:/d/progetti/md5fract$&lt;/b&gt; ./md5fract.sh Gatc.avi &amp;&gt; Gatc.avi.md5f&lt;br /&gt;&lt;b&gt;eu@aer:/d/progetti/md5fract$&lt;/b&gt; ./md5fract.sh --check Gatc.avi.md5f&lt;br /&gt;Gatc.avi: OK (10)&lt;br /&gt;&lt;b&gt;eu@aer:/d/progetti/md5fract$&lt;/b&gt;&lt;/pre&gt;&lt;br /&gt;If we modify one of the hashes, we get this error message:&lt;br /&gt;&lt;br /&gt;&lt;pre class="code"&gt;&lt;b&gt;eu@aer:/d/progetti/md5fract$&lt;/b&gt; ./md5fract.sh --check Gatc.avi.md5f&lt;br /&gt;Gatc.avi: FAILED&lt;br /&gt;Wrong hash at line 8 for file Gatc.avi:&lt;br /&gt;Chunk:           8 (146800640 ... 167772160)&lt;br /&gt;Calculated hash: 7f8fd01e16b6900661f8d4aac2cee7f5&lt;br /&gt;Found hash:      9f8fd01e16b6900661f8d4aac2cee7f5&lt;br /&gt;&lt;b&gt;eu@aer:/d/progetti/md5fract$&lt;/b&gt;&lt;/pre&gt;&lt;br /&gt;I was first thinking that an executable file implementing its own md5sum routine would have had a better performance, because using &lt;span style="font-style: italic;"&gt;dd&lt;/span&gt; for each chunk implies opening a file handle, seeking inside the file and starting a new md5sum process for each chunk; however, a quick performance comparison shows that, thanks quick random file access of modern filesystems, this bash script with redundant file opening is almost as fast as the traditional md5sum program launched with the same file:&lt;br /&gt;&lt;br /&gt;&lt;pre class="code"&gt;&lt;b&gt;eu@aer:/d/progetti/md5fract$&lt;/b&gt; time ./md5fract.sh DevAdvocate.avi&lt;br /&gt;49980c46641915c55252772dc4933090 1:DevAdvocate.avi&lt;br /&gt;7bc34fa302d6fee588eb06421fd529c0 2:DevAdvocate.avi&lt;br /&gt;7c521d571165f4224693396f378e5001 3:DevAdvocate.avi&lt;br /&gt;34975d9be25a75d7e39cc882db9e0ca4 4:DevAdvocate.avi&lt;br /&gt;76e5e56e8972656ef17f1b2c429b3695 5:DevAdvocate.avi&lt;br /&gt;cc32be51ba083482bb4b3e9d2143eb00 6:DevAdvocate.avi&lt;br /&gt;d5ce8ae2027288dfe182276ce2143a69 7:DevAdvocate.avi&lt;br /&gt;5037475202e4ae2682434c612e11b6a8 8:DevAdvocate.avi&lt;br /&gt;0dc569188a14c74c9e6807a05d9af1f6 9:DevAdvocate.avi&lt;br /&gt;a9ecf0210a55e82349939c11d21272b4 10:DevAdvocate.avi&lt;br /&gt;&lt;br /&gt;real    1m5.386s&lt;br /&gt;user    0m5.256s&lt;br /&gt;sys     0m6.536s&lt;br /&gt;&lt;b&gt;eu@aer:/d/progetti/md5fract$&lt;/b&gt; time md5sum DevAdvocate.avi&lt;br /&gt;c61c60414ba0042169d0caf0880c2610  DevAdvocate.avi&lt;br /&gt;&lt;br /&gt;real    0m56.813s&lt;br /&gt;user    0m5.260s&lt;br /&gt;sys     0m1.912s&lt;br /&gt;&lt;b&gt;eu@aer:/d/progetti/md5fract$&lt;/b&gt;&lt;/pre&gt;&lt;br /&gt;The &lt;span style="font-style: italic;"&gt;user time&lt;/span&gt; is basically identical, but the &lt;span style="font-style: italic;"&gt;system time&lt;/span&gt; (necessary to open file handles and new subprocesses more than once, I suppose) is more than doubled. Anyway, on my machine the time required for md5fract execution is always around 110%-115% of the time required by md5sum to checksum the same file (file "DevAdvocate.avi" is about 1.4 Gb). In conclusion, checksumming partial file chunks through a bash script seems to have not a bad performance. This test was done on ext3 filesystem, but would be useful to do more tests on different filesystems (that may have different file seeking speed).&lt;br /&gt;&lt;br /&gt;The aim for version 1.0 would be to have the same script with:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Multiple files support (now it supports just one input file);&lt;/li&gt;&lt;li&gt;Total compatibilty with existent md5sum utility;&lt;/li&gt;&lt;li&gt;Non-bash shells compatibility;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Better error handling.&lt;/li&gt;&lt;/ul&gt;&lt;span style="font-weight: bold; color: rgb(102, 0, 0);"&gt;If you're tired of downloading the same files again and again, or if you simply like the concept, please spread this idea.&lt;/span&gt; I'll complete it sooner or later (sooner if I see some admins are interested in it), but of course anyone else could complete it ;). After completion, I'd like to propose it to several mirror services, and I hope someone will adopt it.&lt;br /&gt;&lt;br /&gt;In a nutshell:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;MD5 partial checksum utility (&lt;span style="font-style: italic;"&gt;md5fract&lt;/span&gt;) for bash, version 0.5&lt;/li&gt;&lt;li&gt;Requires &lt;span style="font-style: italic;"&gt;md5sum&lt;/span&gt; already installed&lt;/li&gt;&lt;li&gt;&lt;a href="http://galileo.dmi.unict.it/utenti/bidduni/ulb/md5fract/md5fract.sh"&gt;Download link&lt;/a&gt; (less than 6K)&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;span style="font-size:78%;"&gt;&lt;sup&gt;1&lt;/sup&gt;: Unfortunately, some FTP clients use just a signed 32 bit integer to seek remote files; as a consequence, they can't seek addresses higher than 2 Gb.&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5998114554635012438-3421287956201716296?l=binaryunit.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://binaryunit.blogspot.com/feeds/3421287956201716296/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://binaryunit.blogspot.com/2007/06/md5fract-partial-md5-checksum-proposal.html#comment-form" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5998114554635012438/posts/default/3421287956201716296?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5998114554635012438/posts/default/3421287956201716296?v=2" /><link rel="alternate" type="text/html" href="http://binaryunit.blogspot.com/2007/06/md5fract-partial-md5-checksum-proposal.html" title="MD5FRACT: partial md5 checksum proposal" /><author><name>Narcolessico</name><uri>http://www.blogger.com/profile/04935543128240934969</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>1</thr:total></entry><entry gd:etag="W/&quot;CEcASX8zeCp7ImA9WxdWFk8.&quot;"><id>tag:blogger.com,1999:blog-5998114554635012438.post-7619051531313915293</id><published>2007-06-20T17:33:00.000+01:00</published><updated>2008-07-09T17:47:28.180+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-07-09T17:47:28.180+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="HTML/CSS" /><title>A CSS style to post code in your blog</title><content type="html">&lt;span style="font-weight: bold;"&gt;So, you own a blog&lt;/span&gt; and you'd like to post some code. Is it HTML, CSS, PHP, Java, ...? You need to highlight and format it, somehow. For example, here is the code to enumerate an associative array in PHP:&lt;br /&gt;&lt;br /&gt;&lt;pre class="code"&gt;&lt;span style="font-weight: bold; color: rgb(0, 0, 0);"&gt;&amp;lt;?php&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 128);"&gt;echo&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(221, 0, 0);"&gt;" Array &lt;/span&gt;&lt;span style="color: rgb(85, 85, 255);"&gt;$arr&lt;/span&gt;&lt;span style="color: rgb(221, 0, 0);"&gt;:&amp;lt;br&amp;gt;&lt;/span&gt;&lt;span style="font-weight: bold; color: rgb(15, 15, 143);"&gt;\n&lt;/span&gt;&lt;span style="color: rgb(221, 0, 0);"&gt;"&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(161, 161, 0);"&gt;foreach&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; (&lt;/span&gt;&lt;span style="color: rgb(85, 85, 255);"&gt;$arr&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(161, 161, 0);"&gt;as&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(85, 85, 255);"&gt;$key&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; =&amp;gt; &lt;/span&gt;&lt;span style="color: rgb(85, 85, 255);"&gt;$value&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;) {&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;  &lt;/span&gt;&lt;span style="color: rgb(0, 0, 128);"&gt;echo&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(221, 0, 0);"&gt;" - Key: &lt;/span&gt;&lt;span style="color: rgb(85, 85, 255);"&gt;$key&lt;/span&gt;&lt;span style="color: rgb(221, 0, 0);"&gt; -&amp;amp;gt; &lt;/span&gt;&lt;span style="color: rgb(85, 85, 255);"&gt;$value&lt;/span&gt;&lt;span style="color: rgb(221, 0, 0);"&gt;&amp;lt;br&amp;gt;&lt;/span&gt;&lt;span style="font-weight: bold; color: rgb(15, 15, 143);"&gt;\n&lt;/span&gt;&lt;span style="color: rgb(221, 0, 0);"&gt;"&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; }&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(0, 0, 0);"&gt;?&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;First of all you need a parser to highlight the code. Most of good editors (e.g. &lt;a href="http://kate-editor.org/"&gt;Kate&lt;/a&gt;, &lt;a href="http://scintilla.sourceforge.net/SciTE.html"&gt;SciTE&lt;/a&gt;) have an "export as HTML" feature, and that's what you need. After exporting the code to HTML, you need to format the paragraph some how in a way you like (tipically with a monospaced font, and often with a special background color). Another good thing would be a horizontal scrollbar appearing only when needed, without the normal word-wrap which is a bit invasive for code quotes.&lt;br /&gt;If you like the CSS style of the above paragraph, I can avoid you the effort to look for it in the source of this page; here's the exact same CSS I use in this blog (I just added some :hover border change):&lt;br /&gt;&lt;br /&gt;&lt;pre class="code"&gt;&lt;span style="font-style: italic; color: rgb(128, 128, 128);"&gt; /* CSS for code quotes by http://binaryunit.blogspot.com&lt;br /&gt;by Eugenio Rustico */&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;.code&lt;/span&gt;&lt;span style="font-weight: bold; color: rgb(0, 0, 0);"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(0, 0, 0);"&gt; width:&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;60%&lt;/span&gt;&lt;span style="font-weight: bold; color: rgb(0, 0, 0);"&gt;;&lt;br /&gt;&lt;/span&gt; &lt;span style="font-weight: bold; color: rgb(0, 0, 0);"&gt;background:&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;#EEE&lt;/span&gt;&lt;span style="font-weight: bold; color: rgb(0, 0, 0);"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(0, 0, 0);"&gt; border-width:&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;1px&lt;/span&gt;&lt;span style="font-weight: bold; color: rgb(0, 0, 0);"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(0, 0, 0);"&gt; border-color:&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;#CCC&lt;/span&gt;&lt;span style="font-weight: bold; color: rgb(0, 0, 0);"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(0, 0, 0);"&gt; border-style:&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;solid&lt;/span&gt;&lt;span style="font-weight: bold; color: rgb(0, 0, 0);"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(0, 0, 0);"&gt; border-left-width:&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;4px&lt;/span&gt;&lt;span style="font-weight: bold; color: rgb(0, 0, 0);"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(0, 0, 0);"&gt; border-left-color:&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;#000066&lt;/span&gt;&lt;span style="font-weight: bold; color: rgb(0, 0, 0);"&gt;;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt; &lt;span style="font-weight: bold; color: rgb(0, 0, 0);"&gt;font-family:&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; Courier, &lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;monospace&lt;/span&gt;&lt;span style="font-weight: bold; color: rgb(0, 0, 0);"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(0, 0, 0);"&gt; line-height:&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;115%&lt;/span&gt;&lt;span style="font-weight: bold; color: rgb(0, 0, 0);"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(0, 0, 0);"&gt; clip&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="font-weight: bold; color: rgb(0, 0, 0);"&gt;:&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;auto&lt;/span&gt;&lt;span style="font-weight: bold; color: rgb(0, 0, 0);"&gt;;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-weight: bold; color: rgb(0, 0, 0);"&gt; overflow&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="font-weight: bold; color: rgb(0, 0, 0);"&gt;:&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;auto&lt;/span&gt;&lt;span style="font-weight: bold; color: rgb(0, 0, 0);"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(0, 0, 0);"&gt; padding:&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;1em&lt;/span&gt;;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-weight: bold; color: rgb(0, 0, 0);"&gt; padding-left:&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;1.5em&lt;/span&gt;&lt;span style="font-weight: bold; color: rgb(0, 0, 0);"&gt;;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-weight: bold; color: rgb(0, 0, 0);"&gt; margin:&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;1em&lt;/span&gt;&lt;span style="font-weight: bold; color: rgb(0, 0, 0);"&gt;;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;br /&gt;&lt;/span&gt; &lt;span style="font-weight: bold; color: rgb(0, 0, 0);"&gt;margin-left:&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;2em&lt;/span&gt;&lt;span style="font-weight: bold; color: rgb(0, 0, 0);"&gt;;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;/span&gt; &lt;span style="font-weight: bold; color: rgb(0, 0, 0);"&gt;&lt;br /&gt;&amp;nbsp;margin-right:&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;2em&lt;/span&gt;&lt;span style="font-weight: bold; color: rgb(0, 0, 0);"&gt;;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-style: italic; color: rgb(128, 128, 128);"&gt; /* white-space:nowrap; if you want DIV instead of PRE */&lt;/span&gt; &lt;span style="font-weight: bold; color: rgb(0, 0, 0);"&gt;&lt;br /&gt;}&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;This class should be used in a &amp;lt;PRE&amp;gt; or in a &amp;lt;DIV&amp;gt; element, depending on your needs. If you don't have to format something else inside the same block with HTML code, just use a &amp;lt;PRE&amp;gt; tag; but remember that every space or tab inside the text will be "as is" in the output (the HTML page). License: just cite this blog in the comments or somewhere else, and you can use and abuse of it =)&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Little note:&lt;/span&gt; due to Blogspot's buggy post editor, I had to add a non-breakable space ( ) at the beginning of the &lt;span style="font-style: italic;"&gt;margin-right&lt;/span&gt; row. Unfortunately, every space in the end of a line in the code editor, even if the line is broken for word-wrap, is considered useless and is trimmed out... Without this addiction, the &lt;span style="font-style: italic;"&gt;margin-right&lt;/span&gt; row is not aligned with the other rows.&lt;br /&gt;Moreover, every time you write the " " string in the HTML editor, and you edit the post again with the &lt;a href="http://en.wikipedia.org/wiki/WySiWyG"&gt;wysiwyg&lt;/a&gt; editor, it magically disappears and you have to edit the HTML code again... Buggy, buggy Blogspot!&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(102, 0, 0);"&gt;The icing on the cake:&lt;/span&gt; If your code is very long (e.g. over 50 lines) but you don't want a such high box in your blog, just add the CSS &lt;span style="font-style: italic;"&gt;max-height&lt;/span&gt; property, preferably to a value expressed in &lt;span style="font-style: italic;"&gt;em&lt;/span&gt; (e.g. to about &lt;span style="font-style: italic;"&gt;30em&lt;/span&gt;) and a vertical scroll bar will appear if needed.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5998114554635012438-7619051531313915293?l=binaryunit.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://binaryunit.blogspot.com/feeds/7619051531313915293/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://binaryunit.blogspot.com/2007/06/formatting-code-in-your-blog.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5998114554635012438/posts/default/7619051531313915293?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5998114554635012438/posts/default/7619051531313915293?v=2" /><link rel="alternate" type="text/html" href="http://binaryunit.blogspot.com/2007/06/formatting-code-in-your-blog.html" title="A CSS style to post code in your blog" /><author><name>Narcolessico</name><uri>http://www.blogger.com/profile/04935543128240934969</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total></entry><entry gd:etag="W/&quot;A0cDQnw8fSp7ImA9WB5RE0k.&quot;"><id>tag:blogger.com,1999:blog-5998114554635012438.post-4500328666909979287</id><published>2007-06-09T14:31:00.000+01:00</published><updated>2007-06-20T15:17:53.275+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2007-06-20T15:17:53.275+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Hacks" /><title>Forcing video preview frame in YouTube</title><content type="html">&lt;span style="font-weight: bold;"&gt;Many people noticed&lt;/span&gt; YouTube flash player is not so rich in options, and one of its the lacks is that it's not possible to choose the preview frame for an uploaded video; not a static image, neither a frame from the video itself. However, if you absolutely have the need to choose the preview frame, you should know YouTube takes as preview the frame at about the &lt;span style="font-style: italic;"&gt;temporal half&lt;/span&gt; of the video. This is &lt;span style="font-style: italic;"&gt;not&lt;/span&gt; an official information, but just the result of some observation: maybe for some videos the choosing "algorithm" is different.&lt;br /&gt;&lt;br /&gt;In my expreriences (the most beautyful video I uploaded, that's nevertheless a poor one, is &lt;a href="http://www.youtube.com/watch?v=LLtSJhJ_kfg"&gt;this&lt;/a&gt;), the frame at the exact half of total frames number is not the chosen preview; it seems that the algorithm is:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Take the temporal length of the video;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Divide by 2, and truncate to the shortest integer;&lt;/li&gt;&lt;li&gt;Choose &lt;span style="font-style: italic;"&gt;previous&lt;/span&gt; frame, or the current one if it's exactly the moment to change frame (if 1/framerate divides the length).&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;I made two videos to confirm this hypothesis, with labels in each frame indicating the current position:&lt;br /&gt;&lt;div style="text-align: center; margin-top: 30px;"&gt;&lt;object style="margin: 30px 30px auto auto;" height="140" width="170"&gt;&lt;param name="movie" value="http://www.youtube.com/v/DV4UDv-YkS8"&gt;&lt;embed src="http://www.youtube.com/v/DV4UDv-YkS8" type="application/x-shockwave-flash" height="140" width="170"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;object style="margin: 30px auto;" height="140" width="170"&gt;&lt;param name="movie" value="http://www.youtube.com/v/OLu0l3nzSpQ"&gt;&lt;embed src="http://www.youtube.com/v/OLu0l3nzSpQ" type="application/x-shockwave-flash" height="140" width="170"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;/div&gt;&lt;br /&gt;&lt;div style="clear: both;"&gt;As you can see, the choosen frame is not the exact half. 500 frames at 25 frames/second are 20 seconds, and 510 frames are 20.4 seconds. In both cases, frame number 251 (1-based) is choosen; 0.4 seconds more make no influence at all.&lt;br /&gt;If you want to do more tests by yourself, you can use &lt;a href="http://www.imagemagick.org/"&gt;ImageMagick&lt;/a&gt; go generate the frames and &lt;a href="http://www.mplayerhq.hu/"&gt;MEncoder&lt;/a&gt; to merge them into a video. &lt;a href="http://galileo.dmi.unict.it/utenti/bidduni/ulb/yt_previews/generate.sh"&gt;Here&lt;/a&gt; is the bash script I used to generate these videos.&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;Interlacing makes things more complicated, because there's no way to know in advance how YouTube converting engine will work; and, of course, we can not choose in advance useful video parameters (like deinterlacing method). So, try to upload an already deinterlaced video, if possible; Flash streams are progressive, and would be a good choice &lt;span style="font-style: italic;"&gt;not&lt;/span&gt; to let YouTube decide how to deinterlace.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Update:&lt;/span&gt; by downloading again my same video, I noticed that its length has changed, though the original submission was already progressive. The conclusion is: I can't find out the algorithm YouTube uses to choose the preview, it would need more experiments and I don't have the time to do them.&lt;br /&gt;&lt;br /&gt;But is this just a useless toy?&lt;br /&gt;In my opinion, it's not just a toy, but a powerful trick. Consider, for example, this video:&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;br /&gt;&lt;object style="margin: 40px;" height="252" width="306"&gt;&lt;param name="movie" value="http://www.youtube.com/v/05U9dV3856A"&gt;&lt;embed src="http://www.youtube.com/v/05U9dV3856A" type="application/x-shockwave-flash" height="252" width="306"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;/div&gt;&lt;br /&gt;The preview is absolutely arbitrary, and has *nothing* to do with the content of the video. During the first two hours after I uploaded it, 239 views  were hit. Without this "special preview", the same video was viewed 2 times in a week... Tricks for cheating people apart, this technique can be used to set a decent preview to your videos; the default YouTube's algorithms produces lots of annoying previews, that just don't match well the real content of the videos. That was why I had the initial idea: in one of my videos, the chosen preview was a frame almost completely black, while the rest of the video was white.&lt;br /&gt;&lt;br /&gt;As you probably noticed, poor seeking is another annoying fact in YouTube videos; this time, the injection of keyframes is related also to scene changes, so if you move the "preview frame" one or two or three position before, it's not the preview anymore but it's still a keyframe (I did this experiment). &lt;span style="font-style: italic;"&gt;To do:&lt;/span&gt; upload a .flv video already encoded with many keyframes, to test if YouTube is going to delete some of them or not.&lt;br /&gt;&lt;br /&gt;Now, if YouTube chose for your video an awful preview, you know how to force it to use a better one. Power to masses! But remember: from a great power, come great responsabilities... Try to imagine what spammers could do with this trick... Oouch!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5998114554635012438-4500328666909979287?l=binaryunit.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://binaryunit.blogspot.com/feeds/4500328666909979287/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://binaryunit.blogspot.com/2007/06/setting-video-preview-frame-in-youtube.html#comment-form" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5998114554635012438/posts/default/4500328666909979287?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5998114554635012438/posts/default/4500328666909979287?v=2" /><link rel="alternate" type="text/html" href="http://binaryunit.blogspot.com/2007/06/setting-video-preview-frame-in-youtube.html" title="Forcing video preview frame in YouTube" /><author><name>Narcolessico</name><uri>http://www.blogger.com/profile/04935543128240934969</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>1</thr:total></entry><entry gd:etag="W/&quot;A0QBRHc7eip7ImA9WxRbGEg.&quot;"><id>tag:blogger.com,1999:blog-5998114554635012438.post-7341447151472842129</id><published>2007-05-02T22:25:00.000+01:00</published><updated>2008-12-09T21:49:15.902Z</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-12-09T21:49:15.902Z</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Software" /><title>Watching local flash .flv videos with your browser</title><content type="html">&lt;span style="font-weight: bold;"&gt;You got it.&lt;/span&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_dWpCGfU56J8/RjkP9q8Q_GI/AAAAAAAAAyc/MZzmxTSjnoU/s1600-h/a1.png"&gt;&lt;img style="margin: 0pt 0pt 10px 10px; float: right; cursor: pointer;" src="http://2.bp.blogspot.com/_dWpCGfU56J8/RjkP9q8Q_GI/AAAAAAAAAyc/MZzmxTSjnoU/s200/a1.png" alt="" id="BLOGGER_PHOTO_ID_5060093208500960354" border="0" /&gt;&lt;/a&gt;&lt;span style="font-size:130%;"&gt; &lt;/span&gt;You couldn't sleep thinking that your removed due to terms favourite video may have been violations or to some other very good reason. So, you just downloaded a video from &lt;a href="http://www.youtube.com/"&gt;YouTube &lt;/a&gt;(don't ask me how and ask &lt;a href="http://www.google.com/"&gt;the master&lt;/a&gt;!), and now you have a nice, little, harmless .flv file on your hd. But how to open it? You are thinking about downloading &lt;a href="http://www.videolan.org/vlc/"&gt;VLC&lt;/a&gt; player, or an unknown generic codec; or maybe you're so bright you already thought it's possible to transcode it with your favourite &lt;span style="font-style: italic;"&gt;factotum&lt;/span&gt;: &lt;a href="http://www.mplayerhq.hu/design7/info.html"&gt;mplayer&lt;/a&gt;. Maybe you could even download a specific application that can only read .flv files! But there's a question silently crawling in your head... Why the hell my friends &lt;a href="http://www.mozilla.com/en-US/firefox/"&gt;Firefox&lt;/a&gt; and &lt;a href="http://www.apple.com/macosx/features/safari/"&gt;Safari&lt;/a&gt; could open and play and even seek the .flv stream, while they don't know how to deal with the &lt;span style="font-weight: bold;"&gt;same&lt;/span&gt; stream coming from my local hd?&lt;br /&gt;And you already know the answer, in the deep. &lt;span style="font-style: italic;"&gt;They can.&lt;/span&gt; You just simply need to present the .flv under a different aspect; you need to wrap it in a Flash object (swf) you can compile by yourself, or you could ask an existent Flash reader to open the .flv file for you.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;[update]&lt;/span&gt;&lt;br /&gt;After a very long and difficult work period (two days)&lt;sup&gt;1&lt;/sup&gt;, finally I made a &lt;span style="font-style: italic;"&gt;html-knowdlege-independent&lt;/span&gt; and &lt;span style="font-style: italic;"&gt;effortless-to-use-even-for-dumb-users&lt;/span&gt; page; it's a little .flv player &lt;span style="font-weight: bold;"&gt;written only in html&lt;/span&gt; (with a flash object). You can download it from &lt;a href="http://www.watchtube.135.it/"&gt;WatchTube&lt;/a&gt; (another cool thing is coming soon on that website). This lilttle reader supports also .swf videos and other media files. Finally, we have our free, cross platform, light, fast .flv reader. We do not depend anymore on any specific codec or dedicated reader. Use &lt;span style="font-style: italic;"&gt;your own&lt;/span&gt; browser and enjoy!&lt;br /&gt;&lt;br /&gt;In a nutshell:&lt;ul&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;Lory Player 1.1&lt;/span&gt; Flash player&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_dWpCGfU56J8/RoQzOx6UoLI/AAAAAAAABUo/-85v2Yb0ops/s1600-h/Pre7.jpg"&gt;&lt;img style="margin: 0pt 0pt 10px 10px; float: right; cursor: pointer;" src="http://2.bp.blogspot.com/_dWpCGfU56J8/RoQzOx6UoLI/AAAAAAAABUo/-85v2Yb0ops/s200/Pre7.jpg" alt="" id="BLOGGER_PHOTO_ID_5081242608589906098" border="0" /&gt;&lt;/a&gt;&lt;/li&gt;&lt;li&gt;Reads Flash videos (*.&lt;span style="font-weight: bold;"&gt;swf&lt;/span&gt;, *.&lt;span style="font-weight: bold;"&gt;flv&lt;/span&gt;) and other formats (*.mp3, *.jpg, *.png, *.gif, RTMP streams)&lt;br /&gt;&lt;/li&gt;&lt;li&gt;No installation required&lt;/li&gt;&lt;li&gt;For Linux, MacOsX, Windows (virtually any version)&lt;/li&gt;&lt;li&gt;Tested on Firefox, IE6, IE7, Safari, Camino (requires &lt;a href="http://www.macromedia.com/go/getflashplayer"&gt;Flash plugin&lt;/a&gt;)&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Creative Commons &lt;a href="http://creativecommons.org/licenses/by-nc-sa/2.5/"&gt;license&lt;/a&gt; (it's &lt;span style="font-style: italic;"&gt;free&lt;/span&gt;)&lt;br /&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://galileo.dmi.unict.it/utenti/bidduni/flv/loryplayer1.1.zip"&gt;Direct download link&lt;/a&gt; (~120 Kb)&lt;/li&gt;&lt;/ul&gt;An online version (not working with local files, it's just a layout preview) is available &lt;a href="http://galileo.dmi.unict.it/utenti/bidduni/flv/lory1.1online/loryplayer.html"&gt;here&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:78%;"&gt;&lt;sup&gt;1&lt;/sup&gt; &lt;span style="font-weight: bold;"&gt;Note added&lt;/span&gt;: when you say you had a "&lt;span style="font-style: italic;"&gt;very long and difficult work period&lt;/span&gt;", and then you specify that the long period was just two days long, you can't be serious. Evidently it's a contradiction, or simply a (stupid) joke...&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5998114554635012438-7341447151472842129?l=binaryunit.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://binaryunit.blogspot.com/feeds/7341447151472842129/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://binaryunit.blogspot.com/2007/05/watching-local-flv-videos-with-your.html#comment-form" title="6 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5998114554635012438/posts/default/7341447151472842129?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5998114554635012438/posts/default/7341447151472842129?v=2" /><link rel="alternate" type="text/html" href="http://binaryunit.blogspot.com/2007/05/watching-local-flv-videos-with-your.html" title="Watching local flash .flv videos with your browser" /><author><name>Narcolessico</name><uri>http://www.blogger.com/profile/04935543128240934969</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://2.bp.blogspot.com/_dWpCGfU56J8/RjkP9q8Q_GI/AAAAAAAAAyc/MZzmxTSjnoU/s72-c/a1.png" height="72" width="72" /><thr:total>6</thr:total></entry></feed>

