<?xml version="1.0" encoding="UTF-8"?>
<feed xml:lang="en-gb" xmlns="http://www.w3.org/2005/Atom"><title type="text">Netxus Foundries</title>
<subtitle type="text">non-corporative site</subtitle>
<link rel="self" href="http://blog.netxus.es/atom/" />
<link rel="alternate" type="text/html" href="http://blog.netxus.es/" />
<id>tag:blog.netxus.es,2005:3ce9f77a34fc941ccfc79f89c35a0079</id>
<generator uri="http://textpattern.com/" version="4.0.5">Textpattern</generator>
<updated>2008-07-12T19:51:02Z</updated>
<author>
		<name>Iván Montes</name>
		<email>&#105;&#109;&#111;&#110;&#116;&#101;&#115;&#64;&#110;&#101;&#116;&#120;&#117;&#115;&#46;&#101;&#115;</email>
		<uri>http://blog.netxus.es/</uri>
</author>
<entry>
		<author>
			<name>Iván Montes</name>
		</author>
		<published>2008-06-15T00:00:19Z</published>
		<updated>2008-06-15T00:03:17Z</updated>
		<title type="html">I&#39;ll no longer be bloggin in here</title>
		<link rel="alternate" type="text/html" href="http://blog.netxus.es/blog/ill-no-longer-be-bloggin-in-here" />
		<id>tag:blog.netxus.es,2008-06-14:3ce9f77a34fc941ccfc79f89c35a0079/d7e16d86f61aa0d4d1f43fec1ec44954</id>
		<category term="Life" />
		
		<summary type="html">
<![CDATA[<p>I&#8217;ve moved my blogging home to a <a href="http://pollinimini.net">new place</a></p>

	<p>From now on I&#8217;ll only post in there, so update your rss subscription!</p>

	<p>I&#8217;ve migrated some articles to the new blog so you might get some duplicates, sorry about that.</p>

	<p>Iván</p>]]>
</summary>
</entry>
<entry>
		<author>
			<name>Iván Montes</name>
		</author>
		<published>2007-12-27T06:06:02Z</published>
		<updated>2007-12-27T08:59:26Z</updated>
		<title type="html">A web development environment (III) - Firefox</title>
		<link rel="alternate" type="text/html" href="http://blog.netxus.es/blog/a-web-development-environment-iii-firefox" />
		<id>tag:blog.netxus.es,2007-12-26:3ce9f77a34fc941ccfc79f89c35a0079/3212b06b95c8f04dd2e85e7d6200783c</id>
		<category term="Software" />
		<category term="Webdev" />
		<summary type="html">
<![CDATA[<p>Firefox is a great browser and is also a great development tool in itself. There are some problems though with the numerous extension available to developers. They are a great resource when programming but they slow down (and in some scenarios they might even break) our normal web browsing.</p>

	<p>So the idea is to have a normal Firefox installation to use as our browser and then a separate install (and profile) used only for development purposes. This way we can install tons of development related addons without worrying about slowing down our normal browsing. Of course this is only useful if you use Firefox as your primary browser.</p>

	<ul>
		<li>Download the <a href="http://www.getfirefox.com">Firefox installer</a></li>
		<li>Launch the installer</li>
		<li>Set the destination folder to <code>c:\dev\Develfox</code></li>
		<li>Uncheck the options to create shortcuts on desktop, start menu&#8230;</li>
		<li>Uncheck the option to launch Firefox on finishing the setup</li>
		<li>Go to the installation directory and start a command prompt there
	<ul>
		<li>Run Firefox with the following command: <code>firefox.exe -no-remote -ProfileManager</code>
	<ul>
		<li>Create a new profile and name it <em>Devel</em></li>
		<li>Exit the profile manager</li>
	</ul></li>
		<li>Create a new batch file name <code>develfox.bat</code> with the following contents. It&#8217;ll copy on each run the firefox executable to <em>develfox.exe</em> so we can tell it apart from our normal browser on the task manager (we copy it on each run so that automatic updates are correctly applied).<br />
<code class="block">@echo off<br />
copy &#8220;c:\dev\develfox\firefox.exe&#8221; &#8220;c:\dev\develfox\develfox.exe&#8221; &#62; null<br />
start &#8220;&#8221; &#8220;c:\dev\develfox\develfox.exe&#8221; -no-remote -P &#8220;Devel&#8221;<br />
</code></li>
	</ul></li>
		<li>Still on the installation directory go to <em>chrome</em> and create in there a directory named <em>icons</em> and inside that one another called <em>default</em>. Put in there a custom icon with the name <em>main-window.ico</em> to be used as the application icon. Check out <a href="http://www.iconbase.com">IconBase</a> for some nice ones.</li>
		<li>Create a shortcut on your desktop or another suitable place and use the following properties:
	<ul>
		<li>Target: c:\dev\develfox\develfox.bat</li>
		<li>Start in: c:\dev\develfox</li>
		<li>Change the icon to the one used in c:\dev\develfox\chrome\icons\default\main-window.ico</li>
	</ul></li>
		<li>Launch the shortcut to execute our new Firefox installation. It&#8217;ll be a vanilla one so now it&#8217;s time to install our development addons ( Firebug, Webdev toolbar, Yslow, Clearcache, Venkman&#8230; ) and also a custom theme so we can easily know in which firefox we are at each moment.</li>
		<li>To further customize our new Firefox installation we can install the <a href="http://addons.mozilla.org/en-US/firefox/addon/31">Firesomething addon</a>, which allows to change the window title to anything we want.</li>
	</ul>]]>
