<?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>Alex Amiryan's Linux Blog &#187; Code</title>
	<atom:link href="http://www.amiryan.org/category/code/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.amiryan.org</link>
	<description>Just sharing my experiance in linux</description>
	<lastBuildDate>Tue, 10 Nov 2009 19:56:31 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
<atom:link rel="hub" href="http://pubsubhubbub.appspot.com"/><atom:link rel="hub" href="http://superfeedr.com/hubbub"/>		<item>
		<title>Web-CVS-Tools is now under GNU GPLv3</title>
		<link>http://www.amiryan.org/2009/11/10/web-cvs-tools-is-now-under-gnu-gplv3/</link>
		<comments>http://www.amiryan.org/2009/11/10/web-cvs-tools-is-now-under-gnu-gplv3/#comments</comments>
		<pubDate>Tue, 10 Nov 2009 19:51:57 +0000</pubDate>
		<dc:creator>Alex Amiryan</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Links]]></category>

		<guid isPermaLink="false">http://www.amiryan.org/?p=309</guid>
		<description><![CDATA[Web-CVS-Tools is now release under GNU GPLv3. Project migrated to github.com, so now you can participate in development. Web-CVS-Tools is a bunch of script written in Perl to automate and make easier web development using CVS. You can read about the intended web development team work flow in my earlier article, which can be found [...]]]></description>
			<content:encoded><![CDATA[<!--Amazon_CLS_IM_START--><p>Web-CVS-Tools is now release under GNU GPLv3. Project migrated to github.com, so now you can participate in development.</p>
<p>Web-CVS-Tools is a bunch of script written in Perl to automate and make easier web development using CVS. You can read about the intended web development team work flow in my earlier article, which can be found <a href="http://www.amiryan.org/2008/08/01/efficient-usage-of-cvs-in-web-development/">here</a>.</p>
<p>To make some changes to source code just run:</p>
<pre class="brush: text">
git clone git://github.com/alexamiryan/Web-CVS-Tools.git
</pre>
<p>Web-CVS-Tools on github &#8211; <a href="http://github.com/alexamiryan/Web-CVS-Tools">http://github.com/alexamiryan/Web-CVS-Tools</a></p>
<p>Have fun!</p>
<!--Amazon_CLS_IM_END-->]]></content:encoded>
			<wfw:commentRss>http://www.amiryan.org/2009/11/10/web-cvs-tools-is-now-under-gnu-gplv3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>VirtualBox init.d service autostart script</title>
		<link>http://www.amiryan.org/2009/11/04/virtualbox-init-d-service-autostart-script/</link>
		<comments>http://www.amiryan.org/2009/11/04/virtualbox-init-d-service-autostart-script/#comments</comments>
		<pubDate>Wed, 04 Nov 2009 16:38:34 +0000</pubDate>
		<dc:creator>Alex Amiryan</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[howtos]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[service]]></category>
		<category><![CDATA[startup]]></category>
		<category><![CDATA[VirtualBox]]></category>

		<guid isPermaLink="false">http://www.amiryan.org/?p=246</guid>
		<description><![CDATA[I&#8217;ve just installed started using VirtualBox on my Fedora 11 x86_64 and it works just perfectly. I&#8217;ve migrated from VMWare when it figured out that it is unable to work with latest kernel version. So I need to start some virtual machines in the background with system startup. I&#8217;ve made a lot of googling and [...]]]></description>
			<content:encoded><![CDATA[<!--Amazon_CLS_IM_START--><p>I&#8217;ve just installed started using VirtualBox on my Fedora 11 x86_64 and it works just perfectly. I&#8217;ve migrated from VMWare when it figured out that it is unable to work with latest kernel version. So I need to start some virtual machines in the background with system startup. I&#8217;ve made a lot of googling and found some dirty scripts that were not meeting my criterias. I&#8217;ve decided to write my own system startup service.</p>
<p>You need to create file named <strong>vbox</strong> in <strong>/etc/sysconfig/</strong> to list the virtual machine names that you want to start with system. Also when shutting down this service will save state to all running VMs. Here is the script:</p>
<p><em><strong>/etc/init.d/vbox</strong></em></p>
<pre class="brush: bash">
#!&#47;bin&#47;sh
#
# chkconfig: - 91 35
# description: Starts and stops vbox autostart VMs.

### BEGIN INIT INFO
# Provides: vbox
# Required-Start: $network $named $vboxdrv
# Required-Stop: $network $named
# Default-Start:
# Default-Stop: 0 1 2 3 4 5 6
# Short-Description: Autostart some Virtual Box VMs
# Description: Autostart some Virtual Box VMs that are mentioned in /etc/sysconfig/vbox file
### END INIT INFO

. /etc/rc.d/init.d/functions

MANAGE_CMD=VBoxManage

[ -r /etc/sysconfig/vbox ] &amp;&amp; . /etc/sysconfig/vbox

prog=$"Virtual Box Machines"

start()
{
	echo -n $"Starting $prog: "
	RETVAL=0

	for vbox_name in ${VBOX_AUTOSTART}
	do
	    SERVS=1
	    echo -n "${vbox_name} "
	    daemon $MANAGE_CMD startvm "${vbox_name}" -type vrdp &gt;/dev/null 2&gt;&amp;1
	    RETVAL=$?
	    [ "$RETVAL" -eq 0 ] || break
	done
	if [ -z "$SERVS" ]; then
	    echo -n "no virtual machines configured "
	    failure
	    RETVAL=6
	else
	    if [ "$RETVAL" -eq 0 ]; then
		success $"vbox startup"
		touch /var/lock/subsys/vbox
	    else
		failure $"vbox start"
	    fi
	fi
	echo
	return "$RETVAL"
}

stop()
{
	echo -n $"Shutting down $prog: "
	for vbox_name in ${VBOX_AUTOSTART}
	do
	    echo -n "${vbox_name} "
	    runuser root -c "$MANAGE_CMD -q controlvm "${vbox_name}" savestate" &gt;/dev/null 2>&#038;1
	done
	RETVAL=$?
	[ "$RETVAL" -eq 0 ] &amp;&amp; success $"vbox shutdown" || \
	    failure $"vbox shutdown"
	echo
	[ "$RETVAL" -eq 0 ] &amp;&amp; rm -f /var/lock/subsys/vbox
	return "$RETVAL"
}

status()
{
	for vbox_name in ${VBOX_AUTOSTART}
	do
	    echo -n "${vbox_name} "
	    $MANAGE_CMD showvminfo "${vbox_name}"|grep "^State:\s*.*$"
	done
}

case "$1" in
  start)
	start
	;;
  stop)
	stop
	;;
  restart|force-reload)
	stop
	start
	;;
  status)
	status
	;;
  *)
	echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload|status}" >&#038;2
	exit 3
	;;
