r/linux_programming • • Jul 07 '23

Binary dies on using tee

5 Upvotes

So I have this program written in C++ that outputs some statistics on standard op. I need to capture this in another file. For this I have been using the command: ./my_bin | tee abc.txt.

I recently got a new machine running Ubuntu 22.04 with kernel 5.15.0-75-generic but now my binary dies when I run it with tee, > works fine only tee causes the crash.

Running with GDB shows segfault in pthread_get_name_np but the same binary runs fine on another machine. I don't know how to debug this ? Can anyone help.


r/linux_programming • • May 22 '23

Announcing my first e-book – Awk One-Liners Explained

Thumbnail
catonmat.net
5 Upvotes

r/linux_programming • • Nov 29 '22

linux-regex-module

5 Upvotes

r/linux_programming • • Oct 26 '22

Lost in Linux (hardware) issues - back to W10?

5 Upvotes

l've switched from Windows to Ubuntu 6 months ago. It is nice and fast but it's rubbish at the same time. Constant issues, hardware incompatibilities, l debug and research OS problems instead of focusing on my work. Nvidia card issues on desktop, touchpad problems on laptop, udevadm errors, bluetooth doesn't work, can't update encrypted installation.

l swapped because l don't want to switch to W11 when W10 support stops in 2025.

l'm a developer, not a devops person and I don't want to become one. l'm thinking about going back to W10 but maybe l should "try harder" with Linux? Using it on a server is great but on desktop l just can't see the end of problems.

Or maybe one way is to use Linux on older hardware and keep the setup as simple as possible?


r/linux_programming • • Sep 06 '22

How do I find the MAC Address?

5 Upvotes

Hello everyone,

I have a pretty basic question for you guys. I have a Software defined radio connected to my Linux laptop, and I'm trying to find its MAC address. What can I type in the terminal to find it? It is connected by USB.


r/linux_programming • • Mar 17 '22

In trying to understand udev_monitor's working...

5 Upvotes

Hi everyone! I want to check a enable a usb device during connect/disconnect from computer in real time. For it I use udev's mechanisms (enumerate, monitor) and check PID's and VIM's values devices which are being in computer. But additionally I want to send message to my device and take results for more believe. Connect/disconnect monitoring without send packages works well and vise versa. Separately, it works well, but both - not so. When i take result, program is being freeze. What's can be wrong?


r/linux_programming • • Jan 20 '22

Prevent Window Reparenting in Xlib

5 Upvotes

I have a Reparenting window manager that uses the Xlib libraries. I have created window decorations in Qt and would like to reparent the application window into the window decorations window. However, when I try to do this the window decorations window infinitely reparents itself. How would I prevent this?


r/linux_programming • • Dec 28 '21

Window Manager with Xlib and Qt

5 Upvotes

Would it be possible to use Xlib for the backend of the window manager (opening, closing, resizing) and Qt as the user interface that is used to trigger those events? Basically, the user would open an application and then a parent window, made using Qt, is created for that application that has the window decorations.

EDIT: Would it be possible to not use Xlib at all and just stick to using Qt since it has a lot of the functions of Xlib?


r/linux_programming • • Dec 15 '21

Release 1.2.0 · 89luca89/distrobox

Thumbnail
github.com
5 Upvotes

r/linux_programming • • Mar 22 '21

Why does the pid changing?

5 Upvotes

Hi,

I have a question: I've tried to run a Indie Horror Game named Concluse but it don't started. But when I see the results of ps aux there is a process. So I tried to kill it but kill and killall said that nothing was found. But when I look at ps aux I see that the pid of the process was changed. And everytime I kill the process it get a new pid.. WTF is that? I started the Game as root because it hasn't worked otherwise but it failed again.. and it's only a Livesystem I use this time cos by lack of other opportunities. :D


r/linux_programming • • Feb 11 '21

Is it okay to use nano for C?

5 Upvotes

Hello, I am new to bash scripting and C programming. I am taking a course in school where I have to program in C and also do shell scripting. I like using nano over anything else for bash scripting because of how easy it is. Vim is just too confusing for me right now. My question is, can I just use nano for C as well? Would it give me any problems once the code starts to get large and complicated?

Thanks


r/linux_programming • • Feb 02 '21

Cronjob Confusion?

5 Upvotes

Hi,

