Wednesday, June 27, 2018

tee command vs redirect symbol


Usually I make use of > to redirect to a file.

We can also redirect using tee command.


Something like:

./test | tee test_output.log
So, here instead of > we are using tee.



What is advantage/ difference?

tee in addition to redirection copies the data to STDOUT.

Also, sometimes we want to see only specific lines with a pattern , we can use like:

./runprogram | tee program.log | grep Error
So, in this example, it logs all output , but displays only those lines with "Error".


Ref: man tee 




Friday, June 1, 2018

git add a new branch and push it to remote server




Add a new branch and push it to remote server:

git checkout -b new_branch

git push -u origin  new_branch



Wednesday, May 16, 2018

Check whether all nodes are in sync(timewise)




To check whether time is in sync (ntp) you can make use of ansible.

First fillup your inventory file with all nodes.

Then,

ansible all -m shell -a "date"

all here will contact all the nodes in inventory and get time.


If it varies widely you have an issue. check whether ntp service like
chronyd/ntpd running in the nodes.