Skip Navigation
InitialsDiceBearhttps://github.com/dicebear/dicebearhttps://creativecommons.org/publicdomain/zero/1.0/„Initials” (https://github.com/dicebear/dicebear) by „DiceBear”, licensed under „CC0 1.0” (https://creativecommons.org/publicdomain/zero/1.0/)ON
onlinepersona @programming.dev
Posts 143
Comments 3.6K

Why hasn't gradle been adopted for C/C++ projects?

I know little about gradle and have only just started exploring it, so this is just a question out of curiosity.

It's supposedly a language agnostic dependency manager and builder, yet it seems to have only found its niche in Java. C/C++ projects could definitely do with dependency resolution...

8
What's the best-practice way to containerise a bot with different environment variables?
  • It's probably "sh" "-c" that was being used. That's the ENTRYPOINT. CMD is passed to the ENTRYPOINT. The docs explain it well, I think.

    As for volumes, TL;DR these are mounted into the container at runtime and are not in the image. You may put the dev and production config in the image, but I'd advise against it, especially if the production config contains secrets. Then they'll be baked into the docker image.

    long explanation

    A docker image is basically an archive of archives. Each line you put in a Dockerfile is executed and the result thereof is put into an archive with a name (hash of the contents plus maybe other stuff) and that's called a layer. To keep the layers small, they contain only the updates to the previous layer. This is done with Copy On Write (CoW).

    FROM alpine
    RUN touch /something # new archive with one single file
    RUN apk add curl # new archive with paths to curl WITHOUT /something
    

    To run a docker image aka docker run $options $image. The archive and its layers are extracted, then a new runtime environment is created using linux kernel namespaces (process namespace, network namespace, mount / storage namespace, ...), and the sum of the layers is mounted in there as a "volume". That means the processes within the container are segregated from the host's processes, the container's network is also segregated, the storage / files and folders too, and so on.

    So there's a, for lack of a better term, root/runtime volume (/) from the sum of layers. So the container only sees the the layers (plus some other fundamental stuff to run like /dev, /proc, etc.). You can mount a file into the container, a folder, a device, or even a network drive if you have the right driver installed. Mounting a file or folder is called a "bind mount", everything else (if I'm not mistaken) is just a mount. Volumes in docker are built on top of that. The doc explains in detail what volumes are and their naming.

    In conclusion, docker image = archive, docker container = extracted archive running in linux namespaces, volume = storage that be mounted into container.

    Finally, parameterising compose files: use environment variables. You can put then into a .env beside your compose.yaml or set them before calling e.g ENVIRONMENT_VARIABLE=someValue docker compose up.

    They are "interpolated" aka used in the compose file like so

    services:
      web:
        image: "webapp:${TAG}"
    

    I recommend you read the docs on the syntax, but for your purpose I'd use something like

    volumes:
      - ${ENV_FILE:?Env file not provided}:/usr/src/app/.env
    

    Then you can ENV_FILE=prod.env docker compose up or put the env var in .env and docker compose will pick it up.

    Anti Commercial-AI license

  • What's the best-practice way to containerise a bot with different environment variables?
  • Concerning environment variables, you can use volumes in the compose.yaml to bind mount files or directories in your container e.g

    services:
      node:
        volumes:
          - ./prod.env:/usr/src/app/.env
          - ./dev.env:/usr/src/app/.env.development
    

    @[email protected] is probably right about the CMD. Read the documentation and learn about the two modes CMD has. Try to figure it out yourself and if you can't, reveal the spoiler below

    What I think should work

    CMD ["npm", "start"]

    runs npm with the start argument. What you passed was like running "npm start" in your shell. It looks for a command that's literally called "npm" "space" "start", which of course doesn't exist.

    Anti Commercial-AI license

  • "Behold, a Linux maintainer openly admitting to attempting to sabotage the entire Rust for Linux project". Thoughts on this post from Marcan?
  • Good grief. People like this Chris dude hold progress back. I'll keep banging the drum (to be heard by not a single kernel dev, but anyway): the linux kernel need 90% of the Linux Foundation's funding, not a mere 2%. There should be so many people wanting to be a maintainer that people who openly declare that they want to get in the way like this are easier to remove.

    Anti Commercial-AI license

  • OpenEuroLLM: European AI alliance unveils LLM alternative to Silicon Valley and DeepSeek
  • According to OpenEuroLLM, the models, software, data, and evaluation will be fully open. [...] The models will be available for commercial, industrial, and public services.

    "OpenEuroLLM". Is this going to be another misnomer for a model that isn't actually open? The quote doesn't give me much hope. I bet they'll have to use Anna's Archive to train their AI too 🤫

    Anti Commercial-AI license

  • systemd: BindReadOnlyPaths alternative allowing user to read it

    I've inherited a systemd service and it uses BindReadOnlyPaths to make certain paths available to the service (doc)

    > A bind mount makes a particular file or directory available at an additional place in the unit's view of the file system. Any bind mounts created with this option are specific to the unit, and are not visible in the host's mount table.

    The service is running using a specific user and I would like the user to access those read-only paths outside of the service. Is there an possibility within systemd that would allow me to do that?

    Edit: solved it with a systemd bind mount

    3

    Video Game skins now cost $1,000,000 - Viva La Dirt League

    0

    Who needs newfangled stuff like forums? 🤢

    11

    What kind of music do you listen to?

    IRL, I once listed my favorite bands across metal, rock, hip-hop, electronic, and drum n bass and was hit with "that's standard programmer music".

    As someone with little physical human contact outside of work and actually meeting devs outside to find out they listen to the same music was a little surprising. That was a tiny sample though and this is the web though and people are from all over, what kind of stuff do you listen to? Favorite genres, artists, or just "everything" even noise?

    52

    How do I find out why I2P thinks it's firewalled?

    The device with I2P is behind a NAT router without UPnP. The device has a firewall but has opened the UDP and TCP port for internet facing communication. The ports from the router are forward to the device's ports. Are there any ports missing?

    Edit: I finally figured it out. The port forwarding was only for TCP. It would be good to have logs or some kind of status window stating why it thinks it's firewalled though.

    Anti Commercial-AI license

    4

    addition to the USB updates and big staging flush merged yesterday for the Linux 6.13 kernel merge window, the "char/misc" pull was also honored for that catch-all of various kernel changes. With the char/misc pull there are some notable additions for those wanting to write kernel drivers within the Rust programming language.

    1

    Rant: I wish more people stopped using Github

    They slowly started locking down the platform for people without accounts and it has been really annoying to use the website since. First it was not possible to search for code, then even searching for issues got more and more difficult with it randomly failing, and now it's gotten to the point where I can't search for a fucking project anymore!

    Github's search is becoming as bad as reddit's, where if you want to find anything, a secondary service like SourceGraph, GrepApp, or even a dumb search engine is better. Sometimes those haven't indexed what I need (especially code search), so I have to download the bloody tarball and rg for whatever the fuck it is I was looking for. Sometimes it will also block the VPN I'm using, so I have to proxy to a non-VPNed machine. The world could do without these unnecessary roadblocks.

    What also grinds my gears is requiring an account to contribute. There is no way to send in a patch, raise an issue, or anything without an account there, so by if a project being on github, you have no choice but to give Microsoft your data to participate in opensource. Don't get me wrong, mailing-lists are filth, but and I'd rather claw my eyes out than participate in any project demanding their use, but Microsoft being the "lesser evil" is not a good look.

    Please, for the love of opensource, get your project off of github, please. It's a monopoly at this point and doing microsoft things. This isn't the end and they'll probably do more stuff to see how far they can push it. We'll all be the boiled frogs.

    Yes, I know they have a CI and some other features, but if all you're doing is hosting your code, please consider an alternative.

    Possible alternatives in alphabetic order:

    • Codeberg (could have federation in the future)
    • Gitlab (has CI)
    • OneDev (no git SSH clone but feature-rich) not an instance for the public
    • Radicle (no CI, but federated)
    • Sourcehut (minimalist, but fast as fuck)

    or maybe others will suggest more.

    104

    How can we help FSF with their "Upgrade From Windows" campaign?

    Right now their page https://upgradefromwindows.com just redirects to https://www.fsf.org/windows which has a wall of text and an infographic. Even I, who doesn't have windows and will never reinstall it unless forced, clicked away from the page within 5 seconds. The FSF desperately needs help with marketing and design, plus it would be great to have tooling for brain-dead linux installation (no, find distribution, backup, put linux on a USB-stick, reboot, hit some button to get into the BIOS, select "USB stick", reboot, click through installation, find alternative software, is not brain-dead).

    18

    How could digitial age verification be possibly implemented with privacy in mind?

    Many might've seen the Australian ban of social media for <16 y.o with no idea of how to implement it. There have been mentions of "double blind age verification", but I can't find any information on it.

    Out of curiosity, how would you implement this with privacy in mind if you really had to?

    82
    phys.org The mechanics of ovulation: Study explains how muscle-like fibers help eggs squeeze out from follicle

    Eggs pop out of ovaries. But what propels them has been unknown. Now, researchers from the University of Connecticut explain in an article published in the September 18 issue of the Proceedings of the National Academy of Sciences that tiny, muscle-like fibers in the ovary's cells squeeze the egg out...

    The mechanics of ovulation: Study explains how muscle-like fibers help eggs squeeze out from follicle

    cross-posted from: https://rss.ponder.cat/post/53510

    1

    cross-posted from: https://lemmy.ca/post/32201894

    0

    Snapdragon 8 Elite arrives with Linux support, potentially unlocking PC gaming on phones and tablets

    cross-posted from: https://lemmy.zip/post/25405532

    > > Qualcomm engineering director Trilok Soni recently confirmed that the company's Linux team published Linux kernel updates for the Snapdragon 8 Elite processor. Qualcomm unveiled the SoC earlier this month, targeting a new generation of flagship phones and tablets supporting Android and Linux.

    12
    phys.org 'Party atmosphere': Skygazers treated to another aurora show

    Scientist Jim Wild has traveled to the Arctic Circle numerous times to study the northern lights, but on Thursday night he only needed to look out of his bedroom window in the English city of Lancaster.

    'Party atmosphere': Skygazers treated to another aurora show

    > Scientist Jim Wild has traveled to the Arctic Circle numerous times to study the northern lights, but on Thursday night he only needed to look out of his bedroom window in the English city of Lancaster.

    2
    www.scientificamerican.com Dark Matter Black Holes Could Fly through the Solar System Once a Decade

    The universe’s hidden mass may be made of black holes, which could wobble the planets of the solar system when they pass by

    Dark Matter Black Holes Could Fly through the Solar System Once a Decade

    > Black holes the size of an atom that contain the mass of an asteroid may fly through the inner solar system about once a decade, scientists say. Theoretically created just after the big bang, these examples of so-called primordial black holes could explain the missing dark matter thought to dominate our universe. And if they sneak by the moon or Mars, scientists should be able to detect them, a new study shows.

    33

    What if somebody wrote a virus that infected windows computers to replace the OS with linux?

    8
    phys.org A possible explanation for the 'missing plastic problem': New detection technique finds microplastics in coral skeletons

    Researchers from Japan and Thailand investigating microplastics in coral have found that all three parts of the coral anatomy—surface mucus, tissue, and skeleton—contain microplastics. The findings were made possible thanks to a new microplastic detection technique developed by the team and applied ...

    A possible explanation for the 'missing plastic problem': New detection technique finds microplastics in coral skeletons

    These findings may also explain the "missing plastic problem" that has puzzled scientists, where about 70% of the plastic litter that has entered the oceans cannot be found. The team hypothesizes that coral may be acting as a "sink" for microplastics by absorbing it from the oceans. Their findings were published in the journal Science of the Total Environment.

    0
    phys.org A possible explanation for the 'missing plastic problem': New detection technique finds microplastics in coral skeletons

    Researchers from Japan and Thailand investigating microplastics in coral have found that all three parts of the coral anatomy—surface mucus, tissue, and skeleton—contain microplastics. The findings were made possible thanks to a new microplastic detection technique developed by the team and applied ...

    A possible explanation for the 'missing plastic problem': New detection technique finds microplastics in coral skeletons

    cross-posted from: https://rss.ponder.cat/post/30414

    4
    phys.org Deserts' biggest threat? Flooding

    A new study from the USC Viterbi School of Engineering researchers, along with researchers from the Institute de Physique du Globe de Paris at the University of Paris Cité, has found that the increase in soil erosion in coastal areas due to desertification is worsening flood impacts on Middle Easter...

    Deserts' biggest threat? Flooding

    > A new study from the USC Viterbi School of Engineering researchers, along with researchers from the Institute de Physique du Globe de Paris at the University of Paris Cité, has found that the increase in soil erosion in coastal areas due to desertification is worsening flood impacts on Middle Eastern and North African port cities.

    0

    Radicle 1.0 released

    radicle.xyz Radicle

    Sovereign code infrastructure.

    Radicle

    cross-posted from: https://discuss.tchncs.de/post/21810137

    > Radicle is an open source, peer-to-peer code collaboration stack built on Git. Unlike centralized code hosting platforms, there is no single entity controlling the network. Repositories are replicated across peers in a decentralized manner, and users are in full control of their data and workflow.

    0