Tricks and Tips about Systems/Network

November 10, 2009

How do I install jre plugins for Firefox on Linux

Filed under: admins,Firefox — Liju Mathew @ 12:32 am

1.Download and extract the binary file jre-6u6-linux-i586.bin from java.com
#sh jre-6u6-linux-i586.bin
2, Switch to Firefox installation folder or obeviously can can choose “.mozilla” from your home directory.
#cd /home/installation/Firefox2.0/firefox/plugins
3. Create a link to jre plug ins
# ln -s /home/installation/jre1.6.0_06/plugin/i386/ns7/libjavaplugin_oji.so
4, Restart Firefox
# killall -9 firefox && firefox

5, You can verify it with the following link

http://java.com/en/download/windows_xpi.jsp?locale=en&host=java.com:80

November 5, 2009

Nagios – Custom command for checking the status of Port on the same server

Filed under: Applications,Nagios — Liju Mathew @ 2:36 pm

Here I am checking the status of mysql running on the nagios Monitoring host

Go to nagios installation directory on nagios Monitoring host.

1. # cd /usr/local/nagios/etc/objects/
2. Add the following line to ” command.cfg and save
# vi commands.cfg

define command{
command_name check_tcp_mysql
command_line /usr/local/nagios/libexec/check_tcp -H localhost -p 3306 -w 100 -c 150
}

Note : we can see the proposed out put by executing this command from the console directly(“/usr/local/nagios/libexec/check_tcp -H localhost -p 3306 -w 100 -c 150″)

3. Edit localhost.cfg and append the line at the end of the file. Save and quit

define service{
use local-service ; Name of service template to use
host_name nagios-svr
service_description MySQL
check_command check_tcp_mysql
notifications_enabled 1
}

4. Verify the sample Nagios configuration files.

#/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg

5. Restart nagios service

Thats’ it

Nagios – Custom command for checking a service is up on the Nagios server

Filed under: Applications,Nagios — Liju Mathew @ 2:36 pm

Here I am checking the status of mysql running on the nagios Monitoring host

Go to nagios installation directory on nagios Monitoring host.

1. # cd /usr/local/nagios/etc/objects/
2. Add the following line to ” command.cfg and save
# vi commands.cfg

define command{
command_name check_tcp_mysql
command_line /usr/local/nagios/libexec/check_tcp -H localhost -p 3306 -w 100 -c 150
}

Note : we can see the proposed out put by executing this command from the console directly(“/usr/local/nagios/libexec/check_tcp -H localhost -p 3306 -w 100 -c 150″)

3. Edit localhost.cfg and append the line at the end of the file. Save and quit

define service{
use local-service ; Name of service template to use
host_name nagios-svr
service_description MySQL
check_command check_tcp_mysql
notifications_enabled 1
}

4. Verify the sample Nagios configuration files.
#/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg

Thats’ it

October 31, 2009

Webmin admin password was lost. How do I reset it ?

Filed under: admins,Applications — Liju Mathew @ 6:09 pm

Today I have got one querry about resetting controll panel password on a dedicated server. I just set it up and provide full admin access to the client. But the password information on my was not working now what to do.

I found a thread on Google which is simple.

#/usr/libexec/webmin/changepass.pl /opt/webmin/etc/webmin webadmin admin#pwd

/usr/libexec/webmin/changepass.pl /opt/webmin/etc/webmin

where “/opt/webmin/” is my webmin installation directory.

cheers,

October 25, 2009

Godaddy Hosting – WordPress don't send email

Filed under: admins,Applications,Windows — Liju Mathew @ 7:13 pm

This is the same blog for about this wordpress,

I have been looking for a solution of sending emails from my blog. It wasn’t sending emails/ I tried many of the plugins but no success.

Finally when i am in the situation which i can’t forward a bit step without sending mail features. Especially in case of lost password.

Finally I found angstrey.com was extremely useful for me.

These are the steps to do.

1. Create an email account on Godaddy account for this purpose.
2. Install the word press plugin "WP-Mail-SMTP" using plugins–> install new–find and search–> click on install
3. Now you navigate to the area Settings–>email
we have to fill out some feilds.
a. From Email :
b. From Name :
c. Mailer: Send all WordPress emails via SMTP
d. SMTP Host : relay-hosting.secureserver.net
e: SMTP port : 25
f: Encryption: No encryption.
g: Authentication: No: Do not use SMTP authentication.

