Skip to content

Instantly share code, notes, and snippets.

@lynsei
lynsei / Generic.ts
Created October 22, 2023 19:02
Property event change
type PropEventSource<Type> = {
on<Key extends string & keyof Type>
(eventName: `${Key}Changed`, callback: (newValue: Type[Key]) => void): void;
};
declare function makeWatchedObject<Type>(obj: Type): Type & PropEventSource<Type>;
const person = makeWatchedObject({
firstName: "lynsei",
lastName: "asynyn",
@lynsei
lynsei / auto-proxy.sh
Last active September 28, 2023 18:12
[auto proxy] a jwilder reverse proxy for quickly spinning up SSL & Nginx
#!/usr/bin/bash
OS=`uname -s`
REV=`uname -r`
MACH=`uname -m`
if [ "${OS}" = "SunOS" ] ; then
OS=Solaris
ARCH=`uname -p`
OSSTR="${OS} ${REV}(${ARCH} `uname -v`)"
@lynsei
lynsei / error_handling_example.sh
Created September 26, 2023 16:52 — forked from pasela/error_handling_example.sh
[bash]error handling and error report example
#!/bin/bash
#
# error handling and error report example
#
set -e
# logfile
LOGFILE=`mktemp`
@lynsei
lynsei / events.md
Created November 8, 2022 18:47
[L7L2]. #Event #Bridge #Events #API #Service #Endpoint #List
@lynsei
lynsei / edge
Last active November 11, 2022 02:26
[lynslang] #current #version #verify #verification gist. This gist is use to confirm the latest versions for each channel.
0.9.95.dbld.00103
@lynsei
lynsei / randomness.c
Last active October 18, 2022 01:11
[/dev/urandom] seed generation for entropic data uses this code...
// SPDX-License-Identifier: (GPL-2.0 OR BSD-3-Clause)
/*
* Copyright (C) 2017-2022 Jason A. Donenfeld <[email protected]>. All Rights Reserved.
* Copyright Matt Mackall <[email protected]>, 2003, 2004, 2005
* Copyright Theodore Ts'o, 1994, 1995, 1996, 1997, 1998, 1999. All rights reserved.
*
* This driver produces cryptographically secure pseudorandom data. It is divided
* into roughly six sections, each with a section header:
*
* - Initialization and readiness waiting.
@lynsei
lynsei / index.html
Last active October 2, 2022 17:22
Splash page generator
<div id="row">
<h1 id="heading" contenteditable="true">GLOBAL.PKGDIST.COM</h1>
<h4 id="strapline" contenteditable="true">GLOBAL SOFTWARE DISTRIBUTION CDN </h4>
<span><a class="button" href="https://github.com/lynslang/" target="_blank">LynsLang CE | EE</a></span>
</div>
@lynsei
lynsei / release-automation.lets-encrypt.jwilder.volume.lyns.md
Last active September 18, 2022 06:21
[Let's Encrypt + Nginx Proxy Companion + Release Detection + Key Mount and Cert Mount Sharing] #release #automation for #certs using #letsencrypt #certificate #key #automation
#
# This simply allows the script to find the private key, chain certifiate, and root cert for any sub-domain that was triggered in automation using Lets Encrypt and a Jwilder proxy # # # companion container and their awesome API!
#
#  1. With LynsLang/Fish or Bash you can first `docker ps` with a filter for "name=nginx-proxy-lets" which will provide the container id easily,
#     provided you supply the correct go-lang template parameters:
@lynsei
lynsei / distro-less.Dockerfile
Created August 29, 2022 01:15
[distroless nodejs apps] #Docker #Image for #NodeJS #Apps #Containers using a tiny NodeJS base image
# my new registry code will be stored at github.com/distro-less and will provide polyglot support
FROM node:8.15.0 AS build-env
ADD . /app
WORKDIR /app
FROM gcr.io/distroless/nodejs
COPY --from=build-env /app /app
WORKDIR /app
CMD ["js_file.js"]
@lynsei
lynsei / pertinent-docs.md
Last active July 19, 2022 14:24
[two simple docker commands for a reverse proxy init without effort]

Reference


# https://docs.timescale.com/install/latest/installation-docker/#more-docker-options