Skip to content

Instantly share code, notes, and snippets.

View barakplasma's full-sized avatar

Michael Salaverry barakplasma

View GitHub Profile
@arianvp
arianvp / SSH_MACOS_SECURE_ENCLAVES.md
Last active December 8, 2025 00:10
Native Secure Enclaved backed ssh keys on MacOS

Native Secure Enclave backed ssh keys on MacOS

It turns out that MacOS Tahoe can generate and use secure-enclave backed SSH keys! This replaces projects like https://github.com/maxgoedjen/secretive

There is a shared library /usr/lib/ssh-keychain.dylib that traditionally has been used to add smartcard support to ssh by implementing PKCS11Provider interface. However since recently it also implements SecurityKeyProivder which supports loading keys directly from the secure enclave! SecurityKeyProvider is what is normally used to talk to FIDO2 devices (e.g. libfido2 can be used to talk to your Yubikey). However you can now use it to talk to your Secure Enclave instead!

@egeozcan
egeozcan / index.html
Created October 18, 2024 08:40
image viewer
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Fullscreen Image Viewer</title>
<style>
body {
font-family: Arial, sans-serif;
}
@OrionReed
OrionReed / dom3d.js
Last active November 16, 2025 19:47
3D DOM viewer, copy-paste this into your console to visualise the DOM topographically.
// 3D Dom viewer, copy-paste this into your console to visualise the DOM as a stack of solid blocks.
// You can also minify and save it as a bookmarklet (https://www.freecodecamp.org/news/what-are-bookmarklets/)
(() => {
const SHOW_SIDES = false; // color sides of DOM nodes?
const COLOR_SURFACE = true; // color tops of DOM nodes?
const COLOR_RANDOM = false; // randomise color?
const COLOR_HUE = 190; // hue in HSL (https://hslpicker.com)
const MAX_ROTATION = 180; // set to 360 to rotate all the way round
const THICKNESS = 20; // thickness of layers
const DISTANCE = 10000; // ¯\\_(ツ)_/¯
@vec715
vec715 / Setup Podman on Chrome OS Flex and Crostini.md
Last active December 2, 2025 22:59
Setup Podman on Chrome OS Flex and Crostini

Actual versions for this guide:

  • Operating System: Debian GNU/Linux 12 (bookworm)
  • Kernel: Linux 6.1.64-09049-g010fe86d9eae
  • Architecture: x86-64
  • Podman: v1.7.1

Installation

1. Install Podman:

sudo apt install podman
@agoose77
agoose77 / flake.nix
Last active August 17, 2025 19:35
Python virtualenvironment flake
{
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = inputs @ {
self,
nixpkgs,
flake-utils,
...
@Alex-Schaefer
Alex-Schaefer / bambu-ssdp-discovery.py
Last active December 6, 2025 16:12
Python implementation to send a fake SSDP discovery message to Bambu Studio or Orca Slicer
# Derived from this: https://github.com/gashton/bambustudio_tools/blob/master/bambudiscovery.sh
# Python implementation without need for linux
# Send the IP address of your BambuLab printer to port 2021/udp, which BambuStudio is listens on.
# Ensure your PC has firewall pot 2021/udp open. This is required as the proper response would usually go to the ephemeral source port that the M-SEARCH ssdp:discover message.
# But we are are blindly sending a response directly to the BambuStudio listening service port (2021/udp).
# Temporary solution to BambuStudio not allowing you to manually specify the Printer IP.
# Usage:

Installing Tailscale on GL.iNet SiFlower (SiChang) routers

I have no experience creating opkg packages for OpenWRT, so manual installation it is!

Automatic installation

It's not compressed as of writing this, but it's much easier to install, and now supports our architecture

Manual compilation and installation

Prerequisites

  1. A GL.iNet SiFlower router, like the Opal (GL-SFT1200)
@barakplasma
barakplasma / script.js
Last active March 20, 2024 18:30
Display if KSP items in category are available nearby (on context menu right click)
// ==UserScript==
// @name Show in stock on KSP
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author You
// @match https://ksp.co.il/web/cat/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=co.il
// @grant GM.xmlHttpRequest
// @connect ksp.co.il
# STEP 1: Load
# Load documents using LangChain's DocumentLoaders
# This is from https://langchain.readthedocs.io/en/latest/modules/document_loaders/examples/csv.html
from langchain.document_loaders.csv_loader import CSVLoader
loader = CSVLoader(file_path='./example_data/mlb_teams_2012.csv')
data = loader.load()
@stokito
stokito / webdav_curl.md
Last active June 22, 2025 22:19
WebDAV with curl or wget for scripts and command line