<?xml version="1.0" encoding="utf-8" ?>
<?xml-stylesheet href="/templates/default-my/atom.css" type="text/css" ?>

<feed 
   xmlns="http://www.w3.org/2005/Atom"
   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
   xmlns:dc="http://purl.org/dc/elements/1.1/"
   xmlns:admin="http://webns.net/mvcb/"
   xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
   xmlns:wfw="http://wellformedweb.org/CommentAPI/">
    
    <link href="http://belsky.info/feeds/atom.xml" rel="self" title="Anatoliy Belsky" type="application/atom+xml" />
    <link href="http://belsky.info/"                        rel="alternate"    title="Anatoliy Belsky" type="text/html" />
    <link href="http://belsky.info/rss.php?version=2.0"     rel="alternate"    title="Anatoliy Belsky" type="application/rss+xml" />
    <title type="html">Anatoliy Belsky</title>
    <subtitle type="html">That's what I'm thinking ...  </subtitle>
    
    <id>http://belsky.info/</id>
    <updated>2011-10-20T13:19:31Z</updated>
    <generator uri="http://www.s9y.org/" version="1.5.5">Serendipity 1.5.5 - http://www.s9y.org/</generator>
    <dc:language>en</dc:language>

    <entry>
        <link href="http://belsky.info/archives/32-Serendipity-meets-Varnish.html" rel="alternate" title="Serendipity meets Varnish" />
        <author>
            <name>Anatoliy Belsky</name>
                    </author>
    
        <published>2011-10-13T20:24:30Z</published>
        <updated>2011-10-20T13:19:31Z</updated>
        <wfw:comment>http://belsky.info/wfwcomment.php?cid=32</wfw:comment>
    
        <slash:comments>2</slash:comments>
        <wfw:commentRss>http://belsky.info/rss.php?version=atom1.0&amp;type=comments&amp;cid=32</wfw:commentRss>
    
            <category scheme="http://belsky.info/categories/7-Linux" label="Linux" term="Linux" />
            <category scheme="http://belsky.info/categories/8-Web" label="Web" term="Web" />
    
        <id>http://belsky.info/archives/32-guid.html</id>
        <title type="html">Serendipity meets Varnish</title>
        <content type="xhtml" xml:base="http://belsky.info/">
            <div xmlns="http://www.w3.org/1999/xhtml">
                I've been using Serendipity for a couple of years and really love it now. But sometimes I wish it could be faster. Different servers tell a difference, but an average generation time for example for one category listing with 15 entries takes about 5 seconds or more. So I couldn't wait any longer, since I've learned Varnish Cache, to toggle it between Serendipity and the end user. Of course, Varnish would limit some blogging features, but the benefits will be worth of that. Sounds interesting? So this article is for you.<br />
<br />
 <br /><a href="http://belsky.info/archives/32-Serendipity-meets-Varnish.html#extended">Continue reading "Serendipity meets Varnish"</a>
            </div>
        </content>
        
    </entry>
    <entry>
        <link href="http://belsky.info/archives/31-SquirrelMail-Change-Password-Plugin.html" rel="alternate" title="SquirrelMail Change Password Plugin" />
        <author>
            <name>Anatoliy Belsky</name>
                    </author>
    
        <published>2011-10-02T10:17:38Z</published>
        <updated>2011-10-10T15:17:29Z</updated>
        <wfw:comment>http://belsky.info/wfwcomment.php?cid=31</wfw:comment>
    
        <slash:comments>0</slash:comments>
        <wfw:commentRss>http://belsky.info/rss.php?version=atom1.0&amp;type=comments&amp;cid=31</wfw:commentRss>
    
            <category scheme="http://belsky.info/categories/4-Bash" label="Bash" term="Bash" />
            <category scheme="http://belsky.info/categories/7-Linux" label="Linux" term="Linux" />
            <category scheme="http://belsky.info/categories/2-PHP5" label="PHP5" term="PHP5" />
            <category scheme="http://belsky.info/categories/8-Web" label="Web" term="Web" />
    
        <id>http://belsky.info/archives/31-guid.html</id>
        <title type="html">SquirrelMail Change Password Plugin</title>
        <content type="xhtml" xml:base="http://belsky.info/">
            <div xmlns="http://www.w3.org/1999/xhtml">
                A couple of years ago I've shared my expierience about how to setup <a href="http://belsky.info/archives/12-Postfix-+-Dovecot-SMTP-and-IMAP-on-Debian-Etch.html" title="Postfix+Dovecot">virtual mail hosting</a> with Postfix and Dovecot. Some time ago I needed to make that accessible via Web. So, a webmail.<br />
<br />
After trying a couple of engines I've decided in favour of <a href="http://squirrelmail.org/">SquirrelMail</a>. This worked like a charm with SSL, etc. so the full mailing functionality was available just out of the box. The one thing I was still missing was a possibility to change password. There are already several plugins to achieve the goal, for instance when logging in over LDAP, but nothing could really fit for me. That's because the maildir setup I'm using is non standard. Luckily, the SquirrelMail API is simple and just well documented, so I was able to write a custom change password plugin very fast.<br />
<br />
 <br /><a href="http://belsky.info/archives/31-SquirrelMail-Change-Password-Plugin.html#extended">Continue reading "SquirrelMail Change Password Plugin"</a>
            </div>
        </content>
        
    </entry>
    <entry>
        <link href="http://belsky.info/archives/30-Varnish-Cache-now-for-PHP-and-from-PHP.html" rel="alternate" title="Varnish Cache now for PHP and from PHP" />
        <author>
            <name>Anatoliy Belsky</name>
                    </author>
    
        <published>2011-08-23T20:34:58Z</published>
        <updated>2011-10-22T08:59:03Z</updated>
        <wfw:comment>http://belsky.info/wfwcomment.php?cid=30</wfw:comment>
    
        <slash:comments>0</slash:comments>
        <wfw:commentRss>http://belsky.info/rss.php?version=atom1.0&amp;type=comments&amp;cid=30</wfw:commentRss>
    
            <category scheme="http://belsky.info/categories/9-CC++" label="C/C++" term="C/C++" />
            <category scheme="http://belsky.info/categories/7-Linux" label="Linux" term="Linux" />
            <category scheme="http://belsky.info/categories/2-PHP5" label="PHP5" term="PHP5" />
            <category scheme="http://belsky.info/categories/1-PHP5-extentions" label="PHP5 extentions" term="PHP5 extentions" />
            <category scheme="http://belsky.info/categories/8-Web" label="Web" term="Web" />
    
        <id>http://belsky.info/archives/30-guid.html</id>
        <title type="html">Varnish Cache now for PHP and from PHP</title>
        <content type="xhtml" xml:base="http://belsky.info/">
            <div xmlns="http://www.w3.org/1999/xhtml">
                There is a new PHP extension I've written to work with Varnish. The extension allows interaction from within a PHP script with a running Varnish instance. For now there is a basic useful functionality such as ban URLs or set/get Varnish configuration. There will be more with the time. For now I would give a couple of examples for the extension usage, as there is not really any docs for the extension here. <br /><a href="http://belsky.info/archives/30-Varnish-Cache-now-for-PHP-and-from-PHP.html#extended">Continue reading "Varnish Cache now for PHP and from PHP"</a>
            </div>
        </content>
        
    </entry>
    <entry>
        <link href="http://belsky.info/archives/29-Using-great-Geonames-database-for-geographical-data-handling.html" rel="alternate" title="Using great Geonames database for geographical data handling" />
        <author>
            <name>Anatoliy Belsky</name>
                    </author>
    
        <published>2010-06-03T11:57:19Z</published>
        <updated>2010-06-03T13:51:06Z</updated>
        <wfw:comment>http://belsky.info/wfwcomment.php?cid=29</wfw:comment>
    
        <slash:comments>3</slash:comments>
        <wfw:commentRss>http://belsky.info/rss.php?version=atom1.0&amp;type=comments&amp;cid=29</wfw:commentRss>
    
            <category scheme="http://belsky.info/categories/4-Bash" label="Bash" term="Bash" />
            <category scheme="http://belsky.info/categories/7-Linux" label="Linux" term="Linux" />
            <category scheme="http://belsky.info/categories/3-PostgreSQL" label="PostgreSQL" term="PostgreSQL" />
            <category scheme="http://belsky.info/categories/8-Web" label="Web" term="Web" />
    
        <id>http://belsky.info/archives/29-guid.html</id>
        <title type="html">Using great Geonames database for geographical data handling</title>
        <content type="xhtml" xml:base="http://belsky.info/">
            <div xmlns="http://www.w3.org/1999/xhtml">
                This time I needed some geographical data evaluation for one of my current projects. The data used to be opensource and as possible qualitative and complete. After spending some time in front of the famous search engine window there was a solution: <br />
<br />
<a href="http://www.geonames.org/">http://www.geonames.org/</a><br />
<br />
That's the first sentence from the site:<br />
<br />
<blockquote>The GeoNames geographical database covers all countries and contains over eight million placenames that are available for download free of charge.</blockquote><br />
<br />
Geonames is used by number of sites. Besides data it has also web services and code libraries in many programming languages to access them. <br /><a href="http://belsky.info/archives/29-Using-great-Geonames-database-for-geographical-data-handling.html#extended">Continue reading "Using great Geonames database for geographical data handling"</a>
            </div>
        </content>
        
    </entry>
    <entry>
        <link href="http://belsky.info/archives/28-Turn-PHP-non-public-classobject-methods-available.html" rel="alternate" title="Turn PHP non public class/object methods available" />
        <author>
            <name>Anatoliy Belsky</name>
                    </author>
    
        <published>2009-09-17T20:46:02Z</published>
        <updated>2009-09-22T18:53:44Z</updated>
        <wfw:comment>http://belsky.info/wfwcomment.php?cid=28</wfw:comment>
    
        <slash:comments>5</slash:comments>
        <wfw:commentRss>http://belsky.info/rss.php?version=atom1.0&amp;type=comments&amp;cid=28</wfw:commentRss>
    
            <category scheme="http://belsky.info/categories/9-CC++" label="C/C++" term="C/C++" />
            <category scheme="http://belsky.info/categories/2-PHP5" label="PHP5" term="PHP5" />
            <category scheme="http://belsky.info/categories/1-PHP5-extentions" label="PHP5 extentions" term="PHP5 extentions" />
    
        <id>http://belsky.info/archives/28-guid.html</id>
        <title type="html">Turn PHP non public class/object methods available</title>
        <content type="xhtml" xml:base="http://belsky.info/">
            <div xmlns="http://www.w3.org/1999/xhtml">
                Anyone who did unit testing in PHP knows that private methods are untestable. One workaround for this could be to make no private but protected only members and to call methods using a proxy class. Another approach I'd like to present here is a small extension hack. <br /><a href="http://belsky.info/archives/28-Turn-PHP-non-public-classobject-methods-available.html#extended">Continue reading "Turn PHP non public class/object methods available"</a>
            </div>
        </content>
        
    </entry>
    <entry>
        <link href="http://belsky.info/archives/26-Making-server-side-playlist-with-PHP.html" rel="alternate" title="Making server side playlist with PHP" />
        <author>
            <name>Anatoliy Belsky</name>
                    </author>
    
        <published>2008-10-02T17:36:35Z</published>
        <updated>2008-10-02T18:18:19Z</updated>
        <wfw:comment>http://belsky.info/wfwcomment.php?cid=26</wfw:comment>
    
        <slash:comments>3</slash:comments>
        <wfw:commentRss>http://belsky.info/rss.php?version=atom1.0&amp;type=comments&amp;cid=26</wfw:commentRss>
    
            <category scheme="http://belsky.info/categories/7-Linux" label="Linux" term="Linux" />
            <category scheme="http://belsky.info/categories/2-PHP5" label="PHP5" term="PHP5" />
            <category scheme="http://belsky.info/categories/8-Web" label="Web" term="Web" />
    
        <id>http://belsky.info/archives/26-guid.html</id>
        <title type="html">Making server side playlist with PHP</title>
        <content type="xhtml" xml:base="http://belsky.info/">
            <div xmlns="http://www.w3.org/1999/xhtml">
                Hi again,<br />
<br />
whole last week I was mad about hearing music. I've heared tons of mp3's and radio stations over the internet.  After a couple of days hearing music at work and at home I was really bored with creating and syncronizing playlists/files. Based on this, I came to the idea to make an online playlist which I would must update only one time and in one place and it would be accessible from anywhere. The idea was easy brougth out with PHP. So just a light reading for you:<br />
<br />
 <br /><a href="http://belsky.info/archives/26-Making-server-side-playlist-with-PHP.html#extended">Continue reading "Making server side playlist with PHP"</a>
            </div>
        </content>
        
    </entry>
    <entry>
        <link href="http://belsky.info/archives/25-Gender-PHP-Extension.html" rel="alternate" title="Gender PHP Extension" />
        <author>
            <name>Anatoliy Belsky</name>
                    </author>
    
        <published>2008-08-24T19:25:41Z</published>
        <updated>2008-08-24T19:25:41Z</updated>
        <wfw:comment>http://belsky.info/wfwcomment.php?cid=25</wfw:comment>
    
        <slash:comments>1</slash:comments>
        <wfw:commentRss>http://belsky.info/rss.php?version=atom1.0&amp;type=comments&amp;cid=25</wfw:commentRss>
    
            <category scheme="http://belsky.info/categories/9-CC++" label="C/C++" term="C/C++" />
            <category scheme="http://belsky.info/categories/2-PHP5" label="PHP5" term="PHP5" />
            <category scheme="http://belsky.info/categories/1-PHP5-extentions" label="PHP5 extentions" term="PHP5 extentions" />
    
        <id>http://belsky.info/archives/25-guid.html</id>
        <title type="html">Gender PHP Extension</title>
        <content type="xhtml" xml:base="http://belsky.info/">
            <div xmlns="http://www.w3.org/1999/xhtml">
                Hi there,<br />
