Hello 2017!

I moved this blog from Linode to Digital Ocean this weekend, using a combination of GitHub, Ansible and good old fashioned sysadmin (me) sitting in front of a terminal. I also upped my security game, as you’ll notice by the nice https:// in the URL and lock in your browser. I’ll have more details later, but it has me feeling very in control of my personal digital destiny.

Which makes me want to blog. So Hello 2017! Expect to see more posts here in the near future.

2015 Year In Review

It is good to sit back and reflect sometimes and with today being New Year’s Eve, I thought it would be good to look back on what I have been doing this past year in 2015.

My wife Monica and I had our seventh son, Mario! He is super cute and huggable. He and the other boys keep me grounded and humble. Bonus: the company I work for is pretty family-friendly, I got to take a few weeks of Paternity Leave.

At work, I transitioned from leading a single Android team to leading several iOS teams. We shipped brand new, redesigned and modernized versions of our Capital One Mobile for iPhone and Capital One for iPad apps plus several monthly updates afterwards. I’ve now become what Lara Hogan from Etsy calls a “meta-manager” and I hope to find some time to write about that more in 2016.

I also helped to find ways for Capital One to invest back into the developer community. I think the Mac and iOS developer community was already strong but I want to make it even better. So we sponsored:

  • CocoaPods
  • Women Who Code
  • James Dempsey and the Breakpoints Live at WWDC
  • WWDCGirls
  • Swift Summit San Francisco 2015

I also organized the seventh annual iOSDevCampDC, along with Natasha (the Robot) Murashev, Jimmy Sambuo and Toria Dacus. We had some awesome speakers, but probably the most unique thing about this year’s is that the majority of speakers were female. I’ll have to revisit this in a future blog post as it deserves more time and attention. Plus I promised Cate Huston that I’d write about it sometime.

I also had a lot of fun with my hobbies, mainly playing video games with my kids (aka father-son bonding time) and watching eSports. I participated in the Alpha and Beta of Heroes of the Storm (currently our favorite multiplayer game in the house) and attended the action-packed and eSports celebrity-filled StarCraft II archon mode championship held at Red Bull Battlegrounds DC with my oldest son Diego, Jimmy and another coworker Cary.

I also spoke at a few events, including iOSDevCampDC, ModevCon, Android+Glass Meetup, Modev Coders Only and some internal events. I presented on a variety of topics including Swift, Frameworks and Kotlin. I’m working to encourage others to present as well. I’m organizing Modev Coders Only now and and it’ll meet monthly in 2016.

Before I go, I thought I should mark some stats for the end of 2015:

  • StackOverflow rep: 8,055
  • Twitter followers: 1,588

Well that’s it. I had much more to say in my unabridged blog post, but I think I’ll spread out that content over several posts. Hope that everyone else had a good year and hopefully 2016 is even better! Happy New Year everyone!

Fully Baking this Blog

Brent makes a plea for “fully baking your blog.” Another way to put it in the Mac community is to make sure your website can stand up to being “Fireballed” (verb) – when John Gruber links to your post and brings a deluge of traffic onto your website, bringing it crashing down like a house of dynamically generated cards.

I used to use Movable Type – which was nice but made me endure long generation times.  Hopefully that has improved since then.

Now I’ve installed WP-SuperCache on this blog as well as my company Happy Apps Blog (which are both powered by self-hosted WordPress). I think that’s probably the best compromise for self-hosted blogs without rolling your own blog software. It also allows you to continue using native clients like MarsEdit.

For some other sites that I host, like NSCoderNightDC, iPad DC and iPhoneDevCampDC that don’t change often, I think static files are indeed the best.

Blog Reboot

Twitter – that’s one word for where a lot of my writing energy has gone.  It’s such an easy way to get out a few words and there’s no pressure to be perfect.

Then again the pressure to be perfect really comes from myself.  But lately I’ve been feeling more of a pressure to write down more of my thoughts and that’s overriding that perfectionism.  So here I am again, this time armed with the latest and greatest MarsEdit 3.0.4.

Of course, every good story has some conflict.  Tonight I realized that my blog had been hacked.  It seems like there were some spam links that were hidden in the page. The only things I did notice was that:

1. Sometimes my theme would get reset.  Not a huge deal but annoying.

2. Every once in a while a new WordPress user would register for no reason.

3. MarsEdit couldn’t my recent posts, instead offering up a -32700 error.

Fortunately that last error got me to Daniel Jalkut’s helpful support forum which helped me find the answer: the wordpress.net.in spam injection hack.

So a quick backup, removal of the old site, and installation of WordPress 3.0.1 and this blog is back in business, now spam link-free.  It’s kind of like encountering the Blue Screen Of Death and hitting Control-Alt-Delete.  A Blog Reboot.

Now I remember why I use Apple products.  So is there a more hack-proof blogging engine out there that will preserve old WordPress entries?

Lessons Learned: Blank page of death after upgrading to WordPress 2.7.1.

I had the blank page of death problem when logging in to my blog after upgrading to 2.7.1. What this means is that after I logged in, I would just get a blank white page with no page source.

To workaround this, I was tediously moving the akismet directory or the plugins directory to login and then moving it back afterwards.

I finally fixed it by looking in the plugins/akismet/ directory and found an akismet_mmddyyyy.cache file and deleted it.

Lesson learned: Delete *.cache files in your plugins/akismet/ directory whenever you upgrade your WordPress blog.

UPDATE (2009-06-18): This problem happened again and I solved it by deleting any .* files in the plugins/akismet/ directory. Specifically, I found .akismet.bak.php and .readme.cache.php.

Lessons Learned: WordPress Comments Disappearing and Spam

Today I emailed my favorite coffee company Beanetics to ask them to have a repeating order of coffee and to remind them that I have the #11 Google hit for “beanetics.” OK its not #1 like it used to be, but it still good. While I was checking the permalink for the post, I noticed that all the comments were missing even though it said that there were 2 comments on the post.

I went to login and it didn’t let me in. I had this problem before so I renamed my wp-content/plugins directory. I logged in and there were 0 comments in the system! Yikes! All my WordPress comments had disappeared!

I went into the wordpress MySQL database and when I typed in “select * from wp_comments;” it replied back with the ominous but helpful: “table wp_comments marked as crashed.” Alright, I think we can fix that. I typed in “repair table wp_comments;” and it reported that all was well again.

I went back into my Comments admin and found that there were 10,445 spam comments! 10,445 – spam is bad but I didn’t realize it could crash your WordPress comments bad.

Alright so after verifying that all my approved comments were back, I had lunch. I came back two hours later and found I had 100 emails – all for pending spam comments. Oops – I had disabled the Akismet spam filter when I renamed my plugins directory earlier.

OK so to make sure this doesn’t happen again in the future:

1. I went to Plugins / Akismet Configuration and checked the box “Automatically discard spam comments on posts older than a month.”

2. I went to Comments / Spam and pressed the button “Delete All Spam”. That should tidy up the wp_comments table and the entire WordPress database quite a bit.

How to fix a corrupted WordPress comments table

I logged into my WordPress admin panel and saw these ominous warnings:

'./your_wordpress_database/wp_comments' is marked as crashed and should be repaired.

Uh oh. That doesn’t seem good. I went to one of my blog posts and it said the same thing. OK no need to panic. I run my own WordPress on a virtual private server and also administer my own MySQL databases.

The solution is remarkably simple:

  1. Run the mysql client. mysql -u your_wordpress_user -p
  2. Switch to your WordPress database. use your_wordpress_database
  3. Issue the command repair table wp_comments

If your WordPress 2.1 is slow…

I just debugged a strange issue with this WordPress 2.1 blog. It’s running 2.1.2 to be exact, but I think the problem manifests itself with all 2.1.x versions. My site was running really slow – 40-50 seconds per page load. I had just moved it to this new host which is also running a few Rails apps. The Rails apps were running *fast*, so it wasn’t the box.

I checked top and it showed the box was fine. I bounced Apache and MySQL. Still slow. I tried static pages – those were fine. I tried a phpinfo page – that was fine.

I googled and googled and finally found this WordPress thread: [resolved] Update a post and blam.. every pageload is 20 seconds. The solution? I had to add www.luisdelarosa.com to the /etc/hosts file. I guess WP 2.1 has some sort of reverse DNS code in it.

So – if your WordPress 2.1 site is slow, add your blog’s hostname to the /etc/hosts file. You could also backtrack to WordPress 2.0.1. I’ll have to look into moving over to Mephisto sometime.

Back from a blogging vacation

I’m still here… Just been taking a vacation from this blog. Sorry to be a dinosaur in your NetNewsWire or other RSS reader. More details soon. :)

Poor Man’s FeedBurner

I wanted to get an idea of how many subscribers I had to my new blog MacHappy. It’s a blog I started to talk about Mac stuff and also the Mac apps I’m writing which I call Happy Apps.

I thought about using FeedBurner, but I really like hosting my own feeds. Plus I haven’t had the need for their wide array of services yet…except for the readership count.

So back to figuring out how many subscribers / readers for a blog. MacHappy is on WordPress and its feed is at http://www.happyapps.com/blog/feed/, which means that the feeds all have “/blog/feed” in the URL. If you’re got a WordPress blog, you’ll have the same sort of setup. This blog is hosted on Movable Type, which is a bit different since usually you have atom.xml or whatever you call your feed template (usually ending in .xml). I’ve actually got two feeds here: a feed for everything and a feed just for Eclipse.

Then you download your log file from your ISP.

Then run this nice series of piped commands (for WordPress): grep /blog/feed yourLogFile | awk ‘{print $1}’ | sort | uniq | wc -l

(for Movable Type): grep .xml yourLogFile | awk ‘{print $1}’ | sort | uniq | wc -l

And for my eclipse.rss feed, something like grep .rss yourLogFile | awk ‘{print $1}’ | sort | uniq | wc -l

You should get a nice integer back, hopefully a nice big one. :)

It’s not exact since the same person could be checking from multiple locations throughout the day, but I think I’ll be using this to keep track of the trend.