Install php-mcrypt in a Centos 6

Posted by root on Sunday May 19, 2013 Under Bash, Centos, Linux, MySql, PHP

The default installation of virutalmin doesn’t come with additional PHP extensions which some php scripts may need, you have to manually install each php extension compare with easyapache from cPanel which you can install all at once.

Add centOS repo

For CentOS 5

rpm -Uvh

For CentOS 6

rpm -Uvh
yum install php-mcrypt

Check php.ini location ( /etc/php.ini is the default virtualmin php.ini location )

php -i | grep php.ini
nano /etc/php.ini

add extension to php.ini


Restart Apache Server

/etc/init.d/httpd restart

After adding centOS Repositories, you could install php extension from virtualmin GUI

Webmin > System Software Packages > Choose Package from YUM >

Click Browse YUM, type the php extension name in the search box and click find packing matching button, and then click the package name install.

Add php extension to php.ini from virtualmin GUI

Webmin > Others > PHP Configuration > Edit Manually
Don’t forget to restart apache server.

Most popular PHP extension you may need:
Format: extension = [extension name].so

•pdo_mysql (requires pdo)
•pdo_odbc (requires pdo)
•pdo_pgsql (requires pdo)
•pdo_sqlite (requires pdo)

Tags : | add comments

Disable or Enable All WordPress Plugins via the Database

Posted by root on Friday May 3, 2013 Under MySql, Wordpress

Before beginning, make a backup copy of your database. Then, login to your database using phpMyAdmin (or whatever), and navigate to the “active_plugins” column of the “wp_options” table using the following SQL query (edit the default WordPress table prefix “wp_” if needed):

SELECT * FROM wp_options WHERE option_name = 'active_plugins';

Once the active_plugins column appears, click to edit it. You will see something similar to the following, depending on the number and type of plugins you have installed:


That entire array of code represents every active plugin on your site. Thus, to quickly disable all plugins without using the WP Admin area, highlight the entire block of code, cut it out, and paste it into a safe, offline text file. After removing the code, click the button to save your changes and that’s it. All WordPress plugins are now deactivated (yet still installed, and with all plugin options intact). This obviously is a huge time-saver that really comes in handy during those mission-critical, time-sensitive situations where every second counts. Once you are ready to re-activate your entire set of plugins, simply cut/copy & paste the preserved code back into the “active_plugins” field. Click save and done.

Alternately, here is a one-second query to disable all plugins:

UPDATE wp_options SET option_value = '' WHERE option_name = 'active_plugins';

Upon execution, this query will clear the active_plugins field of all active plugins (duh), effectively disabling (without uninstalling or modifying) the entire set. This method is great if you plan on re-enabling each plugin individually, say, after resolving some heinous server error. Whereas the previous technique makes it easy to re-enable all plugins en masse, this query is perfect for simply “nuking” all active plugins with no remorse. 😉

Updated Method

Apparently, this method works only for WordPress versions less than 2.9. For 2.9 and better, use this instead:

UPDATE wp_options SET option_value = ‘a:0:{}’ WHERE option_name = ‘active_plugins’;

Tags : | add comments

virt-viewer Remote Access

Posted by root on Friday Apr 22, 2011 Under Debian, MySql, PHP, Remote Access

Virt-viewer has the capability to run locally and connect to a remote server, either directly to the libvirt daemon, or via an SSH tunnel. To do the latter, the following command will work for KVM (qemu) based hypervisors:


virt-viewer --connect qemu+ssh:// vmnamehere

With the above, you’ll have to enter your SSH password twice – first to establish the connection to the hypervisor and secondly to establish a tunnel to the VM’s VNC/SPICE session – you’ll probably quickly decide to get some SSH keys/certs setup to prevent annoyance.

Tags : , | add comments

Change joomla admin password using the database

Posted by root on Friday Mar 18, 2011 Under Centos, Joomla, Linux, MySql

workgroups_documentationDirect Editing of Database

If the methods above will not work, you have two other options, both of which require working with the MySQL database directly.

Change the Password in the Database

If the admin user is still defined, the simplest option is to change the password in the database to a known value. This requires that you have access to the MySQL database using phpMyAdmin or another client.

  1. Navigate to phpMyAdmin and select the database for the Joomla! site in the left-hand drop-down list box. This will show the database tables on the left side of the screen.
  2. Click on the table “jos_users” in the list of tables (note: you may have a prefix that is not jos_, simply go to the _users table for your prefix).
  3. Click on the “Browse” button in the top toolbar. This will show all of the users that are set up for this site.
  4. Find the user whose password you want to change and press the Edit icon for this row.
  5. A form will display that allows you to edit the password field. Copy the value

    into the password field and press the Go button. phpMyAdmin should display the message “Affected rows: 1”. At this point, the password should be changed to “secret”.

  6. Log in with this user and password and change the password of this user to a secure value. Check all of the users using the User Manager to make sure they are legitimate. If you have been hacked, you may want to change all of the passwords on the site.

The examples above change the password to “secret”. Two other possible values are shown below:

- password = "this is the MD5 and salted hashed password"
- admin  = 433903e0a9d6a712e00251e44d29bf87:UJ0b9J5fufL3FKfCc0TLsYJBh2PFULvT
- secret = d2064d358136996bd22421584a7cb33e:trd7TvKHx6dMeoMmBVxYmg0vuXEA4199
- OU812  = 5e3128b27a2c1f8eb53689f511c4ca9e:J584KAEv9d8VKwRGhb8ve7GdKoG7isMm

Taken from:

Tags : , , , , | add comments