Monday, April 26, 2010

How to *.tar/ *.tar.gz/ *.tgz/ *.tar.bz2

1. Creating an archive using tar command
Creating an uncompressed tar archive using option cvf
This is the basic command to create a tar archive.
$ tar cvf archive_name.tar dirname/
In the above command:
c – create a new archive
v – verbosely list files which are processed.
f – following is the archive file name
Creating a tar gzipped archive using option cvzf
The above tar cvf option, does not provide any compression. To use a gzip compression on the tar archive, use the z option as shown below.
$ tar cvzf archive_name.tar.gz dirname/
z – filter the archive through gzip
Note: .tgz is same as .tar.gz
Creating a bzipped tar archive using option cvjf
Create a bzip2 tar archive as shown below:
$ tar cvjf archive_name.tar.bz2 dirname/
j – filter the archive through bzip2
gzip vs bzip2: bzip2 takes more time to compress and decompress than gzip. bzip2 archival size is less than gzip.
Note: .tbz and .tb2 is same as .tar.bz2
Note: I like to keep the ‘cvf’ option unchanged for all archive creation, and add additional option at the end, which is easier to remember. i.e cvf for archive creation, cvzf for compressed gzip archive creation, cvjf for compressed bzip2 archive creation etc.,
2. Extracting (untar) an archive using tar command
Extract a *.tar file using option xvf
Extract a tar file using option x as shown below:
$ tar xvf archive_name.tar
x – extract files from archive
Extract a gzipped tar archive ( *.tar.gz ) using option xvzf
Use the option z for uncompressing a gzip tar archive.
$ tar xvzf archive_name.tar.gz
Extracting a bzipped tar archive ( *.tar.bz2 ) using option xvjf
Use the option j for uncompressing a bzip2 tar archive.
$ tar xvjf archive_name.tar.bz2
Note: In all the above commands v is optional, which lists the file being processed.
3. Listing an archive using tar command
View the tar archive file content without extracting using option tvf
You can view the *.tar file content before extracting as shown below.
$ tar tvf archive_name.tar
View the *.tar.gz file content without extracting using option tvzf
You can view the *.tar.gz file content before extracting as shown below.
$ tar tvzf archive_name.tar.gz
View the *.tar.bz2 file content without extracting using option tvjf
You can view the *.tar.bz2 file content before extracting as shown below.
$ tar tvjf archive_name.tar.bz2
4. Extract a single file from tar, tar.gz, tar.bz2 file
To extract a specific file from a tar archive, specify the file name at the end of the tar xvf command as shown below. The following command extracts only a specific file from a large tar file.
$ tar -xvf archive_file.tar /path/to/file
Use the relevant option z or j according to the compression method gzip or bzip2 respectively as shown below.
$ tar -xvzf archive_file.tar.gz /path/to/file

$ tar -xvjf archive_file.tar.bz2 /path/to/file
5. Extract a single directory from tar, tar.gz, tar.bz2 file
To extract a single directory (along with it’s subdirectory and files) from a tar archive, specify the directory name at the end of the tar xvf command as shown below. The following extracts only a specific directory from a large tar file.
$ tar -xvf archive_file.tar /path/to/dir/
To extract multiple directories from a tar archive, specify those individual directory names at the end of the tar xvf command as shown below.
$ tar -xvf archive_file.tar /path/to/dir1/ /path/to/dir2/
Use the relevant option z or j according to the compression method gzip or bzip2 respectively as shown below.
$ tar -xvzf archive_file.tar.gz /path/to/dir/

$ tar -xvjf archive_file.tar.bz2 /path/to/dir/
6. Extract group of files from tar, tar.gz, tar.bz2 archives using regular expression
You can specify a regex, to extract files matching a specified pattern. For example, following tar command extracts all the files with pl extension.
$ tar -xvf archive_file.tar --wildcards '*.pl'
Options explanation:
–wildcards *.pl – files with pl extension
7. Adding a file or directory to an existing archive using option -r
You can add additional files to an existing tar archive as shown below. For example, to append a file to *.tar file do the following:
$ tar rvf archive_name.tar newfile
This newfile will be added to the existing archive_name.tar. Adding a directory to the tar is also similar,
$ tar rvf archive_name.tar newdir/
Note: You cannot add file or directory to a compressed archive. If you try to do so, you will get “tar: Cannot update compressed archives” error as shown below.
$ tar -rvzf archive_name.tgz newfile
tar: Cannot update compressed archives
Try `tar --help' or `tar --usage' for more information.
8. Verify files available in tar using option -W
As part of creating a tar file, you can verify the archive file that got created using the option W as shown below.
$ tar cvfW file_name.tar dir/
If you are planning to remove a directory/file from an archive file or from the file system, you might want to verify the archive file before doing it as shown below.
$ tar tvfW file_name.tar
Verify 1/file1
1/file1: Mod time differs
1/file1: Size differs
Verify 1/file2
Verify 1/file3
If an output line starts with Verify, and there is no differs line then the file/directory is Ok. If not, you should investigate the issue.
Note: for a compressed archive file ( *.tar.gz, *.tar.bz2 ) you cannot do the verification.
Finding the difference between an archive and file system can be done even for a compressed archive. It also shows the same output as above excluding the lines with Verify.
Finding the difference between gzip archive file and file system
$ tar dfz file_name.tgz
Finding the difference between bzip2 archive file and file system
$ tar dfj file_name.tar.bz2
9. Estimate the tar archive size
The following command, estimates the tar file size ( in KB ) before you create the tar file.
$ tar -cf - /directory/to/archive/ | wc -c
20480
The following command, estimates the compressed tar file size ( in KB ) before you create the tar.gz, tar.bz2 files.
$ tar -czf - /directory/to/archive/ | wc -c
508

$ tar -cjf - /directory/to/archive/ | wc -c
428

Saturday, April 17, 2010

Netstat Command Fedora/Centos/RedHat/

1. List All Ports (both listening and non listening ports)

List all ports using netstat -a
# netstat -a | more
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 localhost:30037 *:* LISTEN
udp 0 0 *:bootpc *:*

