<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/atom10full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><feed xmlns="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearch/1.1/" xmlns:georss="http://www.georss.org/georss" xmlns:gd="http://schemas.google.com/g/2005" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" gd:etag="W/&quot;DEACRXY9fyp7ImA9WxBSE0U.&quot;"><id>tag:blogger.com,1999:blog-4529774779208095174</id><updated>2009-12-21T02:12:44.867-07:00</updated><title>Rha7DotCom</title><subtitle type="html">This website is about me and my work, since I use linux in my desktop, and work maintaining linux servers with apache, asterisk, squid and samba, I will post pretty much about this topics, additionally I am a web developer, lately working with Ruby on Rails, so here you will see a lot of work on this topic too. Thinking about it, I think you will be seeing much more material about Ruby and Ruby On Rails than anything else.

So now you know what this is about, I hope you like it.</subtitle><link rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml" href="http://rha7dotcom.blogspot.com/feeds/posts/default" /><link rel="alternate" type="text/html" href="http://rha7dotcom.blogspot.com/" /><link rel="hub" href="http://pubsubhubbub.appspot.com/" /><link rel="next" type="application/atom+xml" href="http://www.blogger.com/feeds/4529774779208095174/posts/default?start-index=26&amp;max-results=25&amp;redirect=false&amp;v=2" /><author><name>Rha7DotCom</name><uri>http://www.blogger.com/profile/03301281966644888259</uri><email>rha7.com@gmail.com</email></author><generator version="7.00" uri="http://www.blogger.com">Blogger</generator><openSearch:totalResults>29</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/atom+xml" href="http://feeds.feedburner.com/Rha7dotcom" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com" /><entry gd:etag="W/&quot;CEUESXs6eSp7ImA9WxBTE08.&quot;"><id>tag:blogger.com,1999:blog-4529774779208095174.post-7194641771635728480</id><published>2009-12-08T18:28:00.001-07:00</published><updated>2009-12-08T18:30:08.511-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-12-08T18:30:08.511-07:00</app:edited><title>Firefox, the Web browser that changed the way we use the internet</title><content type="html">&lt;h1&gt;Firefox, the Web browser that changed the way we use the internet.&lt;/h1&gt;

&lt;h4&gt;Trend Setting Events&lt;/h4&gt;

&lt;p&gt;There have been actually several times I've seen new things arriving to the IT scene,
sometimes I recognize them as a trend-setting event, sometimes I don't (like facebook).&lt;/p&gt;

&lt;p&gt;Firefox was one of those things that were easy to spot, as always when installing some new
program, and knowing it was a mozilla-based browser, my expectations were .. well, low.&lt;/p&gt;

&lt;p&gt;Then I saw the light... extensions, that was it... I immediately realized the power that
this new browser had, and the sort of things that could be done by community improvement.&lt;/p&gt;

&lt;p&gt;5 years later, it's all there, you can do everything, anything and more with it.&lt;/p&gt;

&lt;p&gt;It set a trend and changed the way we use the Internet, today.&lt;/p&gt;

&lt;p&gt;Firefox reached it's five years birthday.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Happy Birthday Firefox!&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&amp;nbsp;&lt;/p&gt;

&lt;object width="560" height="340"&gt;&lt;param name="movie" value="http://www.youtube.com/v/-ULDH90H530&amp;hl=en_US&amp;fs=1&amp;"&gt;&lt;/param&gt;&lt;param name="allowFullScreen" value="true"&gt;&lt;/param&gt;&lt;param name="allowscriptaccess" value="always"&gt;&lt;/param&gt;&lt;embed src="http://www.youtube.com/v/-ULDH90H530&amp;hl=en_US&amp;fs=1&amp;" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="560" height="340"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;div class="blogger-post-footer"&gt;&lt;a href='http://rha7dotcom.blogspot.com/'&gt;Rha7dotCom Blog&lt;/a&gt;
Gabriel Medina&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4529774779208095174-7194641771635728480?l=rha7dotcom.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel="related" href="http://www.firefox.com/" title="Firefox, the Web browser that changed the way we use the internet" /><link rel="replies" type="application/atom+xml" href="http://rha7dotcom.blogspot.com/feeds/7194641771635728480/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=4529774779208095174&amp;postID=7194641771635728480" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/4529774779208095174/posts/default/7194641771635728480?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/4529774779208095174/posts/default/7194641771635728480?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Rha7dotcom/~3/EeoU_1p4DjE/firefox-web-browser-that-changed-way-we.html" title="Firefox, the Web browser that changed the way we use the internet" /><author><name>Rha7DotCom</name><uri>http://www.blogger.com/profile/03301281966644888259</uri><email>rha7.com@gmail.com</email><gd:extendedProperty name="OpenSocialUserId" value="15457348978367955982" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://rha7dotcom.blogspot.com/2009/12/firefox-web-browser-that-changed-way-we.html</feedburner:origLink></entry><entry gd:etag="W/&quot;AkUCSX8_eip7ImA9WxNQEE0.&quot;"><id>tag:blogger.com,1999:blog-4529774779208095174.post-228111456638861272</id><published>2009-09-15T03:43:00.002-06:00</published><updated>2009-09-15T03:51:08.142-06:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-09-15T03:51:08.142-06:00</app:edited><title>Ruby on Rails, Shoulda, RSpec and The Damned AutoTest ...</title><content type="html">&lt;h1&gt;Ruby on Rails, Shoulda, RSpec and The Damned AutoTest ... And blankly staring idiots.&lt;/h1&gt;

&lt;h4&gt;New Project ... &lt;/h4&gt;
&lt;p&gt;Once again, i got to the point where i'm starting a new project and setting up all the de-facto gems and plugins and generators and stuff... among them... yeah... rspec+shoulda+autotest ....&lt;/p&gt;

&lt;h4&gt;config.gems&lt;/h4&gt;
&lt;p&gt;Having nicely setup haml --rails ., and script/generate rspec, I type at the prompt "autotest", and there I stare stupidly blankly waiting for something to happen, and then it hits me... Oh damn! I have to add that environment variable for autotest to work with rspec, but, what the hell was it? was it "RAILS=true autotest"?, or was it "SPEC=true autotest"....?&lt;/p&gt;

&lt;h4&gt;RSPEC=true autotest&lt;/h4&gt;
&lt;p&gt;As always this post is just a self reminder and an ode to my ever-repeating never-DRY mind:&lt;/p&gt;
&lt;p&gt;RSPEC=true autotest&lt;/p&gt;

&lt;h4&gt;There it is.&lt;/h4&gt;
&lt;p&gt;Thanks for reading.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;a href='http://rha7dotcom.blogspot.com/'&gt;Rha7dotCom Blog&lt;/a&gt;
Gabriel Medina&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4529774779208095174-228111456638861272?l=rha7dotcom.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://rha7dotcom.blogspot.com/feeds/228111456638861272/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=4529774779208095174&amp;postID=228111456638861272" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/4529774779208095174/posts/default/228111456638861272?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/4529774779208095174/posts/default/228111456638861272?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Rha7dotcom/~3/m2ns7p4g-1I/ruby-on-rails-shoulda-rspec-and-damned.html" title="Ruby on Rails, Shoulda, RSpec and The Damned AutoTest ..." /><author><name>Rha7DotCom</name><uri>http://www.blogger.com/profile/03301281966644888259</uri><email>rha7.com@gmail.com</email><gd:extendedProperty name="OpenSocialUserId" value="15457348978367955982" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://rha7dotcom.blogspot.com/2009/09/ruby-on-rails-shoulda-rspec-and-damned.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DUcBQH47fCp7ImA9WxNRFU8.&quot;"><id>tag:blogger.com,1999:blog-4529774779208095174.post-3019146671954492011</id><published>2009-09-09T03:21:00.006-06:00</published><updated>2009-09-09T14:10:51.004-06:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-09-09T14:10:51.004-06:00</app:edited><title>Make GMail Navigation Pane Wider</title><content type="html">&lt;h1&gt;Make GMail Navigation Pane Wider&lt;/h1&gt;

&lt;h4&gt;Love GMail&lt;/h4&gt;

&lt;p&gt;The only damned thing I hate is the too narrow navigation pane they chose to give us.&lt;/p&gt;
&lt;p&gt;Since in that left pane I have the calendar, google docs, and other stuff, and I as a lot of other people, have a Widescreen monitor in my laptop and at home, it's a waste of space.&lt;/p&gt;

&lt;h4&gt;GreaseMonkey&lt;/h4&gt;
&lt;p&gt;This is a &lt;a href='http://greasespot.net/'&gt;GreaseMonkey Firefox Extension (which you have to install first)&lt;/a&gt; user script, to make that possible, it adds 180 pixels of screen real estate to the left column, while correctly resizing the view pane.&lt;/p&gt;

&lt;h4&gt;The User Script&lt;/h4&gt;
&lt;p&gt;You can &lt;a href='http://dl.getdropbox.com/u/1109388/gmail_navigation_pane_wi.user.js'&gt;download the script from http://dl.getdropbox.com/u/1109388/gmail_navigation_pane_wi.user.js&lt;/a&gt;.&lt;/p&gt;


&lt;h4&gt;The Code&lt;/h4&gt;
&lt;p&gt;As always, below is a pastie of the code, if you wanna check it out.&lt;/p&gt;
&lt;script src='http://pastie.org/611520.js'&gt;&lt;/script&gt;&lt;div class="blogger-post-footer"&gt;&lt;a href='http://rha7dotcom.blogspot.com/'&gt;Rha7dotCom Blog&lt;/a&gt;
Gabriel Medina&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4529774779208095174-3019146671954492011?l=rha7dotcom.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel="related" href="http://dl.getdropbox.com/u/1109388/gmail_navigation_pane_wi.user.js" title="Make GMail Navigation Pane Wider" /><link rel="replies" type="application/atom+xml" href="http://rha7dotcom.blogspot.com/feeds/3019146671954492011/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=4529774779208095174&amp;postID=3019146671954492011" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/4529774779208095174/posts/default/3019146671954492011?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/4529774779208095174/posts/default/3019146671954492011?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Rha7dotcom/~3/Q6e80dsa7oA/make-gmail-navigation-pane-wider.html" title="Make GMail Navigation Pane Wider" /><author><name>Rha7DotCom</name><uri>http://www.blogger.com/profile/03301281966644888259</uri><email>rha7.com@gmail.com</email><gd:extendedProperty name="OpenSocialUserId" value="15457348978367955982" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://rha7dotcom.blogspot.com/2009/09/make-gmail-navigation-pane-wider.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CEUBRH44fSp7ImA9WxJUEkg.&quot;"><id>tag:blogger.com,1999:blog-4529774779208095174.post-1337853596814778873</id><published>2009-07-10T12:45:00.004-06:00</published><updated>2009-07-10T12:57:35.035-06:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-07-10T12:57:35.035-06:00</app:edited><title>Enable SQUID Rules Debug</title><content type="html">&lt;h1&gt;Enable SQUID Rules Debug&lt;/h1&gt;
&lt;h4&gt;Nightmare&lt;/h4&gt;
&lt;p&gt;Have you ever tried to debug SQUID rules? It's a real PITA. This post, which is as usual a self-reminder, shows you how to enable SQUID rules debug by showing the last rule processed in your cache.log.&lt;/p&gt;

&lt;h4&gt;The Configuration Line(s)&lt;/h4&gt;
&lt;p&gt;There are two lines, one that will show you debug information and the second one, which will be more verbose, I haven't needed the second one, it just helped me get even more confused with all the extra log text.&lt;/p&gt;

&lt;script src='http://pastie.org/541710.js'&gt;&lt;/script&gt;

&lt;p&gt;Just add one of the two above lines, at the top of your squid.conf file, reload squid, et voilá, you'll see clearly what's going on at the acl's level in your squid processing.&lt;/p&gt;

