Skip to content

Instantly share code, notes, and snippets.

@rigwild
rigwild / README.md
Created February 17, 2024 21:38
Super simple helper class to use OpenPGP.js without getting an headache
@rigwild
rigwild / coolcats_download.sh
Created January 13, 2024 16:50
Download all Cool Cats NFT metadata and images
#!/bin/bash
set -e
set -x
# Directory to save the JSON files and images
mkdir -p coolcats
cd coolcats
# Loop from 1 to 9999
@rigwild
rigwild / record.vb
Created March 7, 2022 11:17
Export Powerpoint presentation as a 60 fps video
' Save presentation as pptm then create a macro in "View > Macros", run it
Sub MkVideo()
If ActivePresentation.CreateVideoStatus <> ppMediaTaskStatusInProgress Then
ActivePresentation.CreateVideo FileName:=Environ("USERPROFILE") & "\Desktop\video.wmv", _
UseTimingsAndNarrations:=True, _
VertResolution:=1080, _
FramesPerSecond:=60, _
Quality:=100
Else: MsgBox "There is another conversion to video in progress"
End If
@rigwild
rigwild / 0_README.md
Last active December 3, 2023 01:18
VM Setup for dockerized apps and Portainer, including exposed NGINX with TLS configuration

Introduction

The goal of this this tutorial is to fully deploy a VM with multiple apps.

All the apps data will be stored in Docker volumes mounted to the host at /var/www/my-deploys for easy edit and backup. The benefit of this is you can create a GitHub repository and store all your configuration files in one place.

To deploy the docker-compose.yml of the apps below into Portainer, go to Stacks > Add stack.

Pre-requisites

@rigwild
rigwild / install.sh
Last active December 3, 2023 01:17
Quick VM install script
#!/bin/bash
# Check if script is ran by root user -> exit
if [[ $EUID -eq 0 ]]; then echo "This script should not be ran by root!"; exit 1; fi
# Stop script on error
set -e
set -o pipefail
sudo apt update
@rigwild
rigwild / README.md
Last active November 26, 2023 18:29
Install https://github.com/dgtlmoon/changedetection.io behind a NGINX proxy
cd /var/www
git clone git@github.com:dgtlmoon/changedetection.io.git
cd changedetection.io

Edit the configuation

nano docker-compose.yml
@rigwild
rigwild / .prettierrc
Last active October 21, 2023 13:53
my prettier config
{
"singleQuote": true,
"semi": false,
"trailingComma": "all",
"arrowParens": "avoid",
"printWidth": 140
}
@rigwild
rigwild / README.md
Last active September 27, 2023 23:31
Install Prometheus, Prometheus Pushgateway and Grafana and add them to systemd startup

Install and use metrics with Prometheus and Grafana

Install metrics agents

Install Prometheus, Prometheus Pushgateway and Grafana. Put them behind NGINX reverse proxy, get a TLS certificate, and run the service on startup with systemd.

Do a replace all of prometheus-pushgateway.example.com and grafana.example.com with your own domains.

chmod u+x ./install_metrics_agents.sh
@rigwild
rigwild / index.js
Last active April 28, 2023 07:44
Run discord-self-bot-console in Node.js example - https://github.com/rigwild/discord-self-bot-console/discussions/4
const fetch = require('node-fetch')
{
const apiPrefix = 'https://discord.com/api/v9'
var delay = ms => new Promise(res => setTimeout(res, ms))
var qs = obj =>
Object.entries(obj)
.map(([k, v]) => `${k}=${v}`)
.join('&')
@rigwild
rigwild / javascript-es6.tex
Created May 3, 2020 17:21
Color ES6 JavaScript in LaTeX
% Code support
\usepackage{listings}
\usepackage{textcomp}
%
% ECMAScript 2015 (ES6) definition by Gary Hammock
%
\lstdefinelanguage[ECMAScript2015]{JavaScript}[]{JavaScript}{
morekeywords=[1]{await, async, case, catch, class, const, default, do,