bahmanm

joined 1 year ago
MODERATOR OF
[โ€“] bahmanm@lemmy.ml 4 points 1 year ago

TBH I use whatever build tool is the better fit for the job, be it Gradle, SBT or Rebar.

But for some (presumably subjective) reason, I like GNU Make quite a lot. And whenever I get the chance I use it - esp since it's somehow ubiquitous nowadays w/ all the Linux containers/VMs everywhere and Homebrew on Mac machines.

[โ€“] bahmanm@lemmy.ml 1 points 1 year ago

Love the attitude ๐Ÿ’ช Let me know if you need help in your quest.

[โ€“] bahmanm@lemmy.ml 2 points 1 year ago (2 children)

I see.

So what do you think would help w/ this particular challenge? What kinds of tools/facilities would help counter that?


Off the top of my head, do you think

  • The sign up process should be more rigorous?
  • The first couple of posts/comments by new users should be verified by the mods?
  • Mods should be notified of posts/comments w/ poor score?

cc @PrettyFlyForAFatGuy@lemmy.ml

[โ€“] bahmanm@lemmy.ml 4 points 1 year ago (1 children)

I'm nitpicking but can you properly quote your code?

[โ€“] bahmanm@lemmy.ml 2 points 1 year ago

I just quote my comment on a similar post earlier ๐Ÿ˜…

A bit too long for my brain but nonetheless it is written in plain English, conveys the message very clearly and is definitely a very good read on the topic. Thanks for sharing.

[โ€“] bahmanm@lemmy.ml 9 points 1 year ago (4 children)

Interesting topic - I've seen it surface up a few times recently.

I've never been a mod anywhere so I can't accurately think what workflows/tools a mod needs to be satisfied w/ their, well, mod'ing.

For the sake of my education at least, can you elaborate what do you consider decent moderation tools/workflows? What gaps do you see between that and Lemmy?

PS: I genuinely want to understand this topic better but your post doesn't provide any details. ๐Ÿ˜…

[โ€“] bahmanm@lemmy.ml 6 points 1 year ago (1 children)

I'd personally appreciate if you explained the intention behind asking these questions.

Is this for your personal market-awareness? Or is it part of a survey (community or corporate?)

[โ€“] bahmanm@lemmy.ml 2 points 1 year ago (1 children)

I just love the "Block User" feature. Immediate results w/ zero intervention by the mods ๐Ÿ˜†

[โ€“] bahmanm@lemmy.ml -3 points 1 year ago* (last edited 1 year ago) (1 children)

Nice! Good to see this idea becoming more common ๐Ÿ‘

I personally use Firefox Relay which gives me better control for my workflow - I usually need my temporary e-mails to last a bit longer, eg a week or a month.


On another note, the post clickable URL opens the Lemmy instace landing page and not that of the disposable email service.

[โ€“] bahmanm@lemmy.ml 6 points 1 year ago

A bit too long for my brain but nonetheless it written in plain English, conveys the message very clearly and is definitely a very good read. Thanks for sharing.

[โ€“] bahmanm@lemmy.ml 2 points 1 year ago

I had so many typos - typed that on my phone ๐Ÿคฆโ€โ™‚๏ธ Glad I was able to communicate in some way ๐Ÿ˜‚

[โ€“] bahmanm@lemmy.ml 7 points 1 year ago* (last edited 1 year ago)

That single line of Lisp is probably (defmacro generate-compiler (...) ...) which GCC folks call every time they decide to implement a new compiler ๐Ÿ˜†

 

From GNU lists earlier today:

We have learned with deep sadness that Thien-Thi Nguyen (ttn) died in October 2022. Thien-Thi was a hacker, artist, writer, and long-time maintainer and contributor to many GNU programs as well as other free software packages. He was the GNU maintainer of the rcs, guile-sdl, alive, and superopt packages, and he was working on GNU Go as well.

Thien-Thi especially loved GNU Emacs, GNU Taler, and GNU Go: he was the author and maintainer of the xpm, gnugo, ascii-art-to-unicode, and hideshow GNU Emacs packages and made substantial contributions to many others such as vc, as well as to GNU Taler and its documentation.

We greatly miss Thien-Thi in the free software community - his death is a great loss to the Free World.

 

To be fair, here's the complete paragraph which makes sense:

Vagrant public networks are less private than private networks, and the exact meaning actually varies from provider to provider, hence the ambiguous definition. The idea is that while private networks should never allow the general public access to your machine, public networks can.

 

cross-posted from: https://lemmy.ml/post/4593804

Originally discussed on Matrix.


TLDR; Ansible handlers are added to the global namespace.


Suppose you've got a role which defines a handler MyHandler:

- name: MyHandler
  ...
  listen: "some-topic"

Each time you import/include your role, a new reference to MyHandler is added to the global namespace.

As a result, when you notify your handler via the topics it listens to (ie notify: "some-topic"), all the references to MyHandler will be executed by Ansible.

If that's not what you want, you should notify the handler by name (ie notify: MyHandler) in which case Ansible will stop searching for other references as soon as it finds the first occurrence of MyHandler. That means MyHandler will be executed only once.

 

cross-posted from: https://lemmy.ml/post/4593804

Originally discussed on Matrix.


TLDR; Ansible handlers are added to the global namespace.


Suppose you've got a role which defines a handler MyHandler:

- name: MyHandler
  ...
  listen: "some-topic"

Each time you import/include your role, a new reference to MyHandler is added to the global namespace.

As a result, when you notify your handler via the topics it listens to (ie notify: "some-topic"), all the references to MyHandler will be executed by Ansible.

If that's not what you want, you should notify the handler by name (ie notify: MyHandler) in which case Ansible will stop searching for other references as soon as it finds the first occurrence of MyHandler. That means MyHandler will be executed only once.

 

cross-posted from: https://lemmy.ml/post/4591838

Suppose I need to find out if the intersection of an arbitrary number of lists or sequences is empty.

Instead of the obvious O(n^2^) approach I used a hash table to achieve an O(n) implementation.

Now, loop mini-language aside, is this idiomatic elisp code? Could it be improved w/o adding a lot of complexity?

You can view the same snippet w/ syntax highlighting on pastebin.

(defun seq-intersect-p (seq1 seq2 &rest sequences)
 "Determine if the intersection of SEQ1, SEQ2 and SEQUENCES is non-nil."
 (cl-do* ((sequences `(,seq1 ,seq2 ,@sequences) (cdr sequences))
          (seq (car sequences) (car sequences))
          (elements (make-hash-table :test #'equal))
          (intersect-p nil))
     ((or (seq-empty-p sequences)) intersect-p)
   (cl-do* ((seq seq (cdr seq))
            (element (car seq) (car seq)))
       ((or intersect-p (seq-empty-p seq)) intersect-p)
     (if (ht-get elements element)
         (setf intersect-p t)
       (ht-set elements element t)))))

(defun test-seq-intersect-p ()
 "Test cases."
 (cl-assert (null (seq-intersect-p '()
                                   '())))
 (cl-assert (null (seq-intersect-p '(1)
                                   '())))
 (cl-assert (null (seq-intersect-p '(1 2)
                                   '(3 4)
                                   '(5 6))))
 (cl-assert (seq-intersect-p '(1 2)
                             '(3 4)
                             '(5 6)
                             '(1)))
 t)

(test-seq-intersect-p)

Version 2

(defun seq-intersect-p (first second & sequences)
  "Determine if FIRST, SECOND and any of the sequences in SEQUENCES have
an intersection."
  (if (seq-empty-p sequences)
      (seq-intersection first second)
    (or (seq-intersection first second)
        (apply #'seq-intersect-p
               first
               (seq-first sequences)
               `,@(seq-rest sequences))
        (apply #'seq-intersect-p
               second
               (seq-first sequences)
               `,@(seq-rest sequences))
        (apply #'seq-intersect-p
               (seq-first sequences)
               (seq-elt sequences 2)
               `,@(seq-rest (seq-rest sequences))))))
 

cross-posted from: https://lemmy.ml/post/4591838

Suppose I need to find out if the intersection of an arbitrary number of lists or sequences is empty.

Instead of the obvious O(n^2^) approach I used a hash table to achieve an O(n) implementation.

Now, loop mini-language aside, is this idiomatic elisp code? Could it be improved w/o adding a lot of complexity?

You can view the same snippet w/ syntax highlighting on pastebin.

(defun seq-intersect-p (seq1 seq2 &rest sequences)
 "Determine if the intersection of SEQ1, SEQ2 and SEQUENCES is non-nil."
 (cl-do* ((sequences `(,seq1 ,seq2 ,@sequences) (cdr sequences))
          (seq (car sequences) (car sequences))
          (elements (make-hash-table :test #'equal))
          (intersect-p nil))
     ((or (seq-empty-p sequences)) intersect-p)
   (cl-do* ((seq seq (cdr seq))
            (element (car seq) (car seq)))
       ((or intersect-p (seq-empty-p seq)) intersect-p)
     (if (ht-get elements element)
         (setf intersect-p t)
       (ht-set elements element t)))))

(defun test-seq-intersect-p ()
 "Test cases."
 (cl-assert (null (seq-intersect-p '()
                                   '())))
 (cl-assert (null (seq-intersect-p '(1)
                                   '())))
 (cl-assert (null (seq-intersect-p '(1 2)
                                   '(3 4)
                                   '(5 6))))
 (cl-assert (seq-intersect-p '(1 2)
                             '(3 4)
                             '(5 6)
                             '(1)))
 t)

(test-seq-intersect-p)
 

Suppose I need to find out if the intersection of an arbitrary number of lists or sequences is empty.

Instead of the obvious O(n^2^) approach I used a hash table to achieve an O(n) implementation.

Now, loop mini-language aside, is this idiomatic elisp code? Could it be improved w/o adding a lot of complexity?

You can view the same snippet w/ syntax highlighting on pastebin.

(defun seq-intersect-p (seq1 seq2 &rest sequences)
  "Determine if the intersection of SEQ1, SEQ2 and SEQUENCES is non-nil."
  (cl-do* ((sequences `(,seq1 ,seq2 ,@sequences) (cdr sequences))
           (seq (car sequences) (car sequences))
           (elements (make-hash-table :test #'equal))
           (intersect-p nil))
      ((or (seq-empty-p sequences)) intersect-p)
    (cl-do* ((seq seq (cdr seq))
             (element (car seq) (car seq)))
        ((or intersect-p (seq-empty-p seq)) intersect-p)
      (if (ht-get elements element)
          (setf intersect-p t)
        (ht-set elements element t)))))

(defun test-seq-intersect-p ()
  "Test cases."
  (cl-assert (null (seq-intersect-p '()
                                    '())))
  (cl-assert (null (seq-intersect-p '(1)
                                    '())))
  (cl-assert (null (seq-intersect-p '(1 2)
                                    '(3 4)
                                    '(5 6))))
  (cl-assert (seq-intersect-p '(1 2)
                              '(3 4)
                              '(5 6)
                              '(1)))
  t)

(test-seq-intersect-p)
 

cross-posted from: https://lemmy.ml/post/4560181

A follow up on [DISCUSS] Website to monitor Lemmy servers' performance/availability


I wanted to experiment w/ Lemmy's APIs to, eventually, build a public-facing performance monitoring solution for Lemmy.

It started w/ a couple of shell commands which I found myself repeating. Then I recalled the saying "Don't repeat yourself - make Make make things happen for you!" and, well, stopped typing commands in bash.

Instead I, incrementally, wrote a makefile to do the crud work for me (esp thanks to its declarative style): https://github.com/bahmanm/lemmy-clerk/blob/v0.0.1/run-clerk


TBH there's nothing special about the file. But I thought I'd share this primarily b/c it is a demonstration of the patterns I usually use in my makefiles and I'd love some feedback on those.

Additionally, it's a real world use-case for bmakelib (a library that I maintain ๐Ÿ˜Ž )

 

cross-posted from: https://lemmy.ml/post/4560181

A follow up on [DISCUSS] Website to monitor Lemmy servers' performance/availability


I wanted to experiment w/ Lemmy's APIs to, eventually, build a public-facing performance monitoring solution for Lemmy.

It started w/ a couple of shell commands which I found myself repeating. Then I recalled the saying "Don't repeat yourself - make Make make things happen for you!" and, well, stopped typing commands in bash.

Instead I, incrementally, wrote a makefile to do the crud work for me (esp thanks to its declarative style): https://github.com/bahmanm/lemmy-clerk/blob/v0.0.1/run-clerk


TBH there's nothing special about the file. But I thought I'd share this primarily b/c it is a demonstration of the patterns I usually use in my makefiles and I'd love some feedback on those.

Additionally, it's a real world use-case for bmakelib (a library that I maintain ๐Ÿ˜Ž )

 

A follow up on [DISCUSS] Website to monitor Lemmy servers' performance/availability


I wanted to experiment w/ Lemmy's APIs to, eventually, build a public-facing performance monitoring solution for Lemmy.

It started w/ a couple of shell commands which I found myself repeating. Then I recalled the saying "Don't repeat yourself - make Make make things happen for you!" and, well, stopped typing commands in bash.

Instead I, incrementally, wrote a makefile to do the crud work for me (esp thanks to its declarative style): https://github.com/bahmanm/lemmy-clerk/blob/v0.0.1/run-clerk


TBH there's nothing special about the file. But I thought I'd share this primarily b/c it is a demonstration of the patterns I usually use in my makefiles and I'd love some feedback on those.

Additionally, it's a real world use-case for bmakelib (a library that I maintain ๐Ÿ˜Ž )

 

Originally asked in #lemmy:matrix.org


1 The Idea

I've been thinking about writing a website to monitor Lemmy instances, much in the same vein as lemmy-status.org, to help people like me, who are interested in the operational health of their favourite servers, have a better understanding of patterns and be notified when things go wrong.

I thought I'd share my thoughts w/ you and ask for your feedback before going down any potential rabbit hole.

1.1 Public-facing monitoring solution external to a cluster

I don't wish to add any more complexity to a Lemmy setup. Rather I'm thinking about a solution which is totally unknown to a Lemmy server AND is publicly available.

I'm sure one could get quite a decent monitoring solution which is internal to the cluster using Prometheus+Grafana but that is not the aim of this.

1.2 A set of key endpoints

In the past there've been situations where a particular server's web UI would be a 404 or 503 while the mobile clients kept happily working.

I'd like to query a server for the following major functionalities (and the RTT rate):

  • web/mobile home feed
  • web/mobile create post/comment
  • web/mobile search

1.3 Presenting stats visually via graphs

I'd like to be able to look at the results in a visual way, preferably as graphs.

1.4 History

I think it'd be quite cool (and helpful?) to retain the history of monitoring data for a certain period of time to be able to do some basic meaningful query over the rates.

1.5 Notification

I'd like to be able to receive some sort of a notification when my favourite instance becomes slow or becomes unavailable and when it comes back online or goes back to "normal."

2 Questions

โ“ Are you folks aware if someone has already done something similar?

โ“ I'm not very familiar w/ Rust (I wrote only a couple of small toy projects w/ it.) Where can I find a list of API endpoints a Lemmy server publicly exposes?

โ“ If there's no such list, which endpoints do you think would work in my case?

 

cross-posted from: https://lemmy.ml/post/4440129

I am not the author.

https://addons.mozilla.org/en-GB/android/addon/github-license-observer/

https://github.com/galdor/github-license-observer

This is a cool little addon to help you tell, at a glance, if the repository you're browsing on github has an open source license license.

Especially relevant nowadays given the trend to convert previously OS repos to non-OS licenses as a business model (eg Akka or Terraform.)

view more: โ€น prev next โ€บ