Skip to content

Instantly share code, notes, and snippets.

View carnotweat's full-sized avatar

sameer gupta carnotweat

View GitHub Profile

$argon2id$v=19$m=64,t=512,p=2$MDOAt0I3AWroFd/E1+x8yg$cblJd+50ziH0GlF6rjJMPQ

[Verifying my cryptographic key: $argon2id$v=19$m=64,t=512,p=2$eGn09j1v01gP103pNTbS5A$kSTgjeRbE9dCqVJWh+qKXw]

@carnotweat
carnotweat / explanation.md
Created October 2, 2024 09:32 — forked from masak/explanation.md
How is git commit sha1 formed

Ok, I geeked out, and this is probably more information than you need. But it completely answers the question. Sorry. ☺

Locally, I'm at this commit:

$ git show
commit d6cd1e2bd19e03a81132a23b2025920577f84e37
Author: jnthn <[email protected]>
Date:   Sun Apr 15 16:35:03 2012 +0200

When I added FIRST/NEXT/LAST, it was idiomatic but not quite so fast. This makes it faster. Another little bit of masak++'s program.

@carnotweat
carnotweat / .ghci
Created July 10, 2024 03:49 — forked from rpearce/.ghci
Flake for using Haskell in nix develop
:def hoogle \x -> return $ ":!hoogle --count=15 \"" ++ x ++ "\""
:def doc \x -> return $ ":!hoogle --info \"" ++ x ++ "\""
:set -Wall
:set -fno-warn-type-defaults -ferror-spans -freverse-errors -fprint-expanded-synonyms
:set prompt "\ESC[0;32m%s\n\ESC[m[ghci]\ESC[38;5;172mλ \ESC[m"
:set prompt-cont " \ESC[38;5;172m> \ESC[m"
@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