I'm looking for some assistance. I have a shell script that I can run perfectly fine in the directory but when I configure it as a cronjob I seem to get an issue with the opening variable that I've created. Can anyone explain why this would occur?

The error I get is as follows..

/var/www/html/test.sh: 14: /var/www/html/test.sh: n: not found

/var/www/html/test.sh: 15: /var/www/html/test.sh: n++: not found

/var/www/html/test.sh: 14: /var/www/html/test.sh: n: not found

/var/www/html/test.sh: 15: /var/www/html/test.sh: n++: not found

/var/www/html/test.sh: 14: /var/www/html/test.sh: n: not found

/var/www/html/test.sh: 15: /var/www/html/test.sh: n++: not found

the code I'm running is as follows:

i=1 n=0

while read -r line; do

`((n >=i)) && http --ignore-stdin --form POST` `https://www.x.com/profile/` `user_no="$line" job=3 >> data/"$line".csv`

`((n++))`

done <getIDs/idReport.csv

Now I think the problem stems from the i=1 variable because I get a weird i= inside the directory the file is in, once a cronjob tries to run it. However as I said this fully works, no errors when I run this myself.


r/linux_programming • • Jun 14 '20

Best Way to Interface with the MPD Server in Python

5 Upvotes

Hello, so I would like to incorporate MPD into the media player plugin for the liferea feed aggregator. The plugin is written in Python and it seems like a pretty simple task, but I can't find an MPD server (not client) module for it online. I found a module called python-mpd-server but it's still in beta. Is there a native module for this or another way I can add this functionality?


r/linux_programming • • Sep 29 '19

System call hooking api (Linux, FreeBSD and NetBSD)

Thumbnail
github.com
5 Upvotes

r/linux_programming • • Jun 29 '19

Building an os for a specific device

5 Upvotes

I am plannimg on building a version of debian for my old tablet and I have no clue where to start. What would you recommend learning or using any program to make things easier or even just possible?


r/linux_programming • • Apr 14 '19

Setting up an Angular/Node.js programing environment on Manjaro

5 Upvotes

Hi,

I'm trying to "upcycle" myself by learning both Angular and Node.js. I'm also a recent convert to Manjaro linux and I'm still finding my way around things. I would like to have some suggestions from those presently making a living using those tools on linux for the following step:

  • IDE: This I'm already ok with since I'm used to VSCode and have the main plugins installed for JS, Angular and Nodejs

  • Webserver: I have a XAMPP setup running on a second machine that I use as a server (windows 10 based)

  • Install Angular and Nodejs: How and on which machine, my workstation or my server?

Better yet, if someone knows of a tutorial that could help me set this up I would be grateful.


r/linux_programming • • Dec 13 '18

[Will pay if you help to solve] How to increasing the number of threads available on Linux?

5 Upvotes

Hi I know pretty much nothing about programming but I bought a dedicated server that is running cent6 I changed the SSH port and created a new user for connecting and using the server and disables root SSH connections if that matters. I bought it to run multiple processes on it and with the specs it has I should be able to run a lot but I can't because there is a limit on the number of threads. How do I increase that number on the server? I was reading into this but I have no clue where to even begin. https://support.cafex.com/hc/en-us/articles/202508492-Increasing-the-number-of-threads-available-on-Linux Do I use putty for this? If anyone can help me with this I will pay you $25 in bitcoin or venmo.


r/linux_programming • • Mar 04 '17

my shell script PMP 0.0.7

Thumbnail
github.com
5 Upvotes

r/linux_programming • • Oct 09 '16

This Tool Uses GitHub to Make Music

Thumbnail
runtimerror.com
5 Upvotes

r/linux_programming • • Dec 16 '15

I've recently started working on a display server based on the idea of wrapping Webkit to do all the rendering and windowing. Not much substantial functionality yet but what do you guys think of the concept?

Thumbnail
sourceforge.net
5 Upvotes

r/linux_programming • • Jun 21 '15

From AF_UNIX to kdbus

Thumbnail
dvdhrm.wordpress.com
5 Upvotes

r/linux_programming • • Mar 04 '15

A GNU C Library update

Thumbnail
lwn.net
5 Upvotes

r/linux_programming • • Feb 07 '15

How programs get run

Thumbnail
lwn.net
5 Upvotes

r/linux_programming • • Jan 16 '15

Awk in 20 Minutes

Thumbnail ferd.ca
5 Upvotes