Monthly Archives: February 2014

linux – change shell prompt without affecting the real hostname

echo “export SRVNAME=linux_server” > /etc/profile.d/bash-prompt

#Edit bashrc file to change PS1:
vi /etc/bashrc >>
shopt -s checkwinsize
[ “$PS1” = “\\s-\\v\\\$ ” ] && PS1=”[\u@$SRVNAME \W]\\$ ”

#Change shell title:

vi /etc/sysconfig/bash-prompt >>
echo -ne “\033]0;${USER}@${SRVNAME}:${PWD/#$HOME/~}\007”
chmod +x /etc/sysconfig/bash-prompt

wordpress – Notice: Undefined Index and Cannot modify header

It occurs when WP_DEBUG is enabled:

The WP_DEBUG option, added in WordPress, controls the reporting of some errors and warnings and enables use of the WP_DEBUG_DISPLAY and WP_DEBUG_LOG settings. The default value is false.

NOTE: The true and false values in the example are not set in apostrophes (‘) because they are boolean values.
define( ‘WP_DEBUG’, true );
define( ‘WP_DEBUG’, false );
Additionally, if you are planning on modifying some of WordPress’ built-in JavaScript or Cascading Style Sheets, you should add the following code to your config file:

define( ‘SCRIPT_DEBUG’, true );
Then the uncompressed versions of scripts and stylesheets in wp-includes/js, wp-includes/css, wp-admin/js, and wp-admin/css will be loaded instead of the .min.css and .min.js versions.

mysql – Host ‘host_name’ is blocked

By default, mysqld blocks a host after 10 connection errors. You can adjust the value by setting max_connect_errors at server startup:

shell> mysqld_safe –max_connect_errors=10000 &
The value can also be set at runtime:

mysql> SET GLOBAL max_connect_errors=10000;
If you get the Host ‘host_name’ is blocked error message for a given host, you should first verify that there is nothing wrong with TCP/IP connections from that host. If you are having network problems, it does you no good to increase the value of the max_connect_errors variable.

forwarding mail exim

yum install exim
mkdir /etc/exim/vhosts
vi /etc/exim/vhosts/linuxėyou.tk >>
info: [email protected]

vi /etc/exim/vhosts/linuxėyou.com >>

info: [email protected]

#Add virtual hosts
vi /etc/exim.conf >
domainlist local_domains = @ : localhost : localhost.localdomain : dsearch;/etc/exim/vhosts

#Create new router:
vi /etc/exim.conf >
virtual:
driver = redirect
domains = dsearch;/etc/exim/vhosts
data = ${lookup{$local_part}lsearch{/etc/exim/vhosts/$domain}}
no_more

service exim restart