<?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>P0L0&#039;s Blog &#187; linux</title>
	<atom:link href="http://p0l0.binware.org/index.php/tag/linux/feed/" rel="self" type="application/rss+xml" />
	<link>http://p0l0.binware.org</link>
	<description>Opensource Projects and IT experiences</description>
	<lastBuildDate>Sun, 30 Oct 2011 08:39:29 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
		<item>
		<title>ChiliProject 1.4.0 + Ruby Enterprise + Passenger + Apache2</title>
		<link>http://p0l0.binware.org/index.php/2011/05/30/redmine-1-2-ruby-enterprise-passenger-apache2/</link>
		<comments>http://p0l0.binware.org/index.php/2011/05/30/redmine-1-2-ruby-enterprise-passenger-apache2/#comments</comments>
		<pubDate>Mon, 30 May 2011 18:29:43 +0000</pubDate>
		<dc:creator>P0L0</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[GNU/Linux]]></category>
		<category><![CDATA[IT Security]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[chiliproject]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[redmine]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[trac]]></category>

		<guid isPermaLink="false">http://p0l0.binware.org/?p=732</guid>
		<description><![CDATA[I was a happy Trac user, but after seeing Redmine, I realized that Trac has many missing features and that you must do a lot of things with plugins, Redmine has this features out-of-box. After working a bit with Redmine I discovered ChiliProject, which is a fork of Redmine, and its actually compatible with Redmine [...]]]></description>
			<content:encoded><![CDATA[<p>I was a happy <a href="http://trac.edgewall.org/" target="_blank">Trac</a> user, but after seeing <a href="http://www.redmine.org/" target="_blank">Redmine</a>, I realized that Trac has many missing features and that you must do a lot of things with plugins, Redmine has this features out-of-box. After working a bit with Redmine I discovered <a href="https://www.chiliproject.org/" target="_blank">ChiliProject</a>, which is a <a href="https://www.chiliproject.org/projects/chiliproject/wiki/Why_Fork" target="_blank">fork</a> of Redmine, and its actually compatible with Redmine <a href="http://www.redmine.org/projects/redmine/wiki/Theme_List" target="_blank">Themes</a> and <a href="http://www.redmine.org/plugins" target="_blank">Plugins</a>.</p>
<p>Here is a comparison of Redmine/ChiliProject and Trac features:<br />
<span id="more-732"></span></p>
<p><div style="margin-left: -20px; margin-top: 20px; margin-bottom: 20px;"><script type="text/javascript"><!--
google_ad_client = "ca-pub-5682258244719056";
/* Inline Post */
google_ad_slot = "6946080416";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></div></p>
<table>
<tr>
<th>Feature</th>
<th>Redmine/ChiliProject</th>
<th>Trac</th>
</tr>
<tr>
<td>Multiple projects support</td>
<td style="color: green;">Yes</td>
<td style="color: orange;">No (with plugin, planned 0.14)</td>
</tr>
<tr>
<td>Flexible role based access control</td>
<td style="color: green;">Yes</td>
<td style="color: red;">No</td>
</tr>
<tr>
<td>Flexible issue tracking system</td>
<td style="color: green;">Yes</td>
<td style="color: orange;">Yes (no bulk ticket changes and ticket dependencies)</td>
</tr>
<tr>
<td>Gantt chart and calendar</td>
<td style="color: green;">Yes</td>
<td style="color: red;">No (<a href="http://trac-hacks.org/wiki/GanttCalendarPlugin" target="_blank" style="color: red;">GanttCalendarPlugin</a>)</td>
</tr>
<tr>
<td>Feeds &#038; email notifications</td>
<td style="color: green;">Yes</td>
<td style="color: red;">Yes</td>
</tr>
<tr>
<td>Per project wiki</td>
<td style="color: green;">Yes</td>
<td style="color: red;">Yes</td>
</tr>
<tr>
<td>Per project forums</td>
<td style="color: green;">Yes</td>
<td style="color: red;">No (<a href="http://trac-hacks.org/wiki/DiscussionPlugin" target="_blank" style="color: red;">DiscussionPlugin</a>)</td>
</tr>
<tr>
<td>Time tracking</td>
<td style="color: green;">Yes</td>
<td style="color: orange;">No (<a href="http://trac.edgewall.org/wiki/TimeTracking" target="_blank" style="color: orange;">Plugins or custom field</a>)</td>
</tr>
<tr>
<td>Custom fields for issues, time-entries, projects and users</td>
<td style="color: green;">Yes</td>
<td style="color: green;">Yes (<a href="http://trac.edgewall.org/wiki/TracTicketsCustomFields" target="_blank" style="color: green;">editing trac.ini</a>)</td>
</tr>
<tr>
<td>SCM integration</td>
<td style="color: green;">SVN, CVS, Git, Mercurial, Bazaar and Darcs</td>
<td style="color: orange;">SVN in core, others with Plugins</td>
</tr>
<tr>
<td>Issue creation via email</td>
<td style="color: green;">Yes</td>
<td style="color: orange;">No (<a href="http://trac-hacks.org/wiki/MailToTracPlugin" target="_blank" style="color: orange;">MailToTracPlugin</a>)</td>
</tr>
<tr>
<td>Multiple LDAP authentication support</td>
<td style="color: green;">Yes</td>
<td style="color: orange;">No (<a href="http://trac-hacks.org/wiki/LdapPlugin" target="_blank" style="color: orange;">LDAPPlugin</a>)</td>
</tr>
<tr>
<td>User self-registration support</td>
<td style="color: green;">Yes</td>
<td style="color: orange;">No (<a href="http://trac-hacks.org/wiki/AccountManagerPlugin" target="_blank" style="color: orange;">AccountManagerPlugin</a>)</td>
</tr>
<tr>
<td>Multilanguage support</td>
<td style="color: green;">Yes</td>
<td style="color: green;">Yes</td>
</tr>
<tr>
<td>Multiple databases support</td>
<td style="color: green;">MySQL, PostgreSQL, SQLite</td>
<td style="color: orange;">MySQL (unstable), PostgreSQL, SQLite</td>
</tr>
<tr>
<td>iPhone/Android Apps</td>
<td style="color: green;">Yes</td>
<td style="color: red;">No</td>
</tr>
</table>
<p>The first thing that made me not to test Redmine/ChiliProject immediately was that it is RoR and the complexity to make it run stable under apache, but after searching a bit, I found <a href="http://www.modrails.com/" target="_blank">Phusion Passenger</a> and <a href="http://www.rubyenterpriseedition.com/" target="_blank">Ruby Enterprise</a>, which is a very good solution to run RoR products stable under Apache, and you have the ability to run Ruby with custom user, usefull for shared environments.</p>
<h3>Installation</h3>
<ol>
<li>
<p>Ruby Enterprise</p>
<p>I downloaded and installer from source code, so that it&#8217;s compiled for my server and I can store it in a specific location. So, the first we have to do is download latest version from <a href="http://www.rubyenterpriseedition.com/download.html" target="_blank">Ruby Enterprise Download page</a></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">wget</span> http:<span style="color: #000000; font-weight: bold;">//</span>rubyenterpriseedition.googlecode.com<span style="color: #000000; font-weight: bold;">/</span>files<span style="color: #000000; font-weight: bold;">/</span>ruby-enterprise-1.8.7-<span style="color: #000000;">2011.03</span>.tar.gz
<span style="color: #c20cb9; font-weight: bold;">tar</span> zxvf ruby-enterprise-1.8.7-<span style="color: #000000;">2011.03</span>.tar.gz
<span style="color: #7a0874; font-weight: bold;">cd</span> ruby-enterprise-1.8.7-<span style="color: #000000;">2011.03</span>
.<span style="color: #000000; font-weight: bold;">/</span>installer</pre></div></div>

<p>Follow installer instructions, and install dependencies if needed (the installer tells us which packages we need for our Linux distro)</p>
</li>
<li>
<p>Phusion Passenger</p>
<p>Next thing to do, is install the Passanger module for apache, this can be done with the <em>passenger-install-apache2-module</em> script available at Ruby Enterprise installation</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span>ruby-enterprise-1.8.7-<span style="color: #000000;">2011.03</span><span style="color: #000000; font-weight: bold;">/</span>bin
.<span style="color: #000000; font-weight: bold;">/</span>passenger-install-apache2-module</pre></div></div>

<p>This script also checks the dependencies and says what packages you need for your Linux distro</p>
</li>
<li>
<p>Apache</p>
<p>Now we need to configure apache, first we need to activate and configure the passenger module</p>
<p><strong>/etc/apache2/mods-enabled/passenger.load</strong></p>

<div class="wp_syntax"><div class="code"><pre class="apache" style="font-family:monospace;"><span style="color: #00007f;">LoadModule</span> passenger_module /opt/ruby-enterprise-1.8.7-<span style="color: #ff0000;">2011.03</span>/lib/ruby/gems/<span style="color: #ff0000;">1.8</span>/gems/passenger-3.0.7/ext/apache2/mod_passenger.so</pre></div></div>

<p><strong>/etc/apache2/mods-enabled/passenger.conf</strong></p>

<div class="wp_syntax"><div class="code"><pre class="apache" style="font-family:monospace;">&lt;<span style="color: #000000; font-weight:bold;">ifmodule</span> mod_passenger.c&gt;
  PassengerRoot /opt/ruby-enterprise-1.8.7-<span style="color: #ff0000;">2011.03</span>/lib/ruby/gems/<span style="color: #ff0000;">1.8</span>/gems/passenger-3.0.7
  PassengerRuby /opt/ruby-enterprise-1.8.7-<span style="color: #ff0000;">2011.03</span>/bin/ruby
&nbsp;
  PassengerFriendlyErrorPages <span style="color: #0000ff;">Off</span>
  PassengerUserSwitching <span style="color: #0000ff;">On</span>
  PassengerDefaultUser www-data
  PassengerDefaultGroup www-data
&lt;/<span style="color: #000000; font-weight:bold;">ifmodule</span>&gt;</pre></div></div>

<p>And the last thing is configure a vhost under which we will run this ChiliProject installation</p>
<p><strong>/etc/apache2/sites-enabled/chiliproject</strong></p>

<div class="wp_syntax"><div class="code"><pre class="apache" style="font-family:monospace;"><span style="color: #00007f;">NameVirtualHost</span> *:<span style="color: #ff0000;">443</span>
&lt;<span style="color: #000000; font-weight:bold;">virtualhost</span> *:<span style="color: #ff0000;">443</span>&gt;
	<span style="color: #00007f;">SSLEngine</span> <span style="color: #0000ff;">on</span>
&nbsp;
	<span style="color: #00007f;">SSLCertificateFile</span>    /etc/apache2/ssl/server.crt
	<span style="color: #00007f;">SSLCertificateKeyFile</span> /etc/apache2/ssl/server.key
&nbsp;
	&lt;<span style="color: #000000; font-weight:bold;">ifmodule</span> mod_passenger.c&gt;
		PassengerUser chiliproject
		PassengerGroup chiliproject
	&lt;/<span style="color: #000000; font-weight:bold;">ifmodule</span>&gt;
&nbsp;
        <span style="color: #00007f;">ServerAdmin</span> webmaster@chiliproject.org
	<span style="color: #00007f;">ServerName</span> chiliproject.org
&nbsp;
	<span style="color: #00007f;">DocumentRoot</span> /home/chiliproject/public
	&lt;<span style="color: #000000; font-weight:bold;">directory</span> /&gt;
		<span style="color: #00007f;">Options</span> -MultiViews
		<span style="color: #00007f;">AllowOverride</span> <span style="color: #0000ff;">All</span>
	&lt; /Directory&gt;
&nbsp;
	<span style="color: #00007f;">ErrorLog</span> /var/log/apache2/chiliproject-error.log
&nbsp;
	<span style="color: #00007f;">CustomLog</span> /var/log/apache2/chiliproject-access.log combined
&lt;/<span style="color: #000000; font-weight:bold;">virtualhost</span>&gt;</pre></div></div>

</li>
<li>
<p>ChiliProject</p>
<p>First install needed gems</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span>ruby-enterprise-1.8.7-<span style="color: #000000;">2011.03</span><span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>gem <span style="color: #c20cb9; font-weight: bold;">install</span> <span style="color: #660033;">-v</span>=0.4.2 i18n
<span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span>ruby-enterprise-1.8.7-<span style="color: #000000;">2011.03</span><span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>gem <span style="color: #c20cb9; font-weight: bold;">install</span> <span style="color: #660033;">-v</span>=1.0.1 rack
<span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span>ruby-enterprise-1.8.7-<span style="color: #000000;">2011.03</span><span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>gem <span style="color: #c20cb9; font-weight: bold;">install</span> mysql</pre></div></div>

<p>Download the last available ChiliProject version from <a href="https://www.chiliproject.org/projects/chiliproject/files" target="_blank">ChiliProject Files Page</a></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">wget</span> https:<span style="color: #000000; font-weight: bold;">//</span>www.chiliproject.org<span style="color: #000000; font-weight: bold;">/</span>attachments<span style="color: #000000; font-weight: bold;">/</span>download<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">99</span><span style="color: #000000; font-weight: bold;">/</span>chiliproject-1.4.0.tar.gz
<span style="color: #c20cb9; font-weight: bold;">tar</span> zxvf chiliproject-1.4.0.tar.gz
<span style="color: #c20cb9; font-weight: bold;">mv</span> chiliproject-1.4.0 <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>chiliproject</pre></div></div>

<p>Create the mysql database and user for ChiliProject</p>

<div class="wp_syntax"><div class="code"><pre class="sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">CREATE</span> <span style="color: #993333; font-weight: bold;">DATABASE</span> chiliproject <span style="color: #993333; font-weight: bold;">CHARACTER</span> <span style="color: #993333; font-weight: bold;">SET</span> utf8 <span style="color: #993333; font-weight: bold;">COLLATE</span> utf8_unicode_ci;
<span style="color: #993333; font-weight: bold;">GRANT</span> <span style="color: #993333; font-weight: bold;">ALL</span> privileges <span style="color: #993333; font-weight: bold;">ON</span> chiliproject<span style="color: #66cc66;">.*</span> <span style="color: #993333; font-weight: bold;">TO</span> <span style="color: #ff0000;">'chiliproject'</span>@<span style="color: #ff0000;">'localhost'</span> <span style="color: #993333; font-weight: bold;">IDENTIFIED</span> <span style="color: #993333; font-weight: bold;">BY</span> <span style="color: #ff0000;">'my_password'</span>;</pre></div></div>

<p>Configure ChiliProject Database Connection</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">mv</span> config<span style="color: #000000; font-weight: bold;">/</span>database.yml.example config<span style="color: #000000; font-weight: bold;">/</span>database.yml</pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="yml" style="font-family:monospace;">production:
  adapter: mysql
  database: chiliproject
  host: localhost
  username: chiliproject
  password: my_password</pre></div></div>

<p>Now initialize ChiliProject (session Store, DB Tables, DB Default Data</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span>ruby-enterprise-1.8.7-<span style="color: #000000;">2011.03</span><span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>rake generate_session_store
<span style="color: #007800;">RAILS_ENV</span>=production <span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span>ruby-enterprise-1.8.7-<span style="color: #000000;">2011.03</span><span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>rake db:migrate
<span style="color: #007800;">RAILS_ENV</span>=production <span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span>ruby-enterprise-1.8.7-<span style="color: #000000;">2011.03</span><span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>rake redmine:load_default_data</pre></div></div>

<p>And the last thing we need to do before we can restart apache and begin to use the new installed ChiliProject, we need to create the <em>chiliproject</em> user</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">adduser <span style="color: #660033;">--home</span> <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>chiliproject <span style="color: #660033;">--shell</span> <span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">false</span> <span style="color: #660033;">--no-create-home</span> chiliproject
<span style="color: #c20cb9; font-weight: bold;">chown</span> <span style="color: #660033;">-R</span> chiliproject:chiliproject <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>chiliproject</pre></div></div>

</li>
<div style="margin-left: -40px;">
<div style="margin-left: -20px; margin-top: 20px; margin-bottom: 20px;"><script type="text/javascript"><!--
google_ad_client = "ca-pub-5682258244719056";
/* Inline Post */
google_ad_slot = "6946080416";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></div>
</div>
<li>
<p>(Optinal) Rmagick</p>
<p>If we would like to enable Gantt export to png image we need to install Rmagick (available as gem). First we need to install imagemagick ang graphicsmagick dev packages and then we can install the rmagick gem.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> libmagickcore-dev libgraphicsmagick1-dev libmagickwand-dev
<span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span>ruby-enterprise-1.8.7-<span style="color: #000000;">2011.03</span><span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>gem <span style="color: #c20cb9; font-weight: bold;">install</span> rmagick</pre></div></div>

</li>
</ol>
<p>Now we only need to restart Apache and load ChiliProject in our Browser. The default user is <em><strong>admin/admin</strong></em></p>
]]></content:encoded>
			<wfw:commentRss>http://p0l0.binware.org/index.php/2011/05/30/redmine-1-2-ruby-enterprise-passenger-apache2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Spidermonkey &#8211; Execute javascript from console</title>
		<link>http://p0l0.binware.org/index.php/2010/05/24/spidermonkey-execute-javascript-from-console/</link>
		<comments>http://p0l0.binware.org/index.php/2010/05/24/spidermonkey-execute-javascript-from-console/#comments</comments>
		<pubDate>Mon, 24 May 2010 06:09:26 +0000</pubDate>
		<dc:creator>P0L0</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[GNU/Linux]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://p0l0.binware.org/?p=693</guid>
		<description><![CDATA[SpiderMonkey is the code-name for the Mozilla&#8217;s C implementation of JavaScript. This is useful to test part of our JavaScript from the console or in scripts. In Debian we have a package called spidermonkey-bin. apt-get install spidermonkey-bin After installing you will have a program called smjs. If you start the program without parameters you will [...]]]></description>
			<content:encoded><![CDATA[<p>SpiderMonkey is the code-name for the Mozilla&#8217;s C implementation of JavaScript. This is useful to test part of our JavaScript from the console or in scripts.</p>
<p>In Debian we have a package called <strong>spidermonkey-bin</strong>.</p>
<p><span id="more-693"></span></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> spidermonkey-bin</pre></div></div>

<p><div style="margin-left: -20px; margin-top: 20px; margin-bottom: 20px;"><script type="text/javascript"><!--
google_ad_client = "ca-pub-5682258244719056";
/* Inline Post */
google_ad_slot = "6946080416";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></div></p>
<p>After installing you will have a program called <strong>smjs</strong>.</p>
<p>If you start the program without parameters you will get a <strong>Javascript shell</strong>, in which you can write and test javascript.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>smjs
js<span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #000000; font-weight: bold;">function</span> <span style="color: #7a0874; font-weight: bold;">test</span><span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span>
print<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #ff0000;">'test'</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>;
<span style="color: #7a0874; font-weight: bold;">&#125;</span>
js<span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #7a0874; font-weight: bold;">test</span>
<span style="color: #000000; font-weight: bold;">function</span> <span style="color: #7a0874; font-weight: bold;">test</span><span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span>
    print<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #ff0000;">&quot;test&quot;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>;
<span style="color: #7a0874; font-weight: bold;">&#125;</span>
js<span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #7a0874; font-weight: bold;">test</span><span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>;
<span style="color: #7a0874; font-weight: bold;">test</span>
js<span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #000000; font-weight: bold;">function</span> <span style="color: #7a0874; font-weight: bold;">test</span><span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span>
print<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #ff0000;">'test'</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>;
test2<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000;">123</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>;
<span style="color: #7a0874; font-weight: bold;">&#125;</span>
js<span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #000000; font-weight: bold;">function</span> test2<span style="color: #7a0874; font-weight: bold;">&#40;</span>param<span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span>
print <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #ff0000;">'test2: '</span> + param<span style="color: #7a0874; font-weight: bold;">&#41;</span>;
<span style="color: #7a0874; font-weight: bold;">&#125;</span>
js<span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #7a0874; font-weight: bold;">test</span><span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>;
<span style="color: #7a0874; font-weight: bold;">test</span>
test2: <span style="color: #000000;">123</span>
js<span style="color: #000000; font-weight: bold;">&gt;</span></pre></div></div>

<p>To exit the shell, just press &#8220;<strong>Ctrl+D</strong>&#8220;.</p>
<p>It&#8217;s important to note that in spidermonkey you doesn&#8217;t have the &#8220;<strong>document</strong>&#8221; Object. If you want to print out text, you cant use <strong>document.write</strong>, you should use <strong>print</strong>.</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">document.<span style="color: #000066; font-weight: bold;">write</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'test'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">// In browser</span>
<span style="color: #000066;">print</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'test'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">//spidermonkey</span></pre></div></div>

<p>You can also make <strong>smjs</strong> to execute the content of a file.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>smjs test-local.js
Rand: <span style="color: #000000;">407</span>
Old: <span style="color: #000000;">600</span>
New: <span style="color: #000000;">800</span>
Result: old</pre></div></div>

<p><div style="margin-left: -20px; margin-top: 20px; margin-bottom: 20px;"><script type="text/javascript"><!--
google_ad_client = "ca-pub-5682258244719056";
/* Inline Post */
google_ad_slot = "6946080416";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></div></p>
]]></content:encoded>
			<wfw:commentRss>http://p0l0.binware.org/index.php/2010/05/24/spidermonkey-execute-javascript-from-console/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Installing TRAC with mod_wsgi using virtualenv</title>
		<link>http://p0l0.binware.org/index.php/2010/05/10/installing-trac-with-mod_wsgi-using-virtualenv/</link>
		<comments>http://p0l0.binware.org/index.php/2010/05/10/installing-trac-with-mod_wsgi-using-virtualenv/#comments</comments>
		<pubDate>Mon, 10 May 2010 19:33:03 +0000</pubDate>
		<dc:creator>P0L0</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[GNU/Linux]]></category>
		<category><![CDATA[IT Security]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[mod_wsgi]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[svn]]></category>
		<category><![CDATA[trac]]></category>
		<category><![CDATA[virtualenv]]></category>

		<guid isPermaLink="false">http://p0l0.binware.org/?p=664</guid>
		<description><![CDATA[This guide is for installing Trac as a user using virtualenv for a isolated Python environment so that the whole installation runs under a specific user. First of all we need to install needed packages apt-get install libapache2-mod-wsgi python-virtualenv python-setuptools Once we have installed the required packages proceed to create the Python environment mkdir /usr/local/trac [...]]]></description>
			<content:encoded><![CDATA[<p>This guide is for installing <a href="http://trac.edgewall.org/" target="_blank">Trac </a> as a user using <a href="http://pypi.python.org/pypi/virtualenv/1.4.8" target="_blank">virtualenv</a> for a isolated Python environment so that the whole installation runs under a specific user.</p>
<p>First of all we need to install needed packages</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> libapache2-mod-wsgi python-virtualenv python-setuptools</pre></div></div>

<p>Once we have installed the required packages proceed to create the Python environment</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>trac
<span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>trac
virtualenv python</pre></div></div>

<p>We now have the isolated Python environment locate under <strong>/usr/local/trac/python</strong>.</p>
<p>To make possible to use <strong>easy_install</strong> with repositories we need to upgrade easy_install. I use this to install Trac plugins directly from SVN.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>trac<span style="color: #000000; font-weight: bold;">/</span>python<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>easy_install <span style="color: #660033;">-U</span> trunk</pre></div></div>

<p>We now can install trac 0.12 using the 0.12b1 SVN Tag (<strong>http://svn.edgewall.com/repos/trac/tags/trac-0.12b1</strong> or <strong>Trac==0.12b1</strong>) or directly from SVN Trunk:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>trac<span style="color: #000000; font-weight: bold;">/</span>python<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>easy_install http:<span style="color: #000000; font-weight: bold;">//</span>svn.edgewall.org<span style="color: #000000; font-weight: bold;">/</span>repos<span style="color: #000000; font-weight: bold;">/</span>trac<span style="color: #000000; font-weight: bold;">/</span>trunk</pre></div></div>

<p>This will download and install the latest trunk version for Trac.</p>
<p>To have webaccess to the Trac projects, we need a <strong>.wsgi</strong> script, were we define where our local python environment is located:</p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;"><span style="color: #808080; font-style: italic;"># Not needed if mod_wsgi &gt;= 3.0</span>
<span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">sys</span>
<span style="color: #dc143c;">sys</span>.<span style="color: black;">stdout</span> = <span style="color: #dc143c;">sys</span>.<span style="color: black;">stderr</span>
&nbsp;
<span style="color: #808080; font-style: italic;"># Load Trac</span>
<span style="color: #ff7700;font-weight:bold;">import</span> trac.<span style="color: black;">web</span>.<span style="color: black;">main</span>
application = trac.<span style="color: black;">web</span>.<span style="color: black;">main</span>.<span style="color: black;">dispatch_request</span></pre></div></div>

<p>And finally we need to configure apache. If you want only one Trac project, you should define <strong>trac.env</strong> to the location of your trac, but if you want multiproject support, you must use <strong>trac.env_parent_dir</strong> (this is what I used)</p>

<div class="wp_syntax"><div class="code"><pre class="apache" style="font-family:monospace;">&lt;<span style="color: #000000; font-weight:bold;">virtualhost</span> *:<span style="color: #ff0000;">80</span>&gt;
    <span style="color: #00007f;">ServerName</span> trac.dns.com
&nbsp;
    <span style="color: #00007f;">DocumentRoot</span> /usr/local/trac/htdocs
    <span style="color: #00007f;">ErrorLog</span> /var/log/apache2/trac-error.log
    <span style="color: #00007f;">CustomLog</span> /var/log/apache2/trac-access.log combined
&nbsp;
    <span style="color: #adadad; font-style: italic;"># Trac Auth</span>
    &lt;<span style="color: #000000; font-weight:bold;">location</span> /&gt;
        <span style="color: #00007f;">AuthType</span> Basic
        <span style="color: #00007f;">AuthName</span> <span style="color: #7f007f;">&quot;Trac&quot;</span>
        <span style="color: #00007f;">AuthUserFile</span> /usr/local/trac/.htpasswd
        <span style="color: #00007f;">Require</span> valid-<span style="color: #00007f;">user</span>
    &lt; /location&gt;
&nbsp;
    <span style="color: #adadad; font-style: italic;">#Trac</span>
    <span style="color: #adadad; font-style: italic;">#Define ProcessGroup with user and group under which it should run</span>
    WSGIDaemonProcess trac <span style="color: #00007f;">user</span>=trac <span style="color: #00007f;">group</span>=trac python-path=/usr/local/trac/python/lib/python2.5/site-packages python-eggs=/usr/local/trac/python/cache
    WSGIScriptAlias / /usr/local/trac/htdocs/trac.wsgi
&nbsp;
    &lt;<span style="color: #000000; font-weight:bold;">directory</span> /usr/local/trac/htdocs&gt;
        WSGIProcessGroup trac
        WSGIApplicationGroup %{GLOBAL}
        <span style="color: #00007f;">SetEnv</span> trac.env_parent_dir /usr/local/trac/projects
    &lt;/<span style="color: #000000; font-weight:bold;">directory</span>&gt;
&lt;/<span style="color: #000000; font-weight:bold;">virtualhost</span>&gt;</pre></div></div>

<p>We need to create the user and change the permissions for <strong>/usr/local/trac</strong> for that user <strong>trac</strong></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">adduser <span style="color: #660033;">--home</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>trac <span style="color: #660033;">--shell</span> <span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">false</span> <span style="color: #660033;">--no-create-home</span> trac
<span style="color: #c20cb9; font-weight: bold;">chown</span> <span style="color: #660033;">-R</span> trac:trac <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>trac</pre></div></div>

<p>If you get an error <strong>&#8220;ImportError: No module named simplejson&#8221;</strong> just install it using easy_install</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>trac<span style="color: #000000; font-weight: bold;">/</span>python<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>easy_install simplejson</pre></div></div>

<p><div style="margin-left: -20px; margin-top: 20px; margin-bottom: 20px;"><script type="text/javascript"><!--
google_ad_client = "ca-pub-5682258244719056";
/* Inline Post */
google_ad_slot = "6946080416";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></div></p>
]]></content:encoded>
			<wfw:commentRss>http://p0l0.binware.org/index.php/2010/05/10/installing-trac-with-mod_wsgi-using-virtualenv/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Mysql Replication</title>
		<link>http://p0l0.binware.org/index.php/2007/04/18/mysql-replication/</link>
		<comments>http://p0l0.binware.org/index.php/2007/04/18/mysql-replication/#comments</comments>
		<pubDate>Wed, 18 Apr 2007 07:32:59 +0000</pubDate>
		<dc:creator>P0L0</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[GNU/Linux]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[mysql]]></category>

		<guid isPermaLink="false">http://p0l0.binware.org/index.php/2007/04/18/mysql-replication/</guid>
		<description><![CDATA[Aqui voy a explicar como poder montar un sistema de maestro-esclavo(s) en mysql. La idea es que hay un servidor principal, que es en el que se modifican los datos y los esclavos solo estan ahi para tenerlo todo duplicado, esto es perfecto para hacer copias de seguridad. Si la idea es tener transferencia de [...]]]></description>
			<content:encoded><![CDATA[<p>Aqui voy a explicar como poder montar un sistema de maestro-esclavo(s) en mysql. La idea es que hay un servidor principal, que es en el que se modifican los datos y los esclavos solo estan ahi para tenerlo todo duplicado, esto es perfecto para hacer copias de seguridad. Si la idea es tener transferencia de datos bidireccional, hay que montar un &#8220;<a href="http://dev.mysql.com/doc/refman/5.1/en/mysql-cluster.html" target="_new">MySQL Cluster</a>&#8220;</p>
<p>La replicacion funciona por medio de los binary log de mysql, asi que lo primero sera configurar correctamente el servidor maestro. Asi que añadimos estas opciones en el fichero my.cnf si aun no estan.</p>

<div class="wp_syntax"><div class="code"><pre class="ini" style="font-family:monospace;"><span style="color: #000066; font-weight:bold;"><span style="">&#91;</span>mysql<span style="">&#93;</span></span>
#Activamos el log binario
<span style="color: #000099;">log-bin</span><span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;">mysql-bin</span>
#Establecemos un id para el servidor, el maestro SIEMPRE sera <span style="">1</span>
<span style="color: #000099;">server_id</span><span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;">1</span>
#Esto ayuda por si el master tiene un cuelgue y no haya problemas en la replicacion al volver a arrancarlo
<span style="color: #000099;">sync_binlog</span><span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;">1</span>
#Si trabajamos con INNODB, hay que activar esto
<span style="color: #000099;">innodb_flush_log_at_trx_commit</span><span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;">1</span></pre></div></div>

<p><strong>IMPORTANTE</strong>: Hay que comprobar que la linea <em>skip-networking </em>no este puesta en el master, ya que sino no abrira el puerto</p>
<p>Ahora dejaremos lista la configuracion en el esclavo</p>

<div class="wp_syntax"><div class="code"><pre class="ini" style="font-family:monospace;"><span style="color: #000066; font-weight:bold;"><span style="">&#91;</span>mysql<span style="">&#93;</span></span>
#Activamos el log binario
<span style="color: #000099;">log-bin</span><span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;">mysql-bin</span>
#Id del esclavo, este tiene que ser unico
<span style="color: #000099;">server_id</span><span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;">2</span></pre></div></div>

<p>Ahora en el maestro le damos permisos al esclavo</p>

<div class="wp_syntax"><div class="code"><pre class="sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">GRANT</span> REPLICATION SLAVE <span style="color: #993333; font-weight: bold;">ON</span> <span style="color: #66cc66;">*.*</span> <span style="color: #993333; font-weight: bold;">TO</span> slave@IP_ESCLAVO <span style="color: #993333; font-weight: bold;">IDENTIFIED</span> <span style="color: #993333; font-weight: bold;">BY</span> <span style="color: #ff0000;">'slavepass'</span>;</pre></div></div>

<p>Ahora vamos a hacer un <em>snapshot</em> de la posicion actual del maestro para dejar el esclavo en la misma posicion para empezar a replicar. Nos conectamos al servidor maestro y ejecutamos lo siguiente:</p>

<div class="wp_syntax"><div class="code"><pre class="sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">FLUSH</span> <span style="color: #993333; font-weight: bold;">TABLES</span> <span style="color: #993333; font-weight: bold;">WITH</span> <span style="color: #993333; font-weight: bold;">READ</span> <span style="color: #993333; font-weight: bold;">LOCK</span>;
<span style="color: #993333; font-weight: bold;">SHOW</span> MASTER <span style="color: #993333; font-weight: bold;">STATUS</span>;</pre></div></div>

<p>Esto nos va a devolver la posicion actual del log, asi que apuntamos &#8220;<strong>File</strong>&#8221; y &#8220;<strong>Position</strong>&#8220;, que lo necesitaremos para ponerselo al esclavo, en caso de que salga en blanco &#8220;<strong>File</strong>&#8221; es <strong>&#8221;</strong> y &#8220;<strong>Position</strong>&#8221; es <strong>4</strong></p>
<p>Ahora sin cerrar la conexion mysql (sino se pondria en marcha otra vez), ejecutamos esto desde otro terminal:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ mysqladmin <span style="color: #660033;">-u</span> root <span style="color: #660033;">-p</span> shutdown</pre></div></div>

<p>Realizamos ahora la copia de la base de datos, hay dos metodos:</p>
<ul>
<li>mysqldump

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ mysqldump <span style="color: #660033;">--all-databases</span> <span style="color: #660033;">--master-data</span> <span style="color: #660033;">-u</span> root <span style="color: #660033;">-p</span> <span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #000000; font-weight: bold;">/</span>tmp<span style="color: #000000; font-weight: bold;">/</span>dump.sql</pre></div></div>

</li>
<li>tar

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>lib ; <span style="color: #c20cb9; font-weight: bold;">tar</span> cf <span style="color: #000000; font-weight: bold;">/</span>tmp<span style="color: #000000; font-weight: bold;">/</span>mysql.tar mysql</pre></div></div>

</li>
</ul>
<p>Pasamos la copia al esclavo y lo importamos:</p>
<ul>
<li>mysqldump

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ mysql <span style="color: #660033;">-u</span> root <span style="color: #660033;">-p</span> <span style="color: #000000; font-weight: bold;">&amp;</span>lt; <span style="color: #000000; font-weight: bold;">/</span>tmp<span style="color: #000000; font-weight: bold;">/</span>dump.sql</pre></div></div>

</li>
<li>tar

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>lib ; <span style="color: #c20cb9; font-weight: bold;">tar</span> xcf <span style="color: #000000; font-weight: bold;">/</span>tmp<span style="color: #000000; font-weight: bold;">/</span>mysql.tar</pre></div></div>

</li>
</ul>
<p>Lo siguiente es ponerle los datos del maestro al esclavo:</p>

<div class="wp_syntax"><div class="code"><pre class="sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">CHANGE</span> MASTER <span style="color: #993333; font-weight: bold;">TO</span> master_host<span style="color: #66cc66;">=</span><span style="color: #ff0000;">'IP_MAESTRO'</span><span style="color: #66cc66;">,</span> master_user<span style="color: #66cc66;">=</span><span style="color: #ff0000;">'slave'</span><span style="color: #66cc66;">,</span> master_password<span style="color: #66cc66;">=</span><span style="color: #ff0000;">'slavepass'</span><span style="color: #66cc66;">,</span> master_log_file<span style="color: #66cc66;">=</span><span style="color: #ff0000;">''</span><span style="color: #66cc66;">,</span> master_log_pos<span style="color: #66cc66;">=</span><span style="color: #cc66cc;">4</span>;
<span style="color: #993333; font-weight: bold;">START</span> slave;</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://p0l0.binware.org/index.php/2007/04/18/mysql-replication/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP5 eAccelerator</title>
		<link>http://p0l0.binware.org/index.php/2007/01/23/php5-eaccelerator/</link>
		<comments>http://p0l0.binware.org/index.php/2007/01/23/php5-eaccelerator/#comments</comments>
		<pubDate>Tue, 23 Jan 2007 19:30:59 +0000</pubDate>
		<dc:creator>P0L0</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[GNU/Linux]]></category>
		<category><![CDATA[cache]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://p0l0.binware.org/index.php/2007/01/23/php5-eaccelerator/</guid>
		<description><![CDATA[Hacia tiempo que queria poner esto, pero nunca me he puesto. eAccelerator es un modulo de php que compila y carga en memoria las aplicaciones php, y con esto consigue que haya una mejora de respuesta y descarga bastante el servidor. Aqui os explico como instalar eAccelerator con PHP5 en una debian. Lo primero que [...]]]></description>
			<content:encoded><![CDATA[<p>Hacia tiempo que queria poner esto, pero nunca me he puesto. eAccelerator es un modulo de php que compila y carga en memoria las aplicaciones php, y con esto consigue que haya una mejora de respuesta y descarga bastante el servidor. Aqui os explico como instalar eAccelerator con PHP5 en una debian.</p>
<p>Lo primero que hay que hacer es descargarse la ultima version de <a title="Download eAccelerator" href="http://sourceforge.net/project/showfiles.php?group_id=122249" target="_blank">eAccelerator</a>, tambien necesitaremos en el server las utilidades de desarrollo de php</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> php5-dev</pre></div></div>

<p>La instalacion es realmente muy sencilla, solo tenemos que descomprimir, compiler, instalar y configurar.</p>
<ul>
<li>Descomprimimos</li>
</ul>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">tar</span> xvfj eaccelerator-0.9.5.tar.bz2</pre></div></div>

<ul>
<li>Compilamos</li>
</ul>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">cd</span> eaccelerator-0.9.5
phpize
.<span style="color: #000000; font-weight: bold;">/</span>configure
<span style="color: #c20cb9; font-weight: bold;">make</span></pre></div></div>

<ul>
<li>Instalamos (nos pondra el modulo en la carpeta de modulos de php)</li>
</ul>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">make</span> <span style="color: #c20cb9; font-weight: bold;">install</span></pre></div></div>

<ul>
<li>Copiamos la configuracion para que la cargue php</li>
</ul>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">cp</span> eaccelerator.ini <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>php5<span style="color: #000000; font-weight: bold;">/</span>conf.d<span style="color: #000000; font-weight: bold;">/</span></pre></div></div>

<p>Lo primero que hay que hacer en la configuracion es decirle que no es una zend_extension, por lo tanto cambiamos</p>

<div class="wp_syntax"><div class="code"><pre class="ini" style="font-family:monospace;"><span style="color: #000099;">zend_extension</span><span style="color: #000066; font-weight:bold;">=</span><span style="color: #933;">&quot;/usr/lib/php4/eaccelerator.so&quot;</span></pre></div></div>

<p>por</p>

<div class="wp_syntax"><div class="code"><pre class="ini" style="font-family:monospace;"><span style="color: #000099;">extension</span><span style="color: #000066; font-weight:bold;">=</span><span style="color: #933;">&quot;eaccelerator.so&quot;</span></pre></div></div>

<p>Luego yo en la configuracion he dejado todo como venia por defecto excepto</p>

<div class="wp_syntax"><div class="code"><pre class="ini" style="font-family:monospace;">eaccelerator.log_file <span style="color: #000066; font-weight:bold;">=</span> <span style="color: #933;">&quot;/var/log/apache/eaccelerator_log&quot;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://p0l0.binware.org/index.php/2007/01/23/php5-eaccelerator/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MRTG Total</title>
		<link>http://p0l0.binware.org/index.php/2006/12/05/mrtg-total/</link>
		<comments>http://p0l0.binware.org/index.php/2006/12/05/mrtg-total/#comments</comments>
		<pubDate>Tue, 05 Dec 2006 15:41:08 +0000</pubDate>
		<dc:creator>P0L0</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[GNU/Linux]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[mrtg]]></category>

		<guid isPermaLink="false">http://p0l0.binware.org/index.php/2006/12/05/mrtg-total/</guid>
		<description><![CDATA[MRTG es una utilidad para monitorizar y generar graficos por medio de snmp. Para los que tengan como yo limite de consumo de trafico mensual, va muy bien tener un contador del total de consumo por dias y por meses. Lo primero que tenemos que hacer es instalar los paquetes necesarios: apt-get install mrtg libgd-graph-perl [...]]]></description>
			<content:encoded><![CDATA[<p><a target="_blank" title="MRTG" href="http://oss.oetiker.ch/mrtg/">MRTG</a> es una utilidad para monitorizar y generar graficos por medio de snmp. Para los que tengan como yo limite de consumo de trafico mensual, va muy bien tener un contador del total de consumo por dias y por meses.</p>
<p>Lo primero que tenemos que hacer es instalar los paquetes necesarios:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> mrtg libgd-graph-perl libgd-graph3d-perl snmpd</pre></div></div>

<p>Una vez instalado, configuramos <a target="_blank" title="MRTG" href="http://oss.oetiker.ch/mrtg/">MRTG</a> (<strong>/etc/mrtg.cfg</strong>):</p>

<div class="wp_syntax"><div class="code"><pre class="ini" style="font-family:monospace;">#################################################
# Multi Router Traffic Grapher -- Sample Configuration File
#################################################
# This file is for use with mrtg-2.5.4c
&nbsp;
# Global configuration
WorkDir: /var/www/mrtg
&nbsp;
#General title
Title<span style="color: #000066; font-weight:bold;"><span style="">&#91;</span>^<span style="">&#93;</span></span>: Traffic Analysis for Atlantis
&nbsp;
#We dont need Ipv6
EnableIPV6: no
#Count in bits, grow from right to left, log unknow data as zero
Options<span style="color: #000066; font-weight:bold;"><span style="">&#91;</span>_<span style="">&#93;</span></span>: bits,growright,unknaszero
&nbsp;
#Target to monitor
Target<span style="color: #000066; font-weight:bold;"><span style="">&#91;</span>atlantis<span style="">&#93;</span></span>: <span style="">2</span>:atlantis@localhost
&nbsp;
#Page title
Title<span style="color: #000066; font-weight:bold;"><span style="">&#91;</span>atlantis<span style="">&#93;</span></span>: Traffic Analysis for Atlantis
PageTop<span style="color: #000066; font-weight:bold;"><span style="">&#91;</span>atlantis<span style="">&#93;</span></span>: &amp;lt<span style="color: #666666; font-style: italic;">;H1&amp;gt;Our 100mbps link to the outside world&amp;lt;/H1&amp;gt;</span>
#100mb
MaxBytes<span style="color: #000066; font-weight:bold;"><span style="">&#91;</span>atlantis<span style="">&#93;</span></span>: <span style="">12500000</span>
WithPeak<span style="color: #000066; font-weight:bold;"><span style="">&#91;</span>atlantis<span style="">&#93;</span></span>: ymw
AbsMax<span style="color: #000066; font-weight:bold;"><span style="">&#91;</span>atlantis<span style="">&#93;</span></span>: <span style="">1000000000000</span>
&nbsp;
#MRTG Total config <span style="">&#40;</span>Title, Unit <span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;"> M<span style="">&#40;</span>Bytes<span style="">&#41;</span><span style="">&#41;</span></span>
#-#Total<span style="color: #000066; font-weight:bold;"><span style="">&#91;</span>atlantis<span style="">&#93;</span></span>: Traffic Totals for Atlantis
#-#Total-Unit<span style="color: #000066; font-weight:bold;"><span style="">&#91;</span>atlantis<span style="">&#93;</span></span>: M
#-#Total:Ratio<span style="color: #000066; font-weight:bold;"><span style="">&#91;</span>atlantis<span style="">&#93;</span></span>: yes</pre></div></div>

<p>Configurar SNMP (<strong>/etc/snmp/snmpd.conf</strong>):</p>

<div class="wp_syntax"><div class="code"><pre class="ini" style="font-family:monospace;">com2sec local localhost atlantis
com2sec atlantis 66.111.52.100 atlantis
&nbsp;
group MyROGroup v1         local
group MyROGroup v1      atlantis
&nbsp;
view all-nibs included .1 <span style="">80</span>
&nbsp;
access MyROGroup <span style="color: #933;">&quot;&quot;</span>      v1       noauth    exact  all-nibs    none   none
&nbsp;
syslocation altantis
syscontact Root</pre></div></div>

<p>Configuramos iptables para que no puedan acceder al SNMP desde fuera</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#SNMPD Solo Local</span>
<span style="color: #007800;">$IPTABLES</span> <span style="color: #660033;">-A</span> INPUT <span style="color: #660033;">-s</span> 127.0.0.1 <span style="color: #660033;">-p</span> tcp <span style="color: #660033;">--dport</span> <span style="color: #000000;">199</span> <span style="color: #660033;">-j</span> ACCEPT
<span style="color: #007800;">$IPTABLES</span> <span style="color: #660033;">-A</span> INPUT <span style="color: #660033;">-s</span> 127.0.0.1 <span style="color: #660033;">-p</span> udp <span style="color: #660033;">--dport</span> <span style="color: #000000;">161</span> <span style="color: #660033;">-j</span> ACCEPT
<span style="color: #007800;">$IPTABLES</span> <span style="color: #660033;">-A</span> INPUT <span style="color: #660033;">-s</span> 85.17.1.127 <span style="color: #660033;">-p</span> tcp <span style="color: #660033;">--dport</span> <span style="color: #000000;">199</span> <span style="color: #660033;">-j</span> ACCEPT
<span style="color: #007800;">$IPTABLES</span> <span style="color: #660033;">-A</span> INPUT <span style="color: #660033;">-s</span> 85.17.1.127 <span style="color: #660033;">-p</span> udp <span style="color: #660033;">--dport</span> <span style="color: #000000;">161</span> <span style="color: #660033;">-j</span> ACCEPT
<span style="color: #007800;">$IPTABLES</span> <span style="color: #660033;">-A</span> INPUT <span style="color: #660033;">-s</span> <span style="color: #000000;">0</span><span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">0</span> <span style="color: #660033;">-p</span> tcp <span style="color: #660033;">--dport</span> <span style="color: #000000;">199</span> <span style="color: #660033;">-j</span> DROP
<span style="color: #007800;">$IPTABLES</span> <span style="color: #660033;">-A</span> INPUT <span style="color: #660033;">-s</span> <span style="color: #000000;">0</span><span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">0</span> <span style="color: #660033;">-p</span> udp <span style="color: #660033;">--dport</span> <span style="color: #000000;">161</span> <span style="color: #660033;">-j</span> DROP</pre></div></div>

<p><a target="_blank" title="MRTG Total" href="http://p0l0.binware.org/wp-content/2006/11/mrtg_total.tar.bz2">Descargamos</a> mrtg_total y lo descomprimimos:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">tar</span> xvfj mrtg_total.tar.bz2
<span style="color: #7a0874; font-weight: bold;">cd</span> mrt_total
<span style="color: #c20cb9; font-weight: bold;">unzip</span> mrtg_total.zip</pre></div></div>

<p>El script importante es mrtg_total.pl, y hay que añadirle en la primera linea del fichero <strong>#!/usr/bin/perl</strong></p>
<p>Ahora añadimos al crontab que ejecute mrtg_total, por ejemplo cada 3 horas (<strong>/etc/crontab</strong>):</p>

<div class="wp_syntax"><div class="code"><pre class="ini" style="font-family:monospace;"><span style="">0</span> */<span style="">3</span> * * * root  /path/to/mrtg_total.pl /etc/mrtg.cfg</pre></div></div>

<p>Esto nos va a generar cada 3 horas una version actualizada del consumo en /var/www/mrtg, lo suyo es protegerlo con contraseña para que no pueda acceder todo el mundo. Creamos un ficheros <strong>.htaccess</strong> en /var/www/mrtg</p>

<div class="wp_syntax"><div class="code"><pre class="ini" style="font-family:monospace;">AuthType Basic
AuthName <span style="color: #933;">&quot;MRTG&quot;</span>
AuthUserFile /var/www/mrtg/.htpasswd
Require valid-user</pre></div></div>

<p>Y ahora creamos el <strong>.htpasswd</strong> de la siguiente forma:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">htpasswd <span style="color: #660033;">-c</span> .htpasswd mrtg</pre></div></div>

<p>Ahora con todo configurado, tendremos:</p>
<p>http://nuestroserver/mrtg/atlantis.html (estadisticas de MRTG)</p>
<div style="text-align: center"><a target="_blank" title="MRTG" href="http://p0l0.binware.org/wp-content/2006/12/mrtg.png" rel="lightbox[228]"><img width="68" height="96" border="0" id="image235" alt="MRTG" src="http://p0l0.binware.org/wp-content/2006/12/mrtg.miniatura.png" /></a></div>
<p>http://nuestroserver/mrtg/atlantis.total.2006.html (estadisticas MRTG total)</p>
<div style="text-align: center"><a target="_blank" title="MRTG Total" href="http://p0l0.binware.org/wp-content/2006/12/mrtg-total.png" rel="lightbox[228]"><img width="90" height="96" border="0" id="image233" alt="Mrtg Total" src="http://p0l0.binware.org/wp-content/2006/12/mrtg-total.miniatura.png" /></a></div>
<p><a target="_blank" title="MRTG Total" href="http://p0l0.binware.org/wp-content/2006/11/mrtg_total.tar.bz2">Download MRTG_TOTAL<br />
</a></p>
]]></content:encoded>
			<wfw:commentRss>http://p0l0.binware.org/index.php/2006/12/05/mrtg-total/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>XFCE 4.4 RC2</title>
		<link>http://p0l0.binware.org/index.php/2006/11/07/xfce-44-rc2/</link>
		<comments>http://p0l0.binware.org/index.php/2006/11/07/xfce-44-rc2/#comments</comments>
		<pubDate>Tue, 07 Nov 2006 08:22:00 +0000</pubDate>
		<dc:creator>P0L0</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[xfce]]></category>

		<guid isPermaLink="false">http://p0l0.binware.org/index.php/2006/11/07/xfce-44-rc2/</guid>
		<description><![CDATA[Ayer por la noche se publico la version 4.4 RC2 del fantastico escritorio XFCE. Ya queda poco para la version final. Los cambios entre la version 4.2 y la 4.4 son impresionantes. Aqui podeis ver los cambios de la RC1 a la RC2 y desde aqui os lo podeis bajar para compilarlo (tiene un bonito [...]]]></description>
			<content:encoded><![CDATA[<p>Ayer por la noche se publico la version 4.4 RC2 del fantastico escritorio <a title="XFCE" target="_blank" href="http://www.xfce.org">XFCE</a>. Ya queda poco para la version final. Los cambios entre la version 4.2 y la 4.4 son impresionantes. <a title="Chagelog XFCE 4.4 RC2" target="_blank" href="http://mocha.xfce.org/release_notes/4.4rc2_changelog.html">Aqui</a> podeis ver los cambios de la RC1 a la RC2 y desde <a title="XFCE 4.4 RC2" target="_blank" href="http://www.xfce.org/archive/xfce-4.3.99.2/">aqui</a> os lo podeis bajar para compilarlo (tiene un bonito <a title="XFCE 4.4 RC2 Installer" target="_blank" href="http://www.xfce.org/archive/xfce-4.3.99.2/installers/">instalador grafico</a> que lo hace todo mas facil)</p>
]]></content:encoded>
			<wfw:commentRss>http://p0l0.binware.org/index.php/2006/11/07/xfce-44-rc2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Multiples proyectos con trac y svn usando HTTPS</title>
		<link>http://p0l0.binware.org/index.php/2006/10/03/multiples-proyectos-con-trac-y-svn-usando-https/</link>
		<comments>http://p0l0.binware.org/index.php/2006/10/03/multiples-proyectos-con-trac-y-svn-usando-https/#comments</comments>
		<pubDate>Tue, 03 Oct 2006 17:51:55 +0000</pubDate>
		<dc:creator>P0L0</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[GNU/Linux]]></category>
		<category><![CDATA[binware]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[hosting]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[svn]]></category>
		<category><![CDATA[trac]]></category>

		<guid isPermaLink="false">http://p0l0.binware.org/index.php/2006/10/03/multiples-proyectos-con-trac-y-svn-usando-https/</guid>
		<description><![CDATA[Voy a explicar como montar el sistema de gestion de proyectos trac y subversion usando https para trabajar con subversion. Yo lo he montado en una debian usando apache2, asi que lo primero que necesitamos es instalar todo lo necesario apt-get install trac subversion apache2 subversion libapache2-svn libapache2-mod-python2.3 Una vez descargado e instalado creamos el [...]]]></description>
			<content:encoded><![CDATA[<p>Voy a explicar como montar el sistema de gestion de proyectos <a target="_blank" title="Trac" href="http://trac.edgewall.com/">trac</a> y <a target="_blank" title="Subversion" href="http://subversion.tigris.org/">subversion</a> usando https para trabajar con subversion. Yo lo he montado en una debian usando apache2, asi que lo primero que necesitamos es instalar todo lo necesario</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> trac subversion apache2 subversion libapache2-svn libapache2-mod-python2.3</pre></div></div>

<p>Una vez descargado e instalado creamos el certificado necesario para usar tanto trac y subversion bajo https. Entra en el directorio <strong>/etc/apache2/ssl</strong> y ejecuta lo siguiente:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">openssl genrsa <span style="color: #660033;">-des3</span> <span style="color: #660033;">-out</span> server.key <span style="color: #000000;">1024</span>
openssl req <span style="color: #660033;">-new</span> <span style="color: #660033;">-key</span> server.key <span style="color: #660033;">-out</span> server.csr
<span style="color: #c20cb9; font-weight: bold;">cp</span> server.key server.key.org
openssl rsa <span style="color: #660033;">-in</span> server.key.org <span style="color: #660033;">-out</span> server.key
openssl x509 <span style="color: #660033;">-req</span> <span style="color: #660033;">-days</span> <span style="color: #000000;">365</span> <span style="color: #660033;">-in</span> server.csr <span style="color: #660033;">-signkey</span> server.key <span style="color: #660033;">-out</span> server.crt</pre></div></div>

<p>Ahora ya tenemos listo los certificados, asi que ahora solo nos queda configurar el apache. Yo he creado un trac.dominio.ext y un svn.dominio.ext para hacer esto, pero esto va a gusto de cada uno. Yo como uso dos subdominios distintos, lo tengo en ficheros separados.</p>
<p>Primero editaremos el trac, asi que creamos el fichero <strong>/etc/apache2/sites-available/trac.domain.ext</strong></p>

<div class="wp_syntax"><div class="code"><pre class="ini" style="font-family:monospace;">NameVirtualHost *:<span style="">443</span>
&lt;VirtualHost *:<span style="">443</span>&gt;
#Activate SSL
SSLEngine on
&nbsp;
SSLCertificateFile    /etc/apache2/ssl/server.crt
SSLCertificateKeyFile /etc/apache2/ssl/server.key
&nbsp;
#VirtualHost Servername
ServerName trac.domain.ext
ServerAdmin trac@domain.ext
&nbsp;
DocumentRoot /opt/projects/trac
&nbsp;
#Authentication
&lt;Location /&gt;
AuthType Basic
AuthName <span style="color: #933;">&quot;Trac&quot;</span>
AuthUserFile /opt/projects/.htpasswd
Require valid-user
&nbsp;
#Trac
SetHandler mod_python
PythonHandler trac.web.modpython_frontend
PythonOption TracEnvParentDir /opt/projects/trac/
PythonOption TracUriRoot /
&nbsp;
&lt;/Location&gt;
&lt;/VirtualHost&gt;</pre></div></div>

<p>El fichero no necesita demasiada explicacion, simplemente le decimos que active el SSL, que pida autentificacion y cargamos el modulo del trac y le especificamos el path de donde estan todos nuestros proyectos.</p>
<p>Ahora vamos con el fichero <strong>/etc/apache2/sites-available/svn.domain.ext</strong></p>

<div class="wp_syntax"><div class="code"><pre class="ini" style="font-family:monospace;">NameVirtualHost *:<span style="">443</span>
&lt;VirtualHost *:<span style="">443</span>&gt;
#Activate SSL
SSLEngine on
&nbsp;
SSLCertificateFile    /etc/apache2/ssl/server.crt
SSLCertificateKeyFile /etc/apache2/ssl/server.key
&nbsp;
#VirtualHost Servername
ServerName svn.domain.ext
ServerAdmin svn@domain.ext
&nbsp;
DocumentRoot /opt/projects/svn
&lt;Location /&gt;
DAV svn
&nbsp;
#Authentication
AuthType Basic
AuthName <span style="color: #933;">&quot;Subversion&quot;</span>
AuthUserFile /opt/projects/.htpasswd
Require valid-user
&nbsp;
#Subversion
SVNParentPath /opt/projects/svn
SVNListParentPath on
SVNAutoVersioning On
&lt;/Location&gt;
&nbsp;
&lt;LocationMatch <span style="color: #933;">&quot;/.+&quot;</span>&gt;
#Subversion permission file
AuthzSVNAccessFile /opt/projects/svn/.htpasswd
&lt;/LocationMatch&gt;
&lt;/VirtualHost&gt;</pre></div></div>

<p>Es importante separar el <strong>AuthzSVNAccessFile</strong> de <strong>&lt;Location /&gt;</strong> ya que sino no listara todos los proyectos en http://svn.domain.ext/ por problemas de permisos.</p>
<p>Ahora que tenemos estos ficheros listos, hay que activar el modulo de ssl en el apache2 y los dos dominios.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">vi</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>apache2<span style="color: #000000; font-weight: bold;">/</span>ports.conf</pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="ini" style="font-family:monospace;">&lt;IfModule mod_ssl.c&gt;
Listen <span style="">443</span>
&lt;/IfModule&gt;</pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>apache2<span style="color: #000000; font-weight: bold;">/</span>mods-enabled
<span style="color: #c20cb9; font-weight: bold;">ln</span> <span style="color: #660033;">-s</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>apache2<span style="color: #000000; font-weight: bold;">/</span>mods-available<span style="color: #000000; font-weight: bold;">/</span>dav.load .
<span style="color: #c20cb9; font-weight: bold;">ln</span> <span style="color: #660033;">-s</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>apache2<span style="color: #000000; font-weight: bold;">/</span>mods-available<span style="color: #000000; font-weight: bold;">/</span>dav_svn.load .
<span style="color: #c20cb9; font-weight: bold;">ln</span> <span style="color: #660033;">-s</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>apache2<span style="color: #000000; font-weight: bold;">/</span>mods-available<span style="color: #000000; font-weight: bold;">/</span>mod_python.load .
<span style="color: #c20cb9; font-weight: bold;">ln</span> <span style="color: #660033;">-s</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>apache2<span style="color: #000000; font-weight: bold;">/</span>mods-available<span style="color: #000000; font-weight: bold;">/</span>ssl.conf .
<span style="color: #c20cb9; font-weight: bold;">ln</span> <span style="color: #660033;">-s</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>apache2<span style="color: #000000; font-weight: bold;">/</span>mods-available<span style="color: #000000; font-weight: bold;">/</span>ssl.load .
&nbsp;
<span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>apache2<span style="color: #000000; font-weight: bold;">/</span>sites-enabled
<span style="color: #c20cb9; font-weight: bold;">ln</span> <span style="color: #660033;">-s</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>apache2<span style="color: #000000; font-weight: bold;">/</span>sites-available<span style="color: #000000; font-weight: bold;">/</span>svn.domain.ext 001-svn.domain.ext
<span style="color: #c20cb9; font-weight: bold;">ln</span> <span style="color: #660033;">-s</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>apache2<span style="color: #000000; font-weight: bold;">/</span>sites-available<span style="color: #000000; font-weight: bold;">/</span>trac.domain.ext 001-trac.domain.ext</pre></div></div>

<p>Ahora vamos a crear un proyecto de prueba</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #660033;">-p</span> <span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span>projects<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">svn</span>
<span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #660033;">-p</span> <span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span>projects<span style="color: #000000; font-weight: bold;">/</span>trac
<span style="color: #c20cb9; font-weight: bold;">svnadmin</span> create <span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span>projects<span style="color: #000000; font-weight: bold;">/</span>svn<span style="color: #000000; font-weight: bold;">/</span>NewProject
trac-admin <span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span>projects<span style="color: #000000; font-weight: bold;">/</span>trac<span style="color: #000000; font-weight: bold;">/</span>NewProject initenv</pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="ini" style="font-family:monospace;">Project Name <span style="color: #000066; font-weight:bold;"><span style="">&#91;</span>My Project<span style="">&#93;</span></span>&gt; NewProject
Database connection string <span style="color: #000066; font-weight:bold;"><span style="">&#91;</span>sqlite:db/trac.db<span style="">&#93;</span></span>&gt;
Path to repository <span style="color: #000066; font-weight:bold;"><span style="">&#91;</span>/var/svn/test<span style="">&#93;</span></span>&gt; /opt/projects/svn/NewProject
Templates directory <span style="color: #000066; font-weight:bold;"><span style="">&#91;</span>/usr/share/trac/templates<span style="">&#93;</span></span>&gt;
Creating and Initializing Project
Configuring Project
trac.repository_dir
trac.database
trac.templates_dir
project.name
Installing default wiki pages
..............</pre></div></div>

<pre lang="bash"
chown -R www-data:www-data /opt/projects/
</pre>
<p>Ahora creamos los ficheros de acceso de usuarios.</p>
</pre>
<pre lang="bash>
htpasswd -c /opt/projects/.htpasswd user1
htpasswd /opt/projects/.htpasswd user2
</pre>
<p>Y el archivo de permisos de subversion, que tiene el siguiente formato</p>

<div class="wp_syntax"><div class="code"><pre class="ini" style="font-family:monospace;"><span style="color: #000066; font-weight:bold;"><span style="">&#91;</span>Repositorio:/Path<span style="">&#93;</span></span>
<span style="color: #000099;">user</span> <span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;"> <span style="color: #000066; font-weight:bold;"><span style="">&#91;</span> <span style="">&#91;</span>r<span style="">&#91;</span>w<span style="">&#93;</span><span style="">&#93;</span><span style="">&#93;</span></span></span></pre></div></div>

<p>Por ejemplo, queremos que el user1 pueda leer y escribir, el user2 leer, y anonymous nada (no deberia haber anonymous ya que el htpasswd no los deja pasar, pero siempre viene bien protegerse por si acaso), el fichero quedaria asi</p>

<div class="wp_syntax"><div class="code"><pre class="ini" style="font-family:monospace;"><span style="color: #000066; font-weight:bold;"><span style="">&#91;</span>NewProject:/<span style="">&#93;</span></span>
<span style="color: #000099;">user1</span> <span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;"> rw</span>
<span style="color: #000099;">user2</span> <span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;"> r</span>
* <span style="color: #000066; font-weight:bold;">=</span></pre></div></div>

<p>Ahora ya tenemos todo listo, podemos instalar el modulo <a target="_blank" title="Trac Web Admin" href="http://trac.edgewall.org/wiki/WebAdmin">TracWebAdmin</a> para que sea mas facil la administracion del trac.</p>
]]></content:encoded>
			<wfw:commentRss>http://p0l0.binware.org/index.php/2006/10/03/multiples-proyectos-con-trac-y-svn-usando-https/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>DIVX/XVID a DVDR en GNU/Linux</title>
		<link>http://p0l0.binware.org/index.php/2006/09/26/divxxvid-a-dvdr-en-gnulinux/</link>
		<comments>http://p0l0.binware.org/index.php/2006/09/26/divxxvid-a-dvdr-en-gnulinux/#comments</comments>
		<pubDate>Tue, 26 Sep 2006 10:05:27 +0000</pubDate>
		<dc:creator>P0L0</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[GNU/Linux]]></category>
		<category><![CDATA[divx]]></category>
		<category><![CDATA[dvdburn]]></category>
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://p0l0.binware.org/index.php/2006/09/26/divxxvid-a-dvdr-en-gnulinux/</guid>
		<description><![CDATA[El otro dia tenia que convertir un divx a dvdr para la prima de Irene y que asi pudiera verlo en su reproductor de DVD. Estuve buscando pero no encontre nada claro sobre este tema. Al final con el avidemux he visto que puedo crear video del tipo DVD y audio MP2, asi que aqui [...]]]></description>
			<content:encoded><![CDATA[<p>El otro dia tenia que convertir un divx a dvdr para la prima de Irene y que asi pudiera verlo en su reproductor de DVD. Estuve buscando pero no encontre nada claro sobre este tema. Al final con el avidemux he visto que puedo crear video del tipo DVD y audio MP2, asi que aqui os cuento los pasos que segui para crear un DVDR.</p>
<p>Una cosa importante a tener en cuenta es que el video no puede tener un bitrate superior a 9,8Mb/s y el audio tiene que ser a 48kHz, asi que lo primero que hay que hacer es mirar las propiedades del video. Esto se puede hacer una vez abierto en el menu &#8220;<strong>File -> Properties</strong>&#8221; y os saldra una pantalla tipo esta:</p>
<p align="center"><a title="File properties" target="_blank" href="http://p0l0.binware.org/wp-content/2006/09/000.png" rel="lightbox[190]"><img width="81" height="96" id="image192" alt="File properties" style="border: 0px none " src="http://p0l0.binware.org/wp-content/2006/09/000.miniatura.png" /></a></p>
<p>Ahora hay que elegir la codificacion del video, para eso se elige en video el formato &#8220;<strong>DVD (lavc)</strong>&#8221; y en el hay que elegir &#8220;<strong>Two Pass (bitrate)</strong>&#8220;, tambien esta el por tamaÃ±o de fichero, pero siendo un divx, se puede poner tranquilamente el bitrate y ponerle 9Mb/s (9000kb/s) que seguro que no ocupara mas de los 4,5gb que tiene el dvd.</p>
<p align="center"><a target="_blank" title="Video properties" href="http://p0l0.binware.org/wp-content/2006/09/001.png" rel="lightbox[190]"><img width="128" height="86" style="border: 0px none " alt="Video config" id="image193" src="http://p0l0.binware.org/wp-content/2006/09/001.miniatura.png" /></a></p>
<p>Para el sonido, el codec que usaremos sera &#8220;<strong>Twolame</strong>&#8221; y elegiremos 160kbps en Stereo.</p>
<div align="center"><a title="Audio properties" target="_blank" href="http://p0l0.binware.org/wp-content/2006/09/002.png" rel="lightbox[190]"><img width="128" height="86" id="image194" alt="Audio Config" style="border: 0px none " src="http://p0l0.binware.org/wp-content/2006/09/002.miniatura.png" /></a></div>
<p>En caso de que el audio no fuera 48kHz, hay que crear un filtro que convierta el audio en 48kHz.</p>
<p align="center"><a title="Audio Filter" target="_blank" href="http://p0l0.binware.org/wp-content/2006/09/003.png" rel="lightbox[190]"><img width="128" height="86" id="image195" alt="Audio Filter" style="border: 0px none " src="http://p0l0.binware.org/wp-content/2006/09/003.miniatura.png" /></a></p>
<div align="left">Una vez elegido esto ya podemos elegir el formato de salida &#8220;<strong>MPEG PS A+V</strong>&#8220;, que nos dejara un mpeg listo para poder meterlo en un programa de autoria DVD.</div>
<p align="center"><a title="Format" target="_blank" href="http://p0l0.binware.org/wp-content/2006/09/004.png" rel="lightbox[190]"><img width="128" height="86" id="image196" alt="Final Format" style="border: 0px none " src="http://p0l0.binware.org/wp-content/2006/09/004.miniatura.png" /></a></p>
<p>Ahora que ya tenemos el video, haremos el DVD, para eso he usado qdvdauthor.</p>
<p>Creamos los datos del proyecto, basta con darle al boton &#8220;<strong>File -> New Project</strong>&#8220;, nos pedira los datos para guardar los ficheros y el nombre del DVD. Una vez creado esto, le volvemos a dar &#8220;<strong>Add Movie</strong>&#8221; y elegimos el fichero de video creado con avidemux. Una vez que tenemos el fichero, se pueden añadir fondo de pantalla y texto, intro video y lo que queramos.</p>
<p align="center"><a target="_blank" title="qdvdauthor" href="http://p0l0.binware.org/wp-content/2006/09/101.png" rel="lightbox[190]"><img width="108" height="96" style="border: 0px none " alt="qdvdauthor" id="image197" src="http://p0l0.binware.org/wp-content/2006/09/100.miniatura.png" /></a></p>
<p align="center"><a target="_blank" title="new project" href="http://p0l0.binware.org/wp-content/2006/09/101.png" rel="lightbox[190]"><img width="109" height="96" style="border: 0px none " alt="create project" id="image198" src="http://p0l0.binware.org/wp-content/2006/09/101.miniatura.png" /></a></p>
<p>Lo importante es aÃ±adir un boton de texto que sea para reproducir el video.</p>
<p align="center"><a target="_blank" title="add text" href="http://p0l0.binware.org/wp-content/2006/09/102.png" rel="lightbox[190]"><img width="111" height="96" style="border: 0px none " alt="add text" id="image199" src="http://p0l0.binware.org/wp-content/2006/09/102.miniatura.png" /></a></p>
<p align="center"><a target="_blank" title="define button" href="http://p0l0.binware.org/wp-content/2006/09/103.png" rel="lightbox[190]"><img width="110" height="96" style="border: 0px none " alt="define as button" id="image200" src="http://p0l0.binware.org/wp-content/2006/09/103.miniatura.png" /></a></p>
<p align="center"><a target="_blank" title="button action" href="http://p0l0.binware.org/wp-content/2006/09/104.png" rel="lightbox[190]"><img width="110" height="96" style="border: 0px none " alt="button action" id="image201" src="http://p0l0.binware.org/wp-content/2006/09/104.miniatura.png" /></a></p>
<div align="left">Una vez puesto el menu a nuestro gusto, vamos a &#8220;<strong>DVD Author -> Create DVD</strong>&#8220;, y aqui es importante cambiar el parametro del toolame, porque sino dara error al intentar crear la pista de audio. Hay que cambiar &#8220;<em><strong>-b128 -s 48000</strong></em>&#8221; por &#8220;<em><strong>-b 128 -s 48</strong></em>&#8220;.</div>
<p align="center"><a target="_blank" title="bad toolame" href="http://p0l0.binware.org/wp-content/2006/09/105.png" rel="lightbox[190]"><img width="119" height="96" style="border: 0px none " alt="bad toolame" id="image202" src="http://p0l0.binware.org/wp-content/2006/09/105.miniatura.png" /></a></p>
<p align="center"><a target="_blank" title="good toolame" href="http://p0l0.binware.org/wp-content/2006/09/106.png" rel="lightbox[190]"><img height="96" style="border: 0px none " alt="good toolame" id="image203" src="http://p0l0.binware.org/wp-content/2006/09/106.miniatura.png" /></a></p>
<p>Una vez que ha acabado nos encontraremos en el directorio que le hemos especificado al principio una carpeta AUDIO_TS y VIDEO_TS, ahora solo hay que grabarlo. Con mkisofs (con soporte udf) creamos una iso lista para grabar.</p>
<p><em><strong>mkisofs -udf -dvd-video -o archivo.iso NOMBRE_DVD/</strong></em></p>
<p style="font-size: 9px">He seguido los consejos que se dan en esta pagina para pasar de divx a dvd: <a title="Converting to DVD" target="_blank" href="http://www.avidemux.org/wki/index.php?title=Converting_to_DVD">http://www.avidemux.org/wki/index.php?title=Converting_to_DVD</a></p>
]]></content:encoded>
			<wfw:commentRss>http://p0l0.binware.org/index.php/2006/09/26/divxxvid-a-dvdr-en-gnulinux/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Xfce4.4 Beta 2</title>
		<link>http://p0l0.binware.org/index.php/2006/07/10/xfce44-beta-2/</link>
		<comments>http://p0l0.binware.org/index.php/2006/07/10/xfce44-beta-2/#comments</comments>
		<pubDate>Mon, 10 Jul 2006 16:47:23 +0000</pubDate>
		<dc:creator>P0L0</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[GNU/Linux]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[xfce]]></category>

		<guid isPermaLink="false">http://p0l0.binware.org/index.php/2006/07/10/xfce44-beta-2/</guid>
		<description><![CDATA[Acaban de anunciar que ya esta disponible la nueva beta de la version xfce 4.4 para descargar. Asi que me he puesto a bajar el instalador de la ultima version y me puse a compilarlo. Segun parece tiene un nuevo &#8220;File Manager&#8221; llamado XArchive. Una vez que lo haya acabado de compilar subire un par [...]]]></description>
			<content:encoded><![CDATA[<p>Acaban de anunciar que ya esta disponible la nueva beta de la version <a title="XFCe" target="_blank" href="http://www.xfce.org">xfce</a> 4.4 para descargar. Asi que me he puesto a bajar el instalador de la ultima version y me puse a compilarlo. Segun parece tiene un nuevo &#8220;File Manager&#8221; llamado XArchive. Una vez que lo haya acabado de compilar subire un par de screenshots.</p>
]]></content:encoded>
			<wfw:commentRss>http://p0l0.binware.org/index.php/2006/07/10/xfce44-beta-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

