小妖精撞得你舒不舒服

小妖精撞得你舒不舒服

小妖精撞得你舒不舒服

小妖精撞得你舒不舒服
Christmas with Arthur Godfrey and All the Little Godfreys (1953 album)

I'm a fan of old time radio, in particular the wise-cracking detective shows like Yours Truly, Johnny Dollar and Rogue's Gallery. Some of the series are getting well-deserved criticism today for their offensive racial and gender depictions -- Wisconsin Public Radio just cancelled its old time radio program after 31 years over such concerns -- but among the thousands of shows preserved at places like the Internet Archive, there's still a lot of entertainment for the ears.

While looking over archival publications on old time radio shows for Winnetoba Radio, I found a great story I hadn't heard before: The night Arthur Godfrey fired a singer on live radio.

In 1952 Archie Bleyer formed Cadence Records and had [Julius] La Rosa recording for him. La Rosa then hired a manager after his first hit record. This didn't go over too well with Sir Arthur, since none of Arthur's friends were allowed managers. La Rosa also refused (unlike all the other male stars on the show) to take dance lessons ordered by Godfrey. On top of this all, La Rosa had a thing for Dorothy McGuire. Godfrey himself also had a soft spot for McGuire. Finally on Oct. 19, 1953, La Rosa was canned right after singing "Manhattan." Godfrey called it La Rosa's "swan song."

The link includes audio of the firing, an act of public humiliation from which Godfrey's folksy reputation never recovered.

小妖精撞得你舒不舒服

MySQL dolphin logoWhen you run a webserver there's always things that could be set up better, for reasons of security, reliability or speed. One of my undone tasks for an embarrassingly long time has been to stop backing up MySQL databases by passing along the username and password to a script at the command line.

I was regularly using the mysqldump program to make a backup of each database via a script that contained these commands:

OF=/home/[username]/backup/$3-$(date +%Y%m%d).gz
mysqldump --user=$1 --password=$2 $3 | gzip > $OF

The arguments $1, $2, and $3 are a username, password, and database name, respectively. The script creates a copy of the database with the current date in the filename and ends with .gz because it compresses the file with GZIP.

MySQL hates being run this way. Every single time I used the script, I got an email with the message, "Warning: Using a password on the command line interface can be insecure." Getting 12 of these warnings a day made me ignore the server's inbox entirely.

To do something about that security warning, I found several suggestions on this Stack Overflow post.

The one I liked best was to create an extra configuration file for each database that contained the access credentials. It takes this form:

[client]
user = [username goes here]
password = [password goes here]
host = [hostname or localhost goes here]

With this file, the mysqldump command can be rewritten to get the credentials from the new file using the defaults-extra-file argument:

mysqldump --defaults-extra-file=/home/[username]/mysql-$1.cnf $2 | gzip > $OF

The configuration files are accessible only by the user running the script.

小妖精撞得你舒不舒服

As of today, I've been publishing this weblog for 7,500 days. Workbench began on Nov. 7, 1999, on the Blogger platform under the name Referer_Log. The name comes from webserver files that reveal the link someone clicked to reach your site, which could be used to find out what other people were saying about what you wrote. Since I viewed blogs largely as a vehicle for ego gratification it seemed appropriate. The homepage had this kidding-but-not-kidding purpose: "Make People Like Me."

A screen capture of this blog from November 1999

Later I renamed it Workbench because I wanted the blog to be about the programming and publishing projects I was working on instead of a bunch of personal yammering about my life and opinions.

That plan, of course, failed. There has been yammering as well as jibber-jabber, folderol and even a little malarkey.

This milestone comes as the blog is in the process of coming back to life after a long period of quiescence. I have written six posts in two weeks to shake off the dust and start thinking like a blogger again.

I'd like to state some grand ambitious purpose but this is still what it was in 1999: an odd experiment writing for an audience of nobody in particular to see what happens.

Fixing 'Call to Undefined Function' Filter_Var() in PHP

I host a lot of websites in the Amazon cloud on EC2. I recently discovered that all email one site was sending was being rated as spam and never seen by the recipient. This meant that new users didn't get the verification email required to complete signup. It appears that EC2 IP addresses can have a dodgy reputation among email providers. Another web publisher described these problems on AWS Developer Forums.

PHP elephant iconSince then I've been rewriting my code to deliver emails with SendGrid, a service designed to avoid all that agita. SendGrid has an API and PHP library that are simple to implement.

While converting a mail script on a non-EC2 server I encountered the following error:

PHP Fatal error: Call to undefined function SendGrid\Mail\filter_var() in sendgrid-php/lib/mail/Mail.php on line 1008

This occurred because the SendGrid PHP library uses filter_var(), a function that was introduced in a later version of PHP than the one on my server.

I'm retiring the server soon, so I didn't want to upgrade PHP just to fix the problem. Rewriting SendGrid's PHP code to replace the missing function also would be difficult. Fortunately I found an ingenious solution from a Joomla developer who encountered the same problem: Create your own filter_var() function that does nothing but return the text it was supposed to filter:

if (!function_exists('filter_var')){function filter_var($value, $filter_type) {return $value;}}

Putting this in the mail script caused my version of filter_var() to be called instead of the built-in one that SendGrid's code expected. When I move to a new server with PHP 7, it will use the real function again.

I had no idea you could do this in PHP. I thought there was a wall between built-in functions and user-defined functions.

There's at least one aspect of being a programmer that's like being Tony Hawk. You sometimes experience the elation of "I never knew you could do this and now that I can I want to do it all the time."

Working from Home? Welcome to My World

Jake Savin has a blog post up about working from home, something he began doing as a developer at UserLand Software in 2000 coding the blogging platform Manila and other products. Though it wasn't a remote position when he began the job, that soon changed:

The company actually had an office when I was hired, and I had my own space with a desk and a door, a desktop computer, etc. There were only two of us in the office though, and it quickly became clear to me that the value of driving 35-40 minutes each way from my apartment to the office and back just wasn't worth it. So a few weeks in, I drove there one Saturday, packed up the computer and took it home, and never went back. From that point my productivity and focus increased. By a lot.

I've been working from home for decades, first as a computer book author and web publisher and now as a ServiceNow application developer. My morning commute is the thirteen steps I take from the master bedroom to my keyboard.

Jake has some good advice for those new to the experience of being at work while being at home, in particular the call to remember to stop working.

Working from home can erode the boundary between work time and off time. At first you might just fire up the computer occasionally to complete a task or catch up on something you couldn't get done on a day packed with long conference calls. But at some point you start feeling like your extra time is fair game, so you make different decisions about what to get done during the workday. I find this particularly true of programming, which often has blocks of time where you're writing a piece of code and don't need more input from coworkers until it's ready to show them.

Losing the boundary can make all time seem like work time and lead to burnout. I once worked at a startup that had a product launch at an industry conference considered make-or-break for the company. I worked 12 hours a day for 40 consecutive days to get that done along with my other projects. By the time of the event, I was debugging JavaScript in my dreams and had the pallor of an extra on the Walking Dead who died of scurvy.

That's not an experience I recommend. You can't outrun the law of diminishing returns.

Things are better these days. I hear the five o'clock whistle no later than six.

Whatever Happened to the Blogroll?

One of the side effects of reviving an old site design on Workbench is that this blog has a blogroll again. Bloggers used to put a long list of links on their homepage to other blogs they read (or wanted you to think they read). I don't know why everybody stopped doing that. Since I was borrowing an old design from 2008 I decided to bring back the blogroll too.

I used the same blogroll but dropped the sites that are inactive or gone after 12 years, leaving these 20 diehards:

There are a lot of personal blogs in this roll, including three locals from Jacksonville, and a few big names from the earliest days of blogging that are still publishing such as TechDirt, MetaFilter and the unstoppable Jason Kottke.

Most of the other blogs are a lot like Workbench -- updated sporadically and sometimes apologetically by one person in their spare time. The impulse to keep up a personal blog is harder to sustain these days when Twitter, Facebook and Instagram are bringing millions of people together and dispensing the continuous dopamine drip of retweets and likes so they never leave.

Being a blogger in 2020 is like being Free Trader Beowulf, sending out a distress signal from deep space and not knowing if it ever will be heard.

Upload: Do You Really Want to Live Forever?

Promotional image of Amazon Prime TV series Upload

I just finished watching the 10-episode first season of Upload, which just got renewed for a second on Amazon Prime only seven days after its debut.

The show's an oddball take on the afterlife in which anyone can be uploaded to a virtual world shortly before death and still interact with their loved ones. Robbie Amell plays a handsome but shallow app developer who dies under suspicious circumstances in his self-driving car. Andy Allo is his "angel," the tech support rep guiding him through his second life.

There are afterlife worlds for many different budgets, though even the toniest is pleasant on the surface but dire underneath. Amell's girlfriend pays for his continued existence and thus has total control, which inspires her to say for the first time "I love you." When he expresses surprise that she level-jumped their relationship, she replies, "It's not like I can scare you off with that any more."

The biggest laughs come from how horrible the world has become in 2033. This extends to the afterlife, where there are floating three-dimensional banner ads, Taco Bell cheesy gordita upsells and corporate exploitation of private thoughts so relentless Mark Zuckerberg will be upset he didn't think of it first.

Allo's really good as the young tech who starts to fall in love with her client despite being told that long distance living-dead relationships never work.

After The Good Place, I didn't think I needed another afterlife series but I like that I can't figure out what Upload is supposed to be. It's genuinely funny at times but the characters inhabit a world as dark and divided by class as Terry Gilliam's Brazil.

After it ended on a killer cliffhanger I'm looking forward to the second season, which is likely to take awhile with TV production closed down for the pandemic.