Tuesday, 8 May 2018

Steps for RHEL5 to OLE5 Migration.

[root@sankar-devops ~]#  cat /etc/redhat-release
Red Hat Enterprise Linux Server release 5.10 (Tikanga)

[root@sankar-devops ~]# cat /etc/issue
Red Hat Enterprise Linux Server release 5.10 (Tikanga)
Kernel \r on an \m


[root@sankar-devops ~]#
[root@sankar-devops ~]# yum -y remove rhn-client-tools yum-rhn-plugin up2date subscription-manager
Loaded plugins: rhnplugin, security
There was an error communicating with RHN.
RHN Satellite or RHN Classic support will be disabled.

Setting up Remove Process
No Match for argument: up2date
No Match for argument: subscription-manager
Resolving Dependencies
--> Running transaction check
---> Package rhn-client-tools.noarch 0:0.4.20-77.el5 set to be erased
--> Processing Dependency: rhn-client-tools = 0.4.20-77.el5 for package: rhn-setup
--> Processing Dependency: rhn-client-tools = 0.4.20-77.el5 for package: rhn-check
---> Package yum-rhn-plugin.noarch 0:0.5.4-26.el5 set to be erased
--> Running transaction check
---> Package rhn-check.noarch 0:0.4.20-77.el5 set to be erased
--> Processing Dependency: rhn-check >= 0.0.8 for package: rhnsd
---> Package rhn-setup.noarch 0:0.4.20-77.el5 set to be erased
--> Running transaction check
---> Package rhnsd.x86_64 0:4.7.0-10.el5 set to be erased
--> Finished Dependency Resolution

Dependencies Resolved

======================================================================================================================================
 Package                             Arch                      Version                             Repository                    Size
======================================================================================================================================
Removing:
 rhn-client-tools                    noarch                    0.4.20-77.el5                       installed                     0.0
 yum-rhn-plugin                      noarch                    0.5.4-26.el5                        installed                    182 k
Removing for dependencies:
 rhn-check                           noarch                    0.4.20-77.el5                       installed                     0.0
 rhn-setup                           noarch                    0.4.20-77.el5                       installed                     0.0
 rhnsd                               x86_64                    4.7.0-10.el5                        installed                     72 k

Transaction Summary
======================================================================================================================================
Remove        5 Package(s)
Reinstall     0 Package(s)
Downgrade     0 Package(s)

Downloading Packages:
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
  Erasing        : rhn-setup                                                                                                      1/5
  Erasing        : rhnsd                                                                                                          2/5
  Erasing        : rhn-check                                                                                                      3/5
  Erasing        : rhn-client-tools                                                                                               4/5
warning: /etc/sysconfig/rhn/up2date saved as /etc/sysconfig/rhn/up2date.rpmsave
  Erasing        : yum-rhn-plugin                                                                                                 5/5
warning: /etc/yum/pluginconf.d/rhnplugin.conf saved as /etc/yum/pluginconf.d/rhnplugin.conf.rpmsave

Removed:
  rhn-client-tools.noarch 0:0.4.20-77.el5                             yum-rhn-plugin.noarch 0:0.5.4-26.el5                         

Dependency Removed:
  rhn-check.noarch 0:0.4.20-77.el5              rhn-setup.noarch 0:0.4.20-77.el5              rhnsd.x86_64 0:4.7.0-10.el5           

Complete!
[root@sankar-devops ~]#

[root@sankar-devops ~]# cd /etc/yum.repos.d

[root@sankar-devops yum.repos.d]#rm -rf *

[root@sankar-devops yum.repos.d]# ll
total 0
[root@sankar-devops yum.repos.d]# wget http://yum.oracle.com/public-yum-el5.repo
--2018-05-09 00:44:08--  http://yum.oracle.com/public-yum-el5.repo
Resolving yum.oracle.com... 184.25.162.159
Connecting to yum.oracle.com|184.25.162.159|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 4886 (4.8K) [text/plain]
Saving to: `public-yum-el5.repo'

100%[============================================================================================>] 4,886       --.-K/s   in 0s   

2018-05-09 00:44:09 (12.5 MB/s) - `public-yum-el5.repo' saved [4886/4886]

[root@sankar-devops yum.repos.d]# wget https://linux-update.oracle.com/rpms/ULN-CA-CERT.sha2 -O /usr/share/rhn/ULN-CA-CERT
--2018-05-09 00:44:16--  https://linux-update.oracle.com/rpms/ULN-CA-CERT.sha2
wget http://public-yum.oracle.com/RPM-GPG-KEY-oracle-el5 -O /etc/pki/rpm-gpg/RPM-GPG-KEY-oracleResolving linux-update.oracle.com... 137.254.56.42
Connecting to linux-update.oracle.com|137.254.56.42|:443... connected.
HTTP request sent, awaiting response...

[root@sankar-devops yum.repos.d]# ll
total 8
-rw-r--r-- 1 root root 4886 Feb 12 20:32 public-yum-el5.repo

[root@sankar-devops yum.repos.d]# wget https://linux-update.oracle.com/rpms/ULN-CA-CERT.sha2 -O /usr/share/rhn/ULN-CA-CERT
--2018-05-09 00:47:43--  https://linux-update.oracle.com/rpms/ULN-CA-CERT.sha2
Resolving linux-update.oracle.com... 137.254.56.42
Connecting to linux-update.oracle.com|137.254.56.42|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 7727 (7.5K) [text/plain]
Saving to: `/usr/share/rhn/ULN-CA-CERT'

100%[============================================================================================>] 7,727       11.4K/s   in 0.7s 

2018-05-09 00:49:50 (11.4 KB/s) - `/usr/share/rhn/ULN-CA-CERT' saved [7727/7727]

[root@sankar-devops yum.repos.d]# wget http://public-yum.oracle.com/RPM-GPG-KEY-oracle-el5 -O /etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
--2018-05-09 00:52:11--  http://public-yum.oracle.com/RPM-GPG-KEY-oracle-el5
Resolving public-yum.oracle.com... 184.84.98.170
Connecting to public-yum.oracle.com|184.84.98.170|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1397 (1.4K) [text/plain]
Saving to: `/etc/pki/rpm-gpg/RPM-GPG-KEY-oracle'

100%[============================================================================================>] 1,397       --.-K/s   in 0s   

2018-05-09 00:52:12 (88.8 MB/s) - `/etc/pki/rpm-gpg/RPM-GPG-KEY-oracle' saved [1397/1397]

[root@sankar-devops yum.repos.d]# gpg --quiet --with-fingerprint /etc/pki/rpm-gpg/RPM-GPG-KEY-oracle

pub  1024D/1E5E0159 2007-05-18 Oracle OSS group (Open Source Software group) <build@oss.oracle.com>
      Key fingerprint = 99FD 2766 28EE DECB 5E5A  F5F8 66CE D3DE 1E5E 0159
sub  1024g/D303656F 2007-05-18 [expires: 2015-05-16]

[root@sankar-devops yum.repos.d]# yum -y upgrade yum* enterprise-release-notes oracle-logos rpm* redhat* system-config*
Loaded plugins: security
el5_latest                                                                                                     | 1.4 kB     00:00   
el5_latest/primary                                                                                             |  29 MB     05:29   
el5_latest                                                                                                                15734/15734
ol5_UEK_latest                                                                                                 | 1.2 kB     00:00

[root@sankar-devops yum.repos.d]# yum update

[root@sankar-devops yum.repos.d]# cat /etc/issue
Oracle Linux Server release 5.11
Kernel \r on an \m


Wednesday, 2 May 2018

Step by Step configuration of Git on linux

[root@sankar-devops ~]# yum groupinstall "Development Tools"
Loaded plugins: fastestmirror
There is no installed groups file.
Maybe run: yum groups mark convert (see man yum)
Loading mirror speeds from cached hostfile
 * base: centos.excellmedia.net
 * extras: centos.excellmedia.net
 * updates: centos.excellmedia.net
Resolving Dependencies
--> Running transaction check
---> Package autoconf.noarch 0:2.69-11.el7 will be installed
--> Processing Dependency: perl >= 5.006 for package: autoconf-2.69-11.el7.noarch
--> Processing Dependency: m4 >= 1.4.14 for package: autoconf-2.69-11.el7.noarch
--> Processing Dependency: perl(warnings) for package: autoconf-2.69-11.el7.noarch
--> Processing Dependency: perl(vars) for package: autoconf-2.69-11.el7.noarch
--> Proces

[root@sankar-devops ~]#
[root@sankar-devops ~]# yum install gettext-devel openssl-devel perl-CPAN perl-devel zlib-devel
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: centos.excellmedia.net
 * extras: centos.excellmedia.net
 * updates: centos.excellmedia.net
Package gettext-devel-0.19.8.1-2.el7.x86_64 already installed and latest version
Resolving Dependencies
--> Running transaction check
---> Package openssl-devel.x86_64 1:1.0.2k-8.el7 will be installed
--> Processing Dependency: openssl-libs(x86-64) = 1:1.0.2k-8.el7 for package: 1:openssl-devel-1.0.2k-8.el7.x86_64
--> Processing Dependency: krb5-devel(x86-64) for package: 1:openssl-devel-1.0.2k-8.el7.x86_64
---> Package perl-CPAN.noarch 0:1.9800-292.el7 will be installed


[root@sankar-devops opt]# wget https://github.com/git/git/archive/v2.17.0.tar.gz

[root@sankar-devops opt]# ls -l
total 7204
-rw-r--r--.  1 root root 7358338 May  3 00:04 v2.17.0.tar.gz

[root@sankar-devops ~]# tar -xvzf v2.17.0.tar.gz

[root@sankar-devops opt]# ls -l
total 7204
drwxrwxr-x. 24 root root   12288 Apr  2 22:43 git-2.17.0
-rw-r--r--.  1 root root 7358338 May  3 00:04 v2.17.0.tar.gz

[root@sankar-devops opt]# cd git-2.17.0/

[root@sankar-devops git-2.17.0]# make configure
GIT_VERSION = 2.17.0
    GEN configure
[root@sankar-devops git-2.17.0]#

[root@sankar-devops git-2.17.0]# ./configure --prefix=/usr/local

[root@sankar-devops git-2.17.0]# make install

[root@sankar-devops git-2.17.0]# git --version
git version 2.17.0
[root@sankar-devops git-2.17.0]#

[root@sankar-devops git-2.17.0]# git config --global user.name "sankar"
[root@sankar-devops git-2.17.0]# git config --global user.email "sankar.kodipilla@gmail.com"
[root@sankar-devops git-2.17.0]#

[root@sankar-devops git-2.17.0]# git config --list
user.name=sankar
user.email=sankar.kodipilla@gmail.com
[root@sankar-devops git-2.17.0]#

[root@sankar-devops git-2.17.0]# useradd sangit
[root@sankar-devops git-2.17.0]#
[root@sankar-devops git-2.17.0]# su - sangit
[sangit@sankar-devops ~]$

[sangit@sankar-devops ~]$ ssh-keygen -t rsa -b 4096 -C "sankar.kodipilla@gmail.com"
Generating public/private rsa key pair.
Enter file in which to save the key (/home/sangit/.ssh/id_rsa):
Created directory '/home/sangit/.ssh'.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/sangit/.ssh/id_rsa.
Your public key has been saved in /home/sangit/.ssh/id_rsa.pub.
The key fingerprint is:
96:31:83:fe:dd:47:d9:9d:3c:3e:2b:47:50:3b:18:ce sankar.kodipilla@gmail.com
The key's randomart image is:
+--[ RSA 4096]----+
|                 |
|       .     . . |
|      . +   o + .|
|     .   =   E.=o|
|      . S     +++|
|       o . . ....|
|        . . . oo |
|             o .o|
|              o. |
+-----------------+
[sangit@sankar-devops ~]$

