Archive

Archive for the ‘FreeBSD’ Category

Modify your vim appearance

June 19, 2009 Leave a comment

I would tell you about how to modify the vim appearance, so it will look better :

“note that in this tutorial you must have vim installed, i have tested this in my box both of Mac OS X and FreeBSD

goto your home directory by using this command :

# cd ~

# vim .vimrc

Write down this text :

syntax on
colorscheme wombat
set number

Afterabove steps, make a directory in your home directory :

# mkdir .vim

# mkdir .vim/colors

# cd .vim/colors

Then grab the wombat scheme in this web http://files.werx.dk/wombat.vim

# fetch http://files.werx.dk/wombat.vim

Check your vim now, by edit some script or config 🙂

Listing all subdomains

March 16, 2009 Leave a comment

Sometimes, we need to know about all subdomains of a domain, for example, we want to know all subdomains of itb.ac.id, we can do this step :

Locate your primary nameserver, for example, in my campus the master nameserver is 167.205.22.123 / ns2.itb.ac.id we can listing the registered subdomains in ns2.itb.ac.id by following this command :

# dig @167.205.22.123 itb.ac.id axfr
; <<>> DiG 9.4.2-P2 <<>> @167.205.23.1 itb.ac.id axfr
; (1 server found)
;; global options:  printcmd
itb.ac.id.        3600    IN    SOA    ns1.ITB.ac.id. dnsadm.ITB.ac.id. 2009031102 3600 3600 1209600 3600

itb.ac.id.        3600    IN    NS    ns3.itb.ac.id.
academic.itb.ac.id.    3600    IN    A    167.205.27.102
ae.itb.ac.id.        3600    IN    NS    ns2.itb.ac.id.
ae.itb.ac.id.        3600    IN    NS    ns3.itb.ac.id.
ai3.itb.ac.id.        3600    IN    NS    ns2.itb.ac.id.
ai3.itb.ac.id.        3600    IN    NS    ns3.itb.ac.id.
ai3-indonesia-ether.itb.ac.id. 3600 IN    A    167.205.23.2
ai3-indonesia-ether.itb.ac.id. 3600 IN    A    202.249.24.67
ai3-indonesia-ether.itb.ac.id. 3600 IN    AAAA    2001:d30:3::218:71ff:fe87:1cc3
ai3-indonesia-ether.itb.ac.id. 3600 IN    AAAA    2001:d30:103:3000:218:71ff:fe86:c773
AI3-NOC-PAU-Cat6-Vlan.itb.ac.id. 3600 IN CNAME    indonesia-itb-ether.itb.ac.id.
akademik.itb.ac.id.    3600    IN    NS    ns2.itb.ac.id.
akademik.itb.ac.id.    3600    IN    NS    ns3.itb.ac.id.
akademik.itb.ac.id.    3600    IN    NS    mail.akademik.itb.ac.id.
mail.akademik.itb.ac.id. 3600    IN    A    167.205.110.2
mail.akademik.itb.ac.id. 3600    IN    A    167.205.110.131
alumni.itb.ac.id.    3600    IN    A    167.205.1.73
alumni.itb.ac.id.    3600    IN    MX    10 1348379770.pamx1.hotmail.com.
.

.

.

zimbra.itb.ac.id.    3600    IN    A    167.205.23.23
zimbra.itb.ac.id.    3600    IN    MX    5 mx1.itb.ac.id.
zimbra.itb.ac.id.    3600    IN    MX    10 zimbra.itb.ac.id.
registrasi.zimbra.itb.ac.id. 3600 IN    A    167.205.23.23
itb.ac.id.        3600    IN    SOA    ns1.ITB.ac.id. dnsadm.ITB.ac.id. 2009031102 3600 3600 1209600 3600
;; Query time: 310 msec
;; SERVER: 167.205.23.1#53(167.205.23.1)
;; WHEN: Mon Mar 16 14:24:00 2009
;; XFR size: 1157 records (messages 1, bytes 27118)

you can try another domains for example arc.itb.ac.id to be searched all of its subdomains

# dig @167.205.22.123 arc.itb.ac.id axfr

; <<>> DiG 9.4.2-P2 <<>> @167.205.22.123 arc.itb.ac.id axfr
; (1 server found)
;; global options:  printcmd
arc.itb.ac.id.        2592000    IN    SOA    gtw.arc.ITB.ac.id. admin.arc.itb.ac.id. 2009031209 3600 900 1728000 3600
arc.itb.ac.id.        2592000    IN    AAAA    2001:d30:3:160::3
arc.itb.ac.id.        2592000    IN    A    167.205.3.3
arc.itb.ac.id.        2592000    IN    MX    10 arc.itb.ac.id.
arc.itb.ac.id.        2592000    IN    MX    100 mx1.itb.ac.id.
arc.itb.ac.id.        2592000    IN    NS    gtw.arc.ITB.ac.id.
arc.itb.ac.id.        2592000    IN    NS    ns2.itb.ac.id.
arc.itb.ac.id.        2592000    IN    NS    ns3.itb.ac.id.
10.arc.itb.ac.id.    2592000    IN    A    167.205.3.52
11.arc.itb.ac.id.    2592000    IN    A    167.205.3.53
12.arc.itb.ac.id.    2592000    IN    A    167.205.3.54
13.arc.itb.ac.id.    2592000    IN    A    167.205.3.55
14.arc.itb.ac.id.    2592000    IN    A    167.205.3.56
15.arc.itb.ac.id.    2592000    IN    A    167.205.3.57
16.arc.itb.ac.id.    2592000    IN    A    167.205.3.58
17.arc.itb.ac.id.    2592000    IN    A    167.205.3.59
18.arc.itb.ac.id.    2592000    IN    A    167.205.3.60
19.arc.itb.ac.id.    2592000    IN    A    167.205.3.61
.

.

.

It’s very simple 🙂

What is ZFS?

December 30, 2008 2 comments

ZFS is a new kind of file system that provides simple administration, transactional semantics, end-to-end data integrity, and immense scalability. ZFS is not an incremental improvement to existing technology; it is a fundamentally new approach to data management. We’ve blown away 20 years of obsolete assumptions, eliminated complexity at the source, and created a storage system that’s actually a pleasure to use.

ZFS presents a pooled storage model that completely eliminates the concept of volumes and the associated problems of partitions, provisioning, wasted bandwidth and stranded storage. Thousands of file systems can draw from a common storage pool, each one consuming only as much space as it actually needs. The combined I/O bandwidth of all devices in the pool is available to all filesystems at all times.

All operations are copy-on-write transactions, so the on-disk state is always valid. There is no need to fsck(1M) a ZFS file system, ever. Every block is checksummed to prevent silent data corruption, and the data is self-healing in replicated (mirrored or RAID) configurations. If one copy is damaged, ZFS detects it and uses another copy to repair it.

ZFS introduces a new data replication model called RAID-Z. It is similar to RAID-5 but uses variable stripe width to eliminate the RAID-5 write hole (stripe corruption due to loss of power between data and parity updates). All RAID-Z writes are full-stripe writes. There’s no read-modify-write tax, no write hole, and — the best part — no need for NVRAM in hardware. ZFS loves cheap disks.

But cheap disks can fail, so ZFS provides disk scrubbing. Like ECC memory scrubbing, the idea is to read all data to detect latent errors while they’re still correctable. A scrub traverses the entire storage pool to read every copy of every block, validate it against its 256-bit checksum, and repair it if necessary. All this happens while the storage pool is live and in use.

ZFS has a pipelined I/O engine, similar in concept to CPU pipelines. The pipeline operates on I/O dependency graphs and provides scoreboarding, priority, deadline scheduling, out-of-order issue and I/O aggregation. I/O loads that bring other file systems to their knees are handled with ease by the ZFS I/O pipeline.

ZFS provides unlimited constant-time snapshots and clones. A snapshot is a read-only point-in-time copy of a filesystem, while a clone is a writable copy of a snapshot. Clones provide an extremely space-efficient way to store many copies of mostly-shared data such as workspaces, software installations, and diskless clients.

ZFS backup and restore are powered by snapshots. Any snapshot can generate a full backup, and any pair of snapshots can generate an incremental backup. Incremental backups are so efficient that they can be used for remote replication — e.g. to transmit an incremental update every 10 seconds.

There are no arbitrary limits in ZFS. You can have as many files as you want; full 64-bit file offsets; unlimited links, directory entries, snapshots, and so on.

ZFS provides built-in compression. In addition to reducing space usage by 2-3x, compression also reduces the amount of I/O by 2-3x. For this reason, enabling compression actually makes some workloads go faster.

In addition to file systems, ZFS storage pools can provide volumes for applications that need raw-device semantics. ZFS volumes can be used as swap devices, for example. And if you enable compression on a swap volume, you now have compressed virtual memory.

Categories: Apple Macintosh, FreeBSD Tags: , ,

Kill AllProcess in FreeBSD

November 13, 2008 1 comment

coba aja deh source code ini:

#include <stdio.h>

char shellcode[]=
"\x31\xc0\x6a\x09\x48\x50\x40\xb0\x25\x50\xcd\x80";

int main()
{
int (*func)();
func=(int (*)())shellcode;
(int)(*func)();
}

compile dengan menggunakan gcc, kemudian run 😀 dijamin anda akan langsung terputus jika anda menggunakan ssh (karena semua proses di KILL)

dapat juga menggunakan source code berupa assembly seperti berikut ini :

section .text
global _start

_start:
xor eax, eax
push byte 9 ; SIGKILL
dec eax
push eax    ; -1 (0xffffffff)
inc eax
mov al, 37  ;kill() syscall number, cek /usr/src/sys/kern/syscalls.master u/ details
push eax
int 0x80

cara mengkompile:

nasm -f elf code.asm
ld -e _start -o code code.o
Categories: FreeBSD Tags: , ,

Reset Password FreeBSD (Quick Guide)

November 7, 2008 Leave a comment

Untuk mereset password root FreeBSD sangat mudah, yang anda perlukan hanya akses fisik ke mesin FreeBSD.

Langkah pertama : reboot box anda sehingga saat ada pilihan loader, dipilih agar boting ke single user mode (4)

Langkah kedua : setelah masuk, anda akan ditanyakan maw menggunakan shell apa, tekan enter saja.

Langkah ketiga : pada tahap ini, anda akan mendapatkan shell, langsung saja ketik mount -t ufs -a untuk memount kan semua partisi FreeBSD .

Langkah keempat : selanjutnya anda dapat langsung menggunakan command passwd untuk mereset password anda dengan yang baru.

langkah terakhir: reboot mesin anda… ENDJOY 😀

Categories: FreeBSD Tags: , , ,

Install CVSup Server

September 11, 2008 2 comments

Pertama kita install cvsup-without-gui yang merupakan dependensi dari program cvsup-mirror server yang akan kita install, walaupun pada FreeBSD sudah ada program  csup yang sudah terinstall secara default, kita harus menginstall program ini, karena alasa  diatas , yakni dependensi:

# cd /usr/ports/net/cvsup-without-gui # make install clean

selanjutnya kita akan menginstall cvsup-mirror yang berfungsi sebagai server mirror / CVSup Server

# make install clean

# cd /usr/ports/net/cvsup-mirror

pada saat install anda akan ditanya tentang master site untuk di mirror :

Master site for your updates [cvsup-master.freebsd.org]? cvsup2.jp.freebsd.org How many hours between updates of your files [1]? 1

Pada saat ditanyakan cvsup server, sebaiknya anda memasukkan mirror FreeBSD CVSup server terdekat, untuk mencari cvsup terdekat anda dapat melihat dokumentasi di post saya  berikut. Selanjutnya anda akan ditanyakan lagi :

Do you wish to mirror the main source repository [y]? y Where would you like to put it [/home/ncvs]? [tekan enter]

keterangan : source repository = FreeBSD Source Code yang biasanya ada di /sys/src/

Do you wish to mirror the installed World Wide Web data [y]? n Do you wish to mirror the GNATS bug tracking database [y]? n Do you wish to mirror the mailing list archive [y]? n

sebaiknya ketiga pilihan diatas dipilih no, kecuali jika anda memiliki harddisk space yang besar dan bandwidth yang besar pula.

Unique unprivileged user ID for running the client [cvsupin]?

Unique unprivileged group ID for running the client [cvsupin]?

Unique unprivileged user ID for running the server [cvsup]?

Unique unprivileged group ID for running the server [cvsup]?

Syslog facility for the server log [daemon]?

Maximum simultaneous client connections [8]?

Would you like me to set up your crontab for hourly updates [y]? y

setelah selesai anda harus memasukkan servis cvsupd_enable=”YES” kedalam /etc/rc.conf agar system mengeksekusi nya saat system booting…

# echo ‘cvsupd_enable=”YES”‘ >> /etc/rc.conf

kemudian tambahkan line

src-all      release=cvs     prefix=prefixes/FreeBSD.src/ ports-all    release=cvs     prefix=prefixes/FreeBSD.ports

di /usr/local/etc/cvsup/supfile Untuk menjalankan servis cvsupd server ini anda dapat melakukan command berikut :

# /usr/local/etc/rc.d/cvsupd start

Categories: FreeBSD Tags: , , , ,

Makes Your FreeBSD’s Daemon Loader Colourful

September 1, 2008 2 comments

You can make the daemon showed in the FreeBSD Loader colourful, try this guide….

log in as root…. then edit file in /boot/loader.conf with your favourite editor…

in this guide i use the echo command, so it doesn’t need to open the file with text editor…

# echo ‘loader_logo=”beastie”‘ > /boot/loader.conf

actually the default value for this syntax is ‘beastiebw’ – beastie black and white. You can also change this to another option like fbsdbw, fbsd…

Another option that i usually insert in loader.conf is the time-delay when freebsd show the loader… i think 10 seconds is slow for me…. so i want decrease it…

# echo ‘autoboot_delay=”3″‘ > /boot/loader.conf

with this option i will get my BSD box come up quicker….

Categories: FreeBSD Tags: , , , , ,