&lt;h4&gt;Thanks!&lt;/h4&gt;
&lt;p&gt;Thanks for reading&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;a href='http://rha7dotcom.blogspot.com/'&gt;Rha7dotCom Blog&lt;/a&gt;
Gabriel Medina&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4529774779208095174-1337853596814778873?l=rha7dotcom.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel="related" href="http://wiki.squid-cache.org/SquidFaq/SquidAcl" title="Enable SQUID Rules Debug" /><link rel="replies" type="application/atom+xml" href="http://rha7dotcom.blogspot.com/feeds/1337853596814778873/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=4529774779208095174&amp;postID=1337853596814778873" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/4529774779208095174/posts/default/1337853596814778873?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/4529774779208095174/posts/default/1337853596814778873?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Rha7dotcom/~3/W_K1ECaB7Pg/enable-squid-rules-debug.html" title="Enable SQUID Rules Debug" /><author><name>Rha7DotCom</name><uri>http://www.blogger.com/profile/03301281966644888259</uri><email>rha7.com@gmail.com</email><gd:extendedProperty name="OpenSocialUserId" value="15457348978367955982" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://rha7dotcom.blogspot.com/2009/07/enable-squid-rules-debug.html</feedburner:origLink></entry><entry gd:etag="W/&quot;D0QDRH04eSp7ImA9WxJWE0s.&quot;"><id>tag:blogger.com,1999:blog-4529774779208095174.post-492593266957244434</id><published>2009-06-09T01:16:00.003-06:00</published><updated>2009-06-18T16:49:35.331-06:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-06-18T16:49:35.331-06:00</app:edited><title>SubDivX - Spanish Subtitles Downloader for Movies and TV Series</title><content type="html">&lt;h1&gt;SubDivX - Spanish Subtitles Downloader for Movies and TV Series&lt;/h1&gt;

&lt;h4&gt;What Is It?&lt;/h4&gt;
&lt;p&gt;
  A simple GUI program to search and download spanish subtitles for movies and tv series downloaded from usenet and torrents, very simple, ruby Gtk+, specifically programmed in/for Ubuntu, but should work on any Linux distro with GNOME and Ruby support.
&lt;/p&gt;

&lt;h4&gt;How to get it&lt;/h4&gt;
&lt;p&gt;Just clone/download and copy it to your /usr/bin or /usr/local/bin, or your appropriate directory, and run it.&lt;/p&gt;

&lt;h4&gt;Thanks&lt;/h4&gt;
&lt;p&gt;As always thanks for reading and if you have any questions, go ahead and ask them in the comments.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Rha7 - Gabriel Medina&lt;/strong&gt;&lt;/p&gt;

&lt;h4&gt;UPDATE:&lt;/h4&gt;
&lt;p&gt;Since the project started as a command line utility, I've made a lot of changes, among them the switch to python to make the project easier to install and deploy (I like to use ruby from source, and packaging the project in ruby got somewhat messed up).&lt;/p&gt;

&lt;p&gt;So, this project is now made in PYTHON., that be told, go get it at &lt;a href="http://github.com/rha7dotcom/subdivx/tree/master"&gt;GitHub Rha7dotCom SubDivX Git Repository&lt;/a&gt;, in the Downloads section you can find a *.deb file you can use to install it in Ubuntu. Thanks for reading!
&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;a href='http://rha7dotcom.blogspot.com/'&gt;Rha7dotCom Blog&lt;/a&gt;
Gabriel Medina&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4529774779208095174-492593266957244434?l=rha7dotcom.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel="related" href="http://github.com/rha7dotcom/subdivx/tree/master" title="SubDivX - Spanish Subtitles Downloader for Movies and TV Series" /><link rel="replies" type="application/atom+xml" href="http://rha7dotcom.blogspot.com/feeds/492593266957244434/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=4529774779208095174&amp;postID=492593266957244434" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/4529774779208095174/posts/default/492593266957244434?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/4529774779208095174/posts/default/492593266957244434?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Rha7dotcom/~3/Z1SIgGc4XxA/subdivx-spanish-subtitles-downloader.html" title="SubDivX - Spanish Subtitles Downloader for Movies and TV Series" /><author><name>Rha7DotCom</name><uri>http://www.blogger.com/profile/03301281966644888259</uri><email>rha7.com@gmail.com</email><gd:extendedProperty name="OpenSocialUserId" value="15457348978367955982" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://rha7dotcom.blogspot.com/2009/06/subdivx-spanish-subtitles-downloader.html</feedburner:origLink></entry><entry gd:etag="W/&quot;A0IESHo9cSp7ImA9WxJXEUk.&quot;"><id>tag:blogger.com,1999:blog-4529774779208095174.post-2797413210882297177</id><published>2009-06-04T14:47:00.006-06:00</published><updated>2009-06-04T15:05:09.469-06:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-06-04T15:05:09.469-06:00</app:edited><title>How to write a simple C++ Project using Autotools - FREE Download</title><content type="html">&lt;h1&gt;How to write a simple C++ Project using Autotools&lt;/h1&gt;

&lt;h4&gt;My first hit at writing&lt;/h4&gt;

&lt;p&gt;This little booklet is more of an experiment than a real book, although some people might find it useful, it describes the use of the autotools tools, like aclocal, autoconf and automake, in a very hands-on way, by making a simple directory listing (like a simple ls command) application.&lt;/p&gt;

&lt;h4&gt;It is not pretty.&lt;/h4&gt;
&lt;p&gt;It wasn't supposed to be. I had known about &lt;a href='http://www.lulu.com/content/paperback-book/how-to-make-a-c%2b%2b-project-the-gnu-style-with-autotools/7222510'&gt;Lulu.com&lt;/a&gt; for a while, and I was learning Lyx/Latex at the time, and it just came naturally, I tried writing something a little more complicated, and thus, this booklet was born.&lt;/p&gt;

&lt;h4&gt;Is it useful?&lt;/h4&gt;
&lt;p&gt;Yeah, it is. Just because it is an experiment, doesn't mean it delivers what it is supopsed to deliver, if you ever wanted to write a C++ and make a source package like the big boys, but never knew where that ./configure script came from, or what the make &amp;&amp; sudo make install, was doing, this booklet will give you a head start.&lt;/p&gt;

&lt;h4&gt;Then why are you selling it?&lt;/h4&gt;
&lt;p&gt;I am not. &lt;a href='http://stores.lulu.com/store.php?fStoreID=2397147'&gt;YOU CAN DOWNLOAD IT FOR FREE&lt;/a&gt;, at the linked Lulu.com page. I also wanted to learn about how &lt;a href='http://www.lulu.com/content/paperback-book/how-to-make-a-c%2b%2b-project-the-gnu-style-with-autotools/7222510'&gt;Lulu.com&lt;/a&gt; works and actually the download version is free, the print version, is a bit over $4 bucks, but thats just &lt;a href='http://www.lulu.com/content/paperback-book/how-to-make-a-c%2b%2b-project-the-gnu-style-with-autotools/7222510'&gt;Lulu.com&lt;/a&gt;'s expenses. I take nothing. So, just go ahead and get it while it's hot, and if you can leave me a comment.&lt;/p&gt;

&lt;h4&gt;Thanks&lt;/h4&gt;
&lt;p&gt;As always, thanks for reading.&lt;/p&gt;

&lt;p style='text-justify:center;'&gt;
&lt;a href="http://stores.lulu.com/store.php?fStoreID=2397147"&gt;&lt;img src="http://1.bp.blogspot.com/_gswK3oaYqd0/Sig1sFe6_2I/AAAAAAAAADw/EoqX0XgTz40/s320/screenshot_006.png" border="0" alt="How To Make A C++ Project The GNU Style With Autotools" /&gt;&lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;a href='http://stores.lulu.com/store.php?fStoreID=2397147'&gt;How To Make A C++ Project The GNU Style With Autotools&lt;/a&gt;
&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;a href='http://rha7dotcom.blogspot.com/'&gt;Rha7dotCom Blog&lt;/a&gt;
Gabriel Medina&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4529774779208095174-2797413210882297177?l=rha7dotcom.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel="related" href="http://stores.lulu.com/store.php?fStoreID=2397147" title="How to write a simple C++ Project using Autotools - FREE Download" /><link rel="replies" type="application/atom+xml" href="http://rha7dotcom.blogspot.com/feeds/2797413210882297177/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=4529774779208095174&amp;postID=2797413210882297177" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/4529774779208095174/posts/default/2797413210882297177?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/4529774779208095174/posts/default/2797413210882297177?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Rha7dotcom/~3/PGman5bnQUI/how-to-write-simple-c-project-using.html" title="How to write a simple C++ Project using Autotools - FREE Download" /><author><name>Rha7DotCom</name><uri>http://www.blogger.com/profile/03301281966644888259</uri><email>rha7.com@gmail.com</email><gd:extendedProperty name="OpenSocialUserId" value="15457348978367955982" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://1.bp.blogspot.com/_gswK3oaYqd0/Sig1sFe6_2I/AAAAAAAAADw/EoqX0XgTz40/s72-c/screenshot_006.png" height="72" width="72" /><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://rha7dotcom.blogspot.com/2009/06/how-to-write-simple-c-project-using.html</feedburner:origLink></entry><entry gd:etag="W/&quot;Ck4FRHg8eCp7ImA9WxJXEU0.&quot;"><id>tag:blogger.com,1999:blog-4529774779208095174.post-7227108163008201875</id><published>2009-06-04T01:28:00.002-06:00</published><updated>2009-06-04T01:35:15.670-06:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-06-04T01:35:15.670-06:00</app:edited><title>RhegExp, Ruby Regular Expression Tester</title><content type="html">&lt;h1&gt;RhegExp, Ruby Regular Expression Tester&lt;/h1&gt;

&lt;h4&gt;What is it?&lt;/h4&gt;
&lt;p&gt;Have you ever been at &lt;a href="http://www.rubular.com/"&gt;Rubular&lt;/a&gt;?, I love it. Just that there have been some times I have been --oh god-- off-line. No internet, at all, almost 24 hours. I remember that day the water pipe broke, well, this was almost like that time. This project is just that. Only, off-line. It's a classic desktop tiny-app to quickly test ruby regular expressions ala-rubular.&lt;/p&gt;

&lt;h4&gt;You need ...&lt;/h4&gt;

&lt;p&gt;You'll need to have ruby-gnome2, you can get it with apt-get or aptitude, but if you compiled ruby from source, you'll need this : &lt;a href="http://rha7dotcom.blogspot.com/2009/06/how-to-install-ruby-gnome2-from-source.html"&gt;How to install Ruby-GNOME2 from Source in Ubuntu Jaunty Jackalope 9.04&lt;/a&gt;.&lt;/p&gt;

