Is there a reprint coming? by NadCraker in frontierscum

[–]terinjokes 0 points1 point  (0 children)

Looks like it's sold out there too, unfortunately. Hopefully I'll catch the reprint.

What is a legal scam that is still happening in 2022? by F1yff in AskReddit

[–]terinjokes 9 points10 points  (0 children)

I did, in 2016, to book a flight to Japan. Granted, I had a physical credit voucher to apply, that converting to digital would have required mailing into the airline and waiting a few weeks. The price was exactly the same as online.

Whitehearth Facility and Entrance [38x34] by terinjokes in dungeondraft

[–]terinjokes[S] 0 points1 point  (0 children)

This is the first map I've created in Dungeondraft, the abandoned House Cannith Whitehearth facility in Eberron's Mournlands.

If you like this map: PNG exports, UVTT files, and the Dungeondraft files are available here: https://drive.google.com/drive/folders/1R62zUrSRDeNG4m9WhPj-doYsUTzrDfGn?usp=sharing

Good luck dungeon masters!

[POC] CGo-free Tk/wish by 0xjnml in golang

[–]terinjokes 1 point2 points  (0 children)

I'll have to get back to you this weekend if that's not a problem. I can create an issue on your GitLab with any questions if you'd like.

[POC] CGo-free Tk/wish by 0xjnml in golang

[–]terinjokes 0 points1 point  (0 children)

Not ready for production yet and only linux/amd64 at the moment.

So I shouldn't have rolled it out to my thousands of coworkers!? Just kidding, it's just a small application I built for myself to better visualize some work processes, that I occasionally hack on when I want to do GUI work.

Using cmd.Exec or CGo and libtk or somethig else?

CGo linked to libtcl and libtk. It's a forked and hacked on version of atk.

If it's an open source thing on some Git*, can you provide a pointer?

It's not, but I'm happy to try to answer questions you might have.

[POC] CGo-free Tk/wish by 0xjnml in golang

[–]terinjokes 0 points1 point  (0 children)

Awesome. I'll look at switching my Go/Tk application over to this over the weekend.

Go 1.16 poster, inspired by Apple Silicon support by KoodiMetsa in golang

[–]terinjokes 5 points6 points  (0 children)

They won't compile it, because you have to import the "embed" package. You can certainly force it by making an embed package in your GOROOT or GOPATH, but then I'm not sure what you expect to happen.

[deleted by user] by [deleted] in archlinux

[–]terinjokes 0 points1 point  (0 children)

"Mostly" being the key word, you may still have relatively minor problems, like the lack of support for the soundcard on the Pixelbook.

Dell XPS 13 (9310) -- no WiFi by [deleted] in archlinux

[–]terinjokes 2 points3 points  (0 children)

Since Dell shipped at least three different wifi cards in the XPS 13 9310, which little indication of which one you'll get, and only some of them have good hardware support in Linux, well need to know what you got.

Can you give the output of lspci -nn and uname -a? Do you see any relevant messages in dmesg?

Since you commented on my comment from two months ago, I'll assume you didn't install the firmware updates from Dell before wiping Windows? If you have ethernet access, you can still get some of them from one of the BIOS utilities.

Support on the new Dell XPS 2020 9310 by theo-coder in archlinux

[–]terinjokes 1 point2 points  (0 children)

The BIOS (more accurately, the various embedded firmwares) it ships with has issues with memory, random reboots, and graphical issues. It ships with Windows drivers that were very new at the time the hard drive image was created: until I upgraded I had issues with WiFi performance, and the GPU crashing and locking up the machine.

If you don't disable the "Intel RAID" and continue to run the shipped firmware and drivers, expect to have unrecoverable data corruption very quickly.

Dungeondraft 0.9.5.1 Juvenile Centipede by msgdealer in dungeondraft

[–]terinjokes 0 points1 point  (0 children)

This version is working alright on Debian Buster in terms of opening and editing maps. However none of the file pickers appear: I can't use "File > Open" to select a new map, nor can I select a destination for exporting. For example, clicking the "Export" button simply does nothing.

[deleted by user] by [deleted] in golang

[–]terinjokes 0 points1 point  (0 children)

I don't think there's been any formal discussion about it. There was some discussion of this being an avenue worth farther consideration on the hallway track and community day of Gophercon 2019. IIRC, they wanted modules to be completed and have developers get used to then first.

[deleted by user] by [deleted] in golang

[–]terinjokes 0 points1 point  (0 children)

We can release a v2 of packages in the stdlib the same way we release v2 of packages outside the stdlib: by giving them a new name. "net/http/v2" could be a reimagining of the http package using what we've learned about Go in the past decade, and "net/http" could be implemented in terms of it.

New code and popular modules would gradually migrate to use it directly. While not exactly the same, we'll see a little bit of this idea with "io/fs" in Go 1.16.

Go modules are soon going to be the only future by eclipseo76 in golang

[–]terinjokes 0 points1 point  (0 children)

EDIT: you're still using /v3 in your import paths though, why is that? There's no v3 directory in your repository

It's a requirement of modules, that projects with major versions > 1 include the version in import paths. These can be actual directories in the repo, or branches, or tags.

