Skip to content

Instantly share code, notes, and snippets.

Avatar

carles san agustin carlessanagustin

View GitHub Profile
@carlessanagustin
carlessanagustin / Makefile
Created Sep 9, 2021
Makefile example lines
View Makefile
truststore_pass ?= password
java_path ?= /usr/bin/java
NODEINFO = $(shell basename additional-node-infos/*)
etc_hosts:
sed -i 's/.*127.0.0.1.*/127.0.0.1 localhost idman-host netmap-host notary-node/' /etc/hosts
View nested_loop.tf.md
  • In <filename>.tf:
variable "users" {
  default = [
    {
      name       = "user1"
      databases  =  ["db1","db2"]
      password   = "change_me"
      privileges = ["CONNECT","CREATE","TEMPORARY"]
@carlessanagustin
carlessanagustin / tmux.sh
Created Apr 13, 2021
Autostart tmux session when logging in via SSH
View tmux.sh
cat << 'EOF' > ~/.bash_profile
if [ -z "$TMUX" ]; then
tmux attach -t default || tmux new -s default
fi
EOF
@carlessanagustin
carlessanagustin / bash-colors.md
Last active Mar 18, 2021 — forked from Prakasaka/bash-colors.md
The entire table of ANSI color codes.
View bash-colors.md

TLTR;

RED=$'\e[0;31m'
R=${RED}
BLUE=$'\e[0;34m'
B=${BLUE}
GREEN=$'\e[0;32m'
G=${GREEN}
CYAN=$'\e[0;36m'
@carlessanagustin
carlessanagustin / keycloak.sh
Created Feb 14, 2021 — forked from paoloantinori/keycloak.sh
Keycloak Admin API Rest Example
View keycloak.sh
#!/bin/bash
export TKN=$(curl -X POST 'http://localhost:8080/auth/realms/master/protocol/openid-connect/token' \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "username=admin" \
-d 'password=admin' \
-d 'grant_type=password' \
-d 'client_id=admin-cli' | jq -r '.access_token')
curl -X GET 'http://localhost:8080/auth/admin/realms' \
@carlessanagustin
carlessanagustin / docker-compose.yml
Created Jan 26, 2021
Simple Nginx via Docker Compose file
View docker-compose.yml
version: '3'
services:
webserver:
image: nginx:latest
command: [nginx-debug, '-g', 'daemon off;']
ports:
- "8080:80/tcp"
@carlessanagustin
carlessanagustin / functions.tf
Created Jan 20, 2021
Terraform functions by example
View functions.tf
##--------------------------
## Terraform: Functions ##
##--------------------------
## Open terraform console
terraform console
#######################
## Numeric Functions ##
#######################
@carlessanagustin
carlessanagustin / detect_os.sh
Created Jan 14, 2021
detect linux OS from packagecloud.io
View detect_os.sh
: '
thanks to https://packagecloud.io/
You can find a list of supported OSes and distributions on our website: https://packagecloud.io/docs#os_distro_version
'
detect_os_deb ()
{
if [[ ( -z "${os}" ) && ( -z "${dist}" ) ]]; then
# some systems dont have lsb-release yet have the lsb_release binary and
# vice-versa
@carlessanagustin
carlessanagustin / azure-pipeline.yaml
Last active Sep 16, 2020
Azure Pipeline basic infrastructure check
View azure-pipeline.yaml
trigger: none
pr: none
#pool:
stages:
- stage: infrastructure
displayName: infrastructure stage
#variables:
#condition:
jobs:
@carlessanagustin
carlessanagustin / test.dp.yaml
Created Sep 9, 2020
Simple Centos Deployment for Kubernetes
View test.dp.yaml
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: centos-dp
labels:
app: centos
spec:
replicas: 1
selector: