Skip to content

Instantly share code, notes, and snippets.

@aasanchez
aasanchez / portainer.sh
Last active November 23, 2023 12:36
Portainer
#!/usr/bin/env bash
docker stop portainer; docker rm portainer
# docker volume create portainer_data
# docker run -d -p 8000:8000 -p 9443:9443 --name portainer --restart=always -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer-ce:latest
docker run -d -p 8000:8000 -p 9443:9443 --name=portainer --restart=always -v /$XDG_RUNTIME_DIR/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer-ce
sleep 5
docker ps
#!/usr/bin/env bash
export NORMAL='\033[0m'
export RED='\033[1;31m'
export GREEN='\033[1;32m'
export YELLOW='\033[1;33m'
export WHITE='\033[1;37m'
export BLUE='\033[1;34m'
DEBUG='true'
@aasanchez
aasanchez / make-commits-greate-again.sh
Last active January 20, 2022 12:29
Making Commit Messages Greate Again
#!/usr/bin/env bash
# Making Commit Messages Great Again
# Following https://www.conventionalcommits.org/ and
# http://chris.beams.io/posts/git-commit/#seven-rules
# https://regex101.com/r/Up1Y06/5
COMMIT_MSG_FILE=$1
START_LINE=$(head -n1 "$COMMIT_MSG_FILE")
PATTERN="^(build|chore|ci|docs|feat|fix|perf|refactor|revert|style|test)+(\([a-zA-Z0-9 -_\/]+\))?!?:\s[a-zA-Z0-9 -_\/]+$"
@aasanchez
aasanchez / Makefile
Last active November 14, 2021 19:43
Makefile Template
current-dir := $(dir $(abspath $(lastword $(MAKEFILE_LIST))))
SHELL = /bin/bash
ifneq (,$(findstring xterm,${TERM}))
BLACK := $(shell tput -Txterm setaf 0)
RED := $(shell tput -Txterm setaf 1)
GREEN := $(shell tput -Txterm setaf 2)
YELLOW := $(shell tput -Txterm setaf 3)
LIGHTPURPLE := $(shell tput -Txterm setaf 4)
PURPLE := $(shell tput -Txterm setaf 5)
@aasanchez
aasanchez / hooks.sh
Last active June 5, 2019 10:57
Bit8 Install Hooks
#!/usr/bin/env bash
# curl -o- http://code.bit8.local/snippets/3/raw?_=$(date +%s) | bash
cd $(git rev-parse --git-dir)
rm -rf hookstar.gz git-hooks-master
curl http://code.bit8.local/alexis.sanchez/git-hooks/-/archive/master/git-hooks-master.tar.gz --output hooks.tar.gz --silent
tar xzf hooks.tar.gz
cp git-hooks-master/lib-hooks.sh hooks/lib-hooks.sh
@aasanchez
aasanchez / .gitlab-ci.yml
Last active February 13, 2022 17:50
Giltab
# You can override the included template(s) by including variable overrides
# SAST customization: https://docs.gitlab.com/ee/user/application_security/sast/#customizing-the-sast-settings
# Secret Detection customization: https://docs.gitlab.com/ee/user/application_security/secret_detection/#customizing-settings
# Dependency Scanning customization: https://docs.gitlab.com/ee/user/application_security/dependency_scanning/#customizing-the-dependency-scanning-settings
# Container Scanning customization: https://docs.gitlab.com/ee/user/application_security/container_scanning/#customizing-the-container-scanning-settings
# Note that environment variables can be set in several places
# See https://docs.gitlab.com/ee/ci/variables/#cicd-variable-precedence
stages:
- build
- test