Monday, July 31, 2017

Get notification at specific time






Run below command in your terminal :

echo ' notify-send "Meeting with Munusamy in 5 minutes" ' | at 1:25PM



echo 'notify-send "Get your tea!"' | at now + 3 minutes

echo 'notify-send "Meeting in 1 hour with the big boss!"' | at 1pm tomorrow 



Commands used:
notify-send [OPTION...] <SUMMARY> [BODY] - create a notification

at and batch read commands from standard  input  or  a  specified  file
       which are to be executed at a later time, using /bin/sh.


source: https://superuser.com/questions/38654/pop-up-notification-when-time-reaches-400pm





Thursday, July 27, 2017

full screen mode in gvim editor



You need to set the following in your vimrc (mine is /etc/vimrc):



map <silent> <F11>
\    :call system("wmctrl -ir " . v:windowid . " -b toggle,fullscreen")<CR>



Also, you need to have this package installed:
sudo yum install wmctrl.x86_64 -y 


Friday, July 14, 2017

openshift - oc cluster up in specific address



When you do 'oc cluster up' , you can access openshift console using 127.0.0.1.

But if you wish to specify IP address to access your openshift console make use of --public-hostname=<IP address>

This way you can access the  cluster even from outside (but within LAN ofcourse)


# oc cluster up --public-hostname=192.168.122.152

===============================================

Also, to retain configuration from previous run:

oc cluster up --host-data-dir=/mydata     --use-existing-config 

Where mydata is the directory created - ensure it has adequate permissions.


============================================

Also, you can ask for specific version like below:

oc cluster up  --public-hostname=10.70.43.54   --version=v3.9 --service-catalog 

=============

Another example (with all above combined):

oc cluster up 
--image=registry.access.redhat.com/openshift3/ose \
--version=v3.9 \
 --service-catalog=true \
 --routing-suffix=10.70.43.54.nip.io \
 --public-hostname=10.70.43.54.nip.io \
 --loglevel=2 \
 --host-data-dir=/mydata \
 --use-existing-config


Where, 10.70.43.54  is your node's IP address.

===============================================

Friday, July 7, 2017

Store and Run docker images locally & inspect contents of docker image


==========================================

Store and Run docker images locally:


How to save image locally and use it:

// You have built an image named s3-store-build

// Now save locally
$ docker save s3-store-build > s3-store-build.tar

$ ls -ltrsh
261M -rw-rw-r--  s3-store-build.tar

// Load the image - ready to run:
$ docker load --input s3-store-build.tar

==========================================

Inspecting contents of docker image:

# get your image name from this command

docker images


# here 172.31.17.15:5000/openshift/test-apb is the image name , save it to a tar file

docker save 172.31.17.15:5000/openshift/test-apb > s3.tar


mkdir test

cd test

# extract entire image using tar
tar xf ../s3.tar


# now extract individual tar files present
for filename in `find . -name  "*.tar" `; do tar xf  $filename; done


# Now, you check whether the file you are looking for is present in the image
find . -name <some_test_file_whether_present.txt>

=================================================

Push image to docker hub:

How to push image to docker hub:

# docker login


// build a image using Dockerfile in PWD
# docker build -t   store-build .


# docker images | grep store-build

# docker tag <db548e132e30> saran/store-build

# docker push  saran/store-build  

Thursday, July 6, 2017

Pulling docker images using url




Pulling docker images:

Generally, you pull a public URL like:

docker pull gluster/gluster-centos



Sometimes you want to directly pull the Docker image using URL:

docker pull https://hub.docker.com/r/gluster/gluster-centos/


The above can be any URL where Docker image present.