Spyke

Replies

general

Comment on

Community Ideas / Places that I subscribed to elsewhere

Thanks for making this list.

Unfortunately it doesn't look like tags, labels, or any other form of categorization exists: https://github.com/LemmyNet/lemmy/issues/2946

When you create a community you define an immutable "Name" (the !name@[...]) and a "Display Name" like:

  • Name: pc_gaming
  • Display Name: PC Gaming

I'm not sure I'd want to see free-form communities mimicking Reddit 1:1 here though. "TheWeeklyRoll" at a glance might be about drugs, Dungeons & Dragons (heh -- it is!), gambling, or bread. If only it was possible to set a short description separate from the sidebar that showed up in search results.

![email protected] - 10 subscribers - A Dungeons and Dragons themed web comic

I'd be totally fine with comic_[name] or comics_[author]. With that said it seems namespacing with underscores might be the only way to let people know what they're looking at.

Video Content

  • media_[service]_[channel]

Where service might be peertube (pt), youtube (yt), odysee (od), dailymotion (dm), etc

Tabletop Gaming

  • tabletop_gaming (generic chat)
  • tabletop_gaming_[genre]

PC Gaming

  • pc_gaming (generic chat)
  • pc_gaming_[operating_system]

Retro Gaming

  • retro_gaming (generic chat)
  • retro_gaming_[device]

Software

  • software_[product]

Programming (low-level)

  • programming_[lang]

Development (high-level)

  • devel_[topic]

Where topic might be a framework or library. But I think posting "Where can I find a good Tk tutorial?" to !programming_python or "How do I decompress a file with libz?" in !programming_c is perfectly fine. In the worst case the person can just cross-post to devel_[whatever-seems-right].

This scheme isn't perfect either. Some people might consider "ffxiv" worthy of its own namespace. Otherwise it'd end up with ridiculously long name like pc_gaming_ffxiv_{guides,clans,lore,...} instead of simply ffxiv_{help,clans,lore,...}. I'll have to sleep on it.

I want to keep this instance on-topic as much as possible though. That is to say that even if I like/enjoy something... If it doesn't fit the theme of the landing page's side bar it probably won't exist here as a local community.

Comment on

Issues with emails not verified

Reply in thread

Yes. You can use an existing SMTP server (gmail [legacy app mode], yahoo, microsoft, etc). One thing to keep in mind -- if you decide to go that route don't use your personal account because the address might be exposed in the mail headers. Create a dedicated account and use that instead.

lemmy.hjson

email: {
    smtp_server: "smtp.example.tld:[port]" # port 25, port 587, etc
    smtp_login: "username"
    smtp_password: "password"
    smtp_from_address: "[email protected]" # or [email protected]
    tls_type: "tls" # or starttls
}
general

Comment on

Bug in UI

Oh yeah, I've seen this too but only when I have multiple Lemmy instances open. When I posted "Death by user count" it told me I posted it to lemmy.einval.net through lemmy.ml's instance. I had to shift+ctrl+r to get it to show the correct pathway. Its definitely weird that session data is leaking around between logins. You'd think each cookie/session/socket would be totally unique.

I saw they've been working on ditching websockets in favor of a pure REST API. Hopefully this will stop when they release v18.0.

general

Comment on

Be careful with your language settings!

Reply in thread

I haven't had that happen to me yet, but it sounds annoying as hell. The "undetermined" language shouldn't exist. That needs be a silent default. The user should be able select their primary language with a drop-down menu. The combo box would still exist but it'd be completely optional.

In your case it'd be nice if the "Select Language" drop-down was automatically set to the community's default language. And maybe put a little red icon next to it when your language settings are incompatible.

x86_asm

Comment on

What's good setup for learning assembly on linux?

What I use on Linux:

  1. Vim
  2. GNU Make
  3. NASM (nasm.us)

NASM uses Intel assembly syntax. If you want to learn and use AT&T syntax you can use GNU Assembler (as) provided by the bintutils package instead.

How I use it:

Create a project

mkdir hello_world
cd hello_world
touch Makefile hello_world.asm

Write a Makefile

Note the indents below are supposed to be TAB characters, not spaces.

Makefile

all: hello_world

hello_world.o: hello_world.asm
        nasm -o $@ -f elf32 -g $<

hello_world: hello_world.o
        ld -m elf_i386 -g -o $@ $<

.PHONY: clean
clean:
        rm -f hello_world *.o

Write a program

hello_world.asm

; Assemble as a 32-bit program
bits 32

; Constants
SYS_EXIT  equ 1         ; Kernel system call: exit()
SYS_WRITE equ 4         ; Kernel system call: write()
FD_STDOUT equ 1         ; System file descriptor to write to
EXIT_SUCCESS equ 0

; Variable storage
section .data
        msg:            db "hello world from ", 0
        msg_len:        equ $-msg
        linefeed:       db 0xa ; '\n'
        linefeed_len:   equ $-linefeed

; Program storage
section .text
global _start

_start:
        ; Set up stack frame
        push ebp
        mov ebp, esp

        ; Set base pointer to argv[0]
        add ebp, 8

        ; Write "hello world from " message to stdout
        mov eax, SYS_WRITE
        mov ebx, FD_STDOUT
        mov ecx, msg
        mov edx, msg_len
        int 80h

        ; Get length of argv[0]
        push dword [ebp]
        call strlen
        mov edx, eax

        ; Write the program execution path to stdout
        mov eax, SYS_WRITE
        mov ebx, FD_STDOUT
        mov ecx, [ebp]
        ; edx length already set
        int 80h

        ; Write new line character
        mov eax, SYS_WRITE
        mov ebx, FD_STDOUT
        mov ecx, linefeed
        mov edx, linefeed_len
        int 80h

        ; End of stack frame
        pop ebp

        ; End program
        mov eax, SYS_EXIT
        mov ebx, EXIT_SUCCESS
        int 80h

strlen:
        ; Set up stack frame
        push ebp
        mov ebp, esp

        ; Set base pointer to the first argument on the stack
        ; strlen(buffer);
        ;        ^
        add ebp, 8

        ; Save registers we plan to write to
        push ecx
        push esi

        ; Clear string direction flag
        ; (i.e. lodsb will *increment* esi)
        cld

        ; Zero counter
        xor ecx, ecx

        ; Load address of buffer into the "source index" register
        mov esi, [ebp]
        .loop:
                ; Read byte from esi
                ; Store byte in eax
                lodsb

                ; Loop until string NUL terminator
                cmp eax, 0
                je .return
                ; else: Increment counter and continue
                inc ecx
                jmp .loop

        .return:
                ; Return string length in eax
                mov eax, ecx

                ; Restore written registers
                pop esi
                pop ecx

                ; End stack frame
                pop ebp

                ; Pop stack argument
                ; 32-bit word is 4 bytes. We had one argument.
                ret 4 * 1

Compile and run

$ make
nasm -o hello_world.o -f elf32 -g hello_world.asm
ld -m elf_i386 -g -o hello_world hello_world.o
$ ./hello_world 
hello world from ./hello_world

Adding a debug target to the makefile

Want to fire up your debugger immediately and break on the main entrypoint? No problem.

Makefile

gdb: hello_world
    gdb -tui -ex 'b _start' -ex 'run' --args $<

Now you can clean the project, rebuild, and start a debugging session with one command...

$ make clean gdb
rm -f hello_world *.o
nasm -o hello_world.o -f elf32 -g hello_world.asm
ld -m elf_i386 -g -o hello_world hello_world.o
gdb -tui -ex 'b _start' -ex 'run' --args hello_world
# You're debugging the program in GDB now. Poof.
general

Comment on

Bug in UI

Reply in thread

It's a manual process. In theory an upgrade should be as easy as updating the image tags for Lemmy and Lemmy UI in the docker-compose.yml file, then taking everything down and praying it starts back up again.

I'm not sure how they're going to go about telling everyone they need to upgrade. Or I guess I'll wake up to an unfederated/dead instance with a massive error log at some point. 😂

You reached the end