PullMonkey Blog


27 Sep

Routes I did over the weekend


32 miles round trip from my friend's house to work.

25 miles to Los Lunas from downtown Albuquerque, and then we road the train back.


Comments Off on Routes I did over the weekend Filed under: biking, me Tags: , , ,
19 Sep

Getting pretty serious now


It has only been a few weeks of riding to and from work and I am obsessed.  I bought the Cateye v3.  It's a cyclocomputer that measures pretty much everything.  It measures the current, max and average for cadence (crank revolutions), speed, and heart rate.  Not to mention distance, time, and calories.  It took about 5 minutes to setup and getting everything securely fastened and operational.

So far it seems to work just fine.

If I could have justified it, I would have gone with a garmin cyclocomputer (probably the garmin edge 705).  But for $700 bucks it didn't make much sense knowing that my bike was $30 bucks.  I would have loved to ghost race myself, such that the cyclocomputer would have tracked/stored a previous lap or trip and then I would see a dot representation of both my current self and my previous self, kind of like mario kart.   That would have definitely kept me motivated.

For a little over $100.00, I couldn't beat the cateye, so I am going to give it a thorough test tomorrow, see what it can really do.  I hope it is a positive experience.


14 Sep

THINning it out


Been having problems with swap space and memory on my slicehost servers.  And it is all apache's and mongrel's fault.  That used to be the cool combination and now it is an ugly, sluggish beast.  Just recently, I switched to nginx (to replace apache) and thin (to replace mongrel).  So far so good, major speed improvements and definitely memory consumption improvements.

I started out by switching everything over the nginx while keeping the mongrels alive, that was actually pretty easy.  Information was available everywhere.

Thinning everything via capistrano took a while, that wasn't as well documented.  Thin was documented, capistrano was documented, but easy solutions as to how to combine the two were difficult to find.

Here's the solution I was able to come up with -

Capistrano

My config for using mongrel used to look something like this -

[code lang="ruby"]
set :stages, %w(staging production)
set :default_stage, "production"

require "capistrano/ext/multistage"
require "mongrel_cluster/recipes"

set :application, "myapplication.com"
set :user, "appuser"set :repository,  "http://svn.myapplication.com/myapp/trunk"
set :deploy_to, "/var/www/#{application}"

role :app, application
role :web, application
role :db,  application, :primary => true

set :runner, user
set :keep_releases, 3
set(:mongrel_conf) { "#{current_path}/config/mongrel_cluster.yml" }

deploy.task :after_update_code, :roles => [:web] do
desc "Copying the right mongrel cluster config for the current stage environment."
run "cp -f #{release_path}/config/mongrel_#{stage}.yml #{release_path}/config/mongrel_cluster.yml"
end

...
[/code]

Now that we are moving from mongrel to thin, no need for two lines in particular, one being the line that requires mongrel_cluster recipes and the other that sets the mongrel_cluster yaml config path.  A third line changes from mongrel_cluster.yml to thin_cluster.yml.  You get something like this:

[code lang="ruby"]
set :stages, %w(staging production)
set :default_stage, "production"

require "capistrano/ext/multistage"

set :application, "myapplication.com"
set :user, "appuser"

set :repository,  "http://svn.myapplication.com/myapp/trunk"
set :deploy_to, "/var/www/#{application}"

role :app, application
role :web, application
role :db,  application, :primary => true

set :runner, user
set :keep_releases, 3

deploy.task :after_update_code, :roles => [:web] do
desc "Copying the right mongrel cluster config for the current stage environment."
run "cp -f #{release_path}/config/thin_#{stage}.yml #{release_path}/config/thin_cluster.yml"
end
...
[/code]

Now we need to implement what mongrel recipes was doing for us, start, stop and restart but in terms of thin (added this to the bottom of my deploy.rb):

[code lang="ruby"]
namespace :deploy do
desc "Restart the Thin processes on the app server."
task :restart do
run "thin restart -C #{release_path}/config/thin_cluster.yml"
end
desc "Start the Thin processes on the app server."
task :start do
run "thin start -C #{release_path}/config/thin_cluster.yml"
end
desc "Stop the Thin processes on the app server."
task :stop do
run "thin stop -C #{release_path}/config/thin_cluster.yml"
end
end
[/code]

Here's what my thin_cluster.yml looks like:

[code lang="ruby"]

---
log: log/thin.log
address: 127.0.0.1
port: 9000
chdir: /var/www/myapp.com/current
environment: production
pid: tmp/pids/thin.pid
user: www-user
group: www-data
servers: 3
[/code]

That's it and it has worked out nicely so far.


05 Sep

Biking to work


elevation_ride_to_work

I started biking to work every day (approximately 6 miles one-way), and every morning it is a breeze, it takes about 15 - 20 minutes.  On the way back home, it is near impossible, and takes 45 - 60 minutes.  bikely's got this awesome tool that will show you the elevation for your route.  According to the graph I climb 134 ft on the way to work, and descend 594 ft, but on the way home it is reversed and boy do I feel it.

I bought my bike out of my work's classifieds for $30 USD and in the first 2 weeks of biking to and from work, I have had to do a number of things to my bike.   I didn't realize it for the longest time but my back tire had a slow leak and was sitting at about 20 psi, which was no big deal on the way to work, but made it pretty difficult to get home.  My tires are now both around 55 - 60 psi.   I also spent a good couple of hours learning about derailleurs, cogs, chainrings, sprockets, etc ....  My bike would jump gears, slip gears, fail to shift at all, it was a mess.  But I love it now - free exercise and I don't have to deal with too much traffic.

Here's my bike -

gt_timerline

It is a GT Timberline (8-10 years old), all tuned up now and looking good, I have definitely gotten my money's worth.


4 Responses Filed under: biking, me Tags: , ,