gchristensen changed the topic of #nixos-chat to: NixOS but much less topical || https://logs.nix.samueldr.com/nixos-chat
drakonis1 has quit [Ping timeout: 250 seconds]
<gchristensen> hmm
<gchristensen> muahaha
<gchristensen> sed -e 's @.*\s \ '
Guanin has quit [Remote host closed the connection]
<samueldr> no
<gchristensen> sed -e 'ss@.*\ss s'
<samueldr> see, this one is better
<gchristensen> lol
<gchristensen> infinisil: zfs list -Hp -t snapshot -o name,creation | sed -e 's#@.*\s# #' | awk '{ if (last[$1] < $2) { last[$1]=$2 } } END { for (m in last) { printf "zfs_snapshot_age_seconds{dataset=\"%s\"} %s\n", m, last[m]; }}'
<infinisil> gchristensen: That prints the date of the latest snapshot for each dataset?
<gchristensen> yeah
<gchristensen> in a format which prometheus can scrape
<gchristensen> znapzend could really use some introduced jitter
<gchristensen> having several systems sync all an the some moment is not nice for the receiving end
<infinisil> Yeah.. the longer I'm using znapzend the more things to improve I find
<gchristensen> I'd really like it to operate on a systemd timer
<infinisil> gchristensen: Btw: for set in $(zfs list -Hp -o name); do echo "zfs_snapshot_age_seconds{dataset=\"$set\"} $(zfs list -Hp -t snapshot -o creation -s creation "$set" | head -1)"; done
<infinisil> But it doesn't quite do the same
<gchristensen> neat
<gchristensen> pretty close
<infinisil> (And it takes longer because zfs list is called multiple times)
<gchristensen> aye
<infinisil> gchristensen: Or even fancier, `man zfs program`!
<gchristensen> do it in lua or something? :P
<infinisil> Yup!
<gchristensen> so cool
<infinisil> Yea, haven't used it though
<gchristensen> wow, looking at the available lua api, I could really do some damage
drakonis has quit [Quit: WeeChat 2.6]
drakonis has joined #nixos-chat
drakonis_ has quit [Ping timeout: 246 seconds]
<infinisil> gchristensen: Yeah it's pretty nice :D
drakonis1 has joined #nixos-chat
drakonis has quit [Quit: WeeChat 2.4]
drakonis1 is now known as drakonis
waleee-cl has quit [Quit: Connection closed for inactivity]
<infinisil> I just learned that Linux doesn't automatically put stuff from swap back into RAM when there's space
<infinisil> I learned this because my swap is on an HDD, and apparently a lot of often-used things were in there..
<clever> infinisil: but the reverse is true, there is a thing called swap cache
<clever> $ grep SwapCached /proc/meminfo
<clever> SwapCached: 932844 kB
<clever> infinisil: when idle, linux will sometimes pre-write some stuff in ram to swap, but leave it in ram (and specially flag it read-only)
<clever> if it needs the ram, it can insta-free the pages
<infinisil> Neat
<clever> if something writes to it, the pagefault (due to readonly) will alert linux, which invalidates the copy in swap, flags it r/w, and triggers a retry
<infinisil> Hmm yes, some nice cache invalidation
<clever> $ grep Cache /proc/meminfo
<clever> Cached: 1600176 kB
<clever> infinisil: i think this is both the read cache, and the mmap cache?
<clever> the .text and .data sections of binaries, basically act like mini swap files
<clever> and the kernel will read them in on-demand, but can insta-free them when needed
<clever> $ grep Dirty /proc/meminfo
<clever> Dirty: 556 kB
<clever> infinisil: and this one, is the nasty one, any time you do things like ext2/3/4 on usb
<clever> basically, the FS lets you have several gig of outstanding writes
<clever> so it acts way faster then the disk can keep up
<clever> and when you try to `sync` or `umount`, it will just hang for 10 or 20 minutes, while it writes it all to disk!!
<elvishjerricco> infinisil, gchristensen: The odd thing about `zfs program` is that it put a lua interpreter in kernel mode, which seems like a bad idea. Dunno why they couldn't have just extended the ioctl API and written a user space library...
<clever> elvishjerricco: ive seen just as crazy things before, https://lwn.net/Articles/641244/ python in grub!
<infinisil> clever: Earlier when I fixed my problem with swapoff I also had to wait like 10 minutes for it to copy everything away from swap :)
<elvishjerricco> clever: gross :P
<clever> infinisil: ive also found swapoff to have horid performance
<gchristensen> elvishjerricco: that is surprising.
<clever> elvishjerricco: does it at least need root to execute programs?
<elvishjerricco> gchristensen: They justified it by saying there are other Turing complete drivers in the kernel that can sort of behave like an interpreter. Seemed like a weak argument to me
<elvishjerricco> clever: No idea
<elvishjerricco> Probably though
<clever> elvishjerricco: i'm reminded of how windows renders fonts in-kernel, and fonts are now turing complete!
<elvishjerricco> Dunno if delegated permissions have something for programs
<clever> and there are font exploits, to gain ring0 on a remote box...
<elvishjerricco> ... gross :P
endformationage has quit [Quit: WeeChat 2.6]
drakonis has quit [Quit: WeeChat 2.6]
gspia has joined #nixos-chat
kraem has quit [Quit: outta here]
kraem has joined #nixos-chat
<pie__> some things that went bad and good with the D language design, anniversary retrospective
<pie__> im still waiting for docstrings :P
<pie__> in nix
<pie__> top comment here answers a question i also had https://news.ycombinator.com/item?id=21295149
LnL has quit [Ping timeout: 250 seconds]
<eyJhb> infinisil: the sad part was I didn't get any of the pizza.. :( I picked a friend up after she had hit the town, and I hoped she wouldn't be able to eat it all. I was very very wrong
<eyJhb> Don't underestimate a hungry women I guess
__monty__ has joined #nixos-chat
<infinisil> Haha
<eyJhb> She took my cake as well.. :(
<infinisil> Blimey!
drakonis has joined #nixos-chat
drakonis has quit [Quit: WeeChat 2.6]
drakonis has joined #nixos-chat
drakonis has quit [Quit: WeeChat 2.6]
ddima has quit [Ping timeout: 268 seconds]
endformationage has joined #nixos-chat
drakonis has joined #nixos-chat
ddima has joined #nixos-chat
<pie__> so im gonna log into my github, havent been on in like two monts, lets see how many notifications i have
<pie__> wow ok just two...
<pie__> ;_;
<lassulus> github notifications are luckily quite sparse, except you opt in ffor them explicitly
<lassulus> I miss prs to my own repos most of the time
<pie__> i dont think it would be unreasonable for that to be a blocker :P a couple more tyrions and pies and youre getting a lot of wasted time xD
evanjs has quit [Ping timeout: 268 seconds]
<pie__> crazy idea: just bootstrap nix with guix
<pie__> (yeah old but i hadnt seen it yet)
<samueldr> pie__: ^
<pie__> i scrolled down now hehe
<pie__> just sifting through 30 discourse tabs now to see what i want to read later...
<pie__> i keep forgetting how to write the installphase for stuff that doesnt use a build systen
<pie__> wrong chan
__monty__ has quit [Quit: leaving]
<adisbladis> aszlig: Ping?
<aszlig> adisbladis: pong
<adisbladis> aszlig: Are you planning to go to 36c3? I think you're usually part of organising the assembly?
<aszlig> adisbladis: i wasn't part of organising the assembly last year
<adisbladis> Ahh ok
<aszlig> but i'm planning to go, yes :-)
<adisbladis> I'm mainly asking because I'm thinking to email the orga and ask for vouchers
<adisbladis> But don't want to ask if someone else already did :)
<aszlig> adisbladis: maybe you could ask Mic92 about that, because regarding vouchers i guess i'll need one as well =)
<aszlig> but i usually lazy eval that
<adisbladis> cc makefu lassulus
<aszlig> ah, speaking of lazy eval, i need to get a nixcon ticket
<adisbladis> :D
<adisbladis> aszlig: Gah, I'll just email them
<aszlig> adisbladis: or /query Mic92?
<samueldr> :| lazy eval that's about right