tag:blogger.com,1999:blog-15767217850545050202024-02-20T11:51:52.002+11:00dentcatprogramming and other irrelevant stuffsMasoodhttp://www.blogger.com/profile/02916891582456634367noreply@blogger.comBlogger34125tag:blogger.com,1999:blog-1576721785054505020.post-45250466530018427002011-11-18T17:58:00.001+11:002011-11-18T18:25:54.085+11:00Who Else is Behind SOPA? (Other Than Hollywood, We All Know That)<div dir="ltr" style="text-align: left;" trbidi="on">
First what is <a href="http://en.wikipedia.org/wiki/Stop_Online_Piracy_Act">SOPA</a> anyways? Hit the link to learn more about it if you don't already know. Perhaps a more important question, what does it have to do with someone living outside US? After all, they should bear the consequences of letting a bunch of Hollywood studios control their congress. But that's not the entire issue here; we are talking about a country that more or less is still in control of significant part of Internet infrastructure and their (stupid) actions can affect everyone else.
<br />
<br />
In Australia, we had this blacklisting and Internet censorship issue too. Fortunately, due to significant opposition (yeah, surprisingly even from US government!) it has gone away for a while and now late to the bandwagon is US congress. Going back to the topic, we all know Hollywood is stuck to the business model of ripping off people and they try everything to force people to fill up their pockets but what interests me most is the support of Business Software Alliance. Here is the list of its members:<br />
<br />
<div>
<ul style="float: left; width: 38%;">
<li>Adobe</li>
<li>Apple</li>
<li>Autodesk</li>
<li>AVEVA</li>
<li>AVG</li>
<li>Bentley Systems</li>
<li>CA</li>
<li>Cadence Design Systems</li>
<li>CNC Software - Mastercam</li>
<li>Compuware</li>
<li>Corel</li>
<li>Dassault Systèmes SolidWorks Corporation</li>
<li>Dell</li>
<li>Intel</li>
</ul>
<ul style="float: left; width: 38%;">
<li>Intuit</li>
<li>Kaspersky</li>
<li>McAfee</li>
<li>Microsoft</li>
<li>Minitab</li>
<li>Progress Software</li>
<li>PTC</li>
<li>Quark</li>
<li>Quest</li>
<li>Rosetta Stone</li>
<li>Siemens PLM Software, Inc.</li>
<li>Sybase</li>
<li>Symantec</li>
<li>TechSmith</li>
<li>The MathWorks</li>
</ul>
<div style="clear: both;">
</div>
</div>
It is very sad to see many big software company behind SOPA. If you live is US, get involve and do something about it. For the rest of us, consider not to purchase software or hardware from these companies to let them now it takes more than quality products (I'm referring to Intel here, I'm no Apple fan) to gain customers. <br />
<br />
Links:<br />
<a href="http://en.wikipedia.org/wiki/Stop_Online_Piracy_Act">SOPA Wikipedia Page</a>
</div>Masoodhttp://www.blogger.com/profile/02916891582456634367noreply@blogger.com3tag:blogger.com,1999:blog-1576721785054505020.post-81455723679681124582011-11-15T17:45:00.001+11:002011-11-15T21:34:57.032+11:00Truncating HTML in Java<div dir="ltr" style="text-align: left;" trbidi="on">
I'm currently working on a web application written in Java. Part of this application generate summary of long HTML texts by truncating them to a fixed size. In Python, I usually use <code>truncate_html_words</code> of <a href="https://www.djangoproject.com/">Django</a> template engine so I looked for a similar easy method in Java.<br />
<br />
I did a couple searches on Google but couldn't find something quick and easy. So, I went back and looked at the Django's <a href="https://code.djangoproject.com/browser/django/trunk/django/utils/text.py?rev=12431">code</a> and fortunately it was very straight forward. Find the adapted code below:<br />
<pre class="brush: java">
/**
* Copyright (c) Django Software Foundation and individual contributors.
* All rights reserved.
*
* Copyright (c) 2011 Masood Behabadi <masood@dentcat.com>
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* 3. Neither the name of Django nor the names of its contributors may be used
* to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
public static String truncateHtmlWords(String html, int length){
if (length <= 0)
return new String();
List<string> html4Singlets = Arrays.asList(
"br", "col", "link", "base", "img",
"param", "area", "hr", "input");
// Set up regular expressions
Pattern pWords = Pattern.compile("&.*?;|<.*?>|(\\w[\\w-]*)");
Pattern pTag = Pattern.compile("<(/)?([^ ]+?)(?: (/)| .*?)?>");
Matcher mWords = pWords.matcher(html);
// Count non-HTML words and keep note of open tags
int endTextPos = 0;
int words = 0;
List<string> openTags = new ArrayList<string>();
while (words <= length) {
if (!mWords.find())
break;
if (mWords.group(1) != null) {
// It's an actual non-HTML word
words += 1;
if (words == length)
endTextPos = mWords.end();
continue;
}
// Check for tag
Matcher tag = pTag.matcher(mWords.group());
if (!tag.find() || endTextPos != 0)
// Don't worry about non tags or tags after our
// truncate point
continue;
String closingTag = tag.group(1);
// Element names are always case-insensitive
String tagName = tag.group(2).toLowerCase();
String selfClosing = tag.group(3);
if (closingTag != null) {
int i = openTags.indexOf(tagName);
if (i != -1)
openTags = openTags.subList(i + 1, openTags.size());
}
else if (selfClosing == null && !html4Singlets.contains(tagName))
openTags.add(0, tagName);
}
if (words <= length)
return html;
StringBuilder out = new StringBuilder(html.substring(0, endTextPos));
for (String tag: openTags)
out.append("");
return out.toString();
}
</pre><br />
Feel free to use the code under Modified-BSD License but keep in mind unlike Django, it's not been thoroughly tested and may not function correctly in all cases.<br />
<br />
Links:<br />
<a href="https://www.djangoproject.com/">Django Project Website</a><br />
<a href="https://code.djangoproject.com/browser/django/trunk/django/utils/text.py?rev=12431">Original Source Code</a>
<br /></div>Masoodhttp://www.blogger.com/profile/02916891582456634367noreply@blogger.com6tag:blogger.com,1999:blog-1576721785054505020.post-77637038480901451942011-11-03T02:56:00.000+11:002011-11-03T02:59:36.974+11:00Long Domain Names and RDP Clients<div dir="ltr" style="text-align: left;" trbidi="on">
<div dir="ltr" style="text-align: left;" trbidi="on">
A few days ago, I encounter a strange authentication problem when I tried to connect to a Windows Server 2008 via RDP using several Android remote desktop applications. The server was running AD and had an unusually long domain name. While Vista's native remote desktop client had no problem connecting to the server, both <a href="http://market.android.com/details?id=com.p5sys.android.jump">Jump Desktop</a> and <a href="http://market.android.com/details?id=com.wyse.pocketcloudfree">Pocket Cloud</a> on my Android phone were complaining about "wrong username/password". On Fedora, <a href="http://remmina.sourceforge.net/">remmina</a> wasn't doing any better (latest 0.9.3) so I decided to find out why.<br />
<br />
After a bit of inspection, I realised that all these clients truncate domain field in authentication setting to some arbitrary length. Although I can't be sure what backend the Android applications used, the issue on Linux is certainly related to <code>freerdp</code> as <code>rdesktop</code> connects to the Windows machine without any problem. <br />
<br />
The fix on the Fedora was straight forward, just downgrading <code>remmina</code> to the repository's 0.7.5 (older versions of <code>remmina</code> use <code>rdesktop</code> as the backend). And for the Android apps?<br />
<br />
If you combine domain with username in the following way, you can get RDP working on Jump Desktop and PocketCloud Android applications (hackish but until the developers fix the bug):<br />
<pre><domain>\<username></pre>
You should leave the domain field blank for it to work.<br />
<br />
Links:<br />
<a href="http://market.android.com/details?id=com.p5sys.android.jump">Jump Desktop</a></div>
<a href="http://market.android.com/details?id=com.wyse.pocketcloudfree">Pocket Cloud</a><br />
<a href="http://remmina.sourceforge.net/">Remmina </a></div>Masoodhttp://www.blogger.com/profile/02916891582456634367noreply@blogger.com0tag:blogger.com,1999:blog-1576721785054505020.post-25416245812027173862010-02-22T19:05:00.001+11:002011-11-15T05:44:03.515+11:00A Full-Duplex Software UART<div dir="ltr" style="text-align: left;" trbidi="on">
I recently was working on a small embedded project in which I had used an <a href="http://www.atmel.com/dyn/products/Product_card.asp?part_id=4350">ATtiny48</a> microcontroller. While ATtiny48 had a whole lot of features, it didn't have a hardware UART interface and I didn't want to go for a higher priced ones only for a serial connection; So after a bit of googling, I found <a href="http://www.atmel.com/dyn/resources/prod_documents/doc0941.pdf">Half Duplex Interrupt Driven Software UART</a> and <a href="http://www.atmel.com/dyn/resources/prod_documents/doc0952.pdf">Half Duplex Compact Software UART</a> from Atmel website.<br />
<br />
The interrupt driven version was written in C and I guess could be used after a little modification to compile it with GCC on GNU/Linux. Meanwhile, the code wasn't complex, So I decided to write one that provide a full duplex interface and compiles happily on my setup. <br />
<br />
Well, I have tested it for my own very specific application and it has worked. Please don't assume it will for you. Also, since it uses a 8 bit timer, it will fail if you have a large atomic (a block of code in which global interrupt flag is unset). Also note that I have only tuned it for a 38400 bitrate on internal 8MHz RC oscillator but it should be fairly easy to change it for other speeds.<br />
<br />
You can download the code from googlecode repository: <br />
<pre class="brush: bash">svn checkout http://masood.googlecode.com/svn/trunk/vuart/ </pre>
<br />
Links:<br />
<a href="http://www.atmel.com/dyn/resources/prod_documents/doc0941.pdf">AVR304: Half Duplex Interrupt Driven Software UART on tinyAVR and megaAVR devices</a><br />
<a href="http://www.atmel.com/dyn/resources/prod_documents/doc0952.pdf">AVR305: Half Duplex Compact Software UART on tinyAVR and megaAVR devices</a><br />
<a href="http://www.atmel.com/dyn/resources/prod_documents/avr304.zip">Code for AVR304</a><br />
<a href="http://www.atmel.com/dyn/resources/prod_documents/avr305.zip">Code for AVR305</a>
</div>Masoodhttp://www.blogger.com/profile/02916891582456634367noreply@blogger.com2tag:blogger.com,1999:blog-1576721785054505020.post-23190030078602915022009-09-08T20:44:00.001+10:002011-10-27T20:55:41.393+11:00A Genius Icon<div dir="ltr" style="text-align: left;" trbidi="on">
Well, I'm not fan of <a href="http://en.wikipedia.org/wiki/Proprietary_software">proprietary</a> stuffs and try to avoid writing about them. Yet, I came across a brilliant work when I was looking at this <a href="http://www.cultofmac.com/icon-porn-feast-your-eyes-on-snow-leopards-beautiful-icons/15764">article</a> about Snow Leopard new extra large icons. Of course it's the never getting old campaign of Apple bashing Windows for its stupid bugs in a genius icon, indicating a Windows host on a network. :) <br />
<br />
<a href="http://www.cultofmac.com/icon-porn-feast-your-eyes-on-snow-leopards-beautiful-icons/15764/7"><img alt="" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgGmnxAYMXGguwgoW2Xxf3FBAs0uMGbL8IKyCIOu0BF6c_E6kCISJCpCOMwTjOI5BbsIo66-KjFioUyGHH5bqYojnI3aaPkZTp0gGUcvpek6ADaowkuFHBP3FPgElW4sglsQXnhfcYoGuCr/s400/Windows_PC.jpg" style="display: block; margin: 0px auto 10px; text-align: center;" /></a><br />
<br />
I guess similar icons could be shipped on stock <a href="http://en.wikipedia.org/wiki/GNU/Linux_distribution">GNU/Linux</a> distributions to add a little more fun.
</div>Masoodhttp://www.blogger.com/profile/02916891582456634367noreply@blogger.com1tag:blogger.com,1999:blog-1576721785054505020.post-91166690902874943042009-09-02T21:22:00.001+10:002011-10-27T21:31:29.503+11:00Highlighting YAML in gedit<div dir="ltr" style="text-align: left;" trbidi="on">
I've just written a language spec for <a href="http://en.wikipedia.org/wiki/Yaml">YAML</a> so that <a href="http://en.wikipedia.org/wiki/Gedit">gedit</a> can highlight it. gedit uses <strong>gtksourceview</strong> so the highlighting will be available on any application uses the same widget. <br />
<br />
Get the latest version from Subversion repository: <br />
<pre class="brush: bash;">
svn checkout http://masood.googlecode.com/svn/trunk/yaml-language-spec</pre>
<span style="text-align: center; display: block;"><img src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEijO1pMPgyj9v8eAxJOu4bydV0WstrN313knKU4jJEdSDS07lFUsFRvZl35Tgft5Nuv_aqDjPn_eR3Xzbral3-1_JKqF-MxgOPYg9JbaEdMUc2sO58NJzMeAWGRrMOVr4Mb1JRFq1OiX4E7/s800/yaml-gedit.png" /></span>
or download a tarball from <a href="http://masood.googlecode.com/files/yaml-language-spec-svn20090902.tar.gz">here</a>. Check out the links below if you are also interested in writing a highlighting specification for another language.
Links:
<a href="http://library.gnome.org/devel/gtksourceview-2.0/stable/lang-tutorial.html">Language Definition v2.0 Tutorial </a>
<a href="http://library.gnome.org/devel/gtksourceview-2.0/stable/lang-reference.html">Language Definition v2.0 Reference</a>
</div>Masoodhttp://www.blogger.com/profile/02916891582456634367noreply@blogger.com22tag:blogger.com,1999:blog-1576721785054505020.post-13469508256312459832009-08-24T14:40:00.001+10:002011-10-27T21:34:53.894+11:00A Perfect Pizza Dough<div dir="ltr" style="text-align: left;" trbidi="on">
Baking pizza wasn't really that quick and the end product was usually a horrible flat base with some tasteless stuffs on it. At least that was the case until I found this recipe on <a href="http://www.taste.com.au/">taste.com.au</a> originally from <em>Good Taste</em> 1999. <br />
<br />
I actually didn't followed the instructions for the sauce and topping but the dough recipe was really good. I modified it a little; if you happen to find any major difference with the original recipe, then it means that I haven't read it properly! <br />
<br />
I dissolved <strong>2 tsp of dry yeast</strong> and <strong>1 tsp of salt</strong> in <strong>1 1/4 cups of warm water</strong>. Then I added <strong>2 tbs of olive oil </strong> and <strong>3 cups of plain flour </strong>. After mix it well and knead for a few minutes, leave it cover for 20 minutes in a warm place. Remember, brush the dough very lightly with oil to prevent it sticking to everything. <br />
<br />
I made 2 pizza with this dough and baked it in a fan-forced oven for 20 minutes at 200 °C. Please read the original recipe as it contains a lot more information.<br />
<br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiewxLZFVfNwNs0f1tf-CvlEzUYJ3D15U9JpX1ZsLCfh2hvkOuGy0rnZh8JQOriTvW_GsClcQy68R69GdDp3QGNf1BXt4Mo9N5DhAt6A8rsvdN3sZD65CgPaRGGWJ7jT2xgBzp-1VFX_b7u/s800/pizza.jpg"><img alt="" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiewxLZFVfNwNs0f1tf-CvlEzUYJ3D15U9JpX1ZsLCfh2hvkOuGy0rnZh8JQOriTvW_GsClcQy68R69GdDp3QGNf1BXt4Mo9N5DhAt6A8rsvdN3sZD65CgPaRGGWJ7jT2xgBzp-1VFX_b7u/s800/pizza.jpg" style="border: 0pt none; display: block; margin: 0px auto 10px; text-align: center;" /></a><br />
<br />
Links: <br />
<a href="http://www.taste.com.au/recipes/11084/basic+pizza">Basic Pizza Recipe</a>
</div>Masoodhttp://www.blogger.com/profile/02916891582456634367noreply@blogger.com2tag:blogger.com,1999:blog-1576721785054505020.post-47175340336103526772009-07-15T21:30:00.001+10:002011-10-27T20:53:10.952+11:00A Cute Drawing<div dir="ltr" style="text-align: left;" trbidi="on">
My little sister likes drawing a lot. She often draws sketches of girls with long hairs, dogs and flowers with eyes and mouth. Today, however, she shared with me her vision of universe, a world full of weird looking monsters and candy-shaped planets. So I borrowed it to make my diary cuter! <br />
<a href="http://picasaweb.google.com/lh/photo/MtsJmM2j7Kt54Nx6mFCs_A?authkey=Gv1sRgCKut4qSJsZT1-AE%20&%20amp;feat=directlink"><img alt="" id="BLOGGER_PHOTO_ID_5358671031559890978" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg3T4mHomQBMGoNREAjXUkavcYa0VVcgBII6ywIYe3ApwkszTEIVGW3CSQq0hJ80mEtJJZNQnH9ERsd9EnAk3-G2rADPfYyEXIXczpLyTb9toYP1pimSVqLTMIyVPoqISo-tUeVF_ncwT9x/s800/shivadrawing.jpg" style="cursor: pointer; display: block; margin: 20px auto 40px; text-align: center;" /></a>The work is copyrighted by Shiva Behabadi but if you like to use it, feel free to do so under the terms of <a href="http://creativecommons.org/licenses/by-sa/3.0/">Creative Common Attribution-Share Alike 3.0 License</a></div>Masoodhttp://www.blogger.com/profile/02916891582456634367noreply@blogger.com2tag:blogger.com,1999:blog-1576721785054505020.post-17626668995827471852009-07-01T22:06:00.001+10:002011-10-27T21:31:57.488+11:00Firefox 3.5 on Lenny<div dir="ltr" style="text-align: left;" trbidi="on">
Firefox 3.5 is out finally again with no amd64 built ready for download. I didn't want to wait to see if someone is going to package it for Debian Lenny So I decided to compile it from source. Surprisingly, the compilation was smooth and the improved version of my favorite web browser was ready in no time. <br />
<br />
I needed these packages to install before compiling Firefox for my Lenny setup: <br />
<pre class="brush: plain">
aptitude install make gcc cvs libgtk2.0-dev libxt-dev libidl-dev \
libzip-dev libfreetype6-dev libfontconfig-dev pkg-config \
libdbus-1-dev libasound2-dev libnotify-dev autoconf2.13</pre>
<br />
After downloading and extracting the <a href="ftp://ftp.mozilla.org/pub/mozilla.org/firefox/releases/3.5/source/firefox-3.5-source.tar.bz2">source</a> from Mozilla website, I created <code>.mozconfig</code> file in the root of source directory containing these options: <br />
<pre class="brush: plain">
mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/obj-@CONFIG_GUESS@
ac_add_options --enable-application=browser
mk_add_options MOZ_CO_PROJECT=browser
ac_add_options --enable-optimize=-O2
ac_add_options --disable-tests</pre>
Then the following commands from the root of source tree will do the magic: <br />
<pre class="brush: plain">export MOZCONFIG=.mozconfig
./configure
make
make -C browser/installer/</pre>
<br />
Upon the completion, Firefox 3.5 tarball and accompanying language-pack will be placed in <code>dist</code> directory. The tar file can be extracted anywhere and used without installation. <br />
<br />
You can find a comprehensive <a href="https://developer.mozilla.org/en/Build_Documentation">build documentation</a> at Mozilla Developer Center. <br />
<br />
Links:<br />
<a href="https://developer.mozilla.org/en/Build_Documentation">Build Documentation</a><br />
<a href="ftp://ftp.mozilla.org/pub/mozilla.org/firefox/releases/3.5/source/firefox-3.5-source.tar.bz2">Firefox 3.5 Source </a></div>Masoodhttp://www.blogger.com/profile/02916891582456634367noreply@blogger.com1tag:blogger.com,1999:blog-1576721785054505020.post-79440419267867666292009-06-26T10:36:00.001+10:002011-10-27T20:58:39.267+11:00The Right To Be Uncensored<div dir="ltr" style="text-align: left;" trbidi="on">
OK. Maybe it's time to be get a little more serious about this Internet censorship in Australia. I guess a few more protests wouldn't be a bad idea.<br />
<br />
Senator Conroy! It's time to wake up. It appears you don't really get it. It is obvious that ISP-level filtering, specially a retarded blacklist method, can never stop people accessing illegal contents. Deny it or not, countries like China and Iran have invested way more than what you have or going to spend on that; still people find a way around it. Either Mr Conroy is getting technical advice from a bunch of retards or he assumes the rest of us to be stupid. <br />
<br />
On technical side, keeping a blacklist of a few thousands URLs in a network with more than billions webpages is a joke. On the other hand, packet inspection doesn't seem to be practical with current technology; not only it severely impact the network speed, it'll a hard job to identify what content is actually illegal. Even humans have arguments over it, how would we expect a set of rules and algorithm serve us better?<br />
<br />
But, the opposition to the plan is not only a technical but has a far more fundamental ethical aspect. I don't think it'll be long before pro-censorship people begin asking government to filter harmful conversations in instant messaging networks and mobile phones, assuming the plan won't suddenly extend its coverage to political information. I'm sure some can find certain political debates harmful to kids under 15!<br />
<br />
Unless we want to end up in a situation like what see in Iran, we shouldn't accept any mandatory censorship of information in a free society. Misuse of such system doesn't happen right from the first day but when influential individuals or group from within and outside country find it necessary. I'm not sure if Senator Conroy or those rallying behind him are willing to take any responsibility for what this nation may suffer as a result of their short-sighted plan.</div>Masoodhttp://www.blogger.com/profile/02916891582456634367noreply@blogger.com0tag:blogger.com,1999:blog-1576721785054505020.post-15985156233151776012009-06-24T23:54:00.001+10:002011-10-27T21:31:42.974+11:00A Yum on Steroid<div dir="ltr" style="text-align: left;" trbidi="on">
If you are a Debian user, you would know what a joy is to use <code>apt-get</code> or <code>aptitude</code> specially when those are teamed up with <code>bash-completion</code> scripts.<br />
<br />
In contrast, Yum on Fedora has a poor performance and is sometimes annoying. On Fedora 11, bash completion for Yum is virtually impractical to use as it's unbearably slow. It sometimes take up to two minutes for the prompt to return to life.<br />
<br />
I don't know much about Yum and my lack of knowledge could be at least partly responsible for the poor performance of this particular setup.<br />
<br />
Fortunately, Yum has quite a few plugins which I found some significantly improving its speed. In particular, I have installed <code>rpm-warm-cache</code>, <code>updatesd</code> and <code>refresh-updatesd</code>. It'll surprises you just to see how much faster Yum gets with these plugins and one wonders why these aren't installed by default.<br />
<br />
A shot of plugins to keep it going for now:<br />
<pre class="brush: plain">yum install yum-updatesd yum-plugin-rpm-warm-cache yum-plugin-refresh-updatesd</pre>
</div>Masoodhttp://www.blogger.com/profile/02916891582456634367noreply@blogger.com0tag:blogger.com,1999:blog-1576721785054505020.post-9671393049588776652009-06-20T22:54:00.001+10:002011-10-27T21:00:22.197+11:00You are not alone!<div dir="ltr" style="text-align: left;" trbidi="on">
Don't give up! Yesterday, indeed was one of the darkest days of our revolution; the day Khamenei stood on the footstep of the very dictator he fought against before. He promised the same violence and bloodshed that once Pahlavi's regime did to men and women of this land.<br />
<br />
<object data="http://www.youtube.com/v/pKUZuv6_bus & amp;hl=en & amp;fs=1 & amp;rel=0" height="344" type="application/x-shockwave-flash" width="425"></object><br />
<br />
What seems inevitable today, I truly hope, be avoided and we don't lose any of our dearest brothers and sisters. But those in Iran who think they are any more powerful than Shah, should know the people who have tasted freedom once will <strong>never</strong> go back to dictatorship.<br />
<br />
I kindly requests from all freedom loving people of this planet not to recognised Iran's government as it is now. Any government that ignores and threatens to brutally suppress a significant (if not majority) portion of its nation is not a legitimate government.<br />
<br />
Iran, you are not alone. No matter, what they do to you brave boys and girls, men and women of this great nation, you will not be forgotten. We will be with you till you get what you deserve.</div>Masoodhttp://www.blogger.com/profile/02916891582456634367noreply@blogger.com1tag:blogger.com,1999:blog-1576721785054505020.post-3785474805943729442009-06-20T17:49:00.001+10:002011-10-27T21:31:11.827+11:00Truecrypt on Fedora 11<div dir="ltr" style="text-align: left;" trbidi="on">
Since <a href="http://en.wikipedia.org/wiki/Truecrypt">Truecrypt</a> doesn't officially provide RPM packages for Fedora, you are left with a choice of either compiling your own from the source or using openSUSE RPM (I read somewhere that it would work though I haven't tried it myself).<br />
<br />
Well, I chose to compile version 6.1a of Truecrypt on Fedora 10 which worked pretty well. I used these instructions from <a href="http://penguinenclave.blogspot.com/2008/12/truecrypt-61-install-guide-for-fedora.html">Penguin Enclave</a> but perhaps for a <a href="https://bugzilla.redhat.com/show_bug.cgi?id=496423">bug</a> in Truecrypt code, compiling it on Fedora 11 failed.<br />
<br />
Fortunately, the version 6.2 has resolved the issue and now it can be easily compiled. Please refer to Penguin Enclave's original post for instructions with the only modification being patching of <code>Common/SecurityToken.cpp</code>:<br />
<pre class="brush: diff">diff -urN truecrypt-6.2-source.orig/Common/SecurityToken.cpp truecrypt-6.2-source/Common/SecurityToken.cpp
--- truecrypt-6.2-source.orig/Common/SecurityToken.cpp 2009-05-10 17:38:36.000000000 +1000
+++ truecrypt-6.2-source/Common/SecurityToken.cpp 2009-06-20 18:05:33.873119148 +1000
@@ -657,8 +657,8 @@
TC_TOKEN_ERR (CKR_CRYPTOKI_ALREADY_INITIALIZED)
TC_TOKEN_ERR (CKR_MUTEX_BAD)
TC_TOKEN_ERR (CKR_MUTEX_NOT_LOCKED)
- TC_TOKEN_ERR (CKR_NEW_PIN_MODE)
- TC_TOKEN_ERR (CKR_NEXT_OTP)
+// TC_TOKEN_ERR (CKR_NEW_PIN_MODE)
+// TC_TOKEN_ERR (CKR_NEXT_OTP)
TC_TOKEN_ERR (CKR_FUNCTION_REJECTED)
#undef TC_TOKEN_ERR </pre>
<br />
Links:<br />
<a href="http://penguinenclave.blogspot.com/2008/12/truecrypt-61-install-guide-for-fedora.html">Truecrypt 6.1 Install Guide for Fedora 10 </a><br />
<a href="https://bugzilla.redhat.com/show_bug.cgi?id=496423">Bug 496423 related to compilation of Truecrypt on Fedora 11 </a><br />
<a href="http://www.truecrypt.org/">Truecrypt official website </a><br />
<div class="blogger-post-footer">
</div>
</div>Masoodhttp://www.blogger.com/profile/02916891582456634367noreply@blogger.com1tag:blogger.com,1999:blog-1576721785054505020.post-11336210462226514282009-06-16T00:46:00.001+10:002011-10-27T21:01:20.973+11:00Don't sleep Iran!<div dir="ltr" style="text-align: left;" trbidi="on">
<a href="http://www.talkingpointsmemo.com/images/gallery-iranviolence8.jpg"><img alt="" src="http://www.talkingpointsmemo.com/images/gallery-iranviolence8.jpg" style="height: 333px; text-align: center; width: 500px;" /></a><br />
<br />
Sadly, truth is often bitter. We often don't wanna know about it and hope for the best. I think this is why we vote every now and then despite the usual mismanagements and undelivered promises, hopping tomorrow would be different. <br />
<br />
All this time, we could have asked for more but we never asked. Perhaps, we preferred a peaceful life, so peaceful that we felt asleep while some was taking away our very hope. Regardless of election result, ban on protests and strong use of force to suppress the opposition indicates we are almost at the footsteps of a dictatorship. <br />
<br />
I'd never recognise such election but like or not, other countries will do just like Russia and China. You've heard it right, all those governments that doubted us every single time and used to call our system a dictatorship, now respect our "democracy" and refrain from involving into our "internal affairs"; one suspects of a secret deal between Ahmadinejad's and other superpowers. <br />
<br />
Don't sleep Iran. Not this time. If we don't stand for our freedom, nobody will and we won't get back what we lose today four years later. <br />
<br />
Links: <br />
<a href="http://twitter.com/mousavi1388">Mousavi1388 twitter </a><br />
<a href="http://www.flickr.com/mousavi1388">Mousavi1388 Flickr photo gallery </a><br />
<a href="http://www.talkingpointsmemo.com/gallery/2009/06/mousavi.php?img=1">TPM photo gallery 1 </a><br />
<a href="http://www.talkingpointsmemo.com/gallery/2009/06/violence-erupts-in-iran---june-13-2009.php?img=1">TPM photo gallery 2 </a><br />
<a href="http://www.dailykos.com/storyonly/2009/6/16/743355/-Hashemi-Rafsanjani-And-The-End-Game-In-Iran">A very interesting article on current political situation in Iran </a>
</div>Masoodhttp://www.blogger.com/profile/02916891582456634367noreply@blogger.com1tag:blogger.com,1999:blog-1576721785054505020.post-6085409549417402882009-06-11T17:39:00.001+10:002011-10-27T21:32:42.630+11:00Audio over HDMI<div dir="ltr" style="text-align: left;" trbidi="on">
After a bit of discussion on fedora-test-list, reading this <a href="https://bugzilla.redhat.com/show_bug.cgi?id=502890">bug report</a> and trying out a few parameters from <a href="http://ubuntuforums.org/showthread.php?t=1043568">here</a>, I finally got audio over HDMI from my M1330. <br />
<br />
I have added following to <code>/etc/modprobe.d/alsa.conf</code>: <br />
<pre class="brush: plain;">options snd_hda_intel model=dell-3stack</pre>
I needed <code>pavucontrol</code> to actually select HDMI output profile. <br />
<br />
The front audio jacks still don't work but I guess I'll get back to them after mid-year exams.
</div>Masoodhttp://www.blogger.com/profile/02916891582456634367noreply@blogger.com0tag:blogger.com,1999:blog-1576721785054505020.post-8568354508251573042009-06-10T21:11:00.001+10:002011-10-27T21:33:02.351+11:00The unfriendly television!<div dir="ltr" style="text-align: left;" trbidi="on">
If you happen to have a Samsung Series 6 LCD TV, you probably have already found out that not all the features work out of the box for a Linux user. Fortunately, the fix is easy after a bit of googling. <br />
<br />
I was able to get its <a href="http://en.wikipedia.org/wiki/Dlna">DLNA</a> working with <a href="http://mediatomb.cc/">MediaTomb</a> after adding following lines<sup>1</sup> to its configuration file (thanks to <em>crappylogin</em> for sharing the code):<br />
<pre class="brush: xml"><custom-http-headers ><add header="transferMode.dlna.org: Streaming" />
<add header="contentFeatures.dlna.org: DLNA.ORG_OP=01;DLNA.ORG_CI=0;
DLNA.ORG_FLAGS=01700000000000000000000000000000" />
</custom-http-headers> </pre>
and this to mappings tag: <br />
<pre class="brush: xml"><map from="avi" to="video/mpeg" /> </pre>
Also, X on Fedora 11 doesn't seem to get EDID unless HDMI cable is attached while the system boots. Again, workaround is simply adding correct Modelines using <code>xrandr</code>. Here are Modelines for Samsung LA32B650: <br />
<pre class="brush: plain">"1920x1080" 148.50 1920 2008 2052 2200 1080 1084 1089 1125 +hsync +vsync
"1360x768" 85.50 1360 1424 1536 1792 768 771 777 795 +hsync +vsync </pre>
Despite this little annoyance, the TV is a joy to use. It can play contents from a DLNA server as well as USB flash or HDD and has a comprehensive codec support. <br />
<br />
I haven't spent much time on it yet but if you are interested, you can download source code of its firmware <a href="http://www.samsung.com/global/opensource/files/32B650.zip">here</a>. <br />
<br />
Links: <br />
<a href="http://forums.tversity.com/viewtopic.php?f=2%20&%20amp;t=10992%20&%20amp;st=0%20&%20amp;sk=t%20&%20amp;sd=a%20&%20amp;start=45">http://forums.tversity.com/viewtopic.php?f=2 & amp;t=10992 & amp;st=0 & amp;sk=t & amp;sd=a & amp;start=45 </a>
</div>Masoodhttp://www.blogger.com/profile/02916891582456634367noreply@blogger.com3tag:blogger.com,1999:blog-1576721785054505020.post-52564258253026061142009-02-28T11:38:00.001+11:002011-10-27T21:05:27.927+11:00Education or Censorship?<div dir="ltr" style="text-align: left;" trbidi="on">
So what is the obsession with censorship of information? When did it actually achieve its intended goals in the past for any nation? Of course, I meant any achievement other than suppression of free speech and protecting illegal activities of corrupted rulers. <br />
<br />
Australia is a great country and we are proud of our diverse and free society but we should not take it for granted. Freedom that we enjoy today has not come at no cost and we should protect it. Our democracy would quickly turn into dictatorship if censorship becomes our quick solution to every problem. <br />
<br />
Surely, filtering of Internet in Australia is not only about child pornography and covers whole range of contents labeled 'inappropriate'. Considering our diverse multi-cultural population, such classification will only undermine tolerance and respect in our society and strip a large portion of this nation of their right to information. <br />
<br />
In my opinion, censorship in a democratic environment is absurd to say the least. In addition, filtering gives a false sense of security that can lead to more disastrous results. In case of children accessing harmful contents, parents education can be a more effective method as software for control Internet access at home are readily available. <br />
<br />
Please join the campaign to end this proposal and stop our government from following the footsteps of others blindly. <br />
<a href="http://nocleanfeed.com/"><br />
</a><br />
<div style="text-align: center;">
<a href="http://nocleanfeed.com/"><img alt="No Clean Feed - Stop Internet Censorship in Australia" src="http://nocleanfeed.com/nocensorship.gif" /></a></div>
</div>Masoodhttp://www.blogger.com/profile/02916891582456634367noreply@blogger.com0tag:blogger.com,1999:blog-1576721785054505020.post-83083375012958085392009-02-26T17:16:00.001+11:002011-10-27T21:12:14.637+11:00TomTom won't be the last one!<div dir="ltr" style="text-align: left;" trbidi="on">
Microsoft has sued TomTom for patent infringement. You should have hear it by now and what's better for M$ to have some extra cash and loyalty payment in the middle of a recession. Business as usual with a difference, that is their probable win or settlement can complicate things for FOSS community. <br />
<br />
It's unlikely they sue everyone even if patents are to be upheld in court and applicable to other implementations. Others got patents for defend themselves too but that's still not a desired situation to be in for anyone. <br />
<br />
OK. I hope you were not looking for any serious opinion or insight because I don't have any. I never liked FAT and I hope FOSS community take a note and don't assume (though I wished) their patents are all as worthless as the <a href="http://ubuntulinuxtipstricks.blogspot.com/2007/05/did-microsoft-just-patent-sudo.html">UAC</a> one. <br />
<br />
So don't format a FAT on that external hard drive if you don't have to attach to a FAT-only sh*t box.
</div>Masoodhttp://www.blogger.com/profile/02916891582456634367noreply@blogger.com0tag:blogger.com,1999:blog-1576721785054505020.post-23315145901487212292008-09-03T19:44:00.001+10:002011-10-27T21:08:17.285+11:00Does Google Chrome mean Firefox is not good enough?<div dir="ltr" style="text-align: left;" trbidi="on">
Google released its own web browser based on <em>WebKit</em> today. Well, it's too early to take <em>Chrome</em> seriously and also GNU/Linux and OSX support is not even ready. Nevertheless, Google's choice of WebKit made me wonder why. <br />
<br />
It seems WebKit is easier to port to devices of different size and resource capacity. I read a while ago that KDE and Epiphany were moving to WebKit too. I'm not an expert in browser's engine technology but I think such interest in WebKit might be technical as well as greater flexibility with its license. <br />
<br />
But what does all these mean to <em>Firefox</em> and its engine, <em>Gecko</em>? Does this mean soon everyone will abandon it just because big names are not interested in it? Or not too far in the future, its usage shrink significantly? <br />
<br />
Although these are not particularly good signs for Mozilla, I think Gecko is more than a layout engine; it powers one of the most popular web browsers (I wanted to say the most but some loosers might argue why the IE is more used!!!). Firefox has a wealth of features in addition to its technical merits and Google need a lot of time to build a similar one. I guess by the time other catch up with Firefox features, Mozilla has perfected its Gecko further to stay competitive. <br />
<br />
In the mean time, Firefox the web and support the browser that brought some joy to the net. <br />
<br />
<div style="text-align: center;">
<a href="http://www.spreadfirefox.com/node%20&%20amp;id=0%20&%20amp;t=321"><img alt="Foxkeh" src="http://images.spreadfirefox.com/affiliates/Buttons/firefox3/foxkeh-fx3-180x60.png" title="Foxkeh" /></a></div>
</div>Masoodhttp://www.blogger.com/profile/02916891582456634367noreply@blogger.com0tag:blogger.com,1999:blog-1576721785054505020.post-52712235902336692352008-07-30T00:17:00.001+10:002011-10-27T21:30:59.783+11:00Got My USBs Back in VirtualBox<div dir="ltr" style="text-align: left;" trbidi="on">
Well, since I upgraded to Hardy, I couldn't get my USB devices to work in VirtualBox and I was almost forgetting it once had such feature : ) <br />
<br />
I've been very lazy because if I just had googled it like I did today, my life could have been more colourful. If you suffer from the same problem and haven't bothered fixing it yet, here is a fix I found on <em>ubuntu-unleashed</em>. <br />
<br />
After adding yourself to <code>vboxusers</code> group and uncommenting a few lines in <code>/etc/init.d/mountdevsubfs.sh</code>, find group id of <code>vboxusers</code> and add the following to <code>/etc/fstab</code><br />
<pre 04="" 2008="" class="brush: plain">none /proc/bus/usb usbfs devgid=VBOXUSERS_ID,devmode=664 0 0 </pre>
Mount it and celebrate the reunion. <br />
<br />
Link to full article: <br />
<a =""="" href="http://www.blogger.com/howto-install-virtualbox-in-hardy-heron.html" http:="" www.ubuntu-unleashed.com="">http://www.ubuntu-unleashed.com/2008/04/howto-install-virtualbox-in-hardy-heron.html></a>
</div>Masoodhttp://www.blogger.com/profile/02916891582456634367noreply@blogger.com0tag:blogger.com,1999:blog-1576721785054505020.post-38243344399842957292008-07-03T02:10:00.001+10:002011-10-27T21:10:57.447+11:00Pidgin and ICQ<div dir="ltr" style="text-align: left;" trbidi="on">
Today, ICQ authentication using <em>Pidgin</em> on Hardy died all the sudden with an error message complaining about the version of the software. <br />
<br />
Well, as suggested in the error message, I compiled the latest version, 2.4.3, and it did solve the problem. I've uploaded the new version in <a href="http://ppa.launchpad.net/masoodbeh/ubuntu">my PPA</a> but alternatively you can grab the deb files from <a href="http://www.getdeb.net/">getdeb</a> now. </div>Masoodhttp://www.blogger.com/profile/02916891582456634367noreply@blogger.com0tag:blogger.com,1999:blog-1576721785054505020.post-30643270340738285422008-06-29T17:54:00.001+10:002011-10-27T21:11:50.240+11:00What Are We Thanking Bill Gates For?<div dir="ltr" style="text-align: left;" trbidi="on">
Since Bill Gates retirement from his full-time job at Microsoft, I read a few articles praising him for his role in making PC a commodity today among others. <br />
<br />
Indeed, rise of Microsoft caused PC sales to increased significantly to become affordable enough to reach billions today but so did access to human right organisations and other pro-justice groups is easier today as a result of horrific events of the past. Maybe I'm exaggerating here but I hardly think people thank cruel kings and dictators for causing revolutions to form or inhuman employers for making people cry for unions. <br />
<br />
My point here is not to say that Bill Gates is just as evil as Saddam Husein but I like to question his motivations that helped Microsoft to become evil monopoly. Did he really wanted PC to reach is every classroom in the world just for the sake of education? Or was this the plan he engineered to earn billions? <br />
<br />
In my opinion, poeple's motivations are far more important than simply the result of their actions. You might disagree but computers becoming a part of everyday life was inevitable with or without Microsoft. Well, no doubt that it could be a bit slower but we would get there in a healthier environment. <br />
<br />
Bill Gates indeed was the reason for many changes but like invention of nuclear weapons, changes were natural consequences and shouldn't be credited to those who don't deserve them.
</div>Masoodhttp://www.blogger.com/profile/02916891582456634367noreply@blogger.com0tag:blogger.com,1999:blog-1576721785054505020.post-87393543426102397232008-06-19T17:33:00.001+10:002011-10-27T21:12:35.632+11:00Wahooo! 8 Millions<div dir="ltr" style="text-align: left;" trbidi="on">
Yes. We did it and it's well over expected 5 millions. It's great that people's interest in Firefox has grown up so much and I look forward for sharper rise as further improvements gets into the software. <br />
<br />
Well, Firefox 3 has been in Ubuntu repository for sometime now, from Beta 5 to final release a couple of days before 17th. I'm happy that by the official release date, most add-ons I use were ported to the version 3 and now it truly replaces its older-self. I found the new version much faster and less-memory hungry (I'm not concerned much about memory as I have 4GB but still appreciate lighter applications) specially when Firefox 2 with Firebug was extremely slow and fat! (memory-wise) <br />
<br />
Anyways thanks to all the developers and beta testers of Firefox for producing such a superb software. <br />
<br />
ps. <a href="http://www.spreadfirefox.com/en-US/worldrecord/">the download map</a> at spreadfirefox.com is very interesting. Only 214k for China!!!?? What a shame. We didn't do any better here at Australia; 167k.
</div>Masoodhttp://www.blogger.com/profile/02916891582456634367noreply@blogger.com1tag:blogger.com,1999:blog-1576721785054505020.post-71346668855333205252008-06-18T22:13:00.001+10:002011-10-27T21:13:14.811+11:00GMAIL for mailto Links<div dir="ltr" style="text-align: left;" trbidi="on">
Today after happily downloading <a href="http://www.mozilla.com/en-US/firefox/">Firefox 3</a>, I noticed a feature that seems to be new in Firefox; the ability to add a webmail service such as GMAIL as a mailto link handler. Well, I might be wrong but it seems version 3 is the first to do it without an add-on. <br />
<br />
OK. I read the instructions in an article on lifehacker.com but since it's very short I briefly add it here. <br />
<br />
First type <code>about:config</code> in address bar and after passing the warning message, find <code>gecko.handlerService.allowRegisterFromDifferentHost</code> entry and change its value to <code>true</code>. <br />
<br />
Then type <code>javascript:window.navigator.registerProtocolHandler("mailto","https://mail.google.com/mail/?extsrc=mailto & amp;url=%s","GMail")</code> in the address bar and confirm adding it. <br />
<br />
Go back and change the value of <code>gecko.handlerService.allowRegisterFromDifferentHost </code> to <code>false</code>. <br />
<br />
Now if you open preference, in application tab for mailto handler, you'll have GMAIL as a choice. <br />
<br />
Link to original article: <br />
<a href="http://lifehacker.com/392287/set-firefox-3-to-launch-gmail-for-mailto-links">http://lifehacker.com/392287/set-firefox-3-to-launch-gmail-for-mailto-links</a>
</div>Masoodhttp://www.blogger.com/profile/02916891582456634367noreply@blogger.com0tag:blogger.com,1999:blog-1576721785054505020.post-12102411390220217852008-06-16T22:31:00.001+10:002011-10-27T21:14:41.987+11:00apt-get wife!<div dir="ltr" style="text-align: left;" trbidi="on">
I saw this in a chat room and thought it's definitely worth having it in my blog : )) <br />
<br />
<a href="http://www.lessaid.net/fun/apt-get-wife.png"><img alt="" src="http://www.lessaid.net/fun/apt-get-wife.png" style="cursor: pointer; display: block; height: 175px; margin: 0px auto 10px; text-align: center; width: 518px;" /></a><br />
Poor maintainer have to look after so many dependencies : )) </div>Masoodhttp://www.blogger.com/profile/02916891582456634367noreply@blogger.com0