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

# fetch

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, we can do this step :

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

# dig @ axfr
; <<>> DiG 9.4.2-P2 <<>> @ axfr
; (1 server found)
;; global options:  printcmd        3600    IN    SOA 2009031102 3600 3600 1209600 3600        3600    IN    NS    3600    IN    A        3600    IN    NS        3600    IN    NS        3600    IN    NS        3600    IN    NS 3600 IN    A 3600 IN    A 3600 IN    AAAA    2001:d30:3::218:71ff:fe87:1cc3 3600 IN    AAAA    2001:d30:103:3000:218:71ff:fe86:c773 3600 IN CNAME    3600    IN    NS    3600    IN    NS    3600    IN    NS 3600    IN    A 3600    IN    A    3600    IN    A    3600    IN    MX    10


.    3600    IN    A    3600    IN    MX    5    3600    IN    MX    10 3600 IN    A        3600    IN    SOA 2009031102 3600 3600 1209600 3600
;; Query time: 310 msec
;; WHEN: Mon Mar 16 14:24:00 2009
;; XFR size: 1157 records (messages 1, bytes 27118)

you can try another domains for example to be searched all of its subdomains

# dig @ axfr

; <<>> DiG 9.4.2-P2 <<>> @ axfr
; (1 server found)
;; global options:  printcmd        2592000    IN    SOA 2009031209 3600 900 1728000 3600        2592000    IN    AAAA    2001:d30:3:160::3        2592000    IN    A        2592000    IN    MX    10        2592000    IN    MX    100        2592000    IN    NS        2592000    IN    NS        2592000    IN    NS    2592000    IN    A    2592000    IN    A    2592000    IN    A    2592000    IN    A    2592000    IN    A    2592000    IN    A    2592000    IN    A    2592000    IN    A    2592000    IN    A    2592000    IN    A



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[]=

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

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

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 []? 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: , , , , ,