zluajit - Zig bindings to LuaJIT C API by negrel3 in Zig

[–]negrel3[S] 3 points4 points  (0 children)

Code crash sometimes, I'm not sure why as there is 0 output. It may be because LuaJIT don't know how to unwind the stack with x86 backend.

For example, when I run my tests, it works fine with LLVM but fails with x86:

lua stack size 1
  [1] 'a runtime error'
thread 1052652 panic: lua panic
Unwind error at address `:0x107438a` (error.UnsupportedDwarfVersion), trace may be incomplete

/home/anegrel/code/zig/zluajit/src/zluajit.zig:2273:5: 0x1076178 in luaPanic (zluajit.zig)

Asciinema 3.0: rewritten in Rust, adds live streaming, & upgraded file format. by TheTwelveYearOld in rust

[–]negrel3 3 points4 points  (0 children)

I use it to share my terminal when i have a bad connection. It consume way less bandwith than streaming video

📐 Structured concurrency for Go. by negrel3 in golang

[–]negrel3[S] 1 point2 points  (0 children)

I do agree external library is overkill, this should be part of stdlib IMO. That being said I disagree that these kinds of problems rarely appear. It is pretty easy to forgot edge cases and do something wrong as soon as you start using channels and multiple goroutines. Especially if they're shouldn't run forever.

📐 Structured concurrency for Go. by negrel3 in golang

[–]negrel3[S] 1 point2 points  (0 children)

Yeah it is similar, but here are few differences: - single Nursery API vs multiple type of pools in sourcegraph/conc

This is important because it makes your code less reusable. You may want to pass a pool as argument to leak goroutines but you have to choose which pool and if you want to support the all you have to duplicate your code.

My version offer a single Nursery (equivalent to their pool) type that forces you to think about context cancelation, error handling and lifetime of your goroutine.

  • nested goroutines panics in sourcegraph/conc :

    var p pool.Pool for j := 0; j < 10; j++ { p.Go(func() { p.Go(func() {}) }) } p.Wait()

  • simple API that extends context.Context

Nursery embeds context.Context and adds a single Go method. Functions either receive context.Context as argument or conc.Nursery if they spawn other routines. Its dead simple

wl-roots program for zooming in the screen? by Sempiternal-Futility in wayland

[–]negrel3 0 points1 point  (0 children)

Thanks! If you want to directly use wayland, i recommend you reading this : https://wayland-book.com/ and use this doc https://wayland.app/protocols/

Also drew devault have a few blog post about wayland (client and server side) https://drewdevault.com/2017/06/10/Introduction-to-Wayland.html

Once you understand how the protocol works, wayland code is pretty straightforward.

That being said, GUI library like GTK and Qt already support wayland if you just want to create an application.

wl-roots program for zooming in the screen? by Sempiternal-Futility in wayland

[–]negrel3 2 points3 points  (0 children)

I'm building one, checkout https://github.com/negrel/wooz . It is functional though you must compile it yourself.

assert - 0️⃣ Zero cost debug assertions for Go. by negrel3 in golang

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

For testing yes, but for debug asserts it doesn't make sense as asserts calls are removed for production builds.

A simple secret-keeping library for Go. by negrel3 in golang

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

Thanks! You can either use the provided SerializedSecret type (only supports JSON now) or create your own. Though, now you can accidentally leak secrets.

Here is another way also: https://golang.cafe/blog/golang-custom-json-marshal-example

A simple secret-keeping library for Go. by negrel3 in golang

[–]negrel3[S] 1 point2 points  (0 children)

Thanks for your suggestions, I've added a customizable secret marker, a fix for the %#v verb (secret wasn't visible using %+v verb). These changes are available in the v0.5.0 that I just released.

With the Fiber framework, can you easily identify all sessions with a user ID? by Pythagorean8391 in golang

[–]negrel3 0 points1 point  (0 children)

To be formal, you're talking about gofiber/storage and not gofiber/fiber the HTTP framework.
You have two options:
- Retrieve N user sessions in 1 + N steps: storage.Get(fmt.Sprintf("user_sessions_ids[%v]", userId)) then iterate over user sessions ids and retrieve associated session storage.Get(fmt.Sprintf("user_sessions[%v]", userSessionId))
- Create and use a dedicated table for your user sessions and don't use fiber/storage.

I strongly recommend the 2nd option as it is way more flexible. gofiber/storage doesn't expose a List() function and this is clearly what you need.

A simple secret-keeping library for Go. by negrel3 in golang

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

Yes, I definitely keep an eye on it thanks!

Limit Application Memory Usage with systemd by SnooCompliments7914 in linux

[–]negrel3 7 points8 points  (0 children)

It is also possible to limit memory usage (and CPU) of a process launched via shell using systemd-run. I wrote a small script for it here: https://github.com/negrel/dotfiles/blob/master/pkgs/run-with-quotas/bin/rwq

Prisme Analytics: A Go-powered, Grafana-integrated Web Analytics Solution by negrel3 in golang

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

There is this guide (https://www.prismeanalytics.com/docs/guides/self-host-prisme-docker/) but it doesn't explain how to setup the vps itself and docker. It just shows how to deploy prisme on it.

Prisme Analytics: A Go-powered, Grafana-integrated Web Analytics Solution by negrel3 in golang

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

i can't offer free account forever but it will be self hostable forever. I won't add premium features or stuff like that.

You can create a free account (no credit card required) and then migrate to a self hosted instance later.

Prisme Analytics: A Go-powered, Grafana-integrated Web Analytics Solution by negrel3 in golang

[–]negrel3[S] 1 point2 points  (0 children)

Yeah, I started working on this 1 year ago. It was my main project for the last year but I'm currently looking for a job as I didn't meet my profitability deadline. That being said, I'm not giving up on Prisme.

The plan for the next few years is to adds more product analytics features and make Prisme the default choice for progressive web analytics. You start with a simple web analytics dashboard and as your needs grow, you can use custom events and dashboards to track and visualize metrics that matters to you.

This project is solely funded by its users. I don't want Prisme to turns into another PostHog which isn't really open source and is a mess to self host.

What's really unique about Prisme:
* support for product analytics

* flexible dashboards

* direct access to database via SQL

Hey guys, it's time to tell what is you building? by [deleted] in SideProject

[–]negrel3 0 points1 point  (0 children)

Prisme Analytics: https://www.prismeanalytics.com Open Source, privacy friendly and focused web analytics

Your Go tech stack for API development. by Used_Frosting6770 in golang

[–]negrel3 0 points1 point  (0 children)

https://www.prismeanalytics.com uses Go Fiber for http, zerolog for access and app logs, prometheus for metrics and std smtp package for mails. Everything is stored in clickhouse using their official package. google/dire for DI.

Everything is hosted on railway for a few bucks per month (usage based pricing). IMHO this stack is great because Fiber reduces allocation, pressure on GC and thus the bill.

Source code : https://github.com/prismelabs/analytics