esac

:</pre>
<p>And here is configuration file:</p>
<p><em><strong>/etc/sysconfig/vbox</strong></em></p>
<pre class="brush:bash"># Virtual box machines to autostart
# Example to start 2 machines
#	VBOX_AUTOSTART = "MachineName1 MachineName2"

# VBOX_AUTOSTART=""</pre>
<p>Thats it. If you have any questions do not hesitate to contact me.</p>
<!--Amazon_CLS_IM_END-->]]></content:encoded>
			<wfw:commentRss>http://www.amiryan.org/2009/11/04/virtualbox-init-d-service-autostart-script/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>Howto delete all .svn folders from SVN working directory</title>
		<link>http://www.amiryan.org/2009/04/23/howto-delete-all-svn-folders-from-svn-working-directory/</link>
		<comments>http://www.amiryan.org/2009/04/23/howto-delete-all-svn-folders-from-svn-working-directory/#comments</comments>
		<pubDate>Thu, 23 Apr 2009 15:53:14 +0000</pubDate>
		<dc:creator>Alex Amiryan</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[howtos]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[svn]]></category>

		<guid isPermaLink="false">http://www.amiryan.org/?p=233</guid>
		<description><![CDATA[To delete all .svn folders from SVN working directory for releasing folder from SVN just do this simple steps. Create new file in /usr/local/bin with name svnrm with following content #!&#47;bin&#47;sh find . -name .svn -print0 &#124; xargs -0 rm -rf Save it. From now on you can execute svnrm command in your working directory [...]]]></description>
			<content:encoded><![CDATA[<!--Amazon_CLS_IM_START--><p>To delete all <em><strong>.svn</strong></em> folders from SVN working directory for releasing folder from SVN just do this simple steps.<br />
Create new file in <em>/usr/local/bin</em> with name <strong><em>svnrm</em></strong> with following content</p>
<pre class="brush: bash">#!&#47;bin&#47;sh
find . -name .svn -print0 | xargs -0 rm -rf</pre>
<p>Save it. From now on you can execute <strong><em>svnrm</em></strong> command in your working directory and it will delete all .svn folders at once.<br />
Have fun!</p>
<!--Amazon_CLS_IM_END-->]]></content:encoded>
			<wfw:commentRss>http://www.amiryan.org/2009/04/23/howto-delete-all-svn-folders-from-svn-working-directory/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Bugfix: Howto turn off gpg-agent usage in Enigmail in Thunderbird</title>
		<link>http://www.amiryan.org/2009/04/22/bugfix-howto-turn-off-gpg-agent-usage-in-enigmail-thunderbird/</link>
		<comments>http://www.amiryan.org/2009/04/22/bugfix-howto-turn-off-gpg-agent-usage-in-enigmail-thunderbird/#comments</comments>
		<pubDate>Wed, 22 Apr 2009 13:08:22 +0000</pubDate>
		<dc:creator>Alex Amiryan</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[howtos]]></category>
		<category><![CDATA[bugfix]]></category>
		<category><![CDATA[enigmail]]></category>
		<category><![CDATA[gpg]]></category>
		<category><![CDATA[gpg-agent]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[thunderbird]]></category>

		<guid isPermaLink="false">http://www.amiryan.org/?p=192</guid>
		<description><![CDATA[There is some bug in Enigmail v0.95.7 for Thunderbird. If you untick the checkbox &#8220;Use gpg-agent for passphrases&#8221; in Advanced tab of Advanced settings menu, Thunderbird in anyway will try to use gpg-agent if GPG_AGENT_INFO environment variable is set. The reason is some little bug in Enigmail source code. To fix it, first close Thunderbird, [...]]]></description>
			<content:encoded><![CDATA[<!--Amazon_CLS_IM_START--><p>There is some bug in Enigmail v0.95.7 for Thunderbird. If you untick the checkbox &#8220;Use gpg-agent for passphrases&#8221; in Advanced tab of Advanced settings menu, Thunderbird in anyway will try to use gpg-agent if <strong>GPG_AGENT_INFO</strong> environment variable is set.  The reason is some little bug in Enigmail source code. To fix it, first close Thunderbird, then just open <strong><em>.thunderbird</em></strong> folder in your home directory, search for <strong><em>enigmail.js</em></strong> file. It have to be in <strong><em>extensions</em></strong> folder in one of the random name folders. When you have found the <strong><em>enigmail.js</em></strong> file open it with your favorite text editor and find line number <strong>1368</strong>. It have to be this:</p>
<pre class="brush: javascript">useAgent= (this.gpgAgentInfo.envStr.length&gt;0 || this.prefBranch.getBoolPref("useGpgAgent"));</pre>
<p>Change the <strong>||</strong> sign to <strong>&amp;&amp;</strong>. After change this line have to look like this:</p>
<pre class="brush: javascript">useAgent= (this.gpgAgentInfo.envStr.length&gt;0 &amp;&amp; this.prefBranch.getBoolPref("useGpgAgent"));</pre>
<p>Save file. Now open Thunderbird and enjoy.</p>
<!--Amazon_CLS_IM_END-->]]></content:encoded>
			<wfw:commentRss>http://www.amiryan.org/2009/04/22/bugfix-howto-turn-off-gpg-agent-usage-in-enigmail-thunderbird/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Howto recursively add unversioned files into SVN repository</title>
		<link>http://www.amiryan.org/2009/04/22/howto-recursively-add-unversioned-files-into-svn-repository/</link>
		<comments>http://www.amiryan.org/2009/04/22/howto-recursively-add-unversioned-files-into-svn-repository/#comments</comments>
		<pubDate>Wed, 22 Apr 2009 12:29:02 +0000</pubDate>
		<dc:creator>Alex Amiryan</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[howtos]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[svn]]></category>

		<guid isPermaLink="false">http://www.amiryan.org/?p=189</guid>
		<description><![CDATA[Because svn add command does not support recursive addition of unversioned files you can use this little script to do it. Create new file in /usr/local/bin with name svnadd with following content #!&#47;bin&#47;sh svn status &#124; perl -ne 's/^\?\s+(\S.+)$/\1/g;chomp;system("svn add \"$_\"");' Save it. From now on you can execute svnadd command in your working directory.]]></description>
			<content:encoded><![CDATA[<!--Amazon_CLS_IM_START--><p>Because <em>svn add</em> command does not support recursive addition of unversioned files you can use this little script to do it.<br />
Create new file in <em>/usr/local/bin</em> with name <strong><em>svnadd</em></strong> with following content</p>
<pre class="brush: bash">#!&#47;bin&#47;sh
svn status | perl -ne 's/^\?\s+(\S.+)$/\1/g;chomp;system("svn add \"$_\"");'</pre>
<p>Save it. From now on you can execute <strong><em>svnadd</em></strong> command in your working directory.</p>
<!--Amazon_CLS_IM_END-->]]></content:encoded>
			<wfw:commentRss>http://www.amiryan.org/2009/04/22/howto-recursively-add-unversioned-files-into-svn-repository/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Efficient usage of CVS in web development</title>
		<link>http://www.amiryan.org/2008/08/01/efficient-usage-of-cvs-in-web-development/</link>
		<comments>http://www.amiryan.org/2008/08/01/efficient-usage-of-cvs-in-web-development/#comments</comments>
		<pubDate>Fri, 01 Aug 2008 12:11:52 +0000</pubDate>
		<dc:creator>Alex Amiryan</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[howtos]]></category>
		<category><![CDATA[cvs]]></category>

		<guid isPermaLink="false">http://alexamiryan.wordpress.com/?p=101</guid>
		<description><![CDATA[Hello. In this post I am going to introduce how we started using CVS in our work. First of all I want to tell what our job is. We are developing several big websites with about 20 000 lines of source code. We have 4 dedicated servers with Linux OS. So we need good version [...]]]></description>
			<content:encoded><![CDATA[<!--Amazon_CLS_IM_START--><p>Hello. In this post I am going to introduce how we started using CVS in our work.</p>
<p>First of all I want to tell what our job is. We are developing several big websites with about 20 000 lines of source code. We have 4 dedicated servers with Linux OS. So we need good version control system and ability to make changes to website several times a day. Also it will be good not upload files to server by hand and to have some test place to test unstable code. So I have chosen CVS for this purpose. But the problem is that CVS mostly for application developers who make new releases once a month. So we have to think some scheme of work to deal with CVS in web development.</p>
<p>Here is my solution to this problem. Note that we are working with this scheme for more than month and it seems to fit all our requirements.</p>
<p>So every developer has its own work directory which is located on the development server. Let&#8217;s put them in <strong>/home</strong>. So for example developer Mike has <strong>/home/mike</strong> and if he developing project which called <strong>mysite</strong> then it will be located on <strong>/home/mike/mysite</strong>.</p>
<p>Development server has to have apache and bind configured to allow developers to work and test their work. Every project has to have its own first level domain on developer server. Every user has to have it&#8217;s own subdomain on every project. So we have domain <strong>http://mysite</strong> and Mike can access his copy of <strong>mysite</strong> at <strong>http://mike.mysite</strong> . Also we need special domain for testing joined stable version of the site. Let&#8217;s call it <strong>http://test</strong> and we can access current stable version of mysite at <strong>http://mysite.test</strong> . This files can be located in <strong>/home/test</strong> .</p>
<p>Our online server has to have 2 CVS copies of the site and one clean copy (without CVS folders) which will serve online site. Let&#8217;s put CVS copies in <strong>/home/mysite_test</strong> and <strong>/home/mysite_dev</strong>. Online site will be in <strong>/home/mysite</strong>. If online site&#8217;s address is <strong>http://www.mysite.com</strong> then we have to also have <strong>http://dev.mysite.com</strong> and <strong>http://test.mysite.com</strong> .</p>
<p style="text-align:center;"><strong>Start of a project</strong></p>
<p>Project manager creates new CVS repository and new module. Let&#8217;s call it <strong>mysite</strong>. Then he tags whole project with tag which called <strong>mysite-stable-current</strong>.</p>
<pre class="brush: bash">cvs -q rtag -F -r HEAD mysite-stable-current mysite</pre>
<p style="text-align:center;"><strong>Start making new job on project</strong></p>
<p>When developper with name is <strong>Mike</strong> want to start making new job on the project he creates a new branch with name <strong>mysite-mike-job1</strong> from tag <strong>mysite-current-stable</strong> and starts to work on it.</p>
<pre class="brush: bash">cvs -q rtag -B -b -F -r mysite-stable-current mysite-mike-job1 mysite</pre>
<p style="text-align:center;"><strong>While developing</strong></p>
<p>While developing developer may want to test his work on online server, but without joining it to main branch. In that case he have to commit his current files and execute following command from server in <strong>/home/mysite_dev</strong>.</p>
<pre class="brush: bash">cvs -q update -d -r mysite-mike-job1</pre>
<p>Then he can test his unstable code on <strong>http://dev.mysite.com</strong></p>
<p style="text-align:center;"><strong>When job is finished</strong></p>
<p>When developer finishes and tested his job he needs commit all his files. After that project manager have to join the changes of the developer to the main branch. So he executes following commands:</p>
<pre class="brush: bash">mkdir /tmp/jkh23bhlh234
cd /tmp/jkh23bhlh234
cvs -q checkout -r mysite-mike-job1 mysite
cd mysite
cvs -q update -d -j mysite-stable-current
cvs -q commit -m "Updated with latest stable"
cd /home/manager/mysite
cvs -q update -d -j mysite-mike-job1
cvs -q commit -m "joined mysite-mike-job1"</pre>
<p>Then we have to tag this branch as merged</p>
<pre class="brush: bash">cvs -q rtag -F -r mysite-mike-job1 mysite-mike-job1-merged mysite</pre>
<p>To have history of stable versions we have to make additional tag in format <strong>mysite-stable-YEAR-MONTH-DAY_HOUR-MINUTE-SECOND</strong></p>
<pre class="brush: bash">cvs -q rtag -r HEAD mysite-stable-108-7-1_6-40-21 mysite</pre>
<p>Then we tag our joined version as <strong>mysite-stable-current</strong></p>
<pre class="brush: bash">cvs -q rtag -F -r HEAD mysite-stable-current mysite</pre>
<p style="text-align:center;"><strong>Uploading to online server</strong></p>
<p>To upload last stable version to server we need to execute following command in online server&#8217;s <strong>/home/mysite_test</strong> directory</p>
<pre class="brush: bash">cvs -q update -d -r mysite-stable-current</pre>
<p>Then we can make final test of the site on <strong>http://test.mysite.com</strong> before putting it online. When we finished testing and code is ready to become online we just need to execute following command to copy site from test to online:</p>
<pre class="brush: bash">/bin/cp -aT /home/mysite_test /home/mysite
find /home/mysite -name CVS -prune -exec rm -rf {} \\;
find /home/mysite -name .cvsignore -prune -exec rm -rf {} \\;</pre>
<p>That&#8217;s all.</p>
<p>I have wrote bunch of scripts in Perl to automate the process I have recently described. This project is called <a href="http://github.com/alexamiryan/Web-CVS-Tools">Web-CVS-Tools</a>. You just need suexec to execute these scripts with privileges of the right user according to your system configuration.</p>
<p>You can download latest version of <a href="http://github.com/alexamiryan/Web-CVS-Tools">Web-CVS-Tools</a> from <a href="http://github.com/alexamiryan/Web-CVS-Tools/tarball/master">here</a></p>
<p>Let me explain the purpose of each file in the <a href="http://github.com/alexamiryan/Web-CVS-Tools">Web-CVS-Tools</a>. Let&#8217;s start from dev_server directory</p>
<p><strong>work_config_global.pl</strong> &#8211; Global configuration for developers work script. There is defined list of the project and list of the developers.<br />
<strong>work.pl</strong> &#8211; Main script for developers. It must NOT be called directly, it must be included by the dev_username/work.pl scripts.<br />
<strong>dev_username/config.pl</strong> &#8211; Configuration for each developer.<br />
<strong>dev_username</strong><strong>/work.pl</strong> &#8211; Script that developer should call to get his work interface.<br />
<strong>manager/merge.pl</strong> &#8211; Script for project manager to merge developer&#8217;s work to main branch.</p>
<p>Now let&#8217;s look on online_server directory</p>
<p><strong>update_config.pl</strong> &#8211; Configuration for online server. There is array of sites where you must specify the directories of the dev, test main sites. Also there is array of developers and of course address of the CVSROOT.<br />
<strong>update.pl</strong> &#8211; Main script for uploading last stable version. Must be called directly.</p>
<p>That&#8217;s all.</p>
<p>If you have any questions, please do not hesitate to write me <img src='http://www.amiryan.org/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>For learning CVS I will advice to buy this book: </p>
<!--Amazon_CLS_IM_END-->]]></content:encoded>
			<wfw:commentRss>http://www.amiryan.org/2008/08/01/efficient-usage-of-cvs-in-web-development/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Beryl =&gt; Compiz Fusion</title>
		<link>http://www.amiryan.org/2008/04/22/beryl-compiz-fusion/</link>
		<comments>http://www.amiryan.org/2008/04/22/beryl-compiz-fusion/#comments</comments>
		<pubDate>Tue, 22 Apr 2008 23:10:00 +0000</pubDate>
		<dc:creator>Alex Amiryan</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Compiz-Fusion]]></category>
		<category><![CDATA[Perl]]></category>

		<guid isPermaLink="false">http://fenritz1349.wordpress.com/2008/04/22/beryl-compiz-fusion/</guid>
		<description><![CDATA[Few days ago I was trying to get Compiz Fusion work on my Fedora 8. Compiz Fusion is a new name for famous 3D desktop which named Beryl. Now two composite desktop managers have merged and now this union is called Compiz Fusion. After downloading their repository for yum I have installed everything like they [...]]]></description>
			<content:encoded><![CDATA[<!--Amazon_CLS_IM_START--><p><a href="http://alexamiryan.files.wordpress.com/2008/04/0001d992.jpg"><img class="alignleft size-medium wp-image-10" style="margin-left:5px;margin-right:5px;float:left;" src="http://alexamiryan.files.wordpress.com/2008/04/0001d992.jpg?w=300" alt="" width="300" height="187" /></a>Few days ago I was trying to get <a href="http://www.compiz-fusion.org">Compiz Fusion</a> work on my Fedora 8. <a href="http://www.compiz-fusion.org">Compiz Fusion</a> is a new name for famous 3D desktop which named Beryl. Now two composite desktop managers have merged and now this union is called <a href="http://www.compiz-fusion.org">Compiz Fusion</a>. After downloading their <a href="http://www.dfm.uninsubria.it/compiz/fusion/compiz-fusion.repo">repository for yum</a> I have installed everything like they say in <a href="http://forum.compiz-fusion.org/showthread.php?t=6147&amp;highlight=fedora">forum</a>. Everything is fine, cool and everything like that, BUT!  When switching to another viewport of the cube, items in taskbar remains the same. For example I open Konqueror on Cube side 1 and open Firefox on Cube side 2. On Cube side 1 I see both firefox and konqueror. It is very uncomfortable! I start googling and find the alternative for KDE&#8217;s default taskbar. It called <a href="http://www.kde-apps.org/content/show.php?content=49484">taskbar-compiz</a>. After download and compiling it I have got new taskbar which supports viewports!!! It&#8217;s GREAT!!! BUT! When compiz-fusion is in autostart and when KDE loads, viewports doesn&#8217;t work again!!! I have noticed that if you remove taskbar-compiz then add it again it works. So taskbar-compiz have to load after compiz-fusion. For this reason I wrote a little Perl script which executes compiz fusion, waits some time and then restarts kicker using dcop.<br />
Here is my script:</p>
<pre class="brush: bash">#!&#47;usr&#47;bin&#47;perl
$pid1=fork();
if($pid1){
  exit;
}
$pid=fork();
if($pid){
  sleep(10);
  exec("dcop kicker kicker restart");
}
else{
  exec("fusion-icon");
}</pre>
<p>Put link to this script in ~/.kde/Autostart/</p>
<!--Amazon_CLS_IM_END-->]]></content:encoded>
			<wfw:commentRss>http://www.amiryan.org/2008/04/22/beryl-compiz-fusion/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>pptpconfig bugfix</title>
		<link>http://www.amiryan.org/2008/04/22/pptpconfig-bugfix/</link>
		<comments>http://www.amiryan.org/2008/04/22/pptpconfig-bugfix/#comments</comments>
		<pubDate>Tue, 22 Apr 2008 18:39:00 +0000</pubDate>
		<dc:creator>Alex Amiryan</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[bugfix]]></category>
		<category><![CDATA[pptp]]></category>
		<category><![CDATA[VPN]]></category>

		<guid isPermaLink="false">http://fenritz1349.wordpress.com/2008/04/22/pptpconfig-bugfix/</guid>
		<description><![CDATA[I have WiFi in my home and I need to connect to provider&#8217;s VPN server to gain access to internet. Their VPN is pptp. So after some googling I find the pptpconfig project which brings ability to connect to pptp server in Linux. After installation everything was fine. This program has both cli and gui [...]]]></description>
			<content:encoded><![CDATA[<!--Amazon_CLS_IM_START--><p>I have WiFi in my home and I need to connect to provider&#8217;s VPN server to gain access to internet. Their VPN is pptp. So after some googling  I find the <strong><a href="http://pptpclient.sourceforge.net/">pptpconfig</a> </strong>project which brings ability to connect to pptp server in Linux. After installation everything was fine. This program has both cli and gui interfaces. Once I tried to to put pptpconfig in my <strong>/etc/rc.d/rc.local</strong> file to autostart pptp tunnel at system startup I noticed that it is not changing my default route in kernel routing tables. So every time I had to manualy change default route to have internet. After some investigations I noticed the error.<br />
Here is the output of the program</p>
<pre class="brush: bash"># pptpconfig somename start</pre>
<p>It gives this output:</p>
<pre class="brush: text">pptpconfig: pppd process exit status 0 (started)
ip route replace 192.168.8.1 dev eth1  src 192.168.8.94
pptpconfig: routes added to remote networks
ip route replace default dev
Command line is not complete. Try option "help"

pptpconfig: command failed, exit code 255
pptpconfig: default route changed to use tunnel
pptpconfig: DNS changes made to /etc/resolv.conf
pptpconfig: connected</pre>
<p>Notice that there is a problem with invoking iproute command. So everything started, but nothing added to kernel routing table. I am used Fedora 8 at this time, but I think that this problem exists on earlier Fedoras too.<br />
After some debugging of the code, I have fixed this problem. I have sent the patch file to pptpconfig&#8217;s developers, but <span style="font-style:italic;">James Cameron</span>, one of the developers of this project, said that they are not planning to release a new version of pptpconfig in the near future, so anyone who have problem similar to mine, they can use CVS version of pptpconfig or just find my patch in the mailing list. Also I noticed that there were some people who used my patch and they said that it worked.<br />
If anyone is experiencing problems like this apply this patch to pptpconfig.php</p>
<pre class="brush: diff">--- pptpconfig_fixed.php    2008-03-31 02:48:18.000000000 +0500
+++ pptpconfig.php    2008-01-07 21:53:56.000000000 +0400
@@ -1801,9 +1801,9 @@
$command .= 'exit $pppd_exit_code;';

$context['pipe'] = popen($command.' 2&gt;&amp;1', 'r');
+    socket_set_blocking($context['pipe'], FALSE);

if ($use_gui) {
-        socket_set_blocking($context['pipe'], FALSE);
$window-&gt;set_data('state', 'starting');
setup_list_set_state($name, 'starting');</pre>
<!--Amazon_CLS_IM_END-->]]></content:encoded>
			<wfw:commentRss>http://www.amiryan.org/2008/04/22/pptpconfig-bugfix/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
