Pennies for Thought

Oct
31

After a long week of tinkering and testing I have finally made the “early access” sign ups for Type Aloud available to the public. Most of this week has been spent fixing some issues with the Ruby Bundler, Nginx and of course Passenger 3. Up until this point I did not make the Type Aloud code available for testing on production and have done most of my development locally. This posed some issues for testing OAuth2 authentication with Facebook, Twitter and other end points, but generally I assumed that it would work as expected. I was ever so slightly wrong.

Passenger itself was quite easy to install. I downloaded it from the website and merely followed the instructions, which downloads nginx and compiles the Passenger module into the nginx executable. This is due to Nginx not supporting loadable modules like Apache, but on my meager Slice Host server this went pretty quick. Within an hour I had a Passenger and Nginx installation up and running. My configuration is a little different than most people: on this particular slice I am running two Rails Rack applications (typealoud.com and thunkbrightly.com) and this WordPress blog which is using the php-fastcgi plugin through Nginx.

The last thing that I did was download Ruby Enterprise Edition which is by the same great cats over at Phusion. This version of Ruby is designed specially to minimize the memory footprint and speed up (as much as possible) the execution. There are some nifty graphs over there on the website so I am not going to gush over any of their stats. The point being: since I am broke and using shared hosting this is the absolute best. The installation went quick and easy.

I install all of my third-party applications into the mounted /opt (optional) directory. This is where Passenger is installed. When it comes to Ruby I decided to install this into the /usr/local because I have several scripts that I wrote which expects this to be in the $PATH environment variable. Because the hardest part of this process was figuring out to correctly configure Passenger 3 for Nginx I am going to post my configuration for my Rails (and php-fastcgi) applications. I hope that this helps some of you.

user  op;
worker_processes  2;
 
error_log  logs/error.log warn;
#error_log  logs/error.log  notice;
#error_log  logs/error.log  info;
 
pid        logs/nginx.pid;
 
events {
    worker_connections  1024;
}
 
