Tuesday, January 17, 2017

Login to a running docker container

How to login to a running container?

First get the docker id using this command:
 $ docker ps
feb8867e1fd9 ...

Then, run bash process inside the corresponding container id.
$ docker exec -it  <feb8867e1fd9> bash

Where options:
             -i interactive
             -t allocate a pseudo-TTY.

[root@feb8867e1fd9 /]# [root@feb8867e1fd9 /]# 

We are inside the container now :)

Tuesday, January 10, 2017

stop disable firewall in Centos 7.0

stop firewall
[store1@outspokencentos ~]$ systemctl stop firewalld

To disable it permanently
[store1@outspokencentos ~]$ systemctl disable firewalld

create pause between commands - bash scripting

create pause between commands in a script:

You could create a function for it:

 read -n1 -rsp $'Press any key to continue or Ctrl+C to exit...\n'

Then you can use this everywhere in your script:


Sunday, January 1, 2017

rpm - find whether a package of specific name installed and find its contents

$ rpm -qa | grep vim
$ rpm -ql vim-minimal-7.4.160-1.el7_3.1.x86_64