theiDaemon.com

the luxury of invaluable experience.

Archive for March, 2008

How to search and replace string in mysql database? You can done with phpMyAdmin, That is a easy way.

To search and replace a text string, start up phpMyAdmin, and click on your database name that you want to run the search and replace through. At the top of the window, click on the “SQL” tab.In the text box, enter the following code. This is the generic setup, so edit to satisfy your needs:

UPDATE tablename SET tablefield = replace(tablefield,"findstring","replacestring");

You can add a WHERE clause onto this as well.

For example, here is one command a ran:

UPDATE `mos2_content` SET introtext = replace(introtext,"<p>","") WHERE `title` REGEXP '-0';

This got rid of all paragraph tags in the mos2_content table where the title included the string “-0″.

Hope this helps.

How to backup mysql database

usage


#mysqldump [options] db_name [tables]
#mysqldump [options] –databases db_name1 [db_name2 db_name3...]
#mysqldump [options] –all-databases

Example

#mysqldump -u root -p mydatabase > db.sql

Specific table

#mysqldump -u root -p mydatabase -tables customer > db.sql

How to restore database

#mysql -u root -p database < db.sq

Godaddy promotion coupon list

This is a list of coupon code

OYH3 - $3 off / $6.95 any .COM

BTPS7 - 20% any order of $50 or more

OYH1 - 10% off whatever

BTPS20 - 25% any order of $100 or more

BTPS4 - 10% off anything

OYH2 - $5 off a $30 purchase

hash1 - 10% offhash2 - $5 off $30

hash3 - $6.95 .com registration

gdd1101c - 10% off any order of $40 or more

chill1 - 10% off

chill2 - $5 off $30

chill3 - $6.95 .coms

Today I have finished install mrtg for my idaemon server and here are the perfect setup instruction for who run centos 5.1 in the box.

check this instruction you will not regret, after I have try from many source and googled all day this is the way out!

Part I : SNMP Server

we need to install snmp service to make mrtg graph work.

#yum install net-snmp-utils net-snmp

after it installed make this service that run automaticaly.

#chkconfig --level 345 snmpd

run it.

#service snmpd start

check service that run properly.

#netstat -natv | grep ':199'

look into the line that should be.

tcp 0 0 127.0.0.1:199 0.0.0.0:* LISTEN

now we must check this service.

#snmpwalk -v 1 -c public localhost IP-MIB::ipAdEntIfIndex

the output should be like this. note that 192.168.0.3 is your network ip or internet ip.

ip.ipAddrTable.ipAddrEntry.ipAdEntIfIndex.127.0.0.1 = 1
ip.ipAddrTable.ipAddrEntry.ipAdEntIfIndex.192.168.0.3 = 2

(more…)

Try this free dns service control for your domain. they are note as best in their industry

I have used these for my master domain Thaigaming.com

My frequenly Linux command

Add user
useradd [-c comment] [-d home_dir]
[-e expire_date] [-f inactive_time]
[-g initial_group] [-G group[,...]]
[-m [-k skeleton_dir] | -M] [-n] [-o] [-p passwd] [-r]
[-s shell] [-u uid] login
useradd -D [-g default_group] [-b default_home]
[-e default_expire_date] [-f default_inactive]
[-s default_shell]

Advanced editor enable for wordpress

This is Surprise!! after I always want more option in wordpress editor, which lag of feature. try this

Windows Firefox: Alt+Shift+V (Firefox)
Windows Internet Explorer: Alt+V (Internet Explorer)
Mac OS X Firefox: Ctrl+V
Mac OS X Safari: very sad, it can’t enable advanced editor for wordperss :/

yes !! you will find the way out. some of functions will show up and you will need it.

  • 0 Comments
  • Filed under: Tip and Trick
  • After I have googled for a hole day, I have finished config on idaemon server
    so, I have to note this down for future purpose.

    We have to edit Bind and Apache to let this work, here are example of config files.

    maindomain zone file

    maindomain.com. IN SOA ns1.maindomain.com. admin.maindomain.com. (
    1164635879
    3H
    1H
    7D
    120 )

    maindomain.com. IN NS ns1.maindomain.com.
    maindomain.com. IN NS ns2.maindomain.com.

    maindomain.com. IN A 1.2.3.4

    maindomain.com. IN MX 1 apmx.l.google.com.
    maindomain.com. IN MX 3 alt1.aspmx.l.google.com.
    maindomain.com. IN MX 3 alt2.aspmx.l.google.com.
    maindomain.com. IN MX 5 aspmx2.googlemail.com.
    maindomain.com. IN MX 5 aspmx3.googlemail.com.
    maindomain.com. IN MX 5 aspmx4.googlemail.com.
    maindomain.com. IN MX 5 aspmx5.googlemail.com.

    mail.maindomain.com. IN CNAME ghs.google.com.

    *.maindomain.com. IN A 1.2.3.4

    otherdomain zone file

    otherdomain.com. IN SOA ns11.otherdomain.com. admin.otherdomain.com. (
    1154635879
    3H
    1H
    7D
    120 )

    otherdomain.com. IN NS ns11.otherdomain.com.
    otherdomain.com. IN NS ns12.otherdomain.com.

    otherdomain.com. IN A 1.2.3.4

    *.otherdomain.com. IN CNAME otherdomain.com.

    (more…)

    Sample of BIND Configuration Files

    I noticed a few visitors came to this blog by searching BIND configuration errors. I had troubles too, later simply copied the configuration files from a Linux server. Here are my configuration files of BIND 9, if you have troubles to make BIND work, you can use them directly or as a starting point. Please note that you may need to convert the text to unix Format, and those steps in the handbook should be done first:
    # cd /etc/namedb
    # sh make-localhost

    Add named_enable=”YES” to /etc/rc.conf

    My server is a typical dedicated server and doesn’t rely on any other servers, everything is on this box, such as dns, email, web server, ftp, etc.

    In the sample files, I have a main domain “maindomain.com” for the server, the host name is “hostname.maindomain.com”, DNS servers for all domains on this server are “ns1.maindomain.com” and “ns2.maindomain.com”. All other domains can be configured like “otherdomain.com”.

    (more…)

    This is a setup wizard for admin who want to prevent a mail from domain to sent to a junk box

    try this The SPF Setup Wizard

    and update the resualt to your zone file.