[sangit@sankar-devops ~]$ eval "$(ssh-agent -s)"
Agent pid 3089
[sangit@sankar-devops ~]$

[sangit@sankar-devops ~]$ ssh-add ~/.ssh/id_rsa
Identity added: /home/sangit/.ssh/id_rsa (/home/sangit/.ssh/id_rsa)
[sangit@sankar-devops ~]$

[sangit@sankar-devops ~]$ cat ~/.ssh/id_rsa.pub
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQCz4kZba0TlsMhe2vut7QQfg/vBH8T5GGNGImlnFh0dMJ5b9JgEuj0kE6IdB9J/68TeO2DjWO6kfiP6Qi07bTsGpybAck+VtVEwY+FsrTYURJPgLkdJkK6zFAy1BQJ8vq/qE7nkpIG+l9su4v8WExSFNoTZMGO2NO7JHcaakBvn3IWh1+nO1TooK9/7g7VdJvAEX2/m276Fhu1JDxu3mlyis1SYBv8yUGp5wSDB89KLPb*************************== sankar.kodipilla@gmail.com
[sangit@sankar-devops ~]$


[sangit@sankar-devops ~]$ ssh -T git@github.com
The authenticity of host 'github.com (192.30.253.113)' can't be established.
RSA key fingerprint is 16:27:ac:44::63:1b:56:4d:eb:df:a6:48.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'github.com,192.30.253.113' (RSA) to the list of known hosts.
Hi sankar-kodipilla! You've successfully authenticated, but GitHub does not provide shell access.
[sangit@sankar-devops ~]$

[sangit@sankar-devops ~]$ git init
Initialized empty Git repository in /home/sangit/.git/
[sangit@sankar-devops ~]$


[sangit@sankar-devops ~]$ git status
On branch master

No commits yet

Untracked files:
  (use "git add <file>..." to include in what will be committed)

        .bash_logout
        .bash_profile
        .bashrc
        .ssh/

nothing added to commit but untracked files present (use "git add" to track)
[sangit@sankar-devops ~]$


[sangit@sankar-devops ~]$ cat > gittest_file1.txt
test1

[sangit@sankar-devops ~]$ cat > gittest_file2.txt
test2 


[sangit@sankar-devops ~]$ pwd
/home/sangit
[sangit@sankar-devops ~]$ ll
total 8
-rw-rw-r--. 1 sangit sangit 6 May  3 01:19 gittest_file1.txt
-rw-rw-r--. 1 sangit sangit 7 May  3 01:19 gittest_file2.txt
[sangit@sankar-devops ~]$

[sangit@sankar-devops ~]$ git status
On branch master

No commits yet

Untracked files:
  (use "git add <file>..." to include in what will be committed)

        .bash_logout
        .bash_profile
        .bashrc
        .ssh/
        gittest_file1.txt
        gittest_file2.txt

nothing added to commit but untracked files present (use "git add" to track)
[sangit@sankar-devops ~]$


[sangit@sankar-devops ~]$ git add -A
[sangit@sankar-devops ~]$ git status
On branch master

No commits yet

Changes to be committed:
  (use "git rm --cached <file>..." to unstage)

        new file:   .bash_logout
        new file:   .bash_profile
        new file:   .bashrc
        new file:   .ssh/id_rsa
        new file:   .ssh/id_rsa.pub
        new file:   .ssh/known_hosts
        new file:   gittest_file1.txt
        new file:   gittest_file2.txt

[sangit@sankar-devops ~]$


Error:

[sangit@sankar-devops ~]$ git commit -m "adding two files"

*** Please tell me who you are.

Run

  git config --global user.email "you@example.com"
  git config --global user.name "Your Name"

to set your account's default identity.
Omit --global to set the identity only in this repository.

fatal: empty ident name (for <sangit@sankar-devops.AS.Domcorp.Zetainteractive.com>) not allowed


[sangit@sankar-devops ~]$ git config --global user.name "sangit"

[sangit@sankar-devops ~]$ git commit -m "adding two files"
[master (root-commit) b2b6031] adding two files
 Committer: sangit <sangit@sankar-devops.AS.Domcorp.Zetainteractive.com>
Your name and email address were configured automatically based
on your username and hostname. Please check that they are accurate.
You can suppress this message by setting them explicitly:

    git config --global user.name "Your Name"
    git config --global user.email you@example.com

After doing this, you may fix the identity used for this commit with:

    git commit --amend --reset-author

 8 files changed, 81 insertions(+)
 create mode 100644 .bash_logout
 create mode 100644 .bash_profile
 create mode 100644 .bashrc
 create mode 100644 .ssh/id_rsa
 create mode 100644 .ssh/id_rsa.pub
 create mode 100644 .ssh/known_hosts
 create mode 100644 gittest_file1.txt
 create mode 100644 gittest_file2.txt
[sangit@sankar-devops ~]$

[sangit@sankar-devops ~]$ git commit -a
On branch master
Untracked files:
        .gitconfig

nothing added to commit but untracked files present
[sangit@sankar-devops ~]$

[sangit@sankar-devops ~]$ ls -l
total 8
-rw-rw-r--. 1 sangit sangit 6 May  3 01:19 gittest_file1.txt
-rw-rw-r--. 1 sangit sangit 7 May  3 01:19 gittest_file2.txt
[sangit@sankar-devops ~]$ cat > gittest_file3.txt
test3
^C 
[sangit@sankar-devops ~]$ cat > gittest_file4.txt
test4
^C
[sangit@sankar-devops ~]$ ls -l
total 16
-rw-rw-r--. 1 sangit sangit 6 May  3 01:19 gittest_file1.txt
-rw-rw-r--. 1 sangit sangit 7 May  3 01:19 gittest_file2.txt
-rw-rw-r--. 1 sangit sangit 6 May  3 01:47 gittest_file3.txt
-rw-rw-r--. 1 sangit sangit 6 May  3 01:47 gittest_file4.txt
[sangit@sankar-devops ~]$ git status
On branch master
Untracked files:
  (use "git add <file>..." to include in what will be committed)

        .gitconfig
        gittest_file3.txt
        gittest_file4.txt

nothing added to commit but untracked files present (use "git add" to track)
[sangit@sankar-devops ~]$

[sangit@sankar-devops ~]$ git add  gittest_file3.txt
[sangit@sankar-devops ~]$ git status
On branch master
Changes to be committed:
  (use "git reset HEAD <file>..." to unstage)

        new file:   gittest_file3.txt

Untracked files:
  (use "git add <file>..." to include in what will be committed)

        .gitconfig
        gittest_file4.txt

[sangit@sankar-devops ~]$ git commit -a -m "adding more files"
[master 71a2fdb] adding more files
 Committer: sangit <sangit@sankar-devops.AS.Domcorp.Zetainteractive.com>
Your name and email address were configured automatically based
on your username and hostname. Please check that they are accurate.
You can suppress this message by setting them explicitly:

    git config --global user.name "Your Name"
    git config --global user.email you@example.com

After doing this, you may fix the identity used for this commit with:

    git commit --amend --reset-author

 1 file changed, 1 insertion(+)
 create mode 100644 gittest_file3.txt
[sangit@sankar-devops ~]$


[sangit@sankar-devops ~]$ git remote add origin "https://github.com/sankar-kodipilla/sangit"
[sangit@sankar-devops ~]$