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 / spinners.nfo
Created February 24, 2025 16:26
[Spinners] #spinners
# Spinners
Perl Spinner/Heartbeat demonstrator (Unicode complaint)
perl -CO -Mutf8 -e '$|=1; $c=" ▏▎▍▌▋▊▉█";
while(1){ for $i ($c=~/(.)/g) {
print " $i\r"; select(undef,undef,undef,.1+1/length($c)); } };'
@lynsei
lynsei / softdist.nfo
Created February 19, 2025 20:09
[softdist] banner
.▄▄ · ·▄▄▄▄▄▄▄▄·▄▄▄▄ ▪ .▄▄ · ▄▄▄▄▄
▐█ ▀. ▪ ▐▄▄·•██ ██▪ ██ ██ ▐█ ▀. •██
▄▀▀▀█▄ ▄█▀▄ ██▪ ▐█.▪▐█· ▐█▌▐█·▄▀▀▀█▄ ▐█.▪
▐█▄▪▐█▐█▌.▐▌██▌. ▐█▌·██. ██ ▐█▌▐█▄▪▐█ ▐█▌·
▀▀▀▀ ▀█▄▀▪▀▀▀ ▀▀▀ ▀▀▀▀▀• ▀▀▀ ▀▀▀▀ ▀▀▀
@lynsei
lynsei / .env.gh.runners.fish
Created February 19, 2025 18:14
[fish] #runner start #gh
function .env.gh.runners -d 'Turn on Github Runner Daemons' -a do
if test -n "$do"
switch $do
case "-init"
$HOME/Documents/runner/mck/actions-runner/run.sh &
$HOME/Documents/runner/lyns/actions-runner/run.sh &
$HOME/Documents/runner/lyns/softdist/actions-runner/run.sh &
case "-exit"
pkill -f 'run.sh'
case ""
@lynsei
lynsei / Patch.ts
Last active February 10, 2025 19:36
[deno-duplex] command
private async containerAttachment(containerId: string) {
try {
log(bgBlue(`🔗 Attaching to container: ${containerId}`));
// Check if already attached to avoid duplicate locks
if (this.isAttached) {
log(yellow(`⚠️ Already attached to container: ${containerId}`));
return;
}
this.isAttached = true; // Set flag to prevent duplicate attach calls
@lynsei
lynsei / error
Last active January 27, 2025 17:43
[Docker.ts] usage with @rainypixel/docker-api-ts
Checking Docker daemon...
GET /info HTTP/1.1
Host: docker
Accept: application/json
SyntaxError: Bad control character in string literal in JSON at position 8042 (line 1 column 8043)
at JSON.parse (<anonymous>)
at ConnectionClient.parseResponseBody (https://jsr.io/@rainypixel/docker-api-ts/0.1.2/client/connection.ts:123:31)
at DockerClient.makeRequest (https://jsr.io/@rainypixel/docker-api-ts/0.1.2/client/docker.ts:78:37)
at eventLoopTick (ext:core/01_core.js:177:7)
at async main (file:///Users//Documents/gh/lotsofthoughts/install/deno/run.ts:11:25)
@lynsei
lynsei / generate.ts
Created January 24, 2025 17:22
[deno] AES crypto CBC
import { writeFileStr, readFileStr } from "https://deno.land/std/fs/mod.ts";
import { crypto } from "https://deno.land/std/crypto/mod.ts";
async function encryptAndSave(results: any[], keyFile: string, dataFile: string) {
// Generate a random 256-bit (32 bytes) key and IV
const key = crypto.getRandomValues(new Uint8Array(32)); // AES-256
const iv = crypto.getRandomValues(new Uint8Array(16)); // AES block size
// Convert results to JSON string
const resultsJSON = JSON.stringify(results);
@lynsei
lynsei / run.sh
Created January 22, 2025 22:35
[run.sh]
#!/usr/bin/env bash
# -u Treat unset variables as an error when substituting them
# -e Exit immediately on Error.
# -x Print commands and their arguments as they are read
# -v Print shell input lines as they are read
# -B Perform brace expansion and
# -n read commands but do not execute them (dry run)
# -a mark variables which are modified or created for exporting
set -e
@lynsei
lynsei / install
Last active January 22, 2025 22:36
[install] run.sh
#!/usr/bin/env bash
# -u Treat unset variables as an error when substituting them
# -e Exit immediately on Error.
# -x Print commands and their arguments as they are read
# -v Print shell input lines as they are read
# -B Perform brace expansion and
# -n read commands but do not execute them (dry run)
# -a mark variables which are modified or created for exporting
set -e
@lynsei
lynsei / P2
Last active January 22, 2025 20:00
[alpine-osxc] libintl
# Ensure libintl.h and libintl.so are available to osxcross
RUN ln -sf /usr/include/libintl.h /osxcross/target/include/libintl.h
RUN ln -sf /usr/lib/libintl.so /osxcross/target/lib/libintl.so
# Set environment flags to include libintl paths
ENV CXXFLAGS="$CXXFLAGS -I/osxcross/target/include"
ENV LDFLAGS="$LDFLAGS -L/osxcross/target/lib -lintl"
# CMake build
RUN cmake -G Ninja \
@lynsei
lynsei / gpg.functions.fish
Created January 8, 2025 17:21
[fish] gpg version2 functions
function .gpg.key.create --description 'GPG: Create a key'
gpg --full-gen-key
end
function .gpg.key.export --description 'GPG Key Export' --argument email filename
gpg -a --export $email > "$filename.pub.key"
gpg -a --export-secret-keys $email > "$filename.secret.key"
end
function .gpg.key.list --description 'List GPG Keys'
gpg --list-secret-keys --keyid-format LONG
end