Active UNIX domain sockets (servers and established)
Proto RefCnt Flags Type State I-Node Path
unix 2 [ ACC ] STREAM LISTENING 6135 /tmp/.X11-unix/X0
unix 2 [ ACC ] STREAM LISTENING 5140 /var/run/acpid.socket
List all tcp ports using netstat -at
# netstat -at
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 localhost:30037 *:* LISTEN
tcp 0 0 localhost:ipp *:* LISTEN
tcp 0 0 *:smtp *:* LISTEN
tcp6 0 0 localhost:ipp [::]:* LISTEN
List all udp ports using netstat -au
# netstat -au
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address Foreign Address State
udp 0 0 *:bootpc *:*
udp 0 0 *:49119 *:*
udp 0 0 *:mdns *:*
2. List Sockets which are in Listening State

List only listening ports using netstat -l
# netstat -l
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 localhost:ipp *:* LISTEN
tcp6 0 0 localhost:ipp [::]:* LISTEN
udp 0 0 *:49119 *:*
List only listening TCP Ports using netstat -lt
# netstat -lt
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 localhost:30037 *:* LISTEN
tcp 0 0 *:smtp *:* LISTEN
tcp6 0 0 localhost:ipp [::]:* LISTEN
List only listening UDP Ports using netstat -lu
# netstat -lu
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State
udp 0 0 *:49119 *:*
udp 0 0 *:mdns *:*
List only the listening UNIX Ports using netstat -lx
# netstat -lx
Active UNIX domain sockets (only servers)
Proto RefCnt Flags Type State I-Node Path
unix 2 [ ACC ] STREAM LISTENING 6294 private/maildrop
unix 2 [ ACC ] STREAM LISTENING 6203 public/cleanup
unix 2 [ ACC ] STREAM LISTENING 6302 private/ifmail
unix 2 [ ACC ] STREAM LISTENING 6306 private/bsmtp
3. Show the statistics for each protocol

Show statistics for all ports using netstat -s
# netstat -s
Ip:
11150 total packets received
1 with invalid addresses
0 forwarded
0 incoming packets discarded
11149 incoming packets delivered
11635 requests sent out
Icmp:
0 ICMP messages received
0 input ICMP message failed.
Tcp:
582 active connections openings
2 failed connection attempts
25 connection resets received
Udp:
1183 packets received
4 packets to unknown port received.
.....
Show statistics for TCP (or) UDP ports using netstat -st (or) -su
# netstat -st

# netstat -su
4. Display PID and program names in netstat output using netstat -p

netstat -p option can be combined with any other netstat option. This will add the “PID/Program Name” to the netstat output. This is very useful while debugging to identify which program is running on a particular port.

# netstat -pt
Active Internet connections (w/o servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 1 0 ramesh-laptop.loc:47212 192.168.185.75:www CLOSE_WAIT 2109/firefox
tcp 0 0 ramesh-laptop.loc:52750 lax:www ESTABLISHED 2109/firefox
5. Don’t resolve host, port and user name in netstat output

When you don’t want the name of the host, port or user to be displayed, use netstat -n option. This will display in numbers, instead of resolving the host name, port name, user name.

This also speeds up the output, as netstat is not performing any look-up.

# netstat -an
If you don’t want only any one of those three items ( ports, or hosts, or users ) to be resolved, use following commands.

# netsat -a --numeric-ports

# netsat -a --numeric-hosts

# netsat -a --numeric-users
6. Print netstat information continuously

netstat will print information continuously every few seconds.

# netstat -c
Active Internet connections (w/o servers)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 ramesh-laptop.loc:36130 101-101-181-225.ama:www ESTABLISHED
tcp 1 1 ramesh-laptop.loc:52564 101.11.169.230:www CLOSING
tcp 0 0 ramesh-laptop.loc:43758 server-101-101-43-2:www ESTABLISHED
tcp 1 1 ramesh-laptop.loc:42367 101.101.34.101:www CLOSING
^C
7. Find the non supportive Address families in your system

netstat --verbose
At the end, you will have something like this.

netstat: no support for `AF IPX' on this system.
netstat: no support for `AF AX25' on this system.
netstat: no support for `AF X25' on this system.
netstat: no support for `AF NETROM' on this system.
8. Display the kernel routing information using netstat -r

# netstat -r
Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt Iface
192.168.1.0 * 255.255.255.0 U 0 0 0 eth2
link-local * 255.255.0.0 U 0 0 0 eth2
default 192.168.1.1 0.0.0.0 UG 0 0 0 eth2
Note: Use netstat -rn to display routes in numeric format without resolving for host-names.

9. Find out on which port a program is running

# netstat -ap | grep ssh
(Not all processes could be identified, non-owned process info
will not be shown, you would have to be root to see it all.)
tcp 1 0 dev-db:ssh 101.174.100.22:39213 CLOSE_WAIT -
tcp 1 0 dev-db:ssh 101.174.100.22:57643 CLOSE_WAIT -
Find out which process is using a particular port:

# netstat -an | grep ':80'
10. Show the list of network interfaces

# netstat -i
Kernel Interface table
Iface MTU Met RX-OK RX-ERR RX-DRP RX-OVR TX-OK TX-ERR TX-DRP TX-OVR Flg
eth0 1500 0 0 0 0 0 0 0 0 0 BMU
eth2 1500 0 26196 0 0 0 26883 6 0 0 BMRU
lo 16436 0 4 0 0 0 4 0 0 0 LRU
Display extended information on the interfaces (similar to ifconfig) using netstat -ie:

# netstat -ie
Kernel Interface table
eth0 Link encap:Ethernet HWaddr 00:10:40:11:11:11
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
Memory:f6ae0000-f6b00000

Thursday, April 8, 2010

Using bridged networking with Virt-manager

To do this, we install the package bridge-utils...

yum install bridge-utils

... and configure a bridge. Create the file /etc/sysconfig/network-scripts/ifcfg-br0 (please use the BOOTPROTO, BROADCAST, IPADDR, NETMASK and NETWORK values from the /etc/sysconfig/network-scripts/ifcfg-eth0 file):

vi /etc/sysconfig/network-scripts/ifcfg-br0

DEVICE=br0
TYPE=Bridge
BOOTPROTO=static
BROADCAST=192.168.0.255
IPADDR=192.168.0.100
NETMASK=255.255.255.0
NETWORK=192.168.0.0
ONBOOT=yes

Modify /etc/sysconfig/network-scripts/ifcfg-eth0 as follows (comment out BOOTPROTO, BROADCAST, IPADDR, NETMASK, and NETWORK and add BRIDGE=br0):

vi /etc/sysconfig/network-scripts/ifcfg-eth0

# Realtek Semiconductor Co., Ltd. RTL-8139/8139C/8139C+
DEVICE=eth0
#BOOTPROTO=static
#BROADCAST=192.168.0.255
HWADDR=00:10:A7:05:AF:EB
#IPADDR=192.168.0.100
#NETMASK=255.255.255.0
#NETWORK=192.168.0.0
ONBOOT=yes
BRIDGE=br0

Restart the network...

/etc/init.d/network restart

... and run

ifconfig

It should now show the network bridge (br0):

[root@rajat1 ~]# ifconfig
br0 Link encap:Ethernet HWaddr 00:10:A7:05:AF:EB
inet addr:192.168.0.100 Bcast:192.168.0.255 Mask:255.255.255.0
inet6 addr: fe80::210:a7ff:fe05:afeb/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:17 errors:0 dropped:0 overruns:0 frame:0
TX packets:53 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:1160 (1.1 KiB) TX bytes:14875 (14.5 KiB)

eth0 Link encap:Ethernet HWaddr 00:10:A7:05:AF:EB
inet6 addr: fe80::210:a7ff:fe05:afeb/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:13662 errors:7 dropped:160 overruns:4 frame:0
TX packets:11646 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:15144608 (14.4 MiB) TX bytes:1379942 (1.3 MiB)
Interrupt:74 Base address:0xcc00

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:38 errors:0 dropped:0 overruns:0 frame:0
TX packets:38 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:4308 (4.2 KiB) TX bytes:4308 (4.2 KiB)

virbr0 Link encap:Ethernet HWaddr 00:00:00:00:00:00
inet addr:192.168.122.1 Bcast:192.168.122.255 Mask:255.255.255.0
inet6 addr: fe80::200:ff:fe00:0/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:35 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 b) TX bytes:9987 (9.7 KiB)

[root@rajat1 ~]# brctl show

bridge name bridge id STP enabled interfaces
pan0 8000.000000000000 no
virbr0 8000.000000000000 yes
br0 8000.0019b97ec863 yes eth0

Tuesday, March 23, 2010

Free OS and Software

Debian, Kubuntu, Ubuntu, Xandros, SUSE, Red Hat, Fedora, CentOS, Linspire, Mandriva, Slackware, Open BSD, Gnome, KDE, MySQL, PostgreSQL, PostGIS, Slony, Zarafa, eGroupware, Kolab Groupware, Scalix, SugarCRM, vTiger, CITADEL, Mozilla-Firefox, Mozilla-Suite, OpenOffice, LibreOffice, Thunderbird, Wine, Apache, hadoop, Nginx Drupla, Joomla, Jboss, Wordpress, WebGUI,  Tomcat, TiKi WiKi, Wikimedia, Asterisk, OpenSER, FreePBX, OpenPBX, CallWeaver, SpamAssassin, ClamAV, OpenLDAP, OTRS, RT, Samba, Cyrus, Dovecot, Exim, Postfix, sendmail, Amanda, Bacula, DRBD, Heartbeat, Keepalived, Nagios, Zabbix, Zenoss, Open Security Filter, Ferm, FAI, Moodle, Squid, XEN, KVM, OpenVZ, Xenserver, Eucalyptus, OpenQRM, Opennebula, VirtualBox, Mondorescue, Spacewalk, Convirture, OpenVPN, VLC, PiTiVi, XBMC, dimdim, Puppet, osclass, Django, Affelio, AROUNDMe, BuddyPress, Elgg, iSocial, Mahara, Xoops, Magento, Jcow, Jinzora, OpenStack.

All Above product support available free of cost :D

Monday, March 8, 2010

Fedora Talking to you

# [root@rajat Rajat]# yum install espeak
Loaded plugins: presto, refresh-packagekit
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package espeak.x86_64 0:1.40.02-3.fc12 set to be updated
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================
Package Arch Version Repository Size
================================================================================
Installing:
espeak x86_64 1.40.02-3.fc12 fedora 605 k

Transaction Summary
================================================================================
Install 1 Package(s)
Upgrade 0 Package(s)

Total download size: 605 k
Is this ok [y/N]: y
Downloading Packages:
Setting up and reading Presto delta metadata
Processing delta metadata
Package(s) data still to download: 605 k
espeak-1.40.02-3.fc12.x86_64.rpm | 605 kB 00:14
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : espeak-1.40.02-3.fc12.x86_64 1/1

Installed:
espeak.x86_64 0:1.40.02-3.fc12

Complete!

Example 1: Speak the words specified in command line

This is the default usage.

# espeak --stdout 'words to speak' | aplay

Note: The above may also display the following message: “Playing WAVE ’stdin’ : Signed 16 bit Little Endian, Rate 22050 Hz, Mono”
Example 2: Speak the words specified in stdin

This will take the words interactively from the standard input and convert it to speech.

# espeak --stdout | aplay

Example 3: Speak your document

This will convert the text from the mydocument.txt to speech.

# espeak --stdout -t mydocument.txt | aplay

Example 4: Generate voice file from text document

Convert your text file to an audio file as shown below.

# espeak -t mydocument.txt -w myaudio.wav

Customizing espeak

If you find the default speech synthesizing is not good, you can try to customize it as explained below.
Example 5: List all available voice languages

# espeak --voices
Pty Language Age/Gender VoiceName File Other Langs
5 af M afrikaans af
5 bs M bosnian bs
5 ca M catalan ca
5 cs M czech cs
5 cy M welsh-test cy
5 de M german de
5 el M greek el
5 en M default default
5 en-sc M en-scottish en/en-sc (en 4)
.......

Example 6: Choose a different voice language

The following will use “en-uk” – British english to translate the text to speech.

# espeak -v en-uk --stdout 'reading tips & tricks in TGS' | aplay

Example 7: Increase or Decrease the number of spoken words per minute.

The default is 160 words per minute. You can reduce it using option -s as shown below.

# espeak -s 140 -f mydocument.txt | aplay

Example 8: List the available espeak voices in specific language

The following example will display all possible english language variation that you can use for your text to speech conversion.

# espeak --voice=en
Pty Language Age/Gender VoiceName File Other Langs
2 en-uk M english en/en (en 2)
3 en-uk M english-mb-en1 mb/mb-en1 (en 2)
2 en-us M english-us en/en-us (en-r 5)(en 3)
5 en-sc M en-scottish en/en-sc (en 4)
5 en M default default
.....

Monday, February 15, 2010

Setting DNS Server with Bind

/etc/named.conf.

zone "chida.in" {
type master;
notify no;
allow-query { any; };
file "chida.zone";
};

zone "yeswedeal.com" {
type master;
notify no;
allow-query { any; };
file "yeswedeal.zone";
};

zone "0.168.192.in-addr.arpa" {
type master;
notify no;
file "192-168-0.zone";
};

chida.zone
# vi /var/named/chroot/var/named/chida.zone

$TTL 3D
@ IN SOA ns1.chida.in. hostmaster.chida.in. (
200211152 ; serial#
3600 ; refresh, seconds
3600 ; retry, seconds
3600 ; expire, seconds
3600 ) ; minimum, seconds

NS www ; Inet Address of nameserver
chida.in. MX 10 mail ; Primary Mail Exchanger

localhost A 127.0.0.1
server A 192.168.0.1
mail A 192.168.0.2
ns1 CNAME server
www CNAME server

yeswedeal.zone
# vi /var/named/chroot/var/named/yeswedeal.zone

$TTL 3D
@ IN SOA ns1.yeswedeal.com. hostmaster.yeswedeal.com. (
200211152 ; serial#
3600 ; refresh, seconds
3600 ; retry, seconds
3600 ; expire, seconds
3600 ) ; minimum, seconds

NS www ; Inet Address of nameserver
yeswedeal.com. MX 10 mail ; Primary Mail Exchanger

localhost A 127.0.0.1
server A 192.168.0.1
mail A 192.168.0.3
ns1 CNAME server
www CNAME server

192-168-0.zone
# vi /var/named/chroot/var/named/192-168-0.zone

$TTL 3D
@ IN SOA www.chida.in. hostmaster.chida.in. (
200303301 ; serial number
8H ; refresh, seconds
2H ; retry, seconds
4W ; expire, seconds
1D ) ; minimum, seconds

NS www ; Nameserver Address

$TTL 3D
@ IN SOA www.yeswedeal.com. hostmaster.yeswedeal.com. (
200303301 ; serial number
8H ; refresh, seconds
2H ; retry, seconds
4W ; expire, seconds
1D ) ; minimum, seconds

NS www ; Nameserver Address



# chkconfig named on


# /etc/init.d/named { start | stop | status | restart }


# dig www.chida.in


# nslookup www.yeswedeal.com

Saturday, February 13, 2010

RHEL-CentOS cluster.conf Schema Description

Tag:
Attributes:

* name (required): The name of the cluster you have configured.
* config_version (required): Specifies a revision number for the cluster.conf file.
In order to successfully propagate a new configuration file,
this parameter must be higher than current value, i.e. monotonically increasing order.
* Alias: Pretty name for cluster that is not parsed by cluster
tag software; only the gui uses this value.

Example: ==== ====
Tag: Fence_xvm daemon startup flag
Note: This tag is optional. fence_xvmd is an I/O Fencing host which resides on dom0 and is used in conjunction with the fence_xvm fencing agent. Together, these two programs can be used to fence can be used to fence Xen virtual machines which are part of a cluster. There is a requirement that the parent dom0s are also a part of their own CMAN/OpenAIS based cluster, and that the dom0 cluster does not share any members with the domU cluster. Furthermore, the dom0 cluster is required to have fencing if domU recovery is expected to be automatic.
Parent Tag:
Attributes:

* family (Optional): IP family to use (auto, ipv4, or ipv6; default = auto)
* multicast_address (Optional): Multicast address to listen on (default=225.0.0.12 for ipv4, ff02::3:1 for ipv6)
* port (Optional): Port to use (default=1229)
* auth (Optional): Authentication type (none, sha1, sha256, sha512; default=sha256). This controls the authentication mechanism used to authenticate clients. The three SHA hashes use a key which must be shared between both the Xen virtual machines and the host domain-0 cluster. The three SHA authentication mecha- nisms use a simple bidirectional challenge-response based on pseudo- random number generation and a shared private key.
* hash (Optional): Packet hash type (none, sha1, sha256, sha512; default=sha256). This controls the hashing mechanism used to authenticate fencing requests. The three SHA hashes use a key which must be shared between both the Xen virtual machines and the host domain-0 cluster.
* key_file (Optional): Use the specified key file for packet hashing / SHA authentication. When both the hash type and the authentication type are set to "none" (or not used), this parameter is ignored.
* use_uuid=1 (Optional): Fence by UUID instead of Xen Domain name.

Tag: OpenAIS msg transport protocol
Parent Tag:
Attributes:

* token (Optional): This timeout specifies in milliseconds until a token loss is declared after not receiving a token. This is the time spent detecting a failure of a processor in the current configuration. Reforming a new configuration takes about 50 milliseconds in addition to this timeout.

The default is 10000 milliseconds.
* token_retransmits_before_loss_const (Optional): This timeout specifies in milliseconds after how long before receiving a token the token is retransmitted. This will be automatically calculated if token is modified. It is not recommended to alter this value without guidance from the openais community.

The default is 20 milliseconds.
* join (Optional): This timeout specifies in milliseconds how long to wait for join messages in the membership protocol.

The default is 60 milliseconds.
* consensus (Optional): This timeout specifies in milliseconds how long to wait for consensus to be achieved before starting a new round of membership configuration.

The default is 4800 milliseconds.

Tag: CMAN service configuration
Parent Tag:
Attributes:

