Skip to content

Instantly share code, notes, and snippets.

View carnotweat's full-sized avatar

sameer gupta carnotweat

View GitHub Profile
@carnotweat
carnotweat / 01_NixOS_Prefix_delegation_with_fixed_DUID.md
Created June 23, 2024 10:08 — forked from gleber/01_NixOS_Prefix_delegation_with_fixed_DUID.md
Configuring ipv6 with dhcpcd using static DUID in NixOS 17.03 (e.g. on online.net servers)

I was trying to configure native ipv6 on my NixOS box, which is running in online.net's datacenters. They provide you a /48 or smaller subnet and a DUID which is used during DHCP. In dhcpcd vocabulary DUID is called clientid.

online.net's help page about IPv6 configuration was not very useful, since NixOS uses dhcpcd by default. The page which allowed me to make it all work was https://community.online.net/t/tutorial-ipv6-with-dhcpcd/3804

It looks like the only really required entries in networking.dhcpcd.extraConfig are interface and static though. I assumed that clientid is also necessary, but it looks like dhcpcd cares much more about content of /etc/dhcpcd.duid. Of course replace enp2s0 with the name of the main interface.

@carnotweat
carnotweat / example.m31
Created February 19, 2024 09:02 — forked from andrejbauer/example.m31
Example of Andromeda ML-programming
(* In Andromeda everything the user writes is "meta-level programming. *)
(* ML-level natural numbers *)
mltype rec mlnat =
| zero
| succ of mlnat
end
(* We can use the meta-level numbers to define a program which computes n-fold iterations
of f. Here we give an explicit type of iterate because the ML-type inference cannot tell
@carnotweat
carnotweat / .emacs
Created November 22, 2023 03:49 — forked from oblique63/.emacs
Emacs Bootstrap
;; -*- lexical-binding: t; -*-
;;===[ PERFORMANCE ENHANCEMENTS ]===============================================
;; See:
;; https://github.com/hlissner/doom-emacs/wiki/FAQ#how-is-dooms-startup-so-fast
(defvar file-name-handler-alist-backup file-name-handler-alist)
(defvar gc-cons-threshold-backup gc-cons-threshold)
(defvar gc-cons-percentage-backup gc-cons-percentage)
(setq gc-cons-threshold 402653184
@carnotweat
carnotweat / configuration.nix
Last active October 25, 2023 17:00
from nixos wiki
{ config, lib, pkgs, inputs, system, ... }:
# to be modulazrized as overlay, well maybe
let
unstable = import (fetchTarball
"https://github.com/NixOS/nixpkgs/archive/nixos-unstable.tar.gz") {
overlays = [
(import (builtins.fetchTarball {
url =
"https://github.com/nix-community/emacs-overlay/archive/master.tar.gz";
—- Functors
{—
class Functor f where
fmap :: (a->b) ->fa-->fb
—}
-- Monads, comonads
class (Functor m) => Mon m where
unit :: a->ma
mult :: m (ma) -> ma
class (Functor n) => Comon n where

openpgp4fpr:5303A2502DA636704D86227F0833317599B7F097

@carnotweat
carnotweat / openpgp.md
Last active July 22, 2023 10:54
verification

[Verifying my cryptographic key:openpgp4fpr:d4b56e4d18ed5be3e4aee1cdff331a5a1a7ab372]

@carnotweat
carnotweat / modal_mu.v
Created May 11, 2023 18:23 — forked from qnighy/modal_mu.v
Modal mu calculus in Coq
Require Import Coq.Classes.SetoidClass.
Program Instance Iff1Setoid{A:Type} : Setoid (A->Prop) := {|
equiv := fun P Q => forall x, P x <-> Q x
|}.
Next Obligation.
split.
- intros P x; reflexivity.
- intros P Q H x; symmetry; exact (H x).
- intros P Q R H0 H1 x; transitivity (Q x); [exact (H0 x)|exact (H1 x)].
with import <nixpkgs> {};
mkShell {
nativeBuildInputs = [
ocaml
opam
dune_2
pkg-config
gcc
bintools-unwrapped
gmp

Keybase proof

I hereby claim:

  • I am carnotweat on github.
  • I am sameerg (https://keybase.io/sameerg) on keybase.
  • I have a public key whose fingerprint is 7418 D902 D3DE A1C0 EB27 001F FA20 2CE6 D5F0 4602

To claim this, I am signing this object: