Chris Hardiehttps://chrishardie.com
looking for a better way
Mon, 18 Mar 2019 02:07:19 +0000 en-US
hourly
1 https://wordpress.org/?v=5.1.1https://chrishardie.com/wp-content/uploads/2015/02/web-icon-512x512-54cee75av1_site_icon-32x32.pngChris Hardiehttps://chrishardie.com
3232Better WordPress multisite image URLshttps://chrishardie.com/2019/03/wordpress-multisite-image-urls/
https://chrishardie.com/2019/03/wordpress-multisite-image-urls/#respondMon, 18 Mar 2019 01:58:47 +0000https://chrishardie.com/?p=4817I've been running a personal WordPress multisite instance for several years now, and I use it to host a variety of personal and organizational sites, including this one. I really like the ways it allows me to standardize and consolidate my management of WordPress as a tool, while still allowing a lot of flexibility for … Continue reading Better WordPress multisite image URLs

]]>I've been running a personal WordPress multisite instance for several years now, and I use it to host a variety of personal and organizational sites, including this one. I really like the ways it allows me to standardize and consolidate my management of WordPress as a tool, while still allowing a lot of flexibility for customizing my sites just as though they were individual self-hosted sites.

The one exception to this has been the URL structure for images and other attachments that I upload to any site hosted on this multisite instance. Whereas the typical WordPress image URL might look like this:

https://example.com/wp-content/uploads/2019/03/my_image.jpg

on a multisite instance, there is an directory structure added in to separate each site's uploads into its own subdirectory:

https://example.com/wp-content/uploads/sites/25/2019/03/my_image.jpg

where 25 might be the site's unique site ID within that multisite setup.

There's nothing wrong with this approach and it certainly makes technical sense if you have lots of sites on your multisite instance that are either subdirectories or subdomains of the main multisite domain.

But I don't like it because it means my individual sites start to have their post content and other fields (options, post meta) "polluted" with attachment URLs that are specific to this particular hosting environment; the individual site ID and the use of multisite at all.

One of the great benefits of WordPress is that you can move a given site between hosting environments and, assuming you're using best practices to start with, assume that everything will still work as expected and point to the right place. Yes, there are some relatively easy ways to clean this up after a hypothetical move to another, non-multisite environment, but I prefer solutions that make the day-to-day experience more standard instead of requiring exceptional workarounds or cleanup.

Fortunately in the case of using mapped domains, we have another way to help WordPress identify which subdirectory in the uploads directory structure we're trying to fetch an image from, and so it provides an opportunity to simplify and standardize the attachment URL structure.

(Please beware any solution to this issue that involves changing the actual upload directory destination, modifies WordPress core files, or anything else that might break the underlying functionality of your sites now or after future upgrades.)

There are two parts to this:

Make your webserver (in my case, nginx) serve images from both the multisite attachment URL structure and the non-multisite URL structure, in the case of a mapped domain.

Make WordPress use the simplified, non-multisite URL structure anywhere it can.

Serving attachments from both URL structures

To tell nginx to use both URL structures in the case of an attachment URL on a site with a mapped domain, there are a few steps.

First, create an nginx configuration map that lets nginx know about the relationship between a mapped domain name and the internal numeric ID that WordPress uses for each site in a multisite instance. The easiest way to do this in my experience is with the Nginx Helper plugin from the folks at rtCamp. One of its features is to automatically generate and update an nginx-friendly mapping every time you add or remove a site from your multisite instance. Just check the "Enable Nginx Map" checkbox and you should find a new file available in wp-content/uploads/nginx-helper/map.conf.

Now, you need to tell nginx to use this map file in its configuration:

In the context of a single site that nginx is serving, this will now set the $blogid nginx variable with the internal ID that WordPress uses to identify that site. Using that information, we can tell nginx to try serving a non-multisite version of an attachment URL:

In other words, if I'm on $blogid 25 and https://example.com/wp-content/uploads/2019/03/my_image.jpg doesn't already exist naturally, then try to find it in the directory and file location /wp-content/uploads/sites/25/2019/03/my_image.jpg instead.

Making this change doesn't hurt anything and won't change how your sites operate, but sets us up for the next step where we modify how WordPress behaves.

Tell WordPress to use the simpler URL structure

Now we need to tell WordPress that on sites with mapped domains, it can use the simpler URL structure.

I do this using a "must-use" plugin on my multisite setup that does two main things: rewrite the URL to use the mapped domain instead of the multisite subdomain, and rewrite the URL further to remove the reference to /sites/25/ (or whatever the number might be).

Again, because we're not changing the behavior of the internal WordPress file uploading functionality or filesystem structure, nothing about the core attachment management is any different; just the way WordPress generates the attachment URLs that the rest of the world sees.

Cleaning up old URL references

If you have a perfectionist streak like me, you might now also want to go back and update the attachment URLs that use the multisite version so they use the non-multisite version. Here are the WP CLI commands I used to do this for a single site:

]]>https://chrishardie.com/2019/03/wordpress-multisite-image-urls/feed/0Losing my parentshttps://chrishardie.com/2019/03/losing-my-parents/
https://chrishardie.com/2019/03/losing-my-parents/#commentsSun, 10 Mar 2019 19:44:25 +0000https://chrishardie.com/?p=4797One morning recently as my preschooler daughter climbed in to her customary spot for breakfast, she remarked out of nowhere, "now you don't have any family left!" It only took a moment to clarify that she was putting together my mom's recent death with knowing my dad had died when I was 10 years old, … Continue reading Losing my parents

]]>One morning recently as my preschooler daughter climbed in to her customary spot for breakfast, she remarked out of nowhere, "now you don't have any family left!"

It only took a moment to clarify that she was putting together my mom's recent death with knowing my dad had died when I was 10 years old, and realizing both of my parents were gone. She said it in the same way as when she notices that furniture is unexpectedly repositioned or that some part of her bedtime routine is missed, seemingly unaware of the emotional content of her observation.

Dad and Mom, being silly, before.

In that moment I mostly parented through (around?) the emotion by further clarifying with her that of course I still have family, between her and my wife, my sister and her family, my wife's family, my various aunts, uncles, cousins, nieces and nephews, the many friends who have become chosen family to us, and on and on.

Part of me wanted to show my daughter just how long the list was, so that I could simply reaffirm to myself that I am not without family.

But the awareness of being without both parents haunted me through the rest of the day and into that night's dreams. I guess it's been haunting me on and off for the last three months after saying goodbye to my mom. Maybe in some ways the prospect of it has been haunting me for more than 30 years after my dad's death.

His passing from cancer felt earth shattering in its own ways at the time. The loss of someone so central to my every day existence. The many questions it raised about life and death, health and sickness, joy and pain. The fears about if and when I would die, or when other people I loved might go away. Apparently, as we were walking out of the hospital wing where he died, my 10-year-old self looked at the cars going by as life continued around us and said something to the effect of, "I just can't believe the world is still going on."

And so my mom, sister and I grieved and cried and clung to each other through the hardest times we had known. With many years of counseling, reflection, distraction, community support and sheer will, we found our ways forward. The grief has never fully gone away and the experience has shaped and defined me since, but the sharpness of the pain and sadness tapered off. As 10-year-old me became 20- and 30- and 40-year-old me, the death of my father became mostly a thing that was behind me.

I don't think the emotions of that time were simple, but confronting the declining health and then death of my remaining parent as an adult has felt incredibly complex. In the 30 years since he died, my mom came to play so many different roles in my life:

A single parent doing her best to raise my sister and I while working long hours to provide for us.

A complex person on her own journeys of seeking love, friendship and companionship after losing the love of her life.

A firm but loving guide through my teenage years. (Whether it was learning to drive, choosing a college or bringing home someone I was dating, she'd keep the white-knuckled grip of parental fears and concerns as hidden as she could while offering calmer words of support and guidance out loud.)

A successful business professional who modeled high standards and ferocious but kind leadership, and who encouraged me constantly in my own entrepreneurial endeavors. (The number of women who said at her memorial service that mom had given them their first real job and mentored them through the start of their careers left me speechless.)

A friend to my wife and a loving supporter of our marriage.

A grandparent to my daughter, showering her with love and gifts and silliness and craft project ideas that made a deep and lasting impression on all of us.

A cancer patient braving experimental treatments while trying to figure out what indignities she could tolerate in the name of extending life.

A world traveler. An excellent writer. A generous volunteer and non-profit supporter. A dear friend to many.

I encountered my mom through all of these lenses and more. As an adult I felt more acutely aware than I could with my dad of all the things that the world would be losing when she was gone; even after her death I'm still learning of new ways she made a difference in someone's life. And as a parent myself now, I can't stomach the thought of watching my kid watch me die.

There's no good or right way to say goodbye to our parents. I'm grateful that I had the chance at all, and that they were grounded in love and mutual adoration both times. I know for many, they don't or it's not.

It's even easy to trick myself into thinking I know more about how to handle this loss and grief, as a 41-year-old who has been through it too many times with family and friends gone from cancer, other illness, accidents or suicide. As I explain "the kind of sickness that doctors can't make go away" or "won't be able to visit again but always in our hearts" to a three year old, or as I navigate legal and financial things with mom's estate, or think about how different I am from 10-year-old me, it's tempting to claim a level of wisdom and perspective for myself that might just make it all easier somehow.

But no.

Yesterday as I stood over my mom and dad's adjacent graves, crying in the cold rain as I visited for the first time since we buried mom's ashes in December, it was just 10-year-old me again. Reliving the best and worst moments. Sobbing at the sense of loss, angry at their cancers, wishing they were still here, wondering who will take care of us, trying to know that things will be all right.

]]>https://chrishardie.com/2019/03/losing-my-parents/feed/6Moving photos from Flickr to WordPresshttps://chrishardie.com/2019/02/moving-photos-flickr-wordpress/
https://chrishardie.com/2019/02/moving-photos-flickr-wordpress/#commentsWed, 20 Feb 2019 04:34:48 +0000https://chrishardie.com/?p=4781If you're ready to move your own Flickr photo collection to WordPress and feel comfortable on the command line, you can go straight to the Flickr to WordPress tool I built and get started. Here's some backstory: I used to love Flickr as a place to store photos, and as a community for sharing and … Continue reading Moving photos from Flickr to WordPress

]]>If you're ready to move your own Flickr photo collection to WordPress and feel comfortable on the command line, you can go straight to the Flickr to WordPress tool I built and get started. Here's some backstory:

I used to love Flickr as a place to store photos, and as a community for sharing and discussing photography. But as its ownership changed hands and its future became at times uncertain, I grew reluctant to trust that it could continue to be a permanent home for my own photos. My discomfort increased as I have become more engaged with the need to have full ownership over the things I create online.

So, I set out to migrate my 3.6GB collection of 2,481 Flickr photos, along with their tags, comments and other metadata, into a new home while I still could.

Why WordPress

As someone who works with a WordPress hammer daily I know I'm in danger of seeing every technical need as another nail to hit. But as a content management tool with advanced image handling capabilities, WordPress really is a great foundation for what is essentially photoblogging.

There are an increasing number of WordPress themes that do an excellent job of featuring collections of images. I use a modified version of Fukasawa by Anders Norén but will probably switch to his similar Koji theme soon; Photo Blog is also a good option if you're on WordPress.com. (Full disclosure, I work for Automattic, the company that operates WordPress.com.)

WordPress is doing a great job these days of displaying just the right image size for just the right mobile or desktop viewing scenario, and so things like responsive design and good image performance mostly come out of the box.

The free WordPress mobile app makes it pretty straightforward to get a photo you've just taken on your iOS or Android smartphone into a WordPress instance. On my iPhone it has a share extension so I can do it right from the Photos app.

Most importantly, I know that putting my photos in WordPress means I have ultimate portability for the future. I can keep them on my self-hosted WordPress site now and move them to another host later. I can browse them and share them without worrying about my personal data being sold to others or my activity being used to promote related products or services. No one's terms of service, revenue model or changing business leadership is going to affect my ownership and control over my photo collection.

If there's a downside, it's the absence of the network effect that comes with photo sharing communities like Flickr or Instagram. People will be less likely to stumble upon my WordPress-hosted photos than they would if I used one of those services, but I'm okay with that trade-off for now.

Picking/Building a Migration Tool

I'm thankful that Flickr still makes available a very robust API and so I knew that a worst case scenario would be building my own migration tool from scratch. But I didn't want to start there.

My colleague Beau Lebens had already written a plugin, Keyring Social Importers, that uses the Flickr API to continuously fetch Flickr photos into WordPress posts, and I started building a migration process around it. I hit a few snags and submitted some fixes for some of them, and lost momentum. (This doesn't mean it's not a great tool; it is, and I think with the right bits of polish it could actually be the best tool for helping people make this move.)

Flickr's bulk export result after I requested it in my profile.

I knew that even if the import plugin approach above worked, it could take many hours or days to download and process all of my thousands of photos. So after a hiatus of working on this problem, I started to explore ways to get the images on to a WordPress site all at the same time. And that's when I realized that the bulk export tool that Flickr provides would give me everything I needed to do just that.

After initiating a request in my Flickr account, I soon got access to five zip archives of photo files, and one zip archive of JSON files that contain, among other things, meta data for my photos. On my relatively fast home internet connection, downloading all of these took just a few minutes.

I started crafting a PHP script that would, for each photo in the downloaded archives, grab the corresponding meta data and rearrange everything to fit in to WordPress's way of storing content. It generated a resulting WXR export file that is WordPress's native way of exporting and importing content. It also generated a set of directories and sub-directories of photos in just the right "wp-content/uploads" directory structure that a WordPress site uses, ready for copying on to the server where the site would live.

With those two things, I had everything I needed to populate a freshly installed WordPress site with my photos and their titles, captions, comments, metadata (including EXIF) and more. (There were a few hacks to get around the WordPress importer's default assumption that it will be downloading media from a remote site, but hey what's a few more steps in an already 17-step process?)

The final import took a few minutes on my server, and I had a working site! It was pretty exciting. (I did defer the generation of different image sizes in WordPress until after the initial import, which took a few hours to finish in the background. Thanks as always to Alex Mills for Regenerate Thumbnails.)

Customization and Cleanup

Creating a child theme to support customizations without mangling the original theme.

CSS customizations for the front page to make the images more prominent.

Renaming "posts" to "photos" in the WordPress admin, for more clarity in my workflow.

Creating a custom function that would automatically take the first photo in a new post's content and make the featured image upon publishing, to better support the WordPress mobile app's share extension approach.

Adding photos to RSS feed post content.

And more.

There's still some other cleanup to do. The main thing is finding/replacing all of my historical blog content that embeds Flickr photos with the corresponding photos from my new WordPress photo site. I think I can automate this with the right tools and will be working on that soon.

Feedback Welcome

I realize this migration tool and process is fairly technical and won't be accessible to everyone. And as I say in the README, since I only tested this process on my own Flickr account I'm 99% sure that it will fall apart in some way for other people. If you open an issue with as many details as possible, I will do my best to offer thoughts on how to further improve this tool to help you.

For now I’m happy to have two decades of photos on WordPress. I’m excited to start posting new photos again after a long pause, now done easily and quickly from the same device I take them on. And I'm thankful that my photos live on a platform that I control.

]]>https://chrishardie.com/2019/02/moving-photos-flickr-wordpress/feed/1Hiding authors and users in WordPresshttps://chrishardie.com/2019/01/hiding-authors-users-wordpress/
https://chrishardie.com/2019/01/hiding-authors-users-wordpress/#commentsSun, 20 Jan 2019 02:00:53 +0000https://chrishardie.com/?p=4727As an advanced publishing tool, WordPress typically defaults to displaying information about the author behind a given post or page on a WordPress site. But sometimes you want to build a website that has a more "singular" editorial identity, and that doesn't appear to be authored and managed by multiple people, even if it is. … Continue reading Hiding authors and users in WordPress

]]>As an advanced publishing tool, WordPress typically defaults to displaying information about the author behind a given post or page on a WordPress site. But sometimes you want to build a website that has a more "singular" editorial identity, and that doesn't appear to be authored and managed by multiple people, even if it is. I see this regularly with corporate brands, political organizations, larger not-for-profits, and advocacy groups where the identity of a post or page's author could distract from the content being shared.

So how do you keep WordPress from revealing the author information - names, usernames and more - for the administrative users of your site? Here are a few tips, aimed at WordPress developers comfortable customizing their sites through changing the theme and plugin code.

First, a disclaimer. There's no way to be 100% certain that the author names on a public WordPress site will never be visible to others. After all, we're talking about a database and set of content that is connected to the Internet and generally designed for public consumption (though plenty of people build private WordPress sites too). If you are trying to protect user information in matters of personal safety or other substantial risk, you should make sure none of their real identifying info is stored in WordPress in the first place.

With that out of the way, there are a couple of key areas to consider:

The WordPress theme you're using.

The machine-readable feeds that WordPress generates.

The WordPress API.

The WordPress plugins you're using.

Hiding Author Names in the WordPress Theme

The first place to make sure you're not displaying author information is in the WordPress theme you're using on the site. Most WordPress themes include some kind of call to a function like the_author which displays the name of the author of a post or page. You could try to go through all of the files in the theme and remove calls to those functions, and then do the same for the WordPress core template files, and any parent themes involved. But this is not a good practice as it makes your theme harder to upgrade in the future, and could involve a lot of time and potentially disruptive changes.

Instead, you can use a WordPress filter in your functions.php file (using a child theme where appropriate) to change how author names are displayed throughout your site, except in the WordPress admin area where you presumably want to still see this information:

Again, for any place where the_author is called that is not in the admin context, this filter will return an empty string. Voila, no more author names on your site.

This filter should also handle removing author information from RSS feeds generated by WordPress (aka the dc:creator entity). You can confirm by visiting the https://yoursite.com/feed/.

Even with this in place, it's still worth searching through your theme files for other mentions of "author" or "username" and the like, to make sure your theme isn't doing something else to display author names.

Disabling Author Display in the WordPress API

The WordPress API includes a wide variety of API endpoints that contain details about the posts, pages and other parts of a WordPress site - including authors. While changes have been made to only have the /users/ endpoint display information about authors associated with public, published posts, you still may want to hide that information.

This code, to be placed in your functions.php file, will completely disable the part of the API that returns user information. Other parts of the API will still reference things like an author's numeric ID in the WordPress database, but it won't be easy for someone to figure out that user's display name or username.

In case it's not obvious, disabling parts of the WordPress API should be done at your own risk with thorough testing. Increasingly, other WordPress tools, themes and plugins are coming to depend on it, and may not work properly without all endpoints available.

WordPress Plugins May Expose Author Info

Even if your theme and API setup are all set to hide user names and display names, you may be using plugins that display author information anyway.

For example, the Yoast SEO plugin will, by default, display author archives and include author information in the sitemaps it generates. If you turn off the author archive display, the author sitemap will also be removed.

The only real way to make sure your plugins aren't displaying author information somewhere unintended is to look through the plugin code in some detail. You could search for mentions of "author," "the_author," or "username" as a starting point.

In general, it's best to use as few plugins as possible, and to only use plugins where you fully understand everything that they're doing with your site content and functionality - especially if you're trying to keep certain parts of it like usernames away from public view.

I'll repeat my disclaimer from above: even with these tips and changes, there are other unexpected ways a site could make author information available, and you'll have to carefully research and monitor how each tool in use on your site might contribute to that.

Are there other helpful tips you've found for hiding a WordPress site's authors and users?

]]>https://chrishardie.com/2019/01/hiding-authors-users-wordpress/feed/1Goodbye, mom.https://chrishardie.com/2018/12/goodbye-mom/
https://chrishardie.com/2018/12/goodbye-mom/#commentsSun, 09 Dec 2018 22:04:45 +0000https://chrishardie.com/?p=4742My mom, Cynthia Hardie, passed away on Friday December 7th, 2018. There's so much to say about this, what she means to me, who she was in the world, and what the last few weeks, months and years have been like as she dealt with cancer...and yet for now I am without any good words. … Continue reading Goodbye, mom.

There's so much to say about this, what she means to me, who she was in the world, and what the last few weeks, months and years have been like as she dealt with cancer...and yet for now I am without any good words. I am just deeply sad.

Her obituary, written by a longtime family friend, was published in today's Chicago Tribune. I'm including the full text below.

Goodbye, mom. I love you.

Cynthia Engle Hardie, modest but not self deprecating, might have devoted a wall to vanity in her spacious condo on Chicago's Gold Coast. Photos of famous people shaking her hand. Awards for her impressive work in the field of public relations. Thank-you notes for her philanthropy. A Cubs banner, signaling faith in a team that regularly broke her heart. Exotica from her world travels. But instead of framed kudos, when she died December 7, 2018, she left an imposing array of better things.

When she retired in 2010 as general manager of the Chicago office of global communications behemoth FleishmanHillard, Hardie's colleagues rented Wrigley Field, naming her an honorary usher while wisely retaining her in their own lineup as a consultant. One of her most excruciating career moments was on the morning of 9/11, standing beside United Airlines executives as they reached out to grieving families of passengers on the company's two downed flights. Although her specialty was crisis communications, most professional drama was in her behind-the-scenes leadership, building a client base and nurturing talent. She had a national reputation and was summoned to put out figurative fires all over the country, always returning to her literal Midwestern base.

A childhood in Knoxville, Tennessee, left her with an unruly twang (a mangled “e” which showed up in times of stress), and her middle class upbringing left her with egalitarian views, which were always in evidence. After graduation from Indiana University, her career began in journalism at newspapers in Cincinnati, Kansas City and Chicago. After the death of her husband, Robert Coates Hardie, and realizing she was sole breadwinner for two young children, she spun her part time work as a writer into a full time gig at the largest advertising and public relations agency in Cincinnati. She soon took charge of its public relations division, and then moved on to FleishmanHillard in 1998.

During her off-hours, she helped launch Fernside, one of the nation's first centers for grieving children, and supported it for years with her brains and money. She shored up a floundering equine riding program for kids with special needs near her second home at a lake in Ohio – again with money and with wise counsel. She chaired the communications committee of the highly regarded Chicago Network, a philanthropic organization of influential professional women. Life outside the office also included transporting patients to their chemo, casserole patrols for the sick and grieving, and arm twisting for good causes.

During her own gallant, almost six-year battle with cancer, she brought attention and funding to the Bladder Cancer Advocacy Network, an agency with precious little of either. She was a test patient for new drug protocols, aware they would not save her life but enduring terrible suffering which might help find a cure for somebody else. Even while desperately ill, she maintained intellectual curiosity and an impressive familiarity with the aisles of Costco and most of Chicago's theater venues. She had a wicked sense of humor, cooking for and entertaining wildly dissimilar people, although she had little patience for the passive or unimaginative.

She is survived by her brother and sister-and-law, Ward and Susan Engle of Nashville, Tennessee; her sister and brother-in-law, Norma and Phil Hyatt; her half-brother and half-sister-in-law Doug and Nancy Engle; her half-sister and half-brother-in-law Joanna and Grant Wilkins, and her step-mother Jo Engle, all of Knoxville, Tennessee.

She also reluctantly leaves a son and daughter-in-law, Chris Hardie and Kelly Burk, of Richmond, Indiana; a daughter and son-in-law, Erin and Eric Martineau, of San Diego, California, and three granddaughters. They are responsible for the single congratulatory memento in her home, a framed print in her kitchen: 70 Things We Love About You. “You loved me from the beginning,” her step-granddaughter wrote. “She always puts lipstick on for life's biggest fights,” her daughter said. Her children and in-laws celebrated her progressive worldview, her unwavering and unselfish support, her wit, her kindness, her intelligence and her flair in the kitchen. She was a fiercely protective boss, an inspirational colleague, a relentlessly generous and beloved friend, and the most devoted and dedicated mother. She could elevate a flower arrangement with a Gerbera daisy and a wisp of greenery. She knew just when a PowerPoint presentation needed a comma and when a casserole could use a sprig of cilantro, when to micro manage and when to slip into the background.

Cynthia Hardie relinquished life after a pitched battle with cancer, leaving behind a wide swath of goodness and hardly any vanity.

A celebration of Cynthia’s life will be held Thursday, December 13th at 4 PM Central time in Fourth Presbyterian Church, Buchanan Chapel, 126 E Chestnut, Chicago, IL. In lieu of flowers please donate to the Bladder Cancer Advocacy Network, bcan.org.

]]>https://chrishardie.com/2018/12/goodbye-mom/feed/6Writing to be readhttps://chrishardie.com/2018/09/writing-to-be-read/
https://chrishardie.com/2018/09/writing-to-be-read/#respondMon, 24 Sep 2018 13:00:17 +0000https://chrishardie.com/?p=4711Last week I had a short humor piece published in McSweeney's Internet Tendency. It's been exciting not only because I adore McSweeney's as a publication and am honored to have a byline there, but also because it reminds me how fun it is to have my writing distributed for others to read. And, it's the … Continue reading Writing to be read

I've had that excitement to some degree or another in a few other places: as a reporter and editor for my high school and college newspapers, as a writer for a satirical high school publication (called The Hierarchy of the Zucchini People, naturally), having some creative writing accepted into literary magazines, as an occasional columnist for my local city newspaper, and as a long-time blogger.

Still, I've been conflicted at times about calling myself a writer. And while I subscribe to the notion that one can be a thriving writer even if no one is reading your stuff, it does feel pretty nice when the universe affirms the value of something I've written.

Yes, this website is a largely built around my writing, my longest standing byline of them all. And some of my posts here have seen thousands of views in a day when they're linked from Hacker News or Reddit. But most of the time there are a few hundred visits per day at most, and many of those are to the same handful of technical articles; I don't publish here consistently enough to draw much of a regular readership. It's easy to think of it as "just a blog."

So If I'd posted the above humor piece on this site and linked to it from my Twitter account, I'm guessing it may have been seen by tens or maybe hundreds of people. I might have gotten a comment or two, maybe a few likes from my Twitter followers, and that would be fine.

Most commenters see it as "that new bit from McSweeney's" and not anything from me in particular, just as we tend to associate writing from The Onion or The New York Times with the publication more than the author. That's okay with me - I'm happy to contribute to what McSweeney's is and does in that way.

It also makes me appreciate publications that are open to submissions and that lift up writing done outside of the traditional publishing model (Longreads, part of the Automattic family, not least among them).

I plan to continue putting most of my public writing on my various personal websites. But I have lots of ideas for other publications and media that I could submit to and work with, and myriad notes on possible book topics, editorials, screenplays, journalism projects, short stories and more that I'd love to pursue. Seeing my writing being enjoyed by others certainly encourages me to spend more time on all that, and to live further into the part of my identity that is and probably always has been, "writer."

]]>https://chrishardie.com/2018/09/writing-to-be-read/feed/0Using MoveOn for petitionshttps://chrishardie.com/2018/09/moveon-petitions/
https://chrishardie.com/2018/09/moveon-petitions/#respondMon, 17 Sep 2018 13:41:18 +0000https://chrishardie.com/?p=4698It's been a long time since I started a petition to try to change something in my world. But in recent weeks my local City Council has been threatening to do some silly things related to funding the development of bike and pedestrian paths here, and I'd heard enough people say informally that they were … Continue reading Using MoveOn for petitions

]]>It's been a long time since I started a petition to try to change something in my world. But in recent weeks my local City Council has been threatening to do some silly things related to funding the development of bike and pedestrian paths here, and I'd heard enough people say informally that they were concerned by those threats that I decided it was time to create a central spot where they could put all their names for Council members to see.

And that's how I ended up using the petitions.moveon.org service, which has turned out to be excellent for this purpose.

A few things in particular that I like about it:

While clearly scaled to support national and state level petitions, the MoveOn tool did a great job of enabling a smaller petition targeted at a local legislative body that might not otherwise be in their system. I was able to enter the names and email addresses of my local Council members as "targets" of the petition, and they then were set up to receive deliveries of signatures directly.

