- Check and correct the redhat release
rm -f /etc/redhat-release
ln -s /etc/centos-release /etc/redhat-release
- Check node defination matches hostname
- Check facter hostname correct
#!/bin/bash | |
#script to upgrade Apache web server | |
/usr/local/apache2/bin/httpd -v | |
echo "Upgrade apache ? [y/n]" | |
read ans | |
if [ "$ans" = "y" ] | |
then | |
echo -e "\n Backing up Apache dir \n" | |
cp -pr /usr/local/apache2 /usr/local/apache2-`date +%F`.bk | |
tar -zxvf httpd-2.2.*.tar.gz |
#!/usr/bin/python | |
import sys | |
def getopt(args): | |
if len(args)>1: | |
opts={} | |
while (args): | |
if args[0][0]=='-': | |
opts[args[0]]=args[1] | |
args=args[2:] | |
else: |
awk 'BEGIN { RS="}" } { for(i=1;i<=NF;i++) if ($i~"192.168") print $2,$i }' /etc/dhcpd.conf|sed 's/;//g'|sort -n -t. -k4 |
#!/bin/bash | |
echo "Installing nagios-plugin" | |
cd nagios-plugins* | |
./configure --with-openssl=/usr/bin --with-mysql=/usr | |
make | |
make install | |
useradd nagios -G script | |
chown nagios.nagios /usr/local/nagios | |
chown -R nagios.nagios /usr/local/nagios/libexec |
#!/usr/bin/python | |
import os, sys | |
if len(sys.argv)==1 : | |
folder='.' | |
else : | |
folder=sys.argv[1] | |
if len(sys.argv)==3 : |
#!/usr/bin/python | |
import re | |
config_file='/etc/dhcpd.conf' | |
ips_used=[] | |
not_used=[] | |
try : | |
dhcp_config=open(config_file,'r') | |
for lin in dhcp_config : | |
match=re.search(r'^fixed-address\ \d+\.\d+\.\d+\.(\d+);',lin) |
When hosting our web applications, we often have one public IP
address (i.e., an IP address visible to the outside world)
using which we want to host multiple web apps. For example, one
may wants to host three different web apps respectively for
example1.com
, example2.com
, and example1.com/images
on
the same machine using a single IP address.
How can we do that? Well, the good news is Internet browsers
Picking the right architecture = Picking the right battles + Managing trade-offs
Picking the right architecture = Picking the right battles + Managing trade-offs