July 12, 2012

FreeBSD sqlite3 gem install problem


This guy knows what's up:


$ gem install sqlite3
Building native extensions.  This could take a while...
ERROR:  Error installing sqlite3:
        ERROR: Failed to build gem native extension.


        /.../.rvm/rubies/ruby-1.9.2-p290/bin/ruby extconf.rb --with-sqlite3-include=/usr/local/include
checking for sqlite3.h... yes
checking for sqlite3_libversion_number() in -lsqlite3... no
sqlite3 is missing. Try 'port install sqlite3 +universal'
or 'yum install sqlite-devel' and check your shared library search path (the
location where your sqlite3 shared library is located).
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers.  Check the mkmf.log file for more
details.  You may need configuration options.


Provided configuration options:
        --with-opt-dir
        --without-opt-dir
        --with-opt-include
        --without-opt-include=${opt-dir}/include
        --with-opt-lib
        --without-opt-lib=${opt-dir}/lib
        --with-make-prog
        --without-make-prog
        --srcdir=.
        --curdir
        --ruby=/home/cap/.rvm/rubies/ruby-1.9.2-p290/bin/ruby
        --with-sqlite3-dir
        --without-sqlite3-dir
        --with-sqlite3-include=${sqlite3-dir}/include
        --with-sqlite3-lib
        --without-sqlite3-lib=${sqlite3-dir}/lib
        --enable-local
        --disable-local
        --with-sqlite3lib
        --without-sqlite3lib




Gem files will remain installed in /.../.rvm/gems/ruby-1.9.3-rc1/gems/sqlite3-1.3.6 for inspection.
Results logged to /.../sqlite3-1.3.6/ext/sqlite3/gem_make.out


$ gem install sqlite3 -- --with-sqlite3-dir=/usr/local
Building native extensions.  This could take a while...
Successfully installed sqlite3-1.3.6
1 gem installed
Installing ri documentation for sqlite3-1.3.6...
Installing RDoc documentation for sqlite3-1.3.6...


$ fortune

February 27, 2011

Salon sends all of your clicks to Chartbeat

I'm an idle clicker. I'm always making sure the windows I'm looking at is the frontmost one, or just clicking to the side because something else stole focus and now the page won't scroll with my mousewheel.

Today while reading Salon I noticed that a little hourglass (or spinner, etc.) would show up when I clicked on any whitespace on the page. Given that popunder ads are at epidemic proportions these days, I wonder if this is related, a bug in AdBlock, or what. I bust out Wireshark and lo and behold, I see the following:

GET /ping?h=salon.com&p=[page being clicked on]&u=vanlgrt044uytfp6&d=salon.com&g=1614&n=0&c=4.75&x=3200&y=6963&w=855&j=30&R=1&W=0&I=0&t=f5gb7u5f6c7246dy&_ HTTP/1.1
Host: ping.chartbeat.net
Connection: keep-alive
Referer: [page being clicked on]
Accept: */*
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.13 (KHTML, like Gecko) Chrome/9.0.597.98 Safari/534.13
Accept-Encoding: gzip,deflate,sdch
Accept-Language: en-US,en;q=0.8
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3

This bugs me. I know why they're doing it, but believe me, Salon is not shy about implementing user-hostile advertising and I have been annoyed of late by their persistent modal (page-blocking) ads. Reasonable minds differ, but I have decided that Salon is persona-non-grata when it comes to their advertising ethics. They're being lazy, they could do better, and I will feed them as little usable data as I can control beyond a basic pageread from now on.

Salon puts the codepull in after their Google Analytics junk:

var _sf_startpt=(new Date()).getTime();
var _sf_async_config={uid:1614,domain:document.location.host};
window._sf_endpt=(new Date()).getTime();
var e = document.createElement('script');
e.setAttribute('language', 'javascript');
e.setAttribute('type', 'text/javascript');
e.setAttribute('src',
(("https:" == document.location.protocol) ? "https://a248.e.akamai.net/chartbeat.download.akamai.com/102508/" : "http://static.chartbeat.com/") +
"js/chartbeat.js");
document.head.appendChild(e);
This means that you can get by with by putting the following in your hosts file:
127.0.0.1 static.chartbeat.com chartbeat.download.akamai.com
That's
/etc/hosts
on OSX and unixlikes, and on Windows (typically)
c:\windows\system32\drivers\etc\hosts
Unfortunately, hosts files appear to be the only way of dealing with this currently. They hide the codepull for this feature in the HEAD tag like you would with Google Analytic code, so you have to use your hosts file due to code included on a page this way not showing up in AdBlock's "open blockable items..." feature.

November 16, 2009

thought for the day

Ever notice how many Rails developer blogs use Wordpress?

November 10, 2009

Rails Sortable Draggable params

Went around in circles a bit today implementing a barely-fancy list-to-list drag 'n sort. I don't do much Ajax usually, so I tend to lose my place, forget little things, and basically keep my Googling skills in tip-top shape to make up for my shoddy memory.

Anyway, enough backstory. You gotta use a word when id'ing your elements in sortable_element. It doesn't even matter what you use:

<li id="adfasjkd_<%= partialname.id %>">

(or however you're generating unique IDs for your LIs)

...as long as you have <ul id="flarfydarf">, Rails seems to be smart enough to chop whatever is not unique in the LI ID and throw it into params[:flarfydarf].

There are plenty of older tutorials out there with regexes in js functions inside the Ajax business, but I don't have any of that and Rails is finding my IDs just fine. Go figure.

May 26, 2009

Classics in autodidacticism

Is this supposed to be usable? Just sayin'.

March 21, 2009

Doing it right, part 1

Just so I don't just come off as a cantankerous fool, I'm posting about AuthLogic, an authentication plugin for Rails. I haven't used it yet, but looking at their github page it seems apparent that they value decent documentation. Much better than the two-line READMEs that too many projects throw up there.

March 11, 2009

Where I start to wonder

Someone should write a guide on rehoming webpages.