Friday, March 19, 2010

Sunday, March 14, 2010

Interwoven

http://www.scribd.com/doc/23210131/ts-671sp1-clt-win-v01-en

http://interwoven-teamsite.blogspot.com/2008/02/installing-teamsite-67.html

http://www.epic-ide.org/faq.php
http://www.scribd.com/doc/23210155/upgrade-technical-supplement
http://www.ibm.com/developerworks/aix/library/au-cmsaix/index.html

awk example

http://www.linuxquestions.org/questions/programming-9/file-size-shell-script-377486/
http://www.ibm.com/developerworks/library/l-awk1.html
http://www.mindbend.org/scripts
http://www.thegeekstuff.com/2010/02/awk-conditional-statements/
ll | awk '/Pyrami/ {print $9}'

awk -F":" '{ print $1 }' /etc/passwd 
ll| awk '{if($9=="test"){ print $9} else print "6"}'


IFS=$'\012';
 for d in `find . -type d`;
 do s=$(ls -AlF $d | grep -v / | awk '{ $5 = $5/1024; sum += $5; } END \
 { print sum}') c=$(ls -AF $d|wc -l) ;
printf "%-20s" ${c} ${s}KB ${d} >>usage; printf "\n">>usage; done
ls -al | awk '{sum = sum + $5} END {print sum}'




find . \( -name "CORE_*" -o -name "c-*" \) -mtime -1 -exec ls -l {} \; |awk '/^-/ {total += $5} END {printf "%15.2f\n",total}'

find /path -mtime +1 -printf "%s\n"|awk '{sum+=$0}END{print sum}'

Saturday, March 13, 2010

Cpu Load

http://blog.scoutapp.com/articles/2009/07/31/understanding-load-averages
http://www.linuxjournal.com/article/9001
http://en.wikipedia.org/wiki/Load_%28computing%29

http://digg.com/linux_unix/Linux_tip_How_do_I_find_out_Linux_CPU_utilization
http://www.cyberciti.biz/tips/how-do-i-find-out-linux-cpu-utilization.html





some more ref:
----------------
http://cpulimit.sourceforge.net/


http://www.cyberciti.biz/tips/how-do-i-find-out-linux-cpu-utilization.html

http://www.cyberciti.biz/tips/linux-limiting-or-restricting-smp-cpu-activation-in-smp-mode.html

http://www.cyberciti.biz/faq/cpu-usage-limiter-for-linux/

boot parameter:
-------------------
http://www.cyberciti.biz/tips/10-boot-time-parameters-you-should-know-about-the-linux-kernel.html


security:
--------------
http://www.cyberciti.biz/tips/linux-security.html

Sunday, March 7, 2010

TCP/IP & OSI Stack

http://www.interfacebus.com/Design_OSI_Stack.html

http://www.tutorialsweb.com/networking/osi-model-application-layer.htm
http://www.networkdictionary.com/protocols/osimodel.php

monitorCpuUsage

http://bashcurescancer.com/monitor-cpu-abusers-with-this-simple-script.html

http://httpd.apache.org/docs/1.3/misc/descriptors.html

Mysql Monitoring Script

Mysql to CVS file:


--------------------------------------------------------------------
>>>>>>>>>>SELECT * FROM user where User='root' INTO OUTFILE '/tmp/root_user.txt';

>>>>>>>>>>LOAD DATA INFILE '/tmp/root_user.txt' INTO TABLE user

>>>>>>>>>select User,Host from user where User='root';



>>>>>>>>>mysql -u uid -ppwd -D dbname << EOQ | sed -e 's/        /,/g' | tee list.csv
select id, concat("\"",name,"\"") as name
from students
EOQ


command[check_mysqld]=/usr/lib/nagios/plugins/check_mysql_query -q 'select 1+2' -u nagiosCheck -p 'password' -w 3:3 -c 3:3


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

http://tlug.dnho.net/node/209
http://dev.mysql.com/doc/refman/4.1/en/select.html
http://forums.mysql.com/read.php?93,217055,220349#msg-220349
http://eoslist.com/open_source/directory/database.html
http://dev.mysql.com/doc/refman/5.1/en/mysqldump.html

Regular Expression

http://www.franz.com/support/documentation/7.0/doc/regexp.htm
http://www.regexlab.com/en/regref.htm
http://gravity.tbates.org/reexamp.html
http://support.yessoftware.com/kb_article.asp?article_id=63
http://www.regular-expressions.info/conditional.html

What is innoDB


nnoDB.
innoDB is a table type in mySQL.
InnoDB provides MySQL with a transaction-safe storage engine with commit, rollback, and crash recovery capabilities. InnoDB does locking on the row. These features increase multi-user concurrency and performance. There is no need for lock escalation in InnoDB because row-level locks in InnoDB fit in very little space.
advantages of innoDB table type are :
* InnoDB tables are transactional: they provide rollback and commit capabilities.
* InnoDB is the only table type in MySQL which supports foreign key constraints.
* InnoDB tables are fast, even faster than MyISAM tables in many simple benchmarks. See the benchmark page.
* InnoDB tables have row level locking: they allow higher concurrency than MyISAM tables which use table level locking, or BDB tables, which use page level locking. High concurrency is reflected in high multiuser performance.
* InnoDB tables provide an Oracle-style consistent read, also known as multiversioned concurrency control. SELECTs do not need to set any locks and need not interfere with inserts and updates to the same table. No other MySQL table type has this property.
* There is a true hot backup tool available for InnoDB, which allows you to make backups of a running database in background, without setting any locks or disturbing database operation.
* Multiversioning also allows you to dump tables from your database with SELECT INTO OUTFILE without setting locks on the tables: the database can keep working while a backup is made.
* InnoDB tables have automatic crash recovery. You do not need to repair your tables if the operating system or the database server crashes, when there is no disk image corruption.
* InnoDB tables can be any size, also on those operating systems where file size is restricted to < 2 GB.
Enabling and Checking innoDB type in mySQL
innoDB type is supported my all mySQL versions starting from mySQL 4.0.x
Go to the file /etc/my.cnf file and either comment out the line or delete the line ’skip-innodb’ and innodb will be enabled.
You can check either your mySQL supports the innoDB type by giving the following command at mysql prompt.
mysql> show variables like ‘have_innodb’;
+—————+——-+
| Variable_name | Value |
+—————+——-+
| have_innodb | YES |
+—————+——-+
1 row in set (0.00 sec)


MySQL has two primary storange engines: MyISAM and InnoDB. Each has its own performance characteristics and considerations. In the broadest sense MyISAM is good for read-heavy data and InnoDB is good for write-heavy data, though there are cases where the opposite is true. The biggest gotcha is how the two differ with respect to the COUNT function.
MyISAM keeps an internal cache of table meta-data like the number of rows. This means that, generally, COUNT(*) incurs no additional cost for a well-structured query. InnoDB, however, has no such cache. For a concrete example, let’s say we’re trying to paginate a query. If you have a query SELECT * FROM users LIMIT 5,10, let’s say, running SELECT COUNT(*) FROM users LIMIT 5,10 is essentially free with MyISAM but takes the same amount of time as the first query with InnoDB. MySQL has a SQL_CALC_FOUND_ROWS option which tells InnoDB to calculate the number of rows as it runs the query, which can then be retreived by executing SELECT FOUND_ROWS(). This is very MySQL-specific, but can be necessary in certain situations, particularly if you use InnoDB for its other features (e.g., row-level locking, stored procedures, etc.).



Links:

Friday, March 5, 2010

Sysadmin's Guide

 http://www.ibm.com/developerworks/linux/library/l-10sysadtips/?S_TACT=105AGX54&S_CMP=C0115&ca=dnw-1002&open&cm_mmc=4633-_-n-_-vrm_newsletter-_-10731_101108&cmibm_em=dm:0:6992641

 http://linuxhelp.blogspot.com/2008/03/two-repositories-of-linux-and-unix.html


 http://linuxhelp.blogspot.com/2009/01/linux-commands-10-useful-tricks-for.html

Linux console Screen

http://www.rackaid.com/resources/linux-screen-tutorial-and-how-to/
http://www.cyberciti.biz/tips/linux-screen-command-howto.html
http://magazine.redhat.com/2007/09/27/a-guide-to-gnu-screen/
http://www.pixelbeat.org/lkdb/screen.html
http://www.linuxjournal.com/article/6340


Alternative of screen: tmux
--------------------------------------------

http://tmux.sourceforge.net/

Wednesday, March 3, 2010

Introduction

