Creating a CA-Signed Certificate for the Tomcat Server
Procedure
1. From the command prompt, go to the folder that contains the keytool.exe file:
- For Windows systems, go to C:\Program Files\Commvault\ContentStore\jre\bin.
- For Linux systems, go to /usr/lib/jvm/jdkx/bin.
2. To create the keystore file containing the key-pair/certificate to be signed, run the following command:
For Windows:
> keytool -genkey -alias tomcat -keyalg RSA -keystore "C:\mykeystore.jks" -ext SAN=dns:<domainname>
> keytool -genkey -alias tomcat -keyalg RSA -keystore "C:\mykeystore.jks" -ext "SAN=dns:myserv.eg.com,dns:cnameserv.eg.com,EMAIL:admin@eg.com"
For Linux:
# keytool -genkey -alias tomcat -keyalg RSA -keystore "/mykeystore.jks" -ext SAN=dns:<domainname>
3. Generate a CSR, run the following command:
keytool -certreq -keyalg RSA -alias tomcat -file C:\tomcat.csr -keystore C:\mykeystore.jks -validity <daysValid> -ext SAN=dns:<domainname>
keytool -certreq -keyalg RSA -alias tomcat -file C:\tomcat.csr -keystore C:\mykeystore.jks -validity 365 -ext SAN=dns:myserv.eg.com,dns:cnameserv.eg.com
4. Upload the CSR to the CA website, indicate the type of Tomcat server, and submit for signing.
5. Download the root, intermediate, and issued server/domain certificates.
6. Import each signed certificate that is issued by the CA using the following commands:
a. Root certificate:
keytool -import -alias root -keystore C:\mykeystore.jks -trustcacerts -file C:\valicert_class2_root.crt
b. Intermediate certificate:
keytool -import -alias intermed -keystore C:\mykeystore.jks -trustcacerts -file C:\gd_intermediate.crt
c. Issued server/domain certificate:
keytool -import -alias tomcat -keystore C:\mykeystore.jks -trustcacerts -file C:\server_certificate_whatevername.crt
Note: The keystore parameter must be the path to the keystore file that was used to generate the CSR. You must use the same keystore file throughout this procedure.
7. Configure certificate
1. Stop the Tomcat Server.
2. Go to software_installation_path/Apache/Conf, and then back up the server.xml file that is part of the Apache configuration.
3. Copy the generated keystore file to software_installation_path/Apache.
4. For new installations of Version 11 SP9 or higher, in the server.xml file, modify the path to the generated keystore file and the keystore password values:
<Certificate certificateKeystoreFile="software_installation_path/Apache/your_file" certificateKeystorePassword="password" certificateKeystoreType="JKS"/>
8. Restart the service
a. Click Start and point to All Programs.
b. Click Commvault > Process Manager.
c. Under the Services tab, right-click a running service and then click Restart.
https://documentation.commvault.com/commvault/v11/article?p=50497.htm
Tuesday, July 20, 2021
CommVault - Creating a CA-Signed Certificate for the Tomcat Server
Windows - Registry backup in Windows Server 2019/2016
Registry backup in Windows Server 2019/2016
Press WinKey+R or R click on start menu and click on Run
- Type regedit and click ok
-> Click on file -> Export
-> Specify the location and save it with today's data: regedit_bk_07202021
Restore registry from backup
-> Open the registry editor
-> Click on file -> import
-> Specify the backup location
-> Select the file you downloaded before
-> wait for a while, done ..
Paste from Notepad into Word without getting extra line breaks after every line
How to paste content from notes to windows words without line break?
Win-Word adds spacing after each paragraph, and it considers each pasted line a new paragraph.
Solution:
-> Select all text (e.g. Control-A)
-> Right-click the selected text
-> Then select Paragraph.
-> Check the box "Don't add space between paragraphs of the same style
Friday, July 16, 2021
pyton class
Session 14: 7/15/2021
Review
<syntax2>
if <condition>:
st1
st2
else:
st3
st4
a=int(input("Enter first number"))
b=int(input("Please enter 2nd number"))
if a>b:
print("A is greater then B")
else:
print("A is less than B"
====================================
When will you go for if elif else?
When we have more than 2 options to choose from based on condition, we will use if elif else.
In this case, if the condition is true, it will execute the statement and skips the rest of the statement.
On the other hand, if if condition is false, the control will go to elif part and executes and else part skips. but if elif is false, then executes the else part.
Write a python program to accept one letter and check if it is vowel or not?
Step1: Design with o/p
----------------------
o/p
-------------------------
enter your letter:
user enters a, store a into a variable called letter: a
return: it is vowel.
Enter your letter:
user enter b, store b into variable called letter: b
return: its not a vowel.
coding
--------
letter=input("Enter your letter")
if letter=='a':
print("It is a vowel")
elif letter=='e':
print("It is a vowel")
elif letter=='i':
print("It is a vowel')
elif letter=='o':
print("It is a vowel')
elif letter=='u':
print("It is a vowel")
else
print("It is not a vowel")
When you run this code
input - enter ur letter
user enters a
a=a
condition is true, the it is vowel and rest of the condition is skips.
run it again
user enters b
b=a -> false , skips
b=e and keep checking and it will go to else part and returns the value
it is not vowel.
In this code we have 6 conditions, one for vower and other for consonent
Task1:
implement above program by using if else?
letter=input("Enter a letter")
if(letter=='a'|'e'|'i'|'o'|'u'):
print("The letter is vowel")
else:
print("The letter is not a vowel"
task2
Implement above vowel program by using if else and which should handle casesensitive?
Step1: Design with 0/p
=======================
le=input("Enter a letter")
if (le=='A' or le='a' or le=='E' or le=='e' or le=='I' or le=='i' or le=='o' or le=='O' or le=='U' or le=='u'):
print(le, "is a vowel")
else
print(le, "is not a consonant")
Task3
-----
Write a python program to accept student 3 subject marks and display the result?
Step1: Design with O/P
----------------------
o/p
----------
Enter m1 marks: 60
enter m2 marks: 70
enter m3 marks: 80
m1+m2+m3 = 60+70+80 = totmarks
totmarks/3 -> avg marks
Now display result
result can be vary..
avgmarks=70
1. fail: if > 35 in any one subject
2. First division: if >=60
3. 2nd division: if avgmarks is between 50-59
4. 3rd divison: if avg marks is in between 35 to 49
so output form above command is
Result is: Fist division.
Review and complete these tasks before tomorrow class.
----------------------------------
task4:
implement above program using 6 subjects.
task5:
Accept person's age display person status?
Step1: Design with o/p
----------------------
1. if age>=59
print senior citizen
2. if age is in between 25 to 57
- working citizen
3. if age is in between 16 and 24
- college students
4. if age is between 4-15
- school kids
5. if kids are in between 1-3
playing kids
6. invalid selection
o/p
---------------
Please enter your age:
user enters 59
sore 59 into a variable 'age' so age=50
print:
you are senior citizen.
python class
Expression
tools: subline pycharm
2 = 2 -> expression, evaluate to a single value.
>>> 2 -> expression 2 evaluates it self.
>>> 2 * 2
>>
>>> 2 + 2
4
>>> 5-3
2
>>> 3 * 7
21
>>> 3 x 7
SyntaxError: invalid syntax
>>> 22 / 7
3.142857142857143
>>> 2 + 3 * 6
20
>>> (2+3) * 6
30
>>> (2 + 3) * 6
30
>>> (5 - 1) * ((7+1) / (3 - 1))
16.0
>>> 5 +
SyntaxError: invalid syntax
>>>
Data type
ints, floats, Strings
40, 42.5, hello
>>> 40
40
>>> 40.1
40.1
>>> "Hello, World"
'Hello, World'
>>> 'Hello' + 'Hello'
'HelloHello'
>>> "Hello, World"
'Hello, World'
>>> 'Hello' + 'Hello'
'HelloHello'
>>> 'Hello' + '!'
'Hello!'
>>> 'Hello' + '!' * 10
'Hello!!!!!!!!!!'
>>> 'Hello' * 2
'HelloHello'
>>> 'Hello ' * 10
'Hello Hello Hello Hello Hello Hello Hello Hello Hello Hello '
>>>
Assignment Statement
a=10
You can use variable in expression anywhere you normally use. Variable evaluates value it contains.
>>> a=5
>>> b=10
>>> apple=4
>>> apple
4
>>> a + b
15
>>>
Every variable stores one data type.
>>> a+b
'helloworld'
>>> a + b
'helloworld'
>>> a + 'world'
'helloworld'
>>> a + ' World'
'hello World'
>>> a + 1
Traceback (most recent call last):
File "<pyshell#36>", line 1, in <module>
a + 1
TypeError: can only concatenate str (not "int") to str
>>> a = 2
>>> a + 1
3
>>>
Review
- IDLE is an python editor program
- Interactive shell (>>>) and file editor
- Expressions = Value + Operators
- int, float, string
- 'Hello, World'
- a = 2
= a + 1
IDLE is an interactive shell. You can you file eidtor to write complete program. Click on File -> New FIle on IDLE to open a text editor.
===============================
Writing first program
- Open IDLE
- Click on File -> New file
# THis program prints hello and ask your name
print('Hello, World !!!')
print('Please eneter your name?') # asking for name
myname = input()
print('It is a good to meet you,
Day12 - python class
Day 12. Python
Write a python program to accept 2 numbers from the user and perform division and display division result?
Step1:
Step
vi test.py or open with idle
a=ent(input("Enter first number:"))
b=ent(input("Enter 2nd number:"))
c=a/b
print("Divison result is:", c)
run module
Enter first number:
enter 2nd number:
10 will be storing in a and so on
what happens if user enters 10 and 0?
error: run time error - zeroDivisionError: division by zero
value can not be divide by 0.
observation:
-----------
in the program above, when user entered first number 10 and second number 0, it will throw divide by zero error (run time error). Because of that program execution will be terminated abnormally.
run the program
enter first no: 10
enter 2nd no: 0
error:
Control Statement
in every programming language, control statement is very importand
how to handle run time errors?
- We can handle run time errors in 2 ways.
1. By using login
2. By using exception handling mechanism
1. By using login
- for this, we use control statement
2. Using exception hadling mechanism
-
What can we do using control statement?
- Using comtrol statement, we can control the program control execution flow according to our requirement.
When do we use control statement?
-> When we want to control the program execution flow as per our requirement.
We will go for control statements.
In python, we have 3 types of control statements.
1. Conditional statements
2. Loops
3. Transfer Statements
1. Conditional statements
Lets look at 4 scenarios
---------------------------------
statement 1
statement 2
statement 3
statement 4
statement 5
you have 5 lines of code and execution in order. We don't need any control statement
2nd scenario
---------------------------------
statement 1
statement 2
statement 3 ***
statement 4
statement 5
here staement3 may execute or may not execute. In this type of condition weneed conditional stement
---------------------------------
3nd
statement 1
statement 2
statement 3 ***
statement 4
statement 5
here statement 3 executing multiple time so we use look
---------------------------------
4th
statement 1
statement 2
statement 3 ***
statement 4
statement 5 ***
here, executing 1 and jumping to stetmenet 3 and jumping to 5, we use transfer statement.
as per the situation, we use one of the condition.
=============================
1. Conditional statements
What can we do with conditional statement?
- Using conditional statements, we can execute single statement or multiple statements based on condition.
When do we use conditional statements?
-> When you want to execute single statement or multiple statements based on condition, we will use conditional statements.
Types of conditional statements?
- In python, we have following conditional statements
1. Simple if
2. if else
3. if elif
4. multiple if
5. nested if
HW
Write a program using simple if, if else, if elif, multiple if, and nested if.
==============================
xcellis: AV1746ckh00489
QXS-4 series chassis overview and qxs-456 chassis overview
xcellis I artico documentation center
Python class
Day 13 - Python 7-13-2021
1. Simple if
<syntax1>
if <condition>:
st1
st2
by using relational operators
> -> Greater than
For eg,
-> 10>5 -> true,
10>20 -> false
10<20 -> true
10<5 -> False
10>=10 -> Yes -> True
10 <=20 -> True
10 <=10 -> True
10==10 -> True
10!=20 -> True
10!=10 -> False
< -> Less than
>=
<=
==
!=
coding
if 10>5:
print("Hi")
print("Hello")
we have two statements.
Which statement is conditional dependent statement?
the first one..
what is the output of this code?
Since first condition is true, it will print hi and hello is regular statement, so it will also prints the output
first condition 10>5 is checked and its true so print Hi is printed
the control goes to next statement, and prints hello.
next,
if 10>20:
print("Hi"
print("Hello")
here you will get only Hello outout
10>20 is false so it skips the statement. goes to next statement and reads it. It prints Hello.
<syntax2>
if <condition>:
statement1
st2
st3
we have two consitional statement. and one regular statement.
First condition is checked and if it is true, following two statements are printed.
lets say if condition is false, it will skip these two statements and go to next.
we have two statement conditional dependent and we have one conditional indenendent.
what happens when condition is false,
if condition is false, it will skip st1 and st2 and following statement is always executed.
if 10>5:
print("Hi")
print("Hello")
print("Bye")
what is the output?
->
Hi
Hello
Bye
10>10 true,
control will enter next statement and print Hi, Hello and goes to regular statement and prints bye.
if 10>50:
print("Hi")
print("Hello")
print("Bye")
what is the output?
o/p
--------
bye
10>50 will check and it false, it skips that section and goes to next section and prints bye.
eg,
Implement divide by zero error program by using simple if to handle run time error.
Design with output(o/p)
------------------------
Enter first number: 10
10 i sstored into a variable a.
Enter 2nd number: 0
user enter 0 and stored it into a variable b.
Please enter 2nd number other than zero: 5
user enter 5 and stored in c.
Division result is: 2
third statement is condition dependence. if user enter b==0:
checking the condition b.
3rd is condition accepting number other than 0.
So, we have to write a program. How to write a prigarm?
a=int(input("Enter first number:"))
b=int(input("Enter 2nd number:"))
if b==0:
b=int(input("Please enter 2nd number other than 0"))
c=a/b
print("Division result is:", c)
here, user enters first number 10 stored in a
user enters 0 and stored on b
it will prompt user to enter a number other than zero.
and result will be printed.
lets say frist user enter 10 and stored in a
2nd user enter 5 and stored in b.
review
o/p
---------------
first
enter first number executes and user enters 10 and stored in a
control goes to 2nd line and user enter 0 and 0 is stoed in b.
after that control will check the condition
0=0 which is true and executes next staetmetn.
please enter 2nd number other than zero.
lets assume, user enters 5 and stored in c.
now, control goes to next statement
c=10/5-2.0
now, print
Divison result is 2.0.
what happens
simple if is only verifies only once so we have to use loops if you have to verify multiple condition.
our user may not be gentle man who enter only one right answer.
Review yesterday's 5 home work.
Git branch show detached HEAD
Git branch show detached HEAD 1. List your branch $ git branch * (HEAD detached at f219e03) 00 2. Run re-set hard $ git reset --hard 3. ...
-
snmpconfig command allow you to managge snmpv1/v3 agent configuration on SAN switch. Event trap level is mapped with event severity level....
-
Git branch show detached HEAD 1. List your branch $ git branch * (HEAD detached at f219e03) 00 2. Run re-set hard $ git reset --hard 3. ...
-
Disabling the Telnet protocol on Brocade SAN switches By default, telnet is enabled on Brocade SAN switches. As part of security hardening o...