&lt;h4&gt;Get it&lt;/h4&gt;
&lt;p&gt;The project is, where else?, at GitHub, go clone it.
&lt;p&gt;&lt;a href="http://github.com/rha7dotcom/rhegexp/tree/master"&gt;RhegExp at GitHub.com&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;Thanks&lt;/h4&gt;
&lt;p&gt;As always, thanks for reading.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;a href='http://rha7dotcom.blogspot.com/'&gt;Rha7dotCom Blog&lt;/a&gt;
Gabriel Medina&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4529774779208095174-7227108163008201875?l=rha7dotcom.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel="related" href="http://github.com/rha7dotcom/rhegexp/tree/master" title="RhegExp, Ruby Regular Expression Tester" /><link rel="replies" type="application/atom+xml" href="http://rha7dotcom.blogspot.com/feeds/7227108163008201875/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=4529774779208095174&amp;postID=7227108163008201875" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/4529774779208095174/posts/default/7227108163008201875?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/4529774779208095174/posts/default/7227108163008201875?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Rha7dotcom/~3/y7RxjWWGv2c/rhegexp-ruby-regular-expression-tester.html" title="RhegExp, Ruby Regular Expression Tester" /><author><name>Rha7DotCom</name><uri>http://www.blogger.com/profile/03301281966644888259</uri><email>rha7.com@gmail.com</email><gd:extendedProperty name="OpenSocialUserId" value="15457348978367955982" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://rha7dotcom.blogspot.com/2009/06/rhegexp-ruby-regular-expression-tester.html</feedburner:origLink></entry><entry gd:etag="W/&quot;A0ICSX48eyp7ImA9WxJXEEQ.&quot;"><id>tag:blogger.com,1999:blog-4529774779208095174.post-1945796205572834723</id><published>2009-06-04T01:07:00.002-06:00</published><updated>2009-06-04T01:12:48.073-06:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-06-04T01:12:48.073-06:00</app:edited><title>How to install Ruby-GNOME2  from Source in Ubuntu Jaunty Jackalope 9.04</title><content type="html">&lt;h1&gt;Install Ubuntu Packages&lt;/h1&gt;

&lt;h4&gt;The Story ...&lt;/h4&gt;
&lt;p&gt;I had quite some trouble compiling Ruby-GNOME2 0.19.0, and although I'm not all that dumb, I spent just too much time compiling it, then I spent actually programming the tiny little project I was developing.&lt;/p&gt;
&lt;p&gt;So, I just went down a notch, and compiled Ruby-GNOME2 0.18.1, which for my really humble needs, was more than enough.&lt;/p&gt;
&lt;p&gt;Although this was a bit easier, for several reasons, I use ruby compiled from source, and so, couldn't/didn't want to, use pre-compiled binaries. This is a log of everything I did to compile it and make it work in Ubuntu Jaunty Jackalope 9.04, along with a patch file I had to make to get it to compile.&lt;/p&gt;

&lt;h4&gt;The "How-To"&lt;/h4&gt;
&lt;script src="http://pastie.org/500085.js"&gt;&lt;/script&gt;

&lt;h4&gt;The "Patch"&lt;/h4&gt;
&lt;script src="http://pastie.org/500086.js"&gt;&lt;/script&gt;

&lt;h4&gt;Thanks&lt;/h4&gt;
&lt;p&gt;Thanks for reading, and if anyone follows me out there, sorry for not being much active lately, but I'm just too busy, and when not busy, I'm just too lazy.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;a href='http://rha7dotcom.blogspot.com/'&gt;Rha7dotCom Blog&lt;/a&gt;
Gabriel Medina&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4529774779208095174-1945796205572834723?l=rha7dotcom.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://rha7dotcom.blogspot.com/feeds/1945796205572834723/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=4529774779208095174&amp;postID=1945796205572834723" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/4529774779208095174/posts/default/1945796205572834723?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/4529774779208095174/posts/default/1945796205572834723?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Rha7dotcom/~3/vOZ6II5f6q0/how-to-install-ruby-gnome2-from-source.html" title="How to install Ruby-GNOME2  from Source in Ubuntu Jaunty Jackalope 9.04" /><author><name>Rha7DotCom</name><uri>http://www.blogger.com/profile/03301281966644888259</uri><email>rha7.com@gmail.com</email><gd:extendedProperty name="OpenSocialUserId" value="15457348978367955982" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://rha7dotcom.blogspot.com/2009/06/how-to-install-ruby-gnome2-from-source.html</feedburner:origLink></entry><entry gd:etag="W/&quot;C0EHQXg-eCp7ImA9WxVaGEo.&quot;"><id>tag:blogger.com,1999:blog-4529774779208095174.post-1075719477252856995</id><published>2009-04-16T02:36:00.007-06:00</published><updated>2009-04-16T02:47:10.650-06:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-04-16T02:47:10.650-06:00</app:edited><title>How to Crop a Video using ffmpeg</title><content type="html">As usual, this post is just a self reminder, this time about how to crop a video top and bottom 'black bars' and leave it in a 16:9 format, ready for mythtv ;)&lt;br /&gt;&lt;br /&gt;



&lt;span style="font-weight: bold;font-family:courier new;font-size:130%;"  &gt;ffmpeg -i In_Movie.avi -croptop 74 -cropbottom 74 -sameq -aspect 16:9 -y Out_Movie.avi&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;



&lt;span style="font-weight: bold;font-family:courier new;font-size:130%;"  &gt;-i In_Movie.avi&lt;/span&gt;&lt;span style="font-size:130%;"&gt;
&lt;/span&gt;&lt;br /&gt;
Sets the input file&lt;br /&gt;&lt;br /&gt;



&lt;span style="font-weight: bold;font-family:courier new;font-size:130%;"  &gt;-croptop&lt;/span&gt;&lt;span style="font-size:130%;"&gt;
&lt;/span&gt;&lt;br /&gt;
Sets the top cropping size in pixels, this value must be a multiple of 2&lt;br /&gt;&lt;br /&gt;



&lt;span style="font-weight: bold;font-family:courier new;font-size:130%;"  &gt;-cropbottom&lt;/span&gt;&lt;span style="font-size:130%;"&gt;
&lt;/span&gt;&lt;br /&gt;
Sets the bottom cropping size in pixels, this value must be a multiple of 2&lt;br /&gt;&lt;br /&gt;



&lt;span style="font-weight: bold;font-family:courier new;font-size:130%;"  &gt;-sameq&lt;/span&gt;&lt;span style="font-size:130%;"&gt;
&lt;/span&gt;&lt;br /&gt;
Keeps the video's quality as original&lt;br /&gt;&lt;br /&gt;



&lt;span style="font-weight: bold;font-family:courier new;font-size:130%;"  &gt;-aspect 16:9&lt;/span&gt;&lt;span style="font-size:130%;"&gt;
&lt;/span&gt;&lt;br /&gt;
Sets the output format to 16:9, widescreen, use 4:3 if your video is letterbox.&lt;br /&gt;&lt;br /&gt;



&lt;span style="font-weight: bold;font-family:courier new;font-size:130%;"  &gt;-y&lt;/span&gt;&lt;span style="font-size:130%;"&gt;
&lt;/span&gt;&lt;br /&gt;
Makes ffmpeg stop complaining about overwriting the output file (be careful)&lt;br /&gt;&lt;br /&gt;



&lt;span style="font-weight: bold;font-family:courier new;font-size:130%;"  &gt;Out_Movie.avi&lt;/span&gt;&lt;span style="font-size:130%;"&gt;
&lt;/span&gt;&lt;br /&gt;
The output file, which will be a cropped version of the In_Movie.avi&lt;br /&gt;&lt;br /&gt;



Hope this is useful for someone out there.&lt;br /&gt;&lt;br /&gt;



Greetings,&lt;br /&gt;&lt;br /&gt;



Gabriel.&lt;br /&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;a href='http://rha7dotcom.blogspot.com/'&gt;Rha7dotCom Blog&lt;/a&gt;
Gabriel Medina&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4529774779208095174-1075719477252856995?l=rha7dotcom.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://rha7dotcom.blogspot.com/feeds/1075719477252856995/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=4529774779208095174&amp;postID=1075719477252856995" title="2 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/4529774779208095174/posts/default/1075719477252856995?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/4529774779208095174/posts/default/1075719477252856995?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Rha7dotcom/~3/hQ8ZcsLYefQ/how-to-crop-video-using-ffmpeg.html" title="How to Crop a Video using ffmpeg" /><author><name>Rha7DotCom</name><uri>http://www.blogger.com/profile/03301281966644888259</uri><email>rha7.com@gmail.com</email><gd:extendedProperty name="OpenSocialUserId" value="15457348978367955982" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">2</thr:total><feedburner:origLink>http://rha7dotcom.blogspot.com/2009/04/how-to-crop-video-using-ffmpeg.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CE4GQXs9fCp7ImA9WxVUGEg.&quot;"><id>tag:blogger.com,1999:blog-4529774779208095174.post-526302423103791193</id><published>2009-03-09T20:30:00.006-07:00</published><updated>2009-03-23T17:02:00.564-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-03-23T17:02:00.564-07:00</app:edited><title>Web App Theme Plugin And HAML</title><content type="html">&lt;h1&gt;Web App Theme Plugin And HAML&lt;/h1&gt;
&lt;p&gt;Quick post, I have been using the &lt;a href="http://github.com/pilu/web-app-theme/tree/master"&gt;Web App Theme plugin&lt;/a&gt; from github, and since I love &lt;a href="http://github.com/nex3/haml/tree/master"&gt;haml&lt;/a&gt;, I converted the default generated theme from erb to haml, also made a sample action's view so you can test it out, and see how it is composed.&lt;/p&gt;

&lt;p&gt;Hope this is useful for somebody out there.&lt;/p&gt;

&lt;a href="http://www.pastie.org/412446" target="_blank"&gt;Pastie is Here&lt;/a&gt;

