Linux:Copy, change permissions and ownership of a file in a command

Today I came across a requirement to copy couple of files and change permissions to execute those files when writing some ansible playbooks. We can do this by using cp, chmod, chown command as shown below. Ownership is changed from root user to normal user surendra. ls -l output: -rw-r–r– 1 root root 0(…)

How to force logout a user from Linux/Unix servers

Today I come across a requirement where you have to force a user to logout from a terminal. When I contacted the user and he said he did not logged in. But the thing is I can see the login session from w, last commands. I did this checking before asking him. Then how can(…)

Linux/Unix: How to update timezone in a system

How to update time zone in Linux? Some times it is required to update our timezone when we move our machines(VMs) from one location to other. Recently I came across a situation where I want to move my machine time zone from IST to Sydney time zone. In this post we will see on how(…)

Linux/Unix: Sync system date/time with NTP server

How to sync system time with NTP server? This is small howto on how to setup ntp sync on a Linux box. Before going to do this we should know why we require to sync with NTP server. NTP is a network time protocol server used to sync time across the machines. When we setup(…)

How to open/read epub books in Linux?

This is a small how to on installing epub(Electronic Publications) reader software to read epub books. What is epub means? Epub is a open book standard for reading documents on mobile devices. The beauty of epub books format is that it will adjust its font size to the device display so that user who reads(…)

How to get Linux Docker IP address

Docker is a high level framework for Linux containers which could be next level for virtualising applications and VM's. Some times it is require to get ip address of a docker so that you can try to check a service running on it or try to ssh at 22 port on the IP address assigned(…)

How to install and enable EPEL repo in RHEL/CentOS/Oracle Linux?

What is EPEL repo? EPEL(Extra Packages for Enterprise Linux) is a repo developed by Fedora project to ensure that there is a quality 3rd party packages available for enterprise users such as people who are using RHEL, Cent OS, Oracle Linux and Scientific Linux. These are highly used enterprise Linux OS which are shipped with(…)

Puppet: How to remove node from master

Q) How can I remove a register a puppet agent from puppet master? Some times it is required to remove a host(puppet node) from the register master. To achive this we have to run puppet cert command and have to manually remove entries from site.pp or other *.pp files where that host is register. This(…)

Puppet: List all the nodes in Puppet master

Q)Recently I installed couple of nodes and attached to Puppet master, How can I list all the nodes which are register with Puppet server?  Answer) There are couple of ways to list all the nodes register with master.  1)Through grepping node entries in /etc/puppet/manifests/site.pp(Though not a good way)  2)Through puppet cert command Listing entries though(…)

7 Linux/Unix gzip and gunzip command examples

This is our second post on compression and archiving series. Today we will see how to use gzip and gunzip commands with examples. Gzip(GNU zip) is a compress tool which is available in most of the Linux/Unix based operating systems. Until recent years gzip and bzip2 are most commonly used data compression tools in Linux/Unix. Though(…)