rndc is a nameserver control utility that comes along with the bind package. It uses digital signature to communicate with nameserver. It is used to reload the configuration file and zones, flush the DNS cache, to see the status of nameservers etc.

Configuring rndc

The bind package has utilities to configure rndc with the nameserver. The binary rndc-confgen generates the configuration file for rndc. To generate the configuration file for rndc, run the binary as,
[root@localhost ~]# rndc-confgen
# Start of rndc.conf
key "rndckey" {
        algorithm hmac-md5;
        secret "YAytbNi94tMD26FPxes3Yg==";
};

options {
        default-key "rndckey";
        default-server 127.0.0.1;
        default-port 953;
};
# End of rndc.conf

# Use with the following in named.conf, adjusting the allow list as needed:
# key "rndckey" {
#       algorithm hmac-md5;
#       secret "YAytbNi94tMD26FPxes3Yg==";
# };
#
# controls {
#       inet 127.0.0.1 port 953
#               allow { 127.0.0.1; } keys { "rndckey"; };
# };
# End of named.conf
[root@localhost ~]#
Copy the configuration directives between # Start of rndc.conf and # End of rndc.conf into the file /etc/rndc.conf. We need to configure nameserver to accept the commands issued from rndc utility. For that, copy the directives between # Use with the following in named.conf, adjusting the allow list as needed: and # End of named.conf to /etc/named.conf file removing the leading '#' symbol. The nameserver is now ready to be managed by rndc. Just restart the named service and issue the following command.
[root@localhost ~]# rndc reload
server reload successful
[root@localhost ~]#
You will get server reload successful message, if rndc is able to communicate with the nameserver.

Configuration statements

The key statement specifies the key name being used to communicate with nameserver. The clauses algorithm and secret in the key statement specify the name of algorithm and the the key respectively.
The statement options in rndc.conf specifies the default server and the key to be used, when command rndc is used without specifying any server name.
The control statement in named.conf allows rndc to update the nameserver listening on IP 127.0.0.1 via port 953 using the key "rndckey" from localhost, ie from the server itself.
The rndc-confgen has option to specify the size of the key in bytes. By default, the size is 128. The HMAC-MD5 key can also be generated by using the utility dnssec-keygen. To generate the key with size 128 bytes,
[root@localhost ~]# dnssec-keygen -a HMAC-MD5 -b 128 -n host rndckey
Krndckey.+157+41716
[root@localhost ~]#

The corresponding key can be found in files
Krndckey.+157+41716.key  and
Krndckey.+157+41716.private


Advanced Configuration

Using rndc, we can manage the nameserver remotely. Only thing is both rndc and remote nameserver should use the same digital signature and remote server should accept commands from the server from which it is going to be managed. We can extend the above mentioned configuration to do it.
Using the binary dnssec-keygen, create a new key for managing the remote server and name it as "rndcremotekey". Of course you may use any name for the key as long as the name matches in both servers. To configure rndc to use key "rndcremotekey" to manage the remote server, add the following entries in /etc/rndc.conf file.
# Add the key generated with command 'dnssec-keygen'

key "rndcremotekey" {
        algorithm hmac-md5;
        secret "mSqfSp6rKNHQwVG3JVHfzw==";
};

# Remote nameserver to be managed

server  {
        key "rndcremotekey";
};
You need to replace with the IP address of the remote nameserver.
We have now configured rndc to use key "rndcremotekey" when controlling the remote nameserver.
For the remote server to accept commands, add the following entries in /etc/named.conf file in the remote nameserver.
# Remote nameserver should use the same key

key "rndcremotekey" {
        algorithm hmac-md5;
        secret "mSqfSp6rKNHQwVG3JVHfzw==";
};

# Control statement to accept rndc commands

controls {
        inet  port 953
        allow { ; } keys { "rndcremotekey"; };
};
Replace and with the corresponding server IP addresses.
Once done, restart named service in remote nameserver. You can then manage the remote server from the rndc server. To test the configuration, type the following in rndc server.
[root@localhost ~]# rndc -s  reload
server reload successful
[root@localhost ~]#

Using rndc

After the configuration, you may use rndc to reload, flush cache and see the status of nameserver as
[root@localhost ~]# rndc reload
server reload successful
[root@localhost ~]# rndc flush
[root@localhost ~]# rndc status
number of zones: 6
debug level: 0
xfers running: 0
xfers deferred: 0
soa queries in progress: 0
query logging is OFF
recursive clients: 0/1000
tcp clients: 0/100
server is up and running
[root@localhost ~]#
To see more command line options, just type the command "rndc" in shell. You will see a handful of useful options.

Conclusion

Though startup script /etc/rc.d/init.d/named has option to reload the configuration than restarting named service, rndc provides more options. For example, reload, refresh or retransfer a single zone, flush dns cache without restarting the named service, flush a single name from cache, see the server status etc. So to manage nameserver efficiently, it is necessary to configure rndc utility properly.

Install GNU/Linux without any CD, floppy, USB-key, nor any other removable media

 http://syslinux.zytor.com/wiki/index.php/PXELINUX

  http://marc.herbert.free.fr/linux/win2linstall.html


 http://www.novell.com/coolsolutions/feature/11802.html

mysql replication

Monday, March 1, 2010

Virtual Machine Architecture

A virtual machine can support individual processes or a complete system depending on the abstraction level where virtualization occurs. Some VMs support flexible hardware usage and software isolation, while others translate from one instruction set to another. Virtualizing a system or component -such as a processor, memory, or an I/O device - at a given abstraction level maps its interface and visible resources onto the interface and resources of an underlying, possibly different, real system. Consequently, the real system appears as a different virtual system or even as multiple virtual systems. Interjecting virtualizing software between abstraction layers near the HW/SW interface forms a virtual machine that allows otherwise incompatible subsystems to work together. Further, replication by virtualization enables more flexible and efficient and efficient use of hardware resources.






Kernel Compilation

# cd /usr/src/linux-2.6.18.8/
# cp ./.config ../kernel.2.6.18.8.config
# make clean
# make mrproper
# cp ../kernel.2.6.18.8.config ./.config

yum install ncurses-devel

make mrproper
make oldconfig
make menuconfig
make
make modules_install
make install

or

make bzImage
bzImage inside arch/i386/boot

make modules.

make modules_install.


It will install three files into /boot directory as well as modification to your kernel grub configuration file:

    * System.map-2.6.25
    * config-2.6.25
    * vmlinuz-2.6.25

# cd /boot
# mkinitrd -o initrd.img-2.6.25 2.6.25



make -j bzImage
make -j modules
make -j modules-Install

j=2*cpu no

sh /usr/src/linux-2.6.32.3/arch/x86/boot/install.sh 2.6.32.3 arch/x86/boot/bzImage \
                System.map "/boot"


====================================================
#boot=/dev/sda
default=0
timeout=5
splashimage=(hd0,0)/grub/splash.xpm.gz
hiddenmenu
title CentOS (2.6.18-53.el5)
        root (hd0,0)
        kernel /vmlinuz-2.6.18-53.el5 ro root=/dev/VolGroup00/LogVol00 rhgb quiet
        initrd /initrd-2.6.18-53.el5.img


title new
        root (hd0,0)
        kernel /mynewkernel ro root=/dev/hda3

====================================================





http://tldp.org/HOWTO/Module-HOWTO/copyright.html
https://www.linuxquestions.org/questions/slackware-14/cant-make-menuconfig-as-non-root-ncurses-not-found-543858/
http://www.cyberciti.biz/tips/compiling-linux-kernel-26.html
http://www.linuxchix.org/content/courses/kernel_hacking/lesson4
http://bobcares.com/blog/?p=162









Open Filer iSCSI SAN Commands

 http://www.oracle.com/technology/pub/articles/hunter_rac10gr2_iscsi.html

 http://www.tbaumi.de/blog/?p=244

http://akns.wordpress.com/2009/01/19/software-iscsi-initiator-against-target-openfiler/


--------------------
http://kb.vmware.com/selfservice/microsites/search.do?cmd=displayKC&docType=kc&externalId=1008083&sliceId=2&docTypeID=DT_KB_1_1&dialogID=54682501&stateId=0%200%2055404225


http://greg.porter.name/wiki/HowTo:Openfiler


http://docs.sun.com/app/docs/doc/817-5093/fqnls?a=view


http://www.petri.co.il/use-openfiler-as-free-vmware-esx-san-server.htm









Storage

http://www.storagesearch.com/auspexart.html
http://www.linux.com/archive/feed/53578

 Linux Interview  Linux booting process EXT4 XFS file system runlevel scan disk hba driver systool -c fc_host lspci -nn | grep -i hba single...