Skip to content

Instantly share code, notes, and snippets.

View geodis's full-sized avatar

geodis geodis

View GitHub Profile
@geodis
geodis / notes.md
Created September 5, 2024 14:25
git[object Object]

Git branches by author sorted by committer date:

git for-each-ref --format='%(committerdate) %09 %(authorname) %09 %(refname)' --sort=committerdate
@geodis
geodis / access_to_container.sh
Last active August 20, 2024 08:39
access_to_container
prod=""
export AWS_PROFILE="claranet-root"
DEST_ACCOUNT_ID=${prod}
aws sts assume-role \
--role-arn "arn:aws:iam::${DEST_ACCOUNT_ID}:role/admin" \
--role-session-name awscli-session
export $(printf "AWS_ACCESS_KEY_ID=%s AWS_SECRET_ACCESS_KEY=%s AWS_SESSION_TOKEN=%s" \
@geodis
geodis / examples.md
Last active September 2, 2024 08:51
terraform_examples

Alias provider

provider "aws" {
  alias   = "name"
  region  = "eu-west-1"
  profile = var.profile
  # assume_role {
  #   # network account
  #   role_arn     = "arn:aws:iam::1234:role/terraform"
 # session_name = "terraform"
@geodis
geodis / GithubActions.md
Last active September 8, 2023 10:02
GithubActions

Here’s a shorter list of 10 important GitHub Actions environment variables:

  1. GITHUB_WORKSPACE - The default working directory for steps and location of your repo.
  2. GITHUB_ACTOR - The name of the person or app that initiated the workflow.
  3. GITHUB_REPOSITORY - The owner and repository name.
  4. GITHUB_EVENT_NAME - The name of the event that triggered the workflow.
  5. GITHUB_SHA - The commit SHA that triggered the workflow.
  6. GITHUB_REF - The branch or tag ref that triggered the workflow.
  7. GITHUB_JOB - The ID of the current job.
  8. GITHUB_RUN_NUMBER - A unique number for each run of a workflow.
@geodis
geodis / poc.txt
Created May 19, 2023 13:10
read only and read write users
‎‎​
@geodis
geodis / examples.txt
Last active August 16, 2023 13:49
postgresql
# Querying Schema Privileges
sampledb=# dn+
List of schemas
Name | Owner | Access privileges | Description
--------+----------+----------------------+------------------------
public | postgres | postgres=UC/postgres+| standard public schema
| | =UC/postgres |
(1 row)
- the default-created schema named "public", described as "standard public schema", and owned by the role "postgres"
-- ownership, unless specified otherwise, is set to the role which creates the schema.
@geodis
geodis / examples.sh
Last active April 25, 2023 20:43
awk
sintaxis
awk options program file
# Especificar el separador de archivos
-F fs
# file: programa awk
-f file
@geodis
geodis / k8s.md
Last active May 19, 2023 11:50
kubernetes examples

Pod with volumes

cat <<EOF |  kubectl apply -f -
apiVersion: v1
kind: Pod
metadata:
  name: restore
  namespace: monitoring
spec:
 securityContext:
@geodis
geodis / nginx-deploy_full_example
Last active July 23, 2023 10:53
nginx-ingress-svc-deploy-certificate_full_example
apiVersion: apps/v1
kind: Deployment
metadata:
namespace: staging
name: nginx
labels:
name: nginx
spec:
selector:
matchLabels: