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. 🙂

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.

Spamd / Spamassassin error : argument isn’t numeric in addition / unparseable IPv6 address

I encountered the following error while restarting spamassassin.

Starting spamd: Feb 21 20:29:26.275 [8814] warn: Argument “” isn’t numeric in addition (+) at /usr/local/lib/perl5/site_perl/5.8.8/Mail/SpamAssassin/NetSet.pm line 122.
Feb 21 20:29:26.276 [8814] warn: oops! unparseable IPv6 address for 127/8: 168355856 at /usr/local/lib/perl5/site_perl/5.8.8/Mail/SpamAssassin/NetSet.pm line 128.
Feb 21 20:29:26.276 [8814] warn: oops! unparseable IPv6 address for 127/8: 168356228 at /usr/local/lib/perl5/site_perl/5.8.8/Mail/SpamAssassin/NetSet.pm line 128.
child process [8816] exited or timed out without signaling production of a PID file: exit 255 at /usr/bin/spamd line 2582.

The work around I found is to change cpanel to stable version and run upcp.

then do this,

sa-learn -D –force-expire
sa-update -D
/usr/local/cpanel/scripts/spamassassin_dbm_cleaner
/usr/local/cpanel/scripts/fixspamassassinfailedupdate
/scripts/restartsrv_spamd

This should fix the issue.

Glipper crashed with ValueError in load()

I found out that klipper is not working well in Ubuntu 11.10 version. I installed glipper in my machine and after a reboot, met with this error.

glipper crashed with ValueError in load(): invalid literal for int() with base 10: “\xcb#W\x84\xb0\x0e […] \r”

The workaround appears to be to just forget about the invalid history file (or move it away):

$ rm ~/.local/share/glipper/history

geo@ubuntu:~$ ll .local/share/glipper/history
-rw-rw-r– 1 geo geo 27041 2012-02-16 10:28 .local/share/glipper/history
geo@ubuntu:~$ rm -f .local/share/glipper/history

geo@ubuntu:~$ glipper &
[1] 7221
geo@ubuntu:~$ SHARED_DATA_DIR: /usr/share/glipper
Binding shortcut c to popup glipper
Changed process name to: glipper

Glipper started working again…

How To Find Large Files and Directories in Unix

Sometimes we need to find larger files in a file system when theres is a disk space issue.

This example finds all the files under /etc directory which are larger than 1000k:

geobaby@ubuntu:~$ find /etc -size +1000k
/etc/brltty/zh-tw.ctb

If you look at the file, the size if above 1000k:

geobaby@ubuntu:~$ ls -l /etc/brltty/zh-tw.ctb
-rw-r–r– 1 root root 1368836 2010-08-12 05:20 /etc/brltty/zh-tw.ctb

The following example will be helpful in cPanel or web servers.

find / -size +1000M : will list all the files above 1GB size.

find / -size +1000M > list

for i in `cat list`; do du -sch $i;done : will list all the files and their resoective size.

how to remove an IP from the cphulkd blacklist

cPHulk Brute Force Protection prevents malicious forces from trying to access your server’s services by guessing the login password for that
service.

By the following steps you can remove the IP from the cphulkd blacklist. Issue the commands from mysql prompt.

mysql> use cphulkd;

mysql> select * from brutes;
+————–+————————————————————————-+———————+———————+
| IP | NOTES | BRUTETIME | EXPTIME |
+————–+————————————————————————-+———————+———————+
| 4.9.23.6 | 5 login failures attempts to account geo@geo.com (ftp) | 2011-01-07 14:54:02 | 2011-01-07 14:59:02 |
+————–+————————————————————————-+———————+———————+
1 row in set (0.00 sec)

mysql> delete from brutes where IP=’4.9.23.6′;
Query OK, 1 row affected (0.00 sec)

mysql>quit

You are done.