xwings's blog

First Day With Ruby ....

Submitted by xwings
on July 28, 2004 - 4:28am
Ruby .... Ruby ..... Liao ~~~~~~~~

Today is my first date with ruby.
But , something appears on my head.Ruby suitable for a programmer or system administrator ?

I got a perception that perl is best scripting languages for me as a system admin.
But in the afternoon, i joined freenote's #ruby-lang.
and i discover Ruby is quite powerful for scripting language.

I decided to use ruby for a try on my latest assignment.
I will learn and code along the way. Hopefully i can finish it with ruby.

My Comemnet about ruby ? no comement for the moment yet ..
I will blog when i learn new stuff in ruby.

Very Small Notes On Diff.

Submitted by xwings
on July 23, 2004 - 2:55am
Spoke to a guy in irc(dal.net) today.

We talk about opensource in Malaysia (My COuntry).
Kind of sad story ...

anyway , he give me some tips on how to use - diff -

Here We go ....

     # diff -u A B > yada.diff 
     to create single file diff

     # diff -uNr dirA dirB > big.diff 
     to create cumulative/recursive diffs between 2 directories

     '-u' means 'unified' diff , *standard* diff/patch

Install MRTG , FreeBSD

Submitted by xwings
on June 10, 2004 - 2:01pm
Title  : Install MRTG
OS     : BSD
Distro : FreeBSD
URL    : http://www.freebsd.org
Install SNMP using Ports

      # cd /usr/ports/net-mgmt/net-snmp
      # make && make install && make clean 
      
Add Two Lines into /etc/rc.conf
	
	snmpd_enable="YES"
	snmpd_flags="-a -Lsd -p /var/run/snmpd.pid"

      # chmod 444 /usr/local/etc/rc.d/snmptrapd.sh
      
Configure snmpd.conf

Keypair in SSH2

Submitted by xwings
on June 7, 2004 - 1:17pm
Title   : Keypair in SSH2
Os      : *NIX
Distro  : 
URL     : http://www.openssh.org
(09:15:19).xwings@debnote.<~>$ ssh-keygen -t dsa
      ## No Need to enter value for passphrase

(09:15:19).xwings@debnote.<~>$ cat ~/.ssh/config
Host 192.168.1.21
Port 22
User xwings
Compression yes
Protocol 2
RSAAuthentication yes
StrictHostKeyChecking no
ForwardAgent yes
IdentityFile /home/xwings/.ssh/backup_id_dsa

pppoe in FreeBSD

Submitted by xwings
on June 6, 2004 - 1:18pm
Title   : pppoe in FreeBSD
Os      : BSD
Distro  : FreeBSD
URL     : http://www.freebsd.org

###########################
#  /etc/ppp/ppp.conf
###########################

default:
 set log Phase tun command # you can add more detailed logging if you wish
 #set ifaddr 10.0.0.1/0 10.0.0.2/0

streamyx:
 set device PPPoE:xl0 # replace xl1 with your ethernet device

File Name : vimrc

Submitted by xwings
on May 25, 2004 - 1:48pm

Specs

Title : vimrc
Os :
Distro :
URL : http://www.vim.org

Slackware : /usr/share/vim/vimrc

Debian : /etc/vim/vimrc

Redhat : ~/.vimrc

Freebsd : /usr/local/share/vim/vimrc

dot slash Configure

Submitted by xwings
on May 4, 2004 - 3:14am
dot slash configure for 

     Apache 1 and 2
     Php 4
     MySql 4
     squid 2.5

CVSup , FreeBSD 4.X

Submitted by xwings
on April 29, 2004 - 11:45pm
   # cd ~
   # mkdir cvsup
   # cd cvsup
   # cp /usr/share/example/cvsup/standaed-cvsup

Edit CVSup file, use a faster mirror
   # vim standard-cvsup 

   # cvsup -L2 -g standard-cvsup

   # make buildworld
   # make buildkernel
   # make installkernel
   # reboot


   Boot : boot -s

   # fsck -p
   # mount -u /
   # mount -a -t ufs
   # swapon -a
   # mergemaster -p

IPF for FreeBSD 5

Submitted by xwings
on April 5, 2004 - 12:15am
Title   : IPF for FreeBSD 5
Os      : BSD
Distro  : FreeBSD 5
URL     : i. http://www.freebsd.org
          ii. http://www.schlacter.net/public/FreeBSD-STABLE_and_IPFILTER.html
   1. Install FreeBSD 5.2.1 (Now 5.2.1 is the latest "5 Series").

   2. Remeber to Install Kernel Source and Ports (might be Useful)

   3. Setup the network. Make sure can connect to Internet.

Vim On Slackware

Submitted by xwings
on March 4, 2004 - 11:51pm
Title   : Vim On Slackware
Os      : Linux
Distro  : Slackware
URL     : http://www.slackware.com
In RedHat , their vim looks very cool.

When we started to use some other OS or distro, 
we will find out that their vim looks like lack of feature.

So, to make it looks our vim looks more cooler,
These are the two things we can do.

Create a filename call /usr/share/vim/vimrc , and add in these lines

Debian On Alpha XL 266

Submitted by xwings
on February 28, 2004 - 6:19am
Title   : Debian On Alpha XL 266
Os      : Linux
Distro  : Debian
URL     : http://www.debian.org
System  : Alpha XL 266
Firmware: AlphaBIOS / NT Firmware
First of all, this system don't have SRM console.
So we need to get a copy of MILO.

Download Debian for Alpha , Inside the CD , there is MILO.
Copy linload.exe and the MILO (Filename : xl) file to Floppy.

Use the AlphaBios to start MILO.

Anti Spam and Anti Virus on qmail

Submitted by xwings
on February 24, 2004 - 2:38am
Title   : Anti Spam and Anti Virus on qmail
Os      : Unix
Distro  : 
URL     : http://www.qmail.nu
First of all download the script from qmail.nu. Edit the file ,
for editing your can always use sed.

     cp filename.sh filename.sh.old
     sed "s#old-syntax#new-syntax#" filename.sh.old > filename.sh

In Order to run the file , chmod it and run.
 
     chmod +x filename.sh

Adding New Hard Disk

Submitted by xwings
on January 20, 2004 - 12:04pm
Title   : Adding New Hard Disk
Os      : Unix
Distro  : Solaris 9 x86
URL     : http://


Solaris 9 x86 Disk Controller Table

IDE

/dev/rdsk/c0d0s0~7Primary IDE Master
/dev/rdsk/c0d1s0~7Primary IDE Slave
/dev/rdsk/c1d0s0~7Secondary IDE Master
/dev/rdsk/c1d1s0~7Secondary IDE Slave

SCSI

/dev/rdsk/c0t0d0s0~7First SCSI ?No 0 ? Disk Drive
/dev/rdsk/c0t1d0s0~7First SCSI ?No 1 ? Disk Drive

Simple Backup Script

Submitted by xwings
on December 1, 2003 - 10:12am
Title   : Simple Backup Script
Os      : *NiX
Servers : 1. MySql
          2. Ftp
          3. Bash


-- MySql Syntax --

mysql> create database dbname;
mysql> grant all on dbname.* to dbuser@localhost identified by "dbpassword";
mysql> FLUSH PRIVILEGES;
mysql> show databases;
mysql> use dbname;
mysql> show tables;
mysql> drop table tablename;
mysql> drop database dbname;

OpenLdap + Berkeley DB + PHP

Submitted by xwings
on November 21, 2003 - 4:33am
Title  : OpenLdap with Berkeley DB
Os     : Linux
Distro : Slackware
URL    : http://www.sleepycat.com/
         http://www.openldap.org/
         http://www.php.net/

I.   Dowload Berkeley DB
II.  Download OpenLdap
III. Download PHP

Part I. Install Berkeley DB

   i.   Download the tar.gz file , Untar the file.
      # cd db-
      # cd build_unix
      # ../dist/configure