</summary>
</entry>
<entry>
		<author>
			<name>Iván Montes</name>
		</author>
		<published>2007-12-27T01:27:15Z</published>
		<updated>2007-12-27T04:21:34Z</updated>
		<title type="html">A web development environment (II) - Cygwin</title>
		<link rel="alternate" type="text/html" href="http://blog.netxus.es/blog/a-web-development-environment-ii-cygwin" />
		<id>tag:blog.netxus.es,2007-12-26:3ce9f77a34fc941ccfc79f89c35a0079/a2287b58b69dad0c64a796379f084272</id>
		<category term="Software" />
		<category term="Webdev" />
		<summary type="html">
<![CDATA[<p>Following with the <a href="http://blog.netxus.es/blog/a-web-development-environment-i-the-introduction">series</a> I will introduce in this chapter Cygwin. </p>

	<p>Cygwin is an excellent collection of Unix utilities and programs ported to Windows. While its &#8216;<em>emulation</em>&#8216; of an Unix like environment is quite good I actually don&#8217;t use it. I install it just for the helpful utilities it has. Although I do occasionally use its shell to perform some command line tasks which on Windows&#8217; cmd.exe would be a real nightmare to perform.</p>

	<p>Lets set it up and then we can see some tips and tricks.</p>

	<ul>
		<li>Download the <a href="http://www.cygwin.com">Cygwin installer</a></li>
		<li>Move the installer (setup.exe) to <code>c:\dev\cygwin</code> and launch it</li>
		<li>Set the <em>Root Directory</em> to <code>c:\dev\cygwin</code> and the <em>Local Package Directory</em> to <code>c:\dev\cygwin\packages</code></li>
		<li>Choose at least the following packages to install. You won&#8217;t probably need all of them but in my experience these are the most commonly used and they don&#8217;t take much space actually:
	<ul>
		<li>Admin: <em>shutdown</em></li>
		<li>Archive: <em>unzip, zip</em></li>
		<li>Base: <em>bash, findutils, grep, gzip, run, tar, sed, termcap, terminfo</em></li>
		<li>Database: <em>sqlite3</em></li>
		<li>Devel: <em>binutils, automake, cvs, cygport, gcc, make, subversion</em></li>
		<li>Editors: <em>nano, vim</em></li>
		<li>Graphics: <em>ImageMagick</em></li>
		<li>Interpreters: <em>m4, perl, python, ruby</em></li>
		<li>Net: <em>curl, openssh, openssl, rsync</em></li>
		<li>Shells: <em>bash, bash-completion</em></li>
		<li>Text: <em>less, tidy</em></li>
		<li>Utils: <em>bzip2, cygutils, diffutils, gnupg, patch, screen</em></li>
		<li>Web: <em>cadaver, curl, httping, links, lynx, wget</em></li>
	</ul></li>
		<li>Now wait for all packages to download and install (it will take a while)</li>
		<li>Once the installation is complete we can launch the Cygwin system by running <code>c:\dev\cygwin\cygwin.bat</code></li>
		<li>On the first run it&#8217;ll create a new configuration and home directory for our user. Follow the instructions given on the terminal to complete the installation.</li>
	</ul>

	<p>Ok, so Cygwin is now setup and it&#8217;s time to learn a few tips.</p>

	<p>On a standard installation Cygwin will create a home directory for the user in <code>c:\dev\cygwin\home\[USER]</code>. However we might want to re-use our Windows folder so we have a unique location for our stuff. To do it we just need to create an environment variable (in System Preferences) called <strong><span class="caps">HOME</span></strong> with the path to our profile folder (<em>c:\Users\[USER]</em> in Vista). Now we have to edit <code>/etc/passwd</code> and change the home folder to our Windows profile one (<em>/cygdrive/c/Users/[USER]</em>), we can move the contents of the old home folder to the new one with the following commands: </p>

	<p><code class="block">mv /home/[USER]/* /cygdrive/c/Users/[USER]/.<br />
mv /home/.* /cygdrive/c/Users/[USER]/.<br />
</code></p>

	<p>By default the Windows drive letters are accessible in <code>/cygdrive/[DRIVE]</code>, that is ok but it&#8217;s used often so we can save a few key strokes by creating symlinks at the root of the file system. Create one for each of your drive letters so you can access them as <code>/[DRIVE]/my/path/to/a/file</code>.</p>

	<p><code class="block">$ ln -s /cygdrive/c /c<br />
</code></p>

	<p>As we have seen Cygwin uses Unix like paths so to launch Windows programs from the shell we have to make an extra step and that is to convert between paths. Fortunately there is a little tool called <code>cygpath</code>. When used without modifiers it will translate a Windows path to a Cygwin one and when used with the -w or the -m modifiers it will do the opposite conversion.</p>

	<p>Another nice tool is <code>cygstart</code> which launches a program (or the default program associated with a document). The good about it is that it will launch the program and detach the process from the console.</p>

	<p>For commonly used programs it&#8217;s a bit uncomfortable to use cygpath and cygstart, like for example to launch our favourite text editor. In this example I&#8217;m going to use Notepad as an example. We just have to change our bash init script (~/.bashrc) to include a function to launch Notepad easily from the command line. Add the following to your .bashrc file:</p>

	<p><code class="block">notepad () {
  cygstart &#8220;c:/Windows/System32/notepad.exe&#8221; &#8220;`cygpath -w $1`&#8221;<br />
}<br />
</code></p>

	<p>Now we can edit the contents of a text file just doing <code>notepad /var/log/setup.log</code>. This is a great way to really integrate Cygwin with Windows, which actually makes the Cygwin system ready for real work.</p>

	<p>Another useful utility is <a href="http://www.skamphausen.de/cgi-bin/ska/CDargs">cdargs</a> which while not an official part of the Cygwin system can be compiled from source. To install cdargs we just have to download its <a href="http://www.skamphausen.de/downloads/cdargs/">latests source tarball</a> and unpack it into your Cygwin home directory. Then issue the following commands:</p>

	<p><code class="block">$ cd cdargs-1.XX<br />
$ ./configure<br />
$ make<br />
$ make install<br />
$ cp contrib/cdargs-bash.sh /etc/profile.d/.<br />
$ source /etc/profile.d/cdargs-bash.sh<br />
</code></p>

	<p>Explaining how to use this tool is beyond the scope of this article. There is a nice <a href="http://www.linux.com/articles/114073">mini tutorial at Linux.com</a> and Google will give you plenty of information about this tool.</p>

	<p>There is a lot of software compatible with Cygwin beyond the packages included in the official repository. The <a href="http://cygwinports.dotsrc.org/">Cygwin Ports</a> project offers a few dozens of applications already compiled and ready to be installed. It&#8217;s well worth a look. <br />
Besides there are many Unix/Linux applications which can be compiled to be used in Cygwin even if they don&#8217;t redistribute the binary packages. </p>]]>
</summary>
</entry>
<entry>
		<author>
			<name>Iván Montes</name>
		</author>
		<published>2007-12-26T22:28:00Z</published>
		<updated>2007-12-26T22:52:34Z</updated>
		<title type="html">A web development environment (I) - The introduction</title>
		<link rel="alternate" type="text/html" href="http://blog.netxus.es/blog/a-web-development-environment-i-the-introduction" />
		<id>tag:blog.netxus.es,2007-12-26:3ce9f77a34fc941ccfc79f89c35a0079/141d3187a7bd572ba9b992a330f7b1c3</id>
		<category term="Software" />
		<category term="Webdev" />
		<summary type="html">
<![CDATA[<p><strong>Disclaimer</strong>: This will be a series of posts dedicated to document my current development setup. This setup tries to be the one of a <em>Ninja</em>. It won&#8217;t end up with a bunch of boring application windows typical of a bald engineer. It also won&#8217;t be a group of black terminal windows running vi as a pseudo operating system like the average geek wannabe. I&#8217;m in the search of the <em>Ninja</em> feeling, with white on black text editors, translucent terminals and a dose of eye candy so that I feel <em>special</em> without having to resort to browsing youtube with Lynx.</p>
	<p>After many years I am finally happy with my current development setup. It fits my needs and this series of articles should serve myself as a reminder on how to setup the different pieces. However I guess that it will also be of inspiration for other developers who haven&#8217;t already found their peace of mind with their environment.</p>
	<p>I&#8217;ll focus on Microsoft Windows systems but most of the stuff can be easily implemented in other operating systems. Actually much of the things I do for windows come standard in several operating system distributions, it&#8217;s just that I happen to like Windows (which obviously harms my geek status).</p>
	<p>The main building blocks for this environment are the following ones:</p>
	<ul>
		<li>Cygwin &#8211; A collection of very useful Unix utilities for Windows.</li>
		<li>coLinux &#8211; Wonderful &#8216;<em>virtualization</em>&#8217; software to run Linux side by side Windows.</li>
		<li>Debian &#8211; The only Linux distro I know a bit about. It&#8217;s fantastic so I don&#8217;t have the need to search for a better one.</li>
		<li>PHP5 &#8211; Currently the programming language of my choice.</li>
		<li>Console2 &#8211; An excellent terminal emulator with lots of eye candy.</li>
		<li>Firefox &#8211; The browser that came to rule them all.</li>
		<li>A lightweight text editor &#8211; everyone has its favorite</li>
		<li>A heavy IDE &#8211; Komodo and Eclipse to the rescue</li>
		<li>Several utilities to ease our lives &#8211; TortoiseSVN, kdiff3, wincachegrind, total commander&#8230;</li>
	</ul>
	<p>Before we begin I would like to note the following:</p>
	<ul>
		<li>All tools are installed in &#8220;C:\dev&#8221;. I don&#8217;t like polluting the standard Windows installation with the development tools. Besides, it allows to easily backup most of the environment.</li>
		<li>I&#8217;m using a 32bit version of Windows since coLinux is not compatible with 64bit versions.</li>
	</ul>]]>
</summary>
</entry>
<entry>
		<author>
			<name>Iván Montes</name>
		</author>
		<published>2007-11-27T07:02:00Z</published>
		<updated>2008-06-20T01:32:27Z</updated>
		<title type="html">Xdebug bookmarklet</title>
		<link rel="alternate" type="text/html" href="http://blog.netxus.es/blog/xdebug-bookmarklet" />
		<id>tag:blog.netxus.es,2007-11-26:3ce9f77a34fc941ccfc79f89c35a0079/190b0bd0c20239c5e29079324f68ab96</id>
		
		
		<summary type="html">
<![CDATA[<p>Nothing really new since there is already a <a href="http://blog.netxus.es/https://addons.mozilla.org/en-US/firefox/addon/3960">firefox extension</a> which does just the same but I also wanted support other browsers.</p>

	<p>So this bookmarklet toggles the cookie Xdebug uses to flag if it should debug the running script or not.</p>

	<p><a href="http://blog.netxus.es/javascript:( function(){var idekey='', minutes = 10, exp = new Date(); document.title = 'Xdebug disabled'; if (document.cookie.match(/(^|;)\s*XDEBUG_SESSION=/)) { minutes=-minutes; } else { if (!idekey) idekey = prompt('Set the IDE key for this debugging session if needed (cancel to disable)', 'default'); if (idekey===null){minutes=-minutes}else{document.title='Xdebug enabled'} } exp.setTime( exp.getTime() + minutes*60*1000 ); document.cookie = 'XDEBUG_SESSION=' + (idekey?idekey:'default') + '; expires=' + exp.toGMTString() }() )">Toggle Xdebug</a></p>

	<p>Drag it to your bookmarks (or favourites or whatever is called in your browser) toolbar so it&#8217;s easy to access. Assign it a keyboard shortcut if your browser has that function.</p>

	<p>By default it&#8217;ll prompt for the <em>idekey</em> to be used by Xdebug, it&#8217;s a good idea to modify the <strong>idekey</strong> variable at the start of the bookmarklet&#8217;s source with your <em>idekey</em> or with &#8216;default&#8217; if you&#8217;re not using a <span class="caps">DBG</span>p proxy.</p>]]>
</summary>
</entry>
<entry>
		<author>
			<name>Iván Montes</name>
		</author>
		<published>2007-11-26T07:06:00Z</published>
		<updated>2007-11-27T08:32:19Z</updated>
		<title type="html">Introducing DBGp Path Mapper intercepting proxy</title>
		<link rel="alternate" type="text/html" href="http://blog.netxus.es/blog/introducing-dbgp-path-mapper-intercepting-proxy" />
		<id>tag:blog.netxus.es,2007-11-25:3ce9f77a34fc941ccfc79f89c35a0079/c167035c5801651aade26ce8ebfe4c10</id>
		
		
		<summary type="html">
<![CDATA[<p>My current IDE of choice, <a href="http://www.activestate.com">Komodo</a>, brings native support for the DBGp protocol to debug source code either locally or from a remote server. <del>It has however some issues with its path mapping implementation.</del></p>
	<p>Since it&#8217;s not the first time I stumbled upon this kind of issue (my previous Eclipse PDT experience was troublesome too) I finally tried to solve it. The solution is an intercepting proxy server which listen for connection from the debugger to modify the messages it sends to the IDE with custom path mappings.</p>
	<p>To define the path mappings we use a file with a set of paths on each  line. The path tuples are separated by the <strong>=></strong> operator, placing the path understood by the debugger on the left side and on the right the path as understood by the IDE. The file looks like this.<br />
<pre><code>
  # Mapping for projects
  file:///var/www/projects =&gt; file:///c:/documents%20and%20settings/drslump/projects
  # this one is for my subdomains
  file:///var/www/subdomains =&gt; file:///c:/subdomains<br />
</pre></code></p>
	<p>The path mappings are case insensitive to avoid problems on Windows.</p>
	<p>To run the path mapper server we just need to call it from a terminal like so:<br />
<pre>
  php5 dbgp-mapper.php -i 192.168.0.5 -m dbgp.map<br />
</pre></p>
	<p>The <strong>-i</strong> option specifies the IP or host of the computer where the IDE is running, while the <strong>-m</strong> option points to the file where the path mappings are defined. There are also other options which you can check by seeing the help using the <strong>-h</strong> argument.</p>
	<p>By default it will bind itself to the port 9000, which is DBGp default one, so if you are running this on the same computer as your IDE you will have to change the port either in this tool or on your IDE.</p>
	<p>The source is available via <a href="http://svn.pollinimini.net/public/dbgp-mapper">this subversion repository</a></p>
	<p><strong>Update</strong>: It seems that Komodo uri mapping works properly after version 4.2.0. In my case I was having problems but after rebooting the system it started to work properly.</p>]]>
</summary>
</entry>
<entry>
		<author>
			<name>Iván Montes</name>
		</author>
		<published>2007-11-03T04:46:00Z</published>
		<updated>2007-11-03T04:48:35Z</updated>
		<title type="html">TextMate, the myth</title>
		<link rel="alternate" type="text/html" href="http://blog.netxus.es/blog/textmate-the-myth" />
		<id>tag:blog.netxus.es,2007-11-02:3ce9f77a34fc941ccfc79f89c35a0079/f9a39e31e61e096801e56caa40ddf95c</id>
		
		
		<summary type="html">
<![CDATA[<p>Source code editing and programming tools in general are one of those things I like to be up to date with, you never know when you&#8217;re going to find a killer tool which will boost your productivity. </p>
	<p>For a couple of years I keep hearing about an awesome editor for Macs called TextMate. People even comment on forums and blogs that they are thinking to switch to Mac just to use it.</p>
	<p>Well, I switched to Mac a few weeks ago and one of the first things I installed was this TextMate editor. Given all the hype around it I thought it was going to be my new favourite editor. However there is a lot of myth around this software. For the last year I&#8217;ve been using Eclipse on Windows as my heavy work IDE with Notepad++ as casual editor for quick operations. Now on the Mac Eclipse runs quite slowly so I&#8217;ve been using TextMate a lot in the last days and while it&#8217;s a great replacement for Notepad++ it doesn&#8217;t come close to a real IDE. The Bundles are nice and expose a lot of possibilities but they are useless to work on a big project.</p>
	<p>When you have to deal with a few hundreds library files (Zend Framework, Doctrine, Pear&#8230;) plus another few hundreds of the project then there is nothing else to do that to use a real IDE with  professional tools like integrated debugger, a real code parser, a code explorer and powerful refactoring tools (at least a good find and replace dialog with regular expression support). Then there are some extras like bracket pairing, code versioning, code formatting and smart indentation.</p>
	<p>Sure some of you could argue that TextMate&#8217;s power is on its snippets/bundles customization but lets be serious. I don&#8217;t mind writing function or class constructs continuously, it can get tedious but what really hurts your performance is having to leave the file your are editing because you don&#8217;t remember the exact spelling of an obscure method from a rarely used class, or you can&#8217;t recall what was the order of the arguments for that function that you checked just two hours ago.</p>
	<p>Given that Eclipse is running like a dog on my system I&#8217;ve searched for an alternative and to my surprise I&#8217;ve found a killer one. ActiveState&#8217;s Komodo IDE, which I had trialed a few months ago in Windows but didn&#8217;t really paid attention to it. It&#8217;s dialogs are a bit buggy, the default colour schemes are quite ugly, it takes ages to load, is very expensive and it&#8217;s not the easiest to configure to a point where it&#8217;s useable but&#8230; it&#8217;s really customizable and has a ton of features out of the box. Moreover there is Komodo Edit which is free but doesn&#8217;t have an integrated debugger, so I&#8217;m going to settle on it and will keep Eclipse for remote debugging. Let&#8217;s see if ActiveState drops the price so it can get more popular. By the way, it also has support for code snippets and macros which can make most of the stuff that TextMate&#8217;s bundles can do.</p>
	<p>So right now, I&#8217;m using Komodo IDE and TextMate. When the trial periods of both are over I&#8217;ll have a combination of Komodo Edit, Eclipse and Smultron for the fast editing.</p>
	<p>PS: Excuse the lack of links&#8230; google is your friend</p>]]>
</summary>
</entry>
<entry>
		<author>
			<name>Iván Montes</name>
		</author>
		<published>2007-07-21T19:26:00Z</published>
		<updated>2008-06-20T01:32:20Z</updated>
		<title type="html">Nuestro apoyo al Jueves</title>
		<link rel="alternate" type="text/html" href="http://blog.netxus.es/blog/nuestro-apoyo-al-jueves" />
		<id>tag:blog.netxus.es,2007-07-21:3ce9f77a34fc941ccfc79f89c35a0079/f67e8c2c6b01c1b1f3fe9d611ab1abd1</id>
		
		
		<summary type="html">
<![CDATA[<p>Es una pena que pasen <a href="http://www.20minutos.es/noticia/262733/0/olmo/censura/jueves/">estas</a> <a href="http://www.pagina12.com.ar/diario/elmundo/4-88438-2007-07-21.html">cosas</a></p>

	<p><img src="http://blog.netxus.es/images/7.jpg" title="Portada del Jueves" alt="Portada del Jueves" width="364" height="513" /></p>]]>
</summary>
</entry></feed>