@eapl.me@eapl.me Neat.
So for twt metadata the lextwt parser currently supports values in the form [key=value]
https://git.mills.io/yarnsocial/go-lextwt/src/branch/main/parser_test.go#L692-L698
@eapl.me@eapl.me here are my replies (somewhat similar to Lyseâs and Jamesâ)
Metadata in twts: Key=value is too complicated for non-hackers and hard to write by hand. So if there is a need then we should just use #NSFS or the alt-text file in markdown image syntax

if something is NSFWIDs besides datetime. When you edit a twt then you should preserve the datetime if location-based addressing should have any advantages over content-based addressing. If you change the timestamp the its a new post. Just like any other blog cms.
Caching, Yes all good ideas, but that is more a task for the clients not the serving of the twtxt.txt files.
Discovery: User-agent for discovery can become better. Iâm working on a wrapper script in PHP, so you donât need to go to Apaches log-files to see who fetches your feed. But for other Gemini and gopher you need to relay on something else. That could be using my webmentions for twtxt suggestion, or simply defining an email metadata field for letting a person know you follow their feed. Interesting read about why WebMetions might be a bad idea. Twtxt being much simple that a full featured IndieWeb sites, then a lot of the concerns does not apply here. But thatâs the issue with any open inbox. This is hard to solve without some form of (centralized or community) spam moderation.
Support more protocols besides http/s. Yes why not, if we can make clients that merge or diffident between the same feed server by multiples URLs
Languages: If the need is big then make a separate feed. I donât mind seeing stuff in other langues as it is low. You got translating tool if you need to know whats going on. And again when there is a need for easier switching between posting to several feeds, then itâs about building clients with a UI that makes it easy. No something that should takes up space in the format/protocol.
Emojis: Iâm not sure what this is about. Do you want to use emojis as avatar in CLI clients or it just about rendering emojis?
After testing Vivaldi for a couple of weeks I am convinced this is a great browser and to support the team behind it, I decided to start sending them a couple of Euro monthly, just to keep the momentum going.
@prologic@twtxt.net yeah short Nick is going to be unique enough. There is always olong Nick that adds the domain for differentiation.
Web interface is deleted in https://git.mills.io/saltyim/saltyim/commit/376de2702319686c902ec03b8ca1e17b020fc639 but seems incorrectly (in source i see git lfs metadata). Can be builded if you grab https://git.mills.io/saltyim/saltyim/src/commit/15a64de82829/internal/web/app.wasm and place it in source (go directory has cached source) and rebuild
Honestly⌠not much. Have abandon two projects (both private) on Golang and one related to cryptography. My mostly languages are Python and Javascript (also can PHP). After writing code on Go i spend same time on fixing dumb errors
Same! Great joke!
I share I did write up an algorithm for it at some point I think it is lost in a git comment someplace. Iâll put together a pseudo/go code this week.
Super simple:
Making a reply:
- If yarn has one use that. (Maybe do collision check?)
- Make hash of twt raw no truncation.
- Check local cache for shortest without collision
- in SQL:
select len(subject) where head_full_hash like subject || '%'
- in SQL:
Threading:
- Get full hash of head twt
- Search for twts
- in SQL:
head_full_hash like subject || '%' and created_on > head_timestamp
- in SQL:
The assumption being replies will be for the most recent head. If replying to an older one it will use a longer hash.
@prologic@twtxt.net Regarding the new way of generating twt-hashes, to me it makes more sense to use tabs as separator instead of spaces, since the you can just copy/past a line directly from a twtxt-file that already go a tab between timestamp and message. But tabs might be hard to âtypeâ when you are in a terminal, since it will activate autocompleteâŚđ¤
Another thing, it seems that you sugget we only use the domain in the hash-creation and not the full path to the twtxt.txt
$ echo -e "https://example.com 2024-09-29T13:30:00Z Hello World!" | sha256sum - | awk '{ print $1 }' | base64 | head -c 12
@lyse@lyse.isobeef.org yeah, tell us, @prologic@twtxt.net, what isnât true? đ¤ You canât just go around, âthatâs not true, and thatâs not true; and that, and that!â without spelling out exactly what isnât, and why? For the love of god, why?! đ
@prologic@twtxt.net cool, I will be there! Are you going to post the regular banner notice? It will serve as a reminder, at least for me.
I wrote some code to try out non-hash reply subjects formatted as (replyto ), while keeping the ability to use the existing hash style.
I donât think we need to decide all at once. If clients add support for a new method then people can use it if they like. The downside of course is that this costs developer time, so I decided to invest a few hours of my own time into a proof of concept.
With apologies to @movq@www.uninformativ.de for corrupting jennyâs beautiful code. I donât write this expecting you to incorporate the patch, because it does complicate things and might not be a direction you want to go in. But if you like any part of this approach feel free to use bits of it; I release the patch under jennyâs current LICENCE.
Supporting both kinds of reply in jenny was complicated because each email can only have one Message-Id, and because itâs possible the target twt will not be seen until after the twt referencing it. The following patch uses an sqlite database to keep track of known (url, timestamp) pairs, as well as a separate table of (url, timestamp) pairs that havenât been seen yet but are wanted. When one of those âwantedâ twts is finally seen, the mail file gets rewritten to include the appropriate In-Reply-To header.
Patch based on jenny commit 73a5ea81.
https://www.falsifian.org/a/oDtr/patch0.txt
Not implemented:
- Composing twts using the (replyto âŚ) format.
- Probably other important things Iâm forgetting.
@eldersnake@we.loveprivacy.club I wanted to ask you, are you running Headscale and WireGuard on the same VPS? I want to test Headscale, but currently run a small container with WireGuard, and I wonder if I need to stop (and eventually get rid of) the container to get Headscale going. Did you use the provided .deb
to install Headscale, or some other method?
@eldersnake@we.loveprivacy.club there has to be less reliance on a single point of failure. It is not so much about creating jobs in the US (which come with it, anyway), but about the ability to produce whatâs needed at home too. Whatâs the trade off? Is it going to be a little bit more expensive to manufacture, perhaps?
I have configured my twtxt.txt
as simple as possible. I have setup a publish_command
on jenny. Hopefully all works fine, and I am good to go. Next will be setting the announce_me
to true
. Here we go!
@movq@www.uninformativ.de going a little sideways on this, â*If twtxt/Yarn was to grow bigger, then this would become a concern again. But even Mastodon allows editing, so how much of a problem can it really be? đ *â, wouldnât it preparing for a potential (even if very, very, veeeeery remote) growth be a good thing? Mastodon signs all messages, keeps a history of edits, and it doesnât break threads. It isnât a problem there.đ It is here.
I think keeping hashes is a must. If anything for that âfeels goodâ feeling.
Hey, @movq@www.uninformativ.de, a tiny thing to add to jenny
, a -v
switch. That way when you twtxt âThatâs an older format that was used before jenny version v23.04â, I can go and run jenny -v
, and âduh!â myself on the way to a git pull
. :-D
@prologic@twtxt.net the real conclusion is, is it going to change, to what, and when? :-P
@lyse@lyse.isobeef.org fully agree. I have never been a fan of relative times to begin with, so that one will go away, foh sho! :-D
yarnd just doesnât render the subject. Fair enough. Itâs (replyto http://darch.dk/twtxt.txt 2024-09-15T12:50:17Z), and if you donât want to go on a hunt, the twt hash is weadxga: https://twtxt.net/twt/weadxga
@lyse@lyse.isobeef.org Sorry, I donât think I ever had charset=utf8. I just noticed that a few days ago. OpenBSDâs httpd might not support including a parameter with the mime type, unfortunately. Iâm going to look into it.
@movq@www.uninformativ.de I did the same. jenny
fetches archives, yes, but that twtxt I am referring about is no longer. If you fetch it, but I donât, there is certainly something going onâŚ
@movq@www.uninformativ.de I figured it will be something like this, yet, you were able to reply just fine, and I wasnât. Looking at your twtxt.txt
I see this line:
2024-09-16T17:37:14+00:00 (#o6dsrga) @<prologic https://twtxt.net/user/prologic/twtxt.txt>
@<quark https://ferengi.one/twtxt.txt> This is what I get. đ¤
Which is using the right hash. Mine, on the other hand, when I replied to the original, old style message (Message-Id: <o6dsrga>
), looks like this:
2024-09-16T16:42:27+00:00 (#o) @<prologic https://twtxt.net/user/prologic/twtxt.txt> this was your first twtxt. Cool! :-P
What did you do to make yours work? I simply went to the oldest @prologic@twtxt.netâs entry on my Maildir, and replied to it (jenny
set the reply-to
hash to #o
, even though the Message-Id
is o6dsrga
). Since jenny
canât fetch archived twtxts, how could I go to re-fetch everything? And, most importantly, would re-fetching fix the Message-Id:
?
@prologic@twtxt.net I am going to light some candles this weekend to âLa Virgen de Macarenaâ to make it happen! :-D
So this is a great thread. I have been thinking about this too.. and what if we are coming at it from the wrong direction? Identity being tied to a given URL has always been a pain point. If i get a new URL its almost as if i have a new identity because not only am I serving at a new location but all my previous communications are broken because the hashes are all wrong.
What if instead we used this idea of signatures to thread the URLs together into one identity? We keep the URL to Hash in place. Changing that now is basically a no go. But we can create a signature chain that can link identities together. So if i move to a new URL i update the chain hosted by my primary identity to include the new URL. If i have an archived feed that the old URL is now dead, we can point to where it is now hosted and use the current convention of hashing based on the first url:
The signature chain can also be used to rotate to new keys over time. Just sign in a new key or revoke an old one. The prior signatures remain valid within the scope of time the signatures were made and the keys were active.
The signature file can be hosted anywhere as long as it can be fetched by a reasonable protocol. So say we could use a webfinger that directs to the signature file? you have an identity like frank@beans.co
that will discover a feed at some URL and a signature chain at another URL. Maybe even include the most recent signing key?
From there the client can auto discover old feeds to link them together into one complete timeline. And the signatures can validate that its all correct.
I like the idea of maybe putting the chain in the feed preamble and keeping the single self contained file.. but wonder if that would cause lots of clutter? The signature chain would be something like a log with what is changing (new key, revoke, add url) and a signature of the change + the previous signature.
# chain: ADDKEY kex14zwrx68cfkg28kjdstvcw4pslazwtgyeueqlg6z7y3f85h29crjsgfmu0w
# sig: BEGIN SALTPACK SIGNED MESSAGE. ...
# chain: ADDURL https://txt.sour.is/user/xuu
# sig: BEGIN SALTPACK SIGNED MESSAGE. ...
# chain: REVKEY kex14zwrx68cfkg28kjdstvcw4pslazwtgyeueqlg6z7y3f85h29crjsgfmu0w
# sig: ...
@prologic@twtxt.net Some criticisms and a possible alternative direction:
Key rotation. Iâm not a security person, but my understanding is that itâs good to be able to give keys an expiry date and replace them with new ones periodically.
It makes maintaining a feed more complicated. Now instead of just needing to put a file on a web server (and scan the logs for user agents) I also need to do this. What brought me to twtxt was its radical simplicity.
Instead, maybe we should think about a way to allow old urls to be rotated out? Like, my metadata could somehow say that X used to be my primary URL, but going forward from date D onward my primary url is Y. (Or, if you really want to use public key cryptography, maybe something similar could be used for key rotation there.)
Itâs nice that your scheme would add a way to verify the twts you download, but https is supposed to do that anyway. If you donât trust https to do that (maybe you donât like relying on root CAs?) then maybe your preferred solution should be reflected by your primary feed url. E.g. if you prefer the security offered by IPFS, then maybe an IPNS url would do the trick. The fact that feed locations are URLs gives some flexibility. (But then rotation is still an issue, if I understand ipns right.)
@lyse@lyse.isobeef.org 31°C here, feels like 33°C, with a lovely 75% of humidity. It has been raining, on and off (to make matter âbetterâ) the whole day until now. No horses here, but if you go outside you will smell the same smell of farm animals (like goats, or pigs). Thatâs because two or three kilometres from here there are private farms, and when the wind blows in such way, well, we are reminded of their existence.
I havenât left the house, so it feels well under air conditioning. In two more hours I will call it quits from the work day, and will have to dash to the grocery to get supplies for tonightâs meal (arroz con gandules). I will let you know how it truly feels out there then. :-D
For those swollen fingers, nothing better than a mildly cold shower! Oh, and paws off the keyboard! :-P
vim
cursor at the end of the first line on replies, and forks. I have tried adding to this to jenny
's configuration:
@movq@www.uninformativ.de hmm, I am already using au BufNewFile,BufRead jenny-posting.eml setl completefunc=jenny#CompleteMentions fo-=t wrap
, from jenny
. How would I go to incorporate that there?
vim
cursor at the end of the first line on replies, and forks. I have tried adding to this to jenny
's configuration:
@movq@www.uninformativ.de hmm, I guess I could do that too. I have startinsert
set on my .vimrc
, so I will either have to take it out, or exit insert, $
, then insert again. I think the way you do it would be the way to go.
I tried setting VISUAL
to be something like vim -c 'star!'
, which does the same thing, but no dice. :-/
@movq@www.uninformativ.de, maybe you can help me with this. I want to place the vim
cursor at the end of the first line on replies, and forks. I have tried adding to this to jenny
âs configuration:
"editor": "vim \"+normal $\"",
But that doesnât work. How would you go about it?
@bender@twtxt.net and I saw some conspiracy theory that he knew he was going to be arrested. He was working with French intelligence on a plea deal to defect. And now Russia is freaking out that Ukraine allies can have war comms access.
Yikes! If only they had salty.im!
oh dang. i think thats the go path not the github path.. missing the branch name. here is the pkg one: https://pkg.go.dev/github.com/quic-go/quic-go/http3
for http3 there is
from my understanding.. i donât know how the multiplexing works when its being proxied through another server. I know go has support for it if you call it out directly. https://pkg.go.dev/golang.org/x/net/http2
Its like old school TV but with youtube videos. Each channel has a subject and the channels play in a sort of realtime. so no going forward or back. Perfect for channel surfing.
@prologic@twtxt.net Yeah that is probably what was happening. I wish that go build
could embed the values that go install
does.
Havenât been sleeping well lately. Going to bed late. Lots to do.
Todayâs project: Put 2 failing hard drives in RAID 0 and boot from it. What could go wrong?
# follow = dbucklin@www.davebucklin.com https://www.davebucklin.com/twtxt.txt?nick=dbucklin
I fixed it by adding (?<!\S)
to the regex filter. But what is going on with the ?nick=dbucklin
anyhow?
Going to have to reinstall my Yunohost server one of these days as the packages no longer seem to be updateable.
You canât catch the kill signal. Should this be syscall.SIGTERM instead of os.Kill, xuu? https://git.sour.is/sour-is/go-paste/src/branch/main/main.go#L21
You are totally right.. i think i was going for SIGTERM and SIGQUIT
The way things are going, weâre never going to make it to Alpha Centauri.
So I had three espressos before 11:00 - todayâs going swell.
imagina o âHey Boy Hey Girlâ dos Chemical Brothers, mas com o âhere we goâ do Super Mario
Go 1.22.0 introduces a new experiment for range functions. Have you tried them out? What do you think it can make easier to accomplish?
@prologic@twtxt.net ahhh! Its the dark reader plugin breaking the page.
Twtxt spec enhancement proposal thread đ§ľ
Adding attributes to individual twts similar to adding feed attributes in the heading comments.
https://git.mills.io/yarnsocial/go-lextwt/pulls/17
The basic use case would be for multilingual feeds where there is a default language and some twts will be written a different language.
As seen in the wild: https://eapl.mx/twtxt.txt
The attributes are formatted as [key=value]
They can show up in the twt anywhere it is not enclosed by another element such as codeblock
or part of a markdown link.
>
?
@sorenpeter@darch.dk this makes sense as a quote twt that references a direct URL. If we go back to how it developed on twitter originally it was RT @nick: original text
because it contained the original text the twitter algorithm would boost that text into trending.
i like the format (#hash) @<nick url> > "Quoted text"\nThen a comment
as it preserves the human read able. and has the hash for linking to the yarn. The comment part could be optional for just boosting the twt.
The only issue i think i would have would be that that yarn could then become a mess of repeated quotes. Unless the client knows to interpret them as multiple users have reposted/boosted the thread.
The format is also how iphone does reactions to SMS messages with +number liked: original SMS
Got a Dr checkup and the screw in my hand hasnât moved. Thatâs the good news. Bad news is that there seems to be something going on with the internal healing. Nothing to do but wait.
Late fees for public libraries are not fines, theyâre extra donations to keep the organisation going.
So, I finally got day 17 to under a second on my machine. (in the test runner it takes 10)
I implemented a Fibonacci Heap to replace the priority queue to great success.
https://git.sour.is/xuu/advent-of-code/src/branch/main/search.go#L168-L268
OH MY FREAKING HECK. So.. I made my pather able to run as Dijkstra or A* if the interface includes a heuristic.. when i tried without the heuristic it finished faster :|
So now to figure out why its not working right.
man⌠day17 has been a struggle for me.. i have managed to implement A* but the solve still takes about 2 minutes for me.. not sure how some are able to get it under 10 seconds.
Solution: https://git.sour.is/xuu/advent-of-code/src/branch/main/day17/main.go
A* PathFind: https://git.sour.is/xuu/advent-of-code/src/branch/main/search.go
some seem to simplify the seen check to only be horizontal/vertical instead of each direction.. but it doesnât give me the right answer
I fell with a stupid e-scooter and have been waiting at the hospital now for more than three hours. Not worth it. I almost broke my left elbow and right hand wrist. Got lucky because I was wearing a helmet. Not going to try that again. The wheels slipped on the wet zebra crossing paint in a turn.
My last working day of 2023 is going strong! Just a couple dozen things left to take care of.
Thinking of building a simple âThings our kids sayâ database form, using Node, Express and SQlite3. Going beyond simple text files.
Around and around you go. When we sync up? Nobody knows!
When is most of humanity going to realise that weâre all stuck on the same space vessel, hurling to the vast and empty space together, and have limited resources that cannot be replenished from some other planet.
Its the latest ryzen 7 chipset for laptop/mini form factor.
I am very surprised about the times others are getting. I guess thatâs the difference between interpreted and compiled showing.
@prologic@twtxt.net The âgameâ will involve racing and exploding cake - I think he got inspiration from SuperTuxKart. So will see how far we can go. Heâs only five still..
My son said for the first time he wanted to make a game himself today. Going to freshen up my canvas and collision detection skills.
Ahh I see how someone did it.
https://github.com/immannino/advent-of-go/blob/master/cmd/2023.go#L30-L40
@movq@www.uninformativ.de Dang. Really going overboard with this!
@prologic@twtxt.net I didnât have to do much backtracking. I parsed into an AST-ish table and then just needed some lookups.
The part 2 was pretty easy to work into the AST after.
https://git.sour.is/xuu/advent-of-code-2023/commit/c894853cbd08d5e5733dfa14f22b249d0fb7b06c
Going for Codeberg to support a non-profit organisation that stands for the common good.
@darch@neotxt.dk webmentions are dispatched from here https://git.mills.io/yarnsocial/yarn/src/branch/main/internal/post_handler.go#L160-L169
@prologic@twtxt.net its not.. There are going to be 1000s of copy cat apps built on AI. And they will all die out when the companies that have the AI platforms copy them. It happened all the time with windows and mac os. And iphone.. Like flashlight and sound recorder apps.
@prologic@twtxt.net the going theory is that openAI announced a new product that pretty much blew up the project of one of the board members. So that board member got 3 others to vote to fire Sam.
@movq@www.uninformativ.de I lasted for a long time.. Not sure where or when it was âgotâ. We had been having a cold go around with the kiddos for about a week when the wife started getting sicker than normal. Did a test and she was positive. We tested the rest of the fam and got nothing. Till about 2 days later and myself and the others were positive. It largely hasnât been too bad a little feaver and stuffy noses.
But whatever it was that hit a few days ago was horrible. Like whatever switch in my head that goes to sleep mode was shut off. I would lay down and even though I felt sleepy, I couldnât actually go to sleep. The anxiety hit soon after and I was just awake with no relief. And it persisted that way for three nights. I got some meds from the clinic that seemed to finally get me to sleep.
Now the morning after I realized for all that time a part of me was missing. I would close my eyes and it would just go dark. No imagination, no pictures, nothing. Normally I can visualize things as I read or think about stuff.. But for the last few days it was just nothing. The waking up to it was quite shocking.
Though its just the first night.. I guess Iâll have to see if it persists. đ¤
Wondering how that person in Nebraska is doing keeping that cornerstone open-source package going.
This is some cool development for the go 1.22 standard http mux. Its adding the ability to have path vars and define methods for handlers. Also the errors are quite helpful if you have conflicting paths!
https://eli.thegreenplace.net/2023/better-http-server-routing-in-go-122/
If you are going to compare iPhone with android you canât just throw out bargan bin android phones.. Should compare within the same price points like the Pixel, Galaxy, Pine, or OnePlus models.
@chunkimo@twtxt.net lol. go walrus!!
In case you didnât notice, I deleted my Twitter and Keybase accounts. Going full indieweb.
@prologic@twtxt.net it is from the generator. But in the actual go implementation methods are represented with a unsigned short. So 65k is the hard limit in go.
Oof.
@prologic@twtxt.net I get the worry of privacy. But I think there is some value in the data being collected. Do I think that Russ is up there scheming new ways to discover what packages you use in internal projects for targeting ads?? Probably not.
Go has always been driven by usage data. Look at modules. There was need for having repeatable builds so various package tool chains were made and evolved into what we have today. Generics took time and seeing pain points where they would provide value. They werenât done just so it could be checked off on a box of features. Some languages seem to do that to the extreme.
Whenever changes are made to the language there are extensive searches across public modules for where the change might cause issues or could be improved with the change. The fs embed and strings.Cut come to mind.
I think its good that the language maintainers are using what metrics they have to guide where to focus time and energy. Some of the other languages could use it. So time and effort isnât wasted in maintaining something that has little impact.
The economics of the âspyingâ are to improve the product and ecosystem. Is it âspyingâ when a municipality uses water usage metrics in neighborhoods to forecast need of new water projects? Or is it to discover your shower habits for nefarious reasons?
@prologic@twtxt.net the rm -rf is basically what go clean -modcache
does.
I think you can use another form that will remove just the deps for a specific module. go clean -r
@mckinley@twtxt.net very weird things going on for me.. i can see your twt but its not showing up as a reply or fork?
I think Iâm going to create some boilerplate code for !gestku that isnât ad-hoc. I think Iâm ready for this. Gestkus need less code because of how quickly I want to make them.
â(1) we donât know what is going on in LLMs (2) itâs outlandish to say that LLMs have no understanding of the worldâ both claims cannot be true
@prologic@twtxt.net see where its used maybe that can help.
https://github.com/sour-is/ev/blob/main/app/peerfinder/http.go#L153
This is an upsert. So I pass a streamID which is like a globally unique id for the object. And then see how the type of the parameter in the function is used to infer the generic type. In the function it will create a new *Info and populate it from the datastore to pass to the function. The func will do its modifications and if it returns a nil error it will commit the changes.
The PA type contract ensures that the type fulfills the Aggregate interface and is a pointer to type at compile time.
one that i think is pretty interesting is building up dependent constraints. see here.. it accepts a type but requires the use of a pointer to type.
https://github.com/sour-is/ev/blob/main/pkg/es/es.go#L315-L325
I learned how to make gopls syntax highlight go templates in VSCodium.
By adding the following to my config
i could go from into
I need to learn how to crash dates that are going nowhere with way too much escalation. That should be fun
$name$
and then dispatch the hashing or checking to its specific format.
Circling back to the IsPreferred method. A hasher can define its own IsPreferred method that will be called to check if the current hash meets the complexity requirements. This is good for updating the password hashes to be more secure over time.
func (p *Passwd) IsPreferred(hash string) bool {
_, algo := p.getAlgo(hash)
if algo != nil && algo == p.d {
// if the algorithm defines its own check for preference.
if ck, ok := algo.(interface{ IsPreferred(string) bool }); ok {
return ck.IsPreferred(hash)
}
return true
}
return false
}
https://github.com/sour-is/go-passwd/blob/main/passwd.go#L62-L74
example: https://github.com/sour-is/go-passwd/blob/main/pkg/argon2/argon2.go#L104-L133
$name$
and then dispatch the hashing or checking to its specific format.
Hold up now, that example hash doesnât have a
$
prefix!
Well for this there is the option for a hash type to set itself as a fall through if a matching hash doesnât exist. This is good for legacy password types that donât follow the convention.
func (p *plainPasswd) ApplyPasswd(passwd *passwd.Passwd) {
passwd.Register("plain", p)
passwd.SetFallthrough(p)
}
https://github.com/sour-is/go-passwd/blob/main/passwd_test.go#L28-L31
$name$
and then dispatch the hashing or checking to its specific format.
Here is an example of usage:
func Example() {
pass := "my_pass"
hash := "my_pass"
pwd := passwd.New(
&unix.MD5{}, // first is preferred type.
&plainPasswd{},
)
_, err := pwd.Passwd(pass, hash)
if err != nil {
fmt.Println("fail: ", err)
}
// Check if we want to update.
if !pwd.IsPreferred(hash) {
newHash, err := pwd.Passwd(pass, "")
if err != nil {
fmt.Println("fail: ", err)
}
fmt.Println("new hash:", newHash)
}
// Output:
// new hash: $1$81ed91e1131a3a5a50d8a68e8ef85fa0
}
This shows how one would set a preferred hashing type and if the current version of ones password is not the preferred type updates it to enhance the security of the hashed password when someone logs in.
https://github.com/sour-is/go-passwd/blob/main/passwd_test.go#L33-L59
I made a thing. Its a multi password type checker. Using the PHC string format we can identify a password hashing format from the prefix $name$
and then dispatch the hashing or checking to its specific format.
ahh this is useful https://go.dev/doc/modules/managing-dependencies. the go culture doesnât typically have large dependency graphs like Ruby or JS.
@prologic@twtxt.net the go get
and go mod tidy
wont fetch new changes. thatâs all a manual affair AFAIK
another paper which relies on questionnaires for attention span. am i going crazy? how is this a good metricâ˝
@movq@uninformativ.de yeah.. i rewrote it a few times because i thought there was something breaking.. but was mistaken
though now i am seeing a weird cache corruption.. that seems to come and go.
Tell me you write go like javascript without telling me you write go like javascript:
import "runtime/debug"
var Commit = func() string {
if info, ok := debug.ReadBuildInfo(); ok {
for _, setting := range info.Settings {
if setting.Key == "vcs.revision" {
return setting.Value
}
}
}
return ""
}()
i only allow myself to go the hard way. good or bad?
it uses the queries you define for add/del/set/keys. which corrispond to something like INSERT INTO <table> (key, value) VALUES ($key, $value)
, DELETE ...
, or UPDATE ...
the commands are issued by using the maddycli but not the running maddy daemon.
see https://maddy.email/reference/table/sql_query/
the best way to locate in source is anything that implements the MutableTable interface⌠https://github.com/foxcpp/maddy/blob/master/framework/module/table.go#L38
@prologic@twtxt.net, business is slow (I also just got off that hyoo-män illness that is going around named COVID), so that leaves me some free time on my entrepreneurial hands. đ I have always lurked every couple of weeks or so. I see yarn has regressed on the UI! đŹđŠ
And that I can silence it without having or go through the full test announcing fire and carbon monox throughout the house.
@abucci@anthony.buc.ci Its not better than a Cat5e. I have had two versions of the device. The old ones were only 200Mbps i didnât have the MAC issue but its like using an old 10baseT. The newer model can support 1Gbps on each port for a total bandwidth of 2Gbps.. i typically would see 400-500Mbps from my Wifi6 router. I am not sure if it was some type of internal timeout or being confused by switching between different wifi access points and seeing the mac on different sides.
Right now I have my wifi connected directly with a cat6e this gets me just under my providers 1.3G downlink. the only thing faster is plugging in directly.
MoCA is a good option, they have 2.5G models in the same price range as the 1G Powerline models BUT, only if you have the coax in wall already.. which puts you in the same spot if you donât. You are for sure going to have an outlet in every room of the house by code.
Progress! so i have moved into working on aggregates. Which are a grouping of events that replayed on an object set the current state of the object. I came up with this little bit of generic wonder.
type PA[T any] interface {
event.Aggregate
*T
}
// Create uses fn to create a new aggregate and store in db.
func Create[A any, T PA[A]](ctx context.Context, es *EventStore, streamID string, fn func(context.Context, T) error) (agg T, err error) {
ctx, span := logz.Span(ctx)
defer span.End()
agg = new(A)
agg.SetStreamID(streamID)
if err = es.Load(ctx, agg); err != nil {
return
}
if err = event.NotExists(agg); err != nil {
return
}
if err = fn(ctx, agg); err != nil {
return
}
var i uint64
if i, err = es.Save(ctx, agg); err != nil {
return
}
span.AddEvent(fmt.Sprint("wrote events = ", i))
return
}
This lets me do something like this:
a, err := es.Create(ctx, r.es, streamID, func(ctx context.Context, agg *domain.SaltyUser) error {
return agg.OnUserRegister(nick, key)
})
I can tell the function the type being modified and returned using the function argument that is passed in. pretty cray cray.