Are the caches warmed up? vmtouch and fincore are two useful programs.
What do they do? Basically, one can peek at what’s been cached into memory. I somehow ended up re–looking into this today. The Linux kernel is intelligent.
Another wandering soul whispering into the void. If you are looking for my blog you are in the wrong place. The profile and header pictures are brought to you by cdd20.
Are the caches warmed up? vmtouch and fincore are two useful programs.
What do they do? Basically, one can peek at what’s been cached into memory. I somehow ended up re–looking into this today. The Linux kernel is intelligent.
Another wandering soul whispering into the void. If you are looking for my blog you are in the wrong place. The profile and header pictures are brought to you by cdd20.
Many fortnights ago, I foolishly thought writing a theme from scratch would be easy. It was mostly unlike GTK2. About 40 minutes in came a horrifying realization: there’s fundamentally (and definitively) no way to write a consistent theme that works reliably with every application. The minor upside was a working (and somewhat accessible) wireframe theme and a basic understanding of debugging. The end.
GTK_DEBUG=interactive firefox
Another wandering soul whispering into the void. If you are looking for my blog you are in the wrong place. The profile and header pictures are brought to you by cdd20.
An actual but where did my Linux memory go command;
This program
(repositories) came in handy while
helping someone resolve an problem. Want to
see memory usage and shared memory, perhaps
sorted by swap?
smem -s swap -kta
smem --sort swap --abbreviate --totals --autosize
--sort
?
swap (amount of swap space consumed ignoring sharing)
command (process command line)
maps (total mappings count)
name (process name)
pid (process id #)
user (process owner)
pss (proportional set size including sharing)
rss (resident set size ignoring sharing)
uss (unique set size)
vss (virtual set size; total virtual memory mapped)
/tmp/
and tmpfs
(temporary file storage) abusers;
df -h | grep tmpfs
df --human-readable | grep tmpfs
Another wandering soul whispering into the void. If you are looking for my blog you are in the wrong place. The profile and header pictures are brought to you by cdd20.
Incus is worth a look. It’s the fork of LXD, a container and orchestration/hypervisor program for cluster setups and infra models. Incus sits on top of the lower level LXC (Linux Containers).
Another wandering soul whispering into the void. If you are looking for my blog you are in the wrong place. The profile and header pictures are brought to you by cdd20.
Some nix
language gotchas I’ve experienced while using
NixOS personally:
with
expressions unless with the
inherit
keyword for identifying hidden attributes in scope.rec
keyword unless there’s tracking/control of infinite set recursion (self
naming/references).<nixpkgs>
for any
evaluation chain unless there’s magic compute and “infinite” memory.Tricky is numero three, but crucial for fast feedback regardless of the current thing? I don’t poke around as much to know anymore but; legacy, flakes, community, and possibly others.
Another wandering soul whispering into the void. If you are looking for my blog you are in the wrong place. The profile and header pictures are brought to you by cdd20.
Ho, some of us think alike. I stumbled onto this site while looking up related unshare namespace configuration. I do something similar.
Another wandering soul whispering into the void. If you are looking for my blog you are in the wrong place. The profile and header pictures are brought to you by cdd20.
Different words similar meaning?
--references
is NixOS speak for direct
package dependencies.
--requisites
list all. These work with the
nix-store
command.
$ readlink --canonicalize "$(type -P which)"
/nix/store/r78jv9xgxnvsm5vpasf5ldkc28pkri6r-which-2.21/bin/which
$ nix-store --query --references /nix/store/r78jv9xgxnvsm5vpasf5ldkc28pkri6r-which-2.21
/nix/store/4nlgxhb09sdr51nc9hdm8az5b08vzkgx-glibc-2.35-163
which
directly depends on
glibc
. Swap --references
to
--referrers
for paths pointing to which
. On Guix,
list/draw dependencies with guix graph
.
guix graph --type=references which
nix-store --query --tree "$(readlink --canonicalize "$(type -P which)")"
Another wandering soul whispering into the void. If you are looking for my blog you are in the wrong place. The profile and header pictures are brought to you by cdd20.
I’ve had a draft post of Guix notes written up for a while now. Did you know that it’s easy to generate a file system specified from a config.scm? It’s somewhat equivalent to nixos-install, pacstrap and the like.
guix system init --no-bootloader config.scm filesystem/
Why? Commands like this are handy for messing around with chroots, containers, and other related stuff!
Another wandering soul whispering into the void. If you are looking for my blog you are in the wrong place. The profile and header pictures are brought to you by cdd20.
Look at this Makefile — then look at this NixOS package derivation. Appears simple but I couldn’t for the life of me divine how to quickly compile a custom/patched kernel module on NixOS. Abstractions… are very magical. The guide is cool and all, but it’s a better time investment to guesstimate the relationship between the higher/lower layer. This friendly example looks more like this in reality though ;-)
Another wandering soul whispering into the void. If you are looking for my blog you are in the wrong place. The profile and header pictures are brought to you by cdd20.
{ stdenv, lib, fetchgit, linuxKernel, kernel ? linuxKernel.kernels.linux_5_15
, version ? "d0d785dc1859b09299bde6d0f1d6786a0d610e7f" }:
stdenv.mkDerivation {
inherit version;
name = "sna-hda-codec-cs8409-${version}-module-${kernel.modDirVersion}";
# Upstream: https://github.com/davidjo/snd_hda_macbookpro
src = fetchgit {
url = "https://github.com/egorenar/snd-hda-codec-cs8409.git";
rev = version;
sha256 = "sha256-0UeoERcYpM+ojeZ7dDIE3ruTIoHkkC+s7FcoEVUTR0w=";
};
hardeningDisable = [ "pic" ];
nativeBuildInputs = kernel.moduleBuildDependencies;
NIX_CFLAGS_COMPILE = [ "-g" "-Wall" "-Wno-unused-variable" "-Wno-unused-function" ];
makeFlags = kernel.makeFlags ++ [
"INSTALL_MOD_PATH=$(out)"
"KERNELRELEASE=${kernel.modDirVersion}"
"KERNEL_DIR=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build"
];
postPatch = ''
printf '
snd-hda-codec-cs8409-objs := patch_cs8409.o patch_cs8409-tables.o
obj-$(CONFIG_SND_HDA_CODEC_CS8409) += snd-hda-codec-cs8409.o
KBUILD_EXTRA_CFLAGS = "-DAPPLE_PINSENSE_FIXUP -DAPPLE_CODECS -DCONFIG_SND_HDA_RECONFIG=1"
KERNELRELEASE ?= $(shell uname -r)
KERNEL_DIR ?= /lib/modules/$(KERNELRELEASE)/build
PWD := $(shell pwd)
default:
make -C $(KERNEL_DIR) M=$(PWD) CFLAGS_MODULE=$(KBUILD_EXTRA_CFLAGS)
install:
make -C $(KERNEL_DIR) M=$(PWD) modules_install
' \
> Makefile
sed --in-place 's|<sound/cs42l42.h>|"${linuxKernel.kernels.linux_6_0.dev}/lib/modules/${linuxKernel.kernels.linux_6_0.modDirVersion}/source/include/sound/cs42l42.h"|' patch_cs8409.h
sed --in-place 's|hda_local.h|${kernel.dev}/lib/modules/${kernel.modDirVersion}/source/sound/pci/hda/hda_local.h|' patch_cs8409.h
sed --in-place 's|hda_jack.h|${kernel.dev}/lib/modules/${kernel.modDirVersion}/source/sound/pci/hda/hda_jack.h|' patch_cs8409.h
sed --in-place 's|hda_generic.h|${kernel.dev}/lib/modules/${kernel.modDirVersion}/source/sound/pci/hda/hda_generic.h|' patch_cs8409.h
sed --in-place 's|hda_auto_parser.h|${kernel.dev}/lib/modules/${kernel.modDirVersion}/source/sound/pci/hda/hda_auto_parser.h|' patch_cs8409.h
'';
meta = { platforms = lib.platforms.linux; };
}
Then build it as a extra/custom kernel module. The results of stumbling upon yet another troublesome device…
{ pkgs, ... }:
{
boot = {
extraModulePackages = [
(pkgs.callPackage ../packages/snd-hda-cs8409/default.nix {
kernel = pkgs.linux_5_15;
})
];
};
}