Questions tagged [linux]

LINUX QUESTIONS MUST BE PROGRAMMING RELATED. Use this tag only if your question relates to programming using Linux APIs or Linux-specific behavior, not just because you happen to run your code on Linux. If you need Linux support you can try https://unix.stackexchange.com or the specific Linux distribution's Stack Exchange site like https://askubuntu.com or https://elementaryos.stackexchange.com/

Filter by
Sorted by
Tagged with
0
votes
0answers
3 views

How can I access selenium running on a remote server?

I'm running tests for an application directly on an ubuntu staging server. In order to troubleshoot some failing tests, I'd like devs to be able to access this selenium instance running on the server, ...
0
votes
1answer
10 views

How can I write this correctly?

I am trying to write a script that allows me to refer to a text file with a list of directory names and move only those target directories elsewhere. I have written this script: #!/bin/bash readarray ...
1
vote
2answers
18 views

List shared library in the program executed using C/C++ on Linux

I want to know which dynamic libraries are loaded when executing a C/C++ program on Linux. For example, int main() { ... list = GetAllSharedLibraryFilePaths(); } list should contain: libm....
1
vote
1answer
9 views

LLDB Show trap opcodes in memory dump

I'm wondering if it is possible with LLDB's memory dumper to see trap opcodes in locations where I've just set a beakpoint? As I see LLDB is smart enough to shadow trap opcodes with original ones: (...
-1
votes
1answer
22 views

How does a program communicate with the X11 Server on Linux?

So I made quite a lot of research about this and couldn't find the answer. Does it use a named pipe ? a socket on localhost ? d-bus ? Can I intercept and see the binary messages sent by an X client ...
-3
votes
0answers
65 views

Reduce binary size without using gcc optimization [closed]

I have this homework task: "Reduce the size of their compiled binaries by at least 5% as seen by the size command when exactly the same flags are used in the compilation. Make sure no functionality ...
-2
votes
0answers
9 views
0
votes
0answers
19 views

How can I exclude rows from a table, using the rows' names from another table? [duplicate]

I have a .csv table1 A B C D E gene1 1 3 5 9 gene2 0 0 4 4 gene3 1 0 1 2 gene4 5 5 0 10 gene5 2 0 0 2 I also have another .csv table2 A B ...
0
votes
0answers
13 views

Auto reboot dotnet process on high memory usage or crash running in Ubuntu Linux [closed]

We have a azure app service running netcore 3.0 (using the dotnet process). Linux web apps do not support autoheal at the moment and hence would like to build our own implementation. We would like to ...
1
vote
2answers
15 views

how to add text to an output redirected to a file

I don't know if I'm wording it correctly, but I'm counting file types and outputting the results into a file, and instead of there just being numbers, I'm trying to identify what each number is. Sooo ...
0
votes
0answers
30 views

How to create a shared memory mapping that is read-only for other processes?

I have a forking setuid program in which the parent process creates an anonymous, read-only shared memory mapping. But the unprivileged child process can simply change the memory protection and alter ...
-1
votes
3answers
32 views

How to redirect and append using Bash shell?

I am trying to execute this command for a Linux assignment, but I cannot figure out what the command should be. I know how to append to a file - you use the >>. But I am not sure how to redirect ...
1
vote
1answer
30 views

What exactly does a 'service … start' instruction mean for a .NET Core application?

I need to deploy a .NET Core app (that uses an MVC pattern) that's already been configured to run on an Ubuntu VM that's running under Azure. NGINX appears to be in use as a reverse proxy server. I ...
0
votes
1answer
20 views

bash command to replace a part of a string with an environment variable

I have a configuration file abc.config which looks like the following, made up of key-value pairs: <add key="Server.HostName" value="local_host" /> <add key="Server.Tcp.Port" value="8080" /&...
2
votes
0answers
45 views

Linux system information c++ vs bash vs python [closed]

I would like to make a program to read information from /proc on Linux systems, as light and fast as possible. My initial question is which programming language should I use? At the moment: bash C++...
1
vote
1answer
16 views

npm start doesn't work for any ReactJS anymore - gives no output or logs

After creating a new ReactJS app using npx create-react-app testapp, the command npm start (or any other npm-script) doesn't work in ANY of my react projects. It gives no output to console, and the ...
0
votes
0answers
12 views

Handling concurrent file writes in Bash using SIGSTOP and SIGCONT

My goal is to use signal systems to concurrently write to multiples files but by keeping the order of which scripts executed first wrote to the file (his PID) using a Bash script. Here is the script ...
0
votes
0answers
9 views

How to create shared memory objects with joblib on linux?

I am working through the joblib shared memory tutorial. It seems that numpy.memmap dumps data to disk, which is unfortunate. However, using ramfs it should be theoretically possible to share memory ...
0
votes
0answers
11 views

DirectoryInfo.GetFiles and FileInfo.Name not reading non ASCII correctly

I am moving our .net core(2.1) API from IIS to linux containers in kubernetes in GCP and am having some trouble with files being retrieved from the mounted fileserver when the filenames contain non ...
-1
votes
1answer
19 views

egrep not giving result full path in for loop

I have a simple script return full path if it found in egrep. However it returns only count for each file. #!/bin/bash for file in `/logs/*` do egrep "Warning" $file | wc -l ; done
0
votes
1answer
25 views

Search filenames those contains a text files withing directory having multiple directories in Linux

I have file like search.txt. It has filenames like A190119.unp, A190120.unp, A190121.unp, A190122.unp on so on. I want to search if filenames from search.txt is in path /root/files/ (multiple ...
0
votes
1answer
20 views

Insert text in specific line of file by using sed. Text is including variable, which should be added into file in double quotation [duplicate]

I need your help. I am creating bash script and I have problem in part where I need to add text in line 4 of test.txt file. My text is including variable. I know how to add text with variable, but in ...
0
votes
1answer
21 views

get contet base on regex in to separate variables

Is it possible to get every part of string base on regex? For instance I have: #abc##!#[\s]+[\d] I can target variables #abc# with regex #.+?#. However I would like to have both captured and the ...
0
votes
0answers
4 views

Release file descriptor used by Java ext library

I have issue with closed source library, that I have bought for Java project. After using this library, it does not release Linux audio file: USER PID ACCESS COMMAND /dev/snd/controlC0: ...
-1
votes
0answers
17 views

Script bash Needs Checking

Hi need help in checking the below script #!/bin/bash sudo docker exec -i my-container sh -c "chmod 400 /home/jack/.ssh/id_rsa" sudo docker exec -i my-container sh -c "chmod 400 /home/jack/.ssh/...
0
votes
0answers
8 views

How to start SSH lambci/lambda:dotnetcore2.1 to allow Visual Studio debugging on .Net Core AWS Lambda functions?

I am trying to create a docker-lambda test environment that will allow me to use Visual Studio 2019 debugger locally on AWS Lambda .Net Core functions. My first attempt was to use VS "Attach to ...
-2
votes
0answers
19 views

Lightweight, actively developed DMS - best choice? [closed]

I currently manage an IT project at a company and my mate would like to establish a document management system for sharing relevant documents alongside the employees. We have been doing research for ...
-2
votes
0answers
19 views

integer expression expected in if statement in bash script [duplicate]

I have written the below code: #!/bin/bash trap 'echo "Hey your are interupting the program"' SIGINT #function cleanup() #{ # echo "Cleanup called" # rm -rf /root/summary_command.log # rm -rf ...
-1
votes
2answers
32 views

How to toggle sys.stdout between a file and terminal?

I know that if you want to redirect stdout to a file, you can simply do it like this. sys.stdout = open(fpath, 'w') But how can I switch back stdout to write on the terminal?
1
vote
0answers
29 views

How to read from buffer every second?

I'm writing script that will reload my app, once I changed a code. So far I have the part that will provide the name of the service the changes come from: inotifywait $ENVPATH --recursive --monitor ...
-1
votes
0answers
17 views

Mounting an Amazon EBS Volume to a file directory on Mac Terminal [closed]

I'm trying to mount an Amazon EBS Volume to my file directory for an exercise on GitHub (NYC 311 Data Analysis). I'm not sure what I'm doing wrong with the file path and device location so that the ...
1
vote
0answers
34 views

C/C++ library for memory preallocation ( concurrent ) [closed]

Is there is any memory preallocation library for C++ with which i can pleallocate? for example - 10 gigabytes of memory on application startup and then redirect all malloc/new calls to force use ...
-1
votes
0answers
13 views

Pycharm is slower on windows than in linux [closed]

I am working with hyperspectral images with python by pycharm-community 2019. Until today I worked on ubuntu with a ssd to read the data (each image is about 10GB). It was very fast without any ...
0
votes
1answer
20 views

Can't get pid after executing command

I need to execute node and firefox in that order. The node process needs to remain in the background until I close firefox manually. I've tried this command: node & nodePID=$! && ...
0
votes
0answers
39 views

why does the shellcode get segmentation fault?

I am new to buffer overflow attacks. I copy the shellcode from http://shell-storm.org/shellcode/files/shellcode-76.php I wrote a c script to test the shellcode. It looks like this: char * ...
0
votes
1answer
13 views

Kestrel Certificate “no such file” on Linux containers works find on Windows containers

I have constructed an aspnetcore webapp using https on docker windows containers with no issue. When I modified it to run on Linux containers using http, there was no issue. However, when I enabled ...
-1
votes
0answers
11 views

Trying to install Logstash 7+ on a Raspberry Pi 4, gives me apt-get update error because of architecture [closed]

I managed to get Elasticsearch installed finally on my Raspberry Pi 4+, and the next step was to set up and configure Logstash. I thought it was going to be relatively easy to implement. When going ...
2
votes
1answer
28 views

UDP server fails to send reply back and sendto returns -1 and errno is 22

I am having this problem with UDP client/server code. This code was copied from https://www.geeksforgeeks.org/udp-server-client-implementation-c/ and modified minimally to fix compilation errors and ...
2
votes
3answers
42 views

search recursive files with type of data that ended with specific extension in order to delete the files

We want to search and delete the data files that ended with extension of .pppd We can search the files as find $path -type f -name '*.pppd' -delete but how to tell to find command to filter only ...
3
votes
1answer
40 views

Why signals are platform-dependent in Linux?

SIGNAL(7) man page states: The numeric value for each signal is given in the table below. As shown in the table, many signals have different numeric values on different architectures ... ...
0
votes
1answer
24 views

AWK remove everything after domain and substitute column

I have the following sample file and looking to remove everything after the domain name and replace column 2 with 4. Sample file one two three www.four.com abc def ghi www.jkl.com lion zebra eagle ...
-2
votes
0answers
29 views

Slow start of Tomcat8 [closed]

I'm using Tomcat 8 to run a Java 8 webapp on a Linux system. I have been trying to make the start time of the Tomcat 8 faster. I have seen lots of questions on Stackoverflow about this topic and I ...
-1
votes
0answers
8 views

Email Flooding after installing OMS agent on on-prem linux machines? [closed]

I see huge number of email alerts in the following format, not just with one particular location but many other in the similar fomat Message type 1: [Timestamp] [servername] sudo: omsagent : TTY=...
2
votes
0answers
29 views

JavaFx Jar file doesn't run on linux (run well on windows)

I try to launch a javaFx .jar file, build with maven on a linux device but it doesnt work. Error logs: [email protected]:~/Bureau# java -Djavafx.verbose=true -Dprism.verbose=true -jar myApp-0.3.0.jar ...
-1
votes
0answers
17 views

Markdown mode not working for .md files, python mode activated instead

I have been trying to install markdown-mode for emacs in linux mint (ubuntu) using several of the methods provided. I have tried: installing the `emacs-goodies-el' and the 'elpa-markdown' packages ...
-1
votes
0answers
13 views

Launch tomcat as service [closed]

I have a question, currently my webapp are launched as the service. They have added the webapp in the init.d and all app have an entry in init.d. For me this way is bad So for each webapp I have new ...
0
votes
0answers
17 views

How memory is managed in stdout?

Here is example how to restore postgres dump from s3: wget -O - 'https://s3.amazonaws.com/database.dump' | pg_restore -h somedomain.us-east-1.rds.amazonaws.com -p 5432 -d databasename -U username ...
0
votes
0answers
19 views

Trying to execute the following command shell_exec(“sudo /usr/bin/nmap -n -sn ”.$_SERVER['REMOTE_ADDR']) but it returns NULL

I'm running nginx 1.17.4 php 7.4 arch linux 5.4.2 Trying to execute the following command to get my user MAC address from IP (this script will run on my lan server) and $_SERVER['REMOTE_ADDR'] ...
-1
votes
0answers
13 views

Laptop stuck booting memtest [closed]

I have a Toshiba satellite c660 which I have installed Manjaro Linux on. I happily dual-booted between Windows 7 and Linux until recently when windows 7 updates stopped, with grub2 as my bootloader. I ...
-1
votes
0answers
18 views

“Hosting components are already initialized. Re-initialization to execute an app is not allowed.” running .net core app [closed]

The error of dotnet run defined here. I'm trying to run assembly code via C library DllImport in C# with .net core x64 Linux. How to do this correctly? C#: [DllImport("lib.so")] public static extern ...