MediaWiki Template Get Hostname

I was working on a template for one my personal wikis and needed to get the hostname for a given URL. Using the capabilities of the Parser Functions extension for MediaWiki I whipped up this template. I figured others may find this useful so here it is. The first version has a bunch of spaces and newlines added to make it more readable.

{{#vardefine: hoststart | {{#expr: {{#pos: {{{1|}}} | // }} + 2 }} }}
{{#vardefine: hostend | {{#pos: {{{1|}}} | / | {{#expr: {{#pos: {{{1|}}} | // }} + 2 }} }} }}
{{#vardefine: hostlen | {{#expr: {{#var: hostend }} - {{#var: hoststart }} }} }}
{{#sub: {{{1|}}} | {{#var: hoststart}} | {{#var: hostlen}} }}

To put it in your own MediaWiki, copy this version that removes the spaces and newlines.

To use this template put it on a page like Template:Get hostname and then call it in your pages as

{{Get hostname|http://thingelstad.com/another-reason-you-need-to-use-a-password-manager/}}

which will return thingelstad.com. You can also find this template on MediaWiki Cookbook.

Green Hat

This morning Tyler and I made a donut run for the family. He was digging his green hat.

Driveway getting ready to go.

At Catfish Coffee enjoying a macchiato with Dad.

Checking out the cow outside of Bakers Wife, bag of donuts in hand.

Joining the Dollar Shave Club

This Dollar Shave Club service seems to be making the rounds and it happened to be a time when I was running out of blades for my Gillete Mach 3 razor. I’m always amazed at how much the blades cost. The 15 pack at the store is nearly $40. Sure it’s spread over 15 weeks, but it still seems like a lot. So the Dollar Shave Club $6 a month plan sounded interesting.

I fired up Soulver and did some quick math. I gave the classic Mach 3 blades a fair treatment using the price from Amazon if I subscribe to have them sent on a defined schedule, $33.24.

$33.24/15 week = 2.216 $/week
2.216 $/week by month = $9.64
$6/4 week = 1.50 $/week
1.5 $/weekby month = $6.52
$6.52 as % off $9.64 = 32.31%

I’ll happily sign up to save 32% and not have to think about getting blades anymore. Brilliant service and good price. They just need to execute great.

PS: I added my referral code to the link to Dollar Shave Club. If you sign up, I get 1 month free. Not that I’m begging for free blades, but if there’s a bonus to get someone might as well get it. If you have a friend using the service, get their code.

Another Reason You Need to Use a Password Manager

Got this in my mailbox just now.

Dear Slicehost Forum Member,

Our records show that you have used the Slicehost forum at some point in the past.  We’re writing to inform you that we believe an unauthorized party gained access, for a period of time, to the Slicehost forum login database.  This database contains the email address, user I.D. and password that you selected to access this public forum (which is completely separate from the systems that run our Slicehost services).  Although all passwords in this database are encrypted, out of an abundance of caution, and in support of our policy of transparency with customers, we want to alert you to this situation. We have blocked all access to the forum database and will not bring it back up with existing I.D.s and passwords. We have also temporarily shut down the Slicehost forum.

You probably adhere to Internet best practices, which include maintaining a separate I.D. and password for each website and application that you use. (emphasis mine) If you do so, you need take no action, as the forum contains no personal information.

However, if you used your Slicehost forum I.D. and password in other places, including any Rackspace account, we recommend that you change those I.D.s and passwords.  In fact, the next time you attempt to access the Slice Manager, you will be required to change your password.  If you use the same password for the forum and for your Slicehost account, and you also use an API key, we recommend that you consider changing your API key as well.

During the period when the Slicehost forum is shut down, you can contact your Rackspace support team with any forum question you may have.

We apologize for our failure to maintain an adequate level of security on our public Slicehost forum, and for any inconvenience this may cause you.  We will bring back a great forum experience soon.

Sincerely,

The Slicehost Support Team

I can look at 1Password with 392 unique passwords and read this message without a worry in the world.

My favorite line in that note is the one that I’ve added bold emphasis to. I sincerely doubt even 1% of Internet users do that.