Hello Jekyll

If you’re reading this, then the migration from WordPress to Jekyll is complete. WordPress is a great blogging platform, but it just doesn’t fit the way I work anymore. I spend my days using git and GitHub and everything I write is plain text in Markdown.

With Jekyll I can write posts using Markdown in my favorite text editor, Byword on iOS or Atom on everything else, then commit to GitHub to update the blog. Hopefully this will result in more frequent updates, but no promises…

Where Are The Comments?

I’m very grateful for all of the awesome comments I’ve received over the years. Unfortunately, comment spam is still a big problem. Even with tools like Akismet to filter comments, some manual labor is still required. Here are the numbers for my blog as of today:

Wordpress Spam

That’s right – there are 123 comments on the site and 170,348 were blocked as spam. There are also 94 comments that might be spam. Those need my attention. I exported all of the non-spam comments from the old WordPress blog. Those may come back someday, but probably not. In the mean time, you can find my contact information at the bottom of every page.

Unfollowing Users

A few readers have also asked me to add an Unfollow button for the sample social network in Rails Crash Course. Here’s how I made that happen:

I created a new branch called unfollow-user and added the Unfollow button.

Here are the steps I followed:

  1. Update config/routes.rb to include a route for unfollow_user. Since this removes a row from the database, I used the DELETE HTTP verb.
  2. Add an unfollow! method to app/models/user.rb, similar to the follow! method.
  3. Add an unfollow action to app/controllers/users_controller.rb, similar to the follow action.
  4. Add a Unfollow button to the view at app/views/users/show.html.erb. I also added some logic to show the correct button.

The changes are in this commit: 29fa67a

Hope this helps!

Destroying Comments

A reader asked if I could add the destroy action to CommentsController for the sample blog in Rails Crash Course. The changes are summarized below.

I created a new branch called comments-destroy and then added the destroy action.

Here are the steps I followed:

  1. Update config/routes.rb to include a route for comments destroy
  2. Add a destroy method to app/controllers/comments_controller.rb
  3. Add a Destroy link to the comment partial at app/views/comments/_comment.html.erb

The changes are in this commit: f410496

Note this is the same as Exercise 3 at the end of Chapter 5. The answers for all exercises are in the back of the book.

Hope this helps!

No “Getting Started” Tonight

The Getting Started with Ruby on Rails workshop has been cancelled due to lack of signups. That’s a shame, I was really looking forward to this one. Obviously I didn’t do the best job of getting the word out about this event.

Let me know if you were also looking forward to it and I’ll see if I can set up another session in the future. Another alternative might be something like a screencast or Google Hangout.

Keep Talking

I’m giving the beginner talk at this month’s Austin on Rails meeting. Come to Capital Factory at 7:00pm on January 27 to learn about Active Record Associations. After my talk, Steve Madere is covering Hobo. Austin on Rails is always a lot of fun. The Rails community in Austin is great, there’s free pizza, and drinks and socialization after the meeting.

I’m also leading an evening workshop called Getting Started with Ruby on Rails for General Assembly on Monday, February 2 from 7:00pm – 9:00pm. General Assembly is new in Austin, but the company has been around since 2011. Today they teach classes all over the world.

This workshop covers the tools used by Ruby on Rails programmers, the basics of the Ruby programming language, and the components of Rails and how they work together. If you know the basics of web development, and are curious about building web apps with Rails, come spend the evening with me and see what Rails is all about.

10 Years

I remember September 9, 1999 like it was yesterday…

Paige and I were living in a tiny upstairs apartment. Thanks to a friend of a friend, we were some of the first people in town to have a cable modem.

Back then it was uncapped and since we were officially helping to “test” it, I think it was free for the first few months. Going from around 50k dial-up to at least 5,000k cable made the internet a lot more enjoyable.

Also around this time I discovered a new program called Napster. It was a friendly place where people got together and shared music.  While you were downloading songs from other users you could chat with them about their collections.

The generosity of others, combined with the cable modem, meant I was able to download music faster than we could listen to it. It was fun to have friends over on the weekend and let them pick what they wanted to hear from my endless jukebox.

This was also around the time of our complaint to Domino’s Pizza.  Our pizza arrived cold, and Paige called to tell them about it.  The person on the phone replied “No problem Ms. Lewis.  We’ll get another pizza out to you right away.  You’re one of our best customers.  You’ve ordered over 100 pizzas this year.”  Apparently we ate a lot of pizza in those days.

The big news story at the time was Y2K.  Many people believed that at the stroke of midnight on December 31, 1999 every computer in the world would stop working.  This would cause a world-wide black out, stock markets would crash, dogs and cats would live together, etc.

I set the clock on my computer ahead to December 31, 1999 at 11:59 PM and watched it roll over to January 1, 2000.  Nothing bad happened so I wasn’t too worried.

In an effort to make Y2K seem a little scarier, some news outlets also reported on the 9-9-99 bug.  Supposedly, four nines was the code that told some mainframes to end the currently running program.  The theory was that when the mainframes encountered this date, they would stop working.

This sounded as ridiculous to me then as it does now. So, on September 9, 1999 I wrote my first ever blog post about the 9999 bug.  (That’s right kids, I was blogging when blogging wasn’t cool.)

I had a few web pages before that date, but this was the first thing I ever wrote in the “blog” style.  It was a title with a few paragraphs of text, posted on a certain date. I didn’t call it a blog, of course. I had seen a few people set up their web sites like this before and I wanted to try it out myself.

Things have changed a lot since those days.  Back then I updated the site by editing the HTML in notepad and using WS_FTP to upload the pages to a web server.  I’ve moved on through several different programs to write blog posts, but I made sure to preserve that first post through all of the moves.

Die Spammers

Do you have your own blog?  Is it full of spam?  Are you sure?

A while back a friend of mine asked me a question about her blog.  Everything looked normal in every newsreader except for Google Reader.  In Google Reader every post appeared to be nothing but pharmacy spam.

I looked for the spam in view source, I downloaded the feed and checked it, I even crawled through the PHP code looking for a clue.  Everything looked perfectly normal.  It wasn’t until I started digging through the database, that I discovered what was happening.

Somehow, the spammers replaced two plugins on her site with their own malicious plugins.  These new plugins changed the contents of each post based on the referrer.  That’s why spam only showed up when viewed by Google.

The clue was in the “wp_options” table in a field called “active_plugins”.  I noticed a couple of plugins that started with a dot.  For example, instead of “akismet/akismet.php”, the name was more like “akismet/.akismet.php”.

In Unix, file names that begin with a dot are hidden by default.  The initial dot is so subtle that most people won’t even notice it in the database.  Especially since there’s lots of other information in that field.

Discovery

Here’s a simple way to check your site for this kind of spam.  You can restrict a Google search to a single site by adding “site:domain” to your query.  For example, to search for the word Vaigra on my site try something like this:

viaghra site:anthonylewis.com

This should only show one result for my site – this page.   Put your domain name in place of “anthonylewis.com” to see the results for your site.  If you get lots of results, then you have a problem.

Removal

The first thing I did to remove the spam was change all of her passwords – WordPress, Database, and FTP.  We used much more secure passwords.  I have another post in the works that addresses secure passwords.

Next, I made sure she was running the latest version of WordPress.  Updating WordPress is getting easier all the time.  It’s always been a simple 2-3 step process, but now it’s almost automatic.

Finally, I removed the plugin files with the initial dots and cleared the “option_value” from the database for “active_plugins”.  This disables all of the plugins.  Don’t forget to enable the ones you really need.

Aftermath

Unfortunately, the spam on her site still shows up in Google’s cache.  It’s been over a week now.  I’m not sure how long Google keeps pages in their cache, but this should go away soon.

One option I would recommend if you’re having a problem with stale data in Google’s cache is the Google XML Sitemaps plugin.  This plugin maintains an XML file that lets Google know where to find things on your site and when they were last updated.

Help

Let me know if you’re having this problem.  I have a lot of experience working with WordPress and I would love to help you out.  Leave a comment below or click the Contact link at the top of the page if you’re shy.

I provide advice and guidance for free.  If you’d rather I log on to your site and completely remove this mess, I’ll do that for a small fee.

Why Facebook Will Fail

Everyday I log in to Facebook to see what my friends are up to.  It’s a great way to keep up with my old friends who are now 300 miles away.  Even with all of it’s current popularity, I feel like it will fade away in time.  Here are my reasons.

The Platform Was A Mistake

Thanks to the Facebook Platform, there’s always a new silly quiz to take or some other application wanting my attention.  I mostly ignore those things, but sometimes I give in.

This is where the problems start.  It’s not enough to just take the quiz, the quiz also wants you to invite all of your friends to take it, too.  Also, by taking the quiz, you have to agree to give the program access to all of your information on Facebook.

This has always struck me as a little odd.  I usually spend as much brainpower trying to make sure that this program doesn’t e-mail everyone on my friends list as I do actually taking the quiz.

Facebook Quiz

I believe a social network should be centered on the people involved.  They’re the reason the site exists.  The applications are just a distraction to get people to spend more time looking at the ads.

It’s a Walled Garden

Facebook released their API partly in response to my second criticism.  It’s closed.  There’s no way to share things on Facebook with other people, unless they’re also members.

What if I want to share my pictures and status updates with everyone?  This isn’t possible with Facebook, yet sites like Flickr and Twitter make it easy.  Also, what if I want to export my data from Facebook?

The Platform could easily be used to create applications to make sharing easier, but it’s against the terms of service.  Facebook recently shut down an application that made your data available as an RSS feed citing privacy concerns.

This is kind of a double-edged sword.  I think one of the initial reasons for Facebooks rise to popularity was the fact that it was initially only available to college students.  It was like a private club.  Obviously, that made outsiders want in even more.

Now that the site is available to all, there should be a way to make the data more readily available.

It’s Nothing New

Like I mentioned earlier, there are many other ways to share your information online.  Facebook is nice if you didn’t already have a blog or some other means of sharing your thoughts and pictures online.

Facebook does make it easier to keep up with friends, but it’s not rocket science.  A group of tech-savvy friends could just as easily set up a blog for each person, then subsribe to all of their RSS feeds.

For me, it seems like just another inbox sometimes.  Why should someone send me a message through Facebook, when they could just e-mail me?

I’ve also starting using the Twitter application so that my Twitter updates also update my status on Facebook.  If there was an application to make my friends status show up as a feed, I would probably never visit Facebook.

Thanks to the fact that the site is fueled by advertising, that’s never going to happen.

Blog Posts I’m Tired of Reading

I read quite a few different blogs.  I feel like I should since I sometimes write one.  I read mostly about programming and other technical things.  I probably spend 10-15 minutes per day skimming the headlines in Google Reader, looking for interesting articles.

It’s nice to have a few things to read while I’m waiting for a script to run or eating lunch.  Unfortunately, there are certain types of posts that seem to reappear regularly.  These are a few of the posts that I’m tired of reading:

How To Make Money Blogging

I know that some people make their living as a blogger, and I think that’s great, but I’m tired of reading about it.  What I really can’t stand are people who make money by writing a blog about how to make money blogging.

I’ve fallen into this trap myself in the past.  I created a few different blogs with Google and Amazon ads.  I even made a little money doing this, but it’s not something I can maintain for any length of time.

Blogs with lots of ads (especially ads that pop up on words inside the posts) make me a little uncomfortable.  Like I said, I still have a few blogs with ads on them, but I don’t really feel good about it.

If I never see another post about link baiting, SEO, or how to get on the front page of Digg again, it’ll be too soon.

Arguments About Nothing

For some people, everything is a religion.  There is no gray area, everything is black and white.  You’re either with us or you’re against us.  Windows vs. Mac, Emacs vs. Vi, Windows vs. Linux, Ruby vs. Python, the list goes on forever.

Use the right tool for the job and get on with your life.  Just because I use a Mac at home doesn’t mean I’m an idiot.  I use a Windows PC at work, and that doesn’t mean I don’t like Macs.

The worst are posts written by people who don’t really even know what they’re talking about.  For example:

“You should use a Mac since Windows computers always get viruses.”  I’ve never had a virus on any of the Windows PCs I’ve used.  Am I just lucky?

“Macs are overpriced, you can get a PC with the same hardware for a lot less.”  I look at a lot more than hardware specs when I buy a computer.  What about the operating system, the applications, the community, the build quality, the design?

I will never understand why some people spend every day of their life trying to convince other anonymous internet users that their way is the only way.  What a waste of time and effort.

Personal Attacks

To me, this is about the lowest thing you could possibly write about online.  Yet I still see these kinds of posts on blogs.

I can’t even imagine a situation that would cause me to try to belittle someone else online.  What can a post like this possibly accomplish? If you don’t agree with someone, why not just ignore them?

Maybe it has something to do with television.  Some people aren’t happy unless there’s drama in their life.  I guess it’s nice when people comment on the post and agree with your assessment of the other person.

Just like the endless debates I mentioned earlier, I’ve never seen anything positive come from a personal attack of someone online.  I don’t ever remember a time when a victim of one of these posts said “You know what, you’re right.  I’ll change my ways.”

That’s Enough For Now

I think I’ll stop here.  I’m not really sure what the point of this post was.  I don’t imagine it will change what other people write about, but it can’t hurt to try.

Maybe later I’ll talk about the kinds of posts that I enjoy reading.  In the mean time, what are some posts that you’re tired of reading?