Skip to content

Instantly share code, notes, and snippets.

View jcabrerizo's full-sized avatar
🙈

Juan Cabrerizo jcabrerizo

🙈
View GitHub Profile
@jcabrerizo
jcabrerizo / gist:9c849e871133a056f0131279ff8becc5
Created April 25, 2024 08:02
Script with subcommands and help
#!/bin/bash
# USAGE:
# ./build.sh [option]
#
# DESCRIPTION
# This is a helper script to manage the life cycle of the application
#
# OPTIONS
# --requirements Sets up all the requirements needed for the application lifecycle
# --upload Builds the docker image and push it to ecr
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "EKS add-on workflow - Issue creation",
"type": "object",
"definitions": {
"basicSemver": {
"type": "string",
"pattern": "^[0-9]+\\.[0-9]+\\.[0-9]+$"
},
"serviceAccount": {
@jcabrerizo
jcabrerizo / web-servers.md
Created April 24, 2023 15:02 — forked from willurd/web-servers.md
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@jcabrerizo
jcabrerizo / delete-s3-bucket.sh
Last active January 16, 2023 15:55
delete-s3-bucket
function delete-s3-bucket {
for arg; do
bucketstatus=$(aws s3api head-bucket --bucket “${s3_bucket}” 2>&1)
if echo “${bucketstatus}” | grep ‘Not Found’;
then
echo “bucket doesn’t exist”;
elif echo “${bucketstatus}” | grep ‘Forbidden’;
then
echo “Bucket exists but not owned”
elif echo “${bucketstatus}” | grep ‘Bad Request’;
@jcabrerizo
jcabrerizo / scriptTemplate.sh
Created December 7, 2022 11:25
Bash script template
#!/usr/bin/env bash
# https://sharats.me/posts/shell-script-best-practices/
set -o errexit
set -o nounset
set -o pipefail
if [[ "${TRACE-0}" == "1" ]]; then
set -o xtrace
fi

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example

# https://amp-demo-artifacts.s3.eu-west-1.amazonaws.com/amp.demo-0.1.0-SNAPSHOT.jar
# https://amp-demo-artifacts.s3.eu-west-1.amazonaws.com/amp.training-0.1.0-SNAPSHOT.jar
# https://amp-demo-artifacts.s3.eu-west-1.amazonaws.com/java-web-chat.sql
# https://amp-demo-artifacts.s3.eu-west-1.amazonaws.com/web-chat-1.0.0-SNAPSHOT.war
brooklyn.config:
db.user: db_user
db.password: abcd1234
db.name: web_chat
# Resources
WAR:
http://bit.ly/2dcaKIV
schema generation:
https://bit.ly/brooklyn-visitors-creation-script
java system property:
key: brooklyn.example.db.url
value: DSL format string
@jcabrerizo
jcabrerizo / gist:28a39ae675128e5207bc907da7572890
Created February 12, 2021 13:47
Delete not empty buckets using a pattern
for bucket in $(aws --profile qa-test s3 ls | awk '{print $3}' | grep test-persistence-); do aws s3 --profile qa-test rb "s3://${bucket}" --force ; done
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<extensions>true</extensions>
<configuration>
<supportedProjectTypes>
    
<supportedProjectType>bundle</supportedProjectType>
</supportedProjectTypes>
<instructions>