Skip to content

Welcome to Tech by Example

Menu
  • Home
  • Posts
  • System Design Questions
Menu

Posts

How to create an environment variable for tomcat on Linux?

Posted on July 7, 2021July 7, 2021 by admin

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…

Difference between “./”, “.” and “source” in BASH shell or terminal (Linux)

Posted on July 7, 2021July 7, 2021 by admin

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)

Posted on July 7, 2021July 7, 2021 by admin

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

Posted on July 7, 2021July 7, 2021 by admin

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

Posted on June 27, 2021June 27, 2021 by admin

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

Posted on June 17, 2021June 17, 2021 by admin

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.

Posted on June 17, 2021June 17, 2021 by admin

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

Posted on June 17, 2021June 17, 2021 by admin

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?

Posted on June 17, 2021June 17, 2021 by admin

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…

Posts pagination

Previous 1 … 15 16
©2025 Welcome to Tech by Example | Design: Newspaperly WordPress Theme