Skip to content

Instantly share code, notes, and snippets.

View cameronelliott's full-sized avatar

Cameron Elliott cameronelliott

View GitHub Profile

Editor security run-model comparison: security & supply chain surface. Zed vs Lapce vs VSCode

Run model Language servers run Extensions run Extension tech Everything in container? Other security-relevant notes
Plain Zed on host Host (native binary, spawned with user privileges) Host (in WASM sandbox via wasmtime); spawning of LSP/native binaries prompts user WASM (Component Model + WIT), Rust-compiled No — GUI + LSPs touch host filesystem and creds Curated extension registry; smaller ecosystem (less to vet); pure Rust core (no V8/Node); GPL-licensed; auto-update behavior depends on settings
Plain Lapce on host Host (native binary) Host (in WASM sandbox via wasmtime, WASI Preview 1) WASI WASM (Rust, C, AssemblyScript) No Smallest plugin ecosystem (least attack surface, but also least battle-testing); small team / slow security response; pre-1.0; Apache 2.0; no formal marketplace moderation
Plain VSCode on host Host (separa
@cameronelliott
cameronelliott / sqlite-kv-store-thanks-H2CO3
Last active September 23, 2024 18:48 — forked from rust-play/playground.rs
Code shared from the Rust Playground
use std::path::Path;
use core::marker::PhantomData;
use core::borrow::Borrow;
use chrono::{DateTime, Utc, Days};
use rusqlite::{named_params, Connection, Statement};
use serde::{Serialize, Deserialize};
use thiserror::Error;
pub type Result<T, E = Error> = core::result::Result<T, E>;
#include <srtp2/auth.h>
#include <srtp2/cipher.h>
#include <srtp2/crypto_types.h>
#include <srtp2/srtp.h>
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
char SKEL_RTP_PACKET[17] = {0x80, 0x60, 0x69, 0x8f, 0xd9, 0xc2, 0x93, 0xda, 0x1c, 0x64, 0x27, 0x82, 0x98, 0x36, 0xbe, 0x88, 0x9e};
@cameronelliott
cameronelliott / README.md
Created October 23, 2022 20:26 — forked from mrbar42/README.md
bash scripts to create VOD HLS stream with ffmpeg almighty (tested on Linux and OS X)

running:

bash create-vod-hls.sh beach.mkv

will produce:

    beach/
      |- playlist.m3u8
 |- 360p.m3u8
@cameronelliott
cameronelliott / twoip.sh
Last active October 19, 2022 02:36 — forked from sparkcodeuk/floating-ip-gateway.sh
Digital Ocean show how to use two IP addresses
#!/bin/bash
NET_INT="eth0"
CURL_TIMEOUT=3
echo -n "Setting floating IP as the default gateway: "
# Check there's a floating IP attached to this droplet
if [ "$(curl -s --connect-timeout $CURL_TIMEOUT http://169.254.169.254/metadata/v1/floating_ip/ipv4/active)" != "true" ]; then
echo "Error: this droplet doesn't have a floating IP assigned to it."
@cameronelliott
cameronelliott / janus gateway sfu with https on digital ocean using caddy.txt
Created July 13, 2022 00:12
janus gateway sfu with https on digital ocean using caddy.txt
# http://duckdns.org
# https://github.com/RSATom/janus-gateway-snap
snap install janus-gateway
systemctl status snap.janus-gateway.janus-gateway.service
sudo apt install -y debian-keyring debian-archive-keyring apt-transport-https
curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/gpg.key' | sudo gpg --dearmor -o /usr/share/keyrings/caddy-stable-archive-keyring.gpg
curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/debian.deb.txt' | sudo tee /etc/apt/sources.list.d/caddy-stable.list
sudo apt update
#include <mach/port.h> /* mach_port_t */
#include <mach/mach.h> /* mach_port_allocate(), mach_task_self(), mach_port_insert_member(), MACH_PORT_RIGHT_PORT_SET */
#include <sys/event.h> /* kqueue(), kevent64(), struct kevent64_s, EVFILT_MACHPORT, EV_SET64, EV_ADD */
#include <sys/time.h> /* struct timespec */
//#include <dispatch/private.h>
extern mach_port_t _dispatch_get_main_queue_port_4CF(void);
extern void _dispatch_main_queue_callback_4CF(void);
#include <stdio.h>
@cameronelliott
cameronelliott / doc-ops-consulting-agreement.adoc
Created February 17, 2022 07:26 — forked from briandominick/doc-ops-consulting-agreement.adoc
Sample DocOps Consulting Agreement (Prime Source)

Documentation Engineering Consulting Agreement

@cameronelliott
cameronelliott / README.md
Created December 13, 2021 22:04 — forked from tmiller/README.md
A very simple example of using a map of channels for pub/sub in go.
@cameronelliott
cameronelliott / gist:c820b1ec72fe69dd9f36d5b7ed911aff
Last active November 3, 2021 20:15
Docker kill all, rm all containers, all images, for Fish shell
docker kill (docker ps -q)
docker rm (docker ps -a -q)
docker rmi (docker images -q)
# three commands above do
# stop all containers:
# remove all containers
# remove all docker images