Skip to content

Instantly share code, notes, and snippets.

1. Convert our ".jks" file to ".p12" (PKCS12 key store format):
keytool -importkeystore -srckeystore oldkeystore.jks -destkeystore newkeystore.p12 -deststoretype PKCS12
1.1. To List out new keysrore File :
keytool -deststoretype PKCS12 -keystore newkeystore.p12 -list
2. Extract pem (certificate) from ".p12" keysotre file:
lib_name='trap'
lib_version=20121026
stderr_log="/dev/shm/stderr-$(date +%s).log"
#
# TO BE SOURCED ONLY ONCE:
#
###~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~##
@alexvlasov
alexvlasov / jwtRS256.sh
Created September 11, 2020 12:56 — forked from ygotthilf/jwtRS256.sh
How to generate JWT RS256 key
ssh-keygen -t rsa -b 4096 -m PEM -f jwtRS256.key
# Don't add passphrase
openssl rsa -in jwtRS256.key -pubout -outform PEM -out jwtRS256.key.pub
cat jwtRS256.key
cat jwtRS256.key.pub
image:
name: hashicorp/terraform:light
entrypoint:
- '/usr/bin/env'
- 'PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin'
before_script:
- rm -rf .terraform
- terraform --version
- mkdir -p ./creds
# Install https://www.vaultproject.io/
brew install vault
# Start dev vault server in a separate terminal
vault server -dev
# ==> Vault server configuration:
# ...
# Unseal Key: 7ACQHhLZY5ivzNzhMruX9kSa+VXCah3y87hl3dPSWFk=
# Root Token: 858a6658-682e-345a-e4c4-a6e14e6f7853
@alexvlasov
alexvlasov / cloud-config-master.yaml
Created July 13, 2019 20:54 — forked from ryancurrah/cloud-config-master.yaml
CoreOS w/ Kubernetes Cloud Config
#cloud-config
#type: master
---
hostname: master01
users:
- name: core
passwd: $6$rounds=4096$qTfXAnCBjkQ326$zRFWfe45s3quKvxl2pax1Ml44PCPNQQYXcJ.r0FfkN5jwecdipepTLMNEQCsAcGJkH5NA6BCPr4VIGJNftBIe.
groups:
- sudo
@alexvlasov
alexvlasov / multiple_ssh_setting.md
Created July 27, 2018 15:26 — forked from jexchan/multiple_ssh_setting.md
Multiple SSH keys for different github accounts

Multiple SSH Keys settings for different github account

create different public key

create different ssh key according the article Mac Set-Up Git

$ ssh-keygen -t rsa -C "your_email@youremail.com"
@alexvlasov
alexvlasov / substring.go
Created June 7, 2018 13:07 — forked from yuchan/substring.go
Substring #GoLang
//Original
func substr(s string,pos,length int) string{
bytes:=[]byte(s)
l := pos+length
if l > len(bytes) {
l = len(bytes)
}
return string(bytes[pos:l])
}
@alexvlasov
alexvlasov / nginx.conf
Created February 11, 2017 13:33 — forked from jtimberman/nginx.conf
nginx front end for Riak
# Config for Nginx to act as a front-end for Riak
# The main goal is to proxy all GETs directly to Riak, and disallow anything else (POST, PUT, etc)
# Also, disallow use of the map/reduce query links (i.e. /riak/bucket/key/_,_,_)
# Config is in /etc/nginx/sites-available/default or somewhere like that
# Set up load-balancing to send requests to all nodes in the Riak cluster
# Replace these IPs/ports with the locations of your Riak nodes
upstream riak_hosts {
server 127.0.0.1:8098;