Tuesday, November 6, 2012

Improve system performance

Improve system performance
 
Tip: Find Linux major and minor page faults to improve system performance. Once the number of page faults gone down the performance of the daemons and entire Linux os will go up.

ps -o min_flt,maj_flt PID
ps -o min_flt,maj_flt,cmd,args,uid,gid PID-HERE
sar -B 1 10

Tuesday, October 30, 2012


INSTALL MYSQL-WORKBENCH ON UBUNTU


Steps are simple:

 
1wget ftp://ftp.gwdg.de/pub/misc/mysql/Downloads/MySQLGUITools/mysql-workbench-oss-5.2.11.tar.gz
2 tar -xzf mysql-workbench-oss-5.2.11.tar.gz
3 cd mysql-workbench-oss-5.2.11
4 apt-get install libzip-dev libzip1 libxml2-dev libsigc++-2.0-dev libcairomm-1.0-dev libglibmm-2.4-dev libpangomm-1.4-dev libglade2-dev libaudiofile-dev libavahi-client-dev libavahi-common-dev libavahi-glib-dev libbonobo2-dev libdbus-1-dev libesd0-dev libgconf2-dev libgcrypt11-dev libgnomevfs2-dev libgnutls-dev libgpg-error-dev libpopt-dev libselinux1-dev libsepol1-dev libtasn1-3-dev libsqlite3-dev libboost1.40-dev  libmysqlclient-dev libmysqld-dev uuid-dev liblua5.1-0-dev libncurses5-dev libreadline-dev libreadline6-dev libfribidi-dev libgl1-mesa-dev libglc-dev libglc0 libglu1-mesa-dev mesa-common-dev libpcre3-dev libpcrecpp0 python-paramiko
5 ./autogen.sh --prefix=/path/where/you/want/to/install/it
6 make
7 make install
8 /path/where/you/did/install/it/bin/mysql-workbench
For those guys who already tried it and got errors for missing packages, a python-error for missing import or a seg-faults, here my list of errors and the packages/action required to install/run:

No package 'libzip' found

01checking for ZIP... configure: error: Package requirements (libzip) were not met:
02
03No package 'libzip' found
04
05Consider adjusting the PKG_CONFIG_PATH environment variable if you
06installed software in a non-standard prefix.
07
08Alternatively, you may set the environment variables ZIP_CFLAGS
09and ZIP_LIBS to avoid the need to call pkg-config.
10See the pkg-config man page for more details.
libzip dev package is missing install it via apt-get:
1apt-get install libzip-dev libzip1

No package 'libxml-2.0' found

01checking for GLIB... configure: error: Package requirements (glib-2.0 gthread-2.0 gmodule-2.0 libxml-2.0 >= 2.6.2) were not met:
02
03No package 'libxml-2.0' found
04
05Consider adjusting the PKG_CONFIG_PATH environment variable if you
06installed software in a non-standard prefix.
07
08Alternatively, you may set the environment variables GLIB_CFLAGS
09and GLIB_LIBS to avoid the need to call pkg-config.
10See the pkg-config man page for more details.
libxml dev package is missing install it via apt-get:
1apt-get install libxml2-dev

No package 'sigc++-2.0' found

01checking for SIGC... configure: error: Package requirements (sigc++-2.0) were not met:
02
03No package 'sigc++-2.0' found
04
05Consider adjusting the PKG_CONFIG_PATH environment variable if you
06installed software in a non-standard prefix.
07
08Alternatively, you may set the environment variables SIGC_CFLAGS
09and SIGC_LIBS to avoid the need to call pkg-config.
10See the pkg-config man page for more details.
sigc++2.0 dev package is missing install it via apt-get:
1apt-get install libsigc++-2.0-dev

No package 'libglade-2.0' found / No package 'gtkmm-2.4' found/h3>

01checking for GNOME... configure: error: Package requirements (libglade-2.0 gtkmm-2.4) were not met:
02
03No package 'libglade-2.0' found
04No package 'gtkmm-2.4' found
05
06Consider adjusting the PKG_CONFIG_PATH environment variable if you
07installed software in a non-standard prefix.
08
09Alternatively, you may set the environment variables GNOME_CFLAGS
10and GNOME_LIBS to avoid the need to call pkg-config.
11See the pkg-config man page for more details.
libglade2 dev and libgtkmm 2 dev packages are missing install them via apt-get:
1apt-get install libcairomm-1.0-dev libglibmm-2.4-dev libpangomm-1.4-dev libglade2-dev libaudiofile-dev libavahi-client-dev libavahi-common-dev libavahi-glib-dev libbonobo2-dev libdbus-1-dev libesd0-dev libgconf2-dev libgcrypt11-dev libgnomevfs2-dev libgnutls-dev libgpg-error-dev libpopt-dev libselinux1-dev libsepol1-dev libtasn1-3-dev

No package 'libgnome-2.0' found

01checking for LIBGNOME... configure: error: Package requirements (libgnome-2.0) were not met:
02
03No package 'libgnome-2.0' found
04
05Consider adjusting the PKG_CONFIG_PATH environment variable if you
06installed software in a non-standard prefix.
07
08Alternatively, you may set the environment variables LIBGNOME_CFLAGS
09and LIBGNOME_LIBS to avoid the need to call pkg-config.
10See the pkg-config man page for more details.
libgnome dev package is missing install it via apt-get:
1apt-get install libgnome2-dev

No package 'sqlite3' found

01checking for SQLITE3... configure: error: Package requirements (sqlite3) were not met:
02
03No package 'sqlite3' found
04
05Consider adjusting the PKG_CONFIG_PATH environment variable if you
06installed software in a non-standard prefix.
07
08Alternatively, you may set the environment variables SQLITE3_CFLAGS
09and SQLITE3_LIBS to avoid the need to call pkg-config.
10See the pkg-config man page for more details.
libsql3 dev package is missing install it via apt-get:
1apt-get install libsqlite3-dev

configure: error: "BOOST library is missing"

1checking for boost/foreach.hpp... no
2configure: error: "BOOST library is missing"
libboost dev package is missing install it via apt-get:
1apt-get install libboost1.40-dev

configure: error: Could not find mysql_config script. Make sure the mysql client libraries are installed

1checking for mysql headers and libraries... ./configure: line 16478: mysql_config: command not found
2./configure: line 16479: mysql_config: command not found
3configure: error: Could not find mysql_config script. Make sure the mysql client libraries are installed
libmysqlclient and libmysqld dev packages are missing install them apt-get:
1apt-get install libmysqlclient-dev libmysqld-dev

No package 'uuid' found

01checking for UUID... configure: error: Package requirements (uuid) were not met:
02
03No package 'uuid' found
04
05Consider adjusting the PKG_CONFIG_PATH environment variable if you
06installed software in a non-standard prefix.
07
08Alternatively, you may set the environment variables UUID_CFLAGS
09and UUID_LIBS to avoid the need to call pkg-config.
10See the pkg-config man page for more details.
uuid dev package is missing install it via apt-get:
1apt-get install uuid-dev

No package 'lua' found

01checking for LUA... configure: error: Package requirements (lua >= 5.1) were not met:
02
03No package 'lua' found
04
05Consider adjusting the PKG_CONFIG_PATH environment variable if you
06installed software in a non-standard prefix.
07
08Alternatively, you may set the environment variables LUA_CFLAGS
09and LUA_LIBS to avoid the need to call pkg-config.
10See the pkg-config man page for more details.
liblua5.1 dev package is missing install it via apt-get:
1apt-get install liblua5.1-0-dev libncurses5-dev libreadline-dev libreadline6-dev

configure: error: OpenGL headers not found

1checking for GL/gl.h... no
2configure: error: OpenGL headers not found
opengl dev packages are missing install them via apt-get:
1apt-get install liblua5.1-0-dev libncurses5-dev libreadline-dev libreadline6-dev

configure: error: Could not find pcre-config script. Make sure the pcre libraries are installed

1checking for pcre-config... no
2configure: error: Could not find pcre-config script. Make sure the pcre libraries are installed
libprce dev and libpcrecpp package are missing install them via apt-get:
1apt-get install libpcre3-dev libpcrecpp0

ImportError: No module named paramiko

1Traceback (most recent call last):
2  File "/opt/wb/share/mysql-workbench/sshtunnel.py", line 10, in
3    import paramiko
4ImportError: No module named paramiko
5terminate called after throwing an instance of 'std::runtime_error'
6  what():  Error starting tunnel manager:
7Aborted
python-paramiko is missing install it via apt-get:
1

segmentation fault ./mysql-workbench-bin

1[2]    20800 segmentation fault  ./mysql-workbench-bin
Dont start mysql-workbench-bin, use mysql-workbench instead

Monday, October 29, 2012

Recover MySQL root Password

Step # 1 : Stop mysql service

# /etc/init.d/mysql stop
Output:
Stopping MySQL database server: mysqld.

Step # 2: Start to MySQL server w/o password:

# mysqld_safe --skip-grant-tables &
Output:
[1] 5988
Starting mysqld daemon with databases from /var/lib/mysql
mysqld_safe[6025]: started

Step # 3: Connect to mysql server using mysql client:

# mysql -u root
Output:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 1 to server version: 4.1.15-Debian_1-log
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql>

Step # 4: Setup new MySQL root user password

mysql> use mysql;
mysql> update user set password=PASSWORD("NEW-ROOT-PASSWORD") where User='root';
mysql> flush privileges;
mysql> quit

Step # 5: Stop MySQL Server:

# /etc/init.d/mysql stop
Output:
Stopping MySQL database server: mysqld
STOPPING server from pid file /var/run/mysqld/mysqld.pid
mysqld_safe[6186]: ended
[1]+  Done                    mysqld_safe --skip-grant-tables

Step # 6: Start MySQL server and test it

# /etc/init.d/mysql start
# mysql -u root -p

Tuesday, October 23, 2012

"Server does not use any supported authentication method" in pidgin

 "Server does not use any supported authentication method" in pidgin

     /etc/hostname doesn't match /etc/hosts and comment ipv6 address

Sunday, October 21, 2012

Varnish Cache for Centos.

 Varnish Cache for Centos.

Add EPEL repository to Yum

#rpm -ivh http://mirror.nus.edu.sg/Fedora/epel//5/i386/epel-release-5-4.noarch.rpm

# yum install jemalloc-2.1.3-2.el5.x86_64.rpm

#rpm --nosignature -i http://repo.varnish-cache.org/redhat/varnish-3.0/el5/noarch/varnish-release-3.0-1.noarch.rpm
#yum install varnish

Now to edit the varnish configuration file. It’s located at: etc/varnish/default.vcl. Insert the following code in the file. Explanation of the different constructs follows:


======================================================================================
backend default {
  .host = "your.primary.domainname.com";
  .port = "80";
}
sub vcl_recv {
  if (req.http.Accept-Encoding) {
    if (req.url ~ "\.(jpg|png|gif|gz|tgz|bz2|lzma|tbz)(\?.*|)$") {
      remove req.http.Accept-Encoding;
    } elsif (req.http.Accept-Encoding ~ "gzip") {
      set req.http.Accept-Encoding = "gzip";
    } elsif (req.http.Accept-Encoding ~ "deflate") {
      set req.http.Accept-Encoding = "deflate";
    } else {
      remove req.http.Accept-Encoding;
    }
  }
  if (req.url ~ "^/[^?]+\.(jpeg|jpg|png|gif|ico|js|css|txt|gz|zip|lzma|bz2|tgz|tbz|html|htm)(\?.*|)$") {
    unset req.http.cookie;
  }
  if (req.request == "GET" && req.url ~ "cron_job" ||         req.url ~ "something_else"        ) {
    return ( pass );
  }
}
======================================================================================



To start the varnish process 
 


# varnishd -f /etc/varnish/default.vcl -s malloc,1G -T 127.0.0.1:6081 -a 0.0.0.0:80



To redirect http traffic to varnish port 
 =========================
 iptables -t nat -A PREROUTING -i eth0 -p tcp -m tcp --dport 80 -j REDIRECT --to-ports 6081

 =========================

Wednesday, October 17, 2012

Proxy for Curl.

Proxy Setting for Curl.

You can make a alias in your ~/.bashrc file :

=================
alias curl="curl -x :"
=================
Exp:  vi .bashrc
alias curl="curl -x http://172.16.101.87:80"
 
source .bashrc
aswathy@AcerPower:~$ alias curl
alias curl='curl -x http://172.16.101.87:8080'
 
 
 =================

 
 
Another solution is to use (maybe the better solution) the ~/.curlrc file (create it if it does not exist) :
proxy = :
 
aswathy@AcerPower:~$ cat .curlrc 
proxy = http://172.16.101.87:8080
aswathy@AcerPower:~$ =================

Thursday, October 4, 2012

Password for '(null)' GNOME keyring:




 Password for '(null)' GNOME keyring:  While doing SVN.


 =======================
sanitha@ubuntu1:~ svn co https://xxxxxxxxxxxxxxxxxx/trunk
Password for '(null)' GNOME keyring:

svn: OPTIONS of 'https://xxxxxxxxxxxxx/trunk': authorization failed: Could not authenticate to server: rejected Basic challenge (https://xxxxxxxxxxx)
=======================

The fix is..
 ==========================

sanitha@ubuntu1:~$ rm -rf .gnome2/keyrings/login.keyring
 ==========================