Skip to content

Instantly share code, notes, and snippets.

View spawnrider's full-sized avatar

Yohann Ciurlik spawnrider

View GitHub Profile
@spawnrider
spawnrider / biome.json
Created November 7, 2024 09:37
Biome configuration file for Web projects
{
"formatter": {
"enabled": true,
"formatWithErrors": false,
"indentStyle": "space",
"indentWidth": 2,
"lineEnding": "crlf",
"lineWidth": 120,
"attributePosition": "auto"
},
@spawnrider
spawnrider / CNTLM
Created May 30, 2023 14:27
Configure CNTLM on Ubuntu
1) Download cntlm deb package from http://sourceforge.net/projects/cntlm/files/cntlm/
2) Login as root
3) Run command:
$ dpkg -i cntlm*.deb
4a) Obtain password hash for the configuration file in step 4b (do not put plaintext password in configuration)
$ cntlm -H -d <domain> -u <username>
@spawnrider
spawnrider / snippet.js
Created May 9, 2023 13:34
List of all libraries / modules loaded in memory and filter on a specific lib name
const libs = Object.keys(require('module')._cache);
const filteredItems = libs.filter(item => {
  return item.includes('aLibName');
});
console.log(filteredItems);
@spawnrider
spawnrider / garmin-connect_courses_gpx_exporter
Last active September 3, 2022 15:52
Export all GPX from Garmin Connect using Chrome Console
jQuery.getJSON(
'https://connect.garmin.com/modern/proxy/web-gateway/course/owner/?_=1662219617626',
function(act_list)
{
var t=0;
console.log(act_list);
act_list.coursesForUser.forEach(
function(course) {
setTimeout(function() {
console.dir(course['courseId']);
@spawnrider
spawnrider / kv-copyer.ps1
Created May 31, 2022 15:25
Copying an Azure Key Vault using Powershell
Param(
[Parameter(Mandatory)]
[string]$sourceKvName,
[Parameter(Mandatory)]
[string]$destKvName
)
Connect-AzAccount
$secretNames = (Get-AzKeyVaultSecret -VaultName $sourceKvName).Name
$secretNames.foreach{
Set-AzKeyVaultSecret -VaultName $destKvName -Name $_ `
@spawnrider
spawnrider / docker-compose.yaml
Created April 20, 2022 10:32
Docker Compose for Postgis, Redis and Directus 9 stack
version: '3.9'
services:
database:
container_name: database
image: postgis/postgis:13-master
volumes:
- ./data/database:/var/lib/postgresql/data
networks:
- directus
@spawnrider
spawnrider / index.md
Last active June 16, 2023 20:59
Creating a multi-domain (SAN) SSL certificate using OpenSSL

Creating a multi-domain (SAN) SSL certificate using OpenSSL

Introduction

This minimalist post is about creating a private key and a certificate signing request (CSR) for a SAN SSL certificate using OpenSSL. These commands was tested on the Mac OS command line using iTerm 2.

Generate the private key

Run the following command for generating the private key : openssl genrsa -out acme.com.key 2048

Generate the certificate signing request (CSR)

@spawnrider
spawnrider / index.js
Created March 15, 2022 07:47
Custom endpoints for Directus snapshot import/export
import { defineEndpoint } from '@directus/extensions-sdk';
import * as fs from 'fs';
import * as path from 'path';
import { spawn } from 'child_process';
import busboy from 'busboy';
export default defineEndpoint((router) => {
/*--- waitForKeyElements(): A utility function, for Greasemonkey scripts,
that detects and handles AJAXed content.
Usage example:
waitForKeyElements ("div.comments", commentCallbackFunction);
//--- Page-specific function to do what we want when the node is found.
function commentCallbackFunction (jNode) {
jNode.text ("This comment changed by waitForKeyElements().");
}
@spawnrider
spawnrider / keybase.md
Last active December 14, 2018 16:13
keybase.md

Keybase proof

I hereby claim:

  • I am spawnrider on github.
  • I am spawnrider (https://keybase.io/spawnrider) on keybase.
  • I have a public key ASCSwFqHaw1H8Q0pbgwn_c5BICJzy6nDI7IdzQsc6TYQ3go

To claim this, I am signing this object: