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 / apache-guacamole-docker-compose.md
Last active January 10, 2025 04:31
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 / ec2-prometheus-node_exporter.md
Created December 23, 2024 01:26
Install Prometheus and Node Exporter on EC2 Linux AMI 2023

Install Prometheus and Node Exporter on EC2 Linux AMI 2023

Prerequisites

Create prometheus user

sudo useradd -M -U prometheus

Install Node Exporter

@diegofcornejo
diegofcornejo / eml-download-attachments.js
Created December 16, 2024 20:27
Download attachments from EML file
const EmlParser = require('eml-parser');
const fs = require('fs');
const path = require('path');
// Define paths
const filesPath = 'files';
const resultsPathPrefix = 'results';
const timestamp = new Date().toISOString().replace(/[:]/g, '-').split('.')[0];
const resultsPath = path.join(resultsPathPrefix, timestamp);
@diegofcornejo
diegofcornejo / verify-pdf-signature.js
Created December 14, 2024 02:49
Verify PDF Signature
const verifyPDF = require('pdf-signature-reader-jpc');
const fs = require('fs');
const path = require('path');
// Define paths
const filesPath = 'files';
const resultsPathPrefix = 'results';
const timestamp = new Date().toISOString().replace(/[:]/g, '-').split('.')[0];
const resultsPath = path.join(resultsPathPrefix, timestamp);
const verifiedPath = path.join(resultsPath, 'verified');
@diegofcornejo
diegofcornejo / Dockerfile
Last active October 19, 2024 06:42
Cronicle Docker Compose
FROM docker:24.0
LABEL maintainer="BlueT - Matthew Lien - 練喆明 <[email protected]>"
# Docker defaults
ENV CRONICLE_VERSION 0.9.61
ENV CRONICLE_base_app_url 'http://localhost:3012'
ENV CRONICLE_WebServer__http_port 3012
ENV CRONICLE_WebServer__https_port 443
ENV EDITOR=nano
@diegofcornejo
diegofcornejo / 1. README.md
Last active October 25, 2024 04:21
Grafana Dashboard for Pino HTTP Logs - Express JS example

Pino HTTP Logs Dashboard
This Grafana dashboard utilizes the Loki data source to visualize and analyze logs generated by the Pino logging library. Logs from HTTP requests are captured using the Pino-HTTP plugin and are sent to a Loki instance via the Pino-Loki plugin, enabling real-time monitoring and historical analysis. The dashboard includes graph and table panels to display key metrics such as request status codes, response times, and error rates, making it easy to track application behavior and identify performance issues.

Flow Overview:

  1. Pino: Captures structured logs in a JSON format.
  2. Pino-HTTP: Specifically designed to handle HTTP request/response logging, capturing details such as request method, URL, and status code.
  3. Pino-Loki: Transmits the
@diegofcornejo
diegofcornejo / README.md
Last active September 15, 2024 05:54
Install Prometheus, Loki and Promtail on Ubuntu 24.04 with Basic Auth

Install Prometheus, Loki and Promtail on Ubuntu 24.04 with Basic Auth

Prometheus Installation Guide

Install Prometheus and Node Exporter

apt -y install prometheus prometheus-node-exporter
@diegofcornejo
diegofcornejo / myip.sh
Created July 25, 2024 04:06
Get IP from bash
alias myip=ipinfo
ipinfo() {
IP=$(curl -s https://ipinfo.io/ip)
curl -s "https://ipinfo.io/widget/demo/$IP" | jq
}
@diegofcornejo
diegofcornejo / macOS.sh
Created June 19, 2024 06:11 — forked from repodevs/macOS.sh
gpg: signing failed: Inappropriate ioctl for device macOS
❱ git config user.signingKey 38AF394C
❱ git config commit.gpgSign true
❱ echo "test" | gpg --clearsign
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256
test
gpg: signing failed: Inappropriate ioctl for device
gpg: [stdin]: clear-sign failed: Inappropriate ioctl for device
@diegofcornejo
diegofcornejo / 1. Ollama - Open WebUI.md
Last active June 16, 2024 07:11
Run Ollama Server and Open WebUI with Docker Compose.

ollama-open-webui

This project sets up Ollama and Open WebUI using Docker Compose.

Instructions

  1. Start the services with Docker Compose:
    docker-compose up -d

or