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 https://askubuntu.com

1
vote
0answers
7 views

Using sed in Linux to extract lines from a log file

I have a log file which prints the following lines: 01:15:21.882 DEBUG [SampleProcess] Sample Message 01:15:21.882 DEBUG [SampleProcess1] Summary Report Sample Text1: 126 Sample Text2: 2330 Sample ...
-1
votes
0answers
6 views

How to test network speed from my local PC to my server?

I have a Linux server, hosts a web app. How to test the speed form the server to my local PC? Or I have to install a 3rd party app to test this, like Netperf or iperf ?
0
votes
0answers
6 views

How to make my python program bypass Linux openssl and use my compiled one

I am running an experiment program in python using python3.6.5 and Openssl. I use Ubuntu 18 which comes shipped with OpenSSL 1.1.0g: openssl version -a OpenSSL 1.1.0g 2 Nov 2017 built on: ...
0
votes
0answers
7 views

Disable Crash Wine Debian Linux

so i'm currently running my world of warcraft server on Linux Debian 9 And I've managed to setup everything properly but whenever i restart my 'worldserver.exe' it just doesn't restart. This is the ...
0
votes
1answer
16 views

Segmentation fault in pthread_cond_signal()

First let me provide some background. There are two threads in the production code and synchronization is done via wait and signal. Basic Structure of the code given below. main.c create the thread. ...
2
votes
1answer
15 views

Load shared library only if dependencies are met

