Monday, 30 May 2011

ndoutils in nagios : Could not open data sink! I'll keep trying, but some output may get lost

hi.if you got problem of connecting ndoutils to nagios with that title type of error then you can do chmod to your config files.

[root@localhost etc]# chmod 666 ndo2db.cfg
[root@localhost etc]# chmod 666 ndomod.cfg

after that you can try to tail nagios log. I'm sure that it will not error again instead it will show as:

ndomod: Successfully connected to data sink

whoops..!! don't forget to give your ndouser permission in mysql
mysql> create user 'ndouser'@'localhost';
Query OK, 0 rows affected (0.00 sec)

mysql> grant all on nagios.* to 'ndouser'@'localhost' identified by 'ndopassword';
Query OK, 0 rows affected (0.00 sec)

mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)
goodluck :p

Thursday, 5 May 2011

How to export mysql data from remote to local server

You are only given port 3306 on the remote server. You can't do things like ssh to manage your mysql. So here is the simple receipe:

mysqldump -u user -pmypassword -h 192.168.1.111 mydatabase mytable --where='usrstatus =1;' > test.sql

i used this command on linux but in windows you may try like this instead:

mysqldump -u user -pmypassword -h 192.168.1.111 mydatabase mytable --where="usrstatus =1;" > test.sql

notice the double quote in windows & please put your password beside -p & no space & you can use --where to tell what is your condition of table you want. please try to modify it according to your need.

Monday, 18 April 2011

cannot send email to certain webmail from my local sendmail server

if you ever faced a problem that you can't send emails from your local sendmail's server to certain webmail.. and you're likely the person that i listed here

1. you're using linux, ex: ubuntu,centos etc
2. you installed sendmail as your smtp server
3. you're successfully sent emails to yahoo and gmail account from your command line interface. ex:
root@linux-box:/#sendmail someperson@yahoo.com 
result: success&arrived! user@localhost.localdomain
4. unfortunately you cannot send to certain webmail.
ex: sendmail someperson@somedomain.com 
result: failed!
5. you're going to forum & irc for help => they mock you as a kiddy and shoooh you to go once again to google.com. ex:
"hey kid please find gud linux books & read it back!! search uncle google you're lazy bones!!ya don't really understand open source da u??" (actually even they don't know the answer!)

6. worry no more.. i think this is a solution for you...
masquerade your local domain! so when you send emails it wont show like :  user@localhost.localdomain but it will show as user@somedomain.com.(in /etc/hosts you can see what your local server is => localhost.localdomain)
only then that certain webmail won't reject you're email anymore.(hope so)
1.go to: /etc/mail/
2.create one file, you can call it anything ex: genericstable
put usernames that you're using ex:
root root@somedomain.com
user user@somedomain.com


note:you can spoof your mail address

3.open your /etc/mail/sendmail.mc
and put this thing inside it:
FEATURE(masquerade_envelope)dnl
FEATURE(`genericstable')dnl
GENERICS_DOMAIN(`localhost.localdomain')dnl

4. finally compile it from your shell: make -C /etc/mail
5. restart sendmail: /etc/init.d/sendmail restart
6. testing to send to your targeted webmail:
sendmail someperson@somedomain.com

7. please don't send spam to your friends (although you're anonymous) bcoz they can detect you by reading the headers

Tuesday, 8 March 2011

my.cnf of mysql in redhat linux MISSING

Hi pal.. if you've installed mysql in redhat linux or any linux system then when you try to search for the configuration file & unfortunately couldn't find my.cnf in /etc folder. don't worry about this problem.. open your shell and try to search any files that has .cnf extension first.

use this command:
cd /
find ./ -type f -name "*.cnf"

find: is a searching command.
./: will start search from a current directory.
-type f : means for file type not directory 
-name : is case sensitive. perform better than -iname which is incase sensitive
"*.cnf" : * means any name which has .cnf as its extension


you may found something like: 
my-huge.cnf <-for huge data try use this file
my-large.cnf
my-small.cnf
(if there is no file of cnf! -> search google and copy it from there)

if you found it, quickly go to that directory
copy it and put it in /etc folder as my.cnf (rename it, in some linux like ubuntu you can find /etc/mysql folder)
stop and restart mysql so that it takes effect.
you may as well change the maximum allowed of data that can be restored in mysql db from my.cnf configuration

Error from eclipse : Could not find the main class: org.apache.catalina.startup.Bootstrap

hi friends.. if you used Eclipse and got this kind of error:
"Could not find the main class: org.apache.catalina.startup.Bootstrap"


the easiest way to repair this error is:
(no need to add any external jar files like tomcat-juli)
1.check your tomcat manually by going to the apache tomcat directory -> bin and run your:
sudo ./run.sh
from your console
2.check if everything is ok and that you can go to the localhost server without error ex: http://locahost:8080/
if ok then shutdown your tomcat by running:
sudo ./shutdown.sh
3.check the eclipse. and if only eclipse have the error of the bootstrap..
4.backup all your important sourcefiles from your eclipse workspace.
5.without hesitation run :
sudo rm -rf workspace/
6.open your eclipse: (of course you will create new directory for workspace)
File->New->Other->Server->choose Server->click Next -> choose your type of apache tomcat.. mine is v6.0 server ->finish...
and start the server...

Saturday, 5 March 2011

First Post: I LOVE GNU/LINUX

hi all! this is my first post! the truth is i am truly linux's fan!! linux is truly unix os alike. im keep thinking about linux! i love linux sooo~~ much. my wish is to write more about linux myself. that's include linux configuration problems, security problems, etc.
hope to see you soon in my next post. thanx :)
anyway im agreed with Richard M Stallman the warrior & father of Gnu project that linux should be called as Gnu/Linux. without Gnu philosophy,license,software i think we wouldn't enjoy linux as we are today..but just to make it easier i will call it as linux.  Thanks and credit also given to Linus Torvalds for his magnificent kernel!
Gnu/Linux roX..~~!!