Skip to content

Instantly share code, notes, and snippets.

View diegofcornejo's full-sized avatar
🪄
randomtechguy

Diego Cornejo diegofcornejo

🪄
randomtechguy
View GitHub Profile
@diegofcornejo
diegofcornejo / aws-query-athena.md
Last active August 26, 2025 04:19
Query AWS Athena table using a Cross-Account IAM Role

Query Athena using a Cross-Account IAM Role

This script demonstrates how to query an AWS Athena table from a different AWS account by assuming an IAM Role. It uses the AWS SDK for JavaScript v3.

Description

The script performs the following actions:

  1. Assumes a Cross-Account Role: It uses the AWS Security Token Service (STS) to obtain temporary security credentials by assuming an IAM role in a target AWS account. This is a secure way to grant temporary access to your AWS resources to users from other AWS accounts.
  2. Executes an Athena Query: Using the temporary credentials, it connects to Amazon Athena and executes a SQL query against a specified database and table.
@diegofcornejo
diegofcornejo / INSTALL.md
Created August 24, 2025 21:12
Install Grafana Alloy and Node Exporter on EC2 Linux AMI 2023 and send metrics to Remote Mimir

Install Grafana Alloy and Node Exporter on EC2 Linux AMI 2023 and send metrics to Remote Mimir

Prerequisites

Create prometheus user

sudo useradd -M -U alloy

Create a directory for Grafana Alloy

@diegofcornejo
diegofcornejo / apache-guacamole-docker-compose.md
Last active August 16, 2025 04:06
Install Apache Guacamole (PostgreSQL) with docker compose

Install Apache Guacamole (PostgreSQL) with docker compose

Copy the docker compose file to the server

Get the database script for postgres

docker run --rm guacamole/guacamole /opt/guacamole/bin/initdb.sh --postgresql > initdb.sql

Init the database (just the database)

docker compose up -d postgres
docker logs -f guacamole-postgres
@diegofcornejo
diegofcornejo / chirpstack.nginx.conf
Created July 25, 2025 20:39
ChirpStack NGINX conf
server {
server_name lorawan-ns-02.diegocornejo.com;
listen 80;
# --- API ---
location ^~ /api/ {
proxy_pass http://127.0.0.1:8090;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
@diegofcornejo
diegofcornejo / 1. README.md
Created July 25, 2025 16:12
The Things Stack Docker Installation Guide
name: n8n
volumes:
db_storage:
n8n_storage:
services:
postgres:
image: postgres:16.6
restart: always
@diegofcornejo
diegofcornejo / docker-compose.yml
Last active March 21, 2025 17:29
BookStack Docker Compose
name: bookstack
services:
# The container for BookStack itself
bookstack:
# You should update the version here to match the latest
# release of BookStack: https://github.com/BookStackApp/BookStack/releases
# You'll change this when wanting to update the version of BookStack used.
image: lscr.io/linuxserver/bookstack:version-v25.02

docker-compose.yml

services:
  minio:
    image: quay.io/minio/minio
    container_name: minio
    ports:
      - "127.0.0.1:9200:9000"
      - "127.0.0.1:9201:9001"
 volumes:
@diegofcornejo
diegofcornejo / 1. MicroK8S Ubuntu.md
Last active June 1, 2025 06:18
How to Install MicroK8S on Ubuntu 24.04 (Single Node)

How to Install MicroK8S on Ubuntu 24.04 (Single Node)

Install MicroK8S

sudo snap install microk8s --classic

Add the current user to the microk8s group

@diegofcornejo
diegofcornejo / docker-compose.yml
Last active February 22, 2025 02:23
Deploy IPFS node with docker compose an expose with nginx
services:
ipfs:
image: ipfs/kubo:latest
container_name: ipfs
volumes:
- ./ipfs_path:/data/ipfs
- ./ipfs_export:/export
- ./ipfs_fuse:/ipfs
- ./ipns_fuse:/ipns