YourSite - Slogan Here!

Upgrade FreeBSD to FreeBSD 9.0-RELEASE

Step 1: The upgrade

Let’s get right to it. Here’s the first step in the upgrade process:

freebsd-update upgrade -r 9.0-RELEASE

Once all files have been fetched, you will be asked a number of questions about merging config-files. They all seemed reasonable to me, so I just answered ‘y’ to all of them, but it might differ for you. Make sure you read the diff before accepting it.

If you get the following error:

The update metadata is correctly signed, but failed an integrity check. Cowardly refusing to proceed any further.Then simply patch your freebsd-update using the following command (source):

sed -i -e ’s/=_/=%@_/’ /usr/sbin/freebsd-updateand then re-run the upgrade command again.

If that went fine, it’s time to update the actual system. To do that, run:

freebsd-update installOnce the update is done, reboot your system:

shutdown -r nowWhen it comes back up, make sure you run the install-again to install again to intall the userland updates:

freebsd-update install

Once you’ve run this, you’ll get the message:

Completing this upgrade requires removing old shared object files.   Please rebuild all installed 3rd party software (e.g., programs installed from the ports tree) and then run “/usr/sbin/freebsd-update install” again to finish installing updates.This is of course a massive pain in the butt, but you need to do this nonetheless. Depending on how many packages from ports you have installed, this may take everything from a few minutes to a long time.

The easiest way to do this is to run portupgrade (if you don’t have portupgrade, install it from ‘sysutils/portupgrade’):

rm /var/db/pkg/pkgdb.db && pkgdb -Ffuv && portupgrade -afp

I added the ‘p’-flag, as this allows you to run ‘portupgrade -afP’ on other nodes (assuming you have a shared ports-tree) and just install the packages without having to re-compile them.

Finally, when you’ve done this, you can run (for the last time):

freebsd-update install

FreeBSD Patch

Untuk melakukan patching di OS FreeBSD cukup mengetikkan :

freebsd-update fetch
freebsd-update install

Cheers

CVSUP Syntax

*default host=cvsup.id.FreeBSD.org
*default base=/usr
*default prefix=/usr
*default release=cvs tag=.
*default delete use-rel-suffix

Untuk menghapus ^M pada script PHP

Esc

:%s/^M//g

Note : ^M = Ctrl + vm

Cara Compile Kernet FreeBSD 64bit

#cd /usr/src/sys/amd64/conf
#cp SMP MySMP
#cp GENERIC MyGENERIC
#vi MySMP
ubah GENERIC menjadi MyGENERIC
save

#vi MyGENERIC
tambahkan text dibawah
options         IPFIREWALL
options         IPFIREWALL_VERBOSE
options         IPFIREWALL_VERBOSE_LIMIT=10
options         IPDIVERT
save

#cd /usr/src/
#make buildkernel KERNCONF=MySMP
#make installkernel KERNCONF=MySMP
#cd /etc
#vi rc.conf

tambahkan :
firewall_enable=”YES”
firewall_script=”/etc/ipfw.rules”
save
#vi /etc/ipfw.rules

tambahkan :
#!/bin/sh
fwcmd=”/sbin/ipfw”
$fwcmd -f flush
$fwcmd add allow ip from any to any via lo0

Tambahkan rules ipfw sesuai kebutuhan
save
reboot

Untuk menghapus file yang jumlahnya banyak di *nix

for i in *; do echo $i; rm -f $i; done

How do I change mysql root password?

If you are setting a root password first time, use any one of the following command syntax:
mysqladmin password “NEW-PASSWORD
OR
mysqladmin -u root password “NEW-PASSWORD
OR
mysqladmin -u root -h localhost password “NEW-PASSWORD

Install FreeRadius & MySQL

INSTALL mySQL:
Pertama install dulu mysql, saya menggunakan mySql 5.
Jika sudah jalankan dan otomatisasi shg berjalan sewaktu reboot.

INSTALL FreeRadius:
cd /usr/ports/net/freeradius
% make && make install
Pilih mySQL support dan SNMP (optional).

CONFIGURE freeRADIUS:
% cd /usr/local/etc/raddb
Pastikan file² berikut ada

% clients.conf (basic config cukup & memakai localhost)

% users
Untuk pengetesan pertama tambahkan baris
ainoer Auth-Type := Local, User-Password == “testpass”

% cp snmp.conf.sample snmp.conf
% cp sql.conf.sample sql.conf
% cp huntgroups.sample huntgroups
% cp dictionary.sample dictionary
% cp hints.sample hints
% cp acct_users.sample acct_users
% cp preproxy_users.sample preproxy_users

% cp radiusd.conf.sample radiusd.conf
Edit radiusd.conf,
log_auth = yes
log_auth_badpass = yes
log_auth_goodpass = yes

% radiusd -X &
% radtest ainoer testpass localhost 1812 testing123

Jika berhasil ada indikasi sbb :
rad_recv: Access-Accept packet from host 127.0.0.1:1812, id=119, length=20

CREATE DATABASE & TABEL
Login ke mysql dan create database dengan nama radius.
Carilah file dengan nama db_mysql.sql kemudian import ke database.
/bin/mysql -u root radius < /usr/local/share/examples/freeradius/db_mysql.sql

Masukkan record² berikut :
INSERT INTO radcheck (UserName, Attribute, Value) VALUES (’rahma’, ‘Password’, ‘passku’);
INSERT INTO radgroupcheck (GroupName, Attribute, Value) VALUES (’dynamic’, ‘Auth-Type’, ‘Local’);
INSERT INTO radgroupreply (GroupName, Attribute, op, Value) VALUES (’dynamic’, ‘Framed-Compression’, ‘:=’, ‘Van-Jacobsen-TCP-IP’);
INSERT INTO radgroupreply (GroupName, Attribute, op, Value) VALUES (’dynamic’, ‘Framed-Protocol’, ‘:=’, ‘PPP’);
INSERT INTO radgroupreply (GroupName, Attribute, op, Value) VALUES (’dynamic’, ‘Service-Type’, ‘:=’, ‘Framed-User’);
INSERT INTO radgroupreply (GroupName, Attribute, op, Value) VALUES (’dynamic’, ‘Framed-MTU’, ‘:=’, ‘1500′);
INSERT INTO radgroupreply (GroupName, Attribute, op, Value) VALUES (’dynamic’, ‘X-Ascend-Assign-IP-Pool’, ‘:=’, ‘0′);
INSERT INTO radgroupreply (GroupName, Attribute, op, Value) VALUES (’dynamic’, ‘X-Ascend-Maximum-Time’, ‘:=’, ‘7200′);
INSERT INTO radgroupreply (GroupName, Attribute, op, Value) VALUES (’dynamic’, ‘X-Ascend-Route-IP’, ‘:=’, ‘Route-IP-Yes’);
INSERT INTO radgroupreply (GroupName, Attribute, op, Value) VALUES (’dynamic’, ‘Idle-Timeout’, ‘:=’, ‘1800′);
INSERT INTO usergroup (UserName, GroupName) VALUES (’rahma’, ‘dynamic’);

select * from radcheck;
+—-+———-+———–+—-+——–+
| id | UserName | Attribute | op | Value |
+—-+———-+———–+—-+——–+
| 1 | rahma | Password | == | passku |
+—-+———-+———–+—-+——–+

mysql> select * from radgroupcheck;
+—-+———–+———–+—-+——-+
| id | GroupName | Attribute | op | Value |
+—-+———–+———–+—-+——-+
| 1 | dynamic | Auth-Type | := | Local |
+—-+———–+———–+—-+——-+

select * from radgroupreply;
+—-+———–+————————-+—-+———————+——+
| id | GroupName | Attribute | op | Value | prio |
+—-+———–+————————-+—-+———————+——+
| 1 | dynamic | Framed-Compression | := | Van-Jacobsen-TCP-IP | 0 |
| 2 | dynamic | Framed-Protocol | := | PPP | 0 |
| 3 | dynamic | Service-Type | := | Framed-User | 0 |
| 4 | dynamic | Framed-MTU | := | 1500 | 0 |
| 5 | dynamic | X-Ascend-Assign-IP-Pool | := | 0 | 0 |
| 6 | dynamic | X-Ascend-Maximum-Time | := | 7200 | 0 |
| 7 | dynamic | X-Ascend-Route-IP | := | Route-IP-Yes | 0 |
| 8 | dynamic | Idle-Timeout | := | 1800 | 0 |
+—-+———–+————————-+—-+———————+——+

select * from usergroup;
+———-+———–+———-+
| UserName | GroupName | priority |
+———-+———–+———-+
| rahma | dynamic | 1 |
+———-+———–+———-+

% cd /usr/local/etc/raddb/
Edit sql.conf
Isikan password database( root dgn pass = “” jika masih belum diberi password)

Edit radiusd.conf.
Pada bagian authorize{}:
Hilangkan # pada ’sql’
Pada bagian accounting {}:
Hilangkan # pada ’sql’ accounting{}.

Pada post-auth ():
Hilangkan # pada ’sql’
Hilangkan # 3 baris terkahir dari post-auth dan ganti ke sql modul.

Post-Auth-Type REJECT {
sql
}
kill & restart in debug.
% radiusd -X

Selamat mencoba ;)

Edited :

Ternyata ada yang kurang, settingan di atas kan database mysqlnya masih belum diberi password..
Setelah diberi password kmudain dijalankan la koq error…
rlm_sql_mysql: Mysql error ‘Client does not support authentication please upgrade mysql client dst..

Coba cek librarynya :
# ldd /usr/local/lib/rlm_sql_mysql.so/usr/local/lib/rlm_sql_mysql.so:
libmysqlclient.so.12 => /usr/local/lib/mysql/libmysqlclient.so.12 (0×28157000)
libz.so.2 => /lib/libz.so.2 (0×28177000)
libcrypt.so.2 => /lib/libcrypt.so.2 (0×28187000)
libm.so.3 => /lib/libm.so.3 (0×2819f000)
libc.so.5 => /lib/libc.so.5 (0×28079000)
Udah sip tuw.. but why.. masak harus upgrade mysql clientnya kan versine udah 5.0 ach ngga harus dech kayaknya.. jgn percaya begitu saja sama warning :P .. googling dulu ach..
Setelah berpusing² eh jadi ingat instalasi pureftpd dgn mysql.. so aku coba dey..
# cd /usr/local/mysql/lib/mysql/
# cp * /usr/local/lib

Perbandingan Jumlah IPv4 dengan IPv6

Perbandingan panjang prefix (prefix-length) IPv4 dan IPv6 beserta jumlah IP.

v4 v6 Jumlah IP
/32 /128 1
/31 /127 2
/30 /126 4
/29 /125 8
/28 /124 16
/27 /123 32
/26 /122 64
/25 /121 128
/24 /120 256
/23 /119 512
/22 /118 1024
/21 /117 2048
/20 /116 4096
/19 /115 8192
/18 /114 16384
/17 /113 32768
/16 /112 65536
/15 /111 131072
/14 /110 262144
/13 /109 524288
/12 /108 1048576
/11 /107 2097152
/10 /106 4194304
/9 /105 8388608
/8 /104 16777216
/7 /103 33554432
/6 /102 67108864
/5 /101 134217728
/4 /100 268435456
/3 /99 536870912
/2 /98 1073741824
/1 /97 2147483648
/0 /96 4294967296

Gak punya Ninja lagi hik…hik.. :-(

Tanggal 8 November 2007 adalah tanggal dimana MyLovely Ninja ku di bayarin orang, pembelinya adalah Mr. Panda yang lucu.

Sekarang gue dah gak punya Ninja lagi deh, semoga rezeki datang lagi dan gue bisa beli Ninja baru hik..hik.. sedihnya :-(

gren-ninja.jpg