Manually reset your WordPress password

lost-wordpress-password

It doesn’t matter what application your working with, losing your password is always a pain in the ass. Luckly if you are working with wordpress (man, I blog a lot about wordpress these days), on your server and you have access to the MySql database, resetting your password manually is a snap.

  • Login to your PhpMyAdmin
  • Select your WordPress database and click on the “SQL” button to open the SQL query window.

wordpress-phpmyadmin

  • Paste the following code in the window textarea. (Don’t forget to modify the password and username before executing it)

UPDATE ‘wp_users’ SET ‘user_pass’ = MD5(‘PASSWORD’) WHERE ‘user_login’ =’admin’;

That’s it! Your password has been reset, and you should be able to login to your wordpress admin area once again.


			

Let cURL do your heavy lifting

curlrobot

In a previous post, I talked about using cron to do your bidding. If you do a lot of web development like I do, you may have some web based tasks that you need to automate. A good example of this could be clearing a file cache or tipping of a script to rebuild your xml site map.

One of the best ways to do that would to be cURL and cron together. cURL is an application used to transfer the contents of a url. Insistently, to transfer the contents of a url, curl has to connect to that url, and the server has to process that url/script… do you see what I am going with this? cURL can be used to do anything you would normally do from the url of your browser.

This is the usage of cURL:

curl [options] [URL…]

lets say you have the following URL that you want to connect to on a regular schedule
http://SomeDomain.com/SomeFile.php?var1=abc&var2=zyz

you would use the following cURL command:
/usr/bin/curl -G -d var1=abc -d var2=zyz http://SomeDomain.com/SomeFile.php

We are using the “-G” argument to simulate a “GET” command, and each “-d” is a variable/value pair

note: “/usr/bin/curl” is the location on my computer that cURL is installed

running cURL from the command line will show you results that get returned from the processing of the script.

To fully automate this processs, add the curl command into cron. now you are one step closer to world domination!

Troubleshooting: SoftException in Application.cpp:544

fixing the server

I recently moved all of my sites to a new dedicated web server. In the move my webhost helped me mirror my old applications and tilt them up on the new server. This is where my problems started, several of my applications just wouldnt run, they would throw out “500 errors”.

Checking my logs, the errors looked like this:

[Tue Dec 30 09:20:18 2008] [error] [client ip.address.here] SoftException in Application.cpp:544: Directory “/home/username/public_html/someDirectory” is writeable by group

I searched the error on google like any good geek would

I found several posts about the problem, but it all pointed down to the way that apache was configured on my new server.

I came across this post, and it really shed light on the subject for me:

“The specified directory name has been made writable by group. That suggests that your server’s apache configuration doesn’t allow you to make directories writable by group.”

In english, you’ve got the wrong permissions set on one or more folders.

I checked the directory location from the 500 error, and I saw that it’s permissions were 777, world writable. I changed the directories permissions to 755, and Apache was happy again and let the code run.

Simple as that. My new Apache install won’t run code that is in a public folder. This is a good thing for sure. If you are having issues like I was, check your permissions, and be careful what is 777!

Modifying MimboPro to Add Paged Navigation To Category Pages

Recently I have been doing a lot of work with WordPress. I love WordPress. one of the things I like most about WordPress is the plugins and themes.

I recently bought a copy of the MimboPro theme. Mimbo is clean and very professional. More of a CMS theme then a blogging theme, prefect for what I want to use it for.

As I dug into MimboPro and WordPress, I realized something strange, the MimboPro theme doesn’t support paging in a category view. What this means is EVERY SINGLE post you make is shown on one page. If you have a very active site, like the one I’m working on, this quickly gets out of hand. Look at this image and you will see what I mean (click for full version).

One of the reasons I like MimboPro was the support that the authors of the theme offer. I headed over to their message forums and found other people like me asking for the Additon of Paged Navigation To Category Pages. The original post was 8 months ago, and no one had resolved anything. I made a post to the MimboPro authors only to be told that there is going to be a new theme that will handle this and it will be available at a deep discount to MimboPro owner. This upset me a bit, so taking matters into my own hand, I fixed what Mimbo wont, and I am handing out my own patch to solve this issue. Below are the instructions to hack your own files, or you can just download my zip file with the pre-hacked files.

Pre-Hacked Files:
Download with pre-hacked files: JoshHighlands_MimboPro_CategoryPagingHack.zip

DIY INSTRUCTIONS (click images for full sizes):

  1. Save a copy of your current categories.php and styles.css files inside of the MimboPro theme directory to a safe location
  2. Open up categories.php inside of the MimboPro theme directory, and find line 17
  3. Comment line 17 with a double back slash (//)
  4. Go to line 87 of category.php and add the following code
  5. Save and close category.php
  6. Open up style.css inside of the MimboPro theme directory
  7. Add the following CSS code to the bottom of the file (should be close to line 852)
  8. Save styles.css
  9. Upload categories.php and styles.css to the MimboPro theme directory on your server
  10. Everything should be working. Here is what my wordpress running MimboPro looks like

That’s it! MimboPro will now have paging in all of the categories. The next and previous links will only show up when you have enough posts. The WordPress default is 10 posts. You can edit the number of posts by going to change the number of posts to show on a category page, go into to the admin and under “setting” > “reading” you will find the option, as highlighted here.

If you had any problem reading the code in the image files, download the zip files with the pre-hacked files in them.

Download with pre-hacked files: JoshHighlands_MimboPro_CategoryPagingHack.zip

If you have any further questions, please post them in the comment.