Broken Tooth Pt.2

Leeroy hit me in the mouth a week ago. I went to my dentist on Thursday and it was… well… lets just say my tooth is not going to fall out… yet.

He did a root canal and had to re-shape my tooth with a drill. Turns out Leeroy hit me so hard that he not only knocked it loose, he actually re-positioned the tooth and now the lower right corner was blocking my ability to bite down all the way. All this meant that my tooth was healing (sort of, keep reading) but in a different place than it should.

He said if he could have gotten to it right away he could re-position it, but since it had been a couple of days he had to re-shape it. Not only that, but there was a huge apses forming above my tooth and if I would have left it, the tooth would have been rejected by my body in a couple months anyways.

So he did a root canal, reshaped it, and I’m going back next Monday for a follow up and some more adjustments. I does still hurt and I can bite anything with the tooth, but Advil works wonders and I can eat things if I cut them up. There is still a danger that I cracked the root of my tooth and if that happened I could loose the tooth, but not for a long time (possibly decades).

So yeah… I don’t have pirate teeth yet and I’m very happy that I am not one of the 1/3 Americans who do not have dental insurance. Even if it did end up falling out in 10 years, maybe I could get a cool ass gold tooth and become a rapper. Maybe.

[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon] Comments

I guess it appears like I haven’t been doing much since there has been a lack of new posts on here, moreover a lack of tech related posts.  Well, usually I post a techy post if I stumble upon something new and/or interesting at work and obviously its been kinda quiet on that front.

So what have I been up to then?  Well, work wise, it has been mostly hacking Drupal and Windows Server related.  Pretty boring.  Nothing makes great blog posts like managing Active Directory and setting up Roaming Profiles… (Sarcasim)

In the personal realm of things there are a couple of things happening.  We are looking for a new place, which is always interesting.  We want a bigger place and somewhere over the hill so my commute is shorter.  Just getting up by Miller Hill or in Hermantown will cut about 20 minutes off my commute, which is over an hour right now.

We also need a place that accepts dogs.  Ugh. Then you throw in that we can afford a pretty nice place, but then that extra couple of hundred bucks we could save by just getting your run of mill apartment rather than a townhome or whatever could be put towards credit cards or student loans, and well, it gets complicated.  We are really trying to pay off debt, as living debt free is a goal of ours.

Jen and I have started to take dancing lessons.  It is pretty funny and a good time.  We are the youngest couple by at least 20 years, but I think the other people at the class like having a younger couple there.  It is also nice to see that I’m not the only person that sucks at dancing out there.  Anyways, it is tons of fun and I recommend it to any couple out there.

[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon] Comments

Broke my tooth…

The other day I was holding on to our pup, Leeroy, and he threw his head back and drilled me in the face. After a little blood and four letter words, I realized my front top tooth didn’t feel right.. and was a little crooked.. and was loose.

Took a trip to Urgent Care where the doc said he thought it looked as good ( like its not gonna just fall out) and I’m calling the dentist today.

The worst part of this isn’t how much it hurts, but its the fact I can’t eat anything except coffee, yogurt, and pudding. I had french onion soup, but I literally couldn’t even chew the soggy onions.  Liquid food just doesn’t really fill you up like a nice steak or slice of pizza..

[update]  Can’t get into the dentist till Thursday.

[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon] Comments

Ugh, more snow.

This is what I woke to this morning.
snow_sm
A fresh coat of snow.  Ugh.  Its around this time that Minnesotans start to really hate that beautiful white power from hell.  I mean, I’ll take a foot of snow over below zero temps any day, but really, it is almost April… throw us a bone Mother Nature!

[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon] Comments

Got a new monitor

monitor

Yup, brand new 24 inch Samsung. I’m always amazed what an extra 4 inches will do for your screen real estate. I love it.

[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon] Comment

Today I set up 470.johnyerhot.com and set up a Rails app I worked on to run there, but I needed to install the Pdf-writer Gem for proper functionality. Low and behold when I tried

sudo gem install pdf-writer

I was greeted with nothing, just

Updating Gem source index for: http://gems.rubyforge.org

and that was it. After searching and searching I realized the the version of Gem I had installed was 0.94 and that was the problem.

The solution is as follows:

wget http://rubyforge.org/frs/download.php/29548/rubygems-1.0.1.tgz
tar zxvf rubygems-1.0.1.tgz
cd rubygems-1.0.1
ruby setup.rb
sudo gem update

You just need to manually install the updated Gem. Cinch.

[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon] Comments

I’ve spend all morning trying to get this to work.  I am using nice menus and the frontpage modules in Drupal for a project at work and I could not for the life of me get the nice menu to work on the newly created frontpage I set up using “full” type of front page.

After hours of banging my head on the desk I’ve figured it out.

    <?php
$block = module_invoke(’nice_menus’, ‘block’, ‘view’, 1);
print $block[’content’];
?>

Yes that is it.  This will print out the contents of the nice menus block.  Ugh.

[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon] Comments

Its official - I’m going to be in Grandma’s (Half) Marathon and today was day 1 for training.

I ran one mile. :)

Gotta start somewhere, right? Needless to say I haven’t went for a run in about 3 months, so I was very tired after only 1 mile. After I get done here, I’m going to map out my training on a calendar to make sure I will be up to the 13 miles prior to race day.

I’m hoping to accomplish a couple of things here.

  • loose the winter weight.
  • gain some more energy.
  • since I’m going to have to run in the AM, get up earlier to get a run in before work.
  • eventually run a full Marathon, or even compete in a triathlon. That would be awesome.

I ran in cross country and track in high school so I do know how to train and what to do and what not to do, and I have run 13 miles before… once… about 8 years ago… so it will be interesting.

I’m going to try and put a weekly update up so you can follow my performance.

[EDIT] I’ve created a page (on the right side of my site) that I’m going to log my mile on. If anyone in the Duluth area wants to go for a run with me or has any tips for race day, feel free to email me at joyerhot@gmail.com or gimme a call at 608-385-8897.

[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon] Comments

Some Royner Fixes

Just a few quick bug fixes, mostly involving signing up.

  • fixed problem with the data validation
  • fixed a redirect problem when you entered bad data, resulting in a 500 error.
  • tweaked CSS a bit for flash[:notice

HERE

    [Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon] Comments

    In a previous post I talked about how I just set up my new Slicehost account using Nginx to power this blog (Wordpress - PHP) and some Rails Apps. Here’s a mini how to on how I got the whole thing working, as its not quite as easy as it sounds.

    First though - Why not use Apache + mod_proxy… There is a ton of documentation out there for Apache, and the majority of the web runs on it?

    Well, Nginx is super tiny and super light weight and super fast. If you are in a situation like many people who are using Slicehost and a 256 MB slice, Apache has too big a resource foot print. If you are a Rails guy (or gal) Apache is just used as a proxy to send requests to Mongrel and Apache will just use resources that could be used else where. Nginx is stable, well supported, and growing in popularity. Plus the name is cool.. NGINX.. yeah…

    This will (should) work with a fresh install of Ubuntu Server 7.10, but as always YMMV.

    A lot of this is adapted from a great post on How To Forge, thanks 3uropa.

    Install only the OpenSSH packages NOT the LAMP packages when installing Ubuntu Server 7.10. You’ll have to setup networking for whatever your situation is so can’t help you there. If you have a Slicehost slice, don’t do anything. :)
    install ubuntu
    install ubuntu 2

    Once that is finished installing Ubuntu Server, the first thing you want to do is update and get some prerequisites out of the way!

    sudo apt-get update
    sudo apt-get upgrade
    sudo apt-get install build-essential

    Ok. Now, you need to go in and get all your files/directories in order. That mean, go to /var/www/ (or wherever) and make directories for your PHP site. In my case, I used /home/joyerhot/public_html/johnyerhot.com/wordpress as the root of my Wordpress blog. You should be able to either use wget to grab stuff or SFTP in with your username and password.

    Ok. Next we will install PHP5 and MySQL

    apt-get install php5-cli php5-cgi build-essential mysql-server mysql-client libmysqlclitene15-dev

    Now, lets get Nginx while we’re at it! The version that is in Ubuntu’s repos is old and not cool, so we’ll manually grab a newer version:

    wget http://technokracy.net/nginx/nginx_0.5.32~grrr-1_i386.deb
    sudo dpkg nginx_*

    And now Nginx is running and listening to port 8000.. we’ll change that later though.
    nginx setup

    Now, here is where it gets sticky. You are going to create and edit /etc/nginx/sites-enabled/mysite

    sudo nano /etc/nginx/sites-enabled/mysite

    and put in it the following, changing directories and whatnot to what is appropriate for you.

    server {

    listen 80;
    server_name yourdomain.com;
    rewrite ^/(.*) http://www.yourdomain.com permanent;

    }

    server {

    listen 80;
    server_name www.yourdomain.com;

    access_log /home/joyerhot/public_html/yourdomain.com/logs/access.log;
    error_log /home/joyerhot/public_html/yourdomain.com/logs/error.log;

    if (!-e $request_filename) {
    rewrite ^([_0-9a-zA-Z-]+)?(/wp-.*) $2 last;
    rewrite ^([_0-9a-zA-Z-]+)?(/.*\.php)$ $2 last;
    rewrite ^ /index.php last;
    }

    location / {

    root /home/joyerhot/public_html/johnyerhot.com/wordpress;
    index index.html index.php index.htm;

    }

    # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
    #
    location ~ \.php$ {
    fastcgi_pass 127.0.0.1:9000;
    fastcgi_index index.php;
    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_FILENAME /home/joyerhot/public_html/yourdomain.com/wordpress/$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;
    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;
    }
    }

    editing_nginx

    WHEW! There is A LOT of stuff there! This will setup a Virtual Host for your PHP site, and enable rewrites (for pretty urls). Here is what you need to change in yours though:

    1. the server_name is whatever your domain is.
    2. rewrite ^/(.*) http://www.whatever_goes_here.com permanent;
    3. access_log directory
    4. error_log directory
    5. root directory
    6. fastcgi_param SCRIPT_FILENAME /path/to/your/php/app/root/$fastcgi_script_name;
    7. MAKE SURE YOU’RE LISTENING TO PORT 80.

    Ok, now we’ll get PHP5 working as a fcgi process. To do this, we need to grab some of Lighttpd.

    wget http://www.lighttpd.net/download/lighttpd-1.4.18.tar.bz2
    tar -xvjf lighttpd-*
    cd lighttpd*
    ./configure
    make

    DO NOT “make install”. :)

    sudo cp src/spawn-fcgi /usr/bin/spawn-fcgi
    sudo nano /usr/bin/php-fastcgi

    Now, add the following into php-fastcgi:

    /usr/bin/spawn-fcgi -a 127.0.0.1 -p 9000 -C 2 -u www-data -f /usr/bin/php5-cgi

    -C controls how many fcgi instances of PHP5 are spawned, so you can put however many are appropriate for you in there. I only needed 2.

    sudo nano /etc/init.d/init-fastcgi

    And add:

    #!/bin/bash
    PHP_SCRIPT=/usr/bin/php-fastcgi
    RETVAL=0
    case “$1″ in
    start)
    $PHP_SCRIPT
    RETVAL=$?
    ;;
    stop)
    killall -9 php
    RETVAL=$?
    ;;
    restart)
    killall -9 php
    $PHP_SCRIPT
    RETVAL=$?
    ;;
    *)
    echo “Usage: php-fastcgi {start|stop|restart}”
    exit 1
    ;;
    esac
    exit $RETVAL

    Do some permission magic:

    sudo chmod 755 /etc/init.d/init-fastcgi
    sudo chmod 755 /usr/bin/php-fastcgi

    Now, you can make sure everything is working by:

    /etc/init.d/init-fastcgi start
    top #then shift + M

    You should see a couple of PHP5 fcgi processes! YAY!
    Finally, we want them to start on reboots and whatnot so…

    update-rc.d init-fastcgi defaults

    Ok, now lets restart Nginx and see if things are working!

    /etc/init.d/nginx restart

    You should be able to hit your Php app now!

    Now for Ruby and friends!

    sudo apt-get install libmysql-ruby1.8 ruby1.8-dev ruby1.8 ri1.8 rdoc1.8 irb1.8 libreadline-ruby1.8 libruby1.8 libopenssl-ruby irb1.8 libdbd-mysql-perl libdbi-perl libmysql-ruby1.8 libmysqlclient15-dev libmysqlclient15off libnet-daemon-perl libopenssl-ruby libopenssl-ruby1.8 libplrpc-perl libreadline-ruby1.8 libruby1.8 mysql-client mysql-client-5.0 mysql-common mysql-server mysql-server-5.0 rdoc1.8 ri1.8 ruby1.8 ruby1.8-dev zlib1g-dev

    And you might need to create some symlinks (I had to), thanks Vince Wadhwanl.

    sudo ln -s /usr/bin/ruby1.8 /usr/local/bin/ruby
    sudo ln -s /usr/bin/rdoc1.8 /usr/local/bin/rdoc
    sudo ln -s /usr/bin/ri1.8 /usr/local/bin/ri
    sudo ln -s /usr/bin/irb1.8 /usr/local/bin/irb

    Make sure things are working ok…

    ruby -v

    You should get that you have 1.8.6 installed.Ok, now lets install RubyGems.

    wget http://rubyforge.org/frs/download.php/29548/rubygems-1.0.1.tgz
    tar xvzf rubygems-1.0.1.tgz
    cd rubygems-1.0.1
    sudo ruby setup.rb
    sudo ln -s /usr/bin/gem1.8 /usr/bin/gem

    And finally for Rails and Mongrel:

    sudo gem install rails
    sudo gem install mongrel mongrel_cluster

    You can now set up a mongrel_cluster or whatever you need. There’s plenty of tutorials out there for that, so Google is your friend. The rest will assume you have your Rails app up and running on port 3000.
    We now have to set up a site profile for Nginx for your mongrel_cluster.

    sudo nano /etc/nginx/sites-enabled/rails_app

    And add to it, once again changing the relevant parts….

    upstream domain1 {
    server 127.0.0.1:3000;
    }

    server {

    listen 80;
    server_name www.your2nddomain.com;
    rewrite ^/(.*) http://subdomain.your2nddomain.com permanent;

    }

    server {

    listen 80;
    server_name subdomain.your2nddomain.com;

    access_log /home/joyerhot/public_html/your2nddomain.com/logs/access.log;
    error_log /home/joyerhot/public_html/your2nddomain.com/logs/error.log;

    location / {

    root /home/joyerhot/public_html/your2nddomain.com/public/RAILS_ROOT/public/;
    index index.html;
    location / {
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header Host $http_host;
    proxy_redirect false;

    if (-f $request_filename/index.html) {
    rewrite (.*) $1/index.html break;
    }

    if (-f $request_filename.html) {
    rewrite (.*) $1.html break;
    }

    if (!-f $request_filename) {
    proxy_pass http://domain1;
    break;
    }
    }

    }

    }

    Again, heres what you need to change:
    1. server_name should be the domain
    2. In this case the “rewrite” line will point to subdomain.your2nddomain.com, you should prolly just put your domain here(www.your2nddomain.com).
    3. access_log directory
    4. error_log directory
    5. root directory (pointing to RAILS_ROOT/public)

    That’s it! You should now restart Nginx (/etc/init.d/nginx restart) and when you should have everything working! You’ve got Virtual Hosts setup with PHP running as Fast CGI on one domain and Ruby On Rails on the other!

    I’m sure I’ve got a typo or two in here and a mistake here and there, please leave a message if this worked or didn’t work for you. Remember, this is the process I went through getting everything working on my Slicehost Slice and another server at work, both running Ubuntu 7.10.

    PS. Here is one little nugget of info that may be helpful - Your MySQL socket file location (for your RAILS_ROOT/config/database.yml file) is located at /var/run/mysqld/mysqld.sock. I didn’t realize this at first. :)

    [Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon] Comments