diff --git a/content/posts/nixos-easy-host.md b/content/posts/nixos-easy-host.md new file mode 100644 index 0000000..0e37cfd --- /dev/null +++ b/content/posts/nixos-easy-host.md @@ -0,0 +1,80 @@ ++++ +title = "Running non Nixpkgs services on NixOS, the lazy way" +date = 2025-03-20T14:09:14+01:00 +draft = true ++++ + +NixOS is really nice for self hosting. +Anything that has a NixOS module can be hosted in a few lines of nix code. +But what if the service we want to host doesn't come with a NixOS module written for us already in Nixpkgs? +This is where NixOS can be a little hard, as a guide on setting up a service in Debian or Arch will rarely work on NixOS. +Of course, the 'nix way' would be to write your own package and module for it, but that can be a daunting task. +Here are some 'escape hatches' to host some of the simpler services without having to write your own Nix package or module. + +## Nginx + +If the application is a simple static website, containing just HTML and JS, +the `nginx` module on NixOS provides us with a way to manage virtual hosts complete with https. +Shown is how I host my Hugo generated blog. + +```nix +{ config, ... }: { + services.nginx.virtualHosts."gabevenberg.com" = { + enableACME = true; + forceSSL = true; + root = "/var/www/gabevenberg.com"; + }; + security.acme = { + acceptTerms = true; + defaults.email = "myname@example.com"; + }; + networking.firewall.allowedTCPPorts = [443 80]; +} +``` +The complete list of options for virtual hosts can be found [here](https://nixos.org/manual/nixos/stable/options#opt-services.nginx.virtualHosts) + +## Docker +If the service publishes a Docker image, one can just run that on NixOS. +Here's how I host a game server using a premade docker container. +Things get a bit more complicated with docker-compose, +but one can use [compose2nix](https://github.com/aksiksi/compose2nix) to translate a docker-compose.yaml file into a nix file much like the one shown. +```nix +{ config, ... }: { + virtualisation.oci-containers = { + backend = "docker"; + containers.factorio = { + image = "factoriotools/factorio:stable"; + volumes = ["/storage/factorio:/factorio"]; + hostname = "factorio"; + ports = ["34197:34197/tcp"]; + environment = {UPDATE_MODS_ON_START = "true";}; + }; + }; + virtualisation.docker.enable = true; +} +``` + +There are, of course, more options for the oci-containers module, found [here](https://nixos.org/manual/nixos/stable/options#opt-virtualisation.oci-containers.containers) + +## Systemd + +Finally, if the service is composed of a single static binary, NixOS makes it really easy to write Systemd services. +(I've used a package in Nixpkgs here, +but you could just as easily point the Systemd service to a binary you threw in `/opt/` or somewhere.) + +```nix +{ config, ... }: { + systemd.services.miniserve = { + wantedBy = ["multi-user.target"]; + after = ["network.target"]; + description = "A directory miniserve instance"; + environment = {MINISERVE_ENABLE_TAR_GZ="true";} + serviceConfig.ExecStart = "${pkgs.miniserve}/bin/miniserve -i 127.0.0.1 -- /storage/miniserve" + }; +} + +``` +And like the last 2 times, the complete list of options for Systemd service can be found [here](https://nixos.org/manual/nixos/stable/options.html#opt-systemd.services) + + +*(This article was originally published in issue #6 of the [Paged Out!](https://pagedout.institute/) magazine.)* diff --git a/content/posts/stop-using-TRRS/4C4P.jpg b/content/posts/stop-using-TRRS/4C4P.jpg new file mode 100644 index 0000000..b37c99c Binary files /dev/null and b/content/posts/stop-using-TRRS/4C4P.jpg differ diff --git a/content/posts/stop-using-TRRS/index.md b/content/posts/stop-using-TRRS/index.md new file mode 100644 index 0000000..62955d4 --- /dev/null +++ b/content/posts/stop-using-TRRS/index.md @@ -0,0 +1,62 @@ ++++ +title = "Stop Using TRRS for Split-Keyboard Interconnects!" +date = 2025-03-20T14:10:01+01:00 +draft = true ++++ + + +TRRS (Tip Ring Ring Sleeve, or, as you may know it, "headphone jack with microphone support") cables have long been the go to connector between split keyboard halves. +They are cheap, compact, and thanks to their popularity, come in a variety of aesthetic styles. + +However, TRRS jacks were only designed for passive electrical components, and expose one large flaw when used actively. +When a TRRS cable is (dis)connected, the tip of the plug will slide past every single contact of the jack. +Likewise, the first contact of the jack will slide past every contact of the plug. + +To illustrate this, let us consider a TRRS setup where 5v is applied to the tip. +In this example, assume this plug is on the passive side of the board, receiving power from the active side plugged into USB. +When fully plugged in @5v_plugged_in, everything is connected properly. +However, when pulled out, 5v immediately makes contact with the TX line @5v_partial_plug. + + +5v tip TRRS fully plugged in + + +A 5v tip TRRS starting to be pulled out. Notice the short between 5v and Tx + +When the 5v Aurdino Pro Micro dominated as a keyboard MCU, a brief short between 5v and Tx/Rx may have been acceptable. +However, due to the emergence of RP2040 powered drop in replacements for the Pro Micro, such as the Elite-pi or KB2040, +3.3v logic levels are now commonplace among keyboards. +Thus, shorting the 5v power line with a logic pin is a surefire way to burn out at least a GPIO, if not your whole MCU. + +Now, what if we put the 5v at the base, so that it is the first pin disconnected? + + +A GND tip TRRS fully plugged in + + +A GND tip TRRS starting to be pulled out. Notice the short between 5v and Rx. + +In this case, we are looking at the active side of the board, connected to USB, and supplying power to the passive side. +Now, when unplugged the 5v contact of the jack will immediately make contact with the Rx line, +pulling it up to 5v and damaging the pin on the passive side of the board. + +No matter what order we put the contacts in, +one end of the TRRS cable will be unsafe to unplug while powered. +No other electronics found in your home suffer permanent damage from simply being unplugged in the wrong order. +In a moment of carelessness or forgetfulness, damage to hardware could easily happen. + +So what are the alternatives? +USB-C, while almost as small as TRRS, are more expensive component wise and and +having the same connector for board-to-board and PC-to-board connections may lead to user error. +There are also a wide variety of JST and Molex connectors, some of which rival TRRS in size, +but premade cables are not readily available, +and many connectors have a tendency to work themselves loose over time. +My personal favorite are 4P4C connectors, also known as RJ9, RJ10, or RJ22. +While bulky on the PCB, the connection is sturdy, cables are availible, and one can make ones own cables with a cheap crimping tool. +{{<figure src="./4C4P.jpg" title="A 4C4P connector (Wikimedia, CC-BY-SA 3.0)" width="50%">}} +There are of course other connectors, and any with at least 4 conductors will work for a split keyboard. +Unfortunately, there does not seem to be a perfect connector, but there are many alternatives better than TRRS. + +*This article is dedicated to the late pin D26 of Jonathan's Ferris Sweep. He is forever grateful that the Elite-pi has extra GPIOs.* + +*(This article was originally published in issue #6 of the [Paged Out!](https://pagedout.institute/) magazine.)* diff --git a/content/posts/stop-using-TRRS/trrs_fully_plugged_in_5v_sleeve.svg b/content/posts/stop-using-TRRS/trrs_fully_plugged_in_5v_sleeve.svg new file mode 100644 index 0000000..b2528b2 --- /dev/null +++ b/content/posts/stop-using-TRRS/trrs_fully_plugged_in_5v_sleeve.svg @@ -0,0 +1,160 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- Created with Inkscape (http://www.inkscape.org/) --> + +<svg + height="50mm" + viewBox="-10 0 55.307693 20.299997" + version="1.1" + style="background-color:white" + id="svg1" + xmlns="http://www.w3.org/2000/svg" + xmlns:svg="http://www.w3.org/2000/svg"> + <defs + id="defs1" /> + <g + id="layer1" + transform="translate(-46.842306,-23.849998)"> + <g + id="g8" + transform="translate(36.999998,4.0000007)"> + <rect + style="fill:#3f40a8;fill-opacity:0;stroke:#000000;stroke-width:0.3" + id="rect5" + width="45.000004" + height="19.999996" + x="10" + y="19.999996" /> + <text + xml:space="preserve" + style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:3.21421px;font-family:'Libertinus Sans';-inkscape-font-specification:'Libertinus Sans, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-east-asian:normal;text-align:start;writing-mode:lr-tb;direction:ltr;text-anchor:start;fill:#3f40a8;fill-opacity:0;stroke:#000000;stroke-width:0.315385;stroke-dasharray:none" + x="13.470504" + y="39.411469" + id="text1-6"><tspan + id="tspan1-1" + style="stroke-width:0.315385;stroke-dasharray:none" + x="13.470504" + y="39.411469">5v</tspan></text> + <text + xml:space="preserve" + style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:3.21421px;font-family:'Libertinus Sans';-inkscape-font-specification:'Libertinus Sans, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-east-asian:normal;text-align:start;writing-mode:lr-tb;direction:ltr;text-anchor:start;fill:#3f40a8;fill-opacity:0;stroke:#000000;stroke-width:0.315385;stroke-dasharray:none" + x="23.084501" + y="39.490215" + id="text2-0"><tspan + id="tspan2-6" + style="stroke-width:0.315385;stroke-dasharray:none" + x="23.084501" + y="39.490215">Rx</tspan></text> + <text + xml:space="preserve" + style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:3.21421px;font-family:'Libertinus Sans';-inkscape-font-specification:'Libertinus Sans, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-east-asian:normal;text-align:start;writing-mode:lr-tb;direction:ltr;text-anchor:start;fill:#3f40a8;fill-opacity:0;stroke:#000000;stroke-width:0.315385;stroke-dasharray:none" + x="33.251343" + y="39.483784" + id="text3-3"><tspan + id="tspan3-2" + style="stroke-width:0.315385;stroke-dasharray:none" + x="33.251343" + y="39.483784">Tx</tspan></text> + <text + xml:space="preserve" + style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:3.21421px;font-family:'Libertinus Sans';-inkscape-font-specification:'Libertinus Sans, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-east-asian:normal;text-align:start;writing-mode:lr-tb;direction:ltr;text-anchor:start;fill:#3f40a8;fill-opacity:0;stroke:#000000;stroke-width:0.315385;stroke-dasharray:none" + x="41.831974" + y="39.552891" + id="text4-0"><tspan + id="tspan4-6" + style="stroke-width:0.315385;stroke-dasharray:none" + x="41.831974" + y="39.552891">Gnd</tspan></text> + <path + style="fill:#3f40a8;fill-opacity:0;stroke:#000000;stroke-width:0.3;stroke-dasharray:none" + d="M 20,19.999997 V 39.999994" + id="path6" /> + <path + style="fill:#3f40a8;fill-opacity:0;stroke:#000000;stroke-width:0.3;stroke-dasharray:none" + d="M 30,19.999997 V 39.999994" + id="path7" /> + <path + style="fill:#3f40a8;fill-opacity:0;stroke:#000000;stroke-width:0.3;stroke-dasharray:none" + d="M 40.000002,19.999997 V 39.999994" + id="path8" /> + </g> + </g> + <g + id="layer2" + transform="translate(-46.842306,-23.849998)"> + <g + id="g6" + style="stroke-width:0.3;stroke-dasharray:none" + transform="matrix(1.0512821,0,0,1.0512821,36.48718,2.7179467)"> + <g + id="g5" + style="stroke-width:0.3;stroke-dasharray:none"> + <path + style="fill:#3f40a8;fill-opacity:0;stroke:#000000;stroke-width:0.3;stroke-dasharray:none" + d="m 10,24.999996 h 28.536586 c 0,0 3.804879,1.902439 3.804879,1.902439 l 5.707315,-1.902439 1.902442,3.804878 v 1.902438 L 48.04878,34.51219 42.341465,32.609751 38.536586,34.51219 H 10 Z" + id="path1" /> + <path + style="fill:#3f40a8;fill-opacity:0;stroke:#000000;stroke-width:0.3;stroke-dasharray:none" + d="M 19.512195,24.999996 V 34.51219" + id="path2" /> + <path + style="fill:#3f40a8;fill-opacity:0;stroke:#000000;stroke-width:0.3;stroke-dasharray:none" + d="M 29.024391,24.999996 V 34.51219" + id="path3" /> + <path + style="fill:#3f40a8;fill-opacity:0;stroke:#000000;stroke-width:0.3;stroke-dasharray:none" + d="M 38.536586,24.999996 V 34.51219" + id="path4" /> + </g> + <text + xml:space="preserve" + style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:3.05742px;font-family:'Libertinus Sans';-inkscape-font-specification:'Libertinus Sans, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-east-asian:normal;text-align:start;writing-mode:lr-tb;direction:ltr;text-anchor:start;fill:#3f40a8;fill-opacity:0;stroke:#000000;stroke-width:0.3;stroke-dasharray:none" + x="13.616014" + y="30.651678" + id="text1"><tspan + id="tspan1" + style="stroke-width:0.3;stroke-dasharray:none" + x="13.616014" + y="30.651678">5v</tspan></text> + <text + xml:space="preserve" + style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:3.05742px;font-family:'Libertinus Sans';-inkscape-font-specification:'Libertinus Sans, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-east-asian:normal;text-align:start;writing-mode:lr-tb;direction:ltr;text-anchor:start;fill:#3f40a8;fill-opacity:0;stroke:#000000;stroke-width:0.3;stroke-dasharray:none" + x="22.761036" + y="30.726585" + id="text2"><tspan + id="tspan2" + style="stroke-width:0.3;stroke-dasharray:none" + x="22.761036" + y="30.726585">Rx</tspan></text> + <text + xml:space="preserve" + style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:3.05742px;font-family:'Libertinus Sans';-inkscape-font-specification:'Libertinus Sans, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-east-asian:normal;text-align:start;writing-mode:lr-tb;direction:ltr;text-anchor:start;fill:#3f40a8;fill-opacity:0;stroke:#000000;stroke-width:0.3;stroke-dasharray:none" + x="32.431934" + y="30.72047" + id="text3"><tspan + id="tspan3" + style="stroke-width:0.3;stroke-dasharray:none" + x="32.431934" + y="30.72047">Tx</tspan></text> + <text + xml:space="preserve" + style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:3.05742px;font-family:'Libertinus Sans';-inkscape-font-specification:'Libertinus Sans, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-east-asian:normal;text-align:start;writing-mode:lr-tb;direction:ltr;text-anchor:start;fill:#3f40a8;fill-opacity:0;stroke:#000000;stroke-width:0.3;stroke-dasharray:none" + x="40.593998" + y="30.786205" + id="text4"><tspan + id="tspan4" + style="stroke-width:0.3;stroke-dasharray:none" + x="40.593998" + y="30.786205">Gnd</tspan></text> + <text + xml:space="preserve" + style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:2.82223px;font-family:'Libertinus Sans';-inkscape-font-specification:'Libertinus Sans, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-east-asian:normal;text-align:start;writing-mode:lr-tb;direction:ltr;text-anchor:start;fill:#3f40a8;fill-opacity:0;stroke:#000000;stroke-width:0.3;stroke-dasharray:none" + x="23.552603" + y="9.9999981" + id="text5"><tspan + id="tspan5" + style="stroke-width:0.3;stroke-dasharray:none" + x="23.552603" + y="9.9999981" /></text> + </g> + </g> +</svg> diff --git a/content/posts/stop-using-TRRS/trrs_fully_plugged_in_5v_tip.svg b/content/posts/stop-using-TRRS/trrs_fully_plugged_in_5v_tip.svg new file mode 100644 index 0000000..581208d --- /dev/null +++ b/content/posts/stop-using-TRRS/trrs_fully_plugged_in_5v_tip.svg @@ -0,0 +1,160 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- Created with Inkscape (http://www.inkscape.org/) --> + +<svg + height="50mm" + viewBox="-10 0 55.307693 20.299997" + version="1.1" + style="background-color:white" + id="svg1" + xmlns="http://www.w3.org/2000/svg" + xmlns:svg="http://www.w3.org/2000/svg"> + <defs + id="defs1" /> + <g + id="layer1" + transform="translate(-46.842306,-23.849998)"> + <g + id="g8" + transform="translate(36.999998,4.0000007)"> + <rect + style="fill:#3f40a8;fill-opacity:0;stroke:#000000;stroke-width:0.3" + id="rect5" + width="45.000004" + height="19.999996" + x="10" + y="19.999996" /> + <text + xml:space="preserve" + style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:3.21421px;font-family:'Libertinus Sans';-inkscape-font-specification:'Libertinus Sans, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-east-asian:normal;text-align:start;writing-mode:lr-tb;direction:ltr;text-anchor:start;fill:#3f40a8;fill-opacity:0;stroke:#000000;stroke-width:0.315385;stroke-dasharray:none" + x="13.470504" + y="39.411469" + id="text1-6"><tspan + id="tspan1-1" + style="stroke-width:0.315385;stroke-dasharray:none" + x="13.470504" + y="39.411469">Gnd</tspan></text> + <text + xml:space="preserve" + style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:3.21421px;font-family:'Libertinus Sans';-inkscape-font-specification:'Libertinus Sans, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-east-asian:normal;text-align:start;writing-mode:lr-tb;direction:ltr;text-anchor:start;fill:#3f40a8;fill-opacity:0;stroke:#000000;stroke-width:0.315385;stroke-dasharray:none" + x="23.084501" + y="39.490215" + id="text2-0"><tspan + id="tspan2-6" + style="stroke-width:0.315385;stroke-dasharray:none" + x="23.084501" + y="39.490215">Rx</tspan></text> + <text + xml:space="preserve" + style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:3.21421px;font-family:'Libertinus Sans';-inkscape-font-specification:'Libertinus Sans, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-east-asian:normal;text-align:start;writing-mode:lr-tb;direction:ltr;text-anchor:start;fill:#3f40a8;fill-opacity:0;stroke:#000000;stroke-width:0.315385;stroke-dasharray:none" + x="33.251343" + y="39.483784" + id="text3-3"><tspan + id="tspan3-2" + style="stroke-width:0.315385;stroke-dasharray:none" + x="33.251343" + y="39.483784">Tx</tspan></text> + <text + xml:space="preserve" + style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:3.21421px;font-family:'Libertinus Sans';-inkscape-font-specification:'Libertinus Sans, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-east-asian:normal;text-align:start;writing-mode:lr-tb;direction:ltr;text-anchor:start;fill:#3f40a8;fill-opacity:0;stroke:#000000;stroke-width:0.315385;stroke-dasharray:none" + x="41.831974" + y="39.552891" + id="text4-0"><tspan + id="tspan4-6" + style="stroke-width:0.315385;stroke-dasharray:none" + x="41.831974" + y="39.552891">5v</tspan></text> + <path + style="fill:#3f40a8;fill-opacity:0;stroke:#000000;stroke-width:0.3;stroke-dasharray:none" + d="M 20,19.999997 V 39.999994" + id="path6" /> + <path + style="fill:#3f40a8;fill-opacity:0;stroke:#000000;stroke-width:0.3;stroke-dasharray:none" + d="M 30,19.999997 V 39.999994" + id="path7" /> + <path + style="fill:#3f40a8;fill-opacity:0;stroke:#000000;stroke-width:0.3;stroke-dasharray:none" + d="M 40.000002,19.999997 V 39.999994" + id="path8" /> + </g> + </g> + <g + id="layer2" + transform="translate(-46.842306,-23.849998)"> + <g + id="g6" + style="stroke-width:0.3;stroke-dasharray:none" + transform="matrix(1.0512821,0,0,1.0512821,36.48718,2.7179467)"> + <g + id="g5" + style="stroke-width:0.3;stroke-dasharray:none"> + <path + style="fill:#3f40a8;fill-opacity:0;stroke:#000000;stroke-width:0.3;stroke-dasharray:none" + d="m 10,24.999996 h 28.536586 c 0,0 3.804879,1.902439 3.804879,1.902439 l 5.707315,-1.902439 1.902442,3.804878 v 1.902438 L 48.04878,34.51219 42.341465,32.609751 38.536586,34.51219 H 10 Z" + id="path1" /> + <path + style="fill:#3f40a8;fill-opacity:0;stroke:#000000;stroke-width:0.3;stroke-dasharray:none" + d="M 19.512195,24.999996 V 34.51219" + id="path2" /> + <path + style="fill:#3f40a8;fill-opacity:0;stroke:#000000;stroke-width:0.3;stroke-dasharray:none" + d="M 29.024391,24.999996 V 34.51219" + id="path3" /> + <path + style="fill:#3f40a8;fill-opacity:0;stroke:#000000;stroke-width:0.3;stroke-dasharray:none" + d="M 38.536586,24.999996 V 34.51219" + id="path4" /> + </g> + <text + xml:space="preserve" + style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:3.05742px;font-family:'Libertinus Sans';-inkscape-font-specification:'Libertinus Sans, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-east-asian:normal;text-align:start;writing-mode:lr-tb;direction:ltr;text-anchor:start;fill:#3f40a8;fill-opacity:0;stroke:#000000;stroke-width:0.3;stroke-dasharray:none" + x="13.616014" + y="30.651678" + id="text1"><tspan + id="tspan1" + style="stroke-width:0.3;stroke-dasharray:none" + x="13.616014" + y="30.651678">Gnd</tspan></text> + <text + xml:space="preserve" + style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:3.05742px;font-family:'Libertinus Sans';-inkscape-font-specification:'Libertinus Sans, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-east-asian:normal;text-align:start;writing-mode:lr-tb;direction:ltr;text-anchor:start;fill:#3f40a8;fill-opacity:0;stroke:#000000;stroke-width:0.3;stroke-dasharray:none" + x="22.761036" + y="30.726585" + id="text2"><tspan + id="tspan2" + style="stroke-width:0.3;stroke-dasharray:none" + x="22.761036" + y="30.726585">Rx</tspan></text> + <text + xml:space="preserve" + style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:3.05742px;font-family:'Libertinus Sans';-inkscape-font-specification:'Libertinus Sans, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-east-asian:normal;text-align:start;writing-mode:lr-tb;direction:ltr;text-anchor:start;fill:#3f40a8;fill-opacity:0;stroke:#000000;stroke-width:0.3;stroke-dasharray:none" + x="32.431934" + y="30.72047" + id="text3"><tspan + id="tspan3" + style="stroke-width:0.3;stroke-dasharray:none" + x="32.431934" + y="30.72047">Tx</tspan></text> + <text + xml:space="preserve" + style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:3.05742px;font-family:'Libertinus Sans';-inkscape-font-specification:'Libertinus Sans, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-east-asian:normal;text-align:start;writing-mode:lr-tb;direction:ltr;text-anchor:start;fill:#3f40a8;fill-opacity:0;stroke:#000000;stroke-width:0.3;stroke-dasharray:none" + x="40.593998" + y="30.786205" + id="text4"><tspan + id="tspan4" + style="stroke-width:0.3;stroke-dasharray:none" + x="40.593998" + y="30.786205">5v</tspan></text> + <text + xml:space="preserve" + style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:2.82223px;font-family:'Libertinus Sans';-inkscape-font-specification:'Libertinus Sans, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-east-asian:normal;text-align:start;writing-mode:lr-tb;direction:ltr;text-anchor:start;fill:#3f40a8;fill-opacity:0;stroke:#000000;stroke-width:0.3;stroke-dasharray:none" + x="23.552603" + y="9.9999981" + id="text5"><tspan + id="tspan5" + style="stroke-width:0.3;stroke-dasharray:none" + x="23.552603" + y="9.9999981" /></text> + </g> + </g> +</svg> diff --git a/content/posts/stop-using-TRRS/trrs_partially_plugged_in_5v_sleeve.svg b/content/posts/stop-using-TRRS/trrs_partially_plugged_in_5v_sleeve.svg new file mode 100644 index 0000000..07d5370 --- /dev/null +++ b/content/posts/stop-using-TRRS/trrs_partially_plugged_in_5v_sleeve.svg @@ -0,0 +1,160 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- Created with Inkscape (http://www.inkscape.org/) --> + +<svg + height="50mm" + viewBox="0 0 55.307693 20.299997" + version="1.1" + style="background-color:white" + id="svg1" + xmlns="http://www.w3.org/2000/svg" + xmlns:svg="http://www.w3.org/2000/svg"> + <defs + id="defs1" /> + <g + id="layer1" + transform="translate(-36.842309,-23.849998)"> + <g + id="g8" + transform="translate(36.999998,4.0000007)"> + <rect + style="fill:#3f40a8;fill-opacity:0;stroke:#000000;stroke-width:0.3" + id="rect5" + width="45.000004" + height="19.999996" + x="10" + y="19.999996" /> + <text + xml:space="preserve" + style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:3.21421px;font-family:'Libertinus Sans';-inkscape-font-specification:'Libertinus Sans, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-east-asian:normal;text-align:start;writing-mode:lr-tb;direction:ltr;text-anchor:start;fill:#3f40a8;fill-opacity:0;stroke:#000000;stroke-width:0.315385;stroke-dasharray:none" + x="13.470504" + y="39.411469" + id="text1-6"><tspan + id="tspan1-1" + style="stroke-width:0.315385;stroke-dasharray:none" + x="13.470504" + y="39.411469">5v</tspan></text> + <text + xml:space="preserve" + style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:3.21421px;font-family:'Libertinus Sans';-inkscape-font-specification:'Libertinus Sans, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-east-asian:normal;text-align:start;writing-mode:lr-tb;direction:ltr;text-anchor:start;fill:#3f40a8;fill-opacity:0;stroke:#000000;stroke-width:0.315385;stroke-dasharray:none" + x="23.084501" + y="39.490215" + id="text2-0"><tspan + id="tspan2-6" + style="stroke-width:0.315385;stroke-dasharray:none" + x="23.084501" + y="39.490215">Rx</tspan></text> + <text + xml:space="preserve" + style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:3.21421px;font-family:'Libertinus Sans';-inkscape-font-specification:'Libertinus Sans, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-east-asian:normal;text-align:start;writing-mode:lr-tb;direction:ltr;text-anchor:start;fill:#3f40a8;fill-opacity:0;stroke:#000000;stroke-width:0.315385;stroke-dasharray:none" + x="33.251343" + y="39.483784" + id="text3-3"><tspan + id="tspan3-2" + style="stroke-width:0.315385;stroke-dasharray:none" + x="33.251343" + y="39.483784">Tx</tspan></text> + <text + xml:space="preserve" + style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:3.21421px;font-family:'Libertinus Sans';-inkscape-font-specification:'Libertinus Sans, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-east-asian:normal;text-align:start;writing-mode:lr-tb;direction:ltr;text-anchor:start;fill:#3f40a8;fill-opacity:0;stroke:#000000;stroke-width:0.315385;stroke-dasharray:none" + x="41.831974" + y="39.552891" + id="text4-0"><tspan + id="tspan4-6" + style="stroke-width:0.315385;stroke-dasharray:none" + x="41.831974" + y="39.552891">Gnd</tspan></text> + <path + style="fill:#3f40a8;fill-opacity:0;stroke:#000000;stroke-width:0.3;stroke-dasharray:none" + d="M 20,19.999997 V 39.999994" + id="path6" /> + <path + style="fill:#3f40a8;fill-opacity:0;stroke:#000000;stroke-width:0.3;stroke-dasharray:none" + d="M 30,19.999997 V 39.999994" + id="path7" /> + <path + style="fill:#3f40a8;fill-opacity:0;stroke:#000000;stroke-width:0.3;stroke-dasharray:none" + d="M 40.000002,19.999997 V 39.999994" + id="path8" /> + </g> + </g> + <g + id="layer2" + transform="translate(-36.842309,-23.849998)"> + <g + id="g6" + style="stroke-width:0.3;stroke-dasharray:none" + transform="matrix(1.0512821,0,0,1.0512821,26.487178,2.7179471)"> + <g + id="g5" + style="stroke-width:0.3;stroke-dasharray:none"> + <path + style="fill:#3f40a8;fill-opacity:0;stroke:#000000;stroke-width:0.3;stroke-dasharray:none" + d="m 10,24.999996 h 28.536586 c 0,0 3.804879,1.902439 3.804879,1.902439 l 5.707315,-1.902439 1.902442,3.804878 v 1.902438 L 48.04878,34.51219 42.341465,32.609751 38.536586,34.51219 H 10 Z" + id="path1" /> + <path + style="fill:#3f40a8;fill-opacity:0;stroke:#000000;stroke-width:0.3;stroke-dasharray:none" + d="M 19.512195,24.999996 V 34.51219" + id="path2" /> + <path + style="fill:#3f40a8;fill-opacity:0;stroke:#000000;stroke-width:0.3;stroke-dasharray:none" + d="M 29.024391,24.999996 V 34.51219" + id="path3" /> + <path + style="fill:#3f40a8;fill-opacity:0;stroke:#000000;stroke-width:0.3;stroke-dasharray:none" + d="M 38.536586,24.999996 V 34.51219" + id="path4" /> + </g> + <text + xml:space="preserve" + style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:3.05742px;font-family:'Libertinus Sans';-inkscape-font-specification:'Libertinus Sans, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-east-asian:normal;text-align:start;writing-mode:lr-tb;direction:ltr;text-anchor:start;fill:#3f40a8;fill-opacity:0;stroke:#000000;stroke-width:0.3;stroke-dasharray:none" + x="13.616014" + y="30.651678" + id="text1"><tspan + id="tspan1" + style="stroke-width:0.3;stroke-dasharray:none" + x="13.616014" + y="30.651678">5v</tspan></text> + <text + xml:space="preserve" + style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:3.05742px;font-family:'Libertinus Sans';-inkscape-font-specification:'Libertinus Sans, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-east-asian:normal;text-align:start;writing-mode:lr-tb;direction:ltr;text-anchor:start;fill:#3f40a8;fill-opacity:0;stroke:#000000;stroke-width:0.3;stroke-dasharray:none" + x="22.761036" + y="30.726585" + id="text2"><tspan + id="tspan2" + style="stroke-width:0.3;stroke-dasharray:none" + x="22.761036" + y="30.726585">Rx</tspan></text> + <text + xml:space="preserve" + style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:3.05742px;font-family:'Libertinus Sans';-inkscape-font-specification:'Libertinus Sans, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-east-asian:normal;text-align:start;writing-mode:lr-tb;direction:ltr;text-anchor:start;fill:#3f40a8;fill-opacity:0;stroke:#000000;stroke-width:0.3;stroke-dasharray:none" + x="32.431934" + y="30.72047" + id="text3"><tspan + id="tspan3" + style="stroke-width:0.3;stroke-dasharray:none" + x="32.431934" + y="30.72047">Tx</tspan></text> + <text + xml:space="preserve" + style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:3.05742px;font-family:'Libertinus Sans';-inkscape-font-specification:'Libertinus Sans, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-east-asian:normal;text-align:start;writing-mode:lr-tb;direction:ltr;text-anchor:start;fill:#3f40a8;fill-opacity:0;stroke:#000000;stroke-width:0.3;stroke-dasharray:none" + x="40.593998" + y="30.786205" + id="text4"><tspan + id="tspan4" + style="stroke-width:0.3;stroke-dasharray:none" + x="40.593998" + y="30.786205">Gnd</tspan></text> + <text + xml:space="preserve" + style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:2.82223px;font-family:'Libertinus Sans';-inkscape-font-specification:'Libertinus Sans, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-east-asian:normal;text-align:start;writing-mode:lr-tb;direction:ltr;text-anchor:start;fill:#3f40a8;fill-opacity:0;stroke:#000000;stroke-width:0.3;stroke-dasharray:none" + x="23.552603" + y="9.9999981" + id="text5"><tspan + id="tspan5" + style="stroke-width:0.3;stroke-dasharray:none" + x="23.552603" + y="9.9999981" /></text> + </g> + </g> +</svg> diff --git a/content/posts/stop-using-TRRS/trrs_partially_plugged_in_5v_tip.svg b/content/posts/stop-using-TRRS/trrs_partially_plugged_in_5v_tip.svg new file mode 100644 index 0000000..91c2eae --- /dev/null +++ b/content/posts/stop-using-TRRS/trrs_partially_plugged_in_5v_tip.svg @@ -0,0 +1,160 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- Created with Inkscape (http://www.inkscape.org/) --> + +<svg + height="50mm" + viewBox="0 0 55.307693 20.299997" + version="1.1" + style="background-color:white" + id="svg1" + xmlns="http://www.w3.org/2000/svg" + xmlns:svg="http://www.w3.org/2000/svg"> + <defs + id="defs1" /> + <g + id="layer1" + transform="translate(-36.842309,-23.849998)"> + <g + id="g8" + transform="translate(36.999998,4.0000007)"> + <rect + style="fill:#3f40a8;fill-opacity:0;stroke:#000000;stroke-width:0.3" + id="rect5" + width="45.000004" + height="19.999996" + x="10" + y="19.999996" /> + <text + xml:space="preserve" + style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:3.21421px;font-family:'Libertinus Sans';-inkscape-font-specification:'Libertinus Sans, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-east-asian:normal;text-align:start;writing-mode:lr-tb;direction:ltr;text-anchor:start;fill:#3f40a8;fill-opacity:0;stroke:#000000;stroke-width:0.315385;stroke-dasharray:none" + x="13.470504" + y="39.411469" + id="text1-6"><tspan + id="tspan1-1" + style="stroke-width:0.315385;stroke-dasharray:none" + x="13.470504" + y="39.411469">Gnd</tspan></text> + <text + xml:space="preserve" + style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:3.21421px;font-family:'Libertinus Sans';-inkscape-font-specification:'Libertinus Sans, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-east-asian:normal;text-align:start;writing-mode:lr-tb;direction:ltr;text-anchor:start;fill:#3f40a8;fill-opacity:0;stroke:#000000;stroke-width:0.315385;stroke-dasharray:none" + x="23.084501" + y="39.490215" + id="text2-0"><tspan + id="tspan2-6" + style="stroke-width:0.315385;stroke-dasharray:none" + x="23.084501" + y="39.490215">Rx</tspan></text> + <text + xml:space="preserve" + style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:3.21421px;font-family:'Libertinus Sans';-inkscape-font-specification:'Libertinus Sans, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-east-asian:normal;text-align:start;writing-mode:lr-tb;direction:ltr;text-anchor:start;fill:#3f40a8;fill-opacity:0;stroke:#000000;stroke-width:0.315385;stroke-dasharray:none" + x="33.251343" + y="39.483784" + id="text3-3"><tspan + id="tspan3-2" + style="stroke-width:0.315385;stroke-dasharray:none" + x="33.251343" + y="39.483784">Tx</tspan></text> + <text + xml:space="preserve" + style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:3.21421px;font-family:'Libertinus Sans';-inkscape-font-specification:'Libertinus Sans, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-east-asian:normal;text-align:start;writing-mode:lr-tb;direction:ltr;text-anchor:start;fill:#3f40a8;fill-opacity:0;stroke:#000000;stroke-width:0.315385;stroke-dasharray:none" + x="41.831974" + y="39.552891" + id="text4-0"><tspan + id="tspan4-6" + style="stroke-width:0.315385;stroke-dasharray:none" + x="41.831974" + y="39.552891">5v</tspan></text> + <path + style="fill:#3f40a8;fill-opacity:0;stroke:#000000;stroke-width:0.3;stroke-dasharray:none" + d="M 20,19.999997 V 39.999994" + id="path6" /> + <path + style="fill:#3f40a8;fill-opacity:0;stroke:#000000;stroke-width:0.3;stroke-dasharray:none" + d="M 30,19.999997 V 39.999994" + id="path7" /> + <path + style="fill:#3f40a8;fill-opacity:0;stroke:#000000;stroke-width:0.3;stroke-dasharray:none" + d="M 40.000002,19.999997 V 39.999994" + id="path8" /> + </g> + </g> + <g + id="layer2" + transform="translate(-36.842309,-23.849998)"> + <g + id="g6" + style="stroke-width:0.3;stroke-dasharray:none" + transform="matrix(1.0512821,0,0,1.0512821,26.487178,2.7179471)"> + <g + id="g5" + style="stroke-width:0.3;stroke-dasharray:none"> + <path + style="fill:#3f40a8;fill-opacity:0;stroke:#000000;stroke-width:0.3;stroke-dasharray:none" + d="m 10,24.999996 h 28.536586 c 0,0 3.804879,1.902439 3.804879,1.902439 l 5.707315,-1.902439 1.902442,3.804878 v 1.902438 L 48.04878,34.51219 42.341465,32.609751 38.536586,34.51219 H 10 Z" + id="path1" /> + <path + style="fill:#3f40a8;fill-opacity:0;stroke:#000000;stroke-width:0.3;stroke-dasharray:none" + d="M 19.512195,24.999996 V 34.51219" + id="path2" /> + <path + style="fill:#3f40a8;fill-opacity:0;stroke:#000000;stroke-width:0.3;stroke-dasharray:none" + d="M 29.024391,24.999996 V 34.51219" + id="path3" /> + <path + style="fill:#3f40a8;fill-opacity:0;stroke:#000000;stroke-width:0.3;stroke-dasharray:none" + d="M 38.536586,24.999996 V 34.51219" + id="path4" /> + </g> + <text + xml:space="preserve" + style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:3.05742px;font-family:'Libertinus Sans';-inkscape-font-specification:'Libertinus Sans, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-east-asian:normal;text-align:start;writing-mode:lr-tb;direction:ltr;text-anchor:start;fill:#3f40a8;fill-opacity:0;stroke:#000000;stroke-width:0.3;stroke-dasharray:none" + x="13.616014" + y="30.651678" + id="text1"><tspan + id="tspan1" + style="stroke-width:0.3;stroke-dasharray:none" + x="13.616014" + y="30.651678">Gnd</tspan></text> + <text + xml:space="preserve" + style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:3.05742px;font-family:'Libertinus Sans';-inkscape-font-specification:'Libertinus Sans, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-east-asian:normal;text-align:start;writing-mode:lr-tb;direction:ltr;text-anchor:start;fill:#3f40a8;fill-opacity:0;stroke:#000000;stroke-width:0.3;stroke-dasharray:none" + x="22.761036" + y="30.726585" + id="text2"><tspan + id="tspan2" + style="stroke-width:0.3;stroke-dasharray:none" + x="22.761036" + y="30.726585">Rx</tspan></text> + <text + xml:space="preserve" + style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:3.05742px;font-family:'Libertinus Sans';-inkscape-font-specification:'Libertinus Sans, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-east-asian:normal;text-align:start;writing-mode:lr-tb;direction:ltr;text-anchor:start;fill:#3f40a8;fill-opacity:0;stroke:#000000;stroke-width:0.3;stroke-dasharray:none" + x="32.431934" + y="30.72047" + id="text3"><tspan + id="tspan3" + style="stroke-width:0.3;stroke-dasharray:none" + x="32.431934" + y="30.72047">Tx</tspan></text> + <text + xml:space="preserve" + style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:3.05742px;font-family:'Libertinus Sans';-inkscape-font-specification:'Libertinus Sans, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-east-asian:normal;text-align:start;writing-mode:lr-tb;direction:ltr;text-anchor:start;fill:#3f40a8;fill-opacity:0;stroke:#000000;stroke-width:0.3;stroke-dasharray:none" + x="40.593998" + y="30.786205" + id="text4"><tspan + id="tspan4" + style="stroke-width:0.3;stroke-dasharray:none" + x="40.593998" + y="30.786205">5v</tspan></text> + <text + xml:space="preserve" + style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:2.82223px;font-family:'Libertinus Sans';-inkscape-font-specification:'Libertinus Sans, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-east-asian:normal;text-align:start;writing-mode:lr-tb;direction:ltr;text-anchor:start;fill:#3f40a8;fill-opacity:0;stroke:#000000;stroke-width:0.3;stroke-dasharray:none" + x="23.552603" + y="9.9999981" + id="text5"><tspan + id="tspan5" + style="stroke-width:0.3;stroke-dasharray:none" + x="23.552603" + y="9.9999981" /></text> + </g> + </g> +</svg> diff --git a/hugo.toml b/hugo.toml index a69896e..6bb407f 100644 --- a/hugo.toml +++ b/hugo.toml @@ -112,6 +112,12 @@ endLevel = 5 ordered = false startLevel = 2 +[markup.goldmark] +[markup.goldmark.parser] +[markup.goldmark.parser.attribute] +block = true +title = true + [security] enableInlineShortcodes = true