An Electrifying Superpower

Anonymous_Lightning_IconI like to think that I have many talents.  I write, I code, I can remember tons of useless trivia (as every geek should).  However, there’s one talent that I’d love to give up if I could.  In fact, it’s gotten to the point that I’m beginning to suspect that it’s a secret superpower of mine:  I’m positively electric.

Seriously, I am.

Maybe it’s the dry winter air, but recently every thing I do seems to build up a static charge.  Sit down on the couch?  Charge.  Stand up?  Charge.  Walk across the room while wearing rubber Crocs?  Charge.  The charge then gets released anytime I touch anything.  There’s the usual light switches or electronic equipment (like my computer) and the unusual (getting shocked THROUGH my rubber Crocs or on the non-metal portion of the stove).

It’s gotten so that NHL cowers in fear whenever I approach him.  He doesn’t want me touching him for fear that he will be shocked.  Oddly enough, though, JSL seems thrilled to be shocked and gets disappointed when I don’t zap him.  I think he’s purposefully trying to be the opposite of his brother.  Either that, or I haven’t gotten him with a big shock yet.

As far as superpowers go, this really stinks.  I’m not immune to my own power so I feel the pain of every jolt of static electricity.  Every time I reach for a light switch, I cringe.  Every time I grab my computer, I fear the inevitable shock.  Even while simply walking, I can often feel the static charge building and know that it can be released at any moment.

My only hope is that this super power is super charged by winter’s dry air.  As soon as spring rolls around, my shockings should get fewer and fewer and I’ll be able to touch my loved ones without them leaping away or cowering in fear of my electric touch.

Musical Maleficent

MALEFICENTSome of the most iconic movie music comes from Disney films.  From "When You Wish Upon A Star", to "Beauty and the Beast", to "Friend Like Me", to… well pretty much all of the songs from the recent Disney move Frozen.  An upcoming movie of Disney’s looks to continue the tradition.  Maleficent explores the story behind the famous Disney villain.  The glimpses I’ve seen of the movie from trailers makes it  Of course, it looks like the music is going to be incredible too.

Lana Del Rey has recorded a wonderfully haunting version of "Once Upon A Dream." Even better, until Monday, February 3rd, you can get this song for free from Google Play.  This song is definitely going into my Disney playlist ahead of Maleficent’s May 30th release.

Discovering The Classics

rg1024_cartoon_tv_smallThis past week, the boys and I have been discovering some old classics both on television and book form.  Growing up, I was a big fan of He-Man and the Masters of the Universe.  I would tune in every day to see what new schemes Skeletor had come up with and how He-Man and his friends would defeat the villain.  I even had many of the toys.

Fast forward thirty-something years and I noticed that He-Man is on Netflix.  I had toyed with the idea of introducing the boys to it for awhile, but decided to rewatch it myself instead.  One piece of advice to anyone thinking of reliving their childhood by watching old cartoons you grew up on:  Don’t.  Don’t watch them again.  Chances are, you’ll find the writing horrible and the animation simplistic.

I experienced this first when I watched the first episode of Voltron for the first time since my childhood.  I remembered an incredible show where five folks board robot lions that somehow combine into and incredible, evil-busting robot.  I saw a show with plot holes big enough for Voltron to fly through and animation that my memory had clearly digitally enhanced to make it seem better.

He-Man fared little better during my re-watching of the show.  It seemed very simplistic animation-wise and plot-wise.  To begin, I showed the boys the 2002 reboot under the theory that the more recent show (which I had watched when it aired as half-guilty pleasure and half-nostalgic remembering) would be better than the older one.  Before the boys could finish the reboot, though, NHL found the old show.  They began to watch that one.  After an off-hand comment by me, NHL then sought out She-Ra and watched that as well.

Oddly enough, as the bad writing was making me cringe more than Adam’s fearful pet (named Cringer for those non-He-Man fans out there), the boys were thoroughly enjoying the show.  They didn’t care about the poor animation quality or the bad writing.  All they knew was that He-Man was very strong and would constantly beat Skeletor no matter what evil plot he concocted.

On a personal level, I’ve been delving into a classic myself: Hitchhiker’s Guide to the Galaxy.  I had heard a lot of good things about this book and even got familiar enough with some of the often quoted lines to repeat them to people at the proper times.  (For example, giving "42" as the answer to any question asked of me.)  However, I had never actually read the book.  20 Geek points from TechyDad!

