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.
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/patchTitle : 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.confTitle : 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_dsaTitle : 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
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 for
Apache 1 and 2
Php 4
MySql 4
squid 2.5
# 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
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.
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
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.
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.shTitle : 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
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;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