Skip to content

Instantly share code, notes, and snippets.

Marcello de Sales marcellodesales

View GitHub Profile
View golang-cross-compile-Dockerfile
############################
# STEP 1 build executable binary
############################
# golang alpine 1.12.6
FROM golang@sha256:cee6f4b901543e8e3f20da3a4f7caac6ea643fd5a46201c3c2387183a332d989 as builder
# Install git + SSL ca certificates.
# Git is required for fetching the dependencies.
# Ca-certificates is required to call HTTPS endpoints.
RUN apk update && apk add --no-cache git ca-certificates tzdata libmagic file && update-ca-certificates
@marcellodesales
marcellodesales / Jenkinsfile
Created Mar 6, 2019
Example of Jenkinsfile with icons for the list of parameters
View Jenkinsfile
pipeline {
options {
// Build auto timeout
timeout(time: 15, unit: 'MINUTES')
}
// https://jenkins.io/doc/book/pipeline/syntax/#parameters
parameters {
choice(
@marcellodesales
marcellodesales / .gitconfig
Last active Oct 17, 2018
Github Config to be at ~/.gitconfig
View .gitconfig
[user]
name = Marcello de Sales
email = marcello.desales@gmail.com
[alias]
lol = log --pretty=oneline --abbrev-commit --graph --decorate
#lol = log --all --graph --pretty=format:'%Cred%h%Creset -%C(auto)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative
todos = !sh -c 'git grep TODO: && git show :/TODO'
lg = log --color --graph --pretty=format:'%C(yellow)%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit
new = !sh -c 'git log $1@{1}..$1@{0} "$@"'
reflog = gitk --all --date-order $(git log -g --pretty=%H)
@marcellodesales
marcellodesales / 1.spring-boot-tls-self-signed-cert.log
Last active Sep 19, 2018
Generate an industry standard PKCS12 self-signed cert and setup SpringBoot to use it
View 1.spring-boot-tls-self-signed-cert.log
Ref1: https://drissamri.be/blog/java/enable-https-in-spring-boot/
Ref2: https://stackoverflow.com/questions/13578134/how-to-automate-keystore-generation-using-the-java-keystore-tool-w-o-user-inter/13578480#13578480
1. Generate the cert
$ keytool -genkey -noprompt -storetype PKCS12 -keyalg RSA -keysize 2048 -keystore keystore.p12 -validity 3650 \
-alias springboot \
-dname "CN=App-Name, OU=Org-Unit, O=\"Company, inc.\", L=San Diego, ST=California, C=US" \
-keystore tls.p12 \
-storepass 123456 \
View bash.generate.random.alphanumeric.string.sh
#!/bin/bash
# bash generate random alphanumeric string
#
# bash generate random 32 character alphanumeric string (upper and lowercase) and
NEW_UUID=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1)
# bash generate random 32 character alphanumeric string (lowercase only)
cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1
@marcellodesales
marcellodesales / Dockerfile
Last active Aug 27, 2018
Generic Multi-stage Dockerfile for Springboot Apps with Unit and Integration tests
View Dockerfile
# #####################################################################
# Build stage for building the target directory before running tests
# #####################################################################
FROM marcellodesales/gradle:2.13 as builder
MAINTAINER marcello.desales@gmail.com
USER root
#RUN apt-get update && apt-get install -y git
@marcellodesales
marcellodesales / .helmignore
Last active Feb 26, 2018
How can I fix the Helm Error while deploying an app to Kubernetes K8S "Error: release config-service failed: Deployment.apps "config-service" is invalid: [spec.selector: Required value, spec.template.metadata.labels: Invalid value: map[string]string{"app":"config-service", "release":"config-service"}: `selector` does not match template `labels`]"
View .helmignore
# Patterns to ignore when building packages.
# This supports shell glob matching, relative path matching, and
# negation (prefixed with !). Only one pattern per line.
.DS_Store
# Common VCS dirs
.git/
.gitignore
.bzr/
.bzrignore
.hg/
View earlier-problem-registry-failed-request-entity-too-large
Hash: d548c51c26a51c5c7ab3
Version: webpack 1.15.0
Time: 17436ms
Asset Size Chunks Chunk Names
devportal-addon.js 3.28 MB 0, 1 [emitted] devportal-addon
devportal-addon.min.js 2.37 MB 1, 0 [emitted] devportal-addon.min
+ 726 hidden modules
npm info lifecycle @services-configuration/portal-addon@0.1.2-snapshot-16~postpackage: @services-configuration/portal-addon@0.1.2-snapshot-16
npm info ok
View Docker San Diego Mentor Week Instructions.md
View night-rider-leds.py
from time import sleep
leds = [11, 14, 35, 67, 78, 89]
forward = range(len(leds))
backward = list(reversed(forward))
print forward
print backward
You can’t perform that action at this time.