Skip to content

Instantly share code, notes, and snippets.

@gbluma
gbluma / switch_vm.sh
Created January 30, 2022 01:50
A short script to queue up a start job in proxmox, so that once the FROM vm is fully off, the TO vm is started. It's useful for swapping between GPU passthrough virtual machines without having to use another computer to start the next vm.
#!/bin/bash
FROM=$1
TO=$2
if [ -z "$FROM" ]; then echo "Usage: ./switch_vm.sh <current_vmid> <next_vmid>"; exit 1; fi
if [ -z "$TO" ]; then echo "Usage: ./switch_vm.sh <current_vmid> <next_vmid>"; exit 1; fi
echo "waiting for $FROM to shutdown, then starting $TO"
while : ; do
! --- ~/.Xresources ------------------------------------------------------------
! ------------------------------------------------------------------------------
! --- generated with 4bit Terminal Color Scheme Designer -----------------------
! ------------------------------------------------------------------------------
! --- http://ciembor.github.com/4bit -------------------------------------------
! ------------------------------------------------------------------------------
! --- special colors ---
*background: #122537
@gbluma
gbluma / gist:6991aabdfefe7f8d6da34aa89e99878a
Created December 9, 2016 02:58
self-calling-chip.flx
chip A
connector io
pin i : %< int // we read from
pin o : %> int // we write to
{
while true do
// take the value provided and send it upstream
x := read io.i;
@gbluma
gbluma / arr2.flx
Created November 27, 2016 20:17
Work in progress of a non-initialized array w/ iterator
include "std/gc";
open Gc;
// doesn't seem to do anything yet.
private body raw_array_cleanup_func =
"""
static void _raw_array_cleanup ( ::flx::gc::generic::collector_t *, void*) {
printf("Cleaning up\\n");
}
;; Turn off auto save
(setq auto-save-default nil)
;; Turn off the toolbar
(tool-bar-mode -1)
;; set theme
;; change colors based on time
open syntax chips;
// the most basic integer summing device
chip sum
connector pins
pin i1: %< int
pin i2: %< int
pin r1: %> int
{
while true do
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include "libtcc.h"
#include "tcc.h"
void repl()
// Jason Hemann and Dan Friedman
// microKanren, final implementation from paper
SCHEME """ (define (var c) (vector c)) """;
SCHEME """ (define (var? x) (vector? x)) """;
SCHEME """ (define (var=? x1 x2) (= (vector-ref x1 0) (vector-ref x2 0))) """;
SCHEME """
(define (assp p l)
@gbluma
gbluma / setup.sh
Last active March 2, 2016 16:15
A quick script for setting up *nix machines with my prefs
#!/bin/sh
set -e
cd ~
# get tmux conf
if [ ! -f "~/.tmux.conf" ]; then
wget https://gist.githubusercontent.com/gbluma/3e7019299c0e14a7e438/raw/7ad1f6b05520ab7285be6c6878904efecbd4f158/tmux.conf
mv tmux.conf .tmux.conf
fi
@gbluma
gbluma / Makefile
Last active December 25, 2015 08:01
Felix using and being called from GTK+3
.PHONY: test
test: gtk.fpc
flx --pkgconfig-path+=. --static -o app gtk.flx
gtk.fpc:
echo "cflags: `pkg-config --cflags gtk+-3.0`" > gtk.fpc
echo "requires_slibs: `pkg-config --libs gtk+-3.0`" >> gtk.fpc