<?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/"
	>

<channel>
	<title>Marian Marinov/HackMan</title>
	<atom:link href="http://hydra.azilian.net/blog/feed/" rel="self" type="application/rss+xml" />
	<link>http://hydra.azilian.net/blog</link>
	<description>Personal Blog</description>
	<pubDate>Sun, 14 Mar 2010 19:29:37 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.7</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Contributing to Gearman</title>
		<link>http://hydra.azilian.net/blog/2010/03/contributing-to-gearman/</link>
		<comments>http://hydra.azilian.net/blog/2010/03/contributing-to-gearman/#comments</comments>
		<pubDate>Sun, 14 Mar 2010 18:41:08 +0000</pubDate>
		<dc:creator>HackMan</dc:creator>
		
		<category><![CDATA[Gearman]]></category>

		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://hydra.azilian.net/blog/?p=153</guid>
		<description><![CDATA[Since BG Perl Workshop 2010 I have read about Gearman and a few weeks back I decided to incorporate it in few of my projects. While developing with Gearman is interesting and fun job I found some things that I really missed in the server. While testing Gearman I started a client which added a [...]]]></description>
			<content:encoded><![CDATA[<p>Since <a href="http://event.perlbulgaria.org/sofia2010/" target="_blank">BG Perl Workshop 2010</a> I have read about Gearman and a few weeks back I decided to incorporate it in few of my projects. While developing with Gearman is interesting and fun job I found some things that I really missed in the server. While testing Gearman I started a client which added a lot of calls to a function which was not still registered. The problem was that some of the arguments to that function would insert wrong information into DB so I wanted to simply remove all calls to the function before connecting the worker for that function.<br />
However, currently in Gearman server there are no commands that allow that functionality. The only way to do this is to restart gearmand.</p>
<p>So I decided to look at the code and see if I can add what I want. At first it seemed very easy to implement what I wanted so I started <img src='http://hydra.azilian.net/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>It looked very very easy to implement rmfunc and zerofunc in the server, so I decided to <a href="https://code.launchpad.net/~mm-yuhu/gearmand/server-funcs" target="_blank">contribute back my changes</a> to the gearman project.</p>
<p>However, not everything is as easy as it seamed <img src='http://hydra.azilian.net/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> 1st Eric and Brian requested a test case which was to be in C with their test API. This was quite a challenge and I&#8217;m still not done with it <img src='http://hydra.azilian.net/blog/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> </p>
<p>The 2nd thing seemed to be more complicated, but for me it was easier so I started with it. The problem was that, while it is no problem to remove functions which are executed as background jobs, its quite interesting when you try to remove function which has connected clients requesting it. When you remove currently requested function, there is no code that will notify connected clients that the function is no longer available, nor there is connection error sent to those clients. This breaks gearman communication in a lot of different ways.</p>
<p>So what I&#8217;m trying to achieve is add the functionality required to interrupt client communication with the server and send the proper error messages to the client. For me this is no easy job, but it seams that it is easier then the test cases.</p>
]]></content:encoded>
			<wfw:commentRss>http://hydra.azilian.net/blog/2010/03/contributing-to-gearman/feed/</wfw:commentRss>
		</item>
		<item>
		<title>My library</title>
		<link>http://hydra.azilian.net/blog/2010/03/my-library/</link>
		<comments>http://hydra.azilian.net/blog/2010/03/my-library/#comments</comments>
		<pubDate>Wed, 10 Mar 2010 00:16:09 +0000</pubDate>
		<dc:creator>HackMan</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://hydra.azilian.net/blog/?p=148</guid>
		<description><![CDATA[Today I finally found the will in me to gather all of my books from all places I have left them and reorder my library. I thought that I had much more books but they fitted in only 4 shelves.
I keep most of my books at home but I have usually at least one shelf [...]]]></description>
			<content:encoded><![CDATA[<p>Today I finally found the will in me to gather all of my books from all places I have left them and reorder my library. I thought that I had much more books but they fitted in only 4 shelves.</p>
<p>I keep most of my books at home but I have usually at least one shelf at the office and rotate them, depending on the projects we are working on. Currently almost all of my Perl books are at the office.</p>
<p>One of the biggest problems I have is when I give some book to someone and I don&#8217;t remember&#8230; I have to find a good software which will keep track of that&#8230;</p>
<p>Here are some pictures of the books:</p>
<p><a href="http://hydra.azilian.net/pics/library/DSC07185.JPG"><img class="alignnone" src="http://hydra.azilian.net/pics/library/DSC07185.JPG" alt="" width="294" height="391" /></a></p>
<p><a href="http://hydra.azilian.net/pics/library/DSC07183.JPG"><img class="alignnone" src="http://hydra.azilian.net/pics/library/DSC07183.JPG" alt="" width="333" height="248" /></a></p>
<p>It was very interesting for me, to find that most(3/4) of the books I have already read. Currently I find it harder to buy new books since I already have most of the books I&#8217;m interested in.</p>
<p>However, the sad thing is that for the past 10 years I have only bought 6 books that were not IT related and currently I have only one of those <img src='http://hydra.azilian.net/blog/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://hydra.azilian.net/blog/2010/03/my-library/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Version Control with Git</title>
		<link>http://hydra.azilian.net/blog/2010/02/version-control-with-git/</link>
		<comments>http://hydra.azilian.net/blog/2010/02/version-control-with-git/#comments</comments>
		<pubDate>Thu, 18 Feb 2010 17:02:08 +0000</pubDate>
		<dc:creator>HackMan</dc:creator>
		
		<category><![CDATA[Book reviews]]></category>

		<guid isPermaLink="false">http://hydra.azilian.net/blog/?p=134</guid>
		<description><![CDATA[
This was the second book about Git, that I read. In the beginning the book didn&#8217;t offered anything interesting but it actually managed to summarize Pragmatic version control using Git into one small but very good structured chapter. After you reach the 4th chapter you actually enter into the universe of Git and start to [...]]]></description>
			<content:encoded><![CDATA[<p><img style="margin: 5px" src="http://covers.oreilly.com/images/9780596520137/cat.gif" alt="Version Control with Git" align="left" /><br />
This was the second book about Git, that I read. In the beginning the book didn&#8217;t offered anything interesting but it actually managed to summarize <a href="http://hydra.azilian.net/blog/2009/11/pragmatic-version-control-using-git/">Pragmatic version control using Git</a> into one small but very good structured chapter. After you reach the 4th chapter you actually enter into the universe of Git and start to appreciate written in the book, and the power of this software.</p>
<p>Instead of simply showing how can one use Git, this book describes how one should think in order to use Git. The comprehensive explanation of git&#8217;s internal structure in the beginning  of the 4th chapter may seam as a little too much for the novice readers but it actually helps you understand all of the complicated logic which is behind this great software. Now when I thing about branching, merging or rebaseing I really know what&#8217;s going on. And all of this knowledge helps me solve problems that I have never managed to solve the past. Until now, I have been using best practices to work with Git without actually understanding why these were &#8220;the best&#8221; practices. In the book I found not only technical information about the software, but also a lot of information about how to manage a project, the right way.</p>
<p>I advice everyone to read this book. You will fill enlitened <img src='http://hydra.azilian.net/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://hydra.azilian.net/blog/2010/02/version-control-with-git/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Personal Public GitWeb</title>
		<link>http://hydra.azilian.net/blog/2010/02/personal-public-gitweb/</link>
		<comments>http://hydra.azilian.net/blog/2010/02/personal-public-gitweb/#comments</comments>
		<pubDate>Tue, 09 Feb 2010 17:45:31 +0000</pubDate>
		<dc:creator>HackMan</dc:creator>
		
		<category><![CDATA[Linux-HA]]></category>

		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://hydra.azilian.net/blog/?p=131</guid>
		<description><![CDATA[Finally I decided that it will be a good idea to keep all of my OpenSource contributions into git projects and also to put them online.
Until now I had only the Patches page.
And today while finalizing the MySQL Resource Agent for Heartbeat I have installed gitweb and I&#8217;ll try to add all of my contributions [...]]]></description>
			<content:encoded><![CDATA[<p>Finally I decided that it will be a good idea to keep all of my OpenSource contributions into git projects and also to put them online.<br />
Until now I had only the <a href="http://hydra.azilian.net/patches/">Patches page</a>.</p>
<p>And today while finalizing the <a href="http://hydra.azilian.net/gitweb/?p=linux-ha/.git;a=summary">MySQL Resource Agent</a> for <a href="http://linux-ha.org/wiki/Main_Page">Heartbeat</a> I have installed gitweb and I&#8217;ll try to add all of my contributions there.</p>
]]></content:encoded>
			<wfw:commentRss>http://hydra.azilian.net/blog/2010/02/personal-public-gitweb/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Home Theater</title>
		<link>http://hydra.azilian.net/blog/2010/02/home-theater/</link>
		<comments>http://hydra.azilian.net/blog/2010/02/home-theater/#comments</comments>
		<pubDate>Wed, 03 Feb 2010 13:31:20 +0000</pubDate>
		<dc:creator>HackMan</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://hydra.azilian.net/blog/?p=129</guid>
		<description><![CDATA[Finally I got the new video screen and we tested it yesterday. 2.4 meters is the optimal screen size for my projector and our living room.
You can watch from any angle, the picture is at least 4 times bigger then our 47&#8242; TV. There are some problems now with the quality of the movies that [...]]]></description>
			<content:encoded><![CDATA[<p>Finally I got the new video screen and we tested it yesterday. 2.4 meters is the optimal screen size for my projector and our living room.<br />
You can watch from any angle, the picture is at least 4 times bigger then our 47&#8242; TV. There are some problems now with the quality of the movies that we watch. XviD on Projector is like screener on Laptop <img src='http://hydra.azilian.net/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /><br />
But all 720p movies are crystal clear, like you are in a movie theater and even better. </p>
<p>The only problem yesterday was that we ran out of beer <img src='http://hydra.azilian.net/blog/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://hydra.azilian.net/blog/2010/02/home-theater/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Postfix disk quotas</title>
		<link>http://hydra.azilian.net/blog/2010/01/postfix-disk-quotas/</link>
		<comments>http://hydra.azilian.net/blog/2010/01/postfix-disk-quotas/#comments</comments>
		<pubDate>Sat, 30 Jan 2010 04:09:27 +0000</pubDate>
		<dc:creator>HackMan</dc:creator>
		
		<category><![CDATA[Linux General]]></category>

		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://hydra.azilian.net/blog/?p=115</guid>
		<description><![CDATA[I had to build a mail server for one client. So I decided to use postfix + dovecot as a combination for the setup.
After a week of usage, my client called and asked for per user quotas. Since the setup is with virtual users this required some changes. So here I&#8217;ll try to outline what [...]]]></description>
			<content:encoded><![CDATA[<p>I had to build a mail server for one client. So I decided to use postfix + dovecot as a combination for the setup.<br />
After a week of usage, my client called and asked for per user quotas. Since the setup is with virtual users this required some changes. So here I&#8217;ll try to outline what I have done to setup the system.</p>
<p>First of all you should have to know that I setup the machine to be working with postfix + mysql + postfixadmin + dovecot. So the first step I took was to alter the database and add user ids there:</p>
<p><code><br />
ALTER TABLE mailbox ADD COLUMN uid int NOT NULL AUTO_INCREMENT AFTER active, ADD KEY (uid);<br />
</code></p>
<p>Since on the machine there are already a lot of UIDs allocated from 0 to 1000 I decided that I will use UIDs over 30000 for this setup. But since the machine was in use for a week now, the above query populated the uid column with values. So what you do is, select the last UID from the table and update the AUTO_INCREMENT counter to the value you have + 30000. Here is how you could do it:</p>
<p><code><br />
ALTER TABLE mailbox AUTO_INCREMENT=30173;<br />
UPDATE mailbox SET uid=uid+30000;<br />
</code></p>
<p>Ok, so we have updated the database and we have the new UIDs that we have to use on the machine. The next step is to update the UIDs on the filesystem, so you enter your mail storage dir(mine is /var/vmail) and run this to fix the permissions:</p>
<p><code>mysql -e 'SELECT uid,maildir FROM mailbox' postfix|while read uid dir; do chown -R $uid $dir; done</code></p>
<p>The following steps are configurations for postfix and dovecot.</p>
<p>Since the current configuration for postfix was with static UID/GID maps for all users, now I had to update that. In the main.cf you will usually find these lines:<br />
<code><br />
virtual_uid_maps = static:110<br />
virtual_gid_maps = static:110<br />
</code><br />
These are the static uid/gid maps. So we change ONLY the UID maps to:<br />
<code><br />
virtual_uid_maps = proxy:mysql:/etc/postfix/mysql-virtual-uid-maps.cf<br />
</code></p>
<p>After you have done this you have to create the uid-maps.cf&#8230;:<br />
<code><br />
user      = postfix<br />
password  = *********<br />
dbname    = postfix<br />
hosts     = localhost<br />
query = SELECT uid FROM mailbox WHERE username='%s' AND active = true<br />
</code><br />
Now restart postfix and you have finished with it&#8230;</p>
<p>So what we have left to do is fix dovecot configuration:</p>
<p>in the protocol imap section you have to add this line:<br />
<code>  mail_plugins = quota imap_quota</code><br />
In the protocol pop3 section you have to add this line:<br />
<code>  mail_plugins = quota</code><br />
Then in the plugin section you have to add this line:<br />
<code>  quota = fs:user </code></p>
<p>The last change is to the user_query for dovecot. You have to change this:<br />
<code>user_query = SELECT CONCAT('/var/vmail/',maildir) AS home, '110' AS uid, '110' AS gid, CONCAT('maildir:',CONCAT('/var/vmail/',maildir)) AS mail, CONCAT('maildir:storage=', ROUND( mailbox.quota / 1024 ) ) AS quota_rule  FROM mailbox WHERE username = '%u'</code></p>
<p>To that:<br />
<code>user_query = SELECT CONCAT('/var/vmail/',maildir) AS home, uid, '110' AS gid, CONCAT('maildir:',CONCAT('/var/vmail/',maildir)) AS mail, CONCAT('maildir:storage=', ROUND( mailbox.quota / 1024 ) ) AS quota_rule  FROM mailbox WHERE username = '%u'</code></p>
<p>Now after restart of dovecot you have everything setup and running.</p>
<p>And some plus is the automated quota handling. By adding one simple line to cron you can update the fs quota for all users:<br />
<code>mysql -e 'SELECT uid,ROUND(quota/1024),ROUND(quota/1024),"0","0" FROM mailbox' postfix|setquota -B /</code></p>
<p>Now you control the quota for all these users from the postfixadmin panel <img src='http://hydra.azilian.net/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Quite nice and quite easy. It took me 2hours to read all the documentation for that and to implement it.</p>
]]></content:encoded>
			<wfw:commentRss>http://hydra.azilian.net/blog/2010/01/postfix-disk-quotas/feed/</wfw:commentRss>
		</item>
		<item>
		<title>W.R.Stevens books</title>
		<link>http://hydra.azilian.net/blog/2010/01/wrstevens-books/</link>
		<comments>http://hydra.azilian.net/blog/2010/01/wrstevens-books/#comments</comments>
		<pubDate>Wed, 06 Jan 2010 01:27:49 +0000</pubDate>
		<dc:creator>HackMan</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://hydra.azilian.net/blog/?p=111</guid>
		<description><![CDATA[Finally the books I ordered in the beginning of December have arrived  

Advanced Programing in the Unix Environment
Unix Network Programing Volumes 1 and 2

I think that these books are the bibles of network programing and they should be a must read for any C developer.
I have also ordered these two:

Myths of Security
The Art of [...]]]></description>
			<content:encoded><![CDATA[<p>Finally the books I ordered in the beginning of December have arrived <img src='http://hydra.azilian.net/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<ul>
<li>Advanced Programing in the Unix Environment</li>
<li>Unix Network Programing Volumes 1 and 2</li>
</ul>
<p>I think that these books are the bibles of network programing and they should be a must read for any C developer.</p>
<p>I have also ordered these two:</p>
<ul>
<li>Myths of Security</li>
<li>The Art of Lean Software Development</li>
</ul>
<p>I&#8217;m pretty excited about the Unix Network programing volume 1 since it is third edition and I have read only the second. In the third they cover the SCTP which is a very nice protocol. I actually implemented SCTP in OpenVPN and the book will help me understand just how many mistakes I have made in my implementation <img src='http://hydra.azilian.net/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://hydra.azilian.net/blog/2010/01/wrstevens-books/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Bulgarian Big Brother</title>
		<link>http://hydra.azilian.net/blog/2010/01/bulgarian-big-brother/</link>
		<comments>http://hydra.azilian.net/blog/2010/01/bulgarian-big-brother/#comments</comments>
		<pubDate>Tue, 05 Jan 2010 00:12:00 +0000</pubDate>
		<dc:creator>HackMan</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://hydra.azilian.net/blog/?p=108</guid>
		<description><![CDATA[Just before Christmas, Bulgarian law makers decided that it is a very good idea to approve the changes in the Law for Electronic messages. What they approve was that they need surveillance. What they didn&#8217;t think was how they will have this surveillance! So what we will have is a big version of Big Brother [...]]]></description>
			<content:encoded><![CDATA[<p>Just before Christmas, Bulgarian law makers decided that it is a very good idea to approve the changes in the Law for Electronic messages. What they approve was that they need surveillance. What they didn&#8217;t think was how they will have this surveillance! So what we will have is a big version of Big Brother but with many smaller accomplices and a lot of people peaking in Big Brothers database&#8230;</p>
<p>I just found one initiative which asks every Bulgarian citizen to act and call all those who voted for this madness and try to make them vote against. I will surely make my 100 calls! Here is the list of all phone numbers:</p>
<p>http://jackie.hopto.org/blog/(Bulgarian)</p>
]]></content:encoded>
			<wfw:commentRss>http://hydra.azilian.net/blog/2010/01/bulgarian-big-brother/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Projector</title>
		<link>http://hydra.azilian.net/blog/2010/01/projector/</link>
		<comments>http://hydra.azilian.net/blog/2010/01/projector/#comments</comments>
		<pubDate>Sat, 02 Jan 2010 17:03:11 +0000</pubDate>
		<dc:creator>HackMan</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://hydra.azilian.net/blog/2010/01/projector/</guid>
		<description><![CDATA[Before Christmas I had ordered an Eposn EMP-TW700 projector for home. On 30th it finally came. So we watched one movie with it and my father managed to bring down the screen  So after a second installation yesterday, now I finally have my own home theater&#8230; It looks good but during the day you [...]]]></description>
			<content:encoded><![CDATA[<p>Before Christmas I had ordered an Eposn EMP-TW700 projector for home. On 30th it finally came. So we watched one movie with it and my father managed to bring down the screen <img src='http://hydra.azilian.net/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> So after a second installation yesterday, now I finally have my own home theater&#8230; It looks good but during the day you can watch movies with dark scenes <img src='http://hydra.azilian.net/blog/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> Still the TV is the better option for that. </p>
]]></content:encoded>
			<wfw:commentRss>http://hydra.azilian.net/blog/2010/01/projector/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Perl exam generator</title>
		<link>http://hydra.azilian.net/blog/2010/01/perl-exam-generator/</link>
		<comments>http://hydra.azilian.net/blog/2010/01/perl-exam-generator/#comments</comments>
		<pubDate>Sat, 02 Jan 2010 06:39:41 +0000</pubDate>
		<dc:creator>HackMan</dc:creator>
		
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://hydra.azilian.net/blog/2010/01/perl-exam-generator/</guid>
		<description><![CDATA[Pfiuuu, today I finally finished my Exam generator. I added generating PDF files from the DB. Until now I was generating only txt support. Now I can generate new variants of a test whenever I want, just with one execution of the script. I also made a web version so I can generate variants of [...]]]></description>
			<content:encoded><![CDATA[<p>Pfiuuu, today I finally finished my Exam generator. I added generating PDF files from the DB. Until now I was generating only txt support. Now I can generate new variants of a test whenever I want, just with one execution of the script. I also made a web version so I can generate variants of the tests directly from my home servers without direct access to the questions DB. The only thing that is missing now is stored every generated variation of the exams into DB for later use/verification. Maybe in future I&#8217;ll add this to the DB and to the script. It will be useful for the upcoming years.</p>
<p>I&#8217;m thinking of putting the code online, but since it is a really bad written Perl code for now I&#8217;ll save my self the embarrassment <img src='http://hydra.azilian.net/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://hydra.azilian.net/blog/2010/01/perl-exam-generator/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