<br />
last week I wrote a PHP port for Joerg Michael's gender program. The program stands for gender recognition based on firstnames and has a base of >40000 firstnames from around the world. I hope the stuff is deserved to be accepted on PECL.<br />
<br />
 <br /><a href="http://belsky.info/archives/25-Gender-PHP-Extension.html#extended">Continue reading "Gender PHP Extension"</a>
            </div>
        </content>
        
    </entry>
    <entry>
        <link href="http://belsky.info/archives/23-Phurple-per-se-PHPurple.html" rel="alternate" title="Phurple - per se PHPurple" />
        <author>
            <name>Anatoliy Belsky</name>
                    </author>
    
        <published>2008-08-08T21:58:00Z</published>
        <updated>2012-01-01T17:38:53Z</updated>
        <wfw:comment>http://belsky.info/wfwcomment.php?cid=23</wfw:comment>
    
        <slash:comments>73</slash:comments>
        <wfw:commentRss>http://belsky.info/rss.php?version=atom1.0&amp;type=comments&amp;cid=23</wfw:commentRss>
    
            <category scheme="http://belsky.info/categories/9-CC++" label="C/C++" term="C/C++" />
            <category scheme="http://belsky.info/categories/7-Linux" label="Linux" term="Linux" />
            <category scheme="http://belsky.info/categories/2-PHP5" label="PHP5" term="PHP5" />
            <category scheme="http://belsky.info/categories/1-PHP5-extentions" label="PHP5 extentions" term="PHP5 extentions" />
    
        <id>http://belsky.info/archives/23-guid.html</id>
        <title type="html">Phurple - per se PHPurple</title>
        <content type="xhtml" xml:base="http://belsky.info/">
            <div xmlns="http://www.w3.org/1999/xhtml">
                Hey you all (and me too) web developers. The huge important news today is - now we can send IMs from a script running within a web server - isn't it cool? Only one restriction conditioned by libpurple itself is there - use is definitely safe within CGI environment only. The second important news, as you see from the title - the project was renamed to Phurple. Furthermore there are a couple essential changes I was made as refactoring of the code was written so far.<br />
<br />
Became interested? Lets look onto most important points in the changelog:<br />
<br />
 <br /><a href="http://belsky.info/archives/23-Phurple-per-se-PHPurple.html#extended">Continue reading "Phurple - per se PHPurple"</a>
            </div>
        </content>
        
    </entry>
    <entry>
        <link href="http://belsky.info/archives/22-PHPurple-v0.3-alpha-released.html" rel="alternate" title="PHPurple v0.3 alpha released" />
        <author>
            <name>Anatoliy Belsky</name>
                    </author>
    
        <published>2008-07-01T16:53:34Z</published>
        <updated>2008-07-07T07:14:19Z</updated>
        <wfw:comment>http://belsky.info/wfwcomment.php?cid=22</wfw:comment>
    
        <slash:comments>19</slash:comments>
        <wfw:commentRss>http://belsky.info/rss.php?version=atom1.0&amp;type=comments&amp;cid=22</wfw:commentRss>
    
            <category scheme="http://belsky.info/categories/9-CC++" label="C/C++" term="C/C++" />
            <category scheme="http://belsky.info/categories/7-Linux" label="Linux" term="Linux" />
            <category scheme="http://belsky.info/categories/2-PHP5" label="PHP5" term="PHP5" />
            <category scheme="http://belsky.info/categories/1-PHP5-extentions" label="PHP5 extentions" term="PHP5 extentions" />
    
        <id>http://belsky.info/archives/22-guid.html</id>
        <title type="html">PHPurple v0.3 alpha released</title>
        <content type="xhtml" xml:base="http://belsky.info/">
            <div xmlns="http://www.w3.org/1999/xhtml">
                So, new PHPurple version was issued yesterday and is downloadable from sf.net. What's inside:<br />
