News

After git pull in a new development suburb

Added by Matt Platte over 1 year ago

Random notes

  • Title that begin with QT will not attempt to update twitter status. This should let the development machine actually start serving pages.

Get that new OAuth thingy to working

What I Did On My Holiday Break

Added by Matt Platte about 2 years ago

Hirb is terrific!

I've been wanting to build a traffic-tracker into triopticon.com just for the heck of it. Underneath this idle wish is a faint frustration with log files. I've always used an Apache Proxy to bounce requests to and fro which causes all requests in production.log to look like they're from portsmouth, while the useful traffic data is over there in the Apache log file. I'm too lazy to get awstats organized (more about that directly, in the Systems Administration project); besides, this is more fun.

The code is simple enough:

  before_filter :guest_list, :only => [:index, :show]
  def guest_list
    @visitor = Visitor.new
    @visitor.ip = request.remote_ip
    @visitor.url = request.path
    @visitor.save!
  end

But all the entries are from portsmouth! Dang. Time for Phusion Passenger/mod_rails and boy was that ever easy! I've set this up a couple of times on Edison for development, and for some odd reason figured it would be complicateder on the server. Not so.

And isn't Hirb wonderful?

Loading production environment (Rails 2.3.4)
>> require 'hirb'
=> true
>> Hirb.enable
=> true
>> Visitor.all
+----+-----------------+--------+-----+--------------------------------+--------------------------------+
| id | ip              | domain | url | created_at                     | updated_at                     |
+----+-----------------+--------+-----+--------------------------------+--------------------------------+
| 1  | 000.000.000.204 |        | /   | Tue Dec 29 14:16:22 -0600 2009 | Tue Dec 29 14:16:22 -0600 2009 |
| 2  | 000.000.000.204 |        | /   | Tue Dec 29 14:16:34 -0600 2009 | Tue Dec 29 14:16:34 -0600 2009 |
| 3  | 000.000.000.204 |        | /   | Tue Dec 29 14:16:40 -0600 2009 | Tue Dec 29 14:16:40 -0600 2009 |
| 4  | 000.000.000.204 |        | /   | Tue Dec 29 14:20:45 -0600 2009 | Tue Dec 29 14:20:45 -0600 2009 |
| 5  | 000.000.000.205 |        | /   | Tue Dec 29 14:36:00 -0600 2009 | Tue Dec 29 14:36:00 -0600 2009 |
| 6  | 000.000.000.205 |        | /   | Tue Dec 29 14:36:08 -0600 2009 | Tue Dec 29 14:36:08 -0600 2009 |
+----+-----------------+--------+-----+--------------------------------+--------------------------------+
6 rows in set
>> 

Note: 000.000.000.204 is portsmouth and 000.000.000.205 is the public IP of my internal network.

FakeWeb - for when you want to be a little quieter

Added by Matt Platte over 2 years ago

http://rubyforge.org/forum/forum.php?forum_id=33333 is the location. Fake Web. use it.

3320

Added by Matt Platte almost 3 years ago

In case we forget

Also available in: Atom