<?xml version="1.0" encoding="UTF-8"?> <rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" ><channel><title>Saeid Zebardast&#039;s Blog &#187; Saeid Zebardast</title> <atom:link href="http://zebardast.ir/en/author/admin/feed/" rel="self" type="application/rss+xml" /><link>http://zebardast.ir/en</link> <description></description> <lastBuildDate>Sun, 23 Oct 2011 18:18:07 +0000</lastBuildDate> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=</generator><image><title>Saeid Zebardast&#039;s Blog</title> <url>http://0.gravatar.com/avatar/1518e6b905d65cbe0a03243a199e18fc.png?s=48</url><link>http://zebardast.ir/en</link> </image> <item><title>Free Software / Open Source Business Models</title><link>http://zebardast.ir/en/free-software-open-source-business-models/</link> <comments>http://zebardast.ir/en/free-software-open-source-business-models/#comments</comments> <pubDate>Sun, 23 Oct 2011 18:18:07 +0000</pubDate> <dc:creator>Saeid Zebardast</dc:creator> <category><![CDATA[GNU/Linux]]></category> <category><![CDATA[news]]></category> <category><![CDATA[Business]]></category> <category><![CDATA[Conference]]></category> <category><![CDATA[open source]]></category> <category><![CDATA[Presentation]]></category><guid isPermaLink="false">http://zebardast.ir/en/?p=225</guid> <description><![CDATA[The 2nd Technical Conference of The Free Software / Open Source held on Sep 8-9, 2011 in Zanjan, Iran. I had a conference about Free Software and Open Source Business Models. I&#8217;ve uploaded my presentation on slideshare.net. I hope this help newbies to understand Open Source business models. Free Software / Open Source Business Models [...] Related posts:<ol><li><a href='http://zebardast.ir/en/tv-show-sefroyek-open-source-operating-systems/' rel='bookmark' title='TV show &#8220;SefroYek&#8221;: &#8220;Open Source operating systems&#8221;'>TV show &#8220;SefroYek&#8221;: &#8220;Open Source operating systems&#8221;</a></li><li><a href='http://zebardast.ir/en/hardy-party-held-in-tehran-iran/' rel='bookmark' title='Hardy Party held in Tehran, Iran'>Hardy Party held in Tehran, Iran</a></li></ol>]]></description> <content:encoded><![CDATA[<p>The 2nd Technical Conference of The Free Software / Open Source held on Sep 8-9, 2011 in Zanjan, Iran. I had a conference about Free Software and Open Source Business Models. I&#8217;ve uploaded my presentation on slideshare.net. I hope this help newbies to understand Open Source business models.</p><div style="width:580px" class="ltr" id="__ss_9200235"> <strong style="display:block;margin:12px 0 4px"><a href="http://www.slideshare.net/saeidzebardast/free-software-open-source-business-models" title="Free Software / Open Source Business Models" target="_blank">Free Software / Open Source Business Models</a></strong> <iframe src="http://www.slideshare.net/slideshow/embed_code/9200235" width="580" height="497" frameborder="0" marginwidth="0" marginheight="0" scrolling="no"></iframe></div><p>• <a href='http://zebardast.ir/wp-content/uploads/2011/09/free-software-open-source-business-model.pdf'>Download Free Software / Open Source Business Models </a> (PDF, 2.3 MB)</p><div class="wp-biographia-container-top" style="background-color:#FFEAA8;"><div class="wp-biographia-pic"><img alt='' src='http://1.gravatar.com/avatar/1518e6b905d65cbe0a03243a199e18fc?s=100&amp;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D100&amp;r=G' class='avatar avatar-100 photo' height='100' width='100' /></div><div class="wp-biographia-text"><h3>About <a href="http://zebardast.ir/en/author/admin/" title="Saeid Zebardast">Saeid Zebardast</a></h3><p>I'm Senior software engineer with 5+ years of professional experience includes cross-platform proficiency with considerable knowledge of programming languages especially Java and programming paradigms such as OO and development methodologies. Also I'm MySQL DBA since 2006.</p><small><a href="mailto:&#115;ae&#105;&#100;.&#122;e&#98;ar&#100;a&#115;&#116;&#64;&#103;&#109;a&#105;l&#46;com" title="Send Saeid Zebardast Mail">Mail</a> | <a href="http://zebardast.ir/" title="Saeid Zebardast On The Web">Web</a> | <a href="https://twitter.com/#!/saeid" title="Saeid Zebardast On Twitter">Twitter</a> | <a href="https://www.facebook.com/saeid.zebardast" title="Saeid Zebardast On Facebook">Facebook</a> | <a href="http://www.linkedin.com/in/saeid" title="Saeid Zebardast On LinkedIn">LinkedIn</a> | <a href="https://plus.google.com/112638433061122581433" title="Saeid Zebardast On Google+">Google+</a> | <a href="http://zebardast.ir/en/author/admin/" title="More Posts By Saeid Zebardast">More Posts (31)</a></small></div></div><p><a class="a2a_button_google_plus" href="http://www.addtoany.com/add_to/google_plus?linkurl=http%3A%2F%2Fzebardast.ir%2Fen%2Ffree-software-open-source-business-models%2F&amp;linkname=Free%20Software%20%2F%20Open%20Source%20Business%20Models" title="Google+" rel="nofollow" target="_blank"><img src="http://zebardast.ir/en/wp-content/plugins/add-to-any/icons/google.png" width="16" height="16" alt="Google+"/></a><a class="a2a_button_facebook" href="http://www.addtoany.com/add_to/facebook?linkurl=http%3A%2F%2Fzebardast.ir%2Fen%2Ffree-software-open-source-business-models%2F&amp;linkname=Free%20Software%20%2F%20Open%20Source%20Business%20Models" title="Facebook" rel="nofollow" target="_blank"><img src="http://zebardast.ir/en/wp-content/plugins/add-to-any/icons/facebook.png" width="16" height="16" alt="Facebook"/></a><a class="a2a_button_twitter" href="http://www.addtoany.com/add_to/twitter?linkurl=http%3A%2F%2Fzebardast.ir%2Fen%2Ffree-software-open-source-business-models%2F&amp;linkname=Free%20Software%20%2F%20Open%20Source%20Business%20Models" title="Twitter" rel="nofollow" target="_blank"><img src="http://zebardast.ir/en/wp-content/plugins/add-to-any/icons/twitter.png" width="16" height="16" alt="Twitter"/></a><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fzebardast.ir%2Fen%2Ffree-software-open-source-business-models%2F&amp;title=Free%20Software%20%2F%20Open%20Source%20Business%20Models" id="wpa2a_2"><span style='display:none'>Share</span></a></p><p>Related posts:<ol><li><a href='http://zebardast.ir/en/tv-show-sefroyek-open-source-operating-systems/' rel='bookmark' title='TV show &#8220;SefroYek&#8221;: &#8220;Open Source operating systems&#8221;'>TV show &#8220;SefroYek&#8221;: &#8220;Open Source operating systems&#8221;</a></li><li><a href='http://zebardast.ir/en/hardy-party-held-in-tehran-iran/' rel='bookmark' title='Hardy Party held in Tehran, Iran'>Hardy Party held in Tehran, Iran</a></li></ol></p>]]></content:encoded> <wfw:commentRss>http://zebardast.ir/en/free-software-open-source-business-models/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>How to find IP locations using MySQL</title><link>http://zebardast.ir/en/how-to-find-ip-locations-using-mysql/</link> <comments>http://zebardast.ir/en/how-to-find-ip-locations-using-mysql/#comments</comments> <pubDate>Mon, 14 Mar 2011 15:18:59 +0000</pubDate> <dc:creator>Saeid Zebardast</dc:creator> <category><![CDATA[howto]]></category> <category><![CDATA[MySQL]]></category><guid isPermaLink="false">http://zebardast.ir/en/?p=198</guid> <description><![CDATA[Introduction Here we learn how to use MySQL for locating an IP address. At first we create a table that contains the name of the country and its IP address range. Then define a function to find country name of IP Address. What&#8217;s Ip Address? Quoting from the &#8220;IP address&#8221; page in Wikipedia: An Internet [...] No related posts.]]></description> <content:encoded><![CDATA[<p><strong>Introduction</strong><br /> Here we learn how to use MySQL for locating an IP address. At first we create a table that contains the name of the country and its IP address range. Then define a function to find country name of IP Address.</p><p><strong>What&#8217;s Ip Address?</strong></p><p>Quoting from the &#8220;<a href="http://en.wikipedia.org/wiki/IP_address">IP address</a>&#8221; page in Wikipedia:</p><blockquote><p> An Internet Protocol address (IP address) is a usually numerical label assigned to each device (e.g., computer, printer) participating in a computer network that uses the Internet Protocol for communication. An IP address serves two principal functions: host or network interface identification and location addressing. Its role has been characterized as follows: &#8220;A name indicates what we seek. An address indicates where it is. A route indicates how to get there.&#8221;</p></blockquote><p><strong>Table (database)</strong><br /> I created the ip_location table to save countries and IP Address ranges. Enter the following command:</p><pre class="brush: sql; title: ; notranslate">
CREATE TABLE `ip_location` (
  `from_ip` int(15) DEFAULT NULL,
  `to_ip` int(15) DEFAULT NULL,
  `country` varchar(32) DEFAULT NULL,
  KEY `from_ip` (`from_ip`,`country`),
  KEY `to_ip` (`to_ip`,`country`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC;
</pre><p>Then you need to import ip_location data. I exported my table with data via <a href="http://blog.datispars.com/import-and-export-in-mysql/">mysqldump</a>. You should download it and use <a href="http://blog.datispars.com/import-and-export-in-mysql/">mysql command</a> to restore it.<br /> • <a href='http://zebardast.ir/wp-content/uploads/2011/02/ip_location.sql_.zip'>Download ip_location.sql.zip</a> (165KB)</p><p><strong>getIpCountry() function</strong><br /> Now you need to create the function to extract country name:</p><pre class="brush: sql; title: ; notranslate">
DELIMITER $$
CREATE FUNCTION getIpCountry(ip varchar(15)) RETURNS varchar(64)
BEGIN
 declare a tinyint unsigned;
 declare b tinyint unsigned;
 declare c tinyint unsigned;
 declare d tinyint unsigned;
 declare total bigint;
 declare result varchar(64);
 select substring_index(ip, '.', 1 ) into a;
 select substring_index(substring_index(ip , '.', 2 ),'.',-1) into b;
 select substring_index(substring_index(ip , '.', -2 ),'.',1) into c;
 select substring_index(ip, '.', -1 ) into d;
 set total := (a*256*256*256) + (b*256*256) + (c*256) + d;
 select SQL_CACHE country into result from ip_location where total between from_ip and to_ip limit 1;
 if (result is null) or (result = '') then
 set result := 'unknown';
 end if;
 return result;
 END$$
DELIMITER ;
</pre><p>And done! You just need to use select command in MySQL <abbr title="Command-line interface">cli</abbr>:</p><pre class="brush: sql; title: ; notranslate">
mysql&gt; SELECT getIpCountry('79.175.165.171');
+--------------------------------+
| getIpCountry('79.175.165.171') |
+--------------------------------+
| IRAN (ISLAMIC REPUBLIC OF)     |
+--------------------------------+
1 row in set (0.03 sec)

mysql&gt; SELECT getIpCountry('4.2.2.4');
+-------------------------+
| getIpCountry('4.2.2.4') |
+-------------------------+
| UNITED STATES           |
+-------------------------+
1 row in set (0.00 sec)
</pre><p>Let me know if you have other way <img src='http://zebardast.ir/en/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /></p><div class="wp-biographia-container-top" style="background-color:#FFEAA8;"><div class="wp-biographia-pic"><img alt='' src='http://1.gravatar.com/avatar/1518e6b905d65cbe0a03243a199e18fc?s=100&amp;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D100&amp;r=G' class='avatar avatar-100 photo' height='100' width='100' /></div><div class="wp-biographia-text"><h3>About <a href="http://zebardast.ir/en/author/admin/" title="Saeid Zebardast">Saeid Zebardast</a></h3><p>I'm Senior software engineer with 5+ years of professional experience includes cross-platform proficiency with considerable knowledge of programming languages especially Java and programming paradigms such as OO and development methodologies. Also I'm MySQL DBA since 2006.</p><small><a href="mailto:&#115;aei&#100;.&#122;&#101;&#98;&#97;rda&#115;&#116;&#64;g&#109;&#97;&#105;l.&#99;&#111;&#109;" title="Send Saeid Zebardast Mail">Mail</a> | <a href="http://zebardast.ir/" title="Saeid Zebardast On The Web">Web</a> | <a href="https://twitter.com/#!/saeid" title="Saeid Zebardast On Twitter">Twitter</a> | <a href="https://www.facebook.com/saeid.zebardast" title="Saeid Zebardast On Facebook">Facebook</a> | <a href="http://www.linkedin.com/in/saeid" title="Saeid Zebardast On LinkedIn">LinkedIn</a> | <a href="https://plus.google.com/112638433061122581433" title="Saeid Zebardast On Google+">Google+</a> | <a href="http://zebardast.ir/en/author/admin/" title="More Posts By Saeid Zebardast">More Posts (31)</a></small></div></div><p><a class="a2a_button_google_plus" href="http://www.addtoany.com/add_to/google_plus?linkurl=http%3A%2F%2Fzebardast.ir%2Fen%2Fhow-to-find-ip-locations-using-mysql%2F&amp;linkname=How%20to%20find%20IP%20locations%20using%20MySQL" title="Google+" rel="nofollow" target="_blank"><img src="http://zebardast.ir/en/wp-content/plugins/add-to-any/icons/google.png" width="16" height="16" alt="Google+"/></a><a class="a2a_button_facebook" href="http://www.addtoany.com/add_to/facebook?linkurl=http%3A%2F%2Fzebardast.ir%2Fen%2Fhow-to-find-ip-locations-using-mysql%2F&amp;linkname=How%20to%20find%20IP%20locations%20using%20MySQL" title="Facebook" rel="nofollow" target="_blank"><img src="http://zebardast.ir/en/wp-content/plugins/add-to-any/icons/facebook.png" width="16" height="16" alt="Facebook"/></a><a class="a2a_button_twitter" href="http://www.addtoany.com/add_to/twitter?linkurl=http%3A%2F%2Fzebardast.ir%2Fen%2Fhow-to-find-ip-locations-using-mysql%2F&amp;linkname=How%20to%20find%20IP%20locations%20using%20MySQL" title="Twitter" rel="nofollow" target="_blank"><img src="http://zebardast.ir/en/wp-content/plugins/add-to-any/icons/twitter.png" width="16" height="16" alt="Twitter"/></a><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fzebardast.ir%2Fen%2Fhow-to-find-ip-locations-using-mysql%2F&amp;title=How%20to%20find%20IP%20locations%20using%20MySQL" id="wpa2a_4"><span style='display:none'>Share</span></a></p><p>No related posts.</p>]]></content:encoded> <wfw:commentRss>http://zebardast.ir/en/how-to-find-ip-locations-using-mysql/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>How to get pure content from HTML page in Java via Regex</title><link>http://zebardast.ir/en/how-to-get-pure-content-from-html-page-in-java-via-regex/</link> <comments>http://zebardast.ir/en/how-to-get-pure-content-from-html-page-in-java-via-regex/#comments</comments> <pubDate>Wed, 19 Jan 2011 14:19:00 +0000</pubDate> <dc:creator>Saeid Zebardast</dc:creator> <category><![CDATA[howto]]></category> <category><![CDATA[Java]]></category> <category><![CDATA[html]]></category> <category><![CDATA[Regex]]></category><guid isPermaLink="false">http://zebardast.ir/en/?p=177</guid> <description><![CDATA[Introduction I&#8217;ve written a web crawler while I was developing a search engine a few weeks ago. It extracts the contents and saves them onto the database. The HTML tags aren&#8217;t so important to most of the search engines. So, I removed them successfully. To do the same, follow below steps: 1- Remove the script [...] No related posts.]]></description> <content:encoded><![CDATA[<p><strong>Introduction</strong><br /> I&#8217;ve written a web crawler while I was developing a search engine a few weeks ago. It extracts the contents and saves them onto the database. The HTML tags aren&#8217;t so important to most of the search engines. So, I removed them successfully. To do the same, follow below steps:<br /> 1- Remove the script tags and inclusive content:</p><pre class="brush: java; title: ; notranslate">
// htmlContent is full content of page with HTML codes.

String content;
Pattern pattern;

pattern = Pattern.compile(&quot;&lt;script.*?&gt;.*?&lt;/script&gt;&quot;, Pattern.DOTALL | Pattern.CASE_INSENSITIVE);
content = pattern.matcher(htmlContent).replaceAll(&quot;&quot;);
</pre><p><strong>Note:</strong> In dotall mode, the expression &lt;tt&gt;.&lt;/tt&gt; matches any character, including a line terminator. By default this expression does not match line terminators.</p><p>2- Remove the style tags and inclusive content:</p><pre class="brush: java; title: ; notranslate">
String content;
Pattern pattern;

pattern = Pattern.compile(&quot;&lt;style.*?&gt;.*?&lt;/style&gt;&quot;, Pattern.DOTALL | Pattern.CASE_INSENSITIVE);
content = pattern.matcher(content).replaceAll(&quot;&quot;);
</pre><p>3- Remove all HTML tags without inclusive content.</p><pre class="brush: java; title: ; notranslate">
pattern = Pattern.compile(&quot;&lt;[^&gt;]*&gt;&quot;);
content = pattern.matcher(content).replaceAll(&quot;&quot;);
</pre><p>4- Replace new lines, tabs and multiple spaces with a single space.</p><pre class="brush: java; title: ; notranslate">
content = content.replaceAll(&quot;\n+&quot;, &quot; &quot;);
content = content.replaceAll(&quot;\t+&quot;, &quot; &quot;);
content = content.replaceAll(&quot;(  )+&quot;, &quot;&quot;);
</pre><p>And you have a pure content now <img src='http://zebardast.ir/en/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /></p><p><strong>Links</strong><br /> <a href="http://en.wikipedia.org/wiki/Regular_expression">Regular expression</a><br /> <a href="http://www.infernodevelopment.com/how-write-html-parser-java">How to Write an HTML Parser in Java</a><br /> <a href="http://www.regular-expressions.info/" title="Regex Tutorial, Examples and Reference">Regular-Expressions.info</a></p><div class="wp-biographia-container-top" style="background-color:#FFEAA8;"><div class="wp-biographia-pic"><img alt='' src='http://1.gravatar.com/avatar/1518e6b905d65cbe0a03243a199e18fc?s=100&amp;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D100&amp;r=G' class='avatar avatar-100 photo' height='100' width='100' /></div><div class="wp-biographia-text"><h3>About <a href="http://zebardast.ir/en/author/admin/" title="Saeid Zebardast">Saeid Zebardast</a></h3><p>I'm Senior software engineer with 5+ years of professional experience includes cross-platform proficiency with considerable knowledge of programming languages especially Java and programming paradigms such as OO and development methodologies. Also I'm MySQL DBA since 2006.</p><small><a href="mailto:s&#97;&#101;id&#46;ze&#98;&#97;&#114;d&#97;st&#64;gma&#105;l&#46;&#99;&#111;m" title="Send Saeid Zebardast Mail">Mail</a> | <a href="http://zebardast.ir/" title="Saeid Zebardast On The Web">Web</a> | <a href="https://twitter.com/#!/saeid" title="Saeid Zebardast On Twitter">Twitter</a> | <a href="https://www.facebook.com/saeid.zebardast" title="Saeid Zebardast On Facebook">Facebook</a> | <a href="http://www.linkedin.com/in/saeid" title="Saeid Zebardast On LinkedIn">LinkedIn</a> | <a href="https://plus.google.com/112638433061122581433" title="Saeid Zebardast On Google+">Google+</a> | <a href="http://zebardast.ir/en/author/admin/" title="More Posts By Saeid Zebardast">More Posts (31)</a></small></div></div><p><a class="a2a_button_google_plus" href="http://www.addtoany.com/add_to/google_plus?linkurl=http%3A%2F%2Fzebardast.ir%2Fen%2Fhow-to-get-pure-content-from-html-page-in-java-via-regex%2F&amp;linkname=How%20to%20get%20pure%20content%20from%20HTML%20page%20in%20Java%20via%20Regex" title="Google+" rel="nofollow" target="_blank"><img src="http://zebardast.ir/en/wp-content/plugins/add-to-any/icons/google.png" width="16" height="16" alt="Google+"/></a><a class="a2a_button_facebook" href="http://www.addtoany.com/add_to/facebook?linkurl=http%3A%2F%2Fzebardast.ir%2Fen%2Fhow-to-get-pure-content-from-html-page-in-java-via-regex%2F&amp;linkname=How%20to%20get%20pure%20content%20from%20HTML%20page%20in%20Java%20via%20Regex" title="Facebook" rel="nofollow" target="_blank"><img src="http://zebardast.ir/en/wp-content/plugins/add-to-any/icons/facebook.png" width="16" height="16" alt="Facebook"/></a><a class="a2a_button_twitter" href="http://www.addtoany.com/add_to/twitter?linkurl=http%3A%2F%2Fzebardast.ir%2Fen%2Fhow-to-get-pure-content-from-html-page-in-java-via-regex%2F&amp;linkname=How%20to%20get%20pure%20content%20from%20HTML%20page%20in%20Java%20via%20Regex" title="Twitter" rel="nofollow" target="_blank"><img src="http://zebardast.ir/en/wp-content/plugins/add-to-any/icons/twitter.png" width="16" height="16" alt="Twitter"/></a><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fzebardast.ir%2Fen%2Fhow-to-get-pure-content-from-html-page-in-java-via-regex%2F&amp;title=How%20to%20get%20pure%20content%20from%20HTML%20page%20in%20Java%20via%20Regex" id="wpa2a_6"><span style='display:none'>Share</span></a></p><p>No related posts.</p>]]></content:encoded> <wfw:commentRss>http://zebardast.ir/en/how-to-get-pure-content-from-html-page-in-java-via-regex/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Java: run command as root by Runtime.getRuntime().exec() in Ubuntu</title><link>http://zebardast.ir/en/java-run-command-as-root-by-runtime-getruntime-exec-in-ubuntu/</link> <comments>http://zebardast.ir/en/java-run-command-as-root-by-runtime-getruntime-exec-in-ubuntu/#comments</comments> <pubDate>Mon, 06 Dec 2010 07:53:33 +0000</pubDate> <dc:creator>Saeid Zebardast</dc:creator> <category><![CDATA[Java]]></category> <category><![CDATA[Tips]]></category><guid isPermaLink="false">http://zebardast.ir/en/?p=154</guid> <description><![CDATA[Hey a few days ago I needed to run `/etc/init.d/networking restart` command by Runtime.getRuntime().exec() in Java EE web application. The first and easiest way that came to mind was sudo without password and&#8230; It Worked! * To execute sudo without password, open /etc/sudoers by text editor like `nano`: And add your user or group to [...] Related posts:<ol><li><a href='http://zebardast.ir/en/root-terminal-in-ubuntu/' rel='bookmark' title='Root Terminal in Ubuntu'>Root Terminal in Ubuntu</a></li><li><a href='http://zebardast.ir/en/installing-sun-jdk-5-on-ubuntu-9-10-and-10-04/' rel='bookmark' title='Installing Sun JDK 5 on Ubuntu 9.10 and 10.04'>Installing Sun JDK 5 on Ubuntu 9.10 and 10.04</a></li></ol>]]></description> <content:encoded><![CDATA[<p>Hey <img src='http://zebardast.ir/en/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /></p><p>a few days ago I needed to run `/etc/init.d/networking restart` command by Runtime.getRuntime().exec() in Java EE web application. The first and easiest way that came to mind was sudo without password and&#8230; It Worked!<br /> * To execute sudo without password, open /etc/sudoers by text editor like `nano`:</p><pre class="brush: bash; title: ; notranslate">
$ sudo nano /etc/sudoers
</pre><p>And add your user or group to the end of file like below:</p><pre class="brush: bash; title: ; notranslate">
# for user
USER_NAME ALL= NOPASSWD: ALL

# for group
%GROUP_NAME ALL= NOPASSWD: ALL
</pre><p>let&#8217;s see my Java code:</p><pre class="brush: java; title: ; notranslate">
String command = &quot;sudo /etc/init.d/networking restart&quot;;
Runtime runtime = Runtime.getRuntime();
try {
    Process process = runtime.exec(command);
    BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(process.getInputStream()));
    String line;
    while ((line = bufferedReader.readLine()) != null) {
        System.out.println(line);
    }
} catch (IOException e) {
    e.printStackTrace();
}
</pre><p><strong>Troubleshooting</strong><br /> if you get `sudo: no tty present and no askpass program specified` error, make sure the user that runs command is in /etc/sudoers.</p><p>let me know if you find similar or easier way <img src='http://zebardast.ir/en/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /></p><div class="wp-biographia-container-top" style="background-color:#FFEAA8;"><div class="wp-biographia-pic"><img alt='' src='http://1.gravatar.com/avatar/1518e6b905d65cbe0a03243a199e18fc?s=100&amp;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D100&amp;r=G' class='avatar avatar-100 photo' height='100' width='100' /></div><div class="wp-biographia-text"><h3>About <a href="http://zebardast.ir/en/author/admin/" title="Saeid Zebardast">Saeid Zebardast</a></h3><p>I'm Senior software engineer with 5+ years of professional experience includes cross-platform proficiency with considerable knowledge of programming languages especially Java and programming paradigms such as OO and development methodologies. Also I'm MySQL DBA since 2006.</p><small><a href="mailto:&#115;aeid&#46;ze&#98;&#97;&#114;&#100;a&#115;&#116;&#64;&#103;&#109;&#97;il&#46;co&#109;" title="Send Saeid Zebardast Mail">Mail</a> | <a href="http://zebardast.ir/" title="Saeid Zebardast On The Web">Web</a> | <a href="https://twitter.com/#!/saeid" title="Saeid Zebardast On Twitter">Twitter</a> | <a href="https://www.facebook.com/saeid.zebardast" title="Saeid Zebardast On Facebook">Facebook</a> | <a href="http://www.linkedin.com/in/saeid" title="Saeid Zebardast On LinkedIn">LinkedIn</a> | <a href="https://plus.google.com/112638433061122581433" title="Saeid Zebardast On Google+">Google+</a> | <a href="http://zebardast.ir/en/author/admin/" title="More Posts By Saeid Zebardast">More Posts (31)</a></small></div></div><p><a class="a2a_button_google_plus" href="http://www.addtoany.com/add_to/google_plus?linkurl=http%3A%2F%2Fzebardast.ir%2Fen%2Fjava-run-command-as-root-by-runtime-getruntime-exec-in-ubuntu%2F&amp;linkname=Java%3A%20run%20command%20as%20root%20by%20Runtime.getRuntime%28%29.exec%28%29%20in%20Ubuntu" title="Google+" rel="nofollow" target="_blank"><img src="http://zebardast.ir/en/wp-content/plugins/add-to-any/icons/google.png" width="16" height="16" alt="Google+"/></a><a class="a2a_button_facebook" href="http://www.addtoany.com/add_to/facebook?linkurl=http%3A%2F%2Fzebardast.ir%2Fen%2Fjava-run-command-as-root-by-runtime-getruntime-exec-in-ubuntu%2F&amp;linkname=Java%3A%20run%20command%20as%20root%20by%20Runtime.getRuntime%28%29.exec%28%29%20in%20Ubuntu" title="Facebook" rel="nofollow" target="_blank"><img src="http://zebardast.ir/en/wp-content/plugins/add-to-any/icons/facebook.png" width="16" height="16" alt="Facebook"/></a><a class="a2a_button_twitter" href="http://www.addtoany.com/add_to/twitter?linkurl=http%3A%2F%2Fzebardast.ir%2Fen%2Fjava-run-command-as-root-by-runtime-getruntime-exec-in-ubuntu%2F&amp;linkname=Java%3A%20run%20command%20as%20root%20by%20Runtime.getRuntime%28%29.exec%28%29%20in%20Ubuntu" title="Twitter" rel="nofollow" target="_blank"><img src="http://zebardast.ir/en/wp-content/plugins/add-to-any/icons/twitter.png" width="16" height="16" alt="Twitter"/></a><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fzebardast.ir%2Fen%2Fjava-run-command-as-root-by-runtime-getruntime-exec-in-ubuntu%2F&amp;title=Java%3A%20run%20command%20as%20root%20by%20Runtime.getRuntime%28%29.exec%28%29%20in%20Ubuntu" id="wpa2a_8"><span style='display:none'>Share</span></a></p><p>Related posts:<ol><li><a href='http://zebardast.ir/en/root-terminal-in-ubuntu/' rel='bookmark' title='Root Terminal in Ubuntu'>Root Terminal in Ubuntu</a></li><li><a href='http://zebardast.ir/en/installing-sun-jdk-5-on-ubuntu-9-10-and-10-04/' rel='bookmark' title='Installing Sun JDK 5 on Ubuntu 9.10 and 10.04'>Installing Sun JDK 5 on Ubuntu 9.10 and 10.04</a></li></ol></p>]]></content:encoded> <wfw:commentRss>http://zebardast.ir/en/java-run-command-as-root-by-runtime-getruntime-exec-in-ubuntu/feed/</wfw:commentRss> <slash:comments>2</slash:comments> </item> <item><title>/etc/network/interfaces configuration for 802.1x authentication</title><link>http://zebardast.ir/en/etcnetworkinterfaces-configuration-for-802-1x-authentication/</link> <comments>http://zebardast.ir/en/etcnetworkinterfaces-configuration-for-802-1x-authentication/#comments</comments> <pubDate>Tue, 02 Nov 2010 06:14:08 +0000</pubDate> <dc:creator>Saeid Zebardast</dc:creator> <category><![CDATA[Ubuntu]]></category> <category><![CDATA[GNU/Linux]]></category> <category><![CDATA[Network]]></category> <category><![CDATA[Network Manager]]></category><guid isPermaLink="false">http://zebardast.ir/en/?p=114</guid> <description><![CDATA[Hey I have a problem with adjust Network Manager for 802.x1 Tunneled TLS (TTLS) and MD5 in Ubuntu. MD5 does not exist in `Inner Authentication` when I choose TTLS. I was forced to enter the settings to interfaces file (/etc/network/interfaces). Interfaces file content is shown below: auto lo iface lo inet loopback auto eth0 iface [...] No related posts.]]></description> <content:encoded><![CDATA[<p>Hey <img src='http://zebardast.ir/en/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /></p><p>I have a problem with adjust Network Manager for 802.x1 Tunneled TLS (TTLS) and MD5 in Ubuntu. MD5 does not exist in `Inner Authentication` when I choose TTLS.<br /> I was forced to enter the settings to interfaces file (/etc/network/interfaces). Interfaces file content is shown below:</p><pre>
auto lo
iface lo inet loopback

auto eth0
iface eth0 inet static
address xx.xx.xx.xx
netmask xx.xx.xx.xx
gateway xx.xx.xx.xx
wpa-driver wired
wpa-eap TTLS MD5
wpa-key-mgmt IEEE8021X
wpa-anonymous-identity USER_NAME
wpa-identity USER_NAME
wpa-password PASSWORD
wpa-phase1 auth=MD5
wpa-phase2 auth=PAP password=PASSWORD
</pre><p>Also you can use <a href="http://open1x.sourceforge.net/">Open1X (XSupplicant)</a>.</p><p><strong>Links</strong><br /> • <a href="http://en.wikipedia.org/wiki/IEEE_802.1X">IEEE 802.1X</a><br /> • <a href="https://help.ubuntu.com/community/Network802.1xAuthentication">Network 802.1x Authentication</a><br /> • <a href="http://open1x.sourceforge.net/">Open1X (XSupplicant)</a></p><p>Have a good time <img src='http://zebardast.ir/en/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /></p><div class="wp-biographia-container-top" style="background-color:#FFEAA8;"><div class="wp-biographia-pic"><img alt='' src='http://1.gravatar.com/avatar/1518e6b905d65cbe0a03243a199e18fc?s=100&amp;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D100&amp;r=G' class='avatar avatar-100 photo' height='100' width='100' /></div><div class="wp-biographia-text"><h3>About <a href="http://zebardast.ir/en/author/admin/" title="Saeid Zebardast">Saeid Zebardast</a></h3><p>I'm Senior software engineer with 5+ years of professional experience includes cross-platform proficiency with considerable knowledge of programming languages especially Java and programming paradigms such as OO and development methodologies. Also I'm MySQL DBA since 2006.</p><small><a href="mailto:s&#97;&#101;&#105;d.&#122;e&#98;a&#114;&#100;&#97;s&#116;&#64;gmai&#108;&#46;&#99;&#111;m" title="Send Saeid Zebardast Mail">Mail</a> | <a href="http://zebardast.ir/" title="Saeid Zebardast On The Web">Web</a> | <a href="https://twitter.com/#!/saeid" title="Saeid Zebardast On Twitter">Twitter</a> | <a href="https://www.facebook.com/saeid.zebardast" title="Saeid Zebardast On Facebook">Facebook</a> | <a href="http://www.linkedin.com/in/saeid" title="Saeid Zebardast On LinkedIn">LinkedIn</a> | <a href="https://plus.google.com/112638433061122581433" title="Saeid Zebardast On Google+">Google+</a> | <a href="http://zebardast.ir/en/author/admin/" title="More Posts By Saeid Zebardast">More Posts (31)</a></small></div></div><p><a class="a2a_button_google_plus" href="http://www.addtoany.com/add_to/google_plus?linkurl=http%3A%2F%2Fzebardast.ir%2Fen%2Fetcnetworkinterfaces-configuration-for-802-1x-authentication%2F&amp;linkname=%2Fetc%2Fnetwork%2Finterfaces%20configuration%20for%20802.1x%20authentication" title="Google+" rel="nofollow" target="_blank"><img src="http://zebardast.ir/en/wp-content/plugins/add-to-any/icons/google.png" width="16" height="16" alt="Google+"/></a><a class="a2a_button_facebook" href="http://www.addtoany.com/add_to/facebook?linkurl=http%3A%2F%2Fzebardast.ir%2Fen%2Fetcnetworkinterfaces-configuration-for-802-1x-authentication%2F&amp;linkname=%2Fetc%2Fnetwork%2Finterfaces%20configuration%20for%20802.1x%20authentication" title="Facebook" rel="nofollow" target="_blank"><img src="http://zebardast.ir/en/wp-content/plugins/add-to-any/icons/facebook.png" width="16" height="16" alt="Facebook"/></a><a class="a2a_button_twitter" href="http://www.addtoany.com/add_to/twitter?linkurl=http%3A%2F%2Fzebardast.ir%2Fen%2Fetcnetworkinterfaces-configuration-for-802-1x-authentication%2F&amp;linkname=%2Fetc%2Fnetwork%2Finterfaces%20configuration%20for%20802.1x%20authentication" title="Twitter" rel="nofollow" target="_blank"><img src="http://zebardast.ir/en/wp-content/plugins/add-to-any/icons/twitter.png" width="16" height="16" alt="Twitter"/></a><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fzebardast.ir%2Fen%2Fetcnetworkinterfaces-configuration-for-802-1x-authentication%2F&amp;title=%2Fetc%2Fnetwork%2Finterfaces%20configuration%20for%20802.1x%20authentication" id="wpa2a_10"><span style='display:none'>Share</span></a></p><p>No related posts.</p>]]></content:encoded> <wfw:commentRss>http://zebardast.ir/en/etcnetworkinterfaces-configuration-for-802-1x-authentication/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>TV show &#8220;SefroYek&#8221;: &#8220;Open Source operating systems&#8221;</title><link>http://zebardast.ir/en/tv-show-sefroyek-open-source-operating-systems/</link> <comments>http://zebardast.ir/en/tv-show-sefroyek-open-source-operating-systems/#comments</comments> <pubDate>Thu, 23 Sep 2010 08:50:44 +0000</pubDate> <dc:creator>Saeid Zebardast</dc:creator> <category><![CDATA[GNU/Linux]]></category> <category><![CDATA[news]]></category> <category><![CDATA[open source]]></category> <category><![CDATA[TV show]]></category><guid isPermaLink="false">http://zebardast.ir/en/?p=132</guid> <description><![CDATA[Hey, A few days ago, I was invited to &#8220;SefroYek&#8221; a technical TV show that discusses with experts. That was second session and I&#8217;ve been there to talk about “Open Source operation systems”. I opened the discussion with GNU/Linux. Next, I answered the questions. There were many questions about equivalent windows softwares in GNU/Linux. I [...] No related posts.]]></description> <content:encoded><![CDATA[<p>Hey,</p><p>A few days ago, I was invited to &#8220;<a href="http://www.tv7.ir/portal/index.php?option=com_content&#038;id=944">SefroYek</a>&#8221; a technical TV show that discusses with experts. That was second session and I&#8217;ve been there to talk about “Open Source operation systems”. I opened the discussion with GNU/Linux. Next, I answered the questions. There were many questions about equivalent windows softwares in GNU/Linux. I uploaded the first part. It’s in <a href="http://en.wikipedia.org/wiki/Persian_language">Persian language</a>.</p><div style="text-align: center"> <iframe src="http://player.vimeo.com/video/14711037" width="400" height="300" frameborder="0"></iframe><p><a href="http://vimeo.com/14711037">Open Source operating software</a> from <a href="http://vimeo.com/user4658545">Saeid Zebardast</a> on <a href="http://vimeo.com">Vimeo</a>.</p></div><p>I&#8217;ve wrote more information about this TV show in <a href="http://zebardast.ir/%D8%B5%D9%81%D8%B1-%D9%88-%DB%8C%DA%A9-%D8%A8%D8%A7-%D9%85%D9%88%D8%B6%D9%88%D8%B9-%D8%B3%DB%8C%D8%B3%D8%AA%D9%85-%D8%B9%D8%A7%D9%85%D9%84-%D9%87%D8%A7%DB%8C-%D9%85%D8%AA%D9%86-%D8%A8%D8%A7%D8%B2/">my Persian blog</a>.</p><p>Have a good time <img src='http://zebardast.ir/en/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /></p><div class="wp-biographia-container-top" style="background-color:#FFEAA8;"><div class="wp-biographia-pic"><img alt='' src='http://1.gravatar.com/avatar/1518e6b905d65cbe0a03243a199e18fc?s=100&amp;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D100&amp;r=G' class='avatar avatar-100 photo' height='100' width='100' /></div><div class="wp-biographia-text"><h3>About <a href="http://zebardast.ir/en/author/admin/" title="Saeid Zebardast">Saeid Zebardast</a></h3><p>I'm Senior software engineer with 5+ years of professional experience includes cross-platform proficiency with considerable knowledge of programming languages especially Java and programming paradigms such as OO and development methodologies. Also I'm MySQL DBA since 2006.</p><small><a href="mailto:&#115;a&#101;id.&#122;&#101;&#98;&#97;r&#100;a&#115;t&#64;&#103;m&#97;i&#108;&#46;c&#111;m" title="Send Saeid Zebardast Mail">Mail</a> | <a href="http://zebardast.ir/" title="Saeid Zebardast On The Web">Web</a> | <a href="https://twitter.com/#!/saeid" title="Saeid Zebardast On Twitter">Twitter</a> | <a href="https://www.facebook.com/saeid.zebardast" title="Saeid Zebardast On Facebook">Facebook</a> | <a href="http://www.linkedin.com/in/saeid" title="Saeid Zebardast On LinkedIn">LinkedIn</a> | <a href="https://plus.google.com/112638433061122581433" title="Saeid Zebardast On Google+">Google+</a> | <a href="http://zebardast.ir/en/author/admin/" title="More Posts By Saeid Zebardast">More Posts (31)</a></small></div></div><p><a class="a2a_button_google_plus" href="http://www.addtoany.com/add_to/google_plus?linkurl=http%3A%2F%2Fzebardast.ir%2Fen%2Ftv-show-sefroyek-open-source-operating-systems%2F&amp;linkname=TV%20show%20%26%238220%3BSefroYek%26%238221%3B%3A%20%26%238220%3BOpen%20Source%20operating%20systems%26%238221%3B" title="Google+" rel="nofollow" target="_blank"><img src="http://zebardast.ir/en/wp-content/plugins/add-to-any/icons/google.png" width="16" height="16" alt="Google+"/></a><a class="a2a_button_facebook" href="http://www.addtoany.com/add_to/facebook?linkurl=http%3A%2F%2Fzebardast.ir%2Fen%2Ftv-show-sefroyek-open-source-operating-systems%2F&amp;linkname=TV%20show%20%26%238220%3BSefroYek%26%238221%3B%3A%20%26%238220%3BOpen%20Source%20operating%20systems%26%238221%3B" title="Facebook" rel="nofollow" target="_blank"><img src="http://zebardast.ir/en/wp-content/plugins/add-to-any/icons/facebook.png" width="16" height="16" alt="Facebook"/></a><a class="a2a_button_twitter" href="http://www.addtoany.com/add_to/twitter?linkurl=http%3A%2F%2Fzebardast.ir%2Fen%2Ftv-show-sefroyek-open-source-operating-systems%2F&amp;linkname=TV%20show%20%26%238220%3BSefroYek%26%238221%3B%3A%20%26%238220%3BOpen%20Source%20operating%20systems%26%238221%3B" title="Twitter" rel="nofollow" target="_blank"><img src="http://zebardast.ir/en/wp-content/plugins/add-to-any/icons/twitter.png" width="16" height="16" alt="Twitter"/></a><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fzebardast.ir%2Fen%2Ftv-show-sefroyek-open-source-operating-systems%2F&amp;title=TV%20show%20%26%238220%3BSefroYek%26%238221%3B%3A%20%26%238220%3BOpen%20Source%20operating%20systems%26%238221%3B" id="wpa2a_12"><span style='display:none'>Share</span></a></p><p>No related posts.</p>]]></content:encoded> <wfw:commentRss>http://zebardast.ir/en/tv-show-sefroyek-open-source-operating-systems/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Fetch full posts content of FeedWordPress feeds</title><link>http://zebardast.ir/en/fetch-full-posts-content-of-feedwordpress-feeds/</link> <comments>http://zebardast.ir/en/fetch-full-posts-content-of-feedwordpress-feeds/#comments</comments> <pubDate>Mon, 05 Jul 2010 03:57:59 +0000</pubDate> <dc:creator>Saeid Zebardast</dc:creator> <category><![CDATA[howto]]></category> <category><![CDATA[PHP]]></category> <category><![CDATA[FeedWordPress]]></category> <category><![CDATA[wordpress]]></category><guid isPermaLink="false">http://zebardast.ir/en/?p=115</guid> <description><![CDATA[Hi I use WordPress and FeedWordPress plugin to create a planet. It&#8217;s great plugin. Some bloggers don&#8217;t show full post content on their feeds. If you like to get the full content of posts, you can contact to blogger and ask his/her to enable full content on the feed or continue to read this article. [...] No related posts.]]></description> <content:encoded><![CDATA[<p>Hi <img src='http://zebardast.ir/en/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /></p><p>I use <a href="http://wordpress.org/">WordPress</a> and <a href="http://feedwordpress.radgeek.com/">FeedWordPress</a> plugin to create a <a href="Planet (software)?phpMyAdmin=0OE6BojXhWUIhS49ohu1lcDd6Ab">planet</a>. It&#8217;s great plugin. Some bloggers don&#8217;t show full post content on their feeds. If you like to get the full content of posts, you can contact to blogger and ask his/her to enable full content on the feed or continue to read this article.<br /> I create functions to get full content of posts.</p><p><strong>Requirement</strong></p><ul><li>PHP with cURL support (Client URL Library)</li><li>Permissions to modify theme files</li><li>Text editor</li><li>basic php programming skills</li></ul><p><strong>Step 1 &#8211; Where is post content?</strong><br /> It&#8217;s easy. just open the web page and see the page source.<br /> For example, open <a href="http://zebardast.ir/en/linux-and-unix-bash-shell-aliases/">http://zebardast.ir/en/linux-and-unix-bash-shell-aliases/</a> (Single post with full content) and see the page source.<br /> On the page source you can see the content which is started by below code:</p><pre>&lt;div  class="postBody"&gt;</pre><p>and ended by  :</p><pre>			&lt;/div&gt; 

						&lt;div class="postFooter"&gt;</pre><p>* It&#8217;s not ended only by &lt;/div&gt; because there is some divs on post content. So I add some html code after &lt;/div&gt; which is unique.</p><p><strong>Step 2 &#8211; Add started and ended code to `Custom Feed Settings`</strong><br /> Open the wordpress administration panel and go to the `Feed and Update Settings` page. Select the feed from  drop down menu (Here `Saeid Zebardast&#8217;s Blog`).<br /> Add started and ended code to `Custom Feed Settings`:</p><div class="autocap aligncenter" style="width: 300px;"><div><a href="http://zebardast.ir/en/wp-content/uploads/2010/07/Add-started-and-ended-code-to-Custom-Feed-Settings.png"><img src="http://zebardast.ir/en/wp-content/uploads/2010/07/Add-started-and-ended-code-to-Custom-Feed-Settings-300x131.png" alt="" title="Add started and ended code to `Custom Feed Settings`" width="300" height="131" class=" size-medium wp-image-116" /></a><p class="autocap-text"><span class="hide">— </span>Add started and ended code to `Custom Feed Settings`</p></div></div><p><strong>Step 3 &#8211; Fetch full content from source and update post on wordpress</strong><br /> Open functions.php in text editor and add the below codes to the end of it:</p><pre>
&lt;?php
function validLink($link) {
    if(preg_match('|^http(s)?://[a-z0-9-]+(.[a-z0-9-]+)*(:[0-9]+)?(/.*)?$|i', $link)) {
        return true;
    } else {
        return false;
    }
}

/**
 * Get a web file (HTML, XHTML, XML, image, etc.) from a URL.  Return an
 * array containing the HTTP server response header fields and content.
 */
function get_web_page( $url )
{
    $options = array(
        CURLOPT_RETURNTRANSFER => true,     // return web page
        CURLOPT_HEADER         => false,    // don't return headers
        CURLOPT_FOLLOWLOCATION => false,     // follow redirects
        CURLOPT_ENCODING       => "",       // handle all encodings
        CURLOPT_USERAGENT      => "ayy.ir spider", // who am i
        CURLOPT_AUTOREFERER    => true,     // set referer on redirect
        CURLOPT_CONNECTTIMEOUT => 120,      // timeout on connect
        CURLOPT_TIMEOUT        => 120,      // timeout on response
        CURLOPT_MAXREDIRS      => 10,       // stop after 10 redirects
    );

    $ch      = curl_init( $url );
    curl_setopt_array( $ch, $options );
    $content = curl_exec( $ch );
    $err     = curl_errno( $ch );
    $errmsg  = curl_error( $ch );
    $header  = curl_getinfo( $ch );
    curl_close( $ch );

    $header['errno']   = $err;
    $header['errmsg']  = $errmsg;
    $header['content'] = $content;
    return $header;
}

function before ($this, $inthat)
{
    return substr($inthat, 0, strpos($inthat, $this));
}; 

function after ($this, $inthat)
{
    if (!is_bool(strpos($inthat, $this)))
    return substr($inthat, strpos($inthat,$this)+strlen($this));
}; 

function multi_between($this, $that, $inthat)
{
   $counter = 0;
   while ($inthat)
   {
      $counter++;
      $elements[$counter] = before($that, $inthat);
      $elements[$counter] = after($this, $elements[$counter]);
      $inthat = after($that, $inthat);
   }
   return $elements;
} 

function strbet($inputStr, $delimeterLeft, $delimeterRight, $debug=false) {
    $posLeft=strpos($inputStr, $delimeterLeft);

    if ( $debug ) {
    	echo $posLeft;
    }

    if ( $posLeft===false ) {
        if ( $debug ) {
            echo "Warning: left delimiter '{$delimeterLeft}' not found";
        }
        return false;
    }
    $posLeft+=strlen($delimeterLeft);
    $posRight=strpos($inputStr, $delimeterRight, $posLeft);
    if ( $posRight===false ) {
        if ( $debug ) {
            echo "Warning: right delimiter '{$delimeterRight}' not found";
        }
        return false;
    }

    if ( $debug ) {
    	echo $posLeft;
    	echo $posRight;
    }

    return substr($inputStr, $posLeft, $posRight-$posLeft);
} 

?&gt;
</pre><p>Close functions.php and open single.php in text editor. Add the below codes after `&lt;?php if (have_posts()) : while (have_posts()) : the_post(); ?&gt;`:</p><pre>
&lt;?php
	 $my_content = get_the_content();
	 if (is_syndicated()) :

      	$syndication_permalink = get_post_meta(get_the_ID(),"syndication_permalink", true);
      	$syndication_source = get_post_meta(get_the_ID(),"syndication_source", true);
      	$syndication_source_uri = get_post_meta(get_the_ID(),"syndication_source_uri", true);

      	if (!validLink($syndication_permalink) &#038;&#038; validLink($syndication_source_uri)) {
      		$syndication_permalink = $syndication_source_uri . "/" . $syndication_permalink;
      	}

	 		$post_updated = get_post_meta(get_the_ID(),"post_updated", true);
	 		if (empty($post_updated) || $post_updated == false)  {

		      $start_content = get_feed_meta('start_content');
		      $end_content = get_feed_meta('end_content');

		      if (!empty ($start_content) &#038;&#038; !empty($end_content)) {
		      	$result = get_web_page($syndication_permalink);
		      	$my_page = $result['content'];

		      	if (!empty($my_page)) {
		      		$valid_texts = array();
		      		$valid_texts = strbet($my_page, $start_content, $end_content);
				if (is_array($valid_texts)) {
					$valid_texts = $valid_texts[0];
				}

		      		if (!empty($valid_texts)) {
		      			$my_post = array();
		      			$my_post['ID'] = get_the_ID();
		      			$my_post['post_content'] = $valid_texts;
		      			$my_content = $valid_texts;
		      			wp_update_post($my_post);
		      			update_post_meta(get_the_ID(), 'post_updated', true);
		      		}
		      	}
		      }
	 		}

	 endif; //is_syndicated()
  ?&gt;
</pre><p>After it, replace `the_content()` with:</p><pre> echo $my_content; </pre><p>Close text editor and Upload functions.php and single.php to your theme folder. Now go to the single post and see the full content.<br /> <em>Just try it!</em></p><p><strong>See also</strong><br /> • <a href="http://feedwordpress.radgeek.com/wiki/how-do-i-get-feedwordpress-include-full-content-posts-instead-just-short-summary-or-excerpt-tex">How do I get FeedWordPress to include the full content of posts, instead of just a short summary or excerpt of the text?</a></p><p><strong>External links</strong><br /> • <a href="http://wordpress.org/">WordPress</a><br /> • <a href="http://feedwordpress.radgeek.com/">FeedWordPress</a> (Homepage)<br /> • <a href="http://wordpress.org/extend/plugins/feedwordpress/">FeedWordPress</a> (WordPress plugin directory)<br /> • <a href="http://www.php.net/manual/en/book.curl.php">Client URL Library</a></p><p>Good luck <img src='http://zebardast.ir/en/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /></p><div class="wp-biographia-container-top" style="background-color:#FFEAA8;"><div class="wp-biographia-pic"><img alt='' src='http://1.gravatar.com/avatar/1518e6b905d65cbe0a03243a199e18fc?s=100&amp;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D100&amp;r=G' class='avatar avatar-100 photo' height='100' width='100' /></div><div class="wp-biographia-text"><h3>About <a href="http://zebardast.ir/en/author/admin/" title="Saeid Zebardast">Saeid Zebardast</a></h3><p>I'm Senior software engineer with 5+ years of professional experience includes cross-platform proficiency with considerable knowledge of programming languages especially Java and programming paradigms such as OO and development methodologies. Also I'm MySQL DBA since 2006.</p><small><a href="mailto:&#115;ae&#105;&#100;&#46;&#122;&#101;&#98;&#97;&#114;d&#97;s&#116;&#64;&#103;mail.com" title="Send Saeid Zebardast Mail">Mail</a> | <a href="http://zebardast.ir/" title="Saeid Zebardast On The Web">Web</a> | <a href="https://twitter.com/#!/saeid" title="Saeid Zebardast On Twitter">Twitter</a> | <a href="https://www.facebook.com/saeid.zebardast" title="Saeid Zebardast On Facebook">Facebook</a> | <a href="http://www.linkedin.com/in/saeid" title="Saeid Zebardast On LinkedIn">LinkedIn</a> | <a href="https://plus.google.com/112638433061122581433" title="Saeid Zebardast On Google+">Google+</a> | <a href="http://zebardast.ir/en/author/admin/" title="More Posts By Saeid Zebardast">More Posts (31)</a></small></div></div><p><a class="a2a_button_google_plus" href="http://www.addtoany.com/add_to/google_plus?linkurl=http%3A%2F%2Fzebardast.ir%2Fen%2Ffetch-full-posts-content-of-feedwordpress-feeds%2F&amp;linkname=Fetch%20full%20posts%20content%20of%20FeedWordPress%20feeds" title="Google+" rel="nofollow" target="_blank"><img src="http://zebardast.ir/en/wp-content/plugins/add-to-any/icons/google.png" width="16" height="16" alt="Google+"/></a><a class="a2a_button_facebook" href="http://www.addtoany.com/add_to/facebook?linkurl=http%3A%2F%2Fzebardast.ir%2Fen%2Ffetch-full-posts-content-of-feedwordpress-feeds%2F&amp;linkname=Fetch%20full%20posts%20content%20of%20FeedWordPress%20feeds" title="Facebook" rel="nofollow" target="_blank"><img src="http://zebardast.ir/en/wp-content/plugins/add-to-any/icons/facebook.png" width="16" height="16" alt="Facebook"/></a><a class="a2a_button_twitter" href="http://www.addtoany.com/add_to/twitter?linkurl=http%3A%2F%2Fzebardast.ir%2Fen%2Ffetch-full-posts-content-of-feedwordpress-feeds%2F&amp;linkname=Fetch%20full%20posts%20content%20of%20FeedWordPress%20feeds" title="Twitter" rel="nofollow" target="_blank"><img src="http://zebardast.ir/en/wp-content/plugins/add-to-any/icons/twitter.png" width="16" height="16" alt="Twitter"/></a><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fzebardast.ir%2Fen%2Ffetch-full-posts-content-of-feedwordpress-feeds%2F&amp;title=Fetch%20full%20posts%20content%20of%20FeedWordPress%20feeds" id="wpa2a_14"><span style='display:none'>Share</span></a></p><p>No related posts.</p>]]></content:encoded> <wfw:commentRss>http://zebardast.ir/en/fetch-full-posts-content-of-feedwordpress-feeds/feed/</wfw:commentRss> <slash:comments>22</slash:comments> </item> <item><title>Installing Sun JDK 5 on Ubuntu 9.10 and 10.04</title><link>http://zebardast.ir/en/installing-sun-jdk-5-on-ubuntu-9-10-and-10-04/</link> <comments>http://zebardast.ir/en/installing-sun-jdk-5-on-ubuntu-9-10-and-10-04/#comments</comments> <pubDate>Mon, 03 May 2010 02:21:19 +0000</pubDate> <dc:creator>Saeid Zebardast</dc:creator> <category><![CDATA[Java]]></category> <category><![CDATA[Tips]]></category> <category><![CDATA[Ubuntu]]></category><guid isPermaLink="false">http://zebardast.ir/en/?p=107</guid> <description><![CDATA[Hello As you known, Sun JDK version 1.5 or 5 is deleted from Ubuntu 10.4 and 9.10 repositories and the version 6 has been replaced. The easiest way to install Sun JDK 5 version is add its repository from Ubuntu 9.04 to the list of repositories in 9.10 and 10.04. For this purpose, follow the [...] Related posts:<ol><li><a href='http://zebardast.ir/en/webmin-installing-on-ubuntu-gutsy-gibbon-710/' rel='bookmark' title='Webmin, Installing on Ubuntu Gutsy Gibbon (7.10)'>Webmin, Installing on Ubuntu Gutsy Gibbon (7.10)</a></li><li><a href='http://zebardast.ir/en/how-to-install-gos-on-ubuntu-gutsy-gibbon/' rel='bookmark' title='How to install gOS on Ubuntu Gutsy Gibbon'>How to install gOS on Ubuntu Gutsy Gibbon</a></li><li><a href='http://zebardast.ir/en/root-terminal-in-ubuntu/' rel='bookmark' title='Root Terminal in Ubuntu'>Root Terminal in Ubuntu</a></li></ol>]]></description> <content:encoded><![CDATA[<p>Hello <img src='http://zebardast.ir/en/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /></p><p>As you known, Sun <abbr title="Java Development Kit">JDK</abbr> version 1.5 or 5  is deleted from Ubuntu 10.4 and 9.10 repositories and the version 6 has been replaced.</p><p>The easiest way to install Sun JDK 5 version is add its repository from Ubuntu 9.04 to the list of repositories in  9.10 and 10.04. For this purpose, follow the steps.</p><p>1- Open /etc/apt/sources.list with a text editor like gedit:</p><pre>sudo gedit /etc/apt/sources.list</pre><p>2- Add the following lines to the end of the file then save it and close:</p><pre>  ## For sun-java5-jdk
 deb http://ir.archive.ubuntu.com/ubuntu jaunty-updates main multiverse</pre><p>3- Update the packages lists and install sun-java5-jdk:</p><pre> sudo aptitude update
 sudo aptitude install sun-java5-jdk</pre><p><em>* Above method can be used for other applications.</em></p><p>Another way to install jdk 5 is download software package and its dependencies from <a href="http://packages.ubuntu.com">packages.ubuntu.com</a>.</p><p>Good luck</p><div class="wp-biographia-container-top" style="background-color:#FFEAA8;"><div class="wp-biographia-pic"><img alt='' src='http://1.gravatar.com/avatar/1518e6b905d65cbe0a03243a199e18fc?s=100&amp;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D100&amp;r=G' class='avatar avatar-100 photo' height='100' width='100' /></div><div class="wp-biographia-text"><h3>About <a href="http://zebardast.ir/en/author/admin/" title="Saeid Zebardast">Saeid Zebardast</a></h3><p>I'm Senior software engineer with 5+ years of professional experience includes cross-platform proficiency with considerable knowledge of programming languages especially Java and programming paradigms such as OO and development methodologies. Also I'm MySQL DBA since 2006.</p><small><a href="mailto:s&#97;ei&#100;&#46;z&#101;&#98;ar&#100;&#97;s&#116;&#64;gmai&#108;&#46;&#99;&#111;&#109;" title="Send Saeid Zebardast Mail">Mail</a> | <a href="http://zebardast.ir/" title="Saeid Zebardast On The Web">Web</a> | <a href="https://twitter.com/#!/saeid" title="Saeid Zebardast On Twitter">Twitter</a> | <a href="https://www.facebook.com/saeid.zebardast" title="Saeid Zebardast On Facebook">Facebook</a> | <a href="http://www.linkedin.com/in/saeid" title="Saeid Zebardast On LinkedIn">LinkedIn</a> | <a href="https://plus.google.com/112638433061122581433" title="Saeid Zebardast On Google+">Google+</a> | <a href="http://zebardast.ir/en/author/admin/" title="More Posts By Saeid Zebardast">More Posts (31)</a></small></div></div><p><a class="a2a_button_google_plus" href="http://www.addtoany.com/add_to/google_plus?linkurl=http%3A%2F%2Fzebardast.ir%2Fen%2Finstalling-sun-jdk-5-on-ubuntu-9-10-and-10-04%2F&amp;linkname=Installing%20Sun%20JDK%205%20on%20Ubuntu%209.10%20and%2010.04" title="Google+" rel="nofollow" target="_blank"><img src="http://zebardast.ir/en/wp-content/plugins/add-to-any/icons/google.png" width="16" height="16" alt="Google+"/></a><a class="a2a_button_facebook" href="http://www.addtoany.com/add_to/facebook?linkurl=http%3A%2F%2Fzebardast.ir%2Fen%2Finstalling-sun-jdk-5-on-ubuntu-9-10-and-10-04%2F&amp;linkname=Installing%20Sun%20JDK%205%20on%20Ubuntu%209.10%20and%2010.04" title="Facebook" rel="nofollow" target="_blank"><img src="http://zebardast.ir/en/wp-content/plugins/add-to-any/icons/facebook.png" width="16" height="16" alt="Facebook"/></a><a class="a2a_button_twitter" href="http://www.addtoany.com/add_to/twitter?linkurl=http%3A%2F%2Fzebardast.ir%2Fen%2Finstalling-sun-jdk-5-on-ubuntu-9-10-and-10-04%2F&amp;linkname=Installing%20Sun%20JDK%205%20on%20Ubuntu%209.10%20and%2010.04" title="Twitter" rel="nofollow" target="_blank"><img src="http://zebardast.ir/en/wp-content/plugins/add-to-any/icons/twitter.png" width="16" height="16" alt="Twitter"/></a><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fzebardast.ir%2Fen%2Finstalling-sun-jdk-5-on-ubuntu-9-10-and-10-04%2F&amp;title=Installing%20Sun%20JDK%205%20on%20Ubuntu%209.10%20and%2010.04" id="wpa2a_16"><span style='display:none'>Share</span></a></p><p>Related posts:<ol><li><a href='http://zebardast.ir/en/webmin-installing-on-ubuntu-gutsy-gibbon-710/' rel='bookmark' title='Webmin, Installing on Ubuntu Gutsy Gibbon (7.10)'>Webmin, Installing on Ubuntu Gutsy Gibbon (7.10)</a></li><li><a href='http://zebardast.ir/en/how-to-install-gos-on-ubuntu-gutsy-gibbon/' rel='bookmark' title='How to install gOS on Ubuntu Gutsy Gibbon'>How to install gOS on Ubuntu Gutsy Gibbon</a></li><li><a href='http://zebardast.ir/en/root-terminal-in-ubuntu/' rel='bookmark' title='Root Terminal in Ubuntu'>Root Terminal in Ubuntu</a></li></ol></p>]]></content:encoded> <wfw:commentRss>http://zebardast.ir/en/installing-sun-jdk-5-on-ubuntu-9-10-and-10-04/feed/</wfw:commentRss> <slash:comments>25</slash:comments> </item> <item><title>How to find hardware information from command line on Linux</title><link>http://zebardast.ir/en/find-and-show-hardware-information-from-command-line-on-linux/</link> <comments>http://zebardast.ir/en/find-and-show-hardware-information-from-command-line-on-linux/#comments</comments> <pubDate>Mon, 01 Mar 2010 14:25:26 +0000</pubDate> <dc:creator>Saeid Zebardast</dc:creator> <category><![CDATA[GNU/Linux]]></category> <category><![CDATA[howto]]></category> <category><![CDATA[Terminal]]></category> <category><![CDATA[cli]]></category> <category><![CDATA[hardware]]></category><guid isPermaLink="false">http://zebardast.ir/en/?p=94</guid> <description><![CDATA[— linux Hi In this post you can see some useful command to find and show hardware information on Linux. Default commands ALL devices dmesg dmesg will show you the kernel messages which can show you all the devices the kernel has found (hard disks,cdroms,etc) CPU # cat /proc/cpuinfo Memory # cat /proc/meminfo $ free [...] Related posts:<ol><li><a href='http://zebardast.ir/en/linux-and-unix-bash-shell-aliases/' rel='bookmark' title='Linux and UNIX bash shell aliases'>Linux and UNIX bash shell aliases</a></li><li><a href='http://zebardast.ir/en/how-to-posting-to-identica-from-the-cli/' rel='bookmark' title='How to posting to Identi.ca from the CLI'>How to posting to Identi.ca from the CLI</a></li><li><a href='http://zebardast.ir/en/how-to-get-special-lines-data-from-file-linux/' rel='bookmark' title='How to get special lines data from file (Linux)'>How to get special lines data from file (Linux)</a></li></ol>]]></description> <content:encoded><![CDATA[<div style="float:right"><div class="autocap " style="width: 48px;"><div><img class=" size-full wp-image-873" width="48" height="48" title="linux" alt="linux" src="http://zebardast.ir/wp-content/uploads/2009/11/linux48.gif"/><p class="autocap-text"><span class="hide">— </span>linux</p></div></div></div><p>Hi</p><p>In this post you can see some useful command to find and show hardware information on Linux.</p><h3>Default commands</h3><h4>ALL devices</h4><pre>dmesg</pre><p>dmesg will show you the kernel messages which can show you all the devices the kernel has found (hard disks,cdroms,etc)</p><h4>CPU</h4><pre># cat /proc/cpuinfo</pre><h4>Memory</h4><pre># cat /proc/meminfo
$ free
</pre><h4>PCI (including usb bridges,agp cards etc)</h4><pre>$ lspci</pre><h4>USB devices (mice,etc)</h4><pre>$ lsusb</pre><h4>Hard drives</h4><pre># fdisk -l
$ df -h
</pre><h3>Additional Command</h3><h4>lshw</h4><p>lshw is a Linux command which provides details of all the hardware in your PC. The details provided by the lshw command run the gamut of processors, memory, slots, onboard sound, video chipset and more.</p><h5>Install lshw</h5><p>Arch:</p><pre># pacman -S lshw</pre><p>Debain, Ubuntu or any of its derivatives:</p><pre>$ sudo aptitude install lshw</pre><p>Redhat, fedora, CentOS:</p><pre># yum install lshw</pre><p>Gentoo:</p><pre># emerge lshw</pre><h5>Run lshw</h5><pre># lshw
# lshw -short</pre><p>To get the output in HTML, you use the -html option as follows:</p><pre># lshw -html > hardware-info.html</pre><p>• See <a href="http://linuxandfriends.com/2009/02/23/lshw-command-list-hardware-information-in-linux/">lshw command – List hardware information in Linux </a></p><h4>dmidecode</h4><p>dmidecode command reads the system DMI table to display hardware and BIOS information of the server. Apart from getting current configuration of the system, you can also get information about maximum supported configuration of the system using dmidecode. For example, dmidecode gives both the current RAM on the system and the maximum RAM supported by the system.<br /> dmidecode is installed by default on many linux distribution like debain, ubuntu and fedora.<br /> • See <a href="http://www.thegeekstuff.com/2008/11/how-to-get-hardware-information-on-linux-using-dmidecode-command/">How To Get Hardware Information On Linux Using dmidecode Command</a></p><p>have a good time <img src='http://zebardast.ir/en/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /></p><div class="wp-biographia-container-top" style="background-color:#FFEAA8;"><div class="wp-biographia-pic"><img alt='' src='http://1.gravatar.com/avatar/1518e6b905d65cbe0a03243a199e18fc?s=100&amp;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D100&amp;r=G' class='avatar avatar-100 photo' height='100' width='100' /></div><div class="wp-biographia-text"><h3>About <a href="http://zebardast.ir/en/author/admin/" title="Saeid Zebardast">Saeid Zebardast</a></h3><p>I'm Senior software engineer with 5+ years of professional experience includes cross-platform proficiency with considerable knowledge of programming languages especially Java and programming paradigms such as OO and development methodologies. Also I'm MySQL DBA since 2006.</p><small><a href="mailto:&#115;a&#101;&#105;&#100;.&#122;e&#98;ar&#100;&#97;&#115;t&#64;&#103;&#109;a&#105;&#108;&#46;&#99;o&#109;" title="Send Saeid Zebardast Mail">Mail</a> | <a href="http://zebardast.ir/" title="Saeid Zebardast On The Web">Web</a> | <a href="https://twitter.com/#!/saeid" title="Saeid Zebardast On Twitter">Twitter</a> | <a href="https://www.facebook.com/saeid.zebardast" title="Saeid Zebardast On Facebook">Facebook</a> | <a href="http://www.linkedin.com/in/saeid" title="Saeid Zebardast On LinkedIn">LinkedIn</a> | <a href="https://plus.google.com/112638433061122581433" title="Saeid Zebardast On Google+">Google+</a> | <a href="http://zebardast.ir/en/author/admin/" title="More Posts By Saeid Zebardast">More Posts (31)</a></small></div></div><p><a class="a2a_button_google_plus" href="http://www.addtoany.com/add_to/google_plus?linkurl=http%3A%2F%2Fzebardast.ir%2Fen%2Ffind-and-show-hardware-information-from-command-line-on-linux%2F&amp;linkname=How%20to%20find%20hardware%20information%20from%20command%20line%20on%20Linux" title="Google+" rel="nofollow" target="_blank"><img src="http://zebardast.ir/en/wp-content/plugins/add-to-any/icons/google.png" width="16" height="16" alt="Google+"/></a><a class="a2a_button_facebook" href="http://www.addtoany.com/add_to/facebook?linkurl=http%3A%2F%2Fzebardast.ir%2Fen%2Ffind-and-show-hardware-information-from-command-line-on-linux%2F&amp;linkname=How%20to%20find%20hardware%20information%20from%20command%20line%20on%20Linux" title="Facebook" rel="nofollow" target="_blank"><img src="http://zebardast.ir/en/wp-content/plugins/add-to-any/icons/facebook.png" width="16" height="16" alt="Facebook"/></a><a class="a2a_button_twitter" href="http://www.addtoany.com/add_to/twitter?linkurl=http%3A%2F%2Fzebardast.ir%2Fen%2Ffind-and-show-hardware-information-from-command-line-on-linux%2F&amp;linkname=How%20to%20find%20hardware%20information%20from%20command%20line%20on%20Linux" title="Twitter" rel="nofollow" target="_blank"><img src="http://zebardast.ir/en/wp-content/plugins/add-to-any/icons/twitter.png" width="16" height="16" alt="Twitter"/></a><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fzebardast.ir%2Fen%2Ffind-and-show-hardware-information-from-command-line-on-linux%2F&amp;title=How%20to%20find%20hardware%20information%20from%20command%20line%20on%20Linux" id="wpa2a_18"><span style='display:none'>Share</span></a></p><p>Related posts:<ol><li><a href='http://zebardast.ir/en/linux-and-unix-bash-shell-aliases/' rel='bookmark' title='Linux and UNIX bash shell aliases'>Linux and UNIX bash shell aliases</a></li><li><a href='http://zebardast.ir/en/how-to-posting-to-identica-from-the-cli/' rel='bookmark' title='How to posting to Identi.ca from the CLI'>How to posting to Identi.ca from the CLI</a></li><li><a href='http://zebardast.ir/en/how-to-get-special-lines-data-from-file-linux/' rel='bookmark' title='How to get special lines data from file (Linux)'>How to get special lines data from file (Linux)</a></li></ol></p>]]></content:encoded> <wfw:commentRss>http://zebardast.ir/en/find-and-show-hardware-information-from-command-line-on-linux/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Synchronizing Google Tools with Kontact</title><link>http://zebardast.ir/en/synchronizing-google-tools-with-kontact/</link> <comments>http://zebardast.ir/en/synchronizing-google-tools-with-kontact/#comments</comments> <pubDate>Mon, 16 Nov 2009 08:34:12 +0000</pubDate> <dc:creator>Saeid Zebardast</dc:creator> <category><![CDATA[howto]]></category> <category><![CDATA[Kubuntu]]></category> <category><![CDATA[akonadi]]></category> <category><![CDATA[google]]></category> <category><![CDATA[KDE]]></category> <category><![CDATA[kmail]]></category> <category><![CDATA[korganizer]]></category> <category><![CDATA[Synchronization]]></category><guid isPermaLink="false">http://zebardast.ir/en/?p=82</guid> <description><![CDATA[Hello Introduction Using online tools has many advantages. One of the most important of them is the information is accessible from anywhere and at any time. One need that was occurred after using this tools is Synchronizing information with other applications and devices. such as Synchronizing contacts between Mobile, Web and PC. * The following [...] No related posts.]]></description> <content:encoded><![CDATA[<p>Hello <img src='http://zebardast.ir/en/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /></p><p><strong>Introduction</strong><br /> Using online tools has many advantages. One of the most important of them is the information is accessible from anywhere and at any time.<br /> One need that was occurred after using this tools is Synchronizing information with other applications and devices. such as Synchronizing contacts between Mobile, Web and PC.</p><p><em>* The following guide is tested on Kubuntu 9.10 with KDE 4.3.3 environment.</em></p><p><strong>Synchronizing Google Tools with Kontact</strong><br /> <em>Step 1</em><br /> Installing akonadi-kde-resource-googledata package. The package is available in Ubuntu 9.10 and Debian repositories.</p><pre>sudo aptitude install akonadi-kde-resource-googledata</pre><p><em>Step 2</em><br /> After installing akonadi-kde-resource-googledata package, you need to add Google resources to Akonadi. Open Akonadi Console:</p><pre>akonadiconsole</pre><p>Click Add on Agents tab. Add a `Akonadi Google Calendar Resource` for Google Calendar  and add `Akonadi Google Contacts Resource` for Google Contacts.</p><div class="autocap " style="width: 300px;"><div><a href="http://zebardast.ir/wp-content/uploads/2009/11/akonadi-console-google-resource.png"><img class="size-medium wp-image-904" title="Add Google Resources to Akonadi Console" src="http://zebardast.ir/wp-content/uploads/2009/11/akonadi-console-google-resource-300x196.png" alt="Add Google Resources to Akonadi Console" width="300" height="196" /></a><p class="autocap-text"><span class="hide">— </span>Add Google Resources to Akonadi Console</p></div></div><p>Enter your username without `@gmail.com`  in the next window.</p><div class="autocap aligncenter" style="width: 300px;"><div><a href="http://zebardast.ir/wp-content/uploads/2009/11/akonadi-console-google-resource-2.png"><img class=" size-medium wp-image-907" title="Enter your username" src="http://zebardast.ir/wp-content/uploads/2009/11/akonadi-console-google-resource-2-300x170.png" alt="Enter your username" width="300" height="170" /></a><p class="autocap-text"><span class="hide">— </span>Enter your username</p></div></div><p><em>Step 3</em><br /> After adding a resources open Kontact application :</p><pre>kontact</pre><p><strong>Add Contacts</strong><br /> Go to Contact section and add `Akonadi Google Resource` to address books:</p><div class="autocap aligncenter" style="width: 300px;"><div><a href="http://zebardast.ir/wp-content/uploads/2009/11/akonadi-console-google-resource-address-book.png"><img class=" size-medium wp-image-909" title="Add `Akonadi Google Resource` to Address Books" src="http://zebardast.ir/wp-content/uploads/2009/11/akonadi-console-google-resource-address-book-300x196.png" alt="Add `Akonadi Google Resource` to Address Books" width="300" height="196" /></a><p class="autocap-text"><span class="hide">— </span>Add `Akonadi Google Resource` to Address Books</p></div></div><p><strong>Add Calendar</strong><br /> Go to Calendar section and add `Akonadi Google Resource` to calendars:</p><div class="autocap aligncenter" style="width: 300px;"><div><a href="http://zebardast.ir/wp-content/uploads/2009/11/akonadi-console-google-resource-calendar.png"><img class=" size-medium wp-image-910" title="Add `Akonadi Google Resource` to calendars" src="http://zebardast.ir/wp-content/uploads/2009/11/akonadi-console-google-resource-calendar-300x197.png" alt="Add `Akonadi Google Resource` to calendars" width="300" height="197" /></a><p class="autocap-text"><span class="hide">— </span>Add `Akonadi Google Resource` to calendars</p></div></div><p>done <img src='http://zebardast.ir/en/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /></p><p><strong>P.S.</strong><br /> <a href="http://wiki.ubuntu.ir/KarmicKoalaReleaseParty">Ubuntu 9.10 release party held in Tehran, Iran</a>.</p><p>Have a good time <img src='http://zebardast.ir/en/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /></p><div class="wp-biographia-container-top" style="background-color:#FFEAA8;"><div class="wp-biographia-pic"><img alt='' src='http://1.gravatar.com/avatar/1518e6b905d65cbe0a03243a199e18fc?s=100&amp;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D100&amp;r=G' class='avatar avatar-100 photo' height='100' width='100' /></div><div class="wp-biographia-text"><h3>About <a href="http://zebardast.ir/en/author/admin/" title="Saeid Zebardast">Saeid Zebardast</a></h3><p>I'm Senior software engineer with 5+ years of professional experience includes cross-platform proficiency with considerable knowledge of programming languages especially Java and programming paradigms such as OO and development methodologies. Also I'm MySQL DBA since 2006.</p><small><a href="mailto:&#115;&#97;e&#105;d.&#122;&#101;&#98;a&#114;&#100;ast&#64;&#103;m&#97;&#105;l&#46;com" title="Send Saeid Zebardast Mail">Mail</a> | <a href="http://zebardast.ir/" title="Saeid Zebardast On The Web">Web</a> | <a href="https://twitter.com/#!/saeid" title="Saeid Zebardast On Twitter">Twitter</a> | <a href="https://www.facebook.com/saeid.zebardast" title="Saeid Zebardast On Facebook">Facebook</a> | <a href="http://www.linkedin.com/in/saeid" title="Saeid Zebardast On LinkedIn">LinkedIn</a> | <a href="https://plus.google.com/112638433061122581433" title="Saeid Zebardast On Google+">Google+</a> | <a href="http://zebardast.ir/en/author/admin/" title="More Posts By Saeid Zebardast">More Posts (31)</a></small></div></div><p><a class="a2a_button_google_plus" href="http://www.addtoany.com/add_to/google_plus?linkurl=http%3A%2F%2Fzebardast.ir%2Fen%2Fsynchronizing-google-tools-with-kontact%2F&amp;linkname=Synchronizing%20Google%20Tools%20with%20Kontact" title="Google+" rel="nofollow" target="_blank"><img src="http://zebardast.ir/en/wp-content/plugins/add-to-any/icons/google.png" width="16" height="16" alt="Google+"/></a><a class="a2a_button_facebook" href="http://www.addtoany.com/add_to/facebook?linkurl=http%3A%2F%2Fzebardast.ir%2Fen%2Fsynchronizing-google-tools-with-kontact%2F&amp;linkname=Synchronizing%20Google%20Tools%20with%20Kontact" title="Facebook" rel="nofollow" target="_blank"><img src="http://zebardast.ir/en/wp-content/plugins/add-to-any/icons/facebook.png" width="16" height="16" alt="Facebook"/></a><a class="a2a_button_twitter" href="http://www.addtoany.com/add_to/twitter?linkurl=http%3A%2F%2Fzebardast.ir%2Fen%2Fsynchronizing-google-tools-with-kontact%2F&amp;linkname=Synchronizing%20Google%20Tools%20with%20Kontact" title="Twitter" rel="nofollow" target="_blank"><img src="http://zebardast.ir/en/wp-content/plugins/add-to-any/icons/twitter.png" width="16" height="16" alt="Twitter"/></a><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fzebardast.ir%2Fen%2Fsynchronizing-google-tools-with-kontact%2F&amp;title=Synchronizing%20Google%20Tools%20with%20Kontact" id="wpa2a_20"><span style='display:none'>Share</span></a></p><p>No related posts.</p>]]></content:encoded> <wfw:commentRss>http://zebardast.ir/en/synchronizing-google-tools-with-kontact/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> </channel> </rss>
<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk: basic
Page Caching using disk: enhanced
Database Caching 40/100 queries in 0.026 seconds using disk: basic
Object Caching 4363/4447 objects using disk: basic

Served from: zebardast.ir @ 2012-05-22 01:28:00 -->