&lt;script src='http://pastie.org/412446.js'&gt;&lt;/script&gt;&lt;div class="blogger-post-footer"&gt;&lt;a href='http://rha7dotcom.blogspot.com/'&gt;Rha7dotCom Blog&lt;/a&gt;
Gabriel Medina&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4529774779208095174-526302423103791193?l=rha7dotcom.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel="related" href="http://www.pastie.org/412446" title="Web App Theme Plugin And HAML" /><link rel="replies" type="application/atom+xml" href="http://rha7dotcom.blogspot.com/feeds/526302423103791193/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=4529774779208095174&amp;postID=526302423103791193" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/4529774779208095174/posts/default/526302423103791193?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/4529774779208095174/posts/default/526302423103791193?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Rha7dotcom/~3/v_wCkxrAeMY/web-app-theme-plugin-and-haml.html" title="Web App Theme Plugin And HAML" /><author><name>Rha7DotCom</name><uri>http://www.blogger.com/profile/03301281966644888259</uri><email>rha7.com@gmail.com</email><gd:extendedProperty name="OpenSocialUserId" value="15457348978367955982" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://rha7dotcom.blogspot.com/2009/03/web-app-theme-plugin-and-haml.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CU8DRHk4eyp7ImA9WxVVEE4.&quot;"><id>tag:blogger.com,1999:blog-4529774779208095174.post-5325211861802610421</id><published>2009-03-02T15:43:00.000-07:00</published><updated>2009-03-02T15:44:35.733-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-03-02T15:44:35.733-07:00</app:edited><title>Mexico States and Cities Listing in YAML format</title><content type="html">&lt;h1&gt;The Purpose&lt;/h1&gt;
&lt;p&gt;I usually find myself looking for the list of states and cities of Mexico, however, in almost every software available for use as open source, the mentiones list is not included, usually the only pre-loaded one is the &lt;span class="caps"&gt;USA&lt;/span&gt; listings of states and cities (very rarely but sometimes they include the cities).&lt;/p&gt;
&lt;h2&gt;The Source&lt;/h2&gt;
&lt;p&gt;At the &lt;acronym title="Servicio Postal Mexicano"&gt;&lt;span class="caps"&gt;SEPOMEX&lt;/span&gt;&lt;/acronym&gt; (Mexican Post Service, by it&amp;#8217;s spanish acronym), there is a web page &lt;a href="http://www.correosdemexico.gob.mx/servicios/paginas/descargacp.aspx"&gt;Descarga C&amp;oacute;digos Postales Mexicanos&lt;/a&gt; that allows you to download a full listing in several formats, including &lt;span class="caps"&gt;CSV&lt;/span&gt; and &lt;span class="caps"&gt;TXT&lt;/span&gt; (pipe &amp;#8216;|&amp;#8217; separated). Unfortunately &lt;span class="caps"&gt;CSV&lt;/span&gt; format is damaged (not properly formatted), but the &lt;span class="caps"&gt;TXT&lt;/span&gt; one is pristine. Fields 3 and 4 are the city and state respectively. The original file you download is in iso-8859-1 format, while the script works with utf-8, so it&amp;#8217;s probably wise to do something like this before (the file you download from &lt;span class="caps"&gt;SEPOMEX&lt;/span&gt; is named CPdescarga.txt):&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;code&gt;iconv -f iso-8859-1 -t utf-8 CPdescarga.txt &amp;gt; mexico.txt&lt;/code&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h2&gt;The Extractor&lt;/h2&gt;
&lt;p&gt;The extractor.rb file is a ruby script that takes this files you download from &lt;span class="caps"&gt;SEPOMEX&lt;/span&gt;, in &lt;span class="caps"&gt;TXT&lt;/span&gt; format, and parses and extracts a listing of mexican states and cities, over 2800 different cities and locations are extracted by the script. The output is to standard out, and in &lt;span class="caps"&gt;YAML&lt;/span&gt; format, so you can easily incorporate it in your own projects.&lt;/p&gt;
&lt;p&gt;The extractor.rb script expects to find the list of cities in the &lt;span class="caps"&gt;TXT&lt;/span&gt; format from &lt;span class="caps"&gt;SEPOMEX&lt;/span&gt;, but in utf-8 formatting. You don&amp;#8217;t pass any parameters to extractor, and probably will need to pipe the output to a yaml file:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;code&gt;./extractor.rb &amp;gt; mexico.yml&lt;/code&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Progress text is output to standard error, so it doesn&amp;#8217;t interfer with the yaml output.&lt;/p&gt;
&lt;h2&gt;Other Things in Project&lt;/h2&gt;
&lt;p&gt;The textilize.rb program is just a snippet converted to a command line utility to transform a .textile file to .html.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;a href='http://rha7dotcom.blogspot.com/'&gt;Rha7dotCom Blog&lt;/a&gt;
Gabriel Medina&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4529774779208095174-5325211861802610421?l=rha7dotcom.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel="related" href="http://github.com/rha7dotcom/ciudadesdemexico/tree/master" title="Mexico States and Cities Listing in YAML format" /><link rel="replies" type="application/atom+xml" href="http://rha7dotcom.blogspot.com/feeds/5325211861802610421/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=4529774779208095174&amp;postID=5325211861802610421" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/4529774779208095174/posts/default/5325211861802610421?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/4529774779208095174/posts/default/5325211861802610421?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Rha7dotcom/~3/bzXd-tMiKNQ/mexico-states-and-cities-listing-in.html" title="Mexico States and Cities Listing in YAML format" /><author><name>Rha7DotCom</name><uri>http://www.blogger.com/profile/03301281966644888259</uri><email>rha7.com@gmail.com</email><gd:extendedProperty name="OpenSocialUserId" value="15457348978367955982" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://rha7dotcom.blogspot.com/2009/03/mexico-states-and-cities-listing-in.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CEQCSHczeCp7ImA9WxVXFUs.&quot;"><id>tag:blogger.com,1999:blog-4529774779208095174.post-1998120149727252647</id><published>2009-02-13T14:53:00.005-07:00</published><updated>2009-02-13T14:59:29.980-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-02-13T14:59:29.980-07:00</app:edited><title>Happy 1234567890 Epoch Time</title><content type="html">&lt;h1&gt;Happy 1234567890 Epoch Time&lt;/h1&gt;

&lt;p&gt;Happy 1234567890 Epoch Time, today Friday 13th at 2009 23:31:30 UTC, that is within the next two hours.&lt;/p&gt;

&lt;p&gt;:)&lt;/p&gt;

&lt;h4&gt;Enjoy the epoch&lt;/h4&gt;

&lt;p&gt;&lt;a href="http://coolepochcountdown.com/"&gt;Cool Epoch Countdown&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://en.wikipedia.org/wiki/Unix_time"&gt;Wikipedia UNIX Time&lt;/a&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;a href='http://rha7dotcom.blogspot.com/'&gt;Rha7dotCom Blog&lt;/a&gt;
Gabriel Medina&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4529774779208095174-1998120149727252647?l=rha7dotcom.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel="related" href="http://coolepochcountdown.com/" title="Happy 1234567890 Epoch Time" /><link rel="replies" type="application/atom+xml" href="http://rha7dotcom.blogspot.com/feeds/1998120149727252647/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=4529774779208095174&amp;postID=1998120149727252647" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/4529774779208095174/posts/default/1998120149727252647?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/4529774779208095174/posts/default/1998120149727252647?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Rha7dotcom/~3/8RFG9pTnXj0/happy-1234567890-epoch-time.html" title="Happy 1234567890 Epoch Time" /><author><name>Rha7DotCom</name><uri>http://www.blogger.com/profile/03301281966644888259</uri><email>rha7.com@gmail.com</email><gd:extendedProperty name="OpenSocialUserId" value="15457348978367955982" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://rha7dotcom.blogspot.com/2009/02/happy-1234567890-epoch-time.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CkIMQX4_eip7ImA9WxRXE08.&quot;"><id>tag:blogger.com,1999:blog-4529774779208095174.post-5076441824317872857</id><published>2008-10-18T03:02:00.000-06:00</published><updated>2008-10-18T03:03:00.042-06:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-10-18T03:03:00.042-06:00</app:edited><title>Rails Tests, MySQL Tests and Collations</title><content type="html">&lt;h1&gt;Rails Tests, MySQL Tests and Collations&lt;/h1&gt;

&lt;p&gt;Today I was trying to checkout Rails code to fix a bug and contribute it to Rails using git. I &lt;strong&gt;git-clone&lt;/strong&gt;d the Rails code, and went on to &lt;strong&gt;rake test&lt;/strong&gt; it, I created the databases activerecord_unittest and activerecord_unittest2, granted permissions and went on to run the tests.&lt;/p&gt;

&lt;p&gt;One of the ActiveRecord tests failed, but this was expected, ran rake a second time (this time not expecting failures), but I was greeted with the following error:&lt;/p&gt;

&lt;pre name="code" class="ruby"&gt;
  1) Error:
test_validate_case_insensitive_uniqueness(ValidationsTest):
ActiveRecord::StatementInvalid: Mysql::Error: Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (utf8_general_c
i,COERCIBLE) for operation '=': SELECT `title` FROM `topics`     WHERE (LOWER(`topics`.title) = '? ???? ??????????!')
&lt;/pre&gt;

&lt;p&gt;This was in the ActiveRecord tests also, after a little check I noticed that actually, the databases were created with &lt;strong&gt;latin1_swedish_ci&lt;/strong&gt; collation.&lt;/p&gt;

&lt;p&gt;This is easy to correct, just go into your MySQL client, and do the following:&lt;/p&gt;

&lt;pre name="code" class="ruby"&gt;
mysql&gt; alter database activerecord_unittest character set utf8;
Query OK, 1 row affected (0.01 sec)

mysql&gt; alter database activerecord_unittest2 character set utf8;
Query OK, 1 row affected (0.00 sec)

mysql&gt; use activerecord_unittest;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed

mysql&gt; SHOW VARIABLES LIKE 'character_set_database';
+------------------------+-------+
| Variable_name          | Value |
+------------------------+-------+
| character_set_database | utf8  |
+------------------------+-------+
1 row in set (0.00 sec)

mysql&gt; use activerecord_unittest2;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed

mysql&gt; SHOW VARIABLES LIKE 'character_set_database';
+------------------------+-------+
| Variable_name          | Value |
+------------------------+-------+
| character_set_database | utf8  |
+------------------------+-------+
1 row in set (0.00 sec)
&lt;/pre&gt;

&lt;p&gt;Actually the last two commands are just to verify the change, you can just use the first two ones:&lt;/p&gt;

&lt;pre name="code" class="ruby"&gt;
alter database activerecord_unittest character set utf8;
alter database activerecord_unittest2 character set utf8;
&lt;/pre&gt;

&lt;p&gt;Et Voila! All tests pass now. As most of my posts, this is to keep as a self reminder, since I found no info on this error on the 'Net.&lt;/p&gt;

&lt;p&gt;Thanks for reading, and please comment!&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Gabriel Medina&lt;/strong&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;a href='http://rha7dotcom.blogspot.com/'&gt;Rha7dotCom Blog&lt;/a&gt;
Gabriel Medina&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4529774779208095174-5076441824317872857?l=rha7dotcom.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://rha7dotcom.blogspot.com/feeds/5076441824317872857/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=4529774779208095174&amp;postID=5076441824317872857" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/4529774779208095174/posts/default/5076441824317872857?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/4529774779208095174/posts/default/5076441824317872857?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Rha7dotcom/~3/5X6rUTzGwrw/rails-tests-mysql-tests-and-collations.html" title="Rails Tests, MySQL Tests and Collations" /><author><name>Rha7DotCom</name><uri>http://www.blogger.com/profile/03301281966644888259</uri><email>rha7.com@gmail.com</email><gd:extendedProperty name="OpenSocialUserId" value="15457348978367955982" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://rha7dotcom.blogspot.com/2008/10/rails-tests-mysql-tests-and-collations.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DkYER3Y7fSp7ImA9WxRXEUw.&quot;"><id>tag:blogger.com,1999:blog-4529774779208095174.post-5852174282027609993</id><published>2008-10-14T23:13:00.008-06:00</published><updated>2008-10-15T17:41:46.805-06:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-10-15T17:41:46.805-06:00</app:edited><title>Paypal Ruby Gem and custom/invoice methods errors</title><content type="html">&lt;h1&gt;Paypal Gem and custom/invoice methods missing+errors&lt;/h1&gt;

&lt;h4&gt;Errors in ruby/rails paypal gem&lt;/h4&gt;

&lt;p&gt;I noticed a little error in ruby paypal gem, there was no 'custom' method. Also, erroneously, the 'invoice' method returned the data from the custom field.&lt;/p&gt;

&lt;p&gt;I corrected this and pushed it to &lt;a href='http://github.com/rha7dotcom/paypal/tree/master' target='_blank'&gt;http://github.com/rha7dotcom/paypal/tree/master&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Already made a pull request from openhood, but in the mean time, it is available there.&lt;/p&gt;

&lt;p&gt;Added also the pending_reason, reason_code, memo, payment_type, exchange_rate 
methods to notification.&lt;/p&gt;

&lt;p&gt;Hope this is useful for you out there.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Gabriel Medina&lt;/strong&gt;&lt;/p&gt;

&lt;h4&gt;UPDATE&lt;/h4&gt;
&lt;p&gt;Changes have been integrated. You can get this changes now directly from:&lt;/p&gt;
&lt;p&gt;&lt;a href='http://github.com/openhood/paypal/tree/master'&gt;http://github.com/openhood/paypal/tree/master&lt;/a&gt;.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;a href='http://rha7dotcom.blogspot.com/'&gt;Rha7dotCom Blog&lt;/a&gt;
Gabriel Medina&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4529774779208095174-5852174282027609993?l=rha7dotcom.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel="related" href="http://dist.leetsoft.com/api/paypal/" title="Paypal Ruby Gem and custom/invoice methods errors" /><link rel="replies" type="application/atom+xml" href="http://rha7dotcom.blogspot.com/feeds/5852174282027609993/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=4529774779208095174&amp;postID=5852174282027609993" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/4529774779208095174/posts/default/5852174282027609993?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/4529774779208095174/posts/default/5852174282027609993?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Rha7dotcom/~3/_VLZ7mQcZaI/paypal-ruby-gem-and-custominvoice.html" title="Paypal Ruby Gem and custom/invoice methods errors" /><author><name>Rha7DotCom</name><uri>http://www.blogger.com/profile/03301281966644888259</uri><email>rha7.com@gmail.com</email><gd:extendedProperty name="OpenSocialUserId" value="15457348978367955982" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://rha7dotcom.blogspot.com/2008/10/paypal-ruby-gem-and-custominvoice.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CUAGQ3o-eCp7ImA9WxRQEU8.&quot;"><id>tag:blogger.com,1999:blog-4529774779208095174.post-7231077096643402024</id><published>2008-10-04T06:27:00.002-06:00</published><updated>2008-10-04T06:35:22.450-06:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-10-04T06:35:22.450-06:00</app:edited><title>RMagick2.so - shared object cannot be dlopen()ed</title><content type="html">&lt;h1&gt;RMagick2.so - shared object cannot be dlopen()ed&lt;/h1&gt;

&lt;h4&gt;More than a full how to it's just a self-reminder&lt;/h4&gt;
&lt;p&gt;I ran upon this problem today, I was trying to use ImageMagick(source)+RMagick(gem) and found an annoying error saying that &lt;strong&gt;shared object cannot be dlopen()ed&lt;/strong&gt; referring to &lt;strong&gt;RMagick2.so&lt;/strong&gt;.&lt;/p&gt;

&lt;h4&gt;Magick command line&lt;/h4&gt;
&lt;p&gt;Making story short, if you find this error in the recipe &lt;strong&gt;Ubuntu+ImageMagick from source+RMagick gem&lt;/strong&gt;, you reconfigure &lt;strong&gt;ImageMagick&lt;/strong&gt; with the following options:&lt;/p&gt;
&lt;pre name='code' class='ruby'&gt;
./configure --with-png=yes --with-jpeg=yes --disable-openmp --enable-shared
&lt;/pre&gt;

&lt;p&gt;After that, &lt;strong&gt;make &amp;&amp; make install&lt;/strong&gt; as usual, and then uninstall and reinstall RMagick gem. That's all.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;a href='http://rha7dotcom.blogspot.com/'&gt;Rha7dotCom Blog&lt;/a&gt;
Gabriel Medina&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4529774779208095174-7231077096643402024?l=rha7dotcom.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://rha7dotcom.blogspot.com/feeds/7231077096643402024/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=4529774779208095174&amp;postID=7231077096643402024" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/4529774779208095174/posts/default/7231077096643402024?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/4529774779208095174/posts/default/7231077096643402024?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Rha7dotcom/~3/exmko9TuMQU/rmagick2so-shared-object-cannot-be.html" title="RMagick2.so - shared object cannot be dlopen()ed" /><author><name>Rha7DotCom</name><uri>http://www.blogger.com/profile/03301281966644888259</uri><email>rha7.com@gmail.com</email><gd:extendedProperty name="OpenSocialUserId" value="15457348978367955982" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://rha7dotcom.blogspot.com/2008/10/rmagick2so-shared-object-cannot-be.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CEQHQHY7eSp7ImA9WxRRGUU.&quot;"><id>tag:blogger.com,1999:blog-4529774779208095174.post-4852238387475361697</id><published>2008-10-02T05:21:00.011-06:00</published><updated>2008-10-02T15:18:51.801-06:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-10-02T15:18:51.801-06:00</app:edited><title>SASS jEdit Syntax Highlighting Mode</title><content type="html">&lt;h1&gt;SASS jEdit Syntax Highlighting Mode&lt;/h1&gt;

&lt;h4&gt;Files&lt;/h4&gt;
&lt;p&gt;&lt;a href="http://ruby-on-rails-mexico.googlegroups.com/web/catalog"&gt;catalog&lt;/a&gt; - jEdit SAMPLE catalog file&lt;/p&gt;
&lt;p&gt;&lt;a href="http://ruby-on-rails-mexico.googlegroups.com/web/sass.xml"&gt;sass.xml&lt;/a&gt; - jEdit SASS mode file&lt;/p&gt;
&lt;p&gt;&lt;a href="http://ruby-on-rails-mexico.googlegroups.com/web/haml.xml"&gt;haml.xml&lt;/a&gt; - jEdit HAML mode file from &lt;a href="http://blog.wolfman.com/articles/2006/12/01/a-haml-edit-mode-for-jedit"&gt;Wolfmans Howlings&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;What is this?&lt;/h4&gt;
&lt;p&gt;This two files provide syntax highlighting for &lt;a href="http://haml.hamptoncatlin.com/"&gt;HAML/SASS&lt;/a&gt; in jEdit.&lt;/p&gt;

&lt;h4&gt;What for?&lt;/h4&gt;
&lt;p&gt;Well, jEdit happens to be my favorite RoR editor, and I stumbled upon &lt;a href="http://blog.wolfman.com/articles/2006/12/01/a-haml-edit-mode-for-jedit"&gt;Wolfman's Howlings Post&lt;/a&gt; about a HAML syntax highlighting mode for jEdit.&lt;/p&gt;
&lt;p&gt;This got me interested, and obviously googled to find a jEdit mode for SASS (CSS companion for HAML), but apparently there's none available, so I decided to write my own. This post is to share it with the world.

&lt;h4&gt;How to use it&lt;/h4&gt;
&lt;p&gt;Just drop the sass.xml file in your jEdit's mode directory (in Windows it's C:\Documents and Settings\YOUR USER NAME\.jEdit\modes, and in Linux it's ~/.jedit/modes), and modify your existing catalog file to include the &lt;MODE&gt; line from the provided catalog file.&lt;/p&gt;

&lt;h4&gt;Thanks and Bye&lt;/h4&gt;
&lt;p&gt;As always, I hope this is useful for you people out there.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Gabriel Medina&lt;/strong&gt;&lt;/p&gt;

&lt;h4&gt;UPDATE:&lt;/h4&gt;
&lt;p&gt;There is an &lt;a href="http://haml.googlegroups.com/web/sass.xml"&gt;existing SASS.xml file&lt;/a&gt; at &lt;a href="http://groups-beta.google.com/group/haml"&gt;HAML Google Group&lt;/a&gt; - &lt;a href="http://groups-beta.google.com/group/haml/files"&gt;Files Section&lt;/a&gt;, I tried it, but didn't like it much... So, I joined what I liked about that one, and merged it with mine. Use mine or &lt;a href="http://groups-beta.google.com/group/haml"&gt;HAML Google Group&lt;/a&gt;'s one, Open Source is all about choice.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;a href='http://rha7dotcom.blogspot.com/'&gt;Rha7dotCom Blog&lt;/a&gt;
Gabriel Medina&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4529774779208095174-4852238387475361697?l=rha7dotcom.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel="related" href="http://blog.wolfman.com/articles/trackback/87" title="SASS jEdit Syntax Highlighting Mode" /><link rel="replies" type="application/atom+xml" href="http://rha7dotcom.blogspot.com/feeds/4852238387475361697/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=4529774779208095174&amp;postID=4852238387475361697" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/4529774779208095174/posts/default/4852238387475361697?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/4529774779208095174/posts/default/4852238387475361697?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Rha7dotcom/~3/jOeq41iHzco/sass-jedit-syntax-highlighting.html" title="SASS jEdit Syntax Highlighting Mode" /><author><name>Rha7DotCom</name><uri>http://www.blogger.com/profile/03301281966644888259</uri><email>rha7.com@gmail.com</email><gd:extendedProperty name="OpenSocialUserId" value="15457348978367955982" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://rha7dotcom.blogspot.com/2008/10/sass-jedit-syntax-highlighting.html</feedburner:origLink></entry><entry gd:etag="W/&quot;D0ABR3c-fSp7ImA9WxJXEUk.&quot;"><id>tag:blogger.com,1999:blog-4529774779208095174.post-4742478367709950500</id><published>2008-09-28T04:00:00.005-06:00</published><updated>2009-06-04T14:02:36.955-06:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-06-04T14:02:36.955-06:00</app:edited><title>rubyscript2exe.rb and 623 Can't modify frozen string (Type Error)</title><content type="html">&lt;h1&gt;rubyscript2exe.rb and Frozen String error&lt;/h1&gt;