http {
    passenger_root /opt/passenger-3.0.0;
    passenger_ruby /usr/local/bin/ruby;
    passenger_max_pool_size 10;
 
    include       mime.types;
    default_type  application/octet-stream;
 
    log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
                      '$status $body_bytes_sent "$http_referer" '
                      '"$http_user_agent" "$http_x_forwarded_for"';
 
    access_log  logs/access.log  main;
 
    sendfile        on;
    #tcp_nopush     on;
 
    #keepalive_timeout  0;
    keepalive_timeout  65;
 
    gzip  on;
    gzip_http_version 1.0;
    gzip_vary on;
    gzip_comp_level 6;
    gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript;
    gzip_buffers 16 8k;
 
    include /etc/nginx/sites-enabled/*;
 
    server {
        listen       80;
        server_name  localhost;
 
        #charset koi8-r;
 
        access_log  logs/host.access.log  main;
 
        location / {
            root   html;
            index  index.html index.htm;
        }
     }
}

sites-available/typealoud.com

server {
 listen 80;
 server_name www.typealoud.com;
 rewrite ^/(.*) http://typealoud.com/$1 permanent;
}
 
server {
 listen 80;
 server_name typealoud.com;
 access_log /var/log/nginx/typealoud.com/access.log;
 error_log /var/log/nginx/typealoud.com/error.log warn;
 
 location / {
  root /var/www/typealoud.com/public;
  passenger_enabled on;
  rack_env production;
  rails_spawn_method smart;
  index index.htm index.html;
 }
}

sites-available/thoughtlessbanter.com

server {
 listen 80;
 server_name www.thoughtlessbanter.com;
 rewrite ^/(.*) http://thoughtlessbanter.com/$1 permanent;
}
 
server {
 listen 80;
 server_name thoughtlessbanter.com;
 access_log /var/log/nginx/thoughtlessbanter.com/access.log;
 error_log /var/log/nginx/thoughtlessbanter.com/error.log warn;
 
 location / {
   root /var/www/thoughtlessbanter.com;
   index index.php index.html index.htm;
 
   if (-f $request_filename) {
    expires 30d;
    break;
   }
 
   if (!-e $request_filename) {
    rewrite ^(.+)$ /index.php?q=$1 last;
   }
 }
 
 location ~ \.php {
  include /etc/nginx/fastcgi_params;
  keepalive_timeout 30;
  proxy_read_timeout 60;
  proxy_connect_timeout 60;
 
  fastcgi_pass 127.0.0.1:9000;
  fastcgi_index index.php;
 
  fastcgi_param PATH_INFO "";
  fastcgi_param SCRIPT_FILENAME /var/www/thoughtlessbanter.com/$fastcgi_script_name;
 
  fastcgi_param  QUERY_STRING       $query_string;
  fastcgi_param  REQUEST_METHOD     $request_method;
  fastcgi_param  CONTENT_TYPE       $content_type;
  fastcgi_param  CONTENT_LENGTH     $content_length;
   if (!-e $request_filename) {
    rewrite ^(.+)$ /index.php?q=$1 last;
   }
 }
 
 location ~ \.php {
  include /etc/nginx/fastcgi_params;
  keepalive_timeout 30;
  proxy_read_timeout 60;
  proxy_connect_timeout 60;
 
  fastcgi_pass 127.0.0.1:9000;
  fastcgi_index index.php;
 
  fastcgi_param PATH_INFO "";
  fastcgi_param SCRIPT_FILENAME /var/www/thoughtlessbanter.com/$fastcgi_script_name;
 
  fastcgi_param  QUERY_STRING       $query_string;
  fastcgi_param  REQUEST_METHOD     $request_method;
  fastcgi_param  CONTENT_TYPE       $content_type;
  fastcgi_param  CONTENT_LENGTH     $content_length;
 
  fastcgi_param  SCRIPT_NAME        $fastcgi_script_name;
  fastcgi_param  REQUEST_URI        $request_uri;
  fastcgi_param  DOCUMENT_URI       $document_uri;
  fastcgi_param  DOCUMENT_ROOT      $document_root;
  fastcgi_param  SERVER_PROTOCOL    $server_protocol;
 
  fastcgi_param  GATEWAY_INTERFACE  CGI/1.1;
  fastcgi_param  SERVER_SOFTWARE    nginx/$nginx_version;
 
  fastcgi_param  REMOTE_ADDR        $remote_addr;
  fastcgi_param  REMOTE_PORT        $remote_port;
  fastcgi_param  SERVER_ADDR        $server_addr;
  fastcgi_param  SERVER_PORT        $server_port;
  fastcgi_param  SERVER_NAME        $server_name;
 
  fastcgi_param  REDIRECT_STATUS    200;
 
  fastcgi_read_timeout 60;
 }
}
Oct
12
Posted by JB at 11:16 pm

Foolish me, I was doing some housekeeping on my web server and managed to remove the mysql daemon from the startup script. It took me a couple of weeks to figure out that this had happened. Well, anyway, luckily now as you can see it is back online and ready to rock.

I will be heading off to the Boston Gameloop 2010 conference at the Microsoft NERD center in Cambridge, MA tomorrow night. I decided to travel by the means of the Bolt Bus which provides both power outlets for laptops as well as free Internet for the trip. I am not quite sure the quality of either, but I expect to at least be online occasionally tomorrow night to chat on and off. I think I am going to take this time to work more on my Ruby on Rails project, Type Aloud, which I am hoping to launch sometime around the beginning of October. I will be sending around some beta invites when the site is ready to rock and roll.

If you are a frequent rider of the PATH system between New Jersey and New York City you may have noticed big brother communicating overhead reminding you that there is no eating or drinking on the PATH. I have been commuting into New York City for three years now and I absolutely understand their point – due to the high volume of people, even if every third person was eating a sandwich the amount of trash left all over the train would be amazing. But only the other day after I had read my complimentary Metro newspaper, dropped it into a puddle of who-the-hell-knows-what, I realized that there are absolutely no trash cans inside of any of the station terminals!

This was a moment I actually had to double take. I looked around the World Trade Center terminal searching for a trash can and I was only able to find some construction worker’s trash bin which should absolutely not need to be used to throw out newspaper. So I walked out of the terminal in search of a trash can on my normal commute on the Lexington avenue line. It was not until the corner of Broadway and Vesey had I actually found a trash can! That is roughly a quarter mile away from the terminal entrance! As you can clearly see below the distance from the World Trade Center, which is not even accurately depicted due to the ongoing construction, is quite surprising. You would think that someone, anyone, might have decided to stick a trash can on one of the busiest commuter walked areas in the city.


View Larger Map

I understand the need to enforce physiologically the fact that you do not want trash inside of the terminals. But should you absolutely remove trash cans completely, even outside of the turn stiles before you even get inside of the terminal? Some people are standing around drinking (or eating) the remnants of their breakfast/lunch/dinner before they decide to step through the gates. Although, I have to say, it seems to be working – the PATH commute is by far the less smelly of any of the lines that I have to take. Just some food for thought.

I have been using WordPress for many years now. I firmly believe that there is no better software available, free or paid, for rolling your own blog. The guys over at Automattic are an amazing bunch of people for giving away free software that might otherwise cost thousands of dollars. But with all of that said I feel that there is a big gap that the blogging community must hurdle in order to become, well, more conjoined. When I am bored I tend to click around the Internet, read some blog posts, and occasionally comment on the ones that I feel are worthy. I have found that there is some great great commenting software out there that allows tracking of comments from site to site, but the same can’t be said for blogging.

Now, I may have missed the memo, but what blogging really needs is a centralized hub where I can easily search, comment and publicize the authors that I think are making strides in the vast online writing community that is the blogosphere. Up until this point I have had to keep a list of bookmarks for the blogs that I want to frequent, but why is that? Just as I am able to log on to Digg.com and given stories that I would like to read, I should be handled blog articles that are automatically aggregated utilizing the XML-RPC ping protocol that WordPress has seemingly kept infamous. I believe that the WordPress.com community is a step in the right direction when it comes to a blog community, but I do not want to be limited to having to open a blog on their host in order to be listed there. Part of the reason I love WordPress (the software) is that I like the freedom I am given when I am able to run my own host.

Well, those are just some thoughts of mine. I am sure that someone, somewhere, has been thinking the same thing that I have and is probably already hard at work on the next big thing when it comes to blogging communities. I just have not found anything that comes close to my vision of what the ideal would be. Someone surprise me.

Another year has gone by and I am once again typing to the sweet melodies of Slipknot, with a glass of Jack Daniels to the left and my MacBook at my right. This birthday unfortunately will be plagued with stuffing my nose into a physics book learning about electromagnetism, but I figured I would take a little time tonight to write a small little blog post about the things that I am thankful for this year. I find myself looking less upon the past as of recent so I think it is fair to give the time needed to acknowledge those that have had a profound meaning to me this year.

The Guys At Zinkk

What can I say? The past year has been full of amazing achievements for a group of guys that came together with a dream. We each are working through our lives to try and make this business float. Up until the past couple of weeks the outlook was gloomy, and then we pulled together to have an truly amazing time at the teacher’s conference. The late nights spent coding, planning, and sipping coffee with you guys are among what I cherish the most this past year. I hope, no matter what happens with our business, that our lives will allow us to continue to work together in some form or another. There is absolutely no way I would be happier if Type Aloud launched and immediately was taken down by a storm of rabid Twitter fan boys. We can only hope for such a mob!

My Friends, Close and Far

Many of you may not even know the affect that you have towards my ability to still be a sane person. Some of my happiest times are sitting at the universities’ pub drinking back beers and talking about life. Or spending a night drinking booze watching people make fools of themselves playing Asshole or arguing about the logistics of Michael Jackson being both a superstar and a pedaphile. I do have a myriad of misfit friends, but you all each play a specific role to my plan for future world domination, and I will make sure to treat you all like royalty in the new republic.

The Fam

They may or may not be reading this. Nevertheless, it need not be said, but I wouldn’t be here if it weren’t for them.

Well that’s about it for me. I am going to exit on that note (and Smashmouth – Walking On The Sun). I hope all of you have a great holiday, an even better year, and I can’t wait to see what the next twelve months will bring.

Oct
06

It has been nearly a month since I have slept a full night on an actual mattress. During Labor Day weekend, about a month ago, the unit above my apartment sprung a leak in the bathroom and an existing problem got worse. A small spot of mold turned into a swarm, spreading from the upper corner of the wall, down the closet and into my personal affects. A small growth of mold that we wrote to a landlord about in a letter with our rent had multiplied, and forced my roommate and I out of our apartment. The water pressure had also destroyed the tiles in our bathroom’s shower leaving us miserable and dirty to boot. As you can imagine this was not how I wanted to begin my last semester as an undergraduate at university.

Over the course of the month I have seem my health be affected by the disturbed sleeping pattern, the uncomfortable arrangements I have had to make, and my studies have hit an all time rock bottom. This was the first time in my life that I have been physically without a place to call home; luckily I have been able to shack up at the office on an air mattress (occasionally sleeping on the couch to give someone else the mattress to sleep on) which has definitely eased the pain a little. But I can honestly say that this has been one of the worst months of my life.

All throughout this month I have learned how much I am actually able to take without breaking. I really feel like shit right now, burnt out and beat up, but my mind is keeping my sicken body going. I need to get this work done. No matter how much trudging it takes I am going to begrudgingly finish everything as best as I can. I am going to keep my mouth shut, no matter how much I think a teaching method is wrong. Maybe one day I will be able to incorporate what I have learned at college into something meaningful.

I am writing this blog post now sitting on the air mattress that I purchased a couple of weeks ago. My room has yet to be fully finished, I am waiting on a contractor to finish shampooing the carpet, and I have piles of work that needs to be taken care of. The past two weeks I have been nursing a cold that had seemingly gone, came back, only to be gone again leaving a persistent dry cough. I survived the first round of midterm exams, have one more next week, and will be officially halfway finished in about two weeks. This semester has truly been the worst and I am absolutely looking forward to the real world. A world without examinations meant to trick you into the wrong answer, mislead you, and generally make you feel shitty about yourself. A world where the end result matters and not the theoretical process that you used to get that result.

I can smell the roses. Let’s just hope that life does not through another curve ball my way. My apologies for something that is less humorous – I have been unable to write a funny piece this whole month. I’ll make an attempt to get back into the groove of things soon. I promise.