Solve (104: Connection reset by peer)

Posted by Vince Wadhwani on May 17, 2008 in | gnu/linux

Do yourself a favor, if you get a 502 error using the fastcgi script for nginx, check your /var/log/nginx/error.log file. If you see something that looks like this:

2624#0: *11 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: xx.xxx.xxx.xx server: foo.com, URL: "/", upstream: "fastcgi://127.0.0.1:8888", host: "foo.com"

Then make sure you have this line in your php fastcgi_script:

FCGI_WEB_SERVER_ADDRS="127.0.0.1"

That'll save you a whole lot of head scratching and googling.

Quick Tip: Update from Ubuntu Gutsy Gibbon to Hardy Heron

Posted by Vince Wadhwani on May 12, 2008 in | gnu/linux

Wow, it's impressive that updating from one release of Ubuntu Linux to another can be filed under a Quick Tip. Those guys have done a tremendous job! I think I spent a week setting up and fiddling with FreeBSD before I realized that I couldn't upgrade from 6.3 to 7.0 without pulling my hair out. But this is Ubuntu linux so it's way easier. Here's all you have to do to upgrade from Gutsy to Hardy:


Introducing a new Gedit Plugin: Find in Files

Posted by Vince Wadhwani on May 06, 2008 in | gnu/linux | ruby

Regular readers know that I've been using Gedit to do most of the text editing now that I've put away my mac in favor of linux. Leaving Textmate was really hard but luckily there are a few great plugins that help smooth the transition. One of the things that was still missing was an easy way to search for code within my project. There is a Find in Documents plugin but it only searches in documents that you already have open. I decided to modify that plugin to create a new one called Find in Files. Read on for the link and to learn a bit more.

Xfburn for Debian Sid/Sidux/Ubuntu

Posted by Vince Wadhwani on May 05, 2008 in | gnu/linux

I was pretty surprised to find the Xfburn, the xfce cd/dvd burning tool, was not in Debian's Unstable repository. That means you've got to compile it from scratch in order to use it. Compiling from scratch isn't as hard as it sounds.. generally I recommend having a separate folder for the source code. After that it's just a question of the requirements.. so let's work on those.

Install Ruby on Rails on Ubuntu Hardy Heron 8.04

Posted by Vince Wadhwani on Apr 28, 2008 in | gnu/linux | ruby

I recently had to do a fresh installation of Ruby on Rails and Nginx/Mongrel on Hardy Heron server. I compared notes with my last HowTo along the way and decided to write it up in case anybody needs help with the process. If you're struggling with installing Rails, follow along and see if this helps. If you want to scale far and wide on your own I'd suggest popping by Ezra's page and checking out his book. The rest of you.. please read on!

Autocomplete <% %> in Gedit

Posted by Vince Wadhwani on Apr 25, 2008 in | gnu/linux | ruby

If you followed my previous post on using Gedit to do Ruby Rails development in linux you may have discovered the same annoyance I have. Like Textmate, < will auto-complete the > but unlike Textmate pressing <% will still only complete >. That's led to countless errors where I've accidentally created lines of code like:

<%= link_to "Bar", bars_path >

That lack of a proper closing %> naturally throws an error every time. I guess I'm still not over how textmate would do that automatically for me. Anyway, here's how you correct it.

Dump a mysql db to a file

Posted by Vince Wadhwani on Apr 23, 2008 in | gnu/linux

Ok, I'm going to file this under: stuff you don't care about but I want to keep handy just in case I forget. What is it? I'm talking about dumping a mysql db to a .sql file from the command line. Like everything else, it's really simple if you have the correct syntax. For example if your database is called blogapp, then type:

mysqldump --databases --result-file=blogsqlfile.sql blogapp -u mysqluser -p

Substituting the mysqluser user for your mysqluser (root, mysql, whatever)

Quick Tip: Hidden divs in HAML

Posted by Vince Wadhwani on Apr 21, 2008 in | html/css | ruby

I had the chance to play around with haml the other day. Those of you who don't know haml might want to check the above link and come back. For the lazy people, it's basically an alternative markup aiming to make the views more readable or "beautiful". Whether it succeeds or not is not the point of this tip. Rather, if you're using haml, and want to create a hidden div, I'm here to show you how to do it.

Quick TIp: Multiple orders in a conditions statement

Posted by Vince Wadhwani on Apr 17, 2008 in | ruby

I honestly don't know how I went this long without every having to use this, but since googling for it can be a bit of a hassle, I thought I'd share this tip with you. Let's say you're in a situation where you first have to sort by date and then alphabetically. How do you put two :order's in the condition? Simple:

@foo = Foo.find(:all, :order => 'created_at desc, name desc')

The magic comma in the quotes passes it along correctly. Thanks to AndrewO for saving me the hair pulling.

Sid gets Python 2.5.2

Posted by Vince Wadhwani on Apr 16, 2008 in | gnu/linux

It took a long time, but Debian Sid looks like it finally managed to get to version 2.5.2 of Python. Why did it take so long? Because lots of packages could have broken on upgrade. And in fact, my compiz fusion-icon got totally borked because of it.

python-compizconfig: Depends: python (< 2.5) but 2.5.2-0.1 is to be installed

Small price to pay to get v2.5 as the default though -- I'm sure it'll get fixed in short order. But if you're running Debian Sid (or Sidux) consider yourself warned..

Older posts: 1 2 3 4 5 ... 43