Leaderboard (728 x 90)

Sunday, February 26, 2012

how to set proxy server for wget

In file /etc/wgetrc, edit this line.

http_proxy=[proxy_server:port]
ftp_proxy=[proxy_server:port]

Saturday, February 4, 2012

init: Id "x" respawning too fast: disabled for 5 minutes


In most Linux distributions this means that the system is booting by default into runlevel 5, which is supposed to respawn (re-start again after it’s been exited) a gui login via x windows, kdm, gdm, or whatever, but the system can’t locate the program. As a result below logs will keep appearing on your /var/log/messages for every 5 minutes.

Feb 4 08:55:25 server init: Id "x" respawning too fast: disabled for 5 minutes

However, “Id” can also indicate the absence or misconfiguration of another program, like mingetty, if init tries to respawn itself more than 10 times in 2 minutes.

Reason: You remove the “X Window System” and “GNOME Desktop Environment” but never modified the /etc/inittab.

Solution:

vi /etc/inittab

Change the initdefault id to 3 as below:

id:3:initdefault:

save and reboot your system


Or you may need to reinstall the “X Window System” and “GNOME Desktop Environment”.

yum groupinstall "X Window System"
yum groupinstall "GNOME Desktop Environment"

Clean up cache and log for magento


Create cleanup.php file in document root folder then put these code to it, edit database variables, save and run cleanup.php?clean=log or cleanup.php?clean=var


<?
$db['host'] = '';                    // Database hostname
$db['name'] = '';                    // Database name
$db['user'] = '';                    // Database username
$db['pass'] = '';                    // Database password
$db['pref'] = '';                    // Database tables' prefix

if($_GET['clean'] == 'log') clean_log_tables();
if($_GET['clean'] == 'var') clean_var_directory();

function clean_log_tables() {
    global $db;
 
    $tables = array(
        'log_url',
        'log_url_info',
        'log_visitor',
        'log_visitor_info'
    );
 
    mysql_connect($db['host'], $db['user'], $db['pass']) or die(mysql_error());
    mysql_select_db($db['name']) or die(mysql_error());
 
    foreach($tables as $v => $k) {
        mysql_query('TRUNCATE `'.$db['pref'].$k.'`') or die(mysql_error());
    }
}

function clean_var_directory() {
    $dirs = array(
        'var/cache/',
        'var/log/',
        'var/report/',
        'var/session/',
        'var/tmp/',
        'downloader/pearlib/cache/*',
        'downloader/pearlib/download/*'
    );
 
    foreach($dirs as $v => $k) {
        exec('rm -rf '.$k);
    }
}
?>



Reference: http://www.magentocommerce.com/boards/viewthread/36148/#t117754

Sunday, January 29, 2012

How to determine the version and edition of SQL Server

Question: How to determine the version and edition of SQL Server?
Answer: Connect to the instance of SQL Server, and then run the following query: 

Select @@version

An example of the output of this query is as follows:

Microsoft SQL Server 2008 (SP1) - 10.0.2531.0 (X64)   Mar 29 2009 
10:11:52   Copyright (c) 1988-2008 Microsoft Corporation  Express 
Edition (64-bit) on Windows NT 6.1  (Build 7600: )

Cannot resolve the collation conflict between "SQL_Latin1_General_CP1_CI_AS" and "Thai_CI_AS"


Cannot resolve the collation conflict between "SQL_Latin1_General_CP1_CI_AS" and "Thai_CI_AS" in the equal to operation.

Cause: Temp Table that was created by your sql statement use conflict collation with default collations of database or table you querying


Resolution: I install language in Control Panel > Regional and Language Settings for Thai then restart computer. After that, it works normally.