theiDaemon.com

the luxury of invaluable experience.

My Gear Wish list.

I’ll built wishlist of my next desktop here.

CPU - Considering…

CPU Cooler
- Thermal Right Ultra-120 Extreme
Got it! (Powered by maSweet)

VGA -Sapphire Radeon HD 4870 Video Card
Perfect performance with best valued. Use this brand Or other brands, Since they are same card.

VGA Cooler - Considering…
RAM - Considering…
Mainboard - Considering…
Harddisk - Considering…
DVD Writer - Considering…
PSU - Considering…
Case - Cooler Master CM690

So, It may take some time to considerting the spec. If you have any suggestion please comment.

Here are for Squid 2.6+ only and here we go

# yum install squid

Then we need to make a config

# vi /etc/squid/squid.conf

by change these config,

edit http port to use transparent proxy

http_port 8080 transparent

search the line with acl QUERY urlpath_regex cgi-bin \? and add these after it

acl nc_post method POST
acl nc_script urlpath_regex -i \.htm \.php /$
cache deny nc_post
cache deny nc_script

edit the size to fit your server


cache_mem 512 MB
maximum_object_size 8192 KB
minimum_object_size 2 KB
maximum_object_size_in_memory 128 KB
cache_replacement_policy heap LFUDA
memory_replacement_policy heap GDSF
cache_dir aufs /var/spool/squid 1024 16 256

uncomment the logformat


logformat combined %>a %ui %un [%tl] "%rm %ru HTTP/%rv" %Hs %h" "%{User-Agent}>h" %Ss:%Sh

edit the following *ip change it to fit your server

access_log /var/log/squid/access.log combined
dns_nameservers 127.0.0.1 123.123.123.123

find the line acl CONNECT method CONNECT and add the following

acl to_httpd dst 123.123.123.123
acl to_httpdport port 80
acl to_httpdport port 3080
http_access allow to_httpd to_httpdport

edit the host name

visible_hostname your.hostnameyouwant.here.com

manage service and start it.

# chkconfig --level 345 squid on
# squid -z
# service squid start

now you need to edit iptables to use the proxy

# iptables -t nat -A PREROUTING -p tcp -m tcp -d 123.123.123.123 --dport 8080 -j DROP
# iptables -t nat -A PREROUTING -p tcp -m tcp -d 123.123.123.123 --dport 80 -j REDIRECT --to-ports 8080
# service iptables save

that’s all for running squid as transparent proxy but you need to do a following if you have problem experience with transparent proxy ip capture
add these line to php.ini at line auto_prepend_file


$refip = explode(",", $_SERVER["HTTP_X_FORWARDED_FOR"]);
$_SERVER["REMOTE_ADDR"] = trim($refip[count($refip) - 1]);
$_SERVER["HTTP_X_FORWARDED_FOR"] = "";
for ($i=0; $i $_SERVER["HTTP_X_FORWARDED_FOR"] .= ", ".trim($refip[$i]);
}
if (!empty($_SERVER["HTTP_X_FORWARDED_FOR"]))
$_SERVER["HTTP_X_FORWARDED_FOR"] = substr($_SERVER["HTTP_X_FORWARDED_FOR"], 2);
else
unset($_SERVER["HTTP_X_FORWARDED_FOR"]);
?>

You can configure network card by editing text files stored in /etc/sysconfig/network-scripts/ directory. First change directory to /etc/sysconfig/network-scripts/:

# cd /etc/sysconfig/network-scripts/

You need to edit / create files as follows:

* /etc/sysconfig/network-scripts/ifcfg-eth0 : First Ethernet card configuration file
* /etc/sysconfig/network-scripts/ifcfg-eth1 : Second Ethernet card configuration file

To edit/create first NIC file, type command:

# vi ifcfg-eth0

Append/modify as follows:


# Intel Corporation 82801EB/ER (ICH5/ICH5R) integrated LAN Controller
DEVICE=eth0
HWADDR=00:e0:81:28:5b:cc
ONBOOT=yes
TYPE=Ethernet
NETMASK=255.255.255.0
IPADDR=192.168.2.100
GATEWAY=192.168.2.1

Save and close the file. Define default gateway (router IP) and hostname in /etc/sysconfig//network file:

# vi /etc/sysconfig/network

Append/modify configuration as follows:

NETWORKING=yes
HOSTNAME=www.theidaemon.com
GATEWAY=192.168.2.1

Save and close the file. Restart networking:

# /etc/init.d/network restart

Make sure you have correct DNS server defined in /etc/resolv.conf file:

# vi /etc/resolv.conf

Setup DNS Server as follows:


nameserver 192.168.2.1
nameserver 202.67.222.222

Save and close the file. Now you can ping the gateway/other hosts:

$ ping 192.168.2.101

Output:

# ping 192.168.2.101
PING 192.168.2.101 (192.168.2.101) 56(84) bytes of data.
64 bytes from 192.168.2.101: icmp_seq=1 ttl=128 time=0.195 ms
64 bytes from 192.168.2.101: icmp_seq=2 ttl=128 time=0.198 ms
64 bytes from 192.168.2.101: icmp_seq=3 ttl=128 time=0.188 ms

You can also check for Internet connectivity with nslookup or host command:

# nslookup google.com
Server: 192.168.2.1
Address: 192.168.2.1#53

Name: google.com
Address: 72.14.207.99

You can also use host command:

# host theidaemon.com
theidaemon.com has address 74.52.68.114
theidaemon.com mail is handled by 0 theidaemon.com.

If you installed a fresh Centos and not selected any package like me, You may need C compiler

try to install use following command

yum install gcc gcc-c++ autoconf automake

cheer!

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

Read the rest of this entry »

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]
Did you find something on this site useful? Please consider to make a donation.

 

September 2008
M T W T F S S
« Jul    
1234567
891011121314
15161718192021
22232425262728
2930