<br />
* PurpleAccount::isConnecting() added<br />
* PurpleAccount::getUserName() added<br />
* PurpleAccount::getPassword() added<br />
* PurpleClient::deleteAccount() added<br />
* PurpleClient::findAccount() added<br />
* PurpleClient::addAccount returns now a PurpleAccount instance (but was null)<br />
* PurpleClient::authorizeRequest() added<br />
<br />
The most interesting thing there is of course the remote client authorization. <br /><a href="http://belsky.info/archives/22-PHPurple-v0.3-alpha-released.html#extended">Continue reading "PHPurple v0.3 alpha released"</a>
            </div>
        </content>
        
    </entry>
    <entry>
        <link href="http://belsky.info/archives/21-Functions-vs.-inline-code.html" rel="alternate" title="Functions vs. inline code" />
        <author>
            <name>Anatoliy Belsky</name>
                    </author>
    
        <published>2008-06-22T14:56:22Z</published>
        <updated>2008-06-23T05:51:28Z</updated>
        <wfw:comment>http://belsky.info/wfwcomment.php?cid=21</wfw:comment>
    
        <slash:comments>1</slash:comments>
        <wfw:commentRss>http://belsky.info/rss.php?version=atom1.0&amp;type=comments&amp;cid=21</wfw:commentRss>
    
            <category scheme="http://belsky.info/categories/5-Perl" label="Perl" term="Perl" />
            <category scheme="http://belsky.info/categories/2-PHP5" label="PHP5" term="PHP5" />
            <category scheme="http://belsky.info/categories/10-Python" label="Python" term="Python" />
    
        <id>http://belsky.info/archives/21-guid.html</id>
        <title type="html">Functions vs. inline code</title>
        <content type="xhtml" xml:base="http://belsky.info/">
            <div xmlns="http://www.w3.org/1999/xhtml">
                Recently I had a little discussion about our style guide with one of the co-workers. And the matter was concerning the line length. Most default is to limit the line length with 79-85 characters - because of terminals, printing etc. But an other question took my head in the middle of the conversation: limiting the line length would mean for example to encapsulate deep included blocks of the code into functions - sounds not bad, but ... <br />
 <br /><a href="http://belsky.info/archives/21-Functions-vs.-inline-code.html#extended">Continue reading "Functions vs. inline code"</a>
            </div>
        </content>
        
    </entry>
    <entry>
        <link href="http://belsky.info/archives/20-PHPurple-v0.2-alpha-released.html" rel="alternate" title="PHPurple v0.2 alpha released" />
        <author>
            <name>Anatoliy Belsky</name>
                    </author>
    
        <published>2008-05-31T05:44:20Z</published>
        <updated>2008-06-01T05:57:42Z</updated>
        <wfw:comment>http://belsky.info/wfwcomment.php?cid=20</wfw:comment>
    
        <slash:comments>3</slash:comments>
        <wfw:commentRss>http://belsky.info/rss.php?version=atom1.0&amp;type=comments&amp;cid=20</wfw:commentRss>
    
            <category scheme="http://belsky.info/categories/9-CC++" label="C/C++" term="C/C++" />
            <category scheme="http://belsky.info/categories/7-Linux" label="Linux" term="Linux" />
            <category scheme="http://belsky.info/categories/2-PHP5" label="PHP5" term="PHP5" />
            <category scheme="http://belsky.info/categories/1-PHP5-extentions" label="PHP5 extentions" term="PHP5 extentions" />
    
        <id>http://belsky.info/archives/20-guid.html</id>
        <title type="html">PHPurple v0.2 alpha released</title>
        <content type="xhtml" xml:base="http://belsky.info/">
            <div xmlns="http://www.w3.org/1999/xhtml">
                Today I've maked the second PHPurple release and changed it's status to alpha. The changes, came into it, are:<br />
<br />
* fixed zts compatibility<br />
* implemented the loopHeartBeat method<br />
* the runLoop method was changed to set the heartbeat interval<br />
* fixed memory leak on empty alias<br />
* purple.debug_enabled is now boolean<br />
<br />
The most interesting on this release is the PurpleClient::loopHeartBeat() story, which is of course implemented with g_timeout_add. Take a look at the new example script to see how it works.<br />
<br />
 <br /><a href="http://belsky.info/archives/20-PHPurple-v0.2-alpha-released.html#extended">Continue reading "PHPurple v0.2 alpha released"</a>
            </div>
        </content>
        
    </entry>
    <entry>
        <link href="http://belsky.info/archives/19-Postfix+Spamassassin.html" rel="alternate" title="Postfix+Spamassassin" />
        <author>
            <name>Anatoliy Belsky</name>
                    </author>
    
        <published>2008-05-02T19:02:13Z</published>
        <updated>2008-05-02T20:17:57Z</updated>
        <wfw:comment>http://belsky.info/wfwcomment.php?cid=19</wfw:comment>
    
        <slash:comments>0</slash:comments>
        <wfw:commentRss>http://belsky.info/rss.php?version=atom1.0&amp;type=comments&amp;cid=19</wfw:commentRss>
    
            <category scheme="http://belsky.info/categories/4-Bash" label="Bash" term="Bash" />
            <category scheme="http://belsky.info/categories/7-Linux" label="Linux" term="Linux" />
    
        <id>http://belsky.info/archives/19-guid.html</id>
        <title type="html">Postfix+Spamassassin</title>
        <content type="xhtml" xml:base="http://belsky.info/">
            <div xmlns="http://www.w3.org/1999/xhtml">
                Referencing my previous <a href="http://thinker.rubay.de/archives/12-Postfix-+-Dovecot-SMTP-and-IMAP-on-Debian-Etch.html">article</a> about the mali server configuration, I'm continuing with spam and antivirus scanners setup. On my Debian box i'm installing the following:<br />
<br />
<div><b>BASH:</b></div><div><pre class="bash" style="color: #000066; border: 1px solid #d0d0d0; background-color: #f0f0f0;padding-left: 3px;">user@host~$ apt-get <span style="color: #c20cb9; font-weight: bold;">install</span> spamassassin</pre></div><br />
<br />
With this groups spamd and clamav are automatically created. Before you start, keep in mind - if something goes wrong, allways check the /var/log/mail.* files. <br /><a href="http://belsky.info/archives/19-Postfix+Spamassassin.html#extended">Continue reading "Postfix+Spamassassin"</a>
            </div>
        </content>
        
    </entry>
    <entry>
        <link href="http://belsky.info/archives/18-Dont-underestimate-SQL.html" rel="alternate" title="Don't underestimate SQL" />
        <author>
            <name>Anatoliy Belsky</name>
                    </author>
    
        <published>2008-04-27T19:37:00Z</published>
        <updated>2011-10-28T09:28:33Z</updated>
        <wfw:comment>http://belsky.info/wfwcomment.php?cid=18</wfw:comment>
    
        <slash:comments>0</slash:comments>
        <wfw:commentRss>http://belsky.info/rss.php?version=atom1.0&amp;type=comments&amp;cid=18</wfw:commentRss>
    
            <category scheme="http://belsky.info/categories/4-Bash" label="Bash" term="Bash" />
            <category scheme="http://belsky.info/categories/3-PostgreSQL" label="PostgreSQL" term="PostgreSQL" />
            <category scheme="http://belsky.info/categories/10-Python" label="Python" term="Python" />
    
        <id>http://belsky.info/archives/18-guid.html</id>
        <title type="html">Don't underestimate SQL</title>
        <content type="xhtml" xml:base="http://belsky.info/">
            <div xmlns="http://www.w3.org/1999/xhtml">
                Hi there.<br />
<br />
The things I wanna to talk about today are - relational databases building. Particularly I would discuss such the attainments of relational sql as join and subselect. For my experiment I'll take PostgreSQL and Python.<br />
<br />
So, lets start:<br />
<br />
<div><b>BASH:</b></div><div><pre class="bash" style="color: #000066; border: 1px solid #d0d0d0; background-color: #f0f0f0;padding-left: 3px;">user@host~$ <span style="color: #c20cb9; font-weight: bold;">su</span> postgres
postgres@host~$ createuser -P <span style="color: #7a0874; font-weight: bold;">test</span>
Enter password <span style="color: #000000; font-weight: bold;">for</span> new role:
Enter it again:
Shall the new role be a superuser? <span style="color: #7a0874; font-weight: bold;">&#40;</span>y/n<span style="color: #7a0874; font-weight: bold;">&#41;</span> n
Shall the new role be allowed to create <span style="color: #c20cb9; font-weight: bold;">more</span> new roles? <span style="color: #7a0874; font-weight: bold;">&#40;</span>y/n<span style="color: #7a0874; font-weight: bold;">&#41;</span> n
postgres@host~$ createdb <span style="color: #7a0874; font-weight: bold;">test</span>
postgres@host~$ <span style="color: #7a0874; font-weight: bold;">exit</span></pre></div> <br /><a href="http://belsky.info/archives/18-Dont-underestimate-SQL.html#extended">Continue reading "Don't underestimate SQL"</a>
            </div>
        </content>
        
    </entry>
    <entry>
        <link href="http://belsky.info/archives/17-Domains-avaliability-checker.html" rel="alternate" title="Domains avaliability checker" />
        <author>
            <name>Anatoliy Belsky</name>
                    </author>
    
        <published>2008-03-12T21:44:06Z</published>
        <updated>2008-03-12T22:03:55Z</updated>
        <wfw:comment>http://belsky.info/wfwcomment.php?cid=17</wfw:comment>
    
        <slash:comments>0</slash:comments>
        <wfw:commentRss>http://belsky.info/rss.php?version=atom1.0&amp;type=comments&amp;cid=17</wfw:commentRss>
    
            <category scheme="http://belsky.info/categories/4-Bash" label="Bash" term="Bash" />
            <category scheme="http://belsky.info/categories/7-Linux" label="Linux" term="Linux" />
            <category scheme="http://belsky.info/categories/8-Web" label="Web" term="Web" />
    
        <id>http://belsky.info/archives/17-guid.html</id>
        <title type="html">Domains avaliability checker</title>
        <content type="xhtml" xml:base="http://belsky.info/">
            <div xmlns="http://www.w3.org/1999/xhtml">
                About a month ago I've written a simple domain checker, which is using whois.net to get the domains availiable. The main goal was to find free 3-symbols domains. <br />
<br />
<div><b>BASH:</b></div><div><pre class="bash" style="color: #000066; border: 1px solid #d0d0d0; background-color: #f0f0f0;padding-left: 3px;"><span style="color: #808080; font-style: italic;">#!/bin/<span style="color: #c20cb9; font-weight: bold;">sh</span> </span>
&#160;
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #007800;">$#</span> -lt <span style="color: #000000;">1</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>
<span style="color: #000000; font-weight: bold;">then</span>
    <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;usage: `basename $0` extension
Check domains avaliability
&#160;
examples:
`basename $0` com
&quot;</span>;
    <span style="color: #7a0874; font-weight: bold;">exit</span> <span style="color: #000000;">2</span>;
<span style="color: #000000; font-weight: bold;">fi</span>
&#160;
<span style="color: #007800;">EXT=</span>$<span style="color: #000000;">1</span>;
<span style="color: #007800;">LAST_FILENAME=</span>/tmp/dc_<span style="color: #007800;">$USER</span><span style="color: #007800;">$EXT</span>.<span style="color: #c20cb9; font-weight: bold;">last</span>
&#160;
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> -f <span style="color: #ff0000;">&quot;$LAST_FILENAME&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span> <span style="color: #007800;">LAST_DOMAIN=</span>`<span style="color: #c20cb9; font-weight: bold;">cat</span> <span style="color: #007800;">$LAST_FILENAME</span>`; <span style="color: #000000; font-weight: bold;">fi</span> 
&#160;
<span style="color: #000000; font-weight: bold;">for</span> DOMAIN <span style="color: #000000; font-weight: bold;">in</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span><span style="color: #7a0874; font-weight: bold;">&#123;</span><span style="color: #000000;">0</span>..<span style="color: #000000;">9</span><span style="color: #7a0874; font-weight: bold;">&#125;</span>,<span style="color: #7a0874; font-weight: bold;">&#123;</span>a..z<span style="color: #7a0874; font-weight: bold;">&#125;</span>,-<span style="color: #7a0874; font-weight: bold;">&#125;</span><span style="color: #7a0874; font-weight: bold;">&#123;</span><span style="color: #7a0874; font-weight: bold;">&#123;</span><span style="color: #000000;">0</span>..<span style="color: #000000;">9</span><span style="color: #7a0874; font-weight: bold;">&#125;</span>,<span style="color: #7a0874; font-weight: bold;">&#123;</span>a..z<span style="color: #7a0874; font-weight: bold;">&#125;</span>,-<span style="color: #7a0874; font-weight: bold;">&#125;</span><span style="color: #7a0874; font-weight: bold;">&#123;</span><span style="color: #7a0874; font-weight: bold;">&#123;</span><span style="color: #000000;">0</span>..<span style="color: #000000;">9</span><span style="color: #7a0874; font-weight: bold;">&#125;</span>,<span style="color: #7a0874; font-weight: bold;">&#123;</span>a..z<span style="color: #7a0874; font-weight: bold;">&#125;</span>,-<span style="color: #7a0874; font-weight: bold;">&#125;</span>
<span style="color: #000000; font-weight: bold;">do</span>
    <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #ff0000;">&quot;$DOMAIN&quot;</span> \&lt; <span style="color: #ff0000;">&quot;$LAST_DOMAIN&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span> <span style="color: #7a0874; font-weight: bold;">continue</span>; <span style="color: #000000; font-weight: bold;">fi</span>
&#160;
    <span style="color: #7a0874; font-weight: bold;">trap</span> <span style="color: #ff0000;">&quot;echo $DOMAIN &gt; $LAST_FILENAME;exit;&quot;</span> SIGHUP SIGINT SIGTERM
&#160;
    <span style="color: #007800;">STATUS_STRING=</span>`<span style="color: #c20cb9; font-weight: bold;">wget</span> -qO - http://www.whois.net/whois_new.cgi\?d\=<span style="color: #007800;">$DOMAIN</span>\&amp;tld\=<span style="color: #007800;">$EXT</span> | <span style="color: #c20cb9; font-weight: bold;">grep</span> <span style="color: #ff0000;">'Status'</span>`
&#160;
    <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;$STATUS_STRING&quot;</span> | <span style="color: #c20cb9; font-weight: bold;">grep</span> <span style="color: #ff0000;">'free'</span> &amp;&amp; 
    <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;$DOMAIN.$EXT&quot;</span> &gt;&gt; ~/domains_found_<span style="color: #007800;">$EXT</span>.txt &amp;&amp; 
    <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;the domain is free: $DOMAIN.$EXT&quot;</span> | mail -c my@mail.com -s <span style="color: #ff0000;">&quot;free domain&quot;</span> other@mail.com
&#160;
    <span style="color: #c20cb9; font-weight: bold;">sleep</span> <span style="color: #000000;">7</span>
&#160;
<span style="color: #000000; font-weight: bold;">done</span></pre></div><br />
<br />
The thing is very simple and the results can be kept on. Additionally it sends mail messages about each found domain. Lets see, what it brought for the .de domains ( about 9000 free domains was found <img src="http://belsky.info/templates/default-my/img/emoticons/wink.png" alt=";-)" style="display: inline; vertical-align: bottom;" class="emoticon" /> ) <br /><a href="http://belsky.info/archives/17-Domains-avaliability-checker.html#extended">Continue reading "Domains avaliability checker"</a>
            </div>
        </content>
        
    </entry>
    <entry>
        <link href="http://belsky.info/archives/16-Map-objects-recursive-in-perl.html" rel="alternate" title="Map objects recursive in perl" />
        <author>
            <name>Anatoliy Belsky</name>
                    </author>
    
        <published>2008-03-08T16:19:33Z</published>
        <updated>2008-03-09T09:17:59Z</updated>
        <wfw:comment>http://belsky.info/wfwcomment.php?cid=16</wfw:comment>
    
        <slash:comments>0</slash:comments>
        <wfw:commentRss>http://belsky.info/rss.php?version=atom1.0&amp;type=comments&amp;cid=16</wfw:commentRss>
    
            <category scheme="http://belsky.info/categories/5-Perl" label="Perl" term="Perl" />
    
        <id>http://belsky.info/archives/16-guid.html</id>
        <title type="html">Map objects recursive in perl</title>
        <content type="xhtml" xml:base="http://belsky.info/">
            <div xmlns="http://www.w3.org/1999/xhtml">
                One interesting thing I've got stucked on - if we have some multilevel arrays/hashes (which aren't the same in perl), there is no standard way to change all the object's values. The only thing I've found usefull is <a href="http://perldoc.perl.org/functions/map.html">map</a> function, which nevertheless works only for map arrays.  However, it could be very usefull, to have a possibility to change each scalar element of some multilevel object. For example, if you ever used XML::Simple, you could observe the following behavior with values, which contain new lines.<br />
<br />
<div><b>XML:</b></div><div><pre class="xml" style="color: #000066; border: 1px solid #d0d0d0; background-color: #f0f0f0;padding-left: 3px;"><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;root<span style="font-weight: bold; color: black;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;elem<span style="font-weight: bold; color: black;">&gt;</span></span></span>asdf<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/elem<span style="font-weight: bold; color: black;">&gt;</span></span></span>
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/root<span style="font-weight: bold; color: black;">&gt;</span></span></span></pre></div><br />
 <br /><a href="http://belsky.info/archives/16-Map-objects-recursive-in-perl.html#extended">Continue reading "Map objects recursive in perl"</a>
            </div>
        </content>
        
    </entry>

</feed>
