119 Matching Annotations
  1. Dec 2020
    1. Several commands (RSET, DATA, QUIT) are specified as not permitting parameters.

      That is, they don't accept options, only data arguments. E.g., DATA's argument is the RFC 822 message format with headers and message body.

    2. The model for this is that distinct buffers are provided to hold the types of data objects; that is, there is a reverse-path buffer, a forward-path buffer, and a mail data buffer.

      !

    3. 2.3.1. Mail Objects SMTP transports a mail object. A mail object contains an envelope and content. The SMTP envelope is sent as a series of SMTP protocol units (described in Section 3). It consists of an originator address (to Klensin Standards Track [Page 11] RFC 5321 SMTP October 2008 which error reports should be directed), one or more recipient addresses, and optional protocol extension material

      The SMTP envelope is sent as a series of SMTP protocol units (described in Section 3). It consists of

      • an originator address (to which error reports should be directed),

      MAIL FROM that refers to the originator (a.k.a., reverse path, backward-pointing address) of the request

      • one or more recipient addresses,

      Multiple RCPT TO for each "to:" rfc822 message header in the mail data (see annotation)

      • and optional protocol extension material.

      DATA (see below)


      (See also envelope-vs-mail tags.)

    4. The third step in the procedure is the DATA command (or some alternative specified in a service extension). DATA <CRLF>

      Third part of the envelope: DATA.

    5. When the RFC 822 format ([28], [4]) is being used, the mail data include the header fields such as those named Date, Subject, To, Cc, and From.

      This just answered my question regarding the quote from "Postfix: The Definitive Guide":

      ENVELOPE ADDRESSES AND MESSAGE HEADERS A common source of confusion for email users is the fact that the To: address in email message headers has nothing to do with where a message is actually delivered. The envelope address controls message delivery. In practice, when you compose a message and provide your MUA with a To: address, your MUA uses that same address as the envelope destination address, but this is not required nor is it always the case. From the MTA’s point of view, message headers are part of the content of an email message. The delivery of a message is determined by the addresses specified during the SMTP conversation. These addresses are the envelope addresses , and they are the only thing that determine where messages go. See Section 2.2.8 later in the chapter for an explanation of the SMTP protocol.

      Mailing lists and spam are common examples of when the envelope destination address differs from the To: address of the message headers.

      Also an answer to this question.

    6. An SMTP-capable host SHOULD support both the alias and the list models of address expansion for multiple delivery. When a message is delivered or forwarded to each address of an expanded list form, the return address in the envelope ("MAIL FROM:") MUST be changed to be the address of a person or other entity who administers the list. However, in this case, the message header section (RFC 5322 [4]) MUST be left unchanged; in particular, the "From" field of the header section is unaffected.

      Another section that serves well to understand the difference between email data and SMTP envelope.

    7. To expand an alias, the recipient mailer simply replaces the pseudo- mailbox address in the envelope with each of the expanded addresses in turn; the rest of the envelope and the message body are left unchanged. The message is then delivered or forwarded to each expanded address.

      This annotation explains what this paragraph means and dispels my confusion regarding how 3mails with multiple recipients will get processed (also, SMTP envelope vs mail data).

      MS Outlook's "distribution list" is the same as an rfc5321 alias.

    8. The return (backward-pointing) address in the envelope is changed so that all error messages generated by the final deliveries will be returned to a list administrator, not to the message originator, who generally has no control over the contents of the list and will typically find error messages annoying.
      1. This the only difference between an SMTP alias and list; expanding recipients to RCPT commands is the same.
      1. Another great example to highlight the difference between SMTP envelope and mail data: the envelope's MAIL FROM (see annotation) is different from to the mail data's rfc822 From:.
    9. If the Klensin Standards Track [Page 19] RFC 5321 SMTP October 2008 recipient is known not to be a deliverable address, the SMTP server returns a 550 reply, typically with a string such as "no such user - " and the mailbox name (other circumstances and reply codes are possible).

      Will the entire transaction be canceled? "Transaction" in the name of this a section implies yes, but what if all the recipients are valid?

      See replies below but the answer is no; an RCPT command is specified for each recipient in the mail data, these RCPT commands will be evaluated in sequence,, and any SMTP (error) notifications will be sent to the address in the MAIL FROM command (which is not necessarily the same as the mail data's From: header).

    10. There exist mailing lists that perform additional, sometimes extensive, modifications to a message and its envelope. Such mailing lists need to be viewed as full MUAs, which accept a delivery and post a new message.

      I guess Mailman would qualify (e.g., Reply-to header munging)

    11. the reverse-path (originator) address specification command (MAIL)

      Sometimes "reverse path" or "originator" address is also referred to "backward-pointing" address (and those instances also refer to the MAIL command mostly).

    12. The second step in the procedure is the RCPT command. This step of the procedure can be repeated any number of times.

      This step of the procedure can be repeated any number of times. !

      So the section

      3.9.1. Alias

      To expand an alias, the recipient mailer simply replaces the pseudo-mailbox address in the envelope with each of the expanded addresses in turn; the rest of the envelope and the message body are left unchanged. The message is then delivered or forwarded to each expanded address.

      means that for each "to:" rfc822 message header in the mail data (i.e., SMTP envelope's DATA) a RCPT TO command will be added.

    13. An important mail facility is a mechanism for multi-destination delivery of a single message, by transforming (or "expanding" or "exploding") a pseudo-mailbox address into a list of destination mailbox addresses.

      So this section describes how distribution list addresses or mailing list addresses are expanded into individual email addresses of the members of those lists, and not how emails are delivered to multiple addresses when more than one recipient is specified in a MUA.

    14. 2yz
    15. However, in practice, some servers do not perform recipient verification until after the message text is received. These servers SHOULD treat a failure for one or more recipients as a "subsequent failure" and return a mail message as discussed in Section 6 and, in particular, in Section 6.1. Using a "550 mailbox not found" (or equivalent) reply code after the data are accepted makes it difficult or impossible for the client to determine which recipients failed.

      Seems relevant for the question above.

    16. If the verb is initially accepted and the 354 reply issued, the DATA command should fail only if the mail transaction was incomplete (for example, no recipients),

      How could this specific scenario be even possible? It just said in the previous paragraph that

      If there was no MAIL, or no RCPT, command, or all such commands were rejected, the server MAY return a "command out of sequence" (503) or "no valid recipients" (554) reply in response to the DATA command.

    17. 5yz

      This was unexpected; why wasn't the canonical format (i.e., 5xx) used instead?

    18. Since it has been a common source of errors, it is worth noting that spaces are not permitted on either side of the colon following FROM in the MAIL command or TO in the RCPT command. The syntax is exactly as given above.

      !

    19. Similarly, servers MAY decline to accept mail that is destined for other hosts or systems.

      For a personal mail server, this sounds like a reasonable advice to follow.

    20. An SMTP session is initiated when a client opens a connection to a server and the server responds with an opening message.

      Is SMTP stateless or stateful? See thread above.

    21. However, exploiting the case sensitivity of mailbox local-parts impedes interoperability and is discouraged.

      What does this mean? Then what is the point of preserving the case if one can't act on it?

    22. Verbs and argument values (e.g., "TO:" or "to:" in the RCPT command and extension name keywords) are not case sensitive, with the sole exception in this specification of a mailbox local-part (SMTP Extensions may explicitly specify case-sensitive elements). That is, a command verb, an argument value other than a mailbox local-part, and free form text MAY be encoded in upper case, lower case, or any mixture of upper and lower case with no impact on its meaning. The local-part of a mailbox MUST BE treated as case sensitive.

      The local-part of a mailbox MUST BE treated as case sensitive.

      Meaning that email addresses are case sensitive (the part before @, that is).

    23. The terms "message content" and "mail data" are used interchangeably in this document to describe the material transmitted after the DATA command is accepted and before the end of data indication is transmitted.

      The terms "message content" and "mail are used interchangeably

    24. RFC 3463 [25], specifies further structuring of the reply strings, including the use of supplemental and more specific completion codes (see also RFC 5248 [26]).

      To-do: look at the mentioned RFCs.

    25. SMTP sessions are stateful

      SMTP is stateless but SMTP sessions (just as HTTP/HTTPS sessions) are stateful.

    26. CNAME RR

      RR - resource record

    27. The means by which an SMTP client, once it has determined a target domain, determines the identity of an SMTP server to which a copy of a message is to be transferred, and then performs that transfer, is covered by this document. To effect a mail transfer to an SMTP server, an SMTP client establishes a two-way transmission channel to that SMTP server. An SMTP client determines the address of an appropriate host running an SMTP server by resolving a destination domain name to either an intermediate Mail eXchanger host or a final target host.

      What does "SMTP client" refer to in this context? A MUA?

    28. However, RFC 821 specifies some features that were not in significant use in the Internet by the mid-1990s and (in appendices) some additional transport models. Those sections are omitted here in the interest of clarity and brevity; readers needing them should refer to RFC 821.

      Important?

    1. CNAME A <domain-name> which specifies the canonical or primary name for the owner. The owner name is an alias.

      The second sentence ruins understanding this definition for me. Does this mean that CNAME is basically an alias, but it is the highest priority one (hence the designation "primary")?

  2. Nov 2020
    1. performs fully automated deployment. This is a good thing because it ensures that deployments are reproducible.It performs provisioning.

      What is the difference between provisioning and deployment?

    2. missing virtual machines

      Typo? Missing -> spinning

  3. Oct 2020
    1. HTTP CLIENT SERVICE START/STOP An HTTP client can be configured to start when starting the Inets application or started dynamically in runtime by calling the Inets application API inets:start(httpc, ServiceConfig) or inets:start(httpc, ServiceConfig, How), see inets(3). The configuration options are as follows: {profile, profile()} Name of the profile, see DATA TYPES. This option is mandatory. {data_dir, path()} Directory where the profile can save persistent data. If omitted, all cookies are treated as session cookies. The client can be stopped using inets:stop(httpc, Pid) or inets:stop(httpc, Profile).

      inets:start() will automatically start the httpc service also!

      https://stackoverflow.com/a/64212985/1498178

    2. profile() = atom()

      This should be profile() = default | atom() because the httpc service is automatically started with the default profile (called default) when inets is started.

      See also How to get more information about error when starting Inets httpd?

    1. The HTTP client default profile is started when the Inets application is started and is then available to all processes on that Erlang node.
  4. Aug 2020
    1. Commonly the above definition is called the identity function. But in fact we should think of it as a whole family of functions. We should really say that id is an identity function for all types a. In other words, for every type T you might come up with, there is an identity function called id, which is of type T -> T. This is the type-checker’s view anyway, and by turning on the RankNTypes extension we can be explicit about that in our code: {-# LANGUAGE RankNTypes #-} id :: forall a. a -> a id x = x

      This is such a nice description of forall. It should be combined with forall is the type-level "lambda" (also saved it here).

    2. Now it is much clearer that id is really a family of infinitely many functions. It is fair to say that it is an abstract function (as opposed to a concrete one), because its type abstracts over the type variable a. The common and proper mathematical wording is that the type is universally quantified (or often just quantified) over a.

      This was very neatly put, and forall above is also spot on.

    3. It also adds safety through a property called parametricity. If we pretend that there are no infinite loops or exceptions (it’s okay to do that, so we will do it throughout this article), then the function is actually fully determined by its type. In other words, if we see the type a -> a, we know that the corresponding value must be the identity function.

      If this would be the first time I came across parametricity, I wouldn't understand what it means.

      https://en.wikipedia.org/wiki/Parametricity

      In programming language theory, parametricity is an abstract uniformity property enjoyed by parametrically polymorphic functions, which captures the intuition that all instances of a polymorphic function act the same way.

      That is, a function with the type signature a -> a has only one implementation: it can only return its input. In a similar fashion, a -> b -> a will only return the first argument and ignore the second. And so on.

    4. In other words you cannot choose the definition of a value based on its type (for now).

      What does this mean?

    1. and so rows cannot exist as a value.

      From Turning a map of data constructors into a row type (purescript discourse):

      rows don’t have corresponding values, they only exist at the type level. If you do only purely want a row and not something like a Variant result you could return a proxy though.

    1. Quantified Types

      My main issue with this book is that the difficulty is exponentially increasing, and by "keeping it simple" (i.e., trying to use simple terms) it is even harder to do a proper research.

      For example:

      1. The name of this chapter

      This chapter should have been called Explicitly quantified type or Explicit universal quantification as it is too general as is, and doing a search to get to know more when someone has no formal/previous functional programming background, makes very hard.

      Most importantly though, even if Haskell not mentioned, the word "explicit" would have been important.

      It is also more about generic parameters than about quantification itself, and forall is kind of introduced but it is totally misleading.

      2. forall

      The post “forall” is the type-level “lambda” (saved) is the best, most succinct explanation of forall that I ever found. Unfortunately not before going down the rabbit hole.. (See links below.) One still needs to know about

      • typeclasses
      • generic parameters
      • constraints
      • what pragmas are but after that, it is straightforward.

      (Jordan's Reference section on forall also doesn't help much.)

      forall is also mandatory in PureScript (which is also not mentioned when introducing it), and I believe a comparison (the way the above post did) with Haskell is important, but at the right time. At least Jordan's Reference tries to put it off until later, but still before explaining concepts required to understand it.

      3. The "rabbit hole" links

      These are all good resources, but not for uninitiated mortals, and at a lower level (such as where I am now) they raise more questions than answers.

    1. # Build a developer-level executable file spago bundle-app --main Module.Path.To.Main --to dist/index.js node dist/index.js # Build a production-level Node-backend file via Parcel spago bundle-app --main Module.Path.To.Main --to dist/bundle-output.js parcel build dist/bundle-output.js --target "node" -o app.js

      These are the spago equivalents for pulp browserify I guess.

    2. spago build --watch --clear-screen

      Is this the same as pscid?

    1. builtins.attrValues set

      TODO: Is this the same as lib.attrsets.attrValues in nixpkgs?

    2. builtins.elem x xsReturn true if a value equal to x occurs in the list xs, and false otherwise.

      equalElem or eqElem would have been more fortunate. In this form I would believe that it does what builtins.elemAt does.

    3. baseNameOf sReturn the base name of the string s, that is, everything following the final slash in the string. This is similar to the GNU basename command.

      works both on strings and paths

    4. String Concatenation string1 + string2 leftString concatenation.
    1. 5.1.2.6. lib.attrsets.attrValuesattrValues :: AttrSet -> [Any]

      TODO Is this an alias to builtins.attrValues?

    2. type Option type, providing type-checking and value merging.

      This is vague to the point of being useless, given the Nix expression language is untyped.

      A snippet from freeswitch.nix:

            configTemplate = mkOption {
              type = types.path;
              # omitted
            };
            configDir = mkOption {
              type = with types; attrsOf path;
              # omitted
            };
      
      • Where does types come from?

        See NixOS manual at "Option types".

      • What is the difference between the path types? (I guess, the second one is attribute set consisting only of paths.)

    3. TODO: document lib.mkIf

      Found a description in the NixOS manual:

      The special function mkIf causes the evaluation of the conditional to be “pushed down” into the individual definitions, as if you had written:

      config = {
        environment.systemPackages = if
      config.services.httpd.enable then [ ... ] else [];
        ...
      };
      
    4. TODO: document lib.mkDefault

      Not mentioned in any of the manuals (i.e., nix, nixpkgs, NixOS), only the NixOS options page has 1 mention:

      Some promising search result (in the order of relevance):


      From source:

        mkOverride = priority: content:
          { _type = "override";
            inherit priority content;
          };
      
        mkDefault = mkOverride 1000; # used in config sections of non-user modules to set a default
      

      It seems that all the mkOverride calls set up a priority for certain actions.

    5. 5.1.7. NixOS / nixpkgs option handling

      What is an option?

      From the link below to the source, it's just an attribute set with all the function parameters (see below) plus a _type attribute name to allow for type level operations (because Nix is untyped).

        mkOption =
          {
          # Default value used when no definition is given in the configuration.
          default ? null,
          # Textual representation of the default, for the manual.
          defaultText ? null,
          # Example value used in the manual.
          example ? null,
          # String describing the option.
          description ? null,
          # Related packages used in the manual (see `genRelatedPackages` in ../nixos/lib/make-options-doc/default.nix).
          relatedPackages ? null,
          # Option type, providing type-checking and value merging.
          type ? null,
          # Function that converts the option value to something else.
          apply ? null,
          # Whether the option is for NixOS developers only.
          internal ? null,
          # Whether the option shows up in the manual.
          visible ? null,
          # Whether the option can be set only once
          readOnly ? null,
          # Deprecated, used by types.optionSet.
          options ? null
          } @ attrs:
          attrs // { _type = "option"; };
      

      How does it fit in a big scheme of things?

      ?

    6. 5.1.2.25. lib.attrsets.recursiveUpdateUntil

      If there is recursiveUpdateUntil (i.e., mergeUntil) then mergeWith would also be welcome.

    7. 5.1.2.26. lib.attrsets.recursiveUpdaterecursiveUpdate :: AttrSet -> AttrSet -> AttrSet

      Would be nice to have an alias called merge.

    8. String -> Any -> { name = String; value = Any }

      Fix: add semicolon after last Any. (same above in the main type signature)

    9. mapAttrsToList :: (String -> Any -> Any) -> AttrSet -> Any Located at lib/attrsets.nix:233 in <nixpkgs>. Call fn for each attribute in the given set and return the result in a list.

      So the type signature

      (String -> Any -> Any) -> AttrSet -> Any
                                           ^^^
      

      should be

      
      (String -> Any -> Any) -> AttrSet -> List
                                           ^^^^
      

      instead, right?

    10. 5.1.2.11. lib.attrsets.collectcollect :: (Any -> Bool) -> AttrSet -> [Any]
    11. 5.1.2.7. lib.attrsets.catAttrscatAttrs :: String -> [AttrSet] -> [Any] Located at lib/attrsets.nix:113 in <nixpkgs>. Collect each attribute named `attr' from the list of attribute sets, sets.

      Then why not call it collectVals?... (Following the distinctive naming convention between lib.attrsets.attrVals and lib.attrsets.attrValues.)

      Especially because there is lib.attrsets.collect:

      catAttrs :: String -> [AttrSet] -> [Any]
      collect :: (Any -> Bool) -> AttrSet -> [Any]
      

      (Call it filterVals? There are filterAttrs* functions but those return an attribute set, so no collision.)

    12. Attribute-Set

      This should read "Attribute Set Functions". Nowhere else is attribute sets spelled as "attribute-set".

      edit: Alright, "attribute-set" is used in total of 4 times, whereas "attribute set" is used 112 times.

    1. > (square: (x: y: square x + square y) 3 7) (x: x*x)58

      This can be written up in many other forms, plus the possibility of currying deserves to be pointed out:

      $ nix repl
      nix-repl> (sq: (x: y: sq y + sq x) 2 7) (x: x*x)
      53
      
      nix-repl> (sq: (x: y: sq y + sq x)) (x: x*x)     
      «lambda @ (string):1:11»
      
      nix-repl> (sq: (x: y: sq y + sq x)) (x: x*x) 2
      «lambda @ (string):1:14»
      
      nix-repl> (sq: (x: y: sq y + sq x)) (x: x*x) 2 7
      53
      
      nix-repl> (sq: x: y: sq y + sq x) (x: x*x) 2 7   
      53
      
  5. Jul 2020
    1. The keys will be copied to the heap for the process calling get/0, but the values will not.

      What does this mean?

    1. If the run-time dependencies were shared across all applications depending on the same rebar.config file,

      This sentence is straightforward but I only understood it just now.

      rebar.config can specify the dependencies of all the applications in the umbrella project, but they are not necessarily run-time dependencies. Also, the relx example from the rebar.config above shows how to include an app/lib (in this case, recon) in the final production release, even if it is not a run-time dependency.

      This guide also expands on it a paragraph below:

      The Rebar3 maintainers therefore just decided to keep a clear distinction between the applications that need fetching for the project to build or run (in rebar.config), and the run-time dependencies of each OTP application (in the .app file) which may be part of the default OTP install, and would therefore not be included in rebar.config. Other build tools in the ecosystem let you achieve similar results, but they default to including everything at run-time whereas Rebar3 asks of developers to always be specific in their intent.

    1. mark the workers as permanent or transient, so that if they fail they get restarted

      restart defines when a terminated child process must be restarted.

      • A permanent child process is always restarted.
      • A temporary child process is never restarted (even when the supervisor's restart strategy is rest_for_one or one_for_all and a sibling's death causes the temporary process to be terminated).
      • A transient child process is restarted only if it terminates abnormally, that is, with another exit reason than normal, shutdown, or {shutdown,Term}. https://erlang.org/doc/man/supervisor.html
    1. The most commonly supported tool for this is kerl. Kerl is a wrapper around downloading, compiling, and loading various Erlang/OTP versions on a single system, and will abstract away most annoying operations.
    1. prevent its disclosure to any person not authorized to create the subscriber's digital signature

      So the signature can be used by another entity to create the digital signature if authorized beforehand.

      So if there is a statement that "I authorize [organization] to create a cryptographic key-pair on my behalf, and create the digital signature."

  6. Jun 2020
    1. fetchgit Used with Git. Expects url to a Git repo, rev, and sha256. rev in this case can be full the git commit id (SHA1 hash) or a tag name like refs/tags/v1.0.

      Not only is there no fetchgit (the right one is fetchGit), but there is also no sha256 argument.

      Backtracking: Got to IRC log https://logs.nix.samueldr.com/nixos/2018-08-14 (save on archive.org), search for Unsupported argument 'sha256' to 'fetchGit' (or part of it), and an answer will point to:<br> https://github.com/NixOS/nix/blob/master/src/libexpr/primops/fetchGit.cc#L198-L215

      We are again back to trying things out on hearsay.


      In the home-manager NixOS wiki it also shows a ref argument to fetchGit but it is not documented anywhere. Yay. Anyway, it works without it too.

    1. Why is Nix written in C++ rather than a functional language like Haskell?[ ] Mainly because Nix is intended to be lightweight, easy to learn and portable (zero dependencies). Since 24. April 2017 thanks to Shea Levy and the crowdfunding of 54 community members, nix does not have Perl as dependency anymore.

      There is hnix that is still actively developed (as of 2020/06/21).

    1. Basic Install environment.systemPackages = with pkgs; [ vim ]; or environment.systemPackages = with pkgs; [ vim_configurable ];

      What is the difference between the vim and vim_configurable packages?

      I believe the source for the latter is here.

    1. The easiest way I've found to manage that is to copy hardware-configuration.nix and a minimal version of configuration.nix and import it into the NixOps config for the corresponding machine. (I keep them in a git submodule, but keeping them in the same repo could also make sense.) 1 Pick your reaction

      If I understood it correctly, take the hardware-configration.nix from the target machine, and put it into the NixOps config.

      Also relevant: Minimal NixOS config for Nixops deployment (discourse)

  7. docs.microsoft.com docs.microsoft.com
    1. az disk revoke-access Revoke a resource's read access to a managed disk.

      Here's why it's important to revoke access (rom Upload a VHD to Azure or copy a managed disk to another region - Azure PowerShell):

      After the upload is complete, and you no longer need to write any more data to the disk, revoke the SAS. Revoking the SAS will change the state of the managed disk and allow you to attach the disk to a VM.

    1. Install the latest version of NixOps. $ nix-env -i nixops

      ... or list it in environment.systemPackages in /etc/nixos/configuration.nix, and nixos-rebuild switch.

    1. extraUsers

      extraUsers have been renamed to users. See related commits.

    2. boot.initrd.luks.devices = [ { name = "root"; device = "/dev/nvme0n1p2"; preLVM = true; } ];

      This will still work on 20.03 but will show a warning as name = "root"; is deprecated, and luksroot should be used instead (see boot.initrd.luks.devices NixOS option) .

      boot.initd.luks.devices = {
        luksroot = {
          device = "/nev/sda2";
          preLVM = true;
        };
      };
      
    3. # cryptsetup luksFormat $LVM_PARTITION

      Got a warning here but it seems to be safe to ignore.

      WARNING: Locking directory /run/cryptsetup is missing!
      
    4. Networking

      This didn't work out of the box, therefore worth looking at the Arch linux wpa_supplicant docs.

      wpa_cli also wouldn't work, and needed to make sure that I had the right SSID so this link is also helpful to list available wifi networks.

    5. Note that from here on in we’ll be in root prompts the whole time. The NixOS install environment helpfully drops you in a shell with root logged in.

      On 20.03 install drops users to a non-privileged terminal so sudo su has to be entered to become root. (Otherwise the first steps in "Networking" will fail immediately.)

      Saving this here for posterity: https://stackoverflow.com/questions/55191125/cant-seem-to-get-sudo-working-under-nixos

  8. May 2020
    1. In OTP 22 we introduced the new experimental socket API. The idea behind this API is to have a stable intermediary API that can be used to create features that are not part of the higher-level gen_* APIs. We have now come one step further in our plan to replace the inet driver by making it possible to use the gen_tcp API with socket as an optional back-end. To make it easy to test with existing code using gen_tcp a new option {inet_backend, socket | inet} can be used to select the socket implementation instead of the default inet implementation.

      Q1: So inet and socket are competing socket implementations then?

      Q2: inets is higher level abstraction layer on top of inet? (Just as HTTP is higher level than transport protocols.)

      Q3 (corollary of Q1 and Q2): inets could be then rewritten to use socket instead? (And used just like gen_tcp with the inet_backend option?)

  9. Apr 2020
    1. hypermedia

      Hypertext is text which contains links to other texts. The term was coined by Ted Nelson around 1965 (see History ).

      HyperMedia is a term used for hypertext which is not constrained to be text: it can include graphics, video and sound , for example. Apparently Ted Nelson was the first to use this term too. https://www.w3.org/WhatIs.html

      Most Web navigation is done by clicking text-based links that open new pages in a Web browser. These links, which are often blue and underlined, are referred to as hypertext, since they allow the user to jump from page to page. Hypermedia is an extension of hypertext that allows images, movies, and Flash animations to be linked to other content.

      The most common type of hypermedia is an image link. Photos or graphics on the Web are often linked to other pages. For example, clicking a small "thumbnail" image may open a larger version of the picture in a new window. Clicking a promotional graphic may direct you to an advertiser's website. Flash animations and videos can also be turned into hyperlinks by embedding one or more links that appear during playback. https://techterms.com/definition/hypermedia

      See also hypermedia tags in hypothes.is

    1. If we refer to the CAP theorem, Mnesia sits on the CP side, rather than the AP side, meaning that it won't do eventual consistency, will react rather badly to netsplits in some cases, but will give you strong consistency guarantees if you expect the network to be reliable (and you sometimes shouldn't).

      We start out with the TL;DR treatise: The mnesia database is not CP, nor AP. And it cannot be CA, because CA doesn’t make any meaningful sense. In short, it is broken with respect to the CAP theorem. https://medium.com/@jlouis666/mnesia-and-cap-d2673a92850

    1. nix path-info shows information about store paths, replacing nix-store -q. A useful feature is the option --closure-size (-S). For example, the following command show the closure sizes of every path in the current NixOS system closure, sorted by size: nix path-info -rS /run/current-system | sort -nk2

      The Nixpkgs pull request template has a checkbox "Determined the impact on package closure size (by running nix path-info -S before and after)" but there is only 4 instances of path-info in the Nix manual (and none in the Nixpkgs manual).

      nix --help says

      path-info        query information about store paths
      

      so the command works at the bottom but what switches are available for example? From the examples, -r and -S is valid but where are they documented?

      nix path-info -rS $(readlink -f $(which vim))

    1. Applicative order versus normal order According to the description of evaluation given in 1.1.3, the interpreter first evaluates the operator and operands and then applies the resulting procedure to the resulting arguments. This is not the only way to perform evaluation. An alternative evaluation model would not evaluate the operands until their values were needed. Instead it would first substitute operand expressions for parameters until it obtained an expression involving only primitive operators, and would then perform the evaluation.

      Applicative-order and normal-order evaluation sound like synonyms to eager/strict versus _lazy_evaluation strategies respectively, but there are differences:

      The bottom line seems to be that

      • strict/eager = normal order
      • lazy ~= applicative BUT all terms are evaluated at most once
    1. recursion equations

      Does this refer to recurrence relations?

      Not much found for recursion equations, and those seem to suggest the two terms are interchangeable. However: Recurrence vs Recursive

      See wikipedia on recurrence relation also.

    1. Thus, programs must be written for people to read, and only incidentally for machines to execute.
    1. Each breakthrough in hardware technology leads to more massive programming enterprises, new organizational principles, and an enrichment of abstract models. Every reader should ask himself periodically “Toward what end, toward what end?”—but do not ask it too often lest you pass up the fun of programming for the constipation of bittersweet philosophy.
    2. The source of the exhilaration associated with computer programming is the continual unfolding within the mind and on the computer of mechanisms expressed as programs and the explosion of perception they generate. If art interprets our dreams, the computer executes them in the guise of programs!
    1. Origin servers SHOULD NOT fold multiple Set-Cookie header fields into a single header field. The usual mechanism for folding HTTP headers fields (i.e., as defined in [RFC2616]) might change the semantics of the Set-Cookie header field because the %x2C (",") character is used by Set-Cookie in a way that conflicts with such folding.

      "Fold" should be replaced with "combine" to make this paragraph consistent with the HTTP/1 specs (RFC 2616, RFC 7230).

      https://www.rfc-editor.org/errata/eid6093 https://stackoverflow.com/questions/3241326/

    1. api-version A query string parameter, indicating the API version for the IMDS endpoint. Please use API version 2018-02-01 or greater.

      Couldn't find where the exhaustive list of API versions are listed, but found this on the Azure Instance Metadata Service (aka IMDS) page:

      2017-04-02, 2017-08-01, 2017-12-01, 2018-02-01, 2018-04-02, 2018-10-01, 2019-02-01, 2019-03-11, 2019-04-30, 2019-06-01, 2019-06-04, 2019-08-01, 2019-08-15

      Also:

      The version 2019-11-01 is currently getting deployed and may not be available in all regions.

  10. Mar 2020
    1. Voltage is the pressure from an electrical circuit's power source that pushes charged electrons (current) through a conducting loop, enabling them to do work such as illuminating a light.

      This is by far the best explanation I found.

  11. Nov 2019
    1. name = "vim-with-plugins";

      How does one find what vim packages are available? (That nix vim-derivations/attributes, such as vimHugeX)

    2. { packageOverrides = pkgs: rec { foo = pkgs.foo.override { ... }; }; }

      Why is rec needed here, and not in the example under 2.6.1?

      Based on what I saw with other examples, rec is usually included when a_package.override is used inside packageOverrides. But why?

    1. 3. Deployment as Memory Management

      The entire chapter 3 is worth reading. Great resource on what a package (or more broadly, a component) is in regards to Nix.

      Specifically "3.1 What is a component?"

    1. packages

      There is no officially prescribed reading order of the Nix manuals, but it's safe to say that one should start this, the Nix manual. Then it would be prudent to briefly describe what a package is in the context of Nix and/or (at east) link to the definition.

      I like how Dolstra's thesis has an entire section on the topic (that is, on the more general concept of components).

    2. You can have multiple versions or variants of a package installed at the same time.

      It is clear now that there can be multiple versions of the same package in the store, but how does one call them (e.g., if is an executable application)? Simply by using the full Nix store path (and create and manage one's own symlinks, with stow or manually)??

    1. haskell-overridez is a tool and library of nix functions that simplify the use of overrides while developing haskell projects with nixpkgs.

  12. Oct 2019
    1. fixed-point

      "fixed-point", "fix point" seems to be most important concept in Nix, because overrides, overridePackages, overlays are built using it.

    2. Overlays
    3. buildEnv
    4. override

      First mention of the override attribute, so where is it coming from?

    5. stdenv.lib.licenses

      Find out where stdenv.lib functions are documented.

    6. builtins.elem

      builtins.elem x xs

      Return true if a value equal to x occurs in the list xs, and false otherwise.

    7. builtins.parseDrvName

      builtins.parseDrvName s

      Split the string s into a package name and version. The package name is everything up to but not including the first dash followed by a digit, and the version is everything following that dash. The result is returned in a set { name, version }. Thus, builtins.parseDrvName "nix-0.12pre12876" returns { name = "nix"; version = "0.12pre12876"; }.

    8. This option is a function which accepts a package as a parameter, and returns a boolean. The following example configuration accepts a package and always returns false: { allowUnfreePredicate = (pkg: false); }

      What is a package in this context? That is, the callback's pkg parameter. Is it a derivation?

      If I understood it correctly, whenever referencing other packages as inputs, those are actually derivations, that are just attribute sets.