Skip to content

Instantly share code, notes, and snippets.

View 573's full-sized avatar

Daniel Kahlenberg 573

View GitHub Profile
@573
573 / readme.js
Created April 30, 2019 11:04
Add this bookmarklet for archive.today
javascript:void(open('http://archive.today/?run=1&url='+encodeURIComponent(document.location)))
@573
573 / readme.md
Last active June 19, 2025 19:17
playlist m3u android

ls -1 | egrep '.*m4a' -o | sed -e "s/^'//" > out.m3u

@573
573 / .emacs
Created May 8, 2025 09:48 — forked from amygrinn/.emacs
Autoshare -> Tasker -> Termux -> Org Protocol -> Org Capture
;; Required setup for emacs init file
(package-initialize)
(require 'org)
(require 'org-protocol)
;; Set 'my-org-directory' to the base directory of all of
;; your org files (with a trailing slash). For me it's:
(setq my-org-directory "/scp:org:/home/orgmode/")
;; But it could be a local directory for you
@573
573 / readme.md
Last active April 29, 2025 08:41
nixos-wsl fatal error NixOS-WSL wsl WSL nix qemu-aarch64-binfmt-P-x86_64-unknown-linux-musl
sudo -i nix-store --gc

but then i. e. nix shell --no-substitute --option binary-caches '' .#nixosConfigurations.DANIELKNB1.pkgs.hello again gives:

error:
… while setting up the build environment

  error: getting attributes of path '/nix/store/w0cpwqkiim2b3cd8k0j5j1cz0s8kz87q-qemu-aarch64-binfmt-P-x86_64-unknown-linux-musl':  

No such file or directory

@573
573 / readme.md
Last active April 17, 2025 10:01
Shrink size of NixOS disk wsl diskpart resize

https://learn.microsoft.com/en-us/windows/wsl/disk-space#how-to-locate-the-vhdx-file-and-disk-path-for-your-linux-distribution

https://stephenreescarter.net/how-to-shrink-a-wsl2-virtual-disk/

wsl --shutdown
wsl --manage NixOS-Groundtruth -s false
(Get-ChildItem -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Lxss | Where-Object { $_.GetValue("DistributionName") -eq 'NixOS-Groundtruth' }).GetValue("BasePath") + "\ext4.vhdx" | Set-Clipboard
diskpart
> select vdisk file="\\?\C:\Users\dkahlenberg\NixOS\ext4.vhdx"
@573
573 / readme.md
Last active March 21, 2025 07:19
home-manager and related nix-configs

First and foremost the manual mentions it explicitly:

[Use] the standalone home-manager tool. For platforms other than NixOS (...), this is the only available choice. (...) See Section 1.1, “Standalone installation” for instructions (...)

https://grahamc.com/blog/erase-your-darlings
https://github.com/ryantm/home-manager-template
ico nix-store sqlite corruption NixOS/nix#1353
ico nix-store permission error NixOS/nix#4356
https://rgoswami.me/posts/local-nix-no-root/
https://dram.page/p/bootstrapping-nix/

@573
573 / readme.md
Created March 16, 2025 13:39
universal-android-debloater on non-nixos system

nix run --impure github:nix-community/nixGL -- nix run nixpkgs#universal-android-debloater