Skip to content

Instantly share code, notes, and snippets.

View andrewhamon's full-sized avatar

Andy Hamon andrewhamon

View GitHub Profile
@voidus
voidus / flake.nix
Created April 22, 2023 18:35
Build a cloudinit image in nixos
{
description = "A nixos cloudinit base image without nixos-infect";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs";
};
outputs = { self, nixpkgs }:
let
system = "x86_64-linux";
@jpillora
jpillora / sshd.go
Last active December 17, 2023 16:27
Go SSH server complete example - Read more here https://blog.gopheracademy.com/go-and-ssh/
// A small SSH daemon providing bash sessions
//
// Server:
// cd my/new/dir/
// #generate server keypair
// ssh-keygen -t rsa
// go get -v .
// go run sshd.go
//
// Client:
@havenwood
havenwood / fallthrough.rb
Last active August 5, 2020 01:45
Fallthrough case statement in Ruby
value = :initial
catch :redo do
case value
when :initial
puts 'initial'
value = :changed
redo
when :changed
puts 'changed'