Skip to content

Instantly share code, notes, and snippets.

View marcellodesales's full-sized avatar

Marcello DeSales marcellodesales

View GitHub Profile
#!/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 August 27, 2018 15:46
Generic Multi-stage Dockerfile for Springboot Apps with Unit and Integration tests
# #####################################################################
# Build stage for building the target directory before running tests
# #####################################################################
FROM marcellodesales/gradle:2.13 as builder
MAINTAINER [email protected]
USER root
#RUN apt-get update && apt-get install -y git
@marcellodesales
marcellodesales / .helmignore
Last active February 26, 2018 00:44
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`]"
# 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/
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/[email protected]~postpackage: @services-configuration/[email protected]
npm info ok
from time import sleep
leds = [11, 14, 35, 67, 78, 89]
forward = range(len(leds))
backward = list(reversed(forward))
print forward
print backward
@marcellodesales
marcellodesales / aws-put-upload-ssec.sh
Last active September 13, 2016 22:14 — forked from imbradbrown/upload-ssec.sh
Uploading to Amazon S3 from curl with Server Side Encrpytion - Customer Provided Key used. Note that this uses the Amazon Access Keys which should be used with care.
#!/bin/bash
## file to upload.
S3_UPLOAD_FILE=some/path/file.txt
## Specify the bucket name here. This can be found in the S3 console
S3_BUCKET=bucket name here
## The desired path relative to the root of the bucket. All folders must be forward slash '/' separated
S3_DESTINATION_FILE=folder/folder2/file.txt
@marcellodesales
marcellodesales / sign
Created August 22, 2016 21:54
Github Signature validator
2016-08-22 14:50:45.602  INFO 5890 --- [nio-8080-exec-1] .p.c.p.g.GithubWebhookSignatureValidator : Webhook Signature Valid: calculated=666339c4fcd4271465d71f5afd37847d786fdc74 provided=666339c4fcd4271465d71f5afd37847d786fdc74
{
"/docker/0e1e84b6291f9e6b8b328b43eab7901bb2b82fff78bbf41248299bfc1a9fc112":[
{
"timestamp":"2016-02-25T21:58:33.205221796Z",
"cpu":{
"usage":{
"total":303954690683,
"per_cpu_usage":[
77108018085,
#!/bin/bash
# Description: This script spins up a multi node Docker Swarm w/ Docker
# Networking and Consul discovery w/ Registrator
# Author: Ryan C Koch
# [email protected]
# Usage: bash docker-playground.sh usage
usage ()
{