The Shirt Stay Incident

When I was stationed in Maryland back in 96-99, I would sometimes have to report for duty up at Ft Meade, MD. Due to the high profile of my duty station at the time, Commander, Naval Security Group, I was required to wear my dress uniform more often than not.  I had no problem wearing it, but the Navy summer dress uniform had a major problem: the shirt tended to creep up and become untucked over the work day.  The solution? Elastic!  shirtstays

I purchased shirt stays from the local NEX (Naval Exchange), and here’s how they work: You attach the top parts to the front tails of your shirt, both on the left and right side, then the other two are snapped to the left and right rear tails of your dress shirt.  Once attached to your shirt, you would put on your socks, and pull down the elastic bands and attach to the top of your socks.  Once they were properly attached, you’d put on your dress pants and shoes.

To make it even more secure, us sailors would wrap the shirt stays around our legs. I would attach the upper clasp to the front-left tail of my shirt, and wrap the elastic down around my leg and attach it to my sock on the back of my thigh.  Then the front-right tail of my shirt would be attached to the back of my right sock.  Then I’d reverse it for the rear tails…attach them to the front of my socks.  It kept my shirt tucked in at all times, and it looked AWESOME.

I used shirt stays safely for about three or four years without incident.  Hell, I just typed “used without incident”.  Back then, my brain never thought that there would ever be an incident.  I was sadly mistaken.

I don’t remember exactly who I was with, but one fateful day I went out on a smoke break with a buddy (from here on out known as Buddy).  Buddy and I had to walk almost a full city block from our office at CNSG to the smoking area out in the front of the building.  Buddy and I were about halfway to the smoking area and I felt a little nudge on my right sock.  The front part of my right sock felt like it sagged a little bit.  I kind of looked down, acknowledging that something was a bit off kilter, and then Buddy said “Dan, are you listening?”

“Oh, sorry…what was that?”, I said as we turned a corner in the basement of the building.  The hallway got a bit brighter, and Buddy got quiet…we were walking up on the quarterdeck of CNSG.

To those not in the Navy, when approaching/crossing the quarterdeck of any Navy ship or shore station, you always show respect.  Think of it as walking into a church/library combination where you are on your best behavior, and also talking with your lowest voice.

Buddy said “Hold on…”, as we walked towards the quarterdeck.  The Officer Of the Day (OOD) just happened to be walking back from the cafeteria (I know, “galley” in Naval terms, but we were on a shore site….and the Philly Cheese Steaks were better than anything you’d get on a ship!) with his lunch, so we moved out of his way.

This is when my life was truly altered.  I remember Buddy walking along side of me on my right, and the Lieutenant acknowledged Buddy and I as he walked past.  As I moved to my right, I felt something move on my right sock…

Then everything happened in slow motion.

I felt the clasp become undone on my sock and then felt physics come into play. Upon reflection there was no sound to what happened next, but if it were a movie, it certainly would have sounded like a balloon popping. The metal clasp on the front of my right sock opened and the elastic contracted at damn near light speed, inside my pant leg, as I was walking.

My right leg was extended forward and I felt the metal clasp shoot up my leg, again, remembering this all in slow motion.  The lower clasp shot up and…doing what elastic does…it didn’t just stop once the elasticity was expended.  It continued further up.

My right foot touched the ground just as the metal clasp finished its slingshot journey up my leg, right into the worst possible location:  My boys.

If you are a male, imagine the feel of a rubber band being extended and shot onto your boys from a distance of three feet.  If you are female, think of…uh…I dunno….the worst rubber band pain? I honestly don’t know.

The next thing I know, I’m laying on the ground in front of an admiral’s quarterdeck, in a fetal position, with tears coming down my face.  My mouth is wide open in a cry of pain, but there is absolutely no sound coming from me.  I am cupping what I think is left of my twigs and berries.  At that point, I honestly thought, due to the pain, that everything had been cleanly severed and I’d never ever have kids.

My next memory is the LT kneeling down and…I smell his cheese steak.  Yeah, that’s my thought process…FOOD.

“Petty Officer Gilmore, are you OK?  What’s wrong?”, said the LT.

He’s holding my shoulder in one hand, and his carryout cheese steak in the other.  I tried to stand up and just kind of laid there, whimpering.

“Sir, I’m fine…I just had a…uniform accident. My shirt stay…kind of….didn’t”

Once I said that, I heard a guffaw from Buddy.  I rolled over (still laying on the ground in dress whites) and saw Buddy laughing so hard he was crying and doubling over.  I can’t blame him, as I would have probably laughed my ass off as well.

So, a few minutes later, there I am, outside an admiral’s quarterdeck, sitting in a leather bound chair.  Many a sailor has already passed by me, giving me a weird look, mainly because I was still holding my junk in pain.

In conclusion, Buddy and I went and smoked, I stopped wearing shirt stays, and I missed out on that Philly cheese steak for lunch….

 

How would YOU build this solution?

In my organization, we have a 24×7 help desk, and they asked me to create a custom theme for their use to track system outages, and provide daily summaries to upper management. This will be on a WordPress Multisite installation and the subsite will be private for only the helpdesk and management.

I first installed Advanced Custom Fields and WP Posts 2 Posts based on recommendation from Jesse Peterson.  I created two custom post types, Outage and Summary.  What I want to do is have each outage be a separate post, and at the end of the day, the Summary post type would list each outage that happened on that day.  In addition to the outages, the summary would also have info pertinent to that day, such as personnel, etc.

Jesse showed me an example of how he did it on one of his sites, and it looked really slick.  I’d like to have the main page be a chronological list of outages and summaries (got that part done), and in the right primary column, list the summaries in order.  When I click on the summary, I want the list of outages on the main content portion.

I’m not looking for folks to write code, but I’m curious how you would go about creating this solution.

My Movember, 2012

As most of you know, when I try to grow facial hair, I tend to look like a 13 year old Guatemalan boy.  On estrogen.  With that said, for the last four years, every November I’ve been growing a moustache ridiculing myself for money. What is this madness? Why would I do something like this?  What drives me to continue?
[Read more…]

Serving is Serving…Regardless of Sexuality

This post is probably going to piss off some people, and quite frankly, I don’t give a shit.

[Read more…]

Programatically Changing Users’ Roles in WordPress Multisite

Background:

I inherited three different WordPress installations (each one on a separate closed network) from a developer that was leaving our contract for a government civilian position.  I had a grand total of five days to pick his brain about WordPress, and our infrastructure.  It sucked, greatly.

We had two custom Roles in our installations: Blog Owner, and Team Admin.  Blog Owner (listed as ‘owner’ in the database) was the role assigned to the Administrator of a personal blog (a blog with only one user, and said user was the administrator).  Team Admin (listed as ‘teamadmin’ in the database) was the role assigned to users that were Administrators for a “Team Blog”, basically a blog with multiple user accounts associated to it.  Why did we go this way? I have no clue.  I was not part of our organization at that point.

When I upgraded everything to WordPress 3.2.1, Administrators, Blog Owners and Team Admin’s seemed to lose some abilities.  In particular, they did not have the ‘edit_theme_options’, or ‘list_users’ capability.  Upon further research, it seems that I now have two major problems:  The upgrades did not recognize my custom roles, and thereby did not apply the appropriate capabilities to those roles. I looked through the database and saw that I’d have to change over 9,000 records in the wp_usermeta table, on one network alone.

Did I mention that on one network I have over 6,590 blogs, with over 12,000 users?  Yeah, that’s a lot of user editing that I would not do by hand.

Solution:

After much discussion via Twitter, I came up with the following little piece of code that is working for me, and I hope it helps with others.  With regards to the paths, I have this as a php page in a subdirectory of the home directory of our WordPress installation, hence the ‘../’ in each require statement.  Edit that as you need.

global $wpdb;
ini_set("display_errors", "1");
define("WP_INSTALLING", true);
require('../wp-config.php');
require('../wp-blog-header.php');
require('../wp-includes/registration.php');
get_header();
/*
*  Edit this variable to reflect the custom role you want to change.
*/
$role_to_update = 'a:1:{s:5:\"owner\";b:1;}';
$results = $wpdb->get_results("select * from wp_usermeta where meta_value=". $role_to_update .";", ARRAY_A);
if (is_array($results))
{
foreach ($results as $result)
{
//  This line pulls out the blog_id from the meta_key, i.e., 'wp_BLOGID_capabilities'
$blogid = mb_substr($result['meta_key'], strpos($result['meta_key'], '_') +1, strrpos($result['meta_key'], '_') -3 );
$user_id = $result['user_id'];
switch_to_blog($blogid);
$user = new WP_User($user_id);
//  Make sure you have the correct role here that you want to remove.
$user->remove_role('owner');
$user->add_role('administrator');
restore_current_blog();
}
}
echo "DONE!";

This is quick, dirty, and ugly, but it’s working for me. I would LOVE feedback on how to do this better, cleaner and/or more efficient!

You Can Help, You Just Might Not Know It Yet

I have been a WordPress developer for about 3 years, coming from a .NET background.

I run three different installations of (finally) WordPress 3.2.1 on three separate networks.

I converse on a daily basis with some of the best and brightest of WordPress developers, from the hobbyist to the WordPress core developers.

I have been repeatedly invited down to Washington D.C. to have dinner and/or beer and catch a Caps hockey game with one of the core devs who is also an Automattic employee.

I was asked to present at a potential WordPress conference in D.C. about how the Intelligence Community uses WordPress.

I have in my iPhone the number to the author of one of the biggest selling WordPress technical books available (Two editions!).  I was interviewed for those books.  In fact, he may or may not owe me money…need to look into that again.

I met Matt Mullenweg. I had a beer with him in San Francisco.  I told him how I utilize WordPress in my professional career, and he said “WordPress is used in the Intelligence Community? COOL!”  That’s pretty much one of the coolest things that could have been said to me.

With all of that said:  None of that goes to my head.  I am not trying to brag, just making a big point.

I am a newb, a functional WordPress idiot. 

Compared to all of those folks above (and many more folks), I am pretty much a drunken silverback gorilla trying to create source code with one hand behind my back and my good thumb removed.  I ask people questions about WordPress multiple times a day via Twitter.  I’m like your best friend’s little brother tugging on your shirt sleeve asking “Hey, can I play too?!?!?”  That’s how I see myself.  I know we all start at the bottom, and I’ve received nothing but awesome help from everyone involved in the WordPress community.

I was mentioned by Jane Wells in a her blog post “In Praise of the Forums”.  She makes really good points about how we, as a community, need to help each other, and the WordPress.org Support Forums are a great place to help out. Personally, if I post a question in the forums, I try to answer/comment on at least five threads.  I may not be able to fix a person’s problem, but at the very least, I’ll steer that person in the right direction.  The best case scenario is that I fix the person’s problem and learn something in the process.  Win-Win.

Now, what’s with the title of this post?  Well, don’t scare the newbs.  When I first started going to the forums, it was to leach knowledge.  I was scared and intimidated to provide help.  I won’t rehash what Jane posted, but it all boiled down to “Holy crap, the mod’s know 109348 times more stuff than me, so I’ll let them handle it”.

I was way wrong.

We, as a community, need fresh blood helping out in the forums.  Just because you haven’t had a slew of core edits added to trac doesn’t mean you can’t help out.  There are a lot of simple fixes.  You, as a WordPress dev, may be surprised at how much you could help.  Please, take 5-10 minutes out of your day, scroll through the threads, and see if you have any ideas  on how to help out someone else.

In the small amount of time that I’ve been on the forums I’ve been hit up on Twitter asking for help.  That kind of blew my mind.  Someone wanted my help.

I’m contributing, however I can. Contributing to a much bigger thing.  It feels good, and it really made me smile.

 

 

Multisite Blog Lifecycle Audit – My First WordPress Plugin…or not?

So I’ve been inspired to write a plugin for WordPress after attending my first WordCamp San Francisco.  I wanted to help contribute back to the WordPress community, but my chops for helping contribute to core code are not good enough.  With that said, I figured I would look for something I need at work that is currently lacking in WordPress and see if I could figure it out myself.

[Read more…]

WordCamp San Francisco – A Conference That Changed My Brain

Here I am at home, near Baltimore, MD, blasting some metal music (Machine Head & Trivium, just in case you were wondering, @jarret) while typing this, and I really can’t get this shit-eating-grin off my face. WordCamp San Francisco 2011 was beyond anything that I could have imagined. I was in a town car going from my hotel to the San Francisco airport on Sunday morning, looking at Twitter, and following the #WCSF hashtag, and I realized that I was going to miss a lot of information on the last day. I’m not going to lie: I wanted to turn the car around and figure out the airline issues later. So much had happened since Thursday night that I realized that I’d be missing out on too much. Unfortunately, I never tapped the driver on the shoulder. This post is a thank you to everyone that made this WordCamp possible, and to the folks that make the WordPress community so damned awesome.

I am on Twitter and follow a good number of WordPress folks, but I was sincerely apprehensive about flying across the country and being with about a thousand folks smarter than me. I tweeted my anxiety about going to the annual WordPress conference, and I received a response from Jane Wells, one of the people involved in setting this whole thing up. While it made me feel a little bit better, I still didn’t know many people, or who I to hang out with during my time in San Francisco. Why was I worried about that? I knew that San Francisco would be teeming with people that I could learn from. I was just too scared to approach anyone. I’ve have what I think is a good online relationship with a ton of WordPress folks, but again, it’s all online. I’m sure you all felt the same apprehension when you attended your first WordCamp, so I hope I’m not alone. With all that said, I would like to now thank a handful of folks that made my first WordCamp San Francisco one of my best experiences, both professionally and personally.

Aaron Brazell@technosailor

I “met” Aaron via a co-worker when he still lived in Maryland, a few years back. I had no idea that he was writing The WordPress Bible, nor did I know how damned smart he was. I needed a way to prevent all users from changing how permalinks were displayed, and Andrea Baker pointed me in his direction. He posted a comment on my blog, giving me the full code of an Mu-plugin that prevented users from changing the permalink option (or any option, really). Since then, he and I have chatted via Twitter, Facebook, and on the phone about a multitude of things, but we’ve never had the chance to sit down and chat (especially over beer).

This changed on the Thursday I arrived in San Francisco. We had made plans to meet up at The 21st Amendment Brewery and have a few beers. We had beer and chatted WordPress, the Ravens, but mainly had beer. It was awesome. Then the next two folks wandered into the bar…

Ryan Duff@ryancduff

I knew Ryan on Twitter via Aaron. At first impression, he was a pretty quiet laid back dude that didn’t say much. That changed quickly :) He’s very smart about a lot of WordPress stuff, and has a very quick wit. I had to make sure he wasn’t a Steeler’s fan, though, being from Harrisburg, PA…

Andy Stratton@theandystratton

I actually didn’t know about Andy until the week of WCSF when I saw a retweet from Ryan Duff about Andy possibly hiring WordPress devs in the Baltimore area. I’m not looking for another job, but I loved the idea that Baltimore had some WordPress developers living here. Andy, Ryan, Aaron and I sat and drank a few while waiting on the next guest…

Melanie Nelson@sfgirl

Melanie is awesome. I don’t now how else to put it. She arrived about an hour after the four of us were deep into WordPress talk (and beer) and she jumped right into it. She’s also very pretty (don’t beat me Aaron!). The five of us sat around for a couple hours and talked WordPress, WordPress people, and had a grand old time. The kicker? I hadn’t known her for more than two hours, but her and Aaron drove me back to my hotel. It was a cheap taxi fare back to the Hilton on O’Farrell, but the fact she said “Get in the car, Dan” with such authority made me respect her like +100.

Otto@Otto42

I didn’t know anything about Otto until Saturday morning when I was talking to Aaron before the first session. Now that I’ve learned about him, I feel like a total WordPress newb. Aaron introduced us, and somehow the talk went to beer (shocker!). Now that I’ve talked to Otto in depth about beer, I now need to go find Pabst Blue Ribbon on tap. He says it’s good. Since he’s a homebrewer, I’m going to trust him.

He was also one of my favorite presenters at #WCSF, apparently reprising the Nacin & Otto show from Montreal(?)

Sara Rosso@rosso

Sara presented the first session on Friday, about the WordPress Ecosystem. She works for Automattic, and introduced me to the VIP options within WordPress. I broke my “ask a question at a WordCamp session” cherry by asking a question that I have completely forgotten now.

After the session, I did meet up with her and ask about government contracts and whether WordPress.com has any current contracts. They do, but not in my realm of the government. I will be emailing her soon about possibly getting a WordPress brainiac on contract :)

Andrew Nacin@nacin

This dude is not human. He’s a robot. Hence @nacinbot. Seriously, Nacin (that’s how I know him) is a machine when it comes to WordPress code. He and I connected via Twitter after last year’s WordCamp Baltimore, and also because we’re both fans of the Washington Capitals. He’s been trying to get me to go to the WordPress DC Meetup, and after #WCSF, I finally rogered up to going. I can’t wait to sit there and pick his brain about WordPress (and feed him beer).

Mark Jaquith@markjaquith

Mark is another WordPress developer that I can’t talk enough about (without sounding like a stalker). I use his Subscribe to Comments plugin at work, and I thank him for it daily (in my head). When I realized he’d be hosting a session at #WCSF, I knew I had to be there. Then I read what it was about: Scaling WordPress in the Enterprise. With over 12 thousand blogs on one server, I felt the need to attend his session. I took literally four pages of notes. One of the best lines from his session: “VCS or GTFO”. Just that on a slide. Sadly, I’m going to be hard pressed to get the government to go along with all of the great ideas I brought back.

Also, Mark is like six foot twenty, and his hair is epically awesome.

Jane Wells@Janeforshort

As I said above, Jane helped to calm me before my trip. While I was not able to bake cookies, I was somewhat calmed. From what I could tell, being my first WCSF, she did one hell of a job coordinating a conference for about a thousand web dorks. On top of that, she was part of sessions, and made it out to the happy hours. It’s the COMMUNITY of WordPress that makes me happy, more than the software. Folks like Jane, and anyone that coordinates the WordCamps need to be praised more than they are. Jane? Please let me buy you booze the next time we meet at a WordCamp?

Brian Gardner@bgardner

I only met Brian in passing while I was smoking a cig outside Pedro’s, but he’s pretty much the man at Studiopress.com with the Genesis Framework. I had tweeted him about a month ago, asking if I could use Genesis on *any* website I admin’d and he said yes. To me, coming from a Microsoft background, that sounded too good to be true. I asked him if it was ok to use the themes on my clients site, and he said “Oh, I thought I responded to your tweet?” To which I responded: “Yeah, but that sounded too good to be true.” He just smiled and said “Go ahead, man” with a bigger smile than what’s in his Twitter profile pic. Again, coming from a Microsoft background, this blew my mind.

Jarret@Jarret

I’ve only known Jarret via Twitter, and I knew of him via @andrea_r and @ipstenu in our tweets about WordPress Multi-site. He’s a really cool dude, metal-head, and sadly, I only had about 10 minutes to chat with him outside the 21st Amendment. I can’t wait to get back out to the west coast and have a few beers with him, and pick his brain too.

Matt Mullenweg@photomatt

There’s really no better way to explain this. I was drinking with Aaron and Melanie, and as I got drunker, I saw some other WordPress folks on the other side of the bar. One of them was Mr Mullenweg (that’s how I thought of him, since his code pretty much affords me a living, and we’d never met) and a slew of core contributors. I took the picture up top later in the evening. Without those folks, WordPress wouldn’t be where it is today. From left to right: Matt Mullenweg, Mark Jaquith, (someone I need to meet next WordCamp), Jane Wells, Daryl Koopersmith, and Nacin.

I remember walking over to where Matt was hanging out, and there was a bar stool open next to him. I sat down, and while a couple of other folks recognized me and nodded their heads, Matt was talking to somebody about a particular part of the WordPress code, and I didn’t want to interrupt. Once there was a break in the conversation, I offered him my hand and introduced myself. The only way I can describe the meeting to non-WordPress folks is this: Imagine meeting someone that helped create something that you now make your living on. That’s what I was feeling. This guy, younger then me by 10 years, created something that I am now using to support my living.

I explained to Matt how I used WordPress: I run WordPress on three different closed networks for the Intelligence Community, but sadly it’s not up to the latest version (We’re using WPMu 2.8.6…don’t hate, it’s the gov’t). Matt said something to the effect of “The IC is using WordPress? COOL!”

My weekend?

Made.

Conclusion

All in all, WordCamp San Francisco changed my life. I know that sounds like some emo/hipster cliche, but it’s true. I had no idea there were so many people out there that had such a passion for a little web app like this. I met so many cool and smart people. I realized that they devote a large part of their life to this open source codebase. They make it their mission to make WordPress a better product.

I’ve been inspired and motivated. I want to contribute to the core code. I want to make WordPress better. How am I going to do that? I have no idea. I’m going to try and make a plugin first. I contribute to the WordPress.org forums and help where I can. I’m going to continue to communicate with the WordPress community, because honestly, there’s no better software community out there.

Thank you, WordPress Community, for welcoming little old me into your arms. I can’t wait to contribute more.

 

Boating on the Bay

Nancy and I finally bit the bullet and took our boat out on the Chesapeake Bay.  This is kind of a big deal because, well, our boat is pretty small compared to the behemoths out there.  We have a 16 foot Tracker bass boat with a 65 horsepower outboard.  We bought the boat this April and have only used it on a small lake with just the trolling motor.  We haven’t used the “real” engine until this past Saturday.

We put the boat in at Sandy Point State Park right by the Bay Bridge, and honestly, we had no idea what the hell we were doing.  I had just passed the Maryland Boater’s Safety Course online, and it was a LOT of information to take in.  As my buddy Chris said, it really boils down to “Don’t hit anything…boats, crab pots, sandbars, etc.  Also, leave your ego on the boat ramp.”  He taught me more in the 2+ hours we had him and his wife on the boat than I learned in the entire course online.  Thanks again, mi amigo.

So, here’s a quick video that Nancy took of the boat at full speed (about 28mph) out on the open bay.

Cancer Sucks

DISCLAIMER

THIS POST IS EXTREMELY PERSONAL AND DESCRIPTIVELY GRAPHIC ABOUT URINARY HABITS

This post is extremely personal. I was originally posted back on Dec 13th, 2009 on my old blog, and since it’s been two years, I figured I’d re-post it in order to serve as another public service announcement.

In short, I was diagnosed with possibly having bladder cancer.  I was 35 at the time, and I made jokes about having cancer, just to deflect from the fear.  I literally scared myself, my wife, my family, and my friends because I was too much of a pussy to go to the doctor.  I am reposting this for many reasons.  First and foremost, bladder cancer kills.  Second, don’t be a pussy like me, and avoid the doctor.  The roller coaster of emotions that you put your spouse and best friends through will torment you for the rest of your life.  I will never forgive myself for that.

Having said all that, here’s my story.  Remember, this is from Dec of 2009, describing what happened to me in April/May of 09.  Also, when I typed it up, I’ll guarantee I was sauced.

[Read more…]