• 12 Posts
  • 88 Comments
Joined 8 months ago
cake
Cake day: June 2nd, 2024

help-circle


  • Could you provide a link to the documentation for the endpoint you want to access? I can’t find it. My guess is that you need to fetch a specific user via ${api}/user/124356.

    Docs here. My guess is wrong.

    God, that documentation is annoying to read. I revise my revised opinion. Try providing a user ID or a username as query parameters in your API call.

    const response = await fetch(`${api}/user?person_id=123456`, {
        method: "GET",
        headers: {
            "Content-Type": "application/json",
            "Authorization": `Bearer ${lemmyToken}`
        }
    });
    


  • If you’re using a descendant of Debian, you will find a line like this in your ~/.bashrc file:

    PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$
    

    The 32m part controls the color of the username. (\u). 1 is red, 2 is green (as seen in the user and host part, \u@\h), 3 (as seen for the directory, \w) is blue.

    You can use this to distinguish different hosts by color.












  • Yes, you can do crazy shit if you try hard enough, but every reasonable programmer would access foo->child->b als foo->child->b and not via that crazy LISPy expression.

    By question was: Why would you have a pointer to a memory address that itself only holds a pointer somewhere else?

    So far the only reasonable explanation is from @Victoria@lemmy.blahaj.zone:

    • arrays of function pointers
    • pass by reference of a pointer




  • show you a GUI saying “you’re running low on memory, here are your running programs and how much they are using”

    Good luck with this approach on a server.

    If by ‘suspend’ you mean that the process will just halt, then: Which processes? All of them? Good luck displaying a message then. The last one that made a memory request? That might not be the true offender. The highest-consuming process? Same logic applies.

    If by ‘suspend’ you mean moving the memory to disk, then a single misbehaving process, may end up eating all of memory and all remaining disk space.


  • I did try to catch all of these signals:

                    | "SIGABRT"
                    | "SIGALRM"
                    | "SIGBUS"
                    | "SIGCHLD"
                    | "SIGCONT"
                    | "SIGFPE"
                    | "SIGHUP"
                    | "SIGILL"
                    | "SIGINT"
                    | "SIGIO"
                    | "SIGIOT"
                    | "SIGKILL"
                    | "SIGPIPE"
                    | "SIGPOLL"
                    | "SIGPROF"
                    | "SIGPWR"
                    | "SIGQUIT"
                    | "SIGSEGV"
                    | "SIGSTKFLT"
                    | "SIGSTOP"
                    | "SIGSYS"
                    | "SIGTERM"
                    | "SIGTRAP"
                    | "SIGTSTP"
                    | "SIGTTIN"
                    | "SIGTTOU"
                    | "SIGUNUSED"
                    | "SIGURG"
                    | "SIGUSR1"
                    | "SIGUSR2"
                    | "SIGVTALRM"
                    | "SIGWINCH"
                    | "SIGXCPU"
                    | "SIGXFSZ"
                    | "SIGBREAK"
                    | "SIGLOST"
                    | "SIGINFO";