Assuming that tomcat8 is installed at “/var/lib/tomcat8/bin/” on Linux system. We have all the environment variables in a sample file setenv.sh as explained below. Contents of setenv.sh: Please follow the below steps. It’ll export…
Author: admin
Difference between “./”, “.” and “source” in BASH shell or terminal (Linux)
Let’s understand each of these in the context of the sample test.sh file. Using “./“ The changes made by script gets discarded as soon as scripts end because this runs script by forking a…
How to unset a variable in bash or terminal (Linux)
unset command can be used to unset a variable in the terminal. Let’s see an example Output As you can see from the output above that the value of variable test becomes…
How to login in perforce(p4 command line) in python
To login into p4 programmatically, You may write a script something like the below which takes username and password. It is done in two steps. Step 1: Set environment variables. (create entries…
How to check the file size and directory size on Linux
1. Using ‘du -sh’ command Syntax Example Find the size of the file. Find the size of the directory. Find the size of all files in a dictionary. 2. Using ‘stat’ command…
How to find the size/space of disks and volumes attached to the server
Using ‘df -h’ command Syntax Examples: Note:- For the “Filesystem” and “Mount name”, please refer to first and last column in 1st example respectively.
How to increase the size of an EBS volume in EC2 with the help of cloud formation.
1. Attach an EBS to EC2: There are many ways to attach an EBS to EC2. You can manually attach an EBS (Block device) to EC2 through AWS Console UI. You can…
How to run os commands in python
Overview There are many ways but I am going to discuss two popular methods to do it. os.system subprocess.Popen os.system It executes the string command in subshell by calling the standard C…
How to read a file in python?
Using open method: We open files with the open method and read file contents using the read method. Note: With context handles the closing of the file is done automatically so you don’t…