The Eclectic Quill

Website of Joshua McGee

By

God is nowhere to be found

Now you've got both sides claiming 'killing in god's name', but god is nowhere to be found, conveniently. -- Eddie Vedder

Now you've got both sides claiming "killing in god's name", but god is nowhere to be found, conveniently.  — Eddie Vedder

By

Use nginx to block referrer spam from Semalt and others

If you run a website, you have surely seen an increase in referrer spam lately.  In this type of spam, an organization will fake the Referer header of an HTTP request so that the webmaster will notice the spammer.  However, this throws off your site analytics and taxes your server, because each request sends the spammer a full copy of the page.

Semalt — a fake SEO tool that has hijacked a botnet for its spam — is currently the worst offender, but there are plenty of others.

If you use nginx to serve your webpages (or use it as a proxy to Apache), however, you can detect these referrers and block them across all your sites.

To begin, create a directory for global nginx rules:

sudo mkdir /etc/nginx/global
sudo pico /etc/nginx/global/referer-spam.conf

Paste the following into the editor, save, and exit:

##
# Referrer exclusions
##

if ($http_referer ~ "(semalt\.com|buttons-for-website\.com)") {
  set $prohibited "1";
}

if ($prohibited) {
  return 403;
}

The preceding configuration blocks semalt.com and buttons-for-website.com, two major offenders, but you can block whatever referrers you like.  The regular expression syntax is to take the hostname, escape all periods with a backslash, join them with a vertical bar character, and surround them with parentheses.

Then, in each site's configuration file, add the following line:

server {
  … all the stuff that's there already …

  include /etc/nginx/global/*;
}

Yes, it's kind of a pain that you have to repeat this for every site, but you can reuse this in the future by putting new global directives in the /etc/nginx/global/ directory.  If you have a site template file, I recommend adding the above line to it.

Then restart nginx:

sudo service nginx restart

... and you should be good to go.

By

Albert Einstein on race relations

mcgeekiest-einstein-i-do-not-intend-to-be-quiet

In 1946, Albert Einstein spoke at Lincoln University in Pennsylvania, the first university in the United States to grant college degrees to blacks.  In his remarks, he offered this powerful observation:

"There is a separation of colored people from white people in the United States. That separation is not a disease of colored people. It is a disease of white people. I do not intend to be quiet about it."

(Source: Ken Gewertz, Harvard Gazette)

By

5 Sites I Wish I Had Built

As a web developer, sometimes you stumble upon sites that are so perfect in conception and implementation that you start kicking yourself for not having thought to build them yourself.  Here are my entries for sites I wish I had created.

camelcamelcamel

Site premise:  Let users add Amazon items to track.  Ask them what they are willing to pay.  Watch Amazon for price changes.  When the item is suitably discounted, send them an email.

It's super-easy-to-use.  The emails they send contain a graph of historical pricing data.  And the link to the item has an Amazon affiliate ID embedded, so that the creators of the site are making a slice of the profits.  Glorious.

ANAGRAMATRON

Site premise: Watch the Twitter API.  Look for tweets that are anagrams of each other.  Review them, and when you find a poignant pair, post them.

I love anagramsI love the Twitter API.  Why didn't I think to combine them?  Go check the site.  There are amazing pairs of tweets.

TinEye Multicolor Search Lab

Site premise: Scrape Creative Commons images.  Hash their colors, and store in a database.  Let users specify a color scheme, and show them the matching images.

This site is utterly brilliant.  Under the covers, I'm sure it works much like my site TileArray.  I love using it, and the love is only slightly reduced by the fact that I facepalm that it's not my code.

Six Minute Story

Site premise:  Post a writing prompt.  Give a writer six minutes to compose a new piece of flash fiction.  Prevent them from editing the story after the time elapses, and publish the results.

It's fun to write and fun to read others' works.  And after discovering and contributing to the site, I've become friends with the creator, who is a really neat guy.

Where's George?

Site premise:  Let users enter the serial numbers from American paper money.  Tell them to write the site URL on the bills and spend them.  When another person finds a bill, they will be curious about the website, visit, and enter the serial number themselves, and users can watch how currency travels.

I didn't think of this one, but I was hugely into it in the late '90s and into the 2000s.  I used to be ranked #11 on the site, and designed the algorithm (the "George Score") used to determine competitive rankings on the site.  Still wish I'd thought of it, though.

By

Vedder Tuesday XL

The song "Future Days" from Lightning Bolt contains one of my favorite Vedder lyrics of all time: "All my stolen missing parts I’ve no need for anymore".  It's such a profound statement on the healing effects of a loving relationship.  I certainly understand.

Future Days

If I ever were to lose you
I'd surely lose myself
Everything I have found dear
I’ve not found by myself

Try and sometimes you'll succeed to make this man of me
All my stolen missing parts I’ve no need for anymore

I believe and I believe ‘cause I can see
Our future days, days of you and me

Back when I was feeling broken
I focused on a prayer
You came deep as in the ocean
It's something I can't hear

All the complexities and games, no one wins but somehow they're still played
All the missing crooked hearts, they may die, but in us they live on

I believe and I believe ‘cause I can see
Our future days, days of you and me

When the hurricanes and cyclones rage
When winds turn dirt into dust
When floods they came and the tides they raised,
Ever closer became us

All the promises at sundown
I met them like the rest
All the demons used to come round
I'm grateful now they've left

So persistent in my ways
Angel I am here to stay
No resistance, no alarms
Please this is just too good to be gone

I believe and I believe ‘cause I can see
Our future days, days of you and me
You and me
Days of you and me