Skip to content

Instantly share code, notes, and snippets.

View sthordall's full-sized avatar

Stephan Thordal Larsen sthordall

  • Copenhagen, Denmark
View GitHub Profile
@davidfowl
davidfowl / MinimalAPIs.md
Last active May 8, 2024 02:30
Minimal APIs at a glance
@techhazard
techhazard / Readme.md
Last active January 26, 2024 16:23
NixOS: PCI Passthrough

PCI Passthrough

Warning: unfinished (but successfull!)

I did PCI passthrough on Archlinux and Debian with the old PCI-stub method (this was pre-4.0 era). And later I did PCI passthrough on the 4.1+ kernels on Arch and Ubuntu (16.10 I think?).

This is my attempt at doing the same on Nixos.

Requirements

@kuznero
kuznero / nixos-upgrade.md
Created March 30, 2017 19:10
Upgrading NixOS to v17.03

Upgrading NixOS

sudo nix-channel --add https://nixos.org/channels/nixos-17.03 nixos
sudo nix-channel --update
@kuznero
kuznero / docker-service-update-wait.md
Last active May 25, 2022 07:48
Docker service update wait bash script

Here is how this script can be used:

./docker-service-update-wait.sh redis-slave 60 2 "docker service update --image redis:3.2.6-alpine --stop-grace-period 10s --update-delay 5s redis-slave"

     Update command:  docker service update --image redis:3.2.6-alpine --stop-grace-period 10s --update-delay 5s redis-slave
      # of replicas:  3
    Timeout/replica:  60 sec
      Total timeout:  180 sec
 Stability delay: 2 sec
@vbfox
vbfox / Dapper.fs
Last active April 21, 2022 02:58
Minimal dapper in F#
module DapperFSharp =
open System.Data.SqlClient
open System.Dynamic
open System.Collections.Generic
open Dapper
let dapperQuery<'Result> (query:string) (connection:SqlConnection) =
connection.Query<'Result>(query)
let dapperParametrizedQuery<'Result> (query:string) (param:obj) (connection:SqlConnection) : 'Result seq =
@jacobblock
jacobblock / FreeNAS.md
Last active October 22, 2023 13:01
Ultimate FreeNAS Setup

FreeNAS

I started using FreeNAS in August 2013. It is fantastic piece of software and I have been really impressed by the upgrades just in the few months I've been using it. It looks like they recently went to a plugin system as of version 9 to make installing software easier for end users. I've ran into several issues related to plugins and user + group permissions so I decided to just use the available FreeBSD port system. After fiddling for a few days (now turned into months) I believe I have created something helpful for the community and anyone interested in picking up the port system. The sandbox nature of FreeNAS's jail system is especially helpful for playing around without having any consequence on your core system.

Here are straight-forward instructions to setting up a bunch of different software on FreeNAS. If you make a terrible error, just throw up another plugin sandbox and repeat.

ToC

@mattratleph
mattratleph / vimdiff.md
Last active May 9, 2024 03:11 — forked from roothybrid7/vimdiff_cheet.md
vimdiff cheat sheet

vimdiff cheat sheet

##git mergetool

In the middle file (future merged file), you can navigate between conflicts with ]c and [c.

Choose which version you want to keep with :diffget //2 or :diffget //3 (the //2 and //3 are unique identifiers for the target/master copy and the merge/branch copy file names).

:diffupdate (to remove leftover spacing issues)

:only (once you’re done reviewing all conflicts, this shows only the middle/merged file)

@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active May 17, 2024 21:23
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname