Archive for December, 2009

This is new and realistic !!!!

Google is slowly take over the world…

if you wanna speed up your squid box than use google public dns.

Google Public DNS IP addresses

The Google Public DNS IP addresses are as follows:

  • 8.8.8.8
  • 8.8.4.4

use it in squid

pico /etc/squid/squid.cof

dns_nameserver 8.8.8.8   8.8.4.4

than add it with your /etc/resolv.conf

[root@bsd ~]# pico /etc/resolv.conf
nameserver      8.8.4.4
nameserver      8.8.8.8

test and you will see the different.

############################################################################

Pick from google web site

http://code.google.com/speed/public-dns/docs/using.html

############################################################################

CHANGE GOOGLE DNS

Microsoft Windows

DNS settings are specified in the TCP/IP Properties window for the selected network connection.

Example: Changing DNS server settings on Microsoft Windows Vista

  1. Go the Control Panel.
  2. Click Network and Internet, then Network and Sharing Center, then Manage network connections.
  3. Select the connection for which you want to configure Google Public DNS. For example:
    • To change the settings for an Ethernet connection, right-click Local Area Connection, and click Properties.
    • To change the settings for a wireless connection, right-click Wireless Network Connection, and click Properties.

    If you are prompted for an administrator password or confirmation, type the password or provide confirmation.

  4. Select the Networking tab. Under This connection uses the following items, click Internet Protocol Version 4 (TCP/IPv4), and then click Properties.
  5. Click Advanced and select the DNS tab. If there are any DNS server IP addresses listed there, write them down for future reference, and remove them from this window.
  6. Click OK.
  7. Select Use the following DNS server addresses. If there are any IP addresses listed in the Preferred DNS server or Alternate DNS server, write them down for future reference.
  8. Replace those addresses with the IP addresses of the Google DNS servers: 8.8.8.8 and 8.8.4.4.
  9. Restart the connection you selected in step 3.
  10. Test that your setup is working correctly; see Testing your new settings below.
  11. Repeat the procedure for additional network connections you want to change.

Mac OS X

DNS settings are specified in the Network window.

Example: Changing DNS server settings on Mac OS 10.5

  1. From the Apple menu, click System Preferences, then click Network.
  2. If the lock icon in the lower left-hand corner of the window is locked, click the icon to make changes, and when prompted to authenticate, enter your password.
  3. Select the connection for which you want to configure Google Public DNS. For example:
    • To change the settings for an Ethernet connection, select Built-In Ethernet, and click Advanced.
    • To change the settings for a wireless connection, select Airport, and click Advanced.
  4. Select the DNS tab.
  5. Click + to replace any listed addresses with, or add, the Google IP addresses at the top of the list: 8.8.8.8 and 8.8.4.4.
  6. Click Apply and OK.
  7. Test that your setup is working correctly; see Testing your new settings below.
  8. Repeat the procedure for additional network connections you want to change.

Linux

In most modern Linux distributions, DNS settings are configured through Network Manager.

Example: Changing DNS server settings on Ubuntu

  1. In the System menu, click Preferences, then click Network Connections.
  2. Select the connection for which you want to configure Google Public DNS. For example:
    • To change the settings for an Ethernet connection, select the Wired tab, then select your network interface in the list. It is usually called eth0.
    • To change the settings for a wireless connection, select the Wireless tab, then select the appropriate wireless network.
  3. Click Edit, and in the window that appears, select the IPv4 Settings tab.
  4. If the selected method is Automatic (DHCP), open the dropdown and select Automatic (DHCP) addresses only instead. If the method is set to something else, do not change it.
  5. In the DNS servers field, enter the Google Public DNS IP addresses, separated by a space: 8.8.8.8  8.8.4.4
  6. Click Apply to save the change. If you are prompted for a password or confirmation, type the password or provide confirmation.
  7. Test that your setup is working correctly; see Testing your new settings below.
  8. Repeat the procedure for additional network connections you want to change.

If your distribution doesn’t use Network Manager, your DNS settings are specified in /etc/resolv.conf.

Example: Changing DNS server settings on a Debian server

  1. Edit /etc/resolv.conf:
    sudo vi /etc/resolv.conf
  2. If any nameserver lines appear, write down the IP addresses for future reference.
  3. Replace the nameserver lines with, or add, the following lines:
    nameserver 8.8.8.8
    nameserver 8.8.4.4
  4. Save and exit.
  5. Restart any Internet clients you are using.
  6. Test that your setup is working correctly; see Testing your new settings below.

Additionally, if you are using DHCP client software that overwrites the settings in /etc/resolv.conf, you will need to set up the client accordingly by editing the client’s configuration file.

Example: Configuring DHCP client sofware on a Debian server

  1. Back up /etc/resolv.conf:
    sudo cp /etc/resolv.conf /etc/resolv.conf.auto
  2. Edit /etc/dhcp3/dhclient.conf:
    sudo vi /etc/dhcp3/dhclient.conf
  3. If there is a line containing domain-name-servers, write down the IP addresses for future reference.
  4. Replace that line with, or add, the following line:
    prepend domain-name-servers 8.8.8.8, 8.8.4.4;
  5. Save and exit.
  6. Restart any Internet clients you are using.
  7. Test that your setup is working correctly; see Testing your new settings below.

Routers

Every router uses a different user interface for configuring DNS server settings; we provide only a generic procedure below. For more information, please consult your router documentation.

Install bash and use it freebsd

Posted: December 16, 2009 in Freebsd

bash or sh is shell for freebsd

but i will use bash rather than sh

install bash using this command

pkg_add -r bash

To test it, you must enter the full path to bash:

/usr/local/bin/bash

Your prompt will change, as a sign you are using a different shell now
Change root shell from ‘/bin/sh’ to ‘/usr/local/bin/bash’
pw usermod user_name -s /usr/local/bin/bash
show the user
pw usershow user_name
or you can use this command but be carefull
env SHELL=/usr/local/bin/bash /usr/local/bin/bash -l
change
shell : /bin/sh
to
shell : /usr/local/bin/bash

last change the vi or ee editor in .profile

[root@bsd ~]# pico .profile

change from

export EDITOR=ee or vi

to

export EDITOR=nano

freebsd Install apache2 + php5 + mysql

Posted: December 10, 2009 in Freebsd

Install apache, php5, and mysql on FreeBSD using ports

Apache web server one of the most widely used. Apache can also be installed on freebsd.

following way to install apache, PHP5, mysql the most easy to use ports.

1. Install Apache:
# cd /usr/ports/www/apache222

make install clean

to start just type
# /usr/local/sbin/apachectl start

to enable apache on boot add apache22_enable=”YES” following file /etc/rc.conf

check apache on your browser type http://localhost


Loading the accf_http module

On FreeBSD you must load the accf_module before you can start apache, otherwise you are sure to get an httpready error.

To load the module use kldload

# kldload accf_http

If it loaded successfully then it will not give any errors or output. To have it load on boot add this to your /boot/loader.conf file

accf_http_load=”YES”

Starting Apache

Apache is controlled with apachectl, some examples of its usage are

# apachectl start

# apachectl restart

# apachectl graceful

# apachectl stop

The graceful option has the same result as restart, it just does it in a nice way as opposed to restart forcefully restarting the server.

Before restarting or starting Apache it is best to run the configtest to check for errors in the httpd.conf

# apachectl configtest


2. Install PHP 5
# /usr/ports/lang/php5

# make install clean

make sure to build Apache module is checked
add these option on file /usr/local/etc/apache22/httpd.conf

AddType application/x-httpd-php .php

AddType application/x-httpd-php-source .phps

Add Index.php to load auto index
<IfModule dir_module>

DirectoryIndex index.html index.php

</IfModule>

create file php.ini by copy php.ini-dist
# cd /usr/local/etc/

# cp php.ini-dist php.ini

and then restart apache
# /usr/local/sbin/apachectl restart

create file php on /usr/local/www/apache22/data/

<?php phpinfo();?> save as test.php
now test on your browser http://127.0.0.1/test.php
3. Install Mysql 5
# cd /usr/ports/databases/mysql51-server

# make install clean

create database
# /usr/local/bin/mysql_install_db

change owner and group as mysql
# chown -R mysql /var/db/mysql/

# chgrp -R mysql /var/db/mysql/

run mysql daemon

/usr/local/bin/mysqld_safe –user=mysql &

change mysql password
/usr/local/bin/mysqladmin -u root password newpass

to automatic msyql enable when boot add /etc/rc.conf:

mysql_enable=”YES”

4. Install php5-mysql module

cd /usr/ports/databases/php5-mysql

make install clean

create file php to check mysql

?php
$test=mysql_connect(“localhost”,”mysql”,””);
if(!$test)
{
print “cant connect”;
}
else
{
print “connected”;
}
?>
save as test-db.php on /usr/local/www/apache22/data/ and go to your browser

Native JDK on FreeBSD

Posted: December 7, 2009 in Freebsd

Install Java JDK on freebsd

This is the effort of the Java 2 FreeBSD porting project. By the use of patchsets and the JDK source code released by Sun, this port builds a native JDK for FreeBSD.

cd /usr/ports/java/jdk14
make install clean

Sun JDK for Linux

This port installs the Java 2 Developement Kit from Sun which was built for Linux. It will run under FreeBSD using the Linux compatibility.

cd /usr/ports/java/linux-sun-jdk14
make install clean

Jauh Kau Pergi (Tinggal Kenangan)

Posted: December 6, 2009 in My live

Pernah ada rasa cinta antara kita
kini tinggal kenangan
ingin kulupakan semua tentang dirimu
namun tak lagi kan seperti dirimu

oh bintangku
jauh kau pergi meninggalkan diriku
disini aku merindukan dirimu
kini kucoba mencari penggantimu
namun tak lagi kan seperti dirimu

oh kekasih
jauh kau pergi meninggalkan diriku
disini aku merindukan dirimu
kini kucoba mencari penggantimu
namun tak lagi kan seperti dirimu

oh kekasih
pernah ada rasa cinta antara kita
kini tinggal kenangan
ingin kulupakan semua tentang dirimu
namun tak lagi kan seperti dirimu

oh bintangku
jauh kau pergi meninggalkan diriku
disini aku merindukan dirimu
kini kucoba mencari penggantimu
namun tak lagi kan seperti dirimu

oh kekasih

freebsd check memory

Posted: December 5, 2009 in Freebsd

If you wanna check memory in freebsd use this script.

download from my server or original server

fetch http://bsd.mynux.net/freebsd-memory.pl.txt

or

fetch http://www.cyberciti.biz/files/scripts/freebsd-memory.pl.txt

mv freebsd-memory.pl.txt /usr/local/bin/free

chmod +x /usr/local/bin/free

than issued this command

free

you will see this output

[root@bsd /skrip]# free
SYSTEM MEMORY INFORMATION:
mem_wire:         133365760 (    127MB) [ 12%] Wired: disabled for paging out
mem_active:  +     54943744 (     52MB) [  5%] Active: recently referenced
mem_inactive:+    558706688 (    532MB) [ 53%] Inactive: recently not referenced
mem_cache:   +      6766592 (      6MB) [  0%] Cached: almost avail. for allocation
mem_free:    +    286863360 (    273MB) [ 27%] Free: fully available for allocation
mem_gap_vm:  +       708608 (      0MB) [  0%] Memory gap: UNKNOWN
————– ———— ———– ——
mem_all:     =   1041354752 (    993MB) [100%] Total real memory managed
mem_gap_sys: +     19181568 (     18MB)        Memory gap: Kernel?!
————– ———— ———–
mem_phys:    =   1060536320 (   1011MB)        Total real memory available
mem_gap_hw:  +     13205504 (     12MB)        Memory gap: Segment Mappings?!
————– ———— ———–
mem_hw:      =   1073741824 (   1024MB)        Total real memory installed

SYSTEM MEMORY SUMMARY:
mem_used:         221405184 (    211MB) [ 20%] Logically used memory
mem_avail:   +    852336640 (    812MB) [ 79%] Logically available memory
————– ———— ———– ——
mem_total:   =   1073741824 (   1024MB) [100%] Logically total memory

Other way is using Linux Style

# cd /usr/ports/sysutils/freecolor
# make install clean

To see memory details, enter:
$ freecolor -m -o

Sample output:

total       used       free     shared    buffers     cached
Mem:          4082        825       3256          0          0        117
Swap:         2048          0       2047

$ freecolor -t -m -o

Sample output:

total       used       free     shared    buffers     cached
Mem:          4082        825       3256          0          0        117
Swap:         2048          0       2047
Total:        6130 = (     826 (used) +     5421 (free))

Assume you have install freebsd and php5.

than let configure php5 to run with lighttpd

[root@bsd ~]# /usr/local/etc/lighttpd.conf

Make sure FASTCGI module is enabled:

server.modules += ( “mod_fastcgi” )

uncommend ths following code

fastcgi.server = ( “.php” =>
( “localhost” =>
(
“socket” => “/tmp/php-fastcgi.socket”,
“bin-path” => “/usr/local/bin/php-cgi”
)
)
)

Save and close the file. Restart lighttpd:

[root@bsd ~]# /usr/local/etc/rc.d/lighttpd restart

test server using this foolowing code

[root@bsd ~]# pico phpinfo.php

<?php
phpinfo();
?>

Save and close the file.

open your browser

http://localhost/phpinfo.php