Skip to content

Instantly share code, notes, and snippets.

View isweluiz's full-sized avatar

Luiz isweluiz

View GitHub Profile

The Most Common Java Keytool Keystore Commands

Introduction

keytool

Java Keytool is a key and certificate management tool that is used to manipulate Java Keystores, and is included with Java. A Java Keystore is a container for authorization certificates or public key certificates, and is often used by Java-based applications for encryption, authentication, and serving over HTTPS. Its entries are protected by a keystore password. A keystore entry is identified by an alias, and it consists of keys and certificates that form a trust chain.

This cheat sheet-style guide provides a quick reference to keytool commands that are commonly useful when working with Java Keystores. This includes creating and modifying Java Keystores so they can be used with your Java applications.

Note: For easier management of your Java Keystores (using a GUI) check out Portecle.

What is an APIs (application programming interfaces)?

APIS

An API is a set of programming code that enables data transmission between one software product and another. It also contains the terms of this data exchange.

API An API is not a database. It is an access point to an app that can access a database.

They allow us to go get data from outside sources.

@isweluiz
isweluiz / logstash.conf
Created June 24, 2021 18:08 — forked from cgswong/logstash.conf
Logstash configuration file.
# #####################################################################
# DESC: Logstash configuration file. Typically forwarding logs to
# Elasticsearch instance.
# #####################################################################
# Where to get input
input {
# Get input from standard input device/interface
stdin {
type => "stdin-type"
@isweluiz
isweluiz / logstash.conf
Created June 24, 2021 18:08 — forked from cgswong/logstash.conf
Logstash configuration file.
# #####################################################################
# DESC: Logstash configuration file. Typically forwarding logs to
# Elasticsearch instance.
# #####################################################################
# Where to get input
input {
# Get input from standard input device/interface
stdin {
type => "stdin-type"
@isweluiz
isweluiz / README-tomcat-as-systemd-service.md
Created April 22, 2021 16:01 — forked from drmalex07/README-tomcat-as-systemd-service.md
An example configuration for Tomcat as systemd service. #tomcat #systemd #systemd.service

README

Let Tomcat is download and installed under /opt/tomcat. Also, let tomcat be a non-provileged user under which the server will be running.

We assume that we keep server's binaries under /opt/tomcat and we will create a server instance named foo under /var/tomcat/ (carrying its own conf, logs, webapps, work, lib directories). See also https://dzone.com/articles/running-multiple-tomcat.

Create a template service unit file at /etc/systemd/system/tomcat@.service:

AWS Application Load Balancer

Elastic Load Balancing automatically distributes your incoming traffic across multiple targets, such as EC2 instances, containers, and IP addresses, in one or more Availability Zones. It monitors the health of its registered targets, and routes traffic only to the healthy targets. Elastic Load Balancing scales your load balancer as your incoming traffic changes over time. It can automatically scale to the vast majority of workloads.

Elastic Load Balancing supports the following load balancers: Application Load Balancers, Network Load Balancers, Gateway Load Balancers, and Classic Load Balancers.

Application Load Balancer components

The following diagram illustrates the basic components. Notice that each listener contains a default rule, and one listener contains another rule that routes requests to a different target group. One target is registered with two target groups.

Launch instance templates + tomcat 9

You can create a launch template that contains the configuration information to launch an instance. Launch templates enable you to store launch parameters so that you do not have to specify them every time you launch an instance. For example, a launch template can contain the AMI ID, instance type, and network settings that you typically use to launch instances. When you launch an instance using the Amazon EC2 console, an AWS SDK, or a command line tool, you can specify the launch template to use.

The following diagram shows a launch template with three versions.

official

Amazon Elastic File System (Amazon EFS)

EFS

Scalable, elastic, cloud-native NFS file system

EFS

Abstract

@isweluiz
isweluiz / curator_cluster_config.yml
Created October 22, 2019 15:34
Configuration Curator - cluster SSL
---
client:
hosts:
- "es_coordinating_01.singhaiuklimited.com"
port: 9200
url_prefix:
use_ssl: True
# The certificate file is the CA certificate used to sign all ES node certificates.
# Use same CA certificate to generate and sign the certificate running curator (specified in properties client_cert and client_key)
certificate: '/work/elk/elasticsearch-6.3.2/config/x-pack/certificate-bundle/ca/ca.crt'
@isweluiz
isweluiz / gist:8a9914d129ea3d87f0f4a39b2bec5fa6
Created October 9, 2019 22:30 — forked from jhmartin/gist:c09e450853e273ee88f2
Multiple Elasticsearch outputs in logstash
#http://pastebin.com/xGt6vv9R from yardenbar
output {
if [type] == "postfix" {
elasticsearch {
host => [ "ES_HOSTNAME" ]
protocol => "transport"
cluster => "elasticsearch"
index => "postfix-%{+YYYY.MM.dd}"
manage_template => true
template_overwrite => true