Thursday, July 29, 2010

Youtube -> MP3

http://www.dirpy.com

Friday, July 23, 2010

Zimbra mail server

root@abs-mail:~# more /etc/resolv.conf
search abs.com.my
nameserver localhost

-------------------------------------------------

root@abs-mail:~# more /etc/hosts

127.0.0.1 localhost.localdomain localhost
203.223.137.86 abs-mail.abs.com.my absmail

-------------------------------------------------



root@abs-mail:~# more /etc/network/interfaces
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface (DHCP)
#auto eth0
#iface eth0 inet dhcp

# The primary network interface (static)
auto eth0
iface eth0 inet static
address 203.223.137.86
netmask 255.255.255.128
network 203.223.137.0
broadcast 203.223.137.127
gateway 203.223.137.126
root@abs-mail:~#


Wednesday, July 14, 2010

Ubuntu - How to set DNS server

apt-get install bind9
/etc/init.d/bind9 stop

edit 3 files.

* /etc/bind/named.conf.local
* /etc/bind/named.conf.options
* /etc/resolv.conf

create 2 files.

* /etc/bind/zones/mydomain.com.db
* /etc/bind/zones/rev.0.168.192.in-addr.arpa
--------------------------------------------------------------------------------------------

vi /etc/bind/named.conf.local

# Our domain zone

zone "abs.com.my" {
type master;
file "/etc/bind/zones/abs.com.my.db";
};

# For reverse DNS
zone "137.223.203.in-addr.arpa" {
type master;
file "/etc/bind/zones/rev.137.223.203.in-addr.arpa";
};

--------------------------------------------------------------------------------------------

vi /etc/bind/named.conf.options

options {
// directory "/var/named";
// dump-file "/var/named/data/cache_dump.db";
// statistics-file "/var/named/data/named_stats.txt";
directory "/var/cache/bind";

// If there is a firewall between you and nameservers you want
// to talk to, you might need to uncomment the query-source
// directive below. Previous versions of BIND always asked
// questions using port 53, but BIND 8.1 and later use an unprivileged
// port by default.

query-source address * port 53;

// If your ISP provided one or more IP addresses for stable
// nameservers, you probably want to use them as forwarders.
// Uncomment the following block, and insert the addresses replacing
// the all-0's placeholder.

forwarders {
203.223.137.124;
};
// include "/etc/rndc.key";
// We are the master server for server.example.com


//zone "abs-mail.abs.com.my" {
// type master;
// file "abs-mail.abs.com.my";


// auth-nxdomain no; # conform to RFC1035
// listen-on-v6 { any; };
};

--------------------------------------------------------------------------------------------

vi /etc/resolv.conf

search abs.com.my
nameserver localhost
nameserver 203.223.137.126
nameserver 210.19.197.110
nameserver 203.223.137.124
nameserver 203.121.65.30

--------------------------------------------------------------------------------------------


mkdir /etc/bind/zones
vi /etc/bind/zones/mydomain.com.db
$TTL 3D
@ IN SOA abs-mail.abs.com.my. root (
2007062001
28800
3600
604800
38400
);

abs.com.my. IN NS abs-mail.abs.com.my.
abs.com.my. IN MX 10 abs-mail.abs.com.my.
abs-mail IN A 203.223.137.86

--------------------------------------------------------------------------------------------

vi /etc/bind/zones/rev.137.223.203.in-addr.arpa

$TTL 3D
@ IN SOA abs-mail.abs.com.my. root (
2007062001
28800
604800
604800
86400
)
IN NS abs-mail.abs.com.my.
86 IN PTR abs-mail.abs.com.my.


--------------------------------------------------------------------------------------------

/etc/init.d/bind9 restart

--------------------------------------------------------------------------------------------


1. go to other computers, point it's dns server to this new dns server
2. open  terminal/cmd prompt

          dig jaring.my
        ; <<>> DiG 9.6.1-P2 <<>> jaring.my
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 55222 ;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 4, ADDITIONAL: 0 ;; QUESTION SECTION: ;jaring.my. IN A ;; ANSWER SECTION: jaring.my. 359962 IN A 192.228.128.20 ;; AUTHORITY SECTION: jaring.my. 86362 IN NS NS6.jaring.my. jaring.my. 86362 IN NS NS5.jaring.my. jaring.my. 86362 IN NS dns1.jaring.my. jaring.my. 86362 IN NS dns2.jaring.my. ;; Query time: 1 msec ;; SERVER: 203.223.137.86#53(203.223.137.86) ;; WHEN: Wed Jul 14 14:25:00 2010 ;; MSG SIZE rcvd: 117


nslookup jaring.my

Server: 203.223.137.86     <-------it's using new dns server  Address: 203.223.137.86#53 Non-authoritative answer: Name: jaring.my Address: 192.228.128.20



root--- jaring.my ping statistics ---
10 packets transmitted, 10 received, 0% packet loss, time 9011ms
rtt min/avg/max/mdev = 186.559/295.523/416.053/68.948 ms

:~# ping jaring.my -c 10
PING jaring.my (192.228.128.20) 56(84) bytes of data.
64 bytes from dns2.jaring.my (192.228.128.20): icmp_seq=1 ttl=56 time=218 ms
64 bytes from dns2.jaring.my (192.228.128.20): icmp_seq=2 ttl=56 time=358 ms
64 bytes from dns2.jaring.my (192.228.128.20): icmp_seq=3 ttl=56 time=257 ms
64 bytes from dns2.jaring.my (192.228.128.20): icmp_seq=4 ttl=56 time=383 ms
64 bytes from dns2.jaring.my (192.228.128.20): icmp_seq=5 ttl=56 time=289 ms
64 bytes from dns2.jaring.my (192.228.128.20): icmp_seq=6 ttl=56 time=186 ms
64 bytes from dns2.jaring.my (192.228.128.20): icmp_seq=7 ttl=56 time=252 ms
64 bytes from dns2.jaring.my (192.228.128.20): icmp_seq=8 ttl=56 time=286 ms
64 bytes from dns2.jaring.my (192.228.128.20): icmp_seq=9 ttl=56 time=416 ms
64 bytes from dns2.jaring.my (192.228.128.20): icmp_seq=10 ttl=56 time=307 ms


--- jaring.my ping statistics ---
10 packets transmitted, 10 received, 0% packet loss, time 9011ms
rtt min/avg/max/mdev = 186.559/295.523/416.053/68.948 ms
root@fLufyz-laptop:~# 

done.

if error, check log file at  /var/log/syslog

Tuesday, July 13, 2010

Solaris - search installed package

#pkginfo | grep -i [package-name] 

eg.

#pkginfo | grep -i php

Friday, July 9, 2010

Solaris 10 - Backup using fssnap & ufsdump & ufsrestore

1. Create test folder to be backup
#mkdir -p /virtual-rmt/0/
#mkdir /backingstore
#mkdir /export/home/filetobackup
#cd /export/home/filetobackup
#mkfile -nv 100k file1.test file2.test file3.test file4.test


2. Take a snapshot of the file
#fssnap -F ufs -o bs=/backingstore /filetobackup


3. Backup the file
#ufsdump 0uf /virtual-rmt/0 /dev/fssnap/0


------------------------------------------------------------

to check the status of a snapshot:
#fssnap -i

to delete snapshot: 
#fssnap -d /dev/fssnap/0

-----------------------------------------------------------

to restore:

#rm -rf /export/home/filetobackup
#ls
#ufsrestore rvf /virtual-rmt/0/dump0


done

 

Tuesday, July 6, 2010

Solaris 10 - replace failed hardisk on mirror setting

#metastat
#metadb -d c0t1d1s7
#metadetach -f d40 d42
#metaclear -f d42
#cfgadm -al
#cfgadm -c unconfigure c1::dsk/c0t1d0

take out old disk
put in new disk

#cfgadm -c configure c1::dsk/c0t1d0
#format
#prtvtoc /dev/rdsk/c0t0d0s2 | fmthard -s - /dev/rdsk/c0t1d0s2
#metadb -a -c 2 c0t1d0s7
#metainit -f d42 1 1 c0t1d0s5
#metattach d40 d42
#metastat -p
#metadevadm -u c0t1d0

mount iso

#mkdir /tmp/syshandbook
#mount -o loop file1.iso /tmp/syshandbook
#ls /tmp/syshandbook