Skip to content

Instantly share code, notes, and snippets.

View 573's full-sized avatar

Daniel Kahlenberg 573

View GitHub Profile
@573
573 / readme.md
Created October 25, 2024 12:08
emacs windows debug tip
Emacs Abort Dialog
A fatal error has occurred!
Would you like to attach a debugger?
Select:
YES — to debug Emacs, or
NO to abort Emacs and produce a backtrace
(emacs_backtrace.txt in current directory).
(Before clicking YES, type
`gdb -p `, then `continue` inside GDB.)
@573
573 / readme.md
Created October 10, 2024 13:13
java simulate break with takewhile continue with dropwhile

As in take a break take a kitkat

@573
573 / readme.md
Created October 3, 2024 19:24
vim tipp cmp-buffer other buffer completion
@573
573 / mkenv.sh
Created September 30, 2024 13:00 — forked from yihuang/mkenv.sh
build nix shell from python requirements.txt
# build python nix shell from a local `./requirements.txt`
mkdir ./env
cat > ./env/flake.nix << 'EOF'
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
poetry2nix = {
url = "github:nix-community/poetry2nix";
inputs.nixpkgs.follows = "nixpkgs";
@573
573 / yubikey+gpupgp+ssh_howto.md
Created September 19, 2024 14:54 — forked from xirkus/yubikey+gpupgp+ssh_howto.md
Security Adventures 1. How to get yubikey+gpg+ssh+gitbhub working on MacOS

I've spent the day trying to get this setup working with GitHub and given the number of gotcha's I encountered, it seemed like a good idea to document how I finally got this working with as few hacks as possible. There's a lot of documentation out there (some of it old and misleading) and committing here for posterity will help me remember this when I inevitably need to do this again.

Rationale

Passwords are simply not enough these days. Regardless of the company, breaches (and the associated Personally Identifiable Information harvested) are a matter of not if, but when. There are a number of things you can do to protect yourself, but being on the tin-foil-hat side of paranoia, means there are a few Commandents that I adhere to (and recommend for other folks)[Insert link to Fight Club Rules for the Secure Internet].

That being said, if you use 2-factor authentication and have committed to using a hardware token such as the Yubikey, then you're already ahead of the curve. The problem is that wh

@573
573 / readme.md
Created September 12, 2024 08:51
nix vim flakes tip eval

in command mode (vim): :wa followed by :T bash -c 'nix eval ".#nixosConfigurations.HOST.config.system.build.toplevel" --show-trace'

@573
573 / readme.md
Created August 25, 2024 21:17
nix haskell tip

<@lxsameer:matrix.org> hey folks, do you know how I can extend the following derivation: drv = pkgs.haskell.pcakages.ghc96.withPackages (p: (with p;[ .....]); with more haskell packages that use the same compiler instance?

(pkgs.haskell.packages.ghc96.override { overrides = hself: hsuper: { ...; } }).withPackages ...;

@573
573 / readme.md
Created August 24, 2024 20:16
nix-instantiate equivalent for nix repl multi line strings

cat multilinetest.nix

{
  test = ''
  fields: ["wanted", "queued"]
  '';
}