Tuesday, May 17, 2011

Bash debugging

To help you with debugging your BASH scripts, you can use set this option which will print command traces before executing command

# set -o xtrace

Try it and you will love it.

For further notes, do read the
  1. Debugging Bash scripts by Bash Guide for Beginners

Saturday, May 14, 2011

Configuring an Ethernet Bridge

According to the Bridge Web site:
Ethernet bridging is a way to connect networks together to form a larger network. The standard for bridging is ANSI/IEEE 802.1d. A bridge is a way to connect two separate network segments together in a protocol-independent way. Packets are forwarded based on Ethernet address, rather than IP address (like a router). Since forwarding is done at Layer 2, all protocols can go transparently through a bridge.

For a more simplier explaination,

A Bridge is a device that links 1 or more network segment that uses the same network technologies. One simple analogies is the typical hub where you can plug in as many boxes you wish and they become part of a single hub device. It can also be used to modify or sniff the traffic

To bridge 2 physical network interfaces, you will need root access
# brctl addbr br0
# brctl addif br0 eth0
# brctl addif br0 eth1
# echo 1 > /proc/sys/net/ipv4/ip_forward
# ifconfig eth0 up
# ifconfig eth1 up
# ifconfig br0 up

For more information on Ethernet Bridge, do read up the following article which this blog entry relies totally on
  1. Kernel Korner - Linux as an Ethernet Bridge (Linux Journal)
  2. Linux Networking Bridge by Tom Salmon

Friday, May 13, 2011

Testing Torque Server Configuration

After Setting up Torque Server Setting up Torque Server on xCAT 2.x, you may want to verify whether the Torque Server Configuration is correct. Taken from 1.6 Testing Server Configuration (Adaptive Computing)

To verify whether your configuration works, do do the following test

1. Verify all queues are properly configured
# qstat -q

2. View additional server configuration
qmgr -c 'p s'

3.verify all nodes are correctly reporting
# pbsnodes -a


4 Submit a basic job - DO NOT RUN AS ROOT
# su - testuser
$ echo "sleep 30" | qsub

5. Verify jobs display
qstat

Wednesday, May 4, 2011

Setting up self-signed SSL certificate for Apache on CentOS 5

To set up self-signed SSL certificate for Apache on CentOS 5, do the following

1. Create a self-signed certificate
# make /etc/pki/tls/certs/self_signed_cert.pem

2. Enter the information such as country, province, state, company, division etc. These information will be reflected in your self-signed certificate

3. Configure the ssl configuration
# vim /etc/httpd/conf.d/ssl.conf

4. Update ssl.conf, ensure SSLCACertificateFile and SSLCACertificateKeyFile points to the newly created self-signed certificate
...........
SSLCACertificateFile /etc/pki/tls/certs/self_signed_cert.pem
SSLCACertificateKeyFile /etc/pki/tls/certs/self_signed_cert.pem
..........

5. Restart the httpd service
# service httpd restart

6. Check your https :)