Related to that, the MoveOn system allowed the targets of the petition to respond directly to the petition signers with a message, without giving them direct access to each others` private contact information.

The system automatically picks small signature goals to start with and then scales them up as new milestones are hit. I think this helps avoid the awkward "WE'RE GOING TO HAVE A HUNDRED MILLION SIGNATURES HERE!" declarations by petition creators that quickly yield disappointment.

The system offered up interesting summary stats about where signatures were coming from and what activity on the petition looked like over time.

When I had to contact MoveOn's petition support (one of the signers had accidentally left out a word in a comment that significantly changed the meaning, and wanted it corrected) they were fast to respond and provided a quick solution.

Other features in the petition tool, like handling delivery via print and email, contacting petition signers, "declaring victory," and more seemed really well designed; simple, effective, built for bringing about real action.

One of the things I wanted to do as the signature numbers climbed and as I prepared to present the petition to Council was create something that visualized the signing names in one place. The signature count on the petition itself was not super prominent, and in only displaying 10 names at a time it was easy to miss out on the sense of a large part of the local population making a clear statement about what they want.

So I sniffed the XMLHttpRequests being made by the MoveOn site and found the underlying API that was being used to load the signature names. I whipped up a simple PHP script that queries that API to fetch all the names, and then does some basic cleanup of the list: leaving out anything that doesn't look like a full name, making capitalization and spacing consistent, sorting, etc.

I published the tool online at https://github.com/ChrisHardie/moveon-petition-tools in case anyone else might find it useful. (I later learned that MoveOn makes a CSV export of signatures and comments available when you go to print your petition, so that's an option too.)

Using the output of my tool, I created this simple graphic that shows all of the signed names to date:

All in all the MoveOn petition platform has been great, and I think it's made a difference just the way I wanted it to. I highly recommend it.

]]>https://chrishardie.com/2018/09/moveon-petitions/feed/0Article on Strong Townshttps://chrishardie.com/2018/09/article-strong-towns/
https://chrishardie.com/2018/09/article-strong-towns/#commentsThu, 06 Sep 2018 20:01:54 +0000https://chrishardie.com/?p=4691I've been enjoy and appreciating the articles on Strong Towns for a while now. They bring a provocative and practical long-term view to the conversation about how cities and towns in North America can become strong and resilient. Their mission and approach line up so well with the advocacy work I've done in my own … Continue reading Article on Strong Towns

]]>I've been enjoy and appreciating the articles on Strong Towns for a while now. They bring a provocative and practical long-term view to the conversation about how cities and towns in North America can become strong and resilient. Their mission and approach line up so well with the advocacy work I've done in my own community, and the thinking that I see leading to great results in communities around the world.

Now it's an honor to have one of my own essays on community building appear in Strong Towns. I wrote about how to get a response from local leaders when you need to get something done. Most of what I write on RichmondMatters.com is specific to life in Richmond, Indiana, but in this case it turned out that with a few refinements to the original article, the information might be relevant to a national audience.

I hope it helps someone out there find a way forward on positive change they're pursuing in their own town.

]]>https://chrishardie.com/2018/09/article-strong-towns/feed/1Gluing the web together with a personal webhook serverhttps://chrishardie.com/2018/08/webhook-server/
https://chrishardie.com/2018/08/webhook-server/#commentsTue, 28 Aug 2018 14:47:40 +0000https://chrishardie.com/?p=4674I mentioned earlier that I'm using a personal webhook server as glue between various online tools and services, and this post expands on that. Why It Matters For the open web to work well enough to bring people back to it, information has to be able to come and go freely between different systems without relying … Continue reading Gluing the web together with a personal webhook server

]]>I mentioned earlier that I'm using a personal webhook server as glue between various online tools and services, and this post expands on that.

Why It Matters

For the open web to work well enough to bring people back to it, information has to be able to come and go freely between different systems without relying on centrally controlled hubs.

Just like RSS feeds, REST APIs and other tools that allow software programs to talk to each other across disparate systems, webhooks are an important part of that mix. Whereas many of those tools are "pull" technologies - one system goes out and makes a request of another system to see what's been added or changed - webhooks are a "push" technology, where one system proactively notifies another about a change or event that's occurred.

You might be using webhooks right now! Popular services like IFTTT and Zapier are built in part on webhooks in order to make certain things happen over there when something else has happened over here. "Flash my lights when my toaster is done!" And while I have great respect for what IFTTT and Zapier do and how they do it, I get a little uncomfortable when I see (A) so much of the automated, programmable web flowing through a small number of commercially oriented services, and (B) software and service owners building private API and webhook access for IFTTT and Zapier that they don't make available to the rest of us:

Dear app/tool/service developers: if you're going to offer "integrations" with folks like IFTTT, Zapier PLEASE also take the time to directly support the open standards those connections are built on (e.g. REST APIs, webhooks, RSS, CalDav, CardDav, etc).

So I decided that just as I host RSS feeds and APIs for many of the things I build and share online (mostly through WordPress, since it makes that so easy), I also wanted to have the ability to host my own webhook endpoints.

How I Set It Up

I used the free and open source webhook server software. (It's unfortunate that they chose the same name as the accepted term for the underlying technical concept, so just know that this isn't the only way to run a webhook server.) I didn't have a Go environment set up on the Ubuntu server I wanted to use, so I installed the precompiled version from their release directory.

I created a very simple webhook endpoint in my initial hooks.json configuration file that would tell me the server was working at all:

This establishes a proxy setup where nginx passes requests for my public-facing server on to the internally running webhook server. It also limits them to a certain number of requests per second so that some poorly configured webhook client can't hammer my webhook server too hard.

I generated a Let's Encrypt SSL certificate for my webhook server so that all of my webhook traffic will be encrypted in transit. Then I added the webhook startup script to my server's boot time startup by creating /etc/init/webhook.conf:

The hotreload parameter tells the webhook server to monitor for and load any changes to the hooks.json file right away, instead of waiting for you to restart/reload the server. Just make sure you're confident in your config file syntax. 🙂

I strongly recommend using a calling query string parameter that acts as a "secret key" before allowing any service to call one of your webhook endpoints. I also recommend setting up your nginx server to pass along the calling IP address of the webhook clients and then match against a whitelist of allowed callers in your hook config. These steps will help make sure your webhook server is secure.

Finally, I suggest setting up some kind of external monitoring for your webhook server, especially if you start to depend on it for important actions or notifications. I use an Uptimerobot check that ensures my testing endpoint above returns the "webhook is running" string that it expects, and alerts me if it doesn't.

If you don't want to go to the trouble of setting up and hosting your own webhook server, you might look at Hookdoo, which hosts the webhook endpoints for you and then still allows you to script custom actions that result when a webhook is called. I haven't used it myself but it's built by the same folks who released the above webhook server software.

How I Use It

So what webhook endpoints am I using?

My favorite and most frequently used is a webhook that is called by BitBucket when I merge changes to the master branch of one of the code repositories powering various websites and utilities I maintain. When the webhook is called it executes a script locally that then essentially runs a git pull on that repo into the right place, and then pings a private Slack channel to let me know the deployment was successful. This is much faster than manually logging into my webserver to pull down changes or doing silly things like SFTPing files around. This covers a lot of the functionality of paid services like DeployBot or DeployHQ, though obviously those tools offer a lot more bells and whistles for the average use case.

I use a version of this webhook app for SmartThings to send event information from my various connected devices and monitors at home to a database where I can run SQL queries on them. It's fun to ask your house what it's been up to in this way.

For the connected vehicle monitoring adapter I use, they have a webhook option that sends events about my driving activity and car trips to my webhook server. I also store this in a database for later querying and reporting. I have plans to extend this to create or modify items on my to-do list based on locations I've visited; e.g. if I go to the post office to pick up the mail, check off my reminder to go to the post office.

I've asked the Fastmail folks to add in support for a generic webhook endpoint as a notification target in their custom mail processing rules; right now they only support IFTTT. There are lots of neat possibilities for "when I receive an email like this, do this other thing with my to-do list, calendar, smart home or website."

Conclusion

I'm not expecting many folks to go out and set up a webhook server; there's probably a pretty small subset of the population that will find this useful, let alone act on it. But I'm glad it's an option for someone to glue things together like this if they want to, and we need to make sure that software makers and service providers continue to incorporate support for webhooks and other technologies of an open, connected web as they go.

]]>https://chrishardie.com/2018/08/webhook-server/feed/1A year without Facebookhttps://chrishardie.com/2018/06/year-without-facebook/
https://chrishardie.com/2018/06/year-without-facebook/#commentsThu, 28 Jun 2018 10:30:00 +0000https://chrishardie.com/?p=4650It's been about a year since I left Facebook, and I'm still glad I did. (I guess there were those thirty years before Facebook existed that I somehow managed without it, too.) Some observations: People in my circles generally continue to assume that I've seen their event invitations and life updates on Facebook, and so … Continue reading A year without Facebook

]]>It's been about a year since I left Facebook, and I'm still glad I did. (I guess there were those thirty years before Facebook existed that I somehow managed without it, too.)

Some observations:

People in my circles generally continue to assume that I've seen their event invitations and life updates on Facebook, and so it's still a regular occurrence that I find out about something well after everyone else, or not at all. This is most annoying when it's something really time sensitive that I would have liked to have been a part of.

Some of my published writings have been shared extensively on Facebook, generating hundreds or even thousands of views on my various websites, but I don't have a way of knowing where that activity is coming from or what kind of conversation it might be generating there. I've had people tell me in person that they saw and liked something via Facebook, which is nice, but of course I wish they'd leave their likes and comments on my site where it's closer to the original writing, visible to the world, and not subject to later deletion by some corporate entity. (This comes up for any social network, not just Facebook, but it tends to be the one generating the most traffic for me.)

I won't make a claim that the hours I've saved by not looking at Facebook have freed me up to accomplish some amazing other thing. I will say that I felt a nice release from the self-created pressure to keep up with my interactions and profile there, and that in turn has contributed to an increase in my overall creative energy for other things.

I had one time where I needed to use the Facebook sharing debugger for a work project. I signed up for a new account to do this, but Facebook clearly found my lack of interest in populating a real-looking profile to be suspicious, and closed down the account soon after. In the end it was faster to ask a colleague with an active account to do the debugging for me and share the results. As I've said before, I think it's ridiculous and irresponsible that Facebook doesn't make that tool available to logged-out users.

I'm still surprised at how many organizations and businesses use Facebook as their one and only place for posting content; some even do it in a way that I just can't see it as a logged-out user, and others don't seem to realize that they're giving Facebook 80% of any screen real estate on the links I can see. I am now much more likely to avoid doing business with or offering my support to these entities if they don't bother offering non-Facebook ways for me to engage.

I've accepted that people will not necessarily seek out the open version of the web on their own. Being off Facebook has reinforced that there are big gaps to close in the user experiences that other tools and services offer (the WordPress/blogging ecosystem not least among them). My own efforts to migrate my content that still exists on other services like Flickr into a digital home that I fully control are slow-going, so I don't expect other people to even bother. Facebook is still the path of least resistance for now.

When the actions of Cambridge Analytica were in the news, it was tempting to feel smug about not being an active Facebook user. But I know they still have tons of information about me that is of value to advertisers and others, and that even as I use browser plugins to try to prevent Facebook from accumulating an even larger profile of my online activity, it is a losing battle until there are larger shifts in the culture and business models of technology companies.