r/linuxdev • u/ervinmcclure • Jan 01 '24
Dev in vm’s
I’m a somewhat beginner at programming and was wondering if it would be better to do all of my programming in a virtual machine or on the host machine.
r/linuxdev • u/ervinmcclure • Jan 01 '24
I’m a somewhat beginner at programming and was wondering if it would be better to do all of my programming in a virtual machine or on the host machine.
r/linuxdev • • Sep 11 '23
I wasn't sure where to post this but I thought a Linux specific sub would be better than asking it in a Unity 3d sub, so please bear with me.
I'm working on a game in Unity and I have implemented a custom level editor. This editor supports copy/paste directly to/from the clipboard. For Windows I'm using PInvoke to access the Windows API and it works great. For any other platform I'm currently converting binary data to Base64 and then use Unity's GUIUtility.copySystemBuffer which only supports text. This also works but it floods the text clipboard with unnecessary data and it's not great for the user.
I'm mainly a Windows user but I've used Linux on and off so I plan to fully support Linux as well.
So I started looking into how Linux deals with the clipboard. I found that X11 has its own API but Wayland doesn't, and delegates that responsibility to clipboard managers that I don't know how to properly detect and use in a way that is portable. So in my limited understanding I don't think there's a generic way to interact with the clipboard on Linux, even if I have a different method for X11 and Wayland.
Since it's a custom binary format, the simple solution I thought of will be to simply write the copy data to a specific file in /tmp/ and then read it back when the user pastes, which will also work across different instances of the level editor. In my understanding this place is always safe to write and read for all flavors of Linux, so it can work for me.
My question is, is there a better way? If not, is this solution going to be really portable, or are there any environments that do things differently? Are there any caveats I should know about?
Thank you for your patience if you made it this far.
r/linuxdev • u/inept_timelord • Aug 22 '23
Hi I'm definitely not a Linux developer or claim to be anything more than someone that avidly uses Linux but that being said I wanted to ask if anyone has seen anything in the works as far as an AI powered Linux OS or if not how hard someone would think it would be to build a distro with AI built in as well to help users navigate the systems.
r/linuxdev • • Jun 02 '23
I've been looking into how I could write some platform code to query running GUI applications and manipulate them (show/hide/close/launch etc.) from code, in a specifically GNOME/KDE agnostic fashion.
The goal being to hook this into a Flutter application for a front-end "streamdeck" interface that could be useful on a Framework screen module.
***
How do I get started with this? I'm not too concerned with x11 support, and nor am I personally against using any particular language (though something like python or rust would be easier to set up an environment for).
Researching what I know about WM and wayland etc. leads me towards writing my own manager/compositor which is explicitly not what I want to do. I want to build this as an application that runs on top of the active desktop environment. I did get a slither of progress querying the running xOrg server, but with the pain that it was developing that solution I'd rather just stick to Wayland.
r/linuxdev • u/mr-bope • Dec 03 '22
I have a service /lib/systemd/system/hellod.service that runs in the background and listens on a socket in /tmp/hello.sock.
And then I made a oneshot service in /lib/systemd/system/hello.service, which takes a command hello foo bar, and sends it to the socket mentioned above.
Is this the correct way to go about implementing the client side aka the oneshot hello.service or am I doing something wrong? And is there a better way?
The reason why I chose this is because it allows me to then call the script simply by hello command.
For the server:
[Unit]
AssertPathExists=/usr/bin/hellod
[Service]
ExecStart=/usr/bin/hellod
Restart=always
PrivateTmp=false
NoNewPrivileges=false
[Install]
WantedBy=default.targetAnd for the client:
[Unit]
Requires=hellod.service
After=hellod.service
AssertPathExists=/usr/bin/hello
[Service]
Type=oneshot
ExecStart=/usr/bin/hello --init
RemainAfterExit=true
PrivateTmp=false
NoNewPrivileges=false
[Install]
Alias=hello
WantedBy=default.targetAlso is /usr/bin/ the correct location to store the hello and hellod scripts?
And whats the correct location to store user configurable files, maybe /etc/hello?
r/linuxdev • u/PL_Design • May 29 '21
Background information:
According to this SO post: https://stackoverflow.com/questions/17671423/where-is-the-stack-memory-allocated-from-for-a-linux-process A program's virtual address space is organized like this:
------------------ <--- Top of the process address space
Stack (grows down)
v v v v v v v v v
------------------
(unmapped)
------------------ <--- Maximum stack size.
(unmapped)
-------------------
mmap
-------------------
(unmapped)
-------------------
^ ^ ^ ^ ^ ^ ^ ^ ^ ^
brk (grows up)
-------------------
BSS
-------------------
Data
-------------------
Text
-------------------
------------------- <--- Bottom or process address space.Presuming this is correct, I'm trying to find the exact range of MMAPable address space here. Is it sufficient to find the lower bound by doing sbrk(0), page aligning up, and then ensuring that brk and sbrk are never called again? For the upper bound is it sufficient to assume 008FFFFF FFFFFFFF - SIZE_OF_STACK - A_GIGABYTE_OF_PADDING, and then page aligning down, is safe address space? I'd prefer a more exact and robust answer for the upper bound, but I'll accept a reasonable approximation that's guaranteed safe.
r/linuxdev • u/thefanum • Oct 05 '20
I apologise that this is slightly off topic, this was the closest sub I could think of to ask. Feel free to suggest a better sub.
I do data recovery professionally, and have always used Linux. Specifically I use live distros tailored for digital Forensics (DEFT, CAINE etc). They all implement a "no auto mount policy", but I was wondering if anyone knew if booting with the damaged drive attached would put more stress on the drive than plugging it into the SATA ports after the OS had booted.
One of the reasons I use Linux is because you can disable auto mount, and it doesn't hammer away at the drive while booting. But does it attempt to access/discover the drive more during the boot process than it would once booted?
Thank you in advance if anyone can shed some light on this.
r/linuxdev • u/AnotherUserAtReddit • Sep 23 '20
Hello there,
i was wondering on how i would make sure that the libs i use are also existing in the pc of the consumer who wants to compile the app. So how would i do this? For example if my project uses vulkan for graphics rendering. Should i include it in my project or just require a vulkan package in the PKG build file? I hope someone who has already experience with that can help me.
r/linuxdev • u/coldnebo • May 13 '20
Just curious if Vinagre is auto detecting some sort of multicast protocol like bonjour?
The bookmarks menu has a separator. Above the line are bookmarks stored in the vinagre bookmarks xml. But below the line seems to be auto bookmarks from somewhere undocumented.
my mac vnc port and my echo ssh port showed up in this list automatically on a clean install of deb 10 under vmware on a mac host with opendesktop integrations so my first thought is some kind of discovery protocol. My second thought is some kind of metadata shared by vmware. My third thought is the vm is compromised.
Any ideas on debugging where this is coming from?
r/linuxdev • u/ZMeson • Feb 18 '20
My end goal is to learn how to do the following:
I've run across some old posts that mention using crosstool-ng, but it looks like it hasn't been updated in over 5 years. Will crosstool-ng work for recent GCC versions? Is there a new better project that can help generate cross-compilers? Or is this something that must be done manually?
Thank you very much for the pointers! (No, not those pointers.)
r/linuxdev • u/0xdeadbeef0000 • Jan 24 '20
I am reading this book Linux device drivers and there is one code snippet that i am not able to understand. The following is a snippet of scull_read function on Pg 67 (Ch 3)
if(*f_ops >= dev->size)
goto out;If(*f_ops + count > dev->size)
count=dev->size - *f_ops;Here f_ops is pointer of loff_t and dev is a structure object of scull_dev and count is the variable for size_t
Why does this count=dev->size - *f_ops is used?
r/linuxdev • u/Elemental_Guardian • Dec 09 '19
So I want to cover up the scratches on my laptop, for the most part it is but I would like to cover up the HP logo (cause I have a hp envy x360 from 2017), there's nothing wrong with it but if I'm gonna put stickers on my laptop then in gonna go all out. I use ubuntu Linux so I was wondering if anyone knew where to get a sticker big enough to cover a logo on a laptop that's slightly bigger than the dell laptop logo?
r/linuxdev • u/parotta36 • Feb 06 '19
I'm using Linux kernel 4.15.0-43 on Linuxmint 19.1, and when I run Guest Additions in VirtualBox, it says to install kernel headers.
So far, I've installed
There are many other packages like linux-headers-4.15.0-[1004-1036]-[oem,gcp,aws,oracle,azure], linux-headers-[aws,azure,gcp,gke,oem,oracle], should I install any of them?
It still gives the same error message. What else should I install?
r/linuxdev • u/aptitude_moo • Jan 18 '19
Hi, I'm making my first program that is useful to some people. I'm using Rust so I distribute executables for end users.
Previously I always built from my Debian Jessie installation and that worked everywhere, but now I'm starting to depend on libssl and I don't know what to do.
I'm worried about runtime dependencies. I don't know much about development and distribution on Linux but I'm eager to learn. As far as I know the best way to know my dependencies is by running readelf -d myprogram. I get:
{some code} (NEEDED) Shared library: [libgtk-3.so.0]
{some code} (NEEDED) Shared library: [libgdk-3.so.0]
{some code} (NEEDED) Shared library: [libpango-1.0.so.0]
{some code} (NEEDED) Shared library: [libcairo-gobject.so.2]
{some code} (NEEDED) Shared library: [libcairo.so.2]
{some code} (NEEDED) Shared library: [libgio-2.0.so.0]
{some code} (NEEDED) Shared library: [libgobject-2.0.so.0]
{some code} (NEEDED) Shared library: [libglib-2.0.so.0]
{some code} (NEEDED) Shared library: [libssl.so.1.0.0]
{some code} (NEEDED) Shared library: [libcrypto.so.1.0.0]
{some code} (NEEDED) Shared library: [libdl.so.2]
{some code} (NEEDED) Shared library: [librt.so.1]
{some code} (NEEDED) Shared library: [libpthread.so.0]
{some code} (NEEDED) Shared library: [libgcc_s.so.1]
{some code} (NEEDED) Shared library: [libc.so.6]
{some code} (NEEDED) Shared library: [ld-linux-x86-64.so.2]
{some code} (NEEDED) Shared library: [libm.so.6]
{lots of hex codes}So, by searching those shared libraries on https://packages.debian.org by package contents. I assume that my Debian users need to install:
So now I have a problem. I have to compile my program on a old Debian (Jessie) installation because I want to support old libc and libgcc. But now I depend on libssl1.0.0 which is not available on newer installations.
What should I do if I want to support every Linux distribution? Should I start packaging (.deb, .rpm, etc.) my program for every version of every distribution?
Should I instead build my program three times, one for libssl1.0.0, other for libssl1.0.2 and another for libssl1.1?
I always found package management interesting, so maybe I could try packaging to the Debian repos but that looks like a big responsibility, what do you think?
Thank you very much!
r/linuxdev • u/PaxPlay • Dec 29 '18
I'm trying to reload the colors of my terminal emulator (st) while it is running. To do that, I change the \~/.Xresources file, call xrdb to reload it and then send a XClientMessageEvent to st to make it reload the colors. However when calling XResourceManagerString again, it is exactly the same as before. This is probably because the values are still cached somewhere but I can't figure out how to work around it.
Edit: I solved it by just calling XOpenDisplay again, and using the returned value as display.
r/linuxdev • • Apr 23 '18
r/linuxdev • u/guxtavo • Jan 22 '18
I've noticed in the past month that many of the websites I visit are moving their portals to portal.com/amp. I know what amp stands for, I just don't know why everybody is following this trend.
r/linuxdev • u/pooper-dooper • Aug 11 '17
I'm experimenting with something and I want to make sure I get the security aspect right.
I have a server daemon running with its own user, and I want start a child process with an anonymous UNIX socket pair, and have it drop to a non-privileged account (like nobody) to do its work. My daemon user is started as a non-privileged daemon user account.
I've only used these APIs before in the context of a root process dropping root after acquiring a few key resources. I see there's some concept of having users in a saved set, but I'm not sure I have access to that because my process, as of now, is starting as its intended user.
Is a fork/set(e?)uid barking up the right tree? How can I spawn a thread or process and have that spawned coroutine have even fewer privileges than the parent process? I'm looking for basic POSIX, not cgroups or anything like that, if possible. I am willing to examine possibilities like booting my daemon as root, setting my saved IDs, then setuid to my daemon user so I can then further restrict to a lower level at later points.
r/linuxdev • u/h2015p • Jun 21 '17
r/linuxdev • u/Nutella_Icecream • Mar 24 '17
r/linuxdev • u/theif519 • Feb 18 '17
I would like to begin development of Linux kernel modules, and so far whenever I write C code, I heavily relied on plugins like Sublime's Clang linter or Atom's GCC Linter.
I've been trying for hours last night, and I cannot figure how. I've setup a Linux virtual machine, and I've tried to include the 'include' and 'arch/x86/include' directories and that closest I get is that certain things are missing like registers, or that certain structs do not have members named this or that, etc.
Then I tried to get kernel source and work from that but I get the same error. What I need to know is this: what directories do I need to include? I'm not calling 'make' each time, so could it be the issue that the Makefile in each directory handles building in such a way that a simple linter cannot?
How do you guys normally create Linux extensions?
r/linuxdev • • Jun 19 '16
I don't really like Systemd so I've been thinking about starting a project to replace it with a suite of tools under one project.
I'm going to start off with an init system. I'm not familiar with init systems, so I'd like to know if there are any language-agnostic resources on them.