Skip to content

Instantly share code, notes, and snippets.

View fmolliet's full-sized avatar
⚙️
Engineering

Fabio Molliet fmolliet

⚙️
Engineering
View GitHub Profile
@fmolliet
fmolliet / docker-compose.yml
Created April 18, 2024 15:51
Vault Hashicorp Local Container
version: '3.6'
services:
vault:
image: vault:1.13.3
healthcheck:
retries: 5
restart: always
ports:
- 8200:8200
@fmolliet
fmolliet / mytheme.omp.json
Created May 18, 2023 02:40
My Ohmyposh theme
{
"$schema": "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json",
"blocks": [
{
"alignment": "left",
"segments": [
{
"foreground": "#D75F00",
"style": "plain",
"template": "λ ",

How to use insecure registry like remotes without SSL (https)

Adding daemon.jsons config

  • Navigate to /etc/docker
cd /etc/docker
  • Create daemon.json fine ``sh sudo touch daemon.json
@fmolliet
fmolliet / Building_local-Deploy_remote-Portainer.md
Created January 8, 2023 14:02
Tutorial deployment remote container manualy

How to deploy localy remote server:

Building & Tagging

Building

  • Using docker compose:
docker-compose build

Using docker build command

@fmolliet
fmolliet / Quarkus.buiild.native.sh
Last active June 28, 2022 22:59
Quarkus build native container
// DOCS: https://quarkus.io/version/main/guides/deploying-to-heroku
heroku login
mvn clean package -D"quarkus.container-image.build=true" -D"quarkus.container-image.group=registry.heroku.com/<APP NAME>" -D"quarkus.container-image.name=web" -D"quarkus.container-image.tag=latest" -Pnative -D"quarkus.native.container-build=true" -D"quarkus.native.native-image-xmx=6g"
docker push registry.heroku.com/<APP NAME>/web
heroku container:release web --app <APP NAME>
// heroku container:push web -a <APP NAME>
heroku logs --app <APP NAME> --tail
@fmolliet
fmolliet / keyExchangeECDH.js
Created October 30, 2021 20:20
Elliptic Curve Diffie-Hellman (ECDH) key exchange implementation in Node.JS
const crypto = require('crypto');
async function encrypt( text , secret ){
return new Promise( (resolve, reject)=> {
const algorithm = 'aes-256-ctr';
const secretKey = secret;
const iv = crypto.randomBytes(16);
const cipher = crypto.createCipheriv(algorithm, secretKey, iv);
@fmolliet
fmolliet / derivatePublicKey.js
Created October 30, 2021 16:19
Async implementation of public Key derivation
// Node >= v11.6.0
async function derivatePublicKey( privatePemPath ){
if (!privatePemPath) throw new Error('Pem Path not informed.')
return new Promise((resolve, reject)=>{
try {
const privateKey = fs.readFileSync( privatePemPath, 'utf8');
@fmolliet
fmolliet / generateKeyPair.js
Last active October 30, 2021 16:12
Promissified implementation of how generate key pair in nodejs
async function generateKeyPair(){
return new Promise( (resolve, reject ) => {
crypto.generateKeyPair('rsa', {
modulusLength: 4096,
publicKeyEncoding: {
type: 'spki',
format: 'pem'
},
privateKeyEncoding: {
@fmolliet
fmolliet / PemSignMessage.js
Last active October 30, 2021 16:12
Async function for implement Sign data with private pem
async function sign(pemPath, message = '', digest = 'SHA256'){
if (!pemPath) throw new Error('Pem Path not informed.')
return new Promise((resolve, reject)=>{
try {
const privateKey = fs.readFileSync( pemPath, 'utf8');
const sign = crypto.createSign(digest)
@fmolliet
fmolliet / hashPassword.js
Created October 30, 2021 15:54
Async function for hashPassword
const crypto = require('crypto');
async function hashPassword( password , configs = {} ) {
const config = {
hashBytes: configs.hashBytes || 64,
saltBytes: configs.saltBytes || 64,
iterations: configs.iterations || 872791
};