&lt;h4&gt;A tiny bug&lt;/h4&gt;
&lt;p&gt;Today I bumped into this error in rubyscript2exe.rb:&lt;/p&gt;
&lt;pre name='code' class='ruby'&gt;
rubyscript2exe.rb:623:in `replace': can't modify frozen string (TypeError)
&lt;/pre&gt;
&lt;p&gt;I'm using ruby 1.8.6 (2008-08-08 patchlevel 286) [i686-linux] and rubyscript2exe.rb version 0.5.3 (29.05.2007) which is the latest to this date. However the forementioned error occurs when trying to run rubyscript2exe.rb.&lt;/p&gt;
&lt;h4&gt;Ungoogled&lt;/h4&gt;
&lt;p&gt;I quickly googled for an answer but was out of luck, so I just jumped in and found the line, just rephrased the line and here is the change, just edit the rubyscript2exe.rb file at line 623, it looks like this:&lt;/p&gt;
&lt;pre name='code' class='ruby'&gt;

$0.replace(File.expand_path("./init.rb"))

&lt;/pre&gt;
&lt;pre name='code' class='ruby'&gt;

  $_0 = File.expand_path("./init.rb")
  alias $__0 $0
  alias $0 $_0

&lt;/pre&gt;
&lt;p&gt;This was fixed from a simple '=' assignment I had proposed to the above solution, based on a comment from &lt;a href="http://github.com/cowlibob/rubyscript2exe"&gt;cowlibob&lt;/a&gt; (thanks), he has the modified version up in github, and you can &lt;a href="http://github.com/cowlibob/rubyscript2exe"&gt;Get it at http://github.com/cowlibob/rubyscript2exe&lt;/a&gt;.&lt;/p&gt;
&lt;h4&gt;Bye!&lt;/h4&gt;
&lt;p&gt;Hope this works for you, good luck.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Gabriel Medina.&lt;/strong&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;a href='http://rha7dotcom.blogspot.com/'&gt;Rha7dotCom Blog&lt;/a&gt;
Gabriel Medina&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4529774779208095174-4742478367709950500?l=rha7dotcom.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel="related" href="http://www.erikveenstra.nl/rubyscript2exe/index.html" title="rubyscript2exe.rb and 623 Can't modify frozen string (Type Error)" /><link rel="replies" type="application/atom+xml" href="http://rha7dotcom.blogspot.com/feeds/4742478367709950500/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=4529774779208095174&amp;postID=4742478367709950500" title="15 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/4529774779208095174/posts/default/4742478367709950500?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/4529774779208095174/posts/default/4742478367709950500?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Rha7dotcom/~3/-m4NLSUYN9E/rubyscript2exerb-and-623-cant-modify.html" title="rubyscript2exe.rb and 623 Can't modify frozen string (Type Error)" /><author><name>Rha7DotCom</name><uri>http://www.blogger.com/profile/03301281966644888259</uri><email>rha7.com@gmail.com</email><gd:extendedProperty name="OpenSocialUserId" value="15457348978367955982" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">15</thr:total><feedburner:origLink>http://rha7dotcom.blogspot.com/2008/09/rubyscript2exerb-and-623-cant-modify.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DEMHRnw4fip7ImA9WxRRFUk.&quot;"><id>tag:blogger.com,1999:blog-4529774779208095174.post-3217458706592336003</id><published>2008-09-27T11:59:00.007-06:00</published><updated>2008-09-27T14:13:57.236-06:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-09-27T14:13:57.236-06:00</app:edited><title>Flash Alerts Plugin : flash_alerts_helper</title><content type="html">&lt;h1&gt;A Helper for Flash Alerts&lt;/h1&gt;

&lt;h4&gt;flash_alerts_helper&lt;/h4&gt;
&lt;p&gt;I find myself doing this over and again in every rails project I start.&lt;/p&gt;
&lt;p&gt;Put flash alerts inside nice div boxes, and obviously not displaying anything at all if there's nothing to display, you know, if you display a div for the flash messages, but the message is empty, there's an empty blank line that moves everything down.&lt;/p&gt;

&lt;h4&gt;How to install&lt;/h4&gt;
&lt;p&gt;It's extremely simple, but it's easier to just install a plugin.&lt;/p&gt;
&lt;p&gt;Do this:&lt;/p&gt;
&lt;pre name="code" class='ruby'&gt;
git clone git://github.com/rha7dotcom/flash_alerts_helper.git vendor/plugins/flash_alerts_helper
&lt;/pre&gt;

&lt;p&gt;Do that at the root of your rails project.&lt;/p&gt;

&lt;h4&gt;How to Use&lt;/h4&gt;
&lt;p&gt;Even simpler, just add the following at the approriate position in your rails layout.&lt;/p&gt;
&lt;pre name="code" class="ruby"&gt;
&lt;%= flash_alerts %&gt;
&lt;/pre&gt;
&lt;p&gt;And that's all, that will generate something like this:&lt;/p&gt;
&lt;pre name="code" class="ruby"&gt;
&lt;div id='flash_message_box'&gt;
    &lt;div class='flash_message' id='flash_error'&gt;
        Error Flash Message
    &lt;/div&gt;
    &lt;div class='flash_message' id='flash_notice'&gt;
        Notice Flash Message
    &lt;/div&gt;
&lt;/div&gt;
&lt;/pre&gt;

&lt;h4&gt;Git Repo&lt;/h4&gt;
&lt;pre name="code" class='ruby'&gt;
http://github.com/rha7dotcom/flash_alerts_helper/tree/master
&lt;/pre&gt;

&lt;p&gt;Hope this is useful for someone out there, I really appreciate comments, so, reward me with yours.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Thanks and see you next time&lt;/strong&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;a href='http://rha7dotcom.blogspot.com/'&gt;Rha7dotCom Blog&lt;/a&gt;
Gabriel Medina&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4529774779208095174-3217458706592336003?l=rha7dotcom.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel="related" href="http://github.com/rha7dotcom/flash_alerts_helper/tree/master" title="Flash Alerts Plugin : flash_alerts_helper" /><link rel="replies" type="application/atom+xml" href="http://rha7dotcom.blogspot.com/feeds/3217458706592336003/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=4529774779208095174&amp;postID=3217458706592336003" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/4529774779208095174/posts/default/3217458706592336003?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/4529774779208095174/posts/default/3217458706592336003?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Rha7dotcom/~3/FAm1MjJMPc0/flash-alerts-plugin-flashalertshelper.html" title="Flash Alerts Plugin : flash_alerts_helper" /><author><name>Rha7DotCom</name><uri>http://www.blogger.com/profile/03301281966644888259</uri><email>rha7.com@gmail.com</email><gd:extendedProperty name="OpenSocialUserId" value="15457348978367955982" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://rha7dotcom.blogspot.com/2008/09/flash-alerts-plugin-flashalertshelper.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DE8BR3k_cCp7ImA9WxRSEUs.&quot;"><id>tag:blogger.com,1999:blog-4529774779208095174.post-2398729339338160580</id><published>2008-09-11T14:58:00.002-06:00</published><updated>2008-09-11T15:00:56.748-06:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-09-11T15:00:56.748-06:00</app:edited><title>How to install ImageMagick and RMagick on CEntOS</title><content type="html">&lt;h1&gt;How to install ImageMagick and RMagick on CEntOS&lt;/h1&gt;

&lt;h4&gt;Yum, yum, yummi&lt;/h4&gt;
&lt;p&gt;Install dependencies first.&lt;/p&gt;
&lt;pre name="code" class="ruby"&gt;
yum install tcl-devel -y
yum install libpng-devel -y
yum install libjpeg-devel -y
yum install ghostscript-devel -y
yum install bzip2-devel -y
yum install freetype-devel -y
yum install libtiff-devel -y
&lt;/pre&gt;
&lt;h4&gt;Download and Install ImageMagick&lt;/h4&gt;
&lt;p&gt;As root, do the following:&lt;/p&gt;
&lt;pre name="code" class="ruby"&gt;
cd /usr/local/src
wget ftp://ftp.imagemagick.org/pub/ImageMagick/ImageMagick.tar.gz
tar xvfz ImageMagick.tar.gz
cd ImageMagick*
./configure
make
make install
&lt;/pre&gt;
&lt;p&gt;
This downloads and installs the latest stable ImageMaick package, but you can go to &lt;a href="http://www.imagemagick.org/www/download.html" title="ImageMagick Download Page" target="_blank"&gt;http://www.imagemagick.org/www/download.html&lt;/a&gt; and download the specific version you (might) need.
&lt;/p&gt;

&lt;h4&gt;Add /usr/local/lib to ld.so.conf and reload&lt;/h4&gt;
&lt;pre name="code" class="ruby"&gt;
[ `grep /usr/local/lib /etc/ld.so.conf | wc -l` -eq 0 ] &amp;&amp; echo "/usr/local/lib" &gt;&gt; /etc/ld.so.conf
ldconfig
&lt;/pre&gt;

&lt;h4&gt;Install RMagick ...&lt;/h4&gt;
&lt;p&gt;Finally install the ruby RMagick gem&lt;/p&gt;
&lt;pre name="code" class="ruby"&gt;
gem install rmagick -r --no-ri --no-rdoc
&lt;/pre&gt;
&lt;p&gt;I use to omit RDoc and ri documentation install, it takes longer, and the gem command is by itself SLOW. Remove the --no-rdoc --no-ri if you want to install'em.&lt;/p&gt;

&lt;h4&gt;That's all&lt;/h4&gt;
&lt;p&gt;Any doubts, leave a comment, I'll try to answer it as soon as possible.&lt;/p&gt;
&lt;p&gt;Regards&lt;/p&gt;
&lt;p&gt;Gabriel Medina&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;a href='http://rha7dotcom.blogspot.com/'&gt;Rha7dotCom Blog&lt;/a&gt;
Gabriel Medina&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4529774779208095174-2398729339338160580?l=rha7dotcom.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://rha7dotcom.blogspot.com/feeds/2398729339338160580/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=4529774779208095174&amp;postID=2398729339338160580" title="7 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/4529774779208095174/posts/default/2398729339338160580?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/4529774779208095174/posts/default/2398729339338160580?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Rha7dotcom/~3/yEwrzY_dqFQ/how-to-install-imagemagick-and-rmagick.html" title="How to install ImageMagick and RMagick on CEntOS" /><author><name>Rha7DotCom</name><uri>http://www.blogger.com/profile/03301281966644888259</uri><email>rha7.com@gmail.com</email><gd:extendedProperty name="OpenSocialUserId" value="15457348978367955982" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">7</thr:total><feedburner:origLink>http://rha7dotcom.blogspot.com/2008/09/how-to-install-imagemagick-and-rmagick.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DU4ERnY6cSp7ImA9WxdaF0w.&quot;"><id>tag:blogger.com,1999:blog-4529774779208095174.post-5339981762414356265</id><published>2008-08-25T20:29:00.001-06:00</published><updated>2008-08-25T20:31:47.819-06:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-08-25T20:31:47.819-06:00</app:edited><title>Ubuntu's chkconfig: sysv-rc-conf and rcconf</title><content type="html">&lt;h1&gt;Ubuntu's chkconfig&lt;/h1&gt;

&lt;p&gt;Hi, when I'm working in Ubuntu, and happen to install some daemons, make scripts to manage them,
you know you always end up needing to manage the SysV init scripts links, to automatically start and stop
the daemons.&lt;/p&gt;

&lt;p&gt;Being as procrastinative (is that a word?) as I am, I always end up searching again and again on Google, "sysv init bash command" or
"chkconfig alternatives for ubuntu" and search and search until I find for the Nth time the same results.&lt;/p&gt;

&lt;p&gt;That's the reason for this post. There are two alternatives, native to Ubuntu (you can also install an alien-ed version
of chkconfig, but that's not the point), one of them is sysv-rc-conf, the second one is rcconf.&lt;/p&gt;

&lt;h4&gt;sysv-rc-conf&lt;/h4&gt;
&lt;p&gt;sysv-rc-conf has the advantage that you can script with it, a simple&lt;/p&gt;
&lt;pre name="code" class="ruby"&gt;sysv-rc-conf apache2 on&lt;/pre&gt;
&lt;p&gt;Turns the apache service on at start up, and&lt;/p&gt;
&lt;pre name="code" class="ruby"&gt;sysv-rc-conf apache2 off&lt;/pre&gt;
&lt;p&gt;Turns it off, as it can be obviuos&lt;/p&gt;
&lt;p&gt;Besides being a command line option, if you type just sysv-rc-conf, it fires up a text based management console, quite useful.
I recommend you to use TERM=linux or TERM=xterm-color, using xterm alone, makes it look awry.&lt;/p&gt;
&lt;pre name="code" class="ruby"&gt;TERM=xterm-color sysv-rc-conf&lt;/pre&gt;
&lt;p&gt;Not so pretty but easily usable.&lt;/p&gt;

&lt;h4&gt;rcconf&lt;/h4&gt;
&lt;p&gt;Easy to use, it's the text counterpart to Ubuntu's graphical 'bum' Boot-Up Manager GUI. Just fire it up with &lt;b&gt;rcconf&lt;/b&gt;&lt;/p&gt;
&lt;pre name="code" class="ruby"&gt;rcconf&lt;/pre&gt;
&lt;p&gt;The bad news it's that although this one looks a bit prettier all blue and stuff, it's not scriptable, that means it has no switches you can
use from the command line. :( So sad. But it works great when using it interactively.&lt;/p&gt;

&lt;h4&gt;How to install ...&lt;/h4&gt;
&lt;p&gt;Well, as usual use apt-get or aptitude :)&lt;/p&gt;
&lt;pre name="code" class="ruby"&gt;aptitude install rcconf sysv-rc-conf -y&lt;/pre&gt;
&lt;p&gt;And that's it!&lt;/p&gt;

&lt;h4&gt;Bye!&lt;/h4&gt;
&lt;p&gt;See you next time.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;a href='http://rha7dotcom.blogspot.com/'&gt;Rha7dotCom Blog&lt;/a&gt;
Gabriel Medina&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4529774779208095174-5339981762414356265?l=rha7dotcom.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel="related" href="http://rha7dotcom.blogspot.com/" title="Ubuntu's chkconfig: sysv-rc-conf and rcconf" /><link rel="replies" type="application/atom+xml" href="http://rha7dotcom.blogspot.com/feeds/5339981762414356265/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=4529774779208095174&amp;postID=5339981762414356265" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/4529774779208095174/posts/default/5339981762414356265?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/4529774779208095174/posts/default/5339981762414356265?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Rha7dotcom/~3/v0WdNzMaoCQ/ubuntus-chkconfig-hi-when-im-working-in.html" title="Ubuntu's chkconfig: sysv-rc-conf and rcconf" /><author><name>Rha7DotCom</name><uri>http://www.blogger.com/profile/03301281966644888259</uri><email>rha7.com@gmail.com</email><gd:extendedProperty name="OpenSocialUserId" value="15457348978367955982" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://rha7dotcom.blogspot.com/2008/08/ubuntus-chkconfig-hi-when-im-working-in.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DEcMQXY-fCp7ImA9WxRTGUw.&quot;"><id>tag:blogger.com,1999:blog-4529774779208095174.post-5254625209987134983</id><published>2008-08-21T15:45:00.006-06:00</published><updated>2008-09-08T17:21:20.854-06:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-09-08T17:21:20.854-06:00</app:edited><title>rorgitignore : .gitignore files specific for Ruby on Rails</title><content type="html">&lt;h1&gt;rorgitignore : .gitignore files specific for Ruby on Rails&lt;/h1&gt;

&lt;h4&gt;What?&lt;/h4&gt;

&lt;p&gt;It's a miniscript that finds empty directories below current directory and adds empty .gitignore files to them.&lt;/p&gt;
&lt;p&gt;It also adds a main .gitignore file at the current directory with Rails project typical contents.&lt;/p&gt;

&lt;h4&gt;Why?&lt;/h4&gt;
&lt;p&gt;Because git tracks contents, not files, it doesn't save any empty directories, since there is no content to track.&lt;/p&gt;
&lt;p&gt;This means that when you clone your project from a git repository, it is missing the log, tmp, lib and other directories.&lt;/p&gt;
&lt;p&gt;This small script fixes that, so git adds even empty directories.&lt;/p&gt;

&lt;h4&gt;How?&lt;/h4&gt;
&lt;p&gt;Well, it adds empty .gitignore files to any empty directories below the current one.&lt;/p&gt;
&lt;p&gt;Additionally it creates a main .gitignore file that includes tmp, log, tmp, config/database.yml and db/*.sqlite3 (all these usually contain dynamic discardable content that we don't commonly add to a SCM repository).&lt;/p&gt;

&lt;h4&gt;Where's the script?&lt;/h4&gt;
&lt;p&gt;Here it is:&lt;/p&gt;
&lt;pre name="code" class="ruby"&gt;
#!/usr/bin/env bash

echo "Creating .gitignore files in empty directories ..."
for URL in `find . -type d | grep -v \.git`; do
    if [ `ls $URL | wc -l` -eq 0 ]; then
        echo "touch $URL/.gitignore"
        echo "git add -f $URL/.gitignore"
    fi
done | bash -x
echo ".gitignore files in empty directories created."
echo

echo "Creating main .gitignore file ..."
/bin/rm -f .gitignore
echo "config/database.yml" &gt;&gt; .gitignore
echo "db/*.sqlite3" &gt;&gt; .gitignore
echo "log/*.log" &gt;&gt; .gitignore
echo "log/*.pid" &gt;&gt; .gitignore
echo "tmp/**/*" &gt;&gt; .gitignore
echo "Created main .gitignore file."
echo


echo ".gitignore files created"
echo "=============================================================="
find . -name .gitignore
echo "=============================================================="
echo

echo "Content of ./.gitignore"
echo "=============================================================="
cat ./.gitignore
echo "=============================================================="
echo
&lt;/pre&gt;

&lt;h4&gt;&lt;/h4&gt;
Remember to use git add -f .

&lt;h4&gt;Bye!&lt;/h4&gt;
&lt;p&gt;See you next time.&lt;/p&gt;

&lt;h4&gt;Update Sep 8, 2008&lt;/h4&gt;
&lt;p&gt;
Here's a simpler script for those that just want the good part, this just outputs the commands to add an empty .gitignore file to  all empty directories in a git project and git add -f'em to the repo.
&lt;/p&gt;
&lt;p&gt;
For this you're supposed to already have init'ed the git repo. This justs generates the commands and pipes them to bash.
&lt;/p&gt;
&lt;pre name="code" class="ruby"&gt;
for DIR in `find . -type d | sed -re 's/\.\///g' | grep -v '^\.git'`; do
    [ `ls -a $DIR | wc -l` -le 2 ] &amp;&amp; \
    echo Creating and git-adding $DIR/.gitignore &amp;&amp; \
    touch $DIR/.gitignore &amp;&amp; \
    git add -f $DIR/.gitignore
done
&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;a href='http://rha7dotcom.blogspot.com/'&gt;Rha7dotCom Blog&lt;/a&gt;
Gabriel Medina&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4529774779208095174-5254625209987134983?l=rha7dotcom.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel="related" href="http://toolmantim.com/article/2007/12/5/setting_up_a_new_rails_app_with_git" title="rorgitignore : .gitignore files specific for Ruby on Rails" /><link rel="replies" type="application/atom+xml" href="http://rha7dotcom.blogspot.com/feeds/5254625209987134983/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=4529774779208095174&amp;postID=5254625209987134983" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/4529774779208095174/posts/default/5254625209987134983?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/4529774779208095174/posts/default/5254625209987134983?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Rha7dotcom/~3/AMP6VtpO0dg/rorgitignore.html" title="rorgitignore : .gitignore files specific for Ruby on Rails" /><author><name>Rha7DotCom</name><uri>http://www.blogger.com/profile/03301281966644888259</uri><email>rha7.com@gmail.com</email><gd:extendedProperty name="OpenSocialUserId" value="15457348978367955982" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">1</thr:total><feedburner:origLink>http://rha7dotcom.blogspot.com/2008/08/rorgitignore.html</feedburner:origLink></entry><entry gd:etag="W/&quot;Ck8ERH88eip7ImA9WxdUEUw.&quot;"><id>tag:blogger.com,1999:blog-4529774779208095174.post-1962447183947806348</id><published>2008-07-26T03:32:00.008-06:00</published><updated>2008-07-26T16:20:05.172-06:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-07-26T16:20:05.172-06:00</app:edited><title>Git and Less Colors</title><content type="html">&lt;h1&gt;Git and Less Colors&lt;/h1&gt;

&lt;p&gt;This is a not so technical article since it just gives a tip on how to set up your less command to display nice colors for git log, git status and other stuff.&lt;/p&gt;

&lt;h4&gt;Git Colors First&lt;/h4&gt;

&lt;p&gt;execute this commands in your console:&lt;/p&gt;

&lt;pre name="code" class="ruby"&gt;
git config --global color.diff auto
git config --global color.status auto
git config --global color.branch auto
&lt;/pre&gt;

&lt;p&gt;You need to run this commands, otherwise, git itself won't generate color codes embedded in output.&lt;/p&gt;

&lt;h4&gt;Now Less&lt;/h4&gt;

&lt;p&gt;Setting up less is easy, just add this line to your .bashrc, or you can run it directly on your console to test it right away.&lt;/p&gt;

&lt;pre name="code" class="ruby"&gt;
export LESS="-RS#3NM~g"
&lt;/pre&gt;

&lt;p&gt;
  &lt;dl&gt;
    &lt;dt&gt;R&lt;/dt&gt;
      &lt;dd&gt;Raw color codes in output (don't remove color codes)&lt;/dd&gt;
    &lt;dt&gt;S&lt;/dt&gt;
      &lt;dd&gt;Chop long lines, instead of wrapping.&lt;/dd&gt;
    &lt;dt&gt;#3&lt;/dt&gt;
      &lt;dd&gt;Scroll 3 columns horizontally at a time.&lt;/dd&gt;
    &lt;dt&gt;N&lt;/dt&gt;
      &lt;dd&gt;Show line numbers&lt;/dd&gt;
    &lt;dt&gt;M&lt;/dt&gt;
      &lt;dd&gt;Long prompts&lt;/dd&gt;
    &lt;dt&gt;~&lt;/dt&gt;
      &lt;dd&gt;Don't show those weird ~ symbols on lines after EOF&lt;/dd&gt;
    &lt;dt&gt;g&lt;/dt&gt;
      &lt;dd&gt;Hilite results when searching with slash key (/)&lt;/dd&gt;
  &lt;/dl&gt;
&lt;/p&gt;

&lt;p&gt;Hope this is useful for you, I added a sample so you can see how it looks.&lt;/p&gt;

&lt;p&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp1.blogger.com/_gswK3oaYqd0/SIrxMALFXqI/AAAAAAAAAAM/83DxrBvcv4c/s1600-h/less-colors.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://bp1.blogger.com/_gswK3oaYqd0/SIrxMALFXqI/AAAAAAAAAAM/83DxrBvcv4c/s320/less-colors.png" alt="" id="BLOGGER_PHOTO_ID_5227255506024095394" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Thanks for your visit.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;a href='http://rha7dotcom.blogspot.com/'&gt;Rha7dotCom Blog&lt;/a&gt;
Gabriel Medina&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4529774779208095174-1962447183947806348?l=rha7dotcom.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://rha7dotcom.blogspot.com/feeds/1962447183947806348/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=4529774779208095174&amp;postID=1962447183947806348" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/4529774779208095174/posts/default/1962447183947806348?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/4529774779208095174/posts/default/1962447183947806348?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Rha7dotcom/~3/OWLL2NLjuQs/git-and-less-colors.html" title="Git and Less Colors" /><author><name>Rha7DotCom</name><uri>http://www.blogger.com/profile/03301281966644888259</uri><email>rha7.com@gmail.com</email><gd:extendedProperty name="OpenSocialUserId" value="15457348978367955982" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://bp1.blogger.com/_gswK3oaYqd0/SIrxMALFXqI/AAAAAAAAAAM/83DxrBvcv4c/s72-c/less-colors.png" height="72" width="72" /><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://rha7dotcom.blogspot.com/2008/07/git-and-less-colors.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CU8NRX49eyp7ImA9WxdVEEU.&quot;"><id>tag:blogger.com,1999:blog-4529774779208095174.post-6252960380962702363</id><published>2008-07-14T18:52:00.006-06:00</published><updated>2008-07-14T19:04:54.063-06:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-07-14T19:04:54.063-06:00</app:edited><title>Ruby and Rails - How to get pp pretty print to return a string.</title><content type="html">&lt;p&gt;Last night I was searching for a blog post I usually go to to simply copy paste some code, but unfortunately the site no longer exists. Just like that. Even though I felt sorry because I never got the time to thank the author, I immediately thought about this other piece of code I'm about to copy here.&lt;/p&gt;

&lt;p&gt;I use this code in almost every Rails site I start, and wouldn't like to lose it, like the one I mentioned before.&lt;/p&gt;

&lt;p&gt;The code I mention is from the Blog of Graeme Mathieson, and I would like to thank him for sharing this piece of code. I duplicate the code here for redundancy:&lt;/p&gt;

&lt;pre name="code" class="ruby"&gt;
require 'pp'
require 'stringio'

module Kernel
  private
  def pp_s(*objs)
      s = StringIO.new
      objs.each {|obj|
        PP.pp(obj, s)
      }
      s.rewind
      s.read
  end
  module_function :pp_s
end

&lt;/pre&gt;
&lt;p&gt;Hope it's useful for somebody, please don't forget to visit:&lt;/p&gt;
&lt;p&gt;&lt;a href='http://woss.name/'&gt;http://woss.name/&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;for even better tips from Graemer Mathieson.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;a href='http://rha7dotcom.blogspot.com/'&gt;Rha7dotCom Blog&lt;/a&gt;
Gabriel Medina&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4529774779208095174-6252960380962702363?l=rha7dotcom.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel="related" href="http://woss.name/2006/04/13/getting-pp-to-return-a-string/trackback/" title="Ruby and Rails - How to get pp pretty print to return a string." /><link rel="replies" type="application/atom+xml" href="http://rha7dotcom.blogspot.com/feeds/6252960380962702363/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=4529774779208095174&amp;postID=6252960380962702363" title="2 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/4529774779208095174/posts/default/6252960380962702363?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/4529774779208095174/posts/default/6252960380962702363?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Rha7dotcom/~3/_xcYXaKiVL8/ruby-and-rails-how-to-get-pp-pretty.html" title="Ruby and Rails - How to get pp pretty print to return a string." /><author><name>Rha7DotCom</name><uri>http://www.blogger.com/profile/03301281966644888259</uri><email>rha7.com@gmail.com</email><gd:extendedProperty name="OpenSocialUserId" value="15457348978367955982" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">2</thr:total><feedburner:origLink>http://rha7dotcom.blogspot.com/2008/07/ruby-and-rails-how-to-get-pp-pretty.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DEYDRXg5eCp7ImA9WxdWFE8.&quot;"><id>tag:blogger.com,1999:blog-4529774779208095174.post-4888237772063461855</id><published>2008-07-05T23:30:00.010-06:00</published><updated>2008-07-07T04:22:54.620-06:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-07-07T04:22:54.620-06:00</app:edited><title>InvalidAuthenticityToken and Dojo Toolkit</title><content type="html">&lt;h1&gt;InvalidAuthenticityToken and Dojo Toolkit&lt;/h1&gt;
&lt;h4&gt;... or how to add your authenticity token to a hand made form in Rails&lt;/h4&gt;
&lt;h4&gt;Finally decided to take on Dojo&lt;/h4&gt;
Hello again, I started playing with the &lt;a href="http://dojotoolkit.org/"&gt;Dojo Toolkit&lt;/a&gt;, and I really liked it, first thing I found was that it used to be incompatible with &lt;a href="http://prototypejs.org/"&gt;Prototype&lt;/a&gt;/&lt;a href="http://script.aculo.us/"&gt;Script.aculo.us&lt;/a&gt;, but that seems to have been fixed, just add a little config for dojo before loading it, and that gets the job done, also you should not forget to load dojo toolkit before loading prototype/script.aculo.us.

&lt;h4&gt;Googled with no luck, just Toolbocks&lt;/h4&gt;
Well, I shall tell you that before going this path I obviously Googled for a ready made gem and/or plug in that I could use to get dojo on Rails, and found &lt;a href="http://dojo.toolbocks.com/"&gt;Dojo Toolbocks&lt;/a&gt; plug in, but reading the documentation it requires you to add the engines plug in, that I am not really fond of, and that was an immediate turn off...

&lt;h4&gt;I don't like the engines plug in, do you?&lt;/h4&gt;
Also I looked for  more documentation about it but it seems all it does is just load the dojo toolkit, so I went on to try and build a plug in that would do that without needing the engines plug in.

&lt;h4&gt;dojo_support plugin ina repository near you soon&lt;/h4&gt;
I will publish this new plug in that will be named dojo_support, when it's ready for a beta test, and that means writing a couple of helpers for views and also a render similar to the Rails' javascript RJS render.

&lt;h4&gt;The InvalidAuthenticityToken Error&lt;/h4&gt;
While developing the code for a helper to create remote form tags that work with dojo, I came into a problem creating the forms, where rails complains about an Invalid Authenticity Token. This is required by the ProtectFromForgery feature of Rails.

&lt;h4&gt;Disabled protection? I don't think so.&lt;/h4&gt;
I had two choices, first, disable protect from forgery in the controllers for actions handling remote dojo forms (not a choice really), second was adding the needed authenticity token to the form, that is generate the form code and include the authenticity token as a hidden field just like regular Rails' generated forms.

This is where I was stuck, I googled without luck finding only posts that told me to add
&lt;pre name="code" class="ruby"&gt;protect_from_forgery :except =&gt; :my_method&lt;/pre&gt;
as shown in &lt;a href="http://api.rubyonrails.org/classes/ActionController/RequestForgeryProtection/ClassMethods.html"&gt;RequesForgeryProtection Class Methods&lt;/a&gt; to disable forgery protection for specific methods but this was something I didnt feel users should do.

&lt;h4&gt;The Discovery of form_authenticity_token&lt;/h4&gt;
I finally found where this protection is in the Rails tree, and found in &lt;a href="http://api.rubyonrails.org/classes/ActionController/RequestForgeryProtection.html"&gt;RequestForgeryProtection&lt;/a&gt; that you can reach the token with
&lt;pre name="code" class="ruby"&gt;form_authenticity_token&lt;/pre&gt;

&lt;h4&gt;The discovery of request_forgery_protection_token&lt;/h4&gt;
And looking around in options_for_ajax, I found you can get the name of the field in the form with
&lt;pre name="code" class="ruby"&gt;request_forgery_protection_token&lt;/pre&gt;
I found it in &lt;a href="http://api.rubyonrails.org/classes/ActionView/Helpers/PrototypeHelper.html#M001631"&gt;ActionView::Helpers::PrototypeHelper&lt;/a&gt; (use the show source link in the options_for_ajax method).

&lt;h4&gt;So, how do you use them?&lt;/h4&gt;
So to end this long post, to prevent InvalidAuthenticityToken forms created by hand just add the following line to your .html.erb form:
&lt;pre name="code" class="ruby"&gt;&amp;lt;input name="&amp;lt;%= request_forgery_protection_token.to_s %&gt;" type="hidden" value="&amp;lt;%= form_authenticity_token %&gt;" /&gt;&lt;/pre&gt;
And you're on track again.

&lt;h4&gt;I hope I have the skills to make Dojo as easy as Prototype/Script.aculo.us&lt;/h4&gt;
Hope this helps someone, of course this will be included in the helpers of the new dojo_support plugin which I expect to publish in a couple of weeks, with the target of making the use of dojo+rails+RDJS(Rails Dojo Javascript) as easy as prototype+sriptaculous+RJS.&lt;br /&gt;&lt;br /&gt;

Greetings everyone.

Gabriel Medina.&lt;div class="blogger-post-footer"&gt;&lt;a href='http://rha7dotcom.blogspot.com/'&gt;Rha7dotCom Blog&lt;/a&gt;
Gabriel Medina&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4529774779208095174-4888237772063461855?l=rha7dotcom.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel="related" href="http://api.rubyonrails.org/classes/ActionController/RequestForgeryProtection.html" title="InvalidAuthenticityToken and Dojo Toolkit" /><link rel="replies" type="application/atom+xml" href="http://rha7dotcom.blogspot.com/feeds/4888237772063461855/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=4529774779208095174&amp;postID=4888237772063461855" title="2 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/4529774779208095174/posts/default/4888237772063461855?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/4529774779208095174/posts/default/4888237772063461855?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Rha7dotcom/~3/GaUXc_eWZbc/invalidauthenticitytoken-and-dojo.html" title="InvalidAuthenticityToken and Dojo Toolkit" /><author><name>Rha7DotCom</name><uri>http://www.blogger.com/profile/03301281966644888259</uri><email>rha7.com@gmail.com</email><gd:extendedProperty name="OpenSocialUserId" value="15457348978367955982" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">2</thr:total><feedburner:origLink>http://rha7dotcom.blogspot.com/2008/07/invalidauthenticitytoken-and-dojo.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DU8BRn0-fSp7ImA9WxdXFUw.&quot;"><id>tag:blogger.com,1999:blog-4529774779208095174.post-4235385250653665399</id><published>2008-06-25T00:39:00.008-06:00</published><updated>2008-06-26T16:04:17.355-06:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-06-26T16:04:17.355-06:00</app:edited><title>Django and Python - No Multiple Heterogeneous Database Support</title><content type="html">&lt;h1&gt;Django and Python - No Multiple Heterogeneous Database Support&lt;/h1&gt;
&lt;br /&gt;
&lt;h4&gt;I Like Python&lt;/h4&gt;
&lt;br /&gt;
I really do, but can't say the same about Django.

I recently had the freedom to start a new small project, and as you may remember I work with Asterisk, so the project was a report centric application where you can define the diferent parameters for your report, and save them as presets.&lt;br&gt;
&lt;br&gt;
I had been playing with Django and even followed the tutorials on the official site, so, since I had the freedom to decide how to do it, I thought it would be a good test of the framework to see how it compared in real life to Ruby and Rails. It seemed really promising, and although I was a bit worried about the lack of official support for a specific AJAX framework, I also thought this could be beneficial, since that meant I could actually choose a different framework (like I couldn't with Rails, right?, well, that encouraged me at the time).&lt;br&gt;
&lt;br&gt;
&lt;h4&gt;You mean, like plug-ins but better?&lt;/h4&gt;So I started building the project, then the app, that's how it's done in Django, a project, can have several applications, which are like modules, that do specific parts of a whole site, also you can use an app in several projects, kinda nice if you think about it, like plugins, but better in a sense, feels more natural).&lt;br&gt;
&lt;br&gt;
&lt;h4&gt;Batteries Included&lt;/h4&gt;Set up the admin part, Django comes with the administration batteries included, like AjaxScaffold included, but without the AJAX, you just define -- In the model!? -- the administrative aspects.&lt;br&gt;
&lt;br&gt;
I can't see how the administrative details (obviously more in the V part of MVC) could fit in the Model (The M in MVC), but what the heck, it came free, and although it seemed a bit odd, I carried with it.&lt;br&gt;

&lt;h4&gt;I Like Big Buts, And I Cannot Lie&lt;/h4&gt;Up to this point everything was good, I had set up the models for the reports, the administrative part and was just about to set up a Controller/View to create reports, and for this I needed to interact with the Asterisk MySQL database (I didn't mention, but I was required to have this app's specific databases in SQLite3, and yet interact with MySQL to get the reports' data), But, and that's a big But (I like big Buts) Oh surprise!, I just couldn't, unless I patched django, and even if I did I wouldn't be able to use the administrative aspects of a django application with the external database.&lt;br&gt;

&lt;h4&gt;That Sucks&lt;/h4&gt;It does, I usually develop small applications that get deployed to 40+ (and growing) servers,  and try to automate the deployment as much as I can so I dont get nagged by the guys that actually do the deployments with silly questions, comments or complaints.&lt;br&gt;
&lt;br&gt;
This meant that I would have to keep a private branch of Django with the patch, or have it available somewhere for our needs, or otherwise, show the config mgmt guys how to (and why) they had to patch django itself.&lt;br&gt;
&lt;br&gt;
Besides, it didn't feel right.&lt;br&gt;

&lt;h4&gt;No Django for Me? :(&lt;/h4&gt;
So after a short thought about it, I decided to rm -rf it and &lt;strong&gt;start over in Rails&lt;/strong&gt;.&lt;br&gt;
&lt;br&gt;
Ruby and Rails still have to be deployed to every new server we manage, but It can be installed relatively simply with a shell script and doesn't have to be patched (the part I don't like).&lt;br&gt;
&lt;br&gt;
Ruby and Rails can, at times be a PITA to install and get set up, specially in non-standard configurations, but at least I won't have to start all over again.&lt;br&gt;
&lt;br&gt;
So this post was about one thing that may not be apparent when you start programming in Python on Django,&lt;br&gt;

&lt;h4&gt;Conclusion&lt;/h4&gt;
Python on Django DOES NOT SUPPORT Multiple Heterogeneous Databases.
&lt;br&gt;&lt;br&gt;
That said,
&lt;br&gt;&lt;br&gt;
I rest my case.
&lt;br&gt;&lt;br&gt;
P.S. : I know I use to many parenthesis (I like them) and also, If I am wrong and didn't google well, please let me know if Django can interact with external databases in a NATURAL WAY (don't bother commenting that patching is not that hard and stuff like that).&lt;br&gt;&lt;br&gt;Thanks everyone!.&lt;div class="blogger-post-footer"&gt;&lt;a href='http://rha7dotcom.blogspot.com/'&gt;Rha7dotCom Blog&lt;/a&gt;
Gabriel Medina&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4529774779208095174-4235385250653665399?l=rha7dotcom.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://rha7dotcom.blogspot.com/feeds/4235385250653665399/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=4529774779208095174&amp;postID=4235385250653665399" title="3 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/4529774779208095174/posts/default/4235385250653665399?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/4529774779208095174/posts/default/4235385250653665399?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Rha7dotcom/~3/FPOM3fk6y78/django-and-python-no_25.html" title="Django and Python - No Multiple Heterogeneous Database Support" /><author><name>Rha7DotCom</name><uri>http://www.blogger.com/profile/03301281966644888259</uri><email>rha7.com@gmail.com</email><gd:extendedProperty name="OpenSocialUserId" value="15457348978367955982" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">3</thr:total><feedburner:origLink>http://rha7dotcom.blogspot.com/2008/06/django-and-python-no_25.html</feedburner:origLink></entry></feed>