Tag:
Parent Tag:
Attributes:
o addr: Address for multicasting.
Cman can be configured to use multicast instead
of broadcast (broadcast is used by default if no
multicast parameters are given.) Example: ==== ====
Tag: Fence Daemon Configuration
Parent Tag:
Attributes:
o post_join_delay: The number of seconds the daemon will wait before
fencing any victims after a node joins the domain.
o post_fail_delay: The number of seconds the daemon will wait before
fencing any victims after a domain member fails.
o clean_start: Used to prevent any start up fencing the daemon might
do. It indicates that the daemon should assume all nodes
are in a clean state to start.
Example: ==== ====
A Note On Fencing
Fencing is specified within the cluster.conf file in two places. The first place is within the tag. Any device used for fencing a node must be defined here as a first. This applies to power switches (APC, WTI, etc.) with multiple ports that are able to fence multiple cluster nodes, as well as fabric switches and baseboard management fence strategies (iLO, RSA, IPMI, Drac, etc.) that are usually 1 to 1 in nature; that is, one specified fence device is able to fence only one node. After defining the fence devices to be used in the cluster, it is necessary to associate the fence device listings with specific cluster nodes. The second place that fencing is specified within cluster.conf is within the tag. Beneath the tag, is a tag. Beneath the tag is one or more tag sets. Within a tag set, is a tag set. This is where the actual association between and node takes place. A tag has a required "name" attribute that refers to the name of one of the 's specified in the section of cluster.conf. More about blocks: A method block is like a fence level. If a primary fence method is selected, yet the user wants to define a backup method in case the first fence method fails, this is done by defining two d blocks for a cluster node, each with a unique name parameter. The fence daemon will call each fence method in the order they are specified under the tag set. Fence specification within cluster.conf offers one other feature for customizing fence action. Within a block, it is allowable to list more than one . This is useful when fencing a node with redundant power supplies, for example. The fence daemon will run the agent for each device listed within a block before determining success or failure.
Tag: Contains all fencing device information.
Parent Tag:
Attributes: None
Tag: Information about one fence device in particular.
Parent Tag:
Attributes:
o name (required by ALL fence devices): Name of the fence device.
o agent (required by ALL fence devices): Specifies fence agent to be used. See
agent list in Table 1 below.
o The following tables list attributes depending on which fence agent is used (all of these attributes listed below are attributes):
Type: APC Power Switch
attributes
name reference name for this device within the conf file
agent fence_apc
ipaddr IP address of the device.
login login name for device.
passwd password.
attributes
name reference to the fence device name attribute above
port switch outlet port
switch Optional: switch number when ganging Masterswitch Plus switches
option Action required. 'Reboot' (default action if this attr is not present)
'Off' or 'On'

Type: Brocade Fabric Switch
attributes
name reference name for this device within the conf file
agent fence_brocade
ipaddr IP address of the device.
login login name for device.
passwd password.
attributes
name reference to the fence device name attribute above
port switch port
option Action required. 'disable' (default action if this attr is not present)
or 'enable'

Type: McData SAN Switch
attributes
name reference name for this device within the conf file
agent fence_mcdata
ipaddr IP address of the device.
login login name for device.
passwd password.
attributes
name reference to the fence device name attribute above
port switch port
option Action required. 'disable' (default action if this attr is not present)
or 'enable'

Type: QLogic SANBox2
attributes
name reference name for this device within the conf file
agent fence_sanbox2
ipaddr IP address of the device.
login login name for device.
passwd password.
attributes
name reference to the fence device name attribute above
port switch port
option Action required. 'disable' (default action if this attr is not present)
or 'enable'

Type: IBM Blade Center
attributes
name reference name for this device within the conf file
agent fence_bladecenter
ipaddr IP address of the device.
login login name for device.
passwd password.
attributes
name reference to the fence device name attribute above
blade the blade to operate on
option Action required. 'disable' (default action if this attr is not present)
or 'enable'

Type: Bull PAP
attributes
name reference name for this device within the conf file
agent fence_bullpap
ipaddr IP address of the device.
login login name for device.
passwd password.
attributes
name reference to the fence device name attribute above
domain Domain of the BullPAP system to power cycle
option Action required. 'reboot' (default action if this attr is not present)
'on' or 'off'

Type: IPMI Lan
attributes
name reference name for this device within the conf file
agent fence_ipmilan
ipaddr IP address of the device.
login login name for device.
passwd password.
auth Authentication Type: none, 'password', 'md2', or 'md5'
lanplus Use lanplus: 'True' or '1'; leave
out for false (only in RHEL4.5 CS and later)
attributes
name reference to the fence device name attribute above
option Action required. 'reboot' (default action if this attr is not present)
'on' or 'off'

Type: WTI Power Switch
attributes
name reference name for this device within the conf file
agent fence_wti
ipaddr IP address of the device.
passwd password.
attributes
name reference to the fence device name attribute above
port The switch outlet port to power cycle

Type: Vixel SAN Switch
attributes
name reference name for this device within the conf file
agent fence_vixel
ipaddr IP address of the device.
passwd password.
attributes
name reference to the fence device name attribute above
port The switch port to remove zoning from

Type: HP ilo (Integrated Lights Out)
attributes
name reference name for this device within the conf file
agent fence_ilo
hostname Hostname or IP Address of the device.
login Login for the device.
passwd password for the device.
ribcl RIBCL protocol version to use. Default action
if this attr is not present is to autodetect
attributes
name reference to the fence device name attribute above
action Action required. 'reboot' (default action if this attr is not present)
'on' or 'off'
force Optional parameter. If set to '1' (force='1'), status will not be initially checked before fencing. The use of this
attribute significantly speeds up fencing on this device type.

Type: Global Network Block Device (GNBD)
attributes
name reference name for this device within the conf file
agent fence_gnbd
servers A whitespace separated list of servers
attributes
name reference to the fence device name attribute above

Type: Egenera SAN Controller
attributes
name reference name for this device within the conf file
agent fence_egenera
cserver The cserver to ssh to...the cserver can
be of the form user@hostname to log in as a particular user
esh The path to the esh command on the cserver
(default is /opt/pan-mgr/bin/esh if this attr is not present)
attributes
name reference to the fence device name attribute above
lpan The lpan to use
pserver The pserver to fence for this node
action Action required. 'reboot' (default action if this attr is not present)
'on' or 'off'

Type: IBM RSA II
attributes
name reference name for this device within the conf file
agent fence_rsa
ipaddr IP Address or Hostname of the device.
login Login for the device.
passwd password for the device.
attributes
name reference to the fence device name attribute above
option Action required. 'Reboot' (default action if this attr is not present)
'On' or 'Off'

Type: RPS10 Serial Switch
attributes
name reference name for this device within the conf file
agent fence_rps10
device Device name.
port Port to fence.
attributes
name reference to the fence device name attribute above

Type: Dell DRAC
attributes
name reference name for this device within the conf file
agent fence_drac
ipaddr Hostname or IP Address of the device.
login Login for the device.
passwd password for the device.
drac_version Force fence agent to use a particular version of DRAC
firmware. The default action when not including this
attr is to auto-detect
cmd_prompt Optional: Force fence_drac to use this value as the command prompt.
attributes
name reference to the fence device name attribute above
action Action required. 'reboot' (default action if this attr is not present)
'on' or 'off'
modulename Optional: used when employing DRAC/MC multi-chassis version

Type: Manual Fencing
attributes
name reference name for this device within the conf file
agent fence_manual
attributes
name reference to the fence device name attribute above

Example: ==== ====
Tag: Cluster Nodes Configuration: contains 1 or more tags.>br/> Parent Tag:
Attributes: None
Tag: Per Node configuration
Parent Tag:
Attributes:
+ name(Required): The hostname or IP Address of the node
+ votes(Optional - default is 1): number of votes node can cast
+ nodeid (Required): Each node must have a unique integer value node ID. A node’s application to join the cluster
may be rejected if you try to set the nodeid to one that
is already used.
Example: ==== ====
Tag: fencing information for the node.
Parent Tag:
Attributes: None
#
Tag: defines a method for fencing the machine.
Parent Tag:
Attributes:
* name (required): name for the fencing method, if GUI generated, it is a number.
*
Tag: The device used to fence the node
Parent Tag:
Attributes: See section of this document for agent specific attributes for the tag.
Example: ==== ====
====
Tag: The RM block holds resources, failover domains and any number of 'group' (\= resourcegroup) blocks
Parent Tag:
Attributes:
o log_level (Optional): An integer 0-7, inclusive for all
levels less than the selected. 0, system is unusable, emergency;
1 action must be taken immediately;
2, critical conditions;
3, error conditions;
4, warning conditions;
5, normal but significant condition;
6, informational;
7, debug-level messages.
o log_facility The facility is one of the following keywords:
auth, authpriv, cron, daemon, kern, lpr, mail, news, syslog,
user, uucp and local0 through local7.
o Example: ==== ====
Tag: All the tags go under here. Parent Tag: Attributes: None
Tag: Specify properties of specific failover domains Parent Tag: Attributes:
o name (Required): the name of the failover domain
o ordered: Set value to '1' if the failover domain is ordered, '0' if not - default is unordered.
o restricted: Set value to '1' if failover domain is restricted, '0' if not - default is unrestricted.
Tag: An individual node within a failover domain. Parent Tag: Attributes:
o name (Required): name of the node.
o priority (Required): a number representing the priority, with lower numbers having higher priority.
Example: ==== ====

Tuesday, February 2, 2010

Darwin Streaming Server On RHEL/Fedora for Mobile Phones

Step 1

yum -y install vlc

yum -y install perl-Net-SSLeay

wget http://www.abrahamsson.com/DarwinStreamingServer-6.0.3-1.i386.rpm

wget http://www.abrahamsson.com/DarwinStreamingServer-Samples-6.0.3-1.i386.rpm

wget http://www.abrahamsson.com/DarwinStreamingServer-6.0.3-1.src.rpm # if you got .rpm

wget http://www.abrahamsson.com/DarwinStreamingServer-Utils-6.0.3-1.i386.rpm

wget http://www.abrahamsson.com/DarwinStreamingServer-debuginfo-6.0.3-1.i386.rpm

wget http://www.abrahamsson.com/dss-6.0.3.patch #patch for Linux x86-64 platform

Disabling MP3 streaming

You may choose to run a different server, such as Icecast or Shoutcast for MP3 streaming. If you do that, you may like to disable MP3 streaming in Darwin Streaming Server. Do this by changing the option for mp3_streaming_enabled under the MODULE section for QTSSMP3StreamingModule from true to false. E.g.:



...
false
..




Disabling all authentication

You can disable all authentication for the whole of Darwin Streaming Server by editing the file /etc/streaming/streamingserver.xml and by changing the option for Authenticate under the MODULE section for QTSSAdminModule from true to false. E.g.:



...
false
...




options if require patch -p0 < dss-6.0.3.patchkillall -9 DarwinStreamingServerTo change the administrator account from the default password of “password” use the following command:qtpasswd administratorSo DSS starts at boot up run the following:chkconfig --level 345 dss on Configuring Darwin Streaming ServerNow open a browser and point the address to http://:1220 and log in with the username administrator and the password you choose when running qtpasswd.

You can now test your install by opening QuickTime on a client (either Windows or the Mac) and using one of the sample files installed by Darwin.

File > Open URL and type rtsp:///sample_300kbit.mov

Save the file and upload the file to server. Move the file to /var/dss/movies; open QuickTime and select File > Open URL and type rtsp:///movie.mov and the file should stream.

http://wiki.videolan.org/Documentation:Streaming_HowTo/Streaming_a_live_video_feed_to_Darwin_Streaming_Server_for_Mobile_Phones

#vlc -vvv v4l2:///dev/video0:input=1:width=128:height=96:adev=hw.1,0:samplerate=32000 --sout '#transcode{venc=ffmpeg{keyint=1},vcodec=mp4v,vb=100k,acodec=mp4a,fps=10,ab=8k,channels=1,samplerate=16000}:rtp{mp4a-latm,dst=127.0.0.1,port-audio=20000,port-video=20002,ttl=127,name=CHANNEL,sdp=file:///usr/local/movies/channel.sdp}'

where:

* v4l2:///dev/video0 is the video device you want you want to stream,
* input=1 is the input channel of the video device (0 - tv tuner, 1 - composite),
* width=128:height=96 is the width and height of the input video signal to fetch by VLC,
* adev=hw.1,0 is the alsa audio device to capture audio from,
* samplerate=32000 is the input sample rate of the audio live feed,
* venc=ffmpeg is the encoder used (in this case it's ffmpeg, but you can use x264),
* {keyint=1} is the advanced ffmpeg encoder switches,
* vcodec=mp4v is video codec used to encode this live video feed (in this case it's MPEG4),
* vb=100k is the video bitrate (100 kbits/s is this case),
* acodec=mp4a is the audio codec used (is this case it's AAC),
* fps=10 is the frame rate of the video feed,
* ab=8k is the audio bitrate (is this case 8 kbits/s),
* mp4a-latm is only used for aac audio, it activates a different payload format for aac,
* dst=127.0.0.1 is the destination IP, where Darwin Streaming Server is hosted,
* ttl=127 is the value of the TTL (Time To Live) of your IP packets (which means that the stream will be able to cross 126 routers),
* sdp=file:///usr/local/movies/channel.sdp is where to create the SDP file for live streaming with Darwin Streaming Server (it should be inside of the DSS movies folder),
* name=CHANNEL is the name of the live video feed.

Tested on Nokia N73 and SE K800.


There is a small problem with some Nokia phones and Darwin Streaming Servers, that need a line to be edited in the created SDP file (for example):

* from b=RR:0 to b=RR:800

After running this command from console, you can access it from your mobile phone or VLC or any player that supports RTSP protocol

* rtsp://192.168.1.2/channel.sdp

where

* 192.168.1.2 is the IP address of the machine where DSS is running.

 
 
 
 
Posted by Picasa

 
 
 
 
Posted by Picasa

 
 
 
 
Posted by Picasa



Step 2

#!/bin/bash

sudo yum install build-essential wget
sudo addgroup --system qtss
sudo adduser --system --no-create-home --ingroup qtss qtss

wget http://static.macosforge.org/dss/downloads/DarwinStreamingSrvr6.0.3-Source.tar
tar -xvf DarwinStreamingSrvr6.0.3-Source.tar
mv DarwinStreamingSrvr6.0.3-Source DarwinStreamingSrvr6.0.3-Source.orig
wget http://dss.macosforge.org/trac/raw-attachment/ticket/6/dss-6.0.3.patch
patch -p0 < dss-6.0.3.patch
mv DarwinStreamingSrvr6.0.3-Source.orig DarwinStreamingSrvr6.0.3-Source
wget http://dss.macosforge.org/trac/raw-attachment/ticket/6/dss-hh-20080728-1.patch
patch -p0 < dss-hh-20080728-1.patch
#need to answer n then y
cd DarwinStreamingSrvr6.0.3-Source
mv Install Install.orig
wget http://dss.macosforge.org/trac/raw-attachment/ticket/6/Install
chmod +x Install
./Buildit
sudo ./Install

Monday, February 1, 2010

Straming Server Linux Red 5 Installation

REyou need to have:
# http://java.com/en/download/linux_manual.jsp
# chmod 755 jdk-1_5_0-linux-i586.bin
#./jdk-1_5_0-linux-i586.bin

Install Apache Ant Ant 1.7:

wget http://apache.mirror.transip.nl/ant/binaries/apache-ant-1.7.0-bin.tar.gz
tar -zxf apache-ant-1.7.0-bin.tar.gz
sudo mv apache-ant-1.7.0 /opt/ant # you don't need this
export ANT_HOME=/opt/ant
sudo ln -s /opt/ant/bin/ant /usr/bin/ant # shortcut - you sould now be able to use ant

now let’s get red5

svn co http://red5.googlecode.com/svn/java/server/trunk red5

#or

wget http://dl.fancycode.com/red5/0.6.3/src/red5-0.6.3.tar.gz
tar -zxf red5-0.6.3.tar.gz
mv red5-0.6.3 red5

now we have red5 directory containing red5 sources.

next step is compilation - before that we might want to provide proper patches to java and ant

export JAVA_HOME=/usr/lib/jvm/java-1.5.0-sun/
export ANT_HOME=/opt/ant/ # or other directory if you don't have root

now let’s compile

cd red5
/opt/ant/bin/ant prepare
/opt/ant/bin/ant dist

now directory “dist” contains compiled and ready to run server

cd dist
sh red5.sh

# or
# ant server

red5 should now run http server on port 5080 and rtmp service on port 1935

so let’s navigate to:

http://localhost:5080/demos

Sunday, January 31, 2010

Squid Proxy server

The Squid is a good proxy server. Its configuration is very simple. Please use the following procedures.

1) Most of the standard distributions have squid packages in its repository. If you are using fedora, RHEL or centos please do the following procedurea

# yum install squid -y

If your in debian or Ubundu please use the following,

# apt-get install squid

2) Now open the squid configuration file “squid.conf” . In general it will be in /etc/squid/squid.conf . Now modify/ add the following lines.

visible_hostname machine-name
http_port 3128
cache_dir ufs /var/spool/squid 1000 16 256
access_log /var/log/squid/access.log squid

3) Now add the following in the acl section.

acl our_networks src xxx.xxx.xxx.xxx/xx
http_access allow our_networks

Here the xxx.xxx.xxx.xxx/xx is your local IP /netmask

4) Now start the squid server

# /etc/rc.d/init.d/squid start

5) Now configure your web browser as follows. ( It is my firefox configuration )

Go to Preferences -> connection settings -> manual Proxy configurations
Now configure your proxy server IP and port ( 3128)
Now click Ok.

This is the most simplest proxy server configurations over network.

Saturday, January 30, 2010

What is the difference between "su -" and "su" ?

The main difference between su - and su is that the former makes the shell a login shell. This is very important especially if the user is going to su from a regular user account to a root (superuser) account. Normal users do not usually have /sbin/ and /usr/sbin/ in their search path. Therefore if a normal user wants to execute the command ifconfig, for example, after doing su, he usually gets the error message:

bash: ifconfig: command not found

With su -, on the other hand, root's .bashrc and .bash_profile and other special environment settings get sourced and this puts the sbin directories into the search path. Below is a sample session:

[testuser@localhost ~]$ su
Password:
[root@localhost testuser]# echo $PATH
/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:/home/testuser/bin
[root@localhost testuser]# ifconfig
bash: ifconfig: command not found
[root@localhost testuser]# exit
exit
[testuser@localhost ~]$ su -
Password:
[root@localhost ~]# echo $PATH
/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/X11R6/bin:/root/bin
[root@localhost ~]# ifconfig
eth0 Link encap:Ethernet HWaddr 00:A0:CC:39:75:41
inet addr:192.168.44.146 Bcast:172.16.45.255 Mask:255.255.254.0
inet6 addr: fe80::2a0:ccff:fe39:7541/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:21619559 errors:1 dropped:0 overruns:0 frame:87
TX packets:21190195 errors:4 dropped:0 overruns:4 carrier:0
collisions:0 txqueuelen:1000
RX bytes:1509569968 (1.4 GiB) TX bytes:2280347397 (2.1 GiB)
Interrupt:177 Base address:0x6800

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:6159 errors:0 dropped:0 overruns:0 frame:0
TX packets:6159 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:3784618 (3.6 MiB) TX bytes:3784618 (3.6 MiB)

Change hostname in Linux without rebooting server

Change hostname in Linux without rebooting server

First you need to find out your hostname, you can do this with

$ hostname
localhost.localdomain
$

Edit /etc/hosts

You need to edit /etc/hosts and add a line for your host name

$ cat /etc/hosts
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 localhost.localdomain localhost
$

My new server IP is 192.168.1.1, i need to assign it hostname fedora.redhat.com, to do this, i have edited /etc/hosts as follows.

# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 localhost.localdomain localhost
192.168.1.1 fedora.redhat.com fedora

Edit /etc/sysconfig/network

First lets see what is in the file

$ cat /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=localhost.localdomain
$

To change servers hostname to fedora.redhat.com, change the file as follows.

$ cat /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=fedora.redhat.com
$

$/bin/hostname fedora.redhat.com

$service syslog restart

after you can logout and login back

Saturday, January 23, 2010

RedHat/CentOS Cluster HP ilo


Posted by Picasa


1. root#mkqdisk -c /dev/sda1 -l qdisk_rac
2. root#chkconfig --level 345 qdiskd on
3. root#service qdiskd start
4. root#system-config-cluster
5. Cluster Name : apache-cluster and selected quorum disk with following options
Interval = 1
TKO = 10
votes =1
Minimum score = 3
Device = /dev/sda1
Label = qdisk_rac
6. Quorum Disk Heuristic
Program = ping -c 2 10.10.10.1
Score =1
Interval = 2
7. Add new node to cluster
Node Name = node1.example.com
Quorum votes = 1
Node Name = node2.example.com
Quorum votes = 1
8. New Fence Device
HP ILO Device
Name = ILOGB89xxxxxx
user = manage
password = manage
Hostname = 10.10.10.100
HP ILO Device
Name = ILOGB88xxxxxx
user = manage
password = manage
Hostname = 10.10.10.101

9. selected Node1 and "Manage fencing for this node"
Add New Fencing level -> Add Fencing to this Level. selected ILOGB89xxxxxx

10. selected Node2 and "Manage fencing for this node"
Add New Fencing level -> Add Fencing to this Level. selected ILOGB88xxxxxx
11. Created failover domains "failover-cluster" and selected
"node1.example.com and node2.example.com" from menu, and selected
"
"Restrict to this Failover Domain"

12. Create Resource
New Resource = Apache Server
Name = Apache HTTP Server service
Server Root = /etc/httpd
Config File = /etc/httpd/conf/httpd.conf
httpd options = /etc/rc.d/init.d/httpd

13. Create a new Resource "File system"
Name = httpd-content
File System type = ext3
Mount point = /var/www/html
device = /dev/sdb1

14. Create a new Resource "IP "
10.10.10.200

15. Create a New Service "Web-Service"
Failover Domain = failover-cluster
And selected "Add shared resource to this service"
A. Apache HTTP Server Service
B. Httpd-Content
C. IP Address (10.10.10.200)

16
#[node1@node1]scp /etc/cluster/cluster.conf node2:/etc/cluster/cluster.conf

17

#md5sum /etc/clsuter/cluster.conf

541b1dc67392b18aad7e1df3612a6afe cluster.conf (both node )

on both node

18
#service cman start
#service rgmanager start

19

#chkconfig cman on
#chkconfig rgmanager on


Posted by Picasa


20

# fence_ilo -a 10.163.16.31 -l Administrator -p password -o status -v

# fence_ilo -a 10.163.16.31 -l Administrator -p password -o reboot -v

Tuesday, January 5, 2010

FTP server

[1] Build FTP server to transfer files. Install and configure vsftpd for it.
[rajat@rajat ~]#
yum -y install vsftpd

Loading mirror speeds from cached hostfile
Reading repository metadata in from local files
Parsing package install arguments
Resolving Dependencies
--> Populating transaction set with selected packages. Please wait.
---> Downloading header for vsftpd to pack into transaction set.
vsftpd-2.0.5-10.el5.i386. 100% |========================| 16 kB 00:00
---> Package vsftpd.i386 0:2.0.5-10.el5 set to be updated
--> Running transaction check

Dependencies Resolved

===========================================================
Package
Arch
Version
Repository
Size

===========================================================
Installing:
vsftpd
i386
2.0.5-10.el5
base
137 k


Transaction Summary
===========================================================
Install
1 Package(s)

Update
0 Package(s)

Remove
0 Package(s)


Total download size: 137 k
Downloading Packages:
(1/1): vsftpd-2.0.5-10.el
100% |====================| 137 k 00:00

Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
Installing: vsftpd
#################################### [1/1]


Installed: vsftpd.i386 0:2.0.5-10.el5
Complete!
[rajat@rajat ~]#
vi /etc/vsftpd/vsftpd.conf


anonymous_enable=
NO
// line 12: no anonymous


ascii_upload_enable=YES
// line 79: make valid

ascii_download_enable=YES
(permit ascii mode transfer)


chroot_list_enable=YES
// line 94: make valid


(enable chroot list)

chroot_list_file=/etc/vsftpd/chroot_list
// line 96: make valid


(chroot list file)

ls_recurse_enable=YES
// line 102: make valid


chroot_local_user=YES
// bottom: enable chroot

local_root=public_html
// root directory

use_localtime=YES
// use local time


[root@www ~]#
vi /etc/vsftpd/chroot_list


fedora
// write users you permit


[root@www ~]#
/etc/rc.d/init.d/vsftpd start

Starting vsftpd for vsftpd:
[ OK ]