This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# creating a java keystore given a certificate and private key | |
# A java keystore can be created by importing a pkcs12 keystore into a new java keystore | |
# step 1: create a pkcs12 keystore | |
# certificate.crt - type in your actual certificate file name | |
# (if its in a different location type in the location - /path/to/certificate.crt) | |
# privatekey.key - type in your privatekey |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#spring.datasource.driverClassName=org.postgresql.Driver | |
spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect | |
spring.datasource.url=jdbc:postgresql://localhost:5432/database_name | |
spring.datasource.username=username | |
spring.datasource.password=password | |
#jpa | |
spring.jpa.hibernate.ddl-auto = update | |
#logs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE TABLE IF NOT EXISTS `country` ( | |
`id` int(11) NOT NULL AUTO_INCREMENT, | |
`iso` char(2) NOT NULL, | |
`name` varchar(80) NOT NULL, | |
`nicename` varchar(80) NOT NULL, | |
`iso3` char(3) DEFAULT NULL, | |
`numcode` smallint(6) DEFAULT NULL, | |
`phonecode` int(5) NOT NULL, | |
PRIMARY KEY (`id`) | |
) ENGINE=MyISAM DEFAULT CHARSET=latin1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#create a cluster | |
kind create cluster --name prod1 | |
#cluster info | |
kubectl cluster-info --context kind-prod1 | |
#delete cluster | |
kind delete cluster --name prod1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#cd into nginx config directory | |
cd /etc/nginx/conf.d | |
#create a config file for your application | |
nano myapp.conf | |
#Paste the configuration | |
server { | |
listen 443 ssl; | |
#server name refers to your domain name |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#First save the key in a p.12 file | |
#The p.12 file is password protected it shall prompt you to key in a new password | |
#You shall require to also key in the keystore password | |
keytool -v -importkeystore -srckeystore /path/to/keystore.jks -srcalias <alias> -destkeystore /path/to/output.p12 -deststoretype PKCS12 | |
#Use openssl to store the private-key in a .pem file | |
openssl pkcs12 -in /path/to/output.p12 -out /path/to/private-key.pem -nodes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cd /etc/systemd/system/ | |
#create a service file, in my case I am creating myapp.service | |
sudo nano myapp.service | |
#Contents of the file | |
[Unit] | |
Description=Manage myapp java service |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Note the commands below should be run on the server that hosts the application or website | |
# Create a keystore with an entry of a privatekeyentry | |
#replace <keystore.jks> with a keystore name (i.e., opencalenderkeystore.jks) and alias with a alias for your key (i.e., opencalender.com) | |
keytool -genkeypair -keystore <keystore.jks> -alias <alias> -keyalg RSA -validity 365 -keysize 2048 | |
#first and last name - I recommend using the domain name (opencalender.com) | |
#OU - IT or Software Dev or Deployment | |
#Check the privatekeyentry and its alias | |
keytool -list -v -keystore <keystore> |