Just a basic programmer living in California

  • 19 Posts
  • 394 Comments
Joined 2 年前
cake
Cake day: 2024年2月23日

help-circle

  • I like rofi for this use case, but it uses fuzzy search instead of labels. You might have to type more than one letter, depending on what windows you have open. OTOH if you know any part of the window title you can start typing immediately without having to scan a list for a label first.

    Labels work well for jumping to something you can already see, because the label appears where you are already looking, so you see it immediately. I’m guessing the process of finding the label for a window that is not visible would be clunkier - you’d have to find the label in a possibly long window list.



  • Out of sheer curiosity I checked. 18 USC § 921(a)(16) defines “antique firearm” for purposes of crimes and criminal procedure. The term “firearm” is defined in 18 USC § 921(a)(3), which includes the text, “Such term does not include an antique firearm.” (source)

    It’s perplexing because the “antique firearm” definition has numerous references to “firearm”. The (A) and (B) parts include or reference the text, “any firearm (including any firearm with a matchlock, flintlock, percussion cap, or similar type of ignition system) …”.

    So it looks like antique firearms are an instance of Russell’s Paradox. I guess a flintlock is not not a firearm. Paradox resolving powers must be one of those things you need law school for.








  • No, if something goes wrong with the VPN then the confined service will be unable to reach the internet. The setup runs the confined process in a network namespace that does not have a route to your default wifi or ethernet interfaces. If the VPN interface isn’t set up correctly, or stops working there is no other route out.

    You can test this with or without setting up VPN-Confinement. To do a quick test without any VPN setup, create a test service like this:

    systemd.services.test-unit = {
      serviceConfig = {
        NetworkNamespacePath = "/run/netns/test";
        Type = "oneshot";
      };
      script = ''
        ${pkgs.iputils}/bin/ping 1.1.1.1
      '';
    };
    

    Create a matching network namespace that doesn’t route anywhere:

    sudo ip netns add test
    

    Then set the unit running, and watch its output:

    sudo systemctl start test-unit.service
    journalctl -u test-unit.service -f
    

    You’ll see ping report that the network is unreachable. If you delete the namespace while ping is running it will continue to report that the network is unreachable.

    sudo ip netns del test
    

    (If you don’t want to bother with a systemd unit, you can run a process in a given network namespace using sudo ip netns exec <namespace> <command>. For example, sudo ip netns exec test ping 1.1.1.1.)

    If the namespace wasn’t set up for whatever reason the confined service won’t start. (See the edit on the post.)

    I also did some tests with the VPN-Confinement setup with this test unit:

    systemd.services.test-unit = {
      serviceConfig = {
        Type = "oneshot";
      };
      script = ''
        while true; do
          ${pkgs.curl}/bin/curl https://am.i.mullvad.net/connected
          sleep 5
        done
      '';
      vpnConfinement = {
        enable = true;
        inherit vpnNamespace;
      };
    };
    

    If I set vpnNamespace to a name that doesn’t match a configured vpnNamespace then the service won’t start.

    If I bring down the VPN namespace while that curl loop is running with sudo systemctl stop wg.service then test-unit also stops, because of the systemd dependencies that systemd.services.<name>.vpnConfinement sets up.

    If I bring down the network namespace manually while the curl loop is running with sudo ip netns del wg then the curl loop keeps running, and continues to report that it is connected to Mullvad. I guess the network namespace continues to exist while a running process is using it.

    If I bring down the VPN network interface with sudo ip -n wg link set dev wg0 down then curl fails with status=6/NOTCONFIGURED


  • Good question! I think this is distinct from split tunneling, but does a similar thing. But I’m not an expert - I don’t know how precise or broad the definitions are, so I’m not positive the concepts don’t overlap.

    From some brief reading it looks like split tunneling is set up by configuring routing to determine which traffic goes through the VPN based on destination IP addresses. OTOH what I’m calling confinement determines VPN use based on which process sends traffic. So with confinement all traffic from select processes, regardless of destination, goes through the VPN.

    I think there are differences in how inbound traffic works too. With confinement inbound traffic can only reach confined processes.











  • Also the Social Security Administration, despite being a huge operation, runs with less than 1% overhead. And they get those checks out month after month. Medicare’s overhead is under 2%, compared to an average of 12% for private insurance, and polls seem to show people are more satisfied with Medicare than with private insurance.

    I know the complaint that government is ineffective and inefficient is a classic - but it makes me wonder what programs that refers to? Maybe something in the Defense Department?