I have an executable that is linked to two shared libraries, each of which have dependencies to system shared libraries. (In this case these are the OpenCL and CUDA runtime libraries, but this does ...
2
votes
1answer
15 views

Using find and grep in linux command line to search for files with a specific user and text content?

I am trying to find a file that belongs to a specific user, that also contains a specific string of text. For example, I want to find a file that belongs to the root user, and contains the text "hello ...
0
votes
0answers
7 views

Install Windows 10 Guest OS on physical disk

I am trying to install Windows 10 to a physical hard disk via vmware on a Linux system. However, vmware does not run as root and can not change the physical hard disk. how to solve this problem?
1
vote
1answer
6 views

Can fnctl(F_SETOWN, <pid>) direct a signal to a pthread ID instead of a process ID?

I'm developing an application that is going to read data from a serial / UART on Linux. I'm trying to wake up/unblock a pthread started to read the data when the UART has data available from an ...
0
votes
1answer
8 views

Using a symlink with ~ in path in a find command

I am trying to write a command that will work for all users to locate a list of recent files with a given name with a path of ~/work (which maps to /mnt/data/username/ for each user). So the following ...
-1
votes
0answers
6 views

LFTP - Mirror Verbose

I'm running the below LFTP command in two separate shell execution files but getting two different types of output from the mirror LOG+=$(lftp -e "set ftp:ssl-allow true; set ssl:verify-certificate ...
0
votes
1answer
11 views

root can't see HISTTIMEFORMAT in user's bash_history

I have a little question about log date in bash_history for each users. Last time I set in /etc/skel/.bashrc for each new user: export HISTTIMEFORMAT="%d/%m/%y %T " All things seems to be fine if we ...
0
votes
2answers
10 views

Is there any way/alternative to readlink -f in Linux to handle spaces present in the folder name? [duplicate]

My directory structure is /local/mnt/abcd/sub 1 So inside the 'sub 1' folder, I am trying to execute the following script SOURCEDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" ...
1
vote
1answer
21 views

IFS=';' read -a array not splitting “;” correctly when input contains newlines

I'm using PHP and trying to send to a shell script a single string that includes multiple commands separated by ";" (and maybe newline). However, the splitting is not working as expected from IFS. ...
-1
votes
0answers
10 views

Could somebody figure out if the image is encrypted/compressed/library used?

I have a linux distro (LEDE which is OpenWrt) on a device which is Linux for Omega from what I can tell... and I need to change the boot image, but for reasons unknown to me, the image (which is a PPM)...
1
vote
0answers
8 views

Sending MPLS tagged packets from a Linux application

I have written some VPN software which now needs to be able to be able to tag de-tunnelled traffic with MPLS tags. I've looked at the source of Mausezahn (which can send MPLS packets) and it seems to ...
0
votes
0answers
58 views

Segmentation Fault on codeblocks

First sorry my bad English. Please you don't understand ask to me again. I work little code. You can find this code in Raspberry pi. I tried run little code fragment of hello_font. I use code blocks ...
0
votes
0answers
8 views

Error connecting to the URL on a remote linux machine while running request module in nodejs script

This code runs fine on my local machine, but it gives this error while executing on another machine. Also this url is reachable through the remote machine. options = { url: sampleWatchdogUrl, //...
0
votes
0answers
6 views

How to modify the f2fs page size? Can it be set to 16K not 4K?

I'd like to modify f2fs's code, change it page size to 16KB instead of 4KB, could it possible? how???
-1
votes
0answers
19 views

Uninstall NPM with command line gets SynthaxError on Ubuntu 14.4

I'm trying to uninstall npm from the command line to install the last version. With all the commands I get following SyntaxError message: /usr/lib/node_modules/npm/bin/npm-cli.js:85 let ...
2
votes
1answer
13 views

Is there a way to “carry around” my own sh functions inside linux terminals, without having to install a file everywhere I connect?

I'd like to make so that wherever I go when connecting to terminals, I can use the same custom commands. Is there a way to do so?
1
vote
0answers
36 views

Crash after too many socket connections

When a client connects to my server using a (Unix domain) socket, everything seems to work well: the connection gets established, the request gets processed, the client receives a response and the ...
1
vote
1answer
11 views

Change permission of file owned by root-user without using sudo

I have a file owned by "root" and script owned by "non-root" user. I'm trying to change permission of "root" owned file using "non-root" script and getting below error: $ cat root_file echo "HELLO ...
-2
votes
0answers
13 views

How to switch on and off GPU used for CUDA only on ubuntu?

I am the proud owner of a 2016 Razer Blade equipped with a 6GB GTX 1060 for deep learning purposes. Without CUDA installed, I have almost 9hs of battery life on Ubuntu (16.04). When CUDA is installed ...
1
vote
5answers
32 views

How to use grep with regex and patterns from a file together?

Suppose there is a file contains a lot of patterns .com .re .net ... And there is a file contains a lot of data www.recent www.remix3d.com www.verisign.net What I want the outcome is that www....
0
votes
0answers
11 views

How to retrieve Auth information for the connected Wireless AccessPoint in Linux using ioctl

I am using Wireless Extension in ubuntu linux to retrieve the connected wireless access point information using ioctl sys api calls. I wrote below code which successfully retrieves the ESSID and MAC ...
1
vote
2answers
30 views

Hook function to shared library unloading

I want to add hook function, which will be called when shared library is unloaded. Library is linked on complitaion. Is it possible to do such thing? Maybe gcc has flag for it? I saw similar ...
0
votes
1answer
56 views

c++ static variable initialization problem - referencing on another static const

I tried to declare two static variables in two different .cpp, one is trying to use another during initialization (e.g. Class B -> Class A). Code could be compiled if I have main.cpp which includes a....
1
vote
1answer
18 views

Creating temp directory in www for download CentOS

I need to create temp directory in a specific location under var/www/html so anybody can download it for a several mins. How can i do that? mktemp -d generates under /tmp/xxxxx
0
votes
0answers
7 views

Streaming RTSP Video From Internal to External with ICE

I am trying to stream my webcam with RTSP on my PC#1 to another PC #2 under another NAT network. After researching, I find that I would need to use the STUN/TURN server, and signalling service to ...
0
votes
1answer
26 views

expand unix variable inside sed command

I need to replace current value in configuration file with new value which is assigned to variable , like file_name=abc.txt needs to be replaced like file_name=xyz.txt where $file=xyz.txt I ...
0
votes
0answers
13 views

Sending smtp emails with SpringBoot application

I have a basic SpringBoot 2.0.5.RELEASE app. Using Spring Initializer, JPA, embedded Tomcat, Thymeleaf template engine, and package as an executable JAR file. I've configured the springboot ...
0
votes
0answers
6 views

Partition a large csv file for Athena

I have a 100GB CSV file with ~60 columns. I need to split/partition this file based on year, quarter , month (3 columns mainly). I'm finally going to put it in S3 and set up Athena over that. I'm ...
2
votes
0answers
16 views

nmcli slower than netsh stablishing connection

I want a crossplatform (linux and windows) solution for searching networks and connecting to them. In linux I use nmcli giving the SSID and the password. In windows I use netsh giving a profile xml ...
0
votes
0answers
12 views

Challenges i can face in containers running OL7 but the docker host is RHEL 7.5

I have been asked to dockerize applications which require more or less whole Oracle FMW suit along with oracle DB. Preferably, the docker host should be running on the oracle engineered systems i.e. ...
0
votes
1answer
33 views

How to test iterator values using google test case?

I need to test each iterator access value with actual value inserted using google test case, below is my code snippet. TEST(EVTValSortedVector, StdIteratorAccess1) { EVTValSortedVector<Dog> ...
-1
votes
0answers
6 views

why I cannot create .htaccess in CWP

I been stuck with this problem for a week now, I hope some could give me a clear guide on how to go about this case. So far, I been using CWPpro7 for a month now, and I found out I cannot create ....
0
votes
0answers
15 views

PhpStorm remote Xdebug

I've got problems with setting up Remote Web Server Debugging with Xdebug. I keep getting 404 error: but actually Xdebug is being detected correctly: How are machines setup Laptop and Desktop PC ...
0
votes
1answer
13 views

Can LAMP Host IPS?

I have a VPS which I got in a giveaway and I want to host ips board (I haven't bought ips yet) on it via LAMP. Is LAMP powerful/secure enough to host it or is there another free web hosting panel that ...
1
vote
1answer
23 views

madvise(DODUMP) on the same ptr/size as a successful madvise(DONTDUMP) fails with EINVAL

Testing a MariaDB anomaly of mysqld (10.3 branch) what it does is on startup: A memory allocation returns ptr=0x7fffe1a00000 for bytes=2097152 Before the madvise syscall, the /proc/{pid}/smap entry ...
-1
votes
0answers
12 views

Virtualbox install on Linux Mint 19 Tara

I tried to install Virtualbox on linux Mint version 19, Code name : Tara, PackageBase : Ubuntu Bionic Cinnamon (64-bit) Reference link Downloaded this version of linux from above reference link- ...
-2
votes
1answer
36 views

How to pass argument from a text file in mid of linux command

This is my command aws elb describe-tags --profile dev --load-balancer-name ELBNAME |grep -Pwo "Product\K\b.*|Environment\K.*|TAGDESCRIPTIONS\K.*" | xargs And instead of ELBNAME i want to pass ...
0
votes
1answer
20 views

Simultaneous execution of “rsync” into same destination

I want to know if simultaneous execution of "rsync" into a same destination cause a problem. I am now preparing following commands and it is a situation. command if following which is executed ...
0
votes
1answer
42 views

Is this code returning milliseconds to seconds of epoch time

I am linux programmer, was porting some windows code to Linux. Here is a windows code snippet which I need to port. /////////////////////////////////////////////////////////////////////////////// // ...
0
votes
1answer
32 views

function to stop/reboot the computer from a web application

I used Runtime.getRuntime().exec("reboot") to restart the computer, but there are two problems: I use the HandlerInterceptor's afterCompletion method to log the log, so that the log may not be ...
1
vote
0answers
9 views

LINUX KERNEL driver hangs/freeze after handling mapped register

I'm completely new developing in LINUX kernel, and I'm having some problems in a new LINUX driver I'm developing. After I map memory using ioremap() and then I try to write to the register mappend my ...
0
votes
0answers
13 views

Trying to make “Cowsay” command in Linux script echo the contents of another file [on hold]

I am creating a script in Linux. I am trying to make the command "Cowsay" echo the contents of another file called "test.txt" line by line. Any ideas as to how to do that?
0
votes
1answer
15 views

Linux download wildcard URL

Using my script I'd like to be able to go to Chef Inspec and download the latest version. However the URL they use has versions. The versions will change and eventually, if I hard code the URL, I won'...
0
votes
0answers
38 views

Where has my some of my Bash history gone? [on hold]

I don't know how to reproduce the steps I do, but sometimes some of my Bash history doesn't show anymore. I seem to usually notice it happen whenever I've closed all my Bash/shell instances, then ...
0
votes
0answers
17 views

Docker (or Python) - arguments passed to container are getting corrupted

I want to pass argument to Docker container, but it's getting corrupted: $ docker run -it python python -c 'import os;import sys;print(sys.argv);print(os.fsencode(sys.argv[1]))' $'\xFF' ['-c', '�'] b'...