Sunday, July 8, 2018

Docker commands

sudo docker tag hello-world prabhu4029/imagename



DevOps-Docker

mkdir dockerinstall 287 cd dockerinstall 288 sudo yum install docker 289 docker version 290 maven version 291 mvn version 292 sudo nohup docker daemon -H tcp://0.0.0.0:2375 -H unix:///var/run/docker.sock & 293 sudo docker ps 294 sudo nohup docker daemon -H tcp://0.0.0.0:2375 -H unix:///var/run/docker.sock & 295 sudo docker ps 296 sudo docker pull hello-world 297 sudo docker ps 298 ps -ef | grep docker 299 sudo docker pull jenkins 300 sudo docker images -a 301 sudo docker run hello-world 302 cd /usr/libexec/docker/ 303 sudo ln -s docker-runc-current docker-runc 304 sudo docker run hello-world 305 ln -s docker-runc-current docker-runc 306 sudo ln -s docker-runc-current docker-runc 307 sudo docker run hello-world 308 sudo ln -s /usr/libexec/docker/docker-runc-current /usr/bin/docker-runc 309 sudo docker run hello-world 310 sudo docker images 311 sudo docker pull jenkins:alphine 312 sudo docker pull jenkins:alpine 313 sudo docker images 314 sudo docker ps -a 315 shutdown 316 sudo shutdown 318 systemctl status jenkins 319 ls -l 320 mvn -version 321 cd maveninstall 322 echo $PATH 323 echo M2_HOME=/home/kafleashok1/maveninstall 324 export M2_HOME=/home/kafleashok1/maveninstall 325 export PATH-${M2_HOME}/maven/bin:${PATH} 326 export M2_HOME=/home/kafleashok1/maveninstall 327 echo $PATH 328 ps -ef | grep docker 329 sudo nohup docker daemon -H tcp://0.0.0.0:2375 -H unix:///var/run/docker.sock & 330 ps -ef | grep docker 331 cd .. 332 ls -ltr 333 git init 334 cd maveninstall 335 ls -l 336 git clone git clone https://github.com/Prabhu4tx/jenkins-pipeline 337 git clone https://github.com/Prabhu4tx/jenkins-pipeline 338 ls -ltr 339 cd .. 340 docker login 341 sudo docker login 342 sudo docker pull ashokkafle96/hello-noble 343 docker images -a 344 sudo docker images -a 345 sudo docker logout 346 sudo docker images 347 sudo docker tag --help 348 sudo docker tag hello-noble docker.io/hello-world 349 sudo docker create image hello-noble 350 sudo docker tag hello-noble ashokkafle96/hello-noble 351 sudo docker tag hello-world ashokkafle96/hello-noble 352 sudo docker images

Wednesday, June 27, 2018

Installing Python3 on Centos7

$ sudo su -
[root] $ yum groupinstall -y "development tools"
[root] $ yum install -y \
  libffi-devel \
  zlib-devel \
  bzip2-devel \
  openssl-devel \
  ncurses-devel \
  sqlite-devel \
  readline-devel \
  tk-devel \
  gdbm-devel \
  db4-devel \
  libpcap-devel \
  xz-devel \
  expat-devel

[root ] $ cd /usr/src
[root ] $ wget http://python.org/ftp/python/3.6.4/Python-3.6.4.tar.xz
[root ] $ tar xf Python-3.6.4.tar.xz
[root ] $ cd Python-3.6.4
[root ] $ ./configure --enable-optimizations
[root ] $ make altinstall
[root ] $ exit
List of commands: 

1  bash script.sh    2  ls -l    3  yum update    4  yum groupinstall -y "development tools"    5  yum install -y lsof wget vim-enhanced words which    6  exit    7  yum groupinstall -y "development tools"    8  yum yum install -y libffi-devel    9  yum  install -y libffi-devel zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel tk-devel gdbm-devel libpcap-devel xz-devel expat-devel    10  cd /usr/src/   11  ls -l   12  wget https://www.python.org/ftp/python/3.7.0/Python-3.7.0.tgz   13  ls   14  tar xf Python-3.7.0.tgz    15  cd Python-3.7.0   16  ./configure --enable-optimizations   17  make altinstall   18  exit   19  history

Python 3 Scripting for System Administrators


Setting Up a Cloud Server Development Environment:


git config --global user.name "Ashok Kafle" 14 git config --global user.email "ashokkafle96@gmail.com" 15 curl https://raw.githubusercontent.com/linuxacademy/content-python3-sysadmin/master/helpers/bashrc -o ~/.bashrc 16 exec $SHELL 17 curl https://raw.githubusercontent.com/linuxacademy/content-python3-sysadmin/master/helpers/vimrc -o ~/.vimrc 18 vim ~/.vimrc

Saturday, June 16, 2018

Devops --installing apache maven on CENTOS7

136 java -version 137 sudo -d 138 sudo -s 139 ls 140 cd 141 ls-ltr 142 ls -ltr 143 mkdir maveninstall 144 cd maveninstall/ 145 pwd 146 wget httpcd ..//www-eu.apache.org/dist/maven/maven-3/3.5.3/binaries/apache-maven-3.5.3-bin.tar.gz 147 ls -ltr 148 sudo tar xzf apache-maven-3.5.3-bin.tar.gz 149 sudo ln -s apache-maven-3.5.3 maven 150 sudo vi /etc/profile.d/maven.sh 151 cd /etc/ 152 ls -ltr 153 cd /profile 154 cd /profile.d 155 cd profile.d 156 ls 157 vi maven.sh 158 ls -ltr 159 pwd 160 cd .. 161 cd /etc/profile.d/ 162 ls -ltr 163 sudo maven.sh 164 sudo vi maven.sh 165 ls -ltr 166 cd .. 167 sudo chmod 755 /etc/profile.d/maven.sh 168 cd /etc/profile.d/maven.sh 169 170 pwd 171 cd 172 cd maveninstall/ 173 ls -ltr 174 cd local 175 cd /local 176 ls -ltr 177 cd /usr/ 178 ls 179 cd .. 180 pwd 181 cd home 182 ls 183 cd ashokkafle96/ 184 ls 185 pwd 186 cd maveninstall/ 187 pwd 188 export M2_HOME=/home/ashokkafle96/maveninstall 189 cd maven 190 ls -ltr 191 export PATH=${M2_HOME}/maven/bin:${PATH} 192 echo $M2_HOME 193 history[ashokkafle96@nobletecg ~]$ cd /etc/profile.d

Devops -- git

cd git-2.7.2 1 id2 suod yum groupinstall "development tools"3 sudo yum groupinstall "development tools"4 wget https://github.com/git/git/archive/v2.7.2.tar.gz -O git.tar.gz5 yum install wget6 sudo yum install wget7 wget https://github.com/git/git/archive/v2.7.2.tar.gz -O git.tar.gz8 tar -zxf git.tar.gz9 make configure10 ls -l11 cd git.tar.tz12 ls13 cd git-2.7.2/14 ls15 make configure16 ./configure -prefix=/home/Users17 sudo make install18 pwd19 ./configure -prefix=/home/ashokkafle9620 sudo make install21 sudo apt-get install zlib1g-dev22 sudo yum install zlib1g-dev23 cd..24 sudo yum install zlib1g-dev25 cd ..26 sudo yum install zlib1g-dev27 cd git-2.7.228 make configure29 pwd30 ./configure -prefix=/home/ashokkafle9631 sudo make install32 ls33 sudo make install34 cd ..35 sudo yum install zlib1g-dev36 sudo yum install gettext-devel openssl-devel perl-CPAN perl-devel zlib-devel37 ls38 cd git39 ls40 ls -ltr configure*41 sudo make install42 git version43 git config --global user.name "ashokkafle96"44 gitconfig --global user.name "ashok.kafle@bison.howard.edu"45 git config --global user.name "ashok.kafle@bison.howard.edu"46 git config --list47 hostname48 ssh-keygen -t rsa -b 4096 -C "ashok.kafle@bison.howard.edu"49 pwd50 cd /home/ashokkafle96/.ssh51 ls -ltr

Monday, June 12, 2017

Java Practice

class FreshJuice {
   enum FreshJuiceSize{ SMALL, MEDIUM, LARGE }
   FreshJuiceSize size;
}

public class FreshJuiceTest {

   public static void main(String args[]) {
      FreshJuice juice = new FreshJuice();
      juice.size = FreshJuice.FreshJuiceSize.MEDIUM ;
      System.out.println("Size: " + juice.size);
   }
}


/*class FreshJuice {
    enum FreshJuiceSize{SMALL, MEDIUM, LARGE }
    FreshJuiceSize size;
}

public class FreshJuiceTest{
 
    public static void main(String args[]){
        FreshJuice juice = new FreshJuice();
        juice.size = FreshJuice.FreshJuiceSize.MEDIUM;
        System.out.println("Size: " + juice.size);
    }
}
*/