Skip to content

Instantly share code, notes, and snippets.

View spawnrider's full-sized avatar

Yohann Ciurlik spawnrider

View GitHub Profile
@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:

@spawnrider
spawnrider / activate_rdc.cmd
Created April 16, 2018 18:49
Activate Remote Desktop Connection using PsExec
# PSEXEC is a standalone executable file that allows you to run commands on remote machines.
# You can download the tool from here:
# http://technet.microsoft.com/en-us/sysinternals/bb897553.aspx
# Open a command line and type the follwoing:
psexec \\machinename reg add "hklm\system\currentcontrolset\control\terminal server" /f /v fDenyTSConnections /t REG_DWORD /d 0
psexec \\remotecomputername netsh firewall set service remoteadmin enable
psexec \\remotecomputername netsh firewall set service remotedesktop enable
@spawnrider
spawnrider / steps.txt
Created March 19, 2018 14:11
Docker discovery commands
# Exemples
# Listing des utilisateurs dans C:\Users
docker run --rm -v c:/Users:/data alpine ls /data
# Pré-requis - Suppression de l'image locale
docker rmi httpd
# 1 - Récupération d'une image
# Image Docker Apache HTTPD
# https://hub.docker.com/_/httpd/