From Technical Knowledge to IT Service Management

Archive for the ‘Tips and tricks’ Category

Theme and WordPress upgrade problems

I’ve recently tried to update a theme on one blog and during the theme upgrade I got this php error :

“Fatal error: Call to undefined function wp_get_theme(); in [...] /wp-content/themes/photolux/functions.php on line 27″

I tried to connect / reload the admin page, but the blog was down. There was no way to correct this error.

I launched the PhpMyAdmin interface to connect the MySQL database. You can either do it with a SQL script or through the web options. To modify the theme, you’ll have to find your options table (usually named wp_options if you don’t add / modify the prefix): Read more

Just lost your root password on MySQL ?

Loosing your root password on a MySQLserver could become tricky.

If you face this situation, you will have to stop your MySQL server

#/etc/init.d/mysql stop

One your database is stopped, you will start it again with 2 options to avoir authentication process but also avoid networtking connection to your unsecure database:

#/usr/libexec/mysqld --skip-grant-tables --skip-networking &

you will now be able to connect without password:

#mysql mysql -u root

One you are connected, you can reset your password and flush the privileges to apply changes on database:

MYSQL> UPDATE user SET password=PASSWORD('newpassword') WHERE user='root';

MYSQL>FLUSH PRIVILEGES;

MYSQL>quit;

Then restart mysql:

#/etc/init.d/mysql restart

And start using KeePass software to store your password !

Non alphanumeric files

If you want to list all the non alphanumeric files:

ls -R | grep -iv ^[a-z0-9\._-]*$

Log SQL results

If you’d like to log the result from a sql script, just prepare your sql script like that:spool result.log
SET SERVEROUTPUT ON
select * from dual;
spool off
exit

Then from a command line or a script shell execute the following command:
# sqlplus user/pwd@db_name @script.sql

Information Request

You’d like to have a post or a tutorial about linux (redhat, fedora) Oracle (database, 10g, RAC or OAS – oracle application suite), Nagios, Cacti,…

Feel free to ask and i’ll try to answer to your question.
Leave a comment with your question.

Oracle’s Certification Matrices

Because i didn’t find it quickly, i’d just want to publish this very useful link to publish this access to the Certify – Oracle’s Certification Matrices:
http://www.oracle.com/technology/support/metalink/index.html

    —°°°— 

Une petite info pratique que je souhaite publié parce que je ne l’ai pas trouvé rapidemment. Voici le lien pour acceder aux matrices de compatibilté Oracle:
http://www.oracle.com/technology/support/metalink/index.html

List installed oracle components

If you want to know which components were installed on your server:

$ORACLE_HOME/OPatch/opatch lsinventory -detail

The Deployment scanner – jboss

Start

The conf/jboss-service.xml file is full of options. One of these ones is about the deployment scanner. If you make any change in a jboss config file then you’ll have to restart the server.

Open the conf/jboss-service.xml in vi or some text editor capable of saving in plain text. Scroll near the bottom to the MBean definition for the DeploymentScanner:

Deployment Sorter

As you scroll down you should see some comments followed by this:

org.jboss.deployment.DeploymentSorter

This is the deployment sorter which enforces the default deployment order. Starting from 4.0.1, it gets the sort order from the MainDeployerss EnhancedSuffixOrder. If you prefer a UNIX System-V init style you can comment this sorter and uncomment the following line:

org.jboss.deployment.scanner.PrefixDeploymentSorter

This sorter will use a numeric prefix-based order. If you wish to use this sort, you should read further on the prefix deployment order.

Scan Period

As you scroll further you will find:

5000

The default value is 5000 milliseconds or 5 seconds. This determines how frequently the directories which the Deployment Scanner is watching (/deploy) will be polled. Of course it very usefull when you are under development. But when you a production server this option should be disable (because of waste CPU, or protect from unwanted productions changes)

URLs

As you scroll further you will find:

deploy/

It will defined where data (such as .ear or .war) for hot deployments will be used.
It could even be http://url or webdav url.
For example, if you wanted to protect the database passwords you might do this:

deploy/,datasources/

You could set the file system permissions on datasources/ such that JBoss could read them, but developers could not.

Recursive

Finally, you should see:

True

This will cause the deployment scanner to recurse into subdirectories. Read this for more informaton on the drawbacks.

Disable Hot Deployment

Add the following attribute:

false