<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Buzu's Oficial Blog</title>
	<atom:link href="http://imbuzu.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://imbuzu.wordpress.com</link>
	<description></description>
	<lastBuildDate>Thu, 26 Jan 2012 09:08:02 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='imbuzu.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Buzu's Oficial Blog</title>
		<link>http://imbuzu.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://imbuzu.wordpress.com/osd.xml" title="Buzu&#039;s Oficial Blog" />
	<atom:link rel='hub' href='http://imbuzu.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Installing an FTP Server on Ubuntu</title>
		<link>http://imbuzu.wordpress.com/2012/01/26/installing-an-ftp-server-on-ubuntu/</link>
		<comments>http://imbuzu.wordpress.com/2012/01/26/installing-an-ftp-server-on-ubuntu/#comments</comments>
		<pubDate>Thu, 26 Jan 2012 09:07:58 +0000</pubDate>
		<dc:creator>buzu</dc:creator>
				<category><![CDATA[En la web ♥]]></category>
		<category><![CDATA[local server]]></category>
		<category><![CDATA[tutoriales]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[fireftp]]></category>
		<category><![CDATA[ftp server]]></category>

		<guid isPermaLink="false">http://imbuzu.wordpress.com/?p=917</guid>
		<description><![CDATA[I had been postponing this task for some time now thinking that it would be time consuming. However, it is actually pretty simple. Since I did not know of any FTP server, I did a quick search: aptitude search ftp &#8230; <a href="http://imbuzu.wordpress.com/2012/01/26/installing-an-ftp-server-on-ubuntu/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=imbuzu.wordpress.com&amp;blog=3363389&amp;post=917&amp;subd=imbuzu&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I had been postponing this task for some time now thinking that it would be time consuming. However, it is actually pretty simple.</p>
<p>Since I did not know of any FTP server, I did a quick search:</p>
<p><code>aptitude search ftp</code></p>
<p>I got a bunch of results but I decided to try vsftp after seeing somewhere that it was the default daemon for linux. So I just ran</p>
<p><code>sudo apt-get install vsftpd</code></p>
<p>And that is it. I&#8217;m done.</p>
<p>I tested using fireftp on my other machine and it connects via ftp to the server. Now, this setup is just for an in-house server. If you plan on opening your ftp server to the outside world, you should read more about the matter, and read the man pages for vsftpd.</p>
<p>Also take a look at the configuration file located on /etc/vsftpd.conf</p>
<p>Some links that might be useful:</p>
<p><a href="http://blog.dhavalparikh.co.in/2009/11/setting-up-ftp-or-sftp-server-using-vsftpd-on-ubuntu/">http://blog.dhavalparikh.co.in/2009/11/setting-up-ftp-or-sftp-server-using-vsftpd-on-ubuntu/</a><br />
<a href="http://ubuntuforums.org/showthread.php?t=91887">http://ubuntuforums.org/showthread.php?t=91887</a><br />
<a href="https://duckduckgo.com/?q=ftp+server+linux">https://duckduckgo.com/?q=ftp+server+linux</a><br />
This last link is just a search results list. One one of those result previews is where I read that vsftpd is the default ftp daemon on linux, but the link, which points to http://www.scribd.com/doc/26706992/FTP-Server-in-Linux is unreadable.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/imbuzu.wordpress.com/917/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/imbuzu.wordpress.com/917/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/imbuzu.wordpress.com/917/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/imbuzu.wordpress.com/917/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/imbuzu.wordpress.com/917/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/imbuzu.wordpress.com/917/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/imbuzu.wordpress.com/917/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/imbuzu.wordpress.com/917/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/imbuzu.wordpress.com/917/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/imbuzu.wordpress.com/917/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/imbuzu.wordpress.com/917/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/imbuzu.wordpress.com/917/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/imbuzu.wordpress.com/917/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/imbuzu.wordpress.com/917/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=imbuzu.wordpress.com&amp;blog=3363389&amp;post=917&amp;subd=imbuzu&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://imbuzu.wordpress.com/2012/01/26/installing-an-ftp-server-on-ubuntu/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/bb890f96dd8321ac00db3c38e176495b?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">buzu</media:title>
		</media:content>
	</item>
		<item>
		<title>Write Less Code, by Writting Intellingently</title>
		<link>http://imbuzu.wordpress.com/2012/01/14/write-less-code-by-writting-intellingently/</link>
		<comments>http://imbuzu.wordpress.com/2012/01/14/write-less-code-by-writting-intellingently/#comments</comments>
		<pubDate>Sat, 14 Jan 2012 11:17:00 +0000</pubDate>
		<dc:creator>buzu</dc:creator>
				<category><![CDATA[En la web ♥]]></category>
		<category><![CDATA[javascript ❤]]></category>
		<category><![CDATA[programación]]></category>
		<category><![CDATA[quick-tips]]></category>

		<guid isPermaLink="false">http://imbuzu.wordpress.com/?p=911</guid>
		<description><![CDATA[I am currently working on a project, and when I say currently, I mean it literally, as in right now. But I think it is worth making a parenthesis to write this entry. I just wanted to point out the &#8230; <a href="http://imbuzu.wordpress.com/2012/01/14/write-less-code-by-writting-intellingently/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=imbuzu.wordpress.com&amp;blog=3363389&amp;post=911&amp;subd=imbuzu&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I am currently working on a project, and when I say currently, I mean it literally, as in right now. But I think it is worth making a parenthesis to write this entry. I just wanted to point out the huge difference that can be made in the code you write, if you do it more intelligently.</p>
<p>Lets look for example at how we might write some piece of code:</p>
<pre>
var addSomething, addSomethingElse
function start(){
  addSomething = B('a[href="something"]')
  addSomethingElse = B('a[href="something-else"]')

  if(addSomething.length &gt; 0){
    prepareAddSomething();
  }
  if(addSomethingElse.length &gt; 0){
    prepareAddSomethingElse();
  }
}

function prepareSometing(){
  addSomething.click(handleClick('something'))
}

function prepareSometingElse(){
  addSomethingElse.click(handleClick('something-else'))
}

function handleClick(type){
  switch(type){
    case 'something':
      return someFunc;
    break;
    case 'something-else':
      return someOtherFunc;
    break;
  }
}
</pre>
<p>This piece of code has some nice &#8220;features&#8221;. For example, it divides all the work in functions that do one task only. It has a nice &#8220;dispatcher&#8221; that handles adding the click handlers to each element.In my case, instead of returning someFunc and someOtherFunc in the dispatcher, I execute another function, which then returns the function that will be listening for the events. So, as you can see there are some good things about this piece of code. However, it is too long. Many of the code lines are repetitive, and it is too verbose to my taste. We can simplify this code by identifying the pieces that repeat too much.</p>
<p>The firs thing we see, is that instead of having prepareAddSomething, and prepareAddSomethingElse, we can have a single prepare function which can handle the task that this function handle:</p>
<pre>
var addSomething, addSomethingElse
function start(){
  addSomething = B('a[href="#something"]')
  addSomethingElse = B('a[href="#something-else"]')

  if(addSomething.length &gt; 0){
    prepare(addSomething)
  }
  if(addSomethingElse.length &gt; 0){
    prepare(addSomethingElse)
  }
}

function prepare(reference){
  reference.click(handleClick(reference.attr('href').replace('#','')))
}

function handleClick(type){
  switch(type){
    case 'something':
      return someFunc;
    break;
    case 'something-else':
      return someOtherFunc;
    break;
  }
}
</pre>
<p>We have successfully replaced two functions with one, and the code still does the same thing. Notice how we realized that the argument that we pass to handleClick is the value of the href attribute of the anchor elements without the hash (#), and used that to our advantage.</p>
<p>Next, we notice that we only want to run prepare if the collections of elements returned by the function B (which is just an alias of jQuery&#8217;s $) is greater than zero. We can also get rid of the double if statements, and replace them with a single if:</p>
<pre>
var addSomething, addSomethingElse
function start(){
  addSomething = B('a[href="#something"]')
  addSomethingElse = B('a[href="#something-else"]')

  prepare(addSomething)
  prepare(addSomethingElse)
}

function prepare(reference){
  if(reference.length &gt; 0)
    reference.click(handleClick(reference.attr('href').replace('#','')))
}

function handleClick(type){
  switch(type){
    case 'something':
      return someFunc;
    break;
    case 'something-else':
      return someOtherFunc;
    break;
  }
}
</pre>
<p>Since the idea here is to write less code, we are not using the curly braces &#8220;{ and }&#8221; since they are optional in this situation.</p>
<p>Now we have a shorter version of our code, that is still very readable, and that does the same thing as the original code. All we had to do was look at it, find the things that get repeated over and over again, and write more general functions.</p>
<p>This is just a quick note I wanted to make, maybe it inspires you to look at your code and try to find out where you can make it shorter.</p>
<p>One last thing you should notice is how it would be really hard to make one single prepare function if we didn&#8217;t have that little dispatcher function (handleClick). That is one of the reasons I like using those kind of functions.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/imbuzu.wordpress.com/911/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/imbuzu.wordpress.com/911/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/imbuzu.wordpress.com/911/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/imbuzu.wordpress.com/911/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/imbuzu.wordpress.com/911/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/imbuzu.wordpress.com/911/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/imbuzu.wordpress.com/911/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/imbuzu.wordpress.com/911/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/imbuzu.wordpress.com/911/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/imbuzu.wordpress.com/911/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/imbuzu.wordpress.com/911/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/imbuzu.wordpress.com/911/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/imbuzu.wordpress.com/911/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/imbuzu.wordpress.com/911/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=imbuzu.wordpress.com&amp;blog=3363389&amp;post=911&amp;subd=imbuzu&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://imbuzu.wordpress.com/2012/01/14/write-less-code-by-writting-intellingently/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/bb890f96dd8321ac00db3c38e176495b?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">buzu</media:title>
		</media:content>
	</item>
		<item>
		<title>Setting Up a New Working Environment</title>
		<link>http://imbuzu.wordpress.com/2012/01/13/setting-up-a-new-working-environment/</link>
		<comments>http://imbuzu.wordpress.com/2012/01/13/setting-up-a-new-working-environment/#comments</comments>
		<pubDate>Fri, 13 Jan 2012 08:36:04 +0000</pubDate>
		<dc:creator>buzu</dc:creator>
				<category><![CDATA[Networking]]></category>
		<category><![CDATA[IE7]]></category>
		<category><![CDATA[ssh]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://imbuzu.wordpress.com/?p=907</guid>
		<description><![CDATA[If you have followed the blog for long enough, it is no news to you that up untill now I use an old Dell latitude D610 as my main computer. I&#8217;ve been working on this modern Dinosaur since 2010, when &#8230; <a href="http://imbuzu.wordpress.com/2012/01/13/setting-up-a-new-working-environment/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=imbuzu.wordpress.com&amp;blog=3363389&amp;post=907&amp;subd=imbuzu&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>If you have followed the blog for long enough, it is no news to you that up untill now I use an old Dell latitude D610 as my main computer. I&#8217;ve been working on this modern Dinosaur since 2010, when I first started as a feelance. About a month ago, I decided it was time to buy a new computer, despite the fact that the old computer still works pretty well. I now have a brand new computer that runs on a quad core AMD chip, and has the humble amount of 4GB of memory. 4GB may not be much this days, but it is still double what I have on the D610.</p>
<p>Untill a couple of days ago, the new computer was just sitting there. I decided I would not let my money go to waste, and set up the new computer. I made space for it on the desk, and set it there with an external monitor. (In fact, I bought a new desk to fit this new machine). Until today, I&#8217;ve been using that computer just as a firefox house, playing some music on youtube, and searching for stuff on the web, while I try to little by little get rid of my 50+ firefox tabs on the D610. However, the objective is to gradually move all my work environment to this new computer, and leave the old one as a server. The first step is clear: Find a way to access the old computer (running linux) from the new computer, which runs windows 7. I first thought of installing an FTP server, but I decided I would much rather work over SSH than FTP. So, this is what I did:</p>
<p>1) Installed PuTTy on Windows.</p>
<p>Installing programs on windows is pretty easy: you download the executable file, open it, and follow instructions. The intaller can be downloaded from <a href="http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html">http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html</a></p>
<p>I went for the &#8220;installer for everything except PuTTYtel&#8221; mostly because I was too lazy to install puTTY and pscp separately.</p>
<p>At some point I considered copSSH, just because it integrates a client as well as a server, but gave it up when they asked for my email to download the software. I get more than enough spam, so, thanks but no thanks.</p>
<p>The second step was to install an ssh server on the D610, which runs ubuntu.</p>
<p>That is even simpler than what we did on the windows machine. Just open the terminal and enter:</p>
<pre>sudo apt-get install openssh-server</pre>
<p>That was all. I can now ssh into the ubuntu box from the windows machine.</p>
<p>I think I&#8217;m little by little getting away from that sick relationship I have with ubuntu. I am finding myself more and moe annoyed with ubuntu every day. I am not hopping windows will be better, but at least, when I want another linux distro, I will not fall for ubuntu again.</p>
<p>So, what is next? I think next I will install an FTP server, just becuase wordpress sometimes needs one. Then I might install some version manager system. But the real next steps is to start using the windows machine more and leaving the ubuntu box as just a server.</p>
<p>Some links that were useful, or maybe not, are recorded here for future reference:<br />
<a href="http://www.sevenforums.com/customization/19864-ssh-windows-7-a.html">http://www.sevenforums.com/customization/19864-ssh-windows-7-a.html</a><br />
<a href="http://principialabs.com/beginning-ssh-on-ubuntu/">http://principialabs.com/beginning-ssh-on-ubuntu/</a><br />
<a href="https://help.ubuntu.com/11.10/serverguide/C/openssh-server.html">https://help.ubuntu.com/11.10/serverguide/C/openssh-server.html</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/imbuzu.wordpress.com/907/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/imbuzu.wordpress.com/907/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/imbuzu.wordpress.com/907/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/imbuzu.wordpress.com/907/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/imbuzu.wordpress.com/907/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/imbuzu.wordpress.com/907/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/imbuzu.wordpress.com/907/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/imbuzu.wordpress.com/907/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/imbuzu.wordpress.com/907/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/imbuzu.wordpress.com/907/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/imbuzu.wordpress.com/907/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/imbuzu.wordpress.com/907/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/imbuzu.wordpress.com/907/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/imbuzu.wordpress.com/907/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=imbuzu.wordpress.com&amp;blog=3363389&amp;post=907&amp;subd=imbuzu&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://imbuzu.wordpress.com/2012/01/13/setting-up-a-new-working-environment/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/bb890f96dd8321ac00db3c38e176495b?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">buzu</media:title>
		</media:content>
	</item>
		<item>
		<title>Problems Updating Database Tables (MySQL)</title>
		<link>http://imbuzu.wordpress.com/2012/01/12/problems-updating-database-tables-mysql/</link>
		<comments>http://imbuzu.wordpress.com/2012/01/12/problems-updating-database-tables-mysql/#comments</comments>
		<pubDate>Thu, 12 Jan 2012 10:57:49 +0000</pubDate>
		<dc:creator>buzu</dc:creator>
				<category><![CDATA[En la web ♥]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[problemas]]></category>
		<category><![CDATA[quick-tips]]></category>

		<guid isPermaLink="false">http://imbuzu.wordpress.com/?p=904</guid>
		<description><![CDATA[I run into a little problem a few days ago when I was trying to update a database table&#8217;s structure. The table had been created with the wrong settings, and I had to go and add an AUTO_INCREMENT to the &#8230; <a href="http://imbuzu.wordpress.com/2012/01/12/problems-updating-database-tables-mysql/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=imbuzu.wordpress.com&amp;blog=3363389&amp;post=904&amp;subd=imbuzu&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I run into a little problem a few days ago when I was trying to update a database table&#8217;s structure. The table had been created with the wrong settings, and I had to go and add an AUTO_INCREMENT to the primary key. Before you get out of here thinking I&#8217;m such a stupid person, you should know that the table was created, not by me, but by a person who is bravely learning about this stuff.</p>
<p>The table is using InnoDB engine, which enforces constraints between tables, and this was causing me not to be able to change the table. Everytime I tried, I jut got back an error similar to this:</p>
<pre>
ERROR 1025 (HY000): Error on rename of './e3/#sql-17f3_f894' to './e3/cls_ev_items' (errno: 150)
</pre>
<p>To solve this problem, one just needs to remove the contraint, change the database, and add the constraint again.</p>
<p>To remove the contraint you would do something like this:</p>
<pre>
ALTER TABLE table_name DROP FOREIGN KEY relationship_name;
</pre>
<p>Then you can alter your table, in my case I did something like this:</p>
<pre>
ALTER TABLE table_name CHANGE id id INT UNSIGNED NOT NULL AUTO_INCREMENT
</pre>
<p>Then add the constraint again:</p>
<pre>
ALTER TABLE table_name ADD CONSTRAINT `relationship_name` FOREIGN KEY(`field_in_table`) REFERENCES `other_table` (`foreing_key`);
</pre>
<p>And that is basically all you have to do. Im my case, all the tables were missing the AUTO_INCREMENT, so I just DROPed them all and creted them anew with the right settings, but sometimes that is not possible.</p>
<p>Some links that were useful, or maybe not, are recorder here for future reference:<br />
<a href="http://www.simplicidade.org/notes/archives/2008/03/mysql_errno_150.html">http://www.simplicidade.org/notes/archives/2008/03/mysql_errno_150.html</a><br />
<a href="http://stackoverflow.com/questions/160233/what-does-mysql-error-1025-hy000-error-on-rename-of-foo-errorno-150-me">http://stackoverflow.com/questions/160233/what-does-mysql-error-1025-hy000-error-on-rename-of-foo-errorno-150-me</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/imbuzu.wordpress.com/904/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/imbuzu.wordpress.com/904/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/imbuzu.wordpress.com/904/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/imbuzu.wordpress.com/904/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/imbuzu.wordpress.com/904/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/imbuzu.wordpress.com/904/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/imbuzu.wordpress.com/904/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/imbuzu.wordpress.com/904/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/imbuzu.wordpress.com/904/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/imbuzu.wordpress.com/904/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/imbuzu.wordpress.com/904/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/imbuzu.wordpress.com/904/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/imbuzu.wordpress.com/904/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/imbuzu.wordpress.com/904/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=imbuzu.wordpress.com&amp;blog=3363389&amp;post=904&amp;subd=imbuzu&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://imbuzu.wordpress.com/2012/01/12/problems-updating-database-tables-mysql/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/bb890f96dd8321ac00db3c38e176495b?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">buzu</media:title>
		</media:content>
	</item>
		<item>
		<title>Terminal Stays on Top Of all Other Windows on Ubuntu 2D</title>
		<link>http://imbuzu.wordpress.com/2012/01/05/terminal-stays-on-top-of-all-other-windows-on-ubuntu-2d/</link>
		<comments>http://imbuzu.wordpress.com/2012/01/05/terminal-stays-on-top-of-all-other-windows-on-ubuntu-2d/#comments</comments>
		<pubDate>Thu, 05 Jan 2012 13:01:47 +0000</pubDate>
		<dc:creator>buzu</dc:creator>
				<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[gconf-editor]]></category>
		<category><![CDATA[metacity]]></category>

		<guid isPermaLink="false">http://imbuzu.wordpress.com/?p=879</guid>
		<description><![CDATA[Personally I don&#8217;t care much for eye-candy.Don&#8217;t get me wrong; I love beautiful interfaces -minimalists ones if possible. However, I think sometimes too much is too much. I would rather have a beautiful, simple interfaces that is resources-friendly, than a &#8230; <a href="http://imbuzu.wordpress.com/2012/01/05/terminal-stays-on-top-of-all-other-windows-on-ubuntu-2d/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=imbuzu.wordpress.com&amp;blog=3363389&amp;post=879&amp;subd=imbuzu&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Personally I don&#8217;t care much for eye-candy.Don&#8217;t get me wrong; I love beautiful interfaces -minimalists ones if possible. However, I think sometimes too much is too much. I would rather have a beautiful, simple interfaces that is resources-friendly, than a super cool, animated one that uses too many resources on the computer, especially when working with old, or not-so-powerful computers.</p>
<p>Currently I own two laptops. One is an HP pavilion g6 with a quad-core AMD A6 chip, and 4GB of memory. Not a top-of-the-line computer, but certainly more than enough for what I do. Which is editing text files and FTPing into servers, and of course, running my own server. The problem is I&#8217;ve got no time to set it up for my needs, so it currently serves to the only purpose of running IE and Safari in it, and to make me think: &#8220;Why did I buy this thing?&#8221;</p>
<p>The other computer is a dell latitude d610 which I bought a while back. If I remember well, it has an Intel M chip which, needless to say, it is not that powerful, but amazingly enough it runs pretty well, and it is enough for my needs.</p>
<p>I run this Dell with an external monitor attached to it whose maximum resolution is a descent 1280 by 1024. The problem is that the computer can&#8217;t handle that resolution plus the 1024 X 768 screen on the laptop. I decided to start using ubuntu 2D, which is pretty resources-friendly. The computer flies in comparison to using the regular ubuntu (3D?).</p>
<p>Everything was well, until I noticed that the terminal window (either gnome-terminal or terminator) would stay on top of any other window even when that other window had the focus. I asked my good friend duckduckgo about the issue, and one of the search results was this page: <a href="http://superuser.com/questions/351496/why-does-the-terminal-in-unity-2d-ubuntu-11-10-always-stay-in-the-foreground/371329#371329">http://superuser.com/questions/351496/why-does-the-terminal-in-unity-2d-ubuntu-11-10-always-stay-in-the-foreground/371329#371329</a></p>
<p>The solution to the problem is posted there, so you might not want to read the rest of the entry, but if you do, Thanks!</p>
<p>Personally I don&#8217;t quite like the idea of creating a xorg.config file. That file was removed from ubuntu back in 11.04, or at least I think that is when it was removed. I am not aware of the reasons why that config file was removed, but I just didn&#8217;t like the idea of adding it back.</p>
<p>The page mentioned earlier, however, gave me an idea of why I was having that problem. (There is also an interesting discussion of the problem on <a href="http://ubuntuforums.org/showthread.php?p=11387297#poststop">http://ubuntuforums.org/showthread.php?p=11387297#poststop</a>). So I decided to take a look at gconf-editor, especially after seeing this post: <a href="http://marianochavero.wordpress.com/2011/04/20/a-simple-gui-for-unity-2d-settings-ubuntu-11-04/">http://marianochavero.wordpress.com/2011/04/20/a-simple-gui-for-unity-2d-settings-ubuntu-11-04/</a>. </p>
<p>It turns out you can turn off Composite on Metacity through gconf-editor. I&#8217;m sure you already read the instructions on <a href="http://superuser.com/questions/351496/why-does-the-terminal-in-unity-2d-ubuntu-11-10-always-stay-in-the-foreground/371329#371329">http://superuser.com/questions/351496/why-does-the-terminal-in-unity-2d-ubuntu-11-10-always-stay-in-the-foreground/371329#371329</a> That I posted, but if you didn&#8217;t, here they are:</p>
<p>Open the terminal and type: <code>gconf-editor /apps/metacity/general</code></p>
<p>look for the compositing_manager options and uncheck it. Your windows will flicker and the problem will be solved.</p>
<p>I hope this proves useful to some of you.</p>
<p>For now I&#8217;ve decided to give XFCE a try, and see how everything goes. After all, the flexibility of switching between environments an managers is one of the reasons I use linux.</p>
<p>Some links that where useful, or maybe not, are recorded here for future reference:<br />
<a href="http://https://help.ubuntu.com/community/Metacity">https://help.ubuntu.com/community/Metacity</a><br />
<a href="http://http://marianochavero.wordpress.com/2011/04/20/a-simple-gui-for-unity-2d-settings-ubuntu-11-04/">http://marianochavero.wordpress.com/2011/04/20/a-simple-gui-for-unity-2d-settings-ubuntu-11-04/</a><br />
<a href="http://http://ubuntuforums.org/showthread.php?p=11387297#poststop">http://ubuntuforums.org/showthread.php?p=11387297#poststop</a><br />
<a href="http://http://superuser.com/questions/351496/why-does-the-terminal-in-unity-2d-ubuntu-11-10-always-stay-in-the-foreground/371329#371329">http://superuser.com/questions/351496/why-does-the-terminal-in-unity-2d-ubuntu-11-10-always-stay-in-the-foreground/371329#371329</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/imbuzu.wordpress.com/879/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/imbuzu.wordpress.com/879/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/imbuzu.wordpress.com/879/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/imbuzu.wordpress.com/879/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/imbuzu.wordpress.com/879/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/imbuzu.wordpress.com/879/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/imbuzu.wordpress.com/879/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/imbuzu.wordpress.com/879/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/imbuzu.wordpress.com/879/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/imbuzu.wordpress.com/879/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/imbuzu.wordpress.com/879/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/imbuzu.wordpress.com/879/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/imbuzu.wordpress.com/879/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/imbuzu.wordpress.com/879/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=imbuzu.wordpress.com&amp;blog=3363389&amp;post=879&amp;subd=imbuzu&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://imbuzu.wordpress.com/2012/01/05/terminal-stays-on-top-of-all-other-windows-on-ubuntu-2d/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/bb890f96dd8321ac00db3c38e176495b?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">buzu</media:title>
		</media:content>
	</item>
		<item>
		<title>Editing Remote Files on lftp</title>
		<link>http://imbuzu.wordpress.com/2012/01/04/editing-remote-files-on-lftp/</link>
		<comments>http://imbuzu.wordpress.com/2012/01/04/editing-remote-files-on-lftp/#comments</comments>
		<pubDate>Wed, 04 Jan 2012 11:17:49 +0000</pubDate>
		<dc:creator>buzu</dc:creator>
				<category><![CDATA[BASH]]></category>
		<category><![CDATA[Useful Code]]></category>
		<category><![CDATA[problemas]]></category>
		<category><![CDATA[programación]]></category>
		<category><![CDATA[quick-tips]]></category>

		<guid isPermaLink="false">http://imbuzu.wordpress.com/?p=892</guid>
		<description><![CDATA[Well, after that happy day when I finally set fireFTP to open remote files on vim for editing, I&#8217;ve decided that I won&#8217;t use fireFTP any more. The reason for this is basically that I want to migrate to a &#8230; <a href="http://imbuzu.wordpress.com/2012/01/04/editing-remote-files-on-lftp/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=imbuzu.wordpress.com&amp;blog=3363389&amp;post=892&amp;subd=imbuzu&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Well, after that happy day when I finally set fireFTP to open remote files on vim for editing, I&#8217;ve decided that I won&#8217;t use fireFTP any more. The reason for this is basically that I want to migrate to a command-line-based life. There are things I won&#8217;t be able to do through the cl, but that is OK. All I want is to be more efficient, and the command line is one way to really be more efficient. Those tasks that I cannot do via the command line I will do them in the most efficient way I know. For example, I installed pentadactyl on firefox, and it really speeds up any kind of activity you do on firefox.</p>
<p>Anyway, I stated using lftp because it is a really nice ftp client. It come pre-installed on Ubuntu, or at least I don&#8217;t remember installing it, and it is really powerful. However, it does have some disadvantages, and one of them is that you cannot edit remote files.</p>
<p>The way you would do it is downloading the file, editing it locally, and then uploading it to the server, but that is just a really ugly way to do things. I decided I would look for a solutions. A quick search led me to this page:<br />
<a href="http://http://readme.maven.pl/2007/06/15/lftp-and-editing-remote-files/">http://readme.maven.pl/2007/06/15/lftp-and-editing-remote-files/</a><br />
but that is not what I wanted. This script allows you to open any remote file on vim, edit it, and when you close vim, the file gets automatically updated on the remote server. This is not really a good way to do it, because many times you want to make changes, reload the page, make some more changes, and reload again. If every time you make a change you have to close vim for the script to upload the file, you will end up wasting a lot of time.</p>
<p>The ideal way to do it would be to upload the file as soon as it has been edited and saved even if vim is still open. Well, I just spend more than 8 hours writing a script to do just that.</p>
<p>As a side note, I didn&#8217;t even feel the time passing. Rarely do I spend so much time working on something straight.</p>
<p>I found many challenges writing this script, especially because I don&#8217;t really know shell scripting. The first problem I  found is documented on <a href="http://http://superuser.com/questions/374406/why-do-i-get-not-found-when-running-a-script">http://superuser.com/questions/374406/why-do-i-get-not-found-when-running-a-script</a><br />
The other challenges I faced are related to shell commands and the fact that shell commands run one after the other. That is, if you type 2 commands, the first one has to finish execution in order for the second to start executing. You can run commands asynchronously, but that is something I did not know when I started this, or at least I didn&#8217;t exactly know how to do it.</p>
<p>All I knew about running command asynchronously was using the &amp; at the end of a command. I use it sometimes when I want to launch a program, but I don&#8217;t want it to block the current terminal window.</p>
<p>I started by modifying the script presented on maven.pl. After so many modifications I got to this:</p>
<pre>
#!/bin/bash
tempid=$$
save() {
#echo shell echo $COPROC_PID
        tempid=$1
        if [[ /tmp/$tempid$2 -nt /tmp/$tempid$2.check ]]; then
                echo  shell echo "Uploading file " $2
                cp /tmp/$tempid$2 /tmp/$tempid$2.check;
                echo put /tmp/$tempid$2 -o $2;
        fi;
        sleep 2
        if [[ $COPROC_PID != '' ]]; then
                save $tempid $2
        fi;
}
echo get $2 -o /tmp/$tempid$2
cp /tmp/$tempid$2 /tmp/$tempid$2.check;
file2=/tmp/$tempid$2.check;
coproc terminator -x $1 /tmp/$tempid$2
save $tempid $2 $COPROC
echo put -E /tmp/$tempid$2 -o $2
rm $file2
</pre>
<p>just create a file under ~/.lftp/ named edit.sh, and write that code in it.<br />
Then create another file on the same location and name it rc and add the following:</p>
<pre>alias edit source -e ~/.lftp/edit.sh</pre>
<p>Now you can open your files and edit them. They will be uploaded when the script detects that they have changed.</p>
<p>There are still many things that can be done, like adding the possibility of editing more than one file at the same time, but for now I&#8217;m happy with it the way it is.</p>
<p>The usage is simple:</p>
<p>start lftp:</p>
<pre>$ lftp user@host.com</pre>
<p>enter your password and navigate the folder where the file you want to modify is located. The type:</p>
<pre>edit vim file.php</pre>
<p>vim is the program you want to use to edit the file. You could use gimp for images, vim for text files, or gedit for text files, or any other text editor, or in fact any program that is suitable to edit the kind of file you want to edit.<br />
file.php is the name of the file you want to edit.</p>
<p>The most useful resource while developing this was the man page for bash.</p>
<p>Some links that were useful, or maybe not, are recorded here just for reference:</p>
<p>http://www.linuxtopia.org/online_books/advanced_bash_scripting_guide/x6632.html</p>
<p>http://steve-parker.org/sh/functions.shtml</p>
<p>http://www.thegeekstuff.com/2010/05/watch-command-examples/</p>
<p>http://serverfault.com/questions/207067/cd-in-linux-shell-script-returns-command-not-found</p>
<p>http://michael.stapelberg.de/lftp_vi/</p>
<p>http://unix.ittoolbox.com/groups/technical-functional/unixadmin-l/how-to-check-file-exists-in-one-command-line-925140</p>
<p>http://vim.wikia.com/wiki/Edit_remote_files_locally_via_SCP/RCP/FTP</p>
<p>Not all this links are completely related to the script, and not all of them were useful. Some of them I didn&#8217;t read in their entirety or I just red over the surface without really paying much attention to them. They are there just for future reference in case I want to go back to them later. Bookmarking them seemed too</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/imbuzu.wordpress.com/892/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/imbuzu.wordpress.com/892/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/imbuzu.wordpress.com/892/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/imbuzu.wordpress.com/892/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/imbuzu.wordpress.com/892/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/imbuzu.wordpress.com/892/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/imbuzu.wordpress.com/892/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/imbuzu.wordpress.com/892/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/imbuzu.wordpress.com/892/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/imbuzu.wordpress.com/892/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/imbuzu.wordpress.com/892/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/imbuzu.wordpress.com/892/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/imbuzu.wordpress.com/892/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/imbuzu.wordpress.com/892/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=imbuzu.wordpress.com&amp;blog=3363389&amp;post=892&amp;subd=imbuzu&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://imbuzu.wordpress.com/2012/01/04/editing-remote-files-on-lftp/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/bb890f96dd8321ac00db3c38e176495b?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">buzu</media:title>
		</media:content>
	</item>
		<item>
		<title>Changing GIMP&#8217;s Splash Image</title>
		<link>http://imbuzu.wordpress.com/2012/01/03/changing-gimps-splash-image/</link>
		<comments>http://imbuzu.wordpress.com/2012/01/03/changing-gimps-splash-image/#comments</comments>
		<pubDate>Tue, 03 Jan 2012 22:44:06 +0000</pubDate>
		<dc:creator>buzu</dc:creator>
				<category><![CDATA[GIMP]]></category>
		<category><![CDATA[tricks]]></category>
		<category><![CDATA[gimp]]></category>
		<category><![CDATA[trick]]></category>

		<guid isPermaLink="false">http://imbuzu.wordpress.com/?p=889</guid>
		<description><![CDATA[Today I was, for no particular reason, looking at GIMP&#8217;s manual page: man gimp and I learned that you can change the splash image that appears when you start GIMP. This way you can personalise GIMP for example with your &#8230; <a href="http://imbuzu.wordpress.com/2012/01/03/changing-gimps-splash-image/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=imbuzu.wordpress.com&amp;blog=3363389&amp;post=889&amp;subd=imbuzu&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Today I was, for no particular reason, looking at GIMP&#8217;s manual page:</p>
<pre>man gimp</pre>
<p>and I learned that you can change the splash image that appears when you start GIMP. This way you can personalise GIMP for example with your company&#8217;s logo. In order to do that, You just need to place an image on <code>~/.gimp-2.6/ </code>under the name <code>gimp-splash.png</code>. We are assuming that you are using GIMP 2.6 here. If your GIMP version is different, read the gimp man page, or just look at your <code>HOME</code> directory to see what the name of the directory is.</p>
<p>Once you do that, start GIMP and enjoy.</p>
<p>I think this is a neat &#8220;trick&#8221; you can use to further personalise your machine. After all, most of us like to have them personalised to the bone, or should I say to the chip?</p>
<p>Another neat trick is to load a random image. This is very simple to do. Just create a directory and name it splashes under <code>~/.gimp-2.6</code>, then add your images there. There is no mention of whether they have to be of a certain size, so I assume size does not matter, and I would only use png files, but I don&#8217;t know if that is required.</p>
<p>Enjoy!</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/imbuzu.wordpress.com/889/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/imbuzu.wordpress.com/889/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/imbuzu.wordpress.com/889/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/imbuzu.wordpress.com/889/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/imbuzu.wordpress.com/889/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/imbuzu.wordpress.com/889/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/imbuzu.wordpress.com/889/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/imbuzu.wordpress.com/889/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/imbuzu.wordpress.com/889/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/imbuzu.wordpress.com/889/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/imbuzu.wordpress.com/889/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/imbuzu.wordpress.com/889/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/imbuzu.wordpress.com/889/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/imbuzu.wordpress.com/889/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=imbuzu.wordpress.com&amp;blog=3363389&amp;post=889&amp;subd=imbuzu&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://imbuzu.wordpress.com/2012/01/03/changing-gimps-splash-image/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/bb890f96dd8321ac00db3c38e176495b?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">buzu</media:title>
		</media:content>
	</item>
		<item>
		<title>2011 in review</title>
		<link>http://imbuzu.wordpress.com/2012/01/01/2011-in-review/</link>
		<comments>http://imbuzu.wordpress.com/2012/01/01/2011-in-review/#comments</comments>
		<pubDate>Sun, 01 Jan 2012 20:49:19 +0000</pubDate>
		<dc:creator>buzu</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://imbuzu.wordpress.com/?p=887</guid>
		<description><![CDATA[The WordPress.com stats helper monkeys prepared a 2011 annual report for this blog. Here&#8217;s an excerpt: The concert hall at the Syndey Opera House holds 2,700 people. This blog was viewed about 13,000 times in 2011. If it were a &#8230; <a href="http://imbuzu.wordpress.com/2012/01/01/2011-in-review/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=imbuzu.wordpress.com&amp;blog=3363389&amp;post=887&amp;subd=imbuzu&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>The WordPress.com stats helper monkeys prepared a 2011 annual report for this blog.</p>
<p>	<a href="/2011/annual-report/"><img src="http://www.wordpress.com/wp-content/mu-plugins/annual-reports/img/emailteaser.jpg" width="100%" alt="" /></a></p>
<p>Here&#8217;s an excerpt:</p>
</p>
<blockquote><p>The concert hall at the Syndey Opera House holds 2,700 people.  This blog was viewed about <strong>13,000</strong> times in 2011.  If it were a concert at Sydney Opera House, it would take about 5 sold-out performances for that many people to see it.</p></blockquote>
<p><a href="/2011/annual-report/">Click here to see the complete report.</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/imbuzu.wordpress.com/887/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/imbuzu.wordpress.com/887/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/imbuzu.wordpress.com/887/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/imbuzu.wordpress.com/887/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/imbuzu.wordpress.com/887/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/imbuzu.wordpress.com/887/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/imbuzu.wordpress.com/887/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/imbuzu.wordpress.com/887/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/imbuzu.wordpress.com/887/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/imbuzu.wordpress.com/887/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/imbuzu.wordpress.com/887/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/imbuzu.wordpress.com/887/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/imbuzu.wordpress.com/887/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/imbuzu.wordpress.com/887/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=imbuzu.wordpress.com&amp;blog=3363389&amp;post=887&amp;subd=imbuzu&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://imbuzu.wordpress.com/2012/01/01/2011-in-review/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/bb890f96dd8321ac00db3c38e176495b?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">buzu</media:title>
		</media:content>

		<media:content url="http://www.wordpress.com/wp-content/mu-plugins/annual-reports/img/emailteaser.jpg" medium="image" />
	</item>
		<item>
		<title>A Little About the setup_postdata() WordPress Function</title>
		<link>http://imbuzu.wordpress.com/2011/12/30/a-little-about-the-setup_postdata-wordpress-function/</link>
		<comments>http://imbuzu.wordpress.com/2011/12/30/a-little-about-the-setup_postdata-wordpress-function/#comments</comments>
		<pubDate>Fri, 30 Dec 2011 09:53:56 +0000</pubDate>
		<dc:creator>buzu</dc:creator>
				<category><![CDATA[En la web ♥]]></category>
		<category><![CDATA[Lo aprendí a la mala]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[debugging]]></category>
		<category><![CDATA[web development]]></category>

		<guid isPermaLink="false">http://imbuzu.wordpress.com/?p=884</guid>
		<description><![CDATA[Today I spent some minutes trying to get setup_postdata() to work. The problem I was having was that the function seemed to be setting the data for one post only. I was using it along with get_posts. If you look &#8230; <a href="http://imbuzu.wordpress.com/2011/12/30/a-little-about-the-setup_postdata-wordpress-function/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=imbuzu.wordpress.com&amp;blog=3363389&amp;post=884&amp;subd=imbuzu&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Today I spent some minutes trying to get <code>setup_postdata()</code> to work. The problem I was having was that the function seemed to be setting the data for one post only. I was using it along with <code>get_posts</code>. If you look at the <code>setup_postdata</code> function documentation, you will find that it is really of not much help when it comes to finding out why it might not be working properly.</p>
<p>This is the situation I found myself in: I was developing a widget that takes the latest posts from the specified category and displays them. That is pretty easy to do. However, I hit an error when I was displaying the posts. The code looked like this:</p>
<pre>
function widget($args, $instance){
  //..some standard code
  $posts = get_posts($options);
  foreach($posts as $post){
    setup_postdata($post);
    //..some more code here
  }
  //..some more code here
}
</pre>
<p>I&#8217;ve got rid of the code that is not relevant to the situation.</p>
<p>That seemed to not work properly, and I got this output:</p>
<pre>
title1
title1
title1
title1
</pre>
<p>When I should have been getting this:</p>
<pre>
title1
title2
title3
title4
</pre>
<p>I went and checked the documentation of the functions involved and nothing seemed to be wrong. So I decided to look at the code of the function. I knew that the loop was setting the proper value for <code>$post</code> on each round. But for some reason <code>setup_postdata</code> was setting up the data for the same post over and over again.</p>
<p>It turns out I don&#8217;t really need to <code>setup_postdata()</code> at all, but I do it just to be sure. The functions I&#8217;m using to display the information are <code>the_permalink</code>, and <code>the_title</code>.</p>
<p><code>setup_postdata</code> doesn&#8217;t really set up all the data related to a post. It sets only some of it, specifically the numeric ID, the author data, the day, the month, the current page, the content, whether the post is multi-page, the number of pages, and variable named <code>$more</code> that I currently am not sure what it is used for. This information is used by some functions like <code>the_content</code>.</p>
<p>The source of the problem was not really on <code>setup_postdata</code>, but on <code>the_title</code> and <code>the_permalink</code>. <code>the_title</code>, for example, relies on a function called <code>get_the_title</code>, which takes a single argument: a post id. This post id can be 0, which in fact is the default value. <code>get_the_title</code> then calls <code>get_post</code>, and passes the post id as parameter to that function. <code>get_post</code>, in turn, checks for that post id, if it is an empty value (zero is an empty value), then it uses the global <code>$post</code>, and that is where the problem was.</p>
<p>In order for functions like <code>the_title</code> to work properly when inside a function, you must declare a global post variable:</p>
<pre>global $post;</pre>
<p>you should do that, preferably at the top of your function. This overwrites the current global <code>$post</code> with the post that you are trying to access information from.</p>
<p>So, as it turns out, <code>setup_postdata</code> is a function that only sets some global variables that can be used by other functions like <code>the_content</code>. Keep in mind that you don&#8217;t always have to use <code>setup_postdata</code>, and if you do use it, always consider running <code>wp_reset_postdata();</code> when you are done.</p>
<p>And finally, remember that functions like <code>the_title</code>, <code>the_permalink</code>, <code>the_content</code>, and so on, rely on the global <code>$post</code>. This means that you should always declare a global <code>$post</code> inside any function that uses those functions mentioned earlier. When looping through a set of posts that you got from functions like <code>get_posts</code>, always name the current item <code>$post</code>:</p>
<pre>
foreach($posts as $post)//&lt;-That $post is important! Do not use another name, or it won&#039;t work.
</pre>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/imbuzu.wordpress.com/884/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/imbuzu.wordpress.com/884/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/imbuzu.wordpress.com/884/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/imbuzu.wordpress.com/884/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/imbuzu.wordpress.com/884/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/imbuzu.wordpress.com/884/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/imbuzu.wordpress.com/884/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/imbuzu.wordpress.com/884/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/imbuzu.wordpress.com/884/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/imbuzu.wordpress.com/884/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/imbuzu.wordpress.com/884/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/imbuzu.wordpress.com/884/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/imbuzu.wordpress.com/884/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/imbuzu.wordpress.com/884/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=imbuzu.wordpress.com&amp;blog=3363389&amp;post=884&amp;subd=imbuzu&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://imbuzu.wordpress.com/2011/12/30/a-little-about-the-setup_postdata-wordpress-function/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/bb890f96dd8321ac00db3c38e176495b?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">buzu</media:title>
		</media:content>
	</item>
		<item>
		<title>Having Problems with WiFi</title>
		<link>http://imbuzu.wordpress.com/2011/12/28/having-problems-with-wifi/</link>
		<comments>http://imbuzu.wordpress.com/2011/12/28/having-problems-with-wifi/#comments</comments>
		<pubDate>Wed, 28 Dec 2011 21:23:04 +0000</pubDate>
		<dc:creator>buzu</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[modem]]></category>
		<category><![CDATA[motorola NVG510]]></category>
		<category><![CDATA[wifi]]></category>

		<guid isPermaLink="false">http://imbuzu.wordpress.com/?p=881</guid>
		<description><![CDATA[I was playing with the settings on my modem/router (Motorola NVG510) last night and it seems I screwed something up. I was trying to make my local server available to the outside world. That is easy.Just go to the admin &#8230; <a href="http://imbuzu.wordpress.com/2011/12/28/having-problems-with-wifi/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=imbuzu.wordpress.com&amp;blog=3363389&amp;post=881&amp;subd=imbuzu&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I was playing with the settings on my modem/router (Motorola NVG510) last night and it seems I screwed something up. I was trying to make my local server available to the outside world. That is easy.Just go to the admin page of the device, then Firewall-&gt;NAT/Gaming and associate the HTTP service to the server.</p>
<p>The problem is that once online, the server can&#8217;t be access from within the network. That is, you cannot access the public IP from behind the NVG501. If you try to access it from anywhere else it will work, but not from behind the modem/router. It turns out the NVG501 doesn&#8217;t support NAT loopback, so you cannot access your own public IP. You can access the server from any device in the network via the private IP, but not via the public one.</p>
<p>Why is this a problem? Suppose you associate a domain name with your public IP. When you try to access that domain from within your network you will be unable to do that. In my case I was trying to make a wordpress site available to the whole world. This presented a problem because the site was set up using localhost/site/ as it&#8217;s URL, so somewhere in the wp database, that domain was set as the domain of the site. You cannot have two domain names on the same site, so the only option is to change the database value. This is easy. The problem comes when you want to continue working on the site.</p>
<p>Since the NVG510 does not support NAT loopback, you cannot access the site. If you cannot access the site, then you cannot work.</p>
<p>If you were hopping to find a solution to this problem on this post, sorry to disappoint you, but the only one I have for you is: buy a new, better router that supports NAT loopback. You might be able to get another one from your ISP, just give them a call and see if they are kind enough.</p>
<p>I was foolish enough to think there could be a way around this problem, so I started playing around with the settings. Most of what I did was just change settings here and there. I really know nothing about most of what I did, but I&#8217;m never afraid of fooling around with settings.</p>
<p>At some point I got the stupid idea of changing the settings for the public subnet. At around 3 am I decided to go to sleep. As far as I remember, the Internet connection was still working, but today when I woke up, it wasn&#8217;t. At some point it stopped working and I had no idea why.</p>
<p>I was able to connect to the NVG510, but there was no Internet service, although the status page said there was no problem with it. I went to check the settings that I had fooled around with last night. At first it asked me for the device password, which I input and got back an error. I verified the password, input it again, and got another error. This happened about 5 times. I decided to reset the device.</p>
<p>After restarting, I was able to input the password and get to the restricted parts of the device&#8217;s admin interface. The settings for the public subnet were all there, so I guessed that was the problem, and I decided to set them back as they initially where. When I tried to save the settings, the modem would just not respond. It was &#8220;loading&#8221;, and it would not submit the settings.</p>
<p>After much trying, I decided to reset the device again. This time I held the reset button for 10 seconds to make sure it would reset it&#8217;s settings. After this I was able to connect to the modem and the Internet service was once again working.</p>
<p>A few things worth noting: When I reset the device for the last time, the SSID has been reset to it&#8217;s original name, rather than the name I&#8217;d given it, so trying to connect to the usual network would not work. After some time the pc figured that out and connected to the original network on the device. Fortunatelly, the computer remembers all the networks it connects to, when one is not available, it tries the next one if in range. So the computer tried until it finally connected to the original network from when I first set the modem up. Also, in the public subnet, the option that says Primary DHCP Pool would remain marked as public. I think this was the reason for the problem.</p>
<p>My thoughts are that since the Primary DHCP Pool was set as public, the device tried to assigned the computer and other devices attached to it (the modem), a public ip from the range specified. This would prevent the router from properly redirecting traffic to the right device. This is just a guess, since I currently have really no idea what happened in reality.</p>
<p>If, unlike me, you do know something about this things, it would be nice if you could explain more about what you think happened.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/imbuzu.wordpress.com/881/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/imbuzu.wordpress.com/881/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/imbuzu.wordpress.com/881/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/imbuzu.wordpress.com/881/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/imbuzu.wordpress.com/881/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/imbuzu.wordpress.com/881/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/imbuzu.wordpress.com/881/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/imbuzu.wordpress.com/881/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/imbuzu.wordpress.com/881/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/imbuzu.wordpress.com/881/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/imbuzu.wordpress.com/881/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/imbuzu.wordpress.com/881/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/imbuzu.wordpress.com/881/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/imbuzu.wordpress.com/881/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=imbuzu.wordpress.com&amp;blog=3363389&amp;post=881&amp;subd=imbuzu&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://imbuzu.wordpress.com/2011/12/28/having-problems-with-wifi/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/bb890f96dd8321ac00db3c38e176495b?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">buzu</media:title>
		</media:content>
	</item>
	</channel>
</rss>
