Skip to content

Instantly share code, notes, and snippets.

View bketelsen's full-sized avatar
💭
Making tools to make the tools.

Brian Ketelsen bketelsen

💭
Making tools to make the tools.
View GitHub Profile
@worldofgeese
worldofgeese / .gitpod.yml
Last active August 21, 2023 15:07
Development containers compatible with Gitpod and GitHub Codespaces
image:
file: prebuild-devcontainer/Dockerfile
tasks:
- init: |
direnv allow
vscode:
extensions:
- jetpack-io.devbox
- ms-python.python
#!/bin/bash
# Get a list of all volumes
volumes=$(podman volume ls -q)
#get timestamp for unique filename
timestamp=$(date +"%Y%m%d%H%M%S")
# Pause all running containers
echo "Pausing containers for backup"
podman pause $(podman ps -q)

Using VSCode Flatpak to launch DevContainers Using Podman with Support for Nvidia CUDA and VSCode's "Container Features" In SilverBlue.

Note: This Setup Works for Machine Learning and GPU Acceleration in Containers

Setup

Make Sure you have rebased to UBlue-Nvidia.

Install Visual Studio Code

{
pkgs ? import (fetchTarball "https://github.com/NixOS/nixpkgs/archive/refs/tags/22.11-beta.tar.gz") {},
} :
with pkgs;
let
init = pkgs.writeScript "init.sh" ''
#!${pkgs.runtimeShell}
/activate
exec /run/current-system/systemd/lib/systemd/systemd $*
@AnomalRoil
AnomalRoil / go-switch-bash
Last active July 1, 2022 13:37
The `go switch` function allows you to easily switch you current Go version
# to add to your ~/.bashrc or your ~/.zshrc file. Usage: $ go switch 1.18.1
function go() {
case $* in
switch* )
shift 1
gobindir=$(go env GOBIN)
# adapt to a valid directory at the beginning of your $PATH if you're not on systemd
homebindir=$(systemd-path user-binaries)
go install golang.org/dl/go"$@"@latest
$gobindir/go"$@" download
@santicalcagno
santicalcagno / configuration.nix
Created August 2, 2021 00:01
NixOS configuration
# Edit this configuration file to define what should be installed on
# your system. Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running ‘nixos-help’).
{ config, pkgs, ... }:
{
imports =
[ # Include the results of the hardware scan.
./hardware-configuration.nix
#!/usr/bin/env bash
set -euo pipefail
# Always use the by-id aliases for devices, otherwise ZFS can choke on imports.
DISK=${DISK:-/dev/disk/by-id/nvme-Samsung_SSD_970_EVO_Plus_500GB_S4EVNF0M531397T}
EFI=${EFI:-true}
function Usage() {
echo "usage: $0 install|revert" >&2
@obezuk
obezuk / index.html
Last active September 7, 2022 07:58
Cloudflare Worker - Link Shortener
<!doctype html>
<html lang="en">
<head>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
@honewatson
honewatson / elm.nim
Created July 4, 2018 13:33
Nim Karax Elm Architecture Example
include karax / prelude
import strutils
type
Model = object
counter*: int
Dispatch = proc(model: Model): void
proc init(): Model =
result = Model(counter: 0)