Monday, November 1, 2010

Anaconda Installer With Custom Brand/Product name

Mount stage2.img from iso .

edit mount_root/usr/lib/anaconda/product.py

comment the line as below save rebuild stage2.img

[root@localhost anaconda]# cat product.py
#
# product.py: product identification string
#

import os

#if os.access("/tmp/product/.buildstamp", os.R_OK):
#    path = "/tmp/product/.buildstamp"
#elif os.access("/.buildstamp", os.R_OK):
#    path = "/.buildstamp"
#elif os.environ.has_key("PRODBUILDPATH") and \
#         os.access(os.environ["PRODBUILDPATH"], os.R_OK):
#    path = os.environ["PRODBUILDPATH"]
#else:
#    path = None
   
productStamp = ""
productName = "SimpleWall"
productVersion = "bluesky"
productPath = "CentOS"
bugUrl = "Cnetos bugy."

#if path is not None:
#    f = open(path, "r")
#    lines = f.readlines()
#    if len(lines) >= 3:
#        productStamp = lines[0][:-1]
#        productName = lines[1][:-1]
#        productVersion = lines[2][:-1]
#    if len(lines) >= 4:
#    productPath = lines[3][:-1]
#    if len(lines) >= 5:
#        bugUrl = lines[4][:-1]

#if os.environ.has_key("ANACONDA_PRODUCTNAME"):
#    productName = os.environ["ANACONDA_PRODUCTNAME"]
#if os.environ.has_key("ANACONDA_PRODUCTVERSION"):
#    productVersion = os.environ["ANACONDA_PRODUCTVERSION"]
#if os.environ.has_key("ANACONDA_PRODUCTPATH"):
#    productPath = os.environ["ANACONDA_PRODUCTPATH"]
#if os.environ.has_key("ANACONDA_BUGURL"):
#    bugUrl = os.environ["ANACONDA_BUGURL"]

Thats it in short .

How To Connect To Mysql With SSH tunnel

Remote connection of mysql is always pain for security concern ssh tunnel is best option  .


#! /bin/bash
# Copy This script to /usr/bin/

Tunnel_check="`sudo netstat -tulnp 3307 |grep 127.0.0.1:3307`"

if [ "$Tunnel_check" == "" ] ;then
        echo "Tunnel is really Running ?"
        /usr/bin/ssh -2 -f -C -N deploy@ec2-23.45.124.compute-1.amazonaws.com -L 3307/127.0.0.1/3306
else
        echo "Tunnel is Running"
fi