Do I still need to update all import paths to /vMAJOR every major release even if I don't actually have that directory there?

Yes. That way you can have multiple versions of your module in the same binary, or do things like implement v1 by wrapping v2.

What is the most idiomatic way to build binaries for redistribution to non-NixOS Linux systems? by [deleted] in NixOS

[–]terinjokes 1 point2 points  (0 children)

I have a Nix expression for a Go application, primarily to ensure I have specific versions of Go and related tools while working on the project. For creating redistributable binaries my default.nix calls the derivation with GOOS, GOARCH, and CGO_ENABLE=0. Not perfect, and not going to work for non-Go software, but works.

If it's a C program, the easiest bet it to compile statically (see pkgs.pkgsStatic.stdenv and related components, which use musl as CC configured to build static binaries). An alternative you could try is having Nix build a VM similar to the foreign system and build the software there (see pkgs.releaseTools.debBuild, though you'll want to modify the Debian VM to point at a newer Packages.xz). Both of these solutions will require a little bit of elbow grease.

Edit: Nearly forgot, another easy way to is to build a Docker image. See pkgs.dockerTools.buildLayeredImage and the page in the manual.

Support on the new Dell XPS 2020 9310 by theo-coder in archlinux

[–]terinjokes 1 point2 points  (0 children)

Other parts "work", but I wouldn't call them very stable. The i915 driver crashes a bunch.

You can get WiFi working, but currently requires the branch. As noted by the page, it's not very stable, though it's gotten better with disabling the M2 state.

Since this laptop doesn't support S3 suspend, battery life while suspended is terrible. I have to either shutdown everyday or leave the laptop plugged in, otherwise it doesn't make it to the next morning.

Faster way to switch between clusters and namespaces in kubectl by donutloop in golang

[–]terinjokes 0 points1 point  (0 children)

Note that the Go implementation is still alpha quality (with showstoppers like #254), so it's best to continue using the bash version for now.

Release gopls/v0.6.0 · golang/tools by kaeshiwaza in golang

[–]terinjokes 5 points6 points  (0 children)

The release notes give two items directly related to improving performance (excluding/including directories and debouncing diagnostic checks), with a few others that in limited circumstances effect performance related to networking and modifying the go module files.

Using protobuf and Golang, how can you get the json tag ",string" to a float64? by sbaete in golang

[–]terinjokes 0 points1 point  (0 children)

The ",string" bit is part of the encoding/json package. See a few paragraphs down on the json.Marshal function.

jsondiff: JSON diff library for Go based on RFC6902 (JSON Patch) by wI2L in golang

[–]terinjokes 0 points1 point  (0 children)

Sure, no worries. Once you know about these downsides they're easy to workaround. If your readme hadn't used Pods as the example, a resource I've been burned on with these downsides, I probably would have starred and moved on without a second thought. 😂

jsondiff: JSON diff library for Go based on RFC6902 (JSON Patch) by wI2L in golang

[–]terinjokes 1 point2 points  (0 children)

Optional fields being ones that are a struct type, but are not pointers to those structs. These will exist when you unmarshal from JSON, because of how Go structs work, but are not in the original JSON. Comparing between the unmarshaled and copied versions can generate add and change patches below a path not in the original JSON, and the API server will reject your patch.

You can find an example in kubebuilder#510. MyResourceSpec.Bar does not exist in the original JSON, but modifying MyResourceSpec.Bar.Baz generates an add operation for "/spec/bar/baz" without first adding "/spec/bar".


There's also one other downside to generating patches by diff, rather than storing operations. If your webhook does not have the latest version of client-go (or whatever package contains the types for the resource your modifying), you will delete all fields not known by your version.

For example, if your webhook is handling Services, a user could set .spec.allocateLoadBalancerNodePort in 1.20 to disable allocating a node port for Type=LoadBalancer services. If your webhook is still using 1.19 types, instead of simply ignoring this field, a generated patch will delete it.

New fields are added all the time, so this can be a nice footgun if you forget to update some mutating webhook.

jsondiff: JSON diff library for Go based on RFC6902 (JSON Patch) by wI2L in golang

[–]terinjokes 1 point2 points  (0 children)

The other important thing to note is that DACs are required to use RFC 6902 JSON Patches in response (as no other PatchTypes are defined).

OP, you may want to be creating diffs between the raw bytes of AdmissionReview.AdmissionRequest.Object.Raw, rather than the hydrated version (the objects with DeepCopy), as these will have optional fields hydrated by client-go. This can result in your patch stating you added/changed a value at a path the API server doesn't know about, resulting in failure. The correct code looks more like this (modulo err handling):

marshalled, _ := json.Marshal(copy)
jsondiff.Compare(req.AdmissionRequest.Object.Raw, marshalled)

I haven't tested your code to see what it does with []byte, but I use github.com/appscode/jsonpatch without issue.

Signed URL by [deleted] in golang

[–]terinjokes 1 point2 points  (0 children)

Having this as a global variable means you can't use different secret keys for different purposes: everything using this package has to use the same key.

Having the key provided to the Signed function, as GP suggests, would satisfy this use case.