Click on “update option” button to save the changes.

Bottom of the page shows an option to test email functionality.
choose any email for test out.Once the click on the button it returns some status of the email which send through the code.
if it is worked perfectly should returns "bool(true)"

Cropped out put shown below.

Test Message Sent
The result was:
bool(true)
The SMTP debugging output is shown below:
SMTP -> FROM SERVER:
220 p3nlsmtp03.shr.prod.phx3.secureserver.net ESMTP
SMTP -> FROM SERVER:
250-p3nlsmtp03.shr.prod.phx3.secureserver.net
250-PIPELINING
220 p3nlsmtp03.shr.prod.phx3.secureserver.net ESMTP
SMTP -> FROM SERVER:
250-p3nlsmtp03.shr.prod.phx3.secureserver.net
250-PIPELINING
250-SIZE 31457280
250 8BITMIME
SMTP -> FROM SERVER:
250 ok
SMTP -> FROM SERVER:
250 ok
SMTP -> FROM SERVER:
354 go ahead punk, make my day
SMTP -> FROM SERVER:
250 ok 1256477908 qp 25529 by p3nlsmtp03.shr.prod.phx3.secureserver.net
SMTP -> FROM SERVER:
221 p3nlsmtp03.shr.prod.phx3.secureserver.net Goodbye.

Godaddy Hosting – WordPress don't send email

Filed under: admins,Applications,Windows — Liju Mathew @ 7:13 pm

This is the same blog for about this wordpress,

I have been looking for a solution of sending emails from my blog. It wasn’t sending emails/ I tried many of the plugins but no success.

Finally when i am in the situation which i can’t forward a bit step without sending mail features. Especially in case of lost password.

Finally I found angstrey.com was extremely useful for me.

These are the steps to do.

1. Create an email account on Godaddy account for this purpose.
2. Install the word press plugin "WP-Mail-SMTP" using plugins–> install new–find and search–> click on install
3. Now you navigate to the area Settings–>email
we have to fill out some feilds.
a. From Email :
b. From Name :
c. Mailer: Send all WordPress emails via SMTP
d. SMTP Host : relay-hosting.secureserver.net
e: SMTP port : 25
f: Encryption: No encryption.
g: Authentication: No: Do not use SMTP authentication.

Click on “update option” button to save the changes.

Bottom of the page shows an option to test email functionality.
choose any email for test out.Once the click on the button it returns some status of the email which send through the code.
if it is worked perfectly should returns "bool(true)"

Cropped out put shown below.

Test Message Sent
The result was:
bool(true)
The SMTP debugging output is shown below:
SMTP -> FROM SERVER:
220 p3nlsmtp03.shr.prod.phx3.secureserver.net ESMTP
SMTP -> FROM SERVER:
250-p3nlsmtp03.shr.prod.phx3.secureserver.net
250-PIPELINING
220 p3nlsmtp03.shr.prod.phx3.secureserver.net ESMTP
SMTP -> FROM SERVER:
250-p3nlsmtp03.shr.prod.phx3.secureserver.net
250-PIPELINING
250-SIZE 31457280
250 8BITMIME
SMTP -> FROM SERVER:
250 ok
SMTP -> FROM SERVER:
250 ok
SMTP -> FROM SERVER:
354 go ahead punk, make my day
SMTP -> FROM SERVER:
250 ok 1256477908 qp 25529 by p3nlsmtp03.shr.prod.phx3.secureserver.net
SMTP -> FROM SERVER:
221 p3nlsmtp03.shr.prod.phx3.secureserver.net Goodbye.

October 23, 2009

Automated backup for MSSQL server 2005

Filed under: Applications,Windows,Windows 2003 — Liju Mathew @ 9:59 am
Tags:

Hello,

I have a requirement for taking daily backup SQL server 2005 express on a remote windows 2003 server. How to solve ??????

Yeah thinking and familiar with Google search will be your best friend. After the 2 hours search one of my tech-guy comes up with a solution. But I tested it through before implementing on the server.

After few months later I have need a smiler setup. Amazingly this will cause only 15 minutes to make things.
up.

Solutions

1. Download this program from http://www.lazycoding.com/downloads/SQLScheduler_LatestVersion.zip.
2. Copy the contents of the archive to a directory the target machine.
3. Run InstallService.bat file from the command prompt. The executing user account should have administrative rights on the machine. Make sure that service type is automatically started.
4. Click on SQLScheduler.exe and choose the database and set the backup scheduler. Pls also configure the mail server to get the detailed status of backup process.
5. Use my ftp program to upload the backup to remote FTP as well.

-Enjoy

October 19, 2009

VI command for find and replace

Filed under: Applications,General — Liju Mathew @ 4:36 pm

Hello,

This is most suitable commands which help us to replace the string with our occurrence. This is the same feature of “Find and replace ” in windows :-)

open the file to be edit
$ vi strings.txt
a. then press “Esc”
:%s/find-string/replace-string/g
Then press enter
then press “ZZ “ to save the file.

some tweaks are listed below,
1. First occurrence on current line: :s/OLD/NEW
2, Every occurrence in file: :%s/OLD/NEW/g

October 16, 2009

Enabling JSON on php5

Filed under: Applications,Linux,PHP — Liju Mathew @ 6:21 pm
Tags: ,

This little tweak will help you enable json module on php. Unfortunately “YUM ” method won’t work as it’s not support native json .

Open a terminal window execute.

1. pecl install json

2. create a file by # vi /etc/php.d/json.ini then add the line ” extension=json.so “

or echo ” extension=json.so ” >> etc/php.d/json.ini

3. restart Apache

service httpd restart or apache2ctl restart

That’s it. You can find the module enable in phpconfig page

or execute [root@web-test1 ~]# php -r ‘ phpinfo();’ |grep json result will be like this

[root@web-test1 ~]# php -r ‘ phpinfo();’ |grep json
/etc/php.d/json.ini,
json
json support => enabled
json version => 1.2.1

Unfortunately Cpanel doesn’t support it
-enjoy

October 15, 2009

MySQL Server optimization tricks

Filed under: Applications,MySQL — Liju Mathew @ 6:24 pm

These variables will help him to optimize or tuning mysql easily.

1. Lock and unlock mysql tables

LOCK TABLE Books READ;
LOCK TABLES Books READ, BookOrders WRITE;

b. Unlocking tables

UNLOCK TABLES;

2. Variables to be monitored
Threads_connected
Created_temp_disk_tables
Handler_read_first
innodb_buffer_pool_wait_free
key_reads
max_used_connections
open_tables==< tables_cache
Select_full_join
slow_queries
uptime

3. REPAIR TABLE

quick;

4. Enabling/disabling query log without restart in Mysql
set sql_log_off = ‘ON’;
turns of the log without restarting
set sql_log_off = ‘OFF’;
set sql_log_off = 1;
turns it back on

5. monitor the mysql
show status;

6. Repairing Corrupted data in Mysql
CHECK TABLE table;
REPAIR TABLE table;

7. Performing Database Maintenance
ANALYZE TABLE orders;
CHECK TABLE orders, orderitems;
OPTIMIZE TABLE

8. Errors-watching
a. Too Many Connections, ERROR 1040: Too many connections
[mysqld]
max_connections=200

b. ERROR 2006: MySQL server has gone away
The default timeout interval is eight hours, but this value can be changed using the wait_timeout

system variables value is in seconds.

9.Howto enable caching in MySQL

mysql> SET GLOBAL query_cache_size = 16777216; (16Mb)
You can setup them in /etc/my.cnf (Red Hat) or /etc/mysql/my.cnf (Debian) file:
vi /etc/my.cnf
query_cache_size = 268435456
query_cache_type=1
query_cache_limit=1048576

10. max_write_lock_count = 1

By starting mysqld with a low value for the max_write_lock_count system variable you are forcing
MySQL to temporarily elevate the priority of all SELECT statements that are waiting for a table
after a specific number of inserts to the table occur. This allows READ locks after a certain number of
WRITE locks. Is that clear?

11. Creating a MySQL Index – New Table
CREATE TABLE employee_records (
name VARCHAR(50),
employeeID INT, INDEX (employeeID)
)

Creating a MySQL Index – Existing Table

CREATE TABLE employee_records2 (name VARCHAR(50), employeeID INT);
CREATE INDEX id_index ON employee_records2(employeeID)
We keep our existing employeeID field and create a new index id_index that is made up of employeeID data.

# show indexes from employee_records2;

Mysql optimization for Core2duo 4GB Window 2003 server

Theme: Rubric. Blog at WordPress.com.

Follow

Get every new post delivered to your Inbox.