Skip to content

Instantly share code, notes, and snippets.

View m-triassi's full-sized avatar

Massimo m-triassi

View GitHub Profile
@m-triassi
m-triassi / database.go
Created November 27, 2024 16:43
Database driver in Go for connecting to MySQL
package database
import (
"context"
"database/sql"
"fmt"
"log"
"os"
"strconv"
"time"
@m-triassi
m-triassi / update-discord.sh
Last active November 25, 2024 20:58
A simple script to update discord on debian based distributions, like Ubuntu, via discord's API. Put this in a directory on your $PATH.
#!/usr/bin/env bash
if [[ $1 == "-h" ]]; then
echo "Usage: update-discord [-c]"
echo " -h: Display this help message"
echo " -c: Clean up after install"
exit 0
fi
wget https://discordapp.com/api/download?platform=linux -O ~/Downloads/discord.deb
@m-triassi
m-triassi / .Production_Ready_Docker
Last active November 14, 2024 06:07
Production Ready Docker for Laravel
See the blog post here: https://blog.triassi.ca/blog/01-docker-laravel-production/
@m-triassi
m-triassi / kasm_cert.sh
Last active September 15, 2024 00:51
Generate an SSL certificate for a KASM instance. Requires Certbot & Docker to be installed.
#!/usr/bin/env bash
# Leverages Docker containers to create a temporary signing server
# Obtain a SSL cert and then apply it to the service in question we're interested in
# Usage: ./kasm_cert.sh mydomain.test
mkdir -p /tmp/webroot
# Start an ephemeral nginx container