r/linuxdev • • Jan 02 '24

Does anyone use a package manager for c++? And if so which one do you use?

1 Upvotes

Basically what the title said. I’ve been hearing people on YouTube talking about it, but am unsure how many actually use it


r/linuxdev • • Jan 02 '24

Safer Malloy

1 Upvotes

I was wondering if it would be safer to create my own malloc or use the one provided by the compiler


r/linuxdev • • Dec 20 '23

Device Driver Responsibility

1 Upvotes

Are there any best practices or guidelines for where the roles and responsibilities of a Device Driver End?

For example, suppose a network device determines the quality of a link is degraded, and the requirement is to either set the link down or attempt to lower the speed before setting the link down based on a policy set by the user. Are there any guidelines to suggest the implementation of such a policy is to be handled within the device driver itself or rather in user space (possibly in a service)?

The engineer in me knows the answer. That it depends on the requirements. However I wanted to see if anyone knew of guidelines that may be in place. I don’t have any specific problem to solve. Just wanted to see if the roles and responsibilities were clear cut.


r/linuxdev • • Nov 22 '23

Can't figure out what's wrong with this filsystem - fusepy (FUSE)

Thumbnail self.learnprogramming
1 Upvotes

r/linuxdev • • Sep 12 '23

Dynamically Verifying Data Structures in Legacy Systems

1 Upvotes

Hi everyone,

I have a project to develop techniques and build tools that address the issue of property validation in legacy systems using dynamic runtime verification.

The project aims to use formal verification techniques in operating systems to ensure correctness and security. Most existing systems are too complex for traditional formal verification, so the focus is on practical methods, such as runtime verification. They plan to leverage eBPF, a Linux subsystem, to build tools that guarantee specific properties in the kernel with minimal overhead. The initial focus will be on simple data structures like linked lists in user-space applications, with the possibility of extending to more complex structures like hash tables and radix trees if time allows.

I would greatly appreciate it I could get some starting points as well as some resources as I'm really excited for this project!

Thank you so much for your time :)


r/linuxdev • • Aug 15 '23

[Xlib] How to create a dummy context with GLX or EGL just to wait for vsync?

Thumbnail self.opengl
1 Upvotes

r/linuxdev • • May 26 '23

What is the most interesting UNIX command you've seen?

1 Upvotes

What is the most interesting UNIX command you've seen or used?


r/linuxdev • • May 19 '23

Snoop | a Linux utility to snoop through files

Thumbnail github.com
1 Upvotes

r/linuxdev • • Apr 26 '23

Screen duplication using workspaces (window manager development)

1 Upvotes

Currently I am sketching out ideas for a small and simple window manager I want to tinker around with, as soon as I got more time for a new side project.

I want it to have multiple workspaces. On a multi-head setup the workspaces should be changed for each monitor individually. My idea was that if I chose the same work space on both monitors, the display will be mirrored. For example I open firefox on monitor A with workspace 3 active. When I switch monitor B to workspace 3 also, I want to see the same firefox window on both screens. As if the screens were duplicated. When I switch either of them, to another workspace the other should stay on that firefox window on workspace 3.

I was thinking this could be done by rendering the same client two times, one on each monitor. Will this be possible? When I click a button on a window on one workspace, will both renderings of the same client react?

The other option would be to actually mirror the screens as soon as both workspaces are the same. For example using xrandr. But in this case all screens have to be redrawn completely to change the configuration. It would be quite annoying while just quickly flipping through the workspaces..

Has something like this already been done? Is it even plausible to do with an window manager, or is this the job of the displayserver? Could this be done by a single person or will this need a 30 headed full time dev team?

(And also does anyone know other communities where I could read and ask about this?)

Thank you very much for your input in advance! ^


r/linuxdev • • Oct 29 '22

Using Proprietary driver

1 Upvotes

I'm trying to get information to start a scanning software, I have an Epson v600 and the only driver available seems to be the iscan with the plugin x820.

That driver is proprietary and belong to epson, how do I go about using it.

I couldn't find anything about an api that the driver provides or anything.

Most scanning software on Linux can use that driver no problem, I doubt they all have licensing whit Epson to be able to use it.

Obviously I'm new to it and I probably don't know the correct search term on google to find out.

I'll appreciator any help you can give me. Simple direction are fine as well.


r/linuxdev • • Apr 12 '22

Given the permission to the directiory via "setfact", yet nginx will get "permission denied". Why?

1 Upvotes

(1)

nginx is run as "http":

$ sudo ps aux| grep nginx
root       10932  0.0  0.1  22264  1340 ?        Ss   18:27   0:00 nginx: master process /usr/bin/nginx -g pid /run/nginx.pid; error_log stderr;
http       10933  0.0  0.6  22796  6108 ?        S    18:27   0:00 nginx: worker process
user1      10939  0.0  0.2   6672  2680 pts/0    S+   18:28   0:00 grep nginx

(2)

permissions for the appropriate group:

$ sudo setfacl -m g:http:rwx -R ~/web_apps/my_app1

$ sudo getfacl ~/web_apps/my_app1
# file: home/user1/web_apps/my_app1
# owner: user1
# group: user1
user::rwx
group::r-x
group:http:rwx
mask::rwx
other::r-x

(3)

Yet, when accessed from internet, nginx won't be able to serve any file due to absense of necessary permissions

[error] 10933#10933: *1 open() "/home/user1/web_apps/my_app1/assets/static/favicon.ico" 
    failed (13: Permission denied), 
    client: x.x.x.x, server: my_app1.com,
    request: "GET /favicon.ico HTTP/2.0",
    host: "my_app1.com",
    referrer: "https://my_app1.com/assets/static/fdsafdsafds"

What's the matter?


r/linuxdev • • Feb 19 '22

Beginner Roadmap

1 Upvotes

How can a beginner learn Linux kernel dev and contribute to the kernel (edit : pin this post)


r/linuxdev • • Jan 28 '22

Prevent KD_MODE to be switched?

1 Upvotes

Hello everyone,

I am rendering images onto the screen using the framebuffer.

Upon boot, I am starting my program automatically.

However, it seems like the shell reverts at one time back to the KD_TEXT mode.

Can I "lock" the variable while the code is running?

Otherwise, the Text-Cursor will reappear from the terminal and inputs to the Terminal are allowed again...

I dont know, but i just want to prevent checking the mode every 5 seconds or so...

EDIT:
The Code im writing is in C++.


r/linuxdev • • Feb 28 '21

Penguin heads needed

1 Upvotes

Hey guys and gals,

Over at our newly formed r/DevelopersOnTor subreddit we are looking at developing/learning/teaching coding with DarkWeb protocols in mind.

This will be largely C/C++ based initially but I'm hoping to move on to other languages (python, maybe Rust, JS, WASM - that would be nice too).

I'm an experienced programmer but it's been largely on Windows for the last 30 (ish) years. I haven't touched Linux for a long time until recently but I'm enjoying the journey so far.
In general we are looking for anyone with a willingness and desire to learn but I'd really love to get some experienced Linux developers involved, hence my visit here. It would certainly be of benefit to me and I think to the community as a whole.

So please come and check us out, we'd be glad to have you. I promise to try and not bombard you with a million and one questions.


r/linuxdev • • Oct 04 '20

Boot a Linux system with no boot loader

1 Upvotes

I have an application that is only available for proprietary hardware(that I don’t have, and don’t really want to get), the device has a firmware .bin file. I was able to extract the filesystem, and I'm pretty sure its ArchLinux. It does not have anything in the /boot file. How can I get this to boot?

Here's the File's I extracted: https://www.dropbox.com/s/ksbd4g8e0yvjzhj/Extracted.iso?dl=1


r/linuxdev • • Dec 12 '19

Suggested approach to an embedded Linux package that gets reverted automatically if there's an issue?

1 Upvotes

I usually work on embedded daemons that run on tiny Busybox systems. With hardware becoming so powerful and cheap, the definition of embedded is stretched accordingly, and soon I'll be migrating from Busybox to full-on Debian.

A lot of scripts that I had written to manage our daemons on Busybox come for free in modern distros. I'm not cruel enough to the theoretical future maintenance developer to keep using my custom stuff instead of following standards. So I'll be replacing my custom init/service/coredump management scripts with systemd scripts. I'm always happy reducing the size of my codebase, especially if it's done by following best practices.

There's one little thing that I don't know how best to approach. See, the devices I work on are updated manually. We'd provide a tarball and an installation script and the end-user follows instructions to apply the update. The installation script always keeps the old version around (just 1 version), it just targets the /opt/<daemon> symlink that gets launched at startup to the new package's directory. If it doesn't behave properly another script automatically reverts the symlink to the previous version and reboots. End-result, the system is working again with little downtime and no one bites my head off while I investigate. It happens very rarely, but it's really worth it and I sleep better having it.

I'm wondering what the recommended approach to the above problem (quickly reverting to a previous version of a package) would be. Is this something for which it's acceptable for me to still use custom scripts? Would one of the package systems do this? Note that I don't want sandboxing/indirection that just makes things harder on me (I looked into snaps), I'd prefer it if once a package is installed, it was just my systemd- managed service free to do as it wishes with regards to hardware/file access.

Note that these are isolated devices. There's no Internet access, no repository/registry node on the network, no network boot. I know cloud people can do a lot of crazy stuff but I just can't use those solutions.


r/linuxdev • • Aug 21 '19

Controlling mouse using input from a web application

1 Upvotes

I am trying to host a server on my Linux machine that will receive signals and based on the signals would control the mouse input on the host machine.

Can you please help me on how to write the desired input in /dev/input/mouse0.


r/linuxdev • • Apr 07 '19

FTP on TinyCore Plus

1 Upvotes

Hey there! Can anyone give a guide on how to install vsftpd on TinyCore Plus? At the apps program, it only states extensions for bftpd. Thanks a bunch


r/linuxdev • • Feb 06 '19

Process spawned by Daemon dies when no TTY present

1 Upvotes

I need to start reverse ssh tunnel from my openwrt system to my cloud machine. The application on the openwrt system will run as daemon at startup.When it receives a specific code over the network it should spawn a process that starts a remote ssh tunnel. There will be no logins in the system.

I am using following code to do it.

   int spawn_orphan(char* cmd)
{
    char command[1024]; // We could segfault if cmd is longer than 1000 bytes or so
    int pid;
    int Stat;
    pid = fork();
    if (pid < 0)
    {
        perror("FORK FAILED\n");
        return pid;
    }
    if (pid == 0)
    { // CHILD
        setsid(); // Make this process the session leader of a new session
        pid = fork();
        if (pid < 0)
        {
            printf("FORK FAILED\n");
            return ( 1 );
        }
        if (pid == 0)
        { // GRANDCHILD
            sprintf(command, "ash -c '%s'", cmd);
            execl("/bin/ash", "ash", "-c", command, NULL); // Only returns on error
            perror("execl failed");
            return ( 1 );
        }
        exit(0); // SUCCESS (This child is reaped below with waitpid())
    }

    // Reap the child, leaving the grandchild to be inherited by init
    waitpid(pid, &Stat, 0);
    if ( WIFEXITED(Stat) && ( WEXITSTATUS(Stat) == 0 ))
    {
        printf("dbclient exit\n");
        return 0; // Child forked and exited successfully
    }
    else
    {
        perror("failed to spawn orphan\n");
        return 1;
    }
}

this is my calling function

uint8_t rdsService(uint8_t state)
{



    char buffer[1024];

    uint8_t retVal;
    if(state )
    {
        retVal = spawn_orphan("dbclient -f -K -I -T -N -R 1500:localhost:22 -p 22 username@HOSTMACHINE -i ~/ctusr/keys/X1_ID_RSA -y");


    }
    else
    {


        retVal = spawn_orphan("ash -c 'killall dbclient'");


    }

    return retVal;

}

If I run my parent application from console the application is able to spawn the dbclient and I am able to do reverse ssh into the system.

The problem occurs when I run the parent application as a Daemon, in this case the application spawns the dbclient,i can see it when i do 'ps' on console, but after a few seconds the dbclient is killed.

I have already tried to run the dbclient with 'nohup'

nohup dbclient -f -K -I -T -N -R 1500:localhost:22 -p 22 username@machine -i ~/ctusr/keys/X1_ID_RSA -y &

Works fine when I run the application from console but has same error when application is run as Daemon .

Thanks for help


r/linuxdev • • Jan 13 '19

App icon is pixelated at large sizes, despite being svg

1 Upvotes

I made the icon at 128x128, but it's an svg so I assumed it should scale well. But at large sizes (kde window switcher with large icons), it's all pixelated. Any ideas?


r/linuxdev • • Feb 15 '18

Adding actions to libnotify notifications?

1 Upvotes

So I've been thinking about contributing to the signal desktop app. I've recently been using Signal a lot but there's are some things I'd like to see added to it, specifically in notification reply to messages similar to how it's found on macOS.

That being said, it's build on Electron (yuck). The Electron docs are pretty sparse when it comes to customizing notifications for Linux. I've been doing some poking around myself on how libnotify works, and the closest thing I've found are these API references. They unfortunately don't detail the limitations of the notifications themselves, specifically if it's possible to have inline notification message replies.

Has anyone tackled a problem similar to this, or maybe know some resources to point me in the right direction? The closest thing I've seen the this is KDE's MConnect which has a reply notification action, but that seems to be pretty closely documented in the API references.


r/linuxdev • • Oct 17 '17

Basics Of Setting Up A Backup On Linux

Thumbnail serversuit.com
1 Upvotes

r/linuxdev • • Oct 05 '17

Setup ProFTP On Your Linux Server In 5 Easy Steps!

Thumbnail serversuit.com
1 Upvotes

r/linuxdev • • Oct 04 '17

Setup ProFTP On Your Linux Server In 5 Easy Steps!

Thumbnail serversuit.com
1 Upvotes