Ben Lobaugh Online

I think, therefore I am. I am, therefore I sail

B.C. Rich Warlock NJ

New Toy: B.C. Rich Warlock NJ Electric Guitar

I became involved in music at a young age. As time progressed I have acquired more and more instruments (and gotten rid of many too!), but there has been one on my bucket list for quite some time, the B.C. Rich Warlock.

I saw my first Warlock in person as a teenager and it was love at first sight. I knew someday I would have one, but I was not a guitar player at the time. Fast forward to today- I am still not a guitar player, though I can jam out a few chords, but I now have that B.C. Rich Warlock I have long wanted!

B.C. Rich Warlock NJ

This is the B.C. Rich Warlock NJ series. The serial number on it is strange. B.C. Rich changed their serial number formats several times over the years. As near as I can tell, this is from 1992. What drew me to this particular guitar was the deep blue color highlighting the wood grain. That first Warlock I saw had the same look to it. It would seem to be somewhat rare. Most Warlocks are solid black or solid red.

For its age, and considering these are typically thrashing guitars, it is in very good shape. Needed a good cleaning and one of the bridge posts was loose. Easy fix. Since these photos it has been shined up quite a bit more.

Here are some of the handy resources that I found about the history of B.C. Rich guitars that helped identify this one:

S/V Shadow - 1987 Catalina 36

Introducing “Shadow”, our new Catalina 36 sailboat

Update: Shadow has her own website! See it at

I am very excited to announce that Alix and I have completed the purchase of S/V Shadow, a 1987 Catalina 36. She is in tip-top shape and ready to take us cruising!

S/V Shadow - 1987 Catalina 36
S/V Shadow a 1987 Catalina 36

Shadow started her life in Long Beach, CA and had the same owner for 33 years! The original owner used her to visit Catalina Island, which is an easy cruising distance from Long Beach. From the time it left the factory, the boat has been professionally maintained, and it shows. The first time I stepped onto the boat I wondered if I had somehow been transported back in time to when she was new!

The second owner purchased her in August 2020, trucked her up to Washington, re-rigged her and then set about doing lots of updates, such as new stereo, new faucets, fresh bottom paint. Oh, and all new B&G instruments! This owner was not able to take her sailing before moving out of state, making us the third owners, but second users of the boat :).

The Catalina 36 is a stable boat, with a large and comfortable cabin for the family. The cockpit is roomy enough to have many friends aboard for good times sailing. Her amenities, such as: inverter/charger, fridge and freezer, toilet, shower, hot water, and a stove, will make for luxury cruising in Puget Sound.

Most importantly, Clara loves the boat!

How to fix the “sed command expects \” error on Mac OS

If you are familiar with the sed command on Linux then you might be in for an unpleasant surprise the first time you try to use it on Mac OS.

Mac OS runs the BSD version of the sed command. As such, there are some syntax differences.

An example of a classic sed command, that is used in build scripts everywhere:

sed -i 's/WORD/REPLACEMENT' file.txt

If you run that command on Mac OS you will be very grumpily greeted with the error:

sed: 1: "file.txt": command expects \ followed by text


Oh right, this is the BSD version of sed.

You could fiddle with the command until you find something that works on Mac OS. Then you have to ensure it still works on your Linux machines as well.

Or, you could bypass the issue and install the GNU sed via Homebrew.

I choose the second option. It is easier and none of my build scripts will require changes. It can be installed with:

brew install gnu-sed

After install, there will be a new command called gsed. This is great, but still requires updating everything using sed. Simple fix, alias sed in your shell profile. I am still a bash user, so I edit ~/.bash_profile and add the line:

alias sed='gsed'

Source the profile file and voila, the familiar sed version has been restored for you on Mac OS!

Happy sedding.

Photo by Green Chameleon on Unsplash

Highly Performant PHP Sessions with Redis

The web is stateless, but often the apps we build are not. To facilitate state in web apps, PHP provides a session handling mechanism. Sessions are off by default, and enabled with the `session_start()` function.

Read more about PHP session handling at

If you have worked with PHP sessions before you may have noticed performance issues caused by the `session_start()` function. On a small scale your app may be ok, but as you scale up issues will pop up. In particular, if the app makes several ajax calls back to the server during a page load there will see issues. This happens because PHP stores its sessions as files on the drive. During each request, PHP opens the session file for reads and writes. The file is locked during the request. That means if there are three ajax requests to the server, request two and three will be blocked waiting on the request in front of them.

By way of example, let’s assume the web server responds in 300 milliseconds for a single request and we have the initial request with three ajax requests that run asynchronously.

The load time should be: 
300 ms initial request + 300 ms ajax requests = 600 ms

When using PHP’s default session the load time becomes:
300 ms initial request + 300 ms ajax request one + 300 ms ajax request two + 300 ms ajax request three = 1,200 ms or about 1.2 seconds!

And that is a light example. With content systems, such as WordPress, shipping with a built in API, it has become common practice to send many requests to the server during a single page load.

To get around the file locking issue we have to change the session storage mechanism. PHP provides the ability to write custom session handlers. We could do that, or we can tap into the Redis session handler. Redis does not have the locking issue, and it is already set up to be highly scalable. File based sessions are dubiously scalable at best.

To get it running all we need to do is update two lines in the php.ini file to instruct PHP to use Redis and where to find the Redis server. I will not cover how to set up a Redis server in this article.

Open the php.ini file and add or update the following two config values:

  • session.save_handler
  • session.save_path

The session.save_path value instructs PHP where to find the Redis server.

For example, the config values may look something like:

session.save_handler = redis
session.save_path = tcp://

Restart the PHP service and you will see sessions being stored in Redis instead of the filesystem.

If you do not have access to the php.ini file do not give up hope! It is also possible to set these values during the application runtime with the following PHP code:

ini_set('session.save_handler', 'redis');
ini_set('session.save_path', 'tcp://');

Make sure those two lines run before the session_start() function is called.

Depending on the server configuration, it may also be possible to set this in a .htaccess file.

Congratulations! Your users will now experience a considerable performance boost, and you have taken another step towards building a highly scalable and performant site.

First water adventure of 2021!

What a beautiful day to be on the water!

Still boatless, Harold and Jesse took us out on their 36′ Unitflite, for a tour around the Tacoma harbor, across to Dockton, and we even poked into Gig Harbor to pick up some lunch at Tide’s Tavern.

This was Clara’s longest trip on the water, and she loved it! She even kicked Harold out of the captain’s seat and took over for a while 🙂

Page 1 of 168

Powered by WordPress & Beards