reset wordpress admin password using MySQL

If you wish to reset the password from cli, using MySQL prompt, use the following commands:

Login to server via ssh and go to MySQL prompt by entering the following in the cli.

$mysql

Use the corresponding database for the wordpress install. You can locate it from the wp-config.php file.

$use wordpress_dbname;

Check for table wp_users table.

$show tables;

Use the following to find the details of the table.

$SELECT ID, user_login, user_pass FROM (table_name);

Now update the password using the following command.

$UPDATE (name-of-table) SET user_pass=”(MD5-string_of_password)” WHERE ID = (accocunt_id_number);

For the latest MySQL versions, you can generate the MD5 using the MySQL.

$UPDATE `wp_users` SET `user_pass` = MD5(‘new_password’) WHERE `wp_users`.`user_login` = “admin_username”;

reset wordpress admin password using phpMyAdmin

First, log into phpMyAdmin and select the database associated with your WordPress installation. You can find it from the wp-config.php file. Once in your database, select the wp_users table.

Once the table is loaded, look for the username you had chosen while installing WordPress. Assuming the user name is admin in this scenario. Click on the edit icon, the little yellow pencil icon located next to the admin entry.

Look for the row named user_pass and make the following changes:

Change the Function field to MD5. Under the Value field, enter your new password and click on Save Changes.

Now you have successfully changed your WordPress password and reset the WordPress admin password. 🙂

Delete Files With Inode Number in Unix or how to delete files with special characters

You can use rm command to delete file.Sometimes, files are created with special characters like control characters and you will not be able to delete them, as you won’t be able to input them via a keyboard.

These files are not that easy to delete. Inode numbers comes in handy at this time.

You can find the inode value by using the following command.

geobaby@geo-desktop:~/Desktop$ ls -li
3539141 -rwxrwxrwx 2 geobaby geobaby    4096 2013-05-31 16:36 %$#%  ^%^??#$@#
3153532 -rwxrwxrwx 1 geobaby geobaby 3274861 2013-04-30 17:06 DSCF2091.JPG
3146249 -rwxr-xr-x 1 geobaby geobaby     476 2013-02-22 16:58 gnome-terminal.desktop

Next, use find command to remove the file.

find . -inum [inode-number] -exec rm -fi {} \;

And here it will be:

find . -inum 3539141 -exec rm -fi {} \;

The file will be removed.

Remove ^M characters in vi editor at end of lines

Sometimes on editing files in linux or windows, ^M (Control M) character appears at the end of lines in vi editor.

You can use sed command to remove the CTRL M characters.

$ sed -e “s/^M//” file > filenew
To enter ^M, type CTRL-V, then CTRL-M (use the CTRL keys).

You can do this in vi also.

Inside vi editor, in ESC mode, type the following

:%s/^M//g

Press Enter and you are done.

Wired ethernet not getting detected in Ubuntu

Recently I installed Ubuntu on my Desktop. But I met with a difficulty after the installation, my ethernet card is not getting detected.

I searched the repositories and I didn’t get far with that.

Then I searched this in Ubuntu forums, and found a thread similar to my issue.

A solution mentioned there was to install compat-wireless package and enable the module in the kernel.

I downloaded the package from http://linuxwireless.org/download/ and compiled it.

sudo apt-get update
tar -xjvf compat-wireless-x.x.tar.bz2
cd compat-wireless*
scripts/driver-select atl1c
make
sudo make install
sudo modprobe atl1c

and rebooted the machine. Voila!!!!! it worked and was able to connect to the internet.

FastInclude: Userdirname: (null) error after recompiling php and apache

I encountered the following error after recompiling using easyapache in cPanel server.

These were the errors that appeared in apache logs:

[notice] FastInclude: Userdirname: (null)
[Tue Jan 28 02:39:00 2013] [notice] FastInclude: Userdirname: (null)
[Tue Jan 28 02:39:00 2013] [notice] FastInclude: Userdirname: (null)
[Tue Jan 28 02:39:01 2013] [notice] FastInclude: Userdirname: (null)

The fix I was able to find was to remove the attracta plugin installed in the cPanel server.

Force fsck on next Reboot in Linux

By creating /forcefsck file, you will force the linux file system to do a complete file system check on next reboot or in the boot sequence.

To do this, login as root to the / directory and touch a file named forcefsck.

touch /forcefsck

Now you can reboot the system by the reboot command.