Skip to content

Instantly share code, notes, and snippets.

View lynsei's full-sized avatar
:octocat:
Huzzah!

Lynsei lynsei

:octocat:
Huzzah!
View GitHub Profile
@lynsei
lynsei / detect-os.sh
Created December 26, 2024 16:00
Detect operating system
#!/bin/bash
detect_os() {
local os="unknown"
case "$(uname -s)" in
Linux)
os="Linux"
;;
Darwin)
@lynsei
lynsei / gist:a28c4fbb3d9d0019e853c43522ed9ab6
Last active December 24, 2024 23:54
Fish and bash and no extension
# find all .fish|.bash|no-ext files
find . -regex '.*\.\(fish\|bash\)\|^[^\.]*$' #noworky
# that was supposed to work but it did ot
# this worked:
find . -regex '.*.[.fish]'
@lynsei
lynsei / rclone-shell-completions.fish
Created December 20, 2024 15:11
rclone.fish [ for placement at ~/.config/fish/completions/rclone.fish ]
# fish completion for rclone
# rclone v1.68.2 dec 20
function __rclone_debug
set -l file "$BASH_COMP_DEBUG_FILE"
if test -n "$file"
echo "$argv" >> $file
end
end
@lynsei
lynsei / Dockerfile
Last active December 19, 2024 18:52
[Dockerfile.volta] Volta in Ubuntu:rolling
FROM ubuntu:rolling
WORKDIR /volta
RUN apt-get update && \
apt-get install --no-install-recommends -y fish \
wget \
git \
sudo \
ca-certificates
@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 March 10, 2025 10:08
[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.