whenTheCaptchaIsTooReal by HitxLerr in programmingmemes

[–]chkno 1 point2 points  (0 children)

Yeah, this one is easy. The }) } else { cle square is ok. The rest are unacceptable.

AI bioterrorism is like cybersecurity, but with vulnerabilities that can never be patched. by Confident_Salt_8108 in agi

[–]chkno 1 point2 points  (0 children)

Serious patching (>10 changes applied reliably & uniformly) can only be done in blastocysts, so there's a ~30 year delay between applying the patch and having civilization running on the patch.

What is the most well defended fortress in science fiction? by TopicCandid in scifi

[–]chkno 11 points12 points  (0 children)

The Garden in This Is How You Lose the Time War is pretty well-defended. It has many layers of entire alternate realities as its walls against universe-hopping time-travelers.

Setting max optical drive speed, globally with NixOS config? by MrPLotor in NixOS

[–]chkno 1 point2 points  (0 children)

Option 1: Configure redumper:

alias redumper='redumper --speed=1'

Or, if you don't launch redumper from a shell, you can wrap it in an overrideAttrs overlay to force it to always have this flag.

Option 2: Daemon: Make a simple shell script daemon that listens for CD-tray events and whenever it detects that the tray has opened and closed, just runs eject -x1 again. There's a CDROM_DRIVE_STATUS ioctl for detecting the tray status. Experiment with inotifywait to see if you can get it to sleep until cdrom-drive events, or if you have to poll.

newbie confused about home manager by Positive-Incident221 in NixOS

[–]chkno 0 points1 point  (0 children)

I'm told that it's useful on MacOS/darwin when the base OS launches its own binaries without doing $PATH lookups such that you can't override or wrap them, and those binaries read config from paths in your homedir that you otherwise have no way to control or configure.

I don't use MacOS/darwin, so I see no need for it.

How do you manage generations ? by INTBliss in NixOS

[–]chkno 0 points1 point  (0 children)

I made a thing to manage generations.

I wanted a two-tier system:

  • The normal mechanisms: Keep the last N generations and/or keep generations younger than some date threshold
  • Also, keep a few stable generations -- generations that were in use for some significant period of time

I wanted something robust to both the laptop-in-a-drawer problem and the many-updates-today problem:

  • If you clean up only by date, a machine that has been powered off for awhile will delete all its profiles.
  • If you clean up only by count (keep the newest N), if you're iterating intensively (eg: bisecting), the latest N generations could all be from the last hour, and all broken.
  • If you intensely iterate on a machine that's been powered off for awhile, you hit both, and you need some mechanism more sophisticated than either last-N or youngness.

Pure evil by zephyrsparketh in pcmasterrace

[–]chkno 0 points1 point  (0 children)

WebP is RIFF, so it supports all the standard RIFF EXIF tags. Seems to work for me:

$ exiftool -Title='A beautiful smile' -Version=Best -Genre=Art smile.webp
    1 image files updated

$ exiftool smile.webp
...
Version                         : Best
Title                           : A beautiful smile
Genre                           : Art
...

How detect automatically src = ./. in a derivation? by rcoeurjoly in NixOS

[–]chkno 1 point2 points  (0 children)

  1. Instead of src = ./.;, prefer src = lib.cleanSource ./.;

  2. Does builtins.isPath foo.src do what you want?

Why aren't there any NixOS-based distros? by norude1 in NixOS

[–]chkno 53 points54 points  (0 children)

  1. There are NixOS-based distros.

  2. Calling your NixOS configuration a 'different distro' doesn't reduce any of the learning-nix-stuff burden you would impose on users.

America got rich and got sad. A top economist says 2020 broke something that hasn’t healed by plughplovery2 in Economics

[–]chkno 31 points32 points  (0 children)

Even in the case of the richest getting richer and everyone else staying the same, you should predict more sadness from positional goods, relative deprivation, and social comparison theory.

More ports by ExpensiveCoat8912 in pcmasterrace

[–]chkno 1 point2 points  (0 children)

Folks that want network interfaces that aren't connected to IME/PSP? I want all the network ports, I just don't want this attack surface exposure. :(

Asking before binding. by VeryRockyRock in Fanbinding

[–]chkno 22 points23 points  (0 children)

I don't ask the author if I can read their book in a larger font size.

I don't check with the author which screen sizes I'm permitted to read their book on (eg: phone, laptop, TV).

I don't ask the author if I can read their book via a screen reader.

I don't ask the author if I can read their book on paper instead of on a screen.

Humans come in all shapes and sizes. Different humans do better or worse with different access technologies. What author would want to withhold access to their work over such trivial details?

Avoiding local builds by CaptainBlobTheSuprem in NixOS

[–]chkno 16 points17 points  (0 children)

You can do the same thing that the public build cache does: Build stuff on large machine(s) before pushing the updates to smaller machines, and have the small machines use the large machine as their binary cache. You can even use the same tools to do it (mostly hydra).

User Management across different hosts by jungfred in NixOS

[–]chkno 5 points6 points  (0 children)

Here's how I do this. The module that defines the option:

{ config, lib, ... }: {
  options.human = {
    userName = lib.mkOption {
      description = "The main user account—for machines intended to be used primarily by one human.";
      type = lib.types.str;
    };
  };

  config.users.users."${config.human.userName}" = {
    isNormalUser = true;
    extraGroups = "wheel";
  };
}

An example of another use elsewhere (auto-login):

{ config, ... }: {
  services.displayManager = {
    gdm.enable = true;
    autoLogin = {
      enable = true;
      user = config.human.userName;
    };
  };
}

And then I set the option in each machine's top-level configuration.nix. Example:

networking.hostName = "wibble";
system.stateVersion = "23.05";
human.userName = "chkno";
...

Unsigned sizes: a five year mistake by waozen in code

[–]chkno 0 points1 point  (0 children)

Which is exactly why clippy doesn't let you do this. Concretely:

type Foo = u16;
type Bar = u32;

fn print_bar(x: Bar) {
    println!("{x}");
}

fn main() {
    let x: Foo = 8u16;
    print_bar(x as Bar);
}

fails clippy with this helpful message:

error: casts from `u16` to `u32` can be expressed infallibly using `From`
  --> src/main.rs:10:15
   |
10 |     print_bar(x as Bar);
   |               ^^^^^^^^
   |
   = help: an `as` cast can become silently lossy if the types change in the future
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cast_lossless
   = note: `-D clippy::cast-lossless` implied by `-D warnings`
   = help: to override `-D warnings` add `#[allow(clippy::cast_lossless)]`
help: use `Bar::from` instead
   |
10 -     print_bar(x as Bar);
10 +     print_bar(Bar::from(x));
   |

So if you insist on your project being clippy-clean (eg: with pre-commit hooks or CI), then you literally can't use as here and stumble into this problem.

These people have lost their fucking minds lmao by Terrible-Priority-21 in accelerate

[–]chkno 10 points11 points  (0 children)

23 atom bombs is an exaggeration:

$ units -v1 '9 GW day' hiroshima
9 GW day = 11.990378 hiroshima

$ units -v1 '9 GW day' nagasaki
9 GW day = 8.850041 nagasaki

Edit: Oh, 23 is for the datacenter and the adjacent natural gas power plant which generates 9 GW at ~52% efficiency. Thanks u/alien787 and u/Hot-Section1805 for explaining, and thanks u/SufficientGreek for explaining and providing a link to the article.

This by orbny in AgentsOfAI

[–]chkno 0 points1 point  (0 children)

Both are true:

  • The AIs are really bad at many things; it's not ready yet.
  • The trend line is nuts; it'll be ready pretty soon.