RIP Troggie

Blog

Years ago, when I started travelling a lot (for talks and for fun), Mom handed me a small green frog, named her Troggie, and asked me to keep her with me when I travel. Troggie has been a constant companion, hanging out in the lower small pocket of my blue backpack, coming out and having her picture taken when we were in spectacular locations.

She's been to New Zealand with me. She's been to Tanzania with me. She's been to Zanzibar with me. She's been to Portland with me. She's been to Canada with me. She went to Twitter with me. She's been to Ireland with me. She's been to Indiana with me. She's been to Brooklyn with me. She's been to Phoenix with me. She's gone on a cross-country trip with me and my brother. She's been to Australia with me. She's been to Argentina with me, in an attempt to visit Antarctica.

Aaaaaaaand, she's been to Scotland with me.

This is my last photo of Troggie. She was posing with the Edinburgh Castle in the background.

Troggie in Edinburgh

I took pictures of Troggie in all of these places, sending them to Mom. Some of the pictures were amusing (in the palm of the outstretched hand of a statue of a famous dignitary is one of my favorites), most were just Troggie.

Two weeks ago, Troggie hitched a ride in a jacket pocket, then snuck out when I was walking back to my hotel before Scotch on the Rocks, in Edinburgh. I kept hoping she'd turn up, once I noticed her missing. I hoped she had snuck back into one of my bags when I wasn't looking. Today, I admitted defeat.

She's gone.

I am le sad. I hope she's having a good time in Edinburgh, and that the next person who hangs out with her goes on a large number of adventures with her, too.

Yes, please, feel free

Blog

I swear, the 4th most famous last words are, "How hard can it be?"

When I read something like this (go ahead, read the whole post):

"The conference was a joke. You're a ridiculous outfit and I could do a better job in a fraction of the time and cost."

I have to take a deep breath, look down, shake my head, look up, and either burst into laughter or attempt to suppress that laughter. I have to do these things, because the only people who could possibly say these words are the people who HAVE NEVER DONE IT (where IT is defined at organizing and coordinating whatever the organized event is).

When I was running SBUL and MPUL, people would complain about this or that, about how unbalanced the teams were, about how I wouldn't let the teams play when the ground was too wet, about how the bathrooms weren't open or the lights were turned off too early, about how much the league cost, or about I don't know, pick something. Yes, the leagues were balanced on paper but life/injuries/sandbagging happens, we'd lose the fields forever if we played on them when they were wet, the bathrooms were open you went to the wrong ones, the lights went off exactly on schedule, and yes, field maintenance costs money, suck it up. No bit of logic would dissuade these people from complaining to a bunch of volunteers who spent their time helping CREATE SOMETHING THAT DIDN'T EXIST BEFORE, and existed because they wanted it to exist.

Fast forward to Hacker Dojo. Now THERE was a lesson in how many different ways I can keep a smile on my face while people complain about things that really didn't matter much in the grand scheme of things, all while getting kicked in the teeth in the end. Or Ignite Silicon Valley where a woman complained that the free-for-her event that I paid for and was organizing WASN'T SERVING DINNER.

The people who complained were invariably the people who have never managed an event, never created something from nothing for others because they wanted that something to exist, never been on the receiving end of two hundred people all asking for "one small thing, it shouldn't take long." They had never walked that mile in the organizers shoes, never understood death by a thousand cuts.

So, when I read something like the quote above, I see myself standing like Kris, one hand on my hip, the other hand on the bill of my baseball hat, looking down as I push the hat up and rub my forehead with the back of that upper hand, shaking my head slightly, a smirking grimace on my face. I see myself putting my hat back on my head, looking up, and echoing Andy Allan's words, "All I can say to you is please, feel free."

Postfix check_recipient_access with MySQL

Blog

Having a list of rejecting email addresses in a DB table makes adding them easy (add via command line insert, add via script, add via email trigger, add via desktop SQL app like Sequel Pro, add via web app), removing the need for root access to edit configuration files and restart the postfix process that may happen when hashed files are used.

This is what I did, without a list of why I did it, or how I ended up with this particular solution:

In my /etc/postfix/main.cf file, I have this entry in my list of smtpd_recipient_restrictions values:

  check_recipient_access mysql:/etc/postfix/mysql-virtual-recipient-access.cf

This says, check the recipient address by executing the SQL query specified in /etc/postfix/mysql-virtual-recipient-access.cf using the mysql credentials in the same file.

My whole smtpd_recipient_restrictions section looks like, this, but your mileage will vary:

smtpd_recipient_restrictions =
  permit_sasl_authenticated,
  permit_mynetworks,
  reject_unauth_destination,
  reject_unknown_sender_domain
  reject_invalid_hostname,
  reject_non_fqdn_hostname,
  reject_unknown_recipient_domain,
  reject_unknown_helo_hostname,
  check_recipient_access mysql:/etc/postfix/mysql-virtual-recipient-access.cf

For the mysql query to work, I needed my table. I created my mysql table with this command:

CREATE TABLE `virtual_sender_access` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `source` varchar(256) NOT NULL DEFAULT '',
  `access` varchar(128) NOT NULL DEFAULT '',
  `created_on` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
  `last_modified` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB;

Where the fields are id to track unique entries, source is the email address (using the conventions from other tables that are defined in a whole bunch of tutorials for the virtual domains, aliases, and users), access is what I'm going to do with the email address: deliver it, reject it, drop it, etc. as allowed in the access(5) values on http://www.postfix.org/access.5.html.

I nearly always use created_on and last_modified in my tables, as a way to track changes. You can totally leave those out if you don't care about them or have a different logging mechanism.

I have the table, I have the configuration, now the query.

In my mysql-virtual-recipient-access.cf, I have this:

user = lookupuser
password = *********************
hosts = 127.0.0.1
dbname = postfix
query = SELECT access FROM virtual_sender_access WHERE source='%s'

Now, all of this you likely could have gotten from the other tutorials around the web. The problem I had when setting this thing up with my mail server was *what do I put IN the database table*?

Right.

Put in this to reject an address:

INSERT INTO virtual_sender_access (source, access, created_on) VALUES ('reject@example.io', 'REJECT', NOW());

Put in this to accept an address and deliver it:

INSERT INTO virtual_sender_access (source, access, created_on) VALUES ('accept@example.io', 'OK', NOW());

Follow along with the other tutorials for the rest of the configuration, restart your postfix server with something like "service postfix restart" and check your queries and tables are all setup correctly. I tested by sending email to an address I wanted rejected, as listed in my virtual_sender_access with a REJECT code, and watching it be rejected. I then sent an email to an address NOT listed in the table, and it was delivered. I considered this a success. I would not recommend that as the correct way to test if a system is working.

Apache config for redirect from www to just domain

Blog

You can use a VirtualHost directive to redirect from www.example.com to example.com at the Apache level

# redirect www to no-host
<VirtualHost *:80>
  ServerName www.example.io
  Redirect permanent / http://example.io
</VirtualHost>

# redirect SSL www to no-host
<VirtualHost *:443>
  ServerName www.example.io
  Redirect permanent / https://example.io
</VirtualHost>

That second one will likely fail unless you have the SNI (Server Name Indication) TLS extension on your server.

Then, include the rest of your Apache configuration as normal:

<VirtualHost *:80>
  ServerName example.io
  ServerAdmin hello@example.io
  DocumentRoot /var/www/example.io/html/
  ErrorDocument 404 /404.html
  ErrorDocument 403 /403.html
  ...
</VirtualHost>
...

Not Quite "How Things Work"

Blog

When I was a kid, I had a book that describes how things work. It was not the current The Way Things Work, by David Macaulay, that is (rightly) popular these days. It was an oversized book, huge in my small hands; which means that it was likely the 14" x 12" size. It had a hardback cover, wasn't very thick, and was incredibly fascinating. I remember reading it over and over and over again.

I also remember being fascinated by the last entry in the book: "What is a Computer?"

I struggled to pronounce the word computer. I am clearly not a digital native, though I like to believe I'm keeping up well with current technologies. Digital wasn't in my vocabulary at that young age.

What I remember most about the "What is a Computer?" page is the illustration of the computer. It had 4-5 people working on it, it was the size of a small room, with lots of box sections, lights and buttons.

I, perhaps incorrectly, recall the blurb on the page described the computer, explained what it did and why it was great, and had the prediction that future computers would be smaller. Oh, boy, are they smaller!

I've looked for the book, and failed to figure out what the title of the book really is. I recall it only vaguely, I remember reading it in my brothers' bedroom, where, oddly, I recall reading most of my books. I have no idea why that is, why I recall reading books in their room, given I was the one who read the most of the three of us and could probably read just as easily in my bedroom as theirs.

That last page, though, "What is a computer?", just cracks me up. I was mesmerized by the puzzle of it, the one thing in the book I couldn't understand. The one thing in the book that stuck with me.

Pages