(Yes, I did just make a quasi-Harry Potter reference while writing about Hitchhiker’s Guide.)

Two Kindle eBook borrowings from the library later, and I’ve read both Hitchhiker’s Guide to the Galaxy and The Restaurant at the End of the Universe.  (The latter I read in under 24 hours.)  I’ve now moved on to Life, The Universe, and Everything.  I’m really enjoying these books and keep wondering why I didn’t read them sooner.

What classics have you read/watched recently or have you introduced to your children recently?

NOTE: The "cartoon tv" image above is by rg1024 and is available via OpenClipArt.org.

Self Promotional Failure

megafonoThere are many things in this world that I’m good at.  Give me a web application to build and I’ll excel.  Ask me to debug some JavaScript code and I’ll dive right in.  Is your CSS funky on mobile browsers?  I’ll whip up a nice, responsive design that scales from desktop to tablet to mobile device.  Want a shiny new WordPress website?  I’m on it.

One thing I’m not good at, though, is self promotion.

After helping SelfishMom with her WordPress plight, she asked me if I had a page that she could refer people to in case they wanted to hire me to work on some projects.  Yes, I am available for freelance gigs.  (I’m not available for parties or bar mitzvahs, though.  For some reason, kids just don’t find a guy writing HTML and JavaScript entertaining.  What do they know?)

Whenever I sit down to write my page, it winds up sounding too much like a boring, resume-ish listing of web technologies:

I have extensive knowledge of HTML, CSS, JavaScript, jQuery, XML, ASP, PHP, mySQL, Microsoft SQL Server, WordPress, and the Twitter API.

See?  I’ll bet half of you are asleep (WAKE UP!!!) and the other half are confused about what some of those strings mean.  You can no clue the cool things I can do when I put my knowledge to work.

I’ve been looking around for some examples of pages other people set up to advertise their services for hire.  Not just web coding, but speaking, social media promotion, and the like.  My conclusion:  There are some people out there who are really good at self promotion.  Maybe I can hire one of them to write the copy for my page.  Will trade promotional copy for web work!

However tough this is, I’m going to spend some time working on a "hire me for freelance gigs" page.  Look for it coming (hopefully) soon.

How are you when it comes to self promotion?

NOTE: The "megafono" image above is by roshellin and is available from OpenClipArt.org.

Recovering From A WordPress Disaster

Let’s say your day is going pretty good.  You are sitting down to write a blog post and have a great idea too.  As you bring up your blog to check on an older post you see something strange.  Nothing.  As in no posts on your site.  Fighting back panic, you try to log into your admin panel.  Maybe you are successful and maybe you aren’t.  In either case, you find that you can’t bring these posts back.

Just this situation happened to SelfishMom last week.  All of her posts were gone and, while she could log in to her administrator account and see the posts there, nothing she could do could bring them back.  She feared that a hacker had gained control of her site.  I’m going to show just how I helped her bring her posts back – as well as what I could have done had things gone differently.

Just a warning: This is going to involve some intense mySQL queries.  They will be very powerful, but can also be very confusing.  If you find yourself in this situation and don’t want to wrangle with mySQL, I can always help.  That help might come with an hourly rate, however.  You can contact me using my contact form on this site or message me on Twitter.

First, let’s launch phpMyAdmin.  Different web hosts have it set up different, so you might need to check with your host to see how to launch this.  Most web hosts let you launch cPanel by going to yoursite.com/cpanel.  You log in (with credentials given to you by your host), find an entry for phpMyAdmin and launch this.

Once you are in phpMyAdmin, you can access your database directly.  Your database should be on the left hand side.  Click on it.  (You might need to click on a + sign first to show the database.)  A series of mySQL tables will be shown.  Within here is all of your WordPress data.

Find one of your WordPress tables.  It should be named something like "wp_users" or "wp_posts".  The "wp_" prefix might be different depending on your setup.  For the purposes of this post, I’m going to list all of the tables using a wp_ prefix.  If your tables used a different prefix, just replace yours for wp_ in the following queries.

Let’s deviate from SelfishMom’s situation for a moment and suppose that she wasn’t able to log in at all.  How could she have reset her administrative password without having access to the administrative panel?  This is actually pretty easy via phpAdmin.  For brevity’s sake, and since they did such a good job on it, here’s WPExplorer’s tutorial on it.

Ok, now that we have a login, let’s address another concern: Hackers.  Did a hacker somehow gain control of SelfishMom’s site and make himself the administrator?  Click on the SQL tab in phpMyAdmin. A blank box will appear.  In here, type:

SELECT u.*, m . *
FROM wp_usermeta m, wp_users u
WHERE u.id = m.user_id
AND m.meta_key like ‘%user_level%’ and m.meta_value = 10

After you click Go, this will show you a listing of users who are set as administrators.  Ideally, you should see only ones that you have set up.  If you see any users there that you don’t recognize, those might be hacker accounts.  You can lower their access by noting the ID number in the listing.  (For the purposes of the query below, I’ll use the number 42.)  Typing in:

Update wp_usermeta Set meta_value = 0 Where meta_key like ‘%user_level%’ and ID = 42

and clicking Go will lower their access level to 0 (Basic access).  We could have deleted their account, but at this point I’d prefer to lower the access in case we need to use the account.

What if your account isn’t listed though?  This would mean you’ve definitely lost administrative access.  Let’s get that back for you.  Run the following query (replacing "admin" with your administrative username):

Select ID from wp_users where user_login = ‘admin’

Make a note of your ID number.  (You’ll need it again later.)  Now run the following query.  In place of your ID number, I’ll use the number 2.

Update wp_usermeta Set meta_value = 10 Where meta_key like ‘%user_level%’ and ID = 2

There’s one more administrative access level to check.  Enter and run the following query:

SELECT u.*, m . *
FROM wp_usermeta m, wp_users u
WHERE u.id = m.user_id
AND m.meta_key LIKE ‘%capabilities%’ and m.meta_value like ‘%admin%’

Again, this should show only your administrator account.  If a mystery account shows up, revert it to basic access by noting the ID number and running the following.  (Again, I’m going to use 42 in my example.  Replace it with the actual ID number.)

Update wp_usermeta Set meta_value = ‘a:0:{}’ Where meta_key like ‘%capabilities%’ and ID = 42

If your account wasn’t listed, run the following query (substituting your administrative ID – obtained earlier – for the number 2):

Update wp_usermeta Set meta_value = ‘a:1:{s:13:"administrator";b:1;}’ Where meta_key like ‘%capabilities%’ and ID = 2

Now that we’ve sorted out administrative access, log into your WordPress Admin panel.  Keep phpMyAdmin open though, we’ll need that later.  Once you are in, look for your posts.  If they are there, then try to make them live.  If you can, then congratulations.  Your troubles should be over.  You might want to secure your WordPress site more, though.

If you can’t make your posts live, then there are two other possible problems.  The first possibility is that your database has grown so large that it is bumping against the limit your host set for it.  To see how large your database is, run the following query:

SELECT table_schema "Data Base Name", sum( data_length + index_length ) / 1024 / 1024 "Data Base Size in MB" 
FROM information_schema.TABLES GROUP BY table_schema ;

This should give you a listing of one or more databases with sizes.  If your database sizes are more than what your host provides, then unfortunately there is little to do.  You will need to contact your host to discuss your options.

If your database is under the limit, then most likely the database tables have been corrupted.  Don’t worry, though.  There is an easy fix.  At the top of the page, above the Browse tab, the server should be listed.  Next to that should be your database..  Click on the database’ name to see a listing of database tables.  Next, click on the checkbox next to all of the tables relating to WordPress (all of the ones with the "wp_" or other prefix).  Finally, at the bottom of the page, click on the "With selected" drop down and select "Repair table."  The repair process should begin and, when it is done, you should see all your posts live again – just like SelfishMom did.

There is one possibility we didn’t cover yet, though.  What happens if, after you log in, you find that all your posts are gone?  While it is possible that they remain in the database somewhere and are recoverable, sadly this is too complex to cover here.  The best bet here is to have a good backup process in place and to restore your database from a known good backup.  You might lose a little bit of data in the process, but it’s better than losing everything.

I hope this has been an informative post on how you can recover your WordPress posts even under seemingly dire circumstances.  Hopefully, you’ll never need to use them.  Of course, should you find yourself in this situation and need some help from someone well-versed in the ins and outs of WordPress and mySQL, feel free to contact me.

1 42 43 44 45 46 300