Questions tagged [linux]

Attention: In order to maintain the focus on programming, we kindly ask that all inquiries about Linux be directly related to coding. If your query does not pertain to programming using Linux APIs or specific Linux behaviors, it will unfortunately need to be redirected. For general Linux assistance, we recommend visiting linux or utilizing the appropriate Newtab Q&A site dedicated to your Linux distribution, such as linux or linux.

Having difficulties executing Selenium with htmlSuite on a headless Linux environment

After building a basic test using Selenium IDE and converting it into an HTML suite, I set up a VM running CentOS 5.5 to run my Selenium tests. However, when attempting to execute the following command: java -jar selenium-server-standalone-2.14.0.jar -mul ...

On Linux systems, Node.js in JavaScript interprets strings as objects only

I'm encountering an issue with my Discord.io bot. I am attempting to run it on a Linux server, but the Linux version of Node.js keeps treating the contents of a string as a separate object, leading to the following TypeError: TypeError: Object IT'S ALIVE ...

Having trouble launching Firefox using Selenium WebDriver

Oops, encountered an error: Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/firefox/webdriver.py", line 148, in __init__ self.service.start() File ...

It seems like NativeScript is facing compatibility issues on Linux systems running Node.js version 11.1.0

Setting up NativeScript on my Arch Linux machine has been a bit of a challenge. When I try to run tns doctor, I keep getting the following error message: Support for Node.js 11.1.0 is not verified. NativeScript CLI might not install or run properly. Refe ...

Basic communication between two Python scripts by passing a single argument

Below are two different Python scripts: #!/usr/bin/env python import sys print(sys.argv[0]) # displays python_script.py print(sys.argv[1]) # displays var1 print("first one") Now, let's take a look at the second script called sec ...

Encountering issues during npm installation: [current node version is 16.2.0 and npm version is 7.13.0]

For the specific folder I am working in, I need to run the following command: sudo npm install Below is the content of the package.json file: "dependencies": { "@branu-jp/v-drag": "^0.1.0", "axios": " ...

Issue with running Selenium script from console compared to CRON, encountering Geckodriver error

My Selenium script is set up to run from an SH file. When I manually execute the SH file from the console, everything works perfectly. However, when I schedule the file to run from a Cron job, it fails. This is the content of my SH file: #!/bin/sh expor ...

Executing a PHP file with a PDO connection in the terminal is failing to establish a connection

When running a certain PHP file in the browser, everything works perfectly fine. However, when I try to execute it in the terminal, php /opt/lampp/htdocs/xampp/site_name/update_db.php the PDO include and connection don't seem to function properl ...

In Ubuntu (using nvm), when attempting to install npm packages with `npm install`, you may encounter the need for `

I am a new developer and recently encountered a permissions issue after mistakenly installing sudo npm globally. With the help of someone, we used rm -Rf to remove all node files, node_modules, and npm files which fixed my original problem (not being able ...

Tips for sending input to a Yun Process via stdin()?

Is it possible to write to the stdin of an Arduino Yun Linux process launched by the Bridge Process of a sketch? Context: I have a control and logging application that needs to log data to a Google Drive spreadsheet using Temboo.com. While I have successf ...

Error message "npm: not found" was encountered while attempting to generate a React app using tools like NVM and NPM within

I'm currently working on setting up a new React project in pycharm. Utilizing version 0.34.0 of NVM, I have successfully installed node. Before initiating the project, here is my pycharm window: https://i.stack.imgur.com/Opt7z.png The command npm -v ret ...

Steps to remotely access a file stored on a Windows drive from Ubuntu using PHP

In my Windows environment, I had the following command: exec('copy /V "'.$file.'" "'.$dest.'"'); where $file is a REMOTE file in a windows drive such as: \\server\dr1$\folder\file \\serv ...

Looking for the location of the apc.php file?

I've successfully deployed the APC cache on AWS Elastic Beanstalk (confirmed via phpinfo()) How can I verify if APC is functioning properly? Where can I find the location of the apc.php file? Thank you ...

What are the steps to accessing and interpreting the information in /dev/log

Is there a way to read syslog messages directly from Python by accessing /dev/log? It seems like the correct approach is to use a datagram socket. import socket sock = socket.socket(socket.AF_UNIX, socket.SOCK_DGRAM) sock.bind('/dev/log') sock ...

Establishing direct communication between applications on dokku using the docker network

I have multiple Nodejs-Express apps on dukku with the following domains: app1.example.com app2.example.com app3.example.com My app1.example.com is connecting to the other apps using HttpRequest. I have noticed that the connection speed is around 900ms, i ...

Steps for activating PDO_ODBC on a Linux system

Trying to run Microsoft Access Database using PDO_ODBC on CentOS 7 x64 bit, but encountering the following error: could not find driver Checked the code in my connection.php file and everything seems fine (tested on Windows 7 x64 bit). Realized that the ...

Troubles with npm installation of jsdom on Ubuntu 14.04 OS

I have been struggling to install jsdom in my script, encountering an error that I can't find a solution for. Most people face issues with g++ not being installed, but I already have it installed. Here is the content of my package.json file: { "name": ...

Issues with installing npm in Docker

I have encountered an issue with my Docker file while transitioning from using Node 10 to Node 16. Previously, my Dockerfile looked like this (with environment variables removed for privacy): FROM node:10-alpine RUN mkdir -p /home/node/app/node_modules &a ...

What is the best method for extracting a specific block of code from a json file with jq?

I have a json file called temp.json that looks like this: { "data": { "stuff": [ ..... ] }, "time": { "metrics": 83 } } I am looking to remove the following block of code from the JSON file: , ...

Selenium tests causing Firefox browser to remain open even after completion

After finishing the tests, Firefox continues to run without closing on Debian Linux operating system using Firefox version 3.6. ...

access denied when attempting to run a node program with su

Check out my node program: var fs = require('fs'); fs.writeFileSync('./data.txt', 'test'); The program is located in /home/test/, and the test directory has permissions set to rwxrwxrwx. When I run the program with the tomcat account using "node test.js" ...

Jenkins does not have the capability to execute npm or pm2 independently

Currently, I have a Jenkins CI setup running on an EC2 server. I've successfully installed nodejs and npm. Interestingly, Jenkins is able to access them via the command line using this command: sudo -u jenkins node -v However, when it comes to actua ...

Issue with the react-scripts package when running the npm build command

Attempting to compile a project for the first time on a new application using npm run build resulting in the following error: client/node_modules/.bin/react-scripts: line 11: exec: node: not found So far, I have tried: chmod +x node_modules/.bin/react-sc ...

What could be the reason for node js version 8.xx being installed yet displaying version v6.3.1?

My CentOS 7 server is currently running Node.js version 6.3.1 To update to version 8.x of Node.js, I used the following commands: curl --silent --location https://rpm.nodesource.com/setup_8.x | sudo bash - and sudo yum -y install nodejs After executin ...

Error parsing module: Encountered unexpected token at line 7855, character 112

Currently, I am in the process of constructing a frontend application using npm run build via Jenkins. Unfortunately, I have encountered an error message as shown below. Can you provide guidance on how to resolve this issue? Creating an optimized productio ...

Factors to keep in mind when it comes to managing packages in operating systems

I'm currently exploring different technologies for an upcoming web development project. One crucial factor to consider is package management. I am leaning towards using NPM or bower, but open to other recommendations. Do specific operating systems (e.g., ...

``"Issue: 'remap' function is not recognized within the 'cv' module"`` occurring during the execution of the command "python setup.py install

Currently attempting to set up a face tracking system for Python on Ubuntu using the terminal. I installed the necessary files from the following links: The setup.py version for Linux can be found here: Despite following the steps and navigating to the p ...

Is there a way to make Forever write to a new log file on a daily basis?

I am managing a group of production servers that run a Node.JS application using Forever. It seems like my current log file options are limited: Allowing Forever to handle logging on its own, resulting in logs being saved to ~/.forever/XXXX.log Specifyin ...

How to turn off automatic updates on Firefox using the Linux terminal

I've been encountering difficulties with the automatic updating of Firefox on my Linux machine. I'm in need of a solution to turn off the auto update feature of Firefox because I require a version below 41 to be compatible with my Selenium version. Current ...

``John accessed the IPMItool and configured a new User Role

I'm having an issue with user access. I want to grant an OPERATOR privilege to a user, but I'm encountering a problem: Here is the request: ipmitool channel setaccess 1 3 link=on ipmi=on callin=on privilege=3 I only want to change the IPMI LAN Privileg ...

Which fonts are accessible on Linux systems?

Currently, I am working on programming a specialized media box that runs a unique version of Linux (tangox 2.6.29.6-18-sigma #2 PREEMPT Tue Dec 20 14:00:43 UTC 2011 mips GNU/Linux) and need to determine the font options available on this system. My main o ...

Divide the extracted result of executing a command that handles an extremely massive compressed JSON file

Alright, let's kick off with the command line I'm currently using: curl --silent http://example.com/json.gz | pigz -dc | jq -r '[.name, .value] | @csv' > data.csv The CURL function will fetch a whopping 11.6 GB JSON file in compressed format from a sp ...

Is it possible to optimize the memory usage when running `next build`?

My Next.js app is hosted on a 1gb memory server. However, whenever I run next build to redeploy my application, the memory usage spikes from around 70% to 100%, causing the system to slow down significantly. The build process usually takes 15-20 minutes un ...

Having some trouble transferring a string to the clipboard using Python3 and tkinter on Linux. Can't seem to get it to work as intended

Currently in search of a code snippet that can successfully append a string to the clipboard and retrieve text from the clipboard using Python3 along with tkinter. After some research, I came across an insightful post. I tried out the following code excerp ...

Database record fails to update

The code is executing without any errors, but the database table does not get updated id and status are being retrieved from an HTML form router.get('/update_todo/:todo_id',async function(req,res){ const id = req.body.todo_id; const status = req.body.comp ...

Leveraging Bash to modify VS Code Configuration

I have been attempting to utilize the npm package.json in order to modify VS Code settings through a bash script. I came across a helpful resource on How to change VS Code settings from terminal (bash), which has guided me towards achieving my desired outc ...

Setting up a CentOs Linux environment to host and run a node.js server

Just installed node.js on my new VPS server. I have written a basic script called "server.js" and it is currently running on port 8080. The location of the script is in the "var/www/html/" directory. However, whenever I try to access my domain, it only dis ...

Error in CentOS - The effective user ID is not 0. Have you properly installed sudo as setuid root?

After coming across a similar question with the same headline, I realized that my situation is slightly different. While setting up a new project, I encountered an issue with installing nodejs. It seemed to only work when using sudo, for example, sudo npm ...

Encountered Error Compiling OpenCV 4.2.0 on Ubuntu 18.04: Unable to build target 'modules/videoio/CMakeFiles/opencv_videoio.dir/all' during make process

After following a tutorial at cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D INSTALL_PYTHON_EXAMPLES=ON -D INSTALL_C_EXAMPLES=OFF -D OPENCV_ENABLE_NONFREE=ON -D WITH_CUDA=ON -D WITH_CUDNN=ON -D OPENCV_DNN_CUDA=ON -D ENABLE_FAST_MA ...

Script using PHP to remotely connect to a Linux server and run a Bash script

Currently, I am facing a challenge where I need to execute shell commands on our remote servers using PHP. The main goal is to install scripts through bash by having PHP execute these scripts on the server remotely. However, I have encountered an issue wh ...

Launching myapp as a service with the command "node myapp.js > myapp_error.log 2>&1" is identical in functionality

An easy-to-use testing application called myapp: const fs = require("fs"); const json_encode = require('json_encode'); //simulating a real error var wrong; var test = json_encode(wrong); //TypeError: Cannot read property 'replace& ...

Encountering an error on Linux while installing node: The version `GLIBC_2.27' required by node is not found at /lib64/libm.so.6

I recently tried to follow the steps outlined in this post about installing a node.tar.xz file in Linux: How to install node.tar.xz file in linux However, when I try running `node --version`, I encounter some errors. You can view the errors here. I'm no ...

python starting a process on a remote machine using fabric

Hey there! I've been working on deploying my Python project using Fabric. One of the key components is a shell script called 'run_fetchserver.sh' that helps manage the start/stop process. fetch_path=$PROJECT_PATH if [ $1 = start ] then ...

Commands for Yarn, such as type checking, testing, and formatting with Prettier, are encountering

I have been encountering errors in my Jenkins builds for the past 3 weeks. Despite numerous attempts, I cannot seem to get these commands to work within the Jenkins pipeline code using our shared libraries. The same commands work fine locally. The errors ...

Which of the multiple pip installations can I uninstall?

Currently, I have multiple pip installations on my system but I believe having just two would suffice; one for Python 2 and another for Python 3. user@pc:~$ pip# tab completion list pip pip2 pip2.7 pip3 pip3.5 use ...

Utilizing Node.js on Linux to Connect to SQLServer

Looking to create a REST service using Node.js and Express but facing difficulties connecting to a SQLServer 2000 database. The Microsoft connector is not compatible with Linux, as mentioned by the developers: The Microsoft Driver for Node.JS for SQL Se ...

Secure shell access to Amazon EC2 using PHP

When I try to run a PHP script connecting from my local Ubuntu Linux machine to an EC2 instance using SSH, it executes fine when run from the terminal and writes the tailed entries in a file. However, when I try to run it from a browser, I encounter the fo ...

Discovering key value pairs on a Linux server

I need to extract a key pair from improperly formatted JSON data, making it impossible to use tools like jq. The data also doesn't display in any specific order, ruling out extraction by columns or field numbers. What is the most effective approach for th ...

Having trouble with accessing a node module that was installed globally

I attempted to install the npm package @hapi/joi by running this command: alok@alok-HP-Laptop-14s-cr1xxx:~/tmp/js$ sudo npm install @hapi/joi -g + @hapi/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="e9838680a9d8dfc7d8c7de"> ...

How can we ensure the JSON output is easily searchable with grep?

The JSON structure I have is as follows: { "1":{ "state":{ "on":false, "bri":124, "hue":14985, "sat":252, "effect":"none", "xy":[ 0.5182, 0.4363 ], ...

Encountering Issues with Gatsby Build Due to Mozjpeg

Since yesterday, I've been facing issues deploying my Gatsby site to our server due to a problem with the mozjpeg library. Has anyone else run into this error before? I've attempted: locking gatsby-cli installing the automake linux package inst ...

Access the localhost:3000 webpage in kiosk mode once the Node.js server has fully started running

Currently, I am immersed in a Raspberry Pi project which requires me to operate a node server in kiosk mode. To prevent the default localhost opening upon server execution, I have implemented BROWSER=none. My intention is to use wait-on to ensure that th ...

Issue: receiving a "Permission denied" error while attempting to install with the nvm command

After a fresh installation of Ubuntu 21.04, I decided to set up nvm: curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh | bash Following that, I closed and reopened the terminal. However, when attempting to install version 12.16.3 ( ...

Enabling permissions on a Linux Apache server to execute a Python script through PHP

Recently, there has been quite a bit of discussion surrounding this topic and I have immersed myself in research over the past few days. When running the PHP script that executes the Python script from the command line, everything functions properly (show ...

Is there a way to automatically start a process during system boot at runlevel 2 using code?

Can someone please help me figure out how to write Python code that will initiate a process during startup, specifically at level two? I've done some research on my own, but I'm still unsure about the most reliable method to use across different ...

Issue encountered during installation: npm is unable to install protractor or selenium-webdriver due to a gyp ERR! build error

While working on an Angular project, I encountered an issue with installing Protractor and Selenium WebDriver for testing the E2E tests that I wrote. The error message that appeared was: gyp ERR! build error gyp ERR! stack Error: `make` failed with exit ...

Steps to installing Bower on CentOS 7

After successfully installing nodejs on my CentOS 7 system, I decided to proceed with installing bower. For those who are looking to install nodejs, here are the steps I followed: Download Node.js v0.10.30 tar.gz file Extract the downloaded file using ta ...

Limit the size of files to be unzipped using shell_exec

Currently, I am utilizing the following code to download a zip file from an external server that contains more than 1,000 images. The process of downloading and creating/copying the source zip file onto my server is successful, but for some reason, the cod ...

Is it possible to run nightwatch.js tests on a Linux machine?

Struggling to kick off the nightwatch automated UI tests on a Linux machine running CentOS OS? Starting is proving to be quite challenging. This is the test_settings configuration in my nightwatch.json: "test_settings": { "default": { ...

Keeping node and npm current: Leveraging nodesource ppa for updates

I am currently running Ubuntu 15.04 and recently added nodejs using the following ppa link: . The installation instructions can be found here: . npm was included as part of this installation from the ppa, so I'm wondering if simply updating and upgrad ...

Running Terser from a PHP script - a step-by-step guide

I have a PHP script that streamlines my development-to-production process. I am looking to utilize Terser for minifying the JavaScript files in my project. However, when I try to execute it using the php exec() function, I receive a result value of 1. Thi ...

When executed as a root user, the npm install command functions correctly, but when run as the jenkins user, it throws an

When attempting to execute npm install on my CentOS Linux machine as the user jenkins, I encounter the following error: npm WARN tar ENOENT: no such file or directory, lstat '/home/jenkins/workspace/'job name'/Scheduler/scheduler-component/node_modules/ " ...

sed is not able to pick out the values

Looking for assistance with the sed command. I am trying to extract JSON values and assign them to variables using sed. Can someone provide guidance on how this can be achieved? For example: echo "{url:news.google.com,int:3}" | sed ? url=news.google.com ...

Python 3 Selenium Error: Unable to Recognize the Name 'basestring'

Several weeks back, I successfully set up Selenium on a Linux Mint machine (a derivative of Ubuntu) and created Python scraping scripts with it. Everything ran smoothly. Recently, I attempted to replicate the same installation on another Linux Mint machin ...

Setting up Node.js 10 and npm on an Alpine Linux system

I am currently using Alpine to construct my Rails application and I am encountering complications with some of its dependencies. At this moment, here is my Dockerfile configuration: FROM ruby:2.5.1-alpine ENV BUNDLER_VERSION=2.0.2 RUN apk add --update - ...

Having trouble starting Google Chrome version 61 in CentOS 7 with Selenium WebDriver?

System Information: Operating System: Centos 7 Browser: GOOGLE CHROME V61 Automation Tool: SELENIUM WEBDRIVER 3.5.3 Driver: ChromeDriver 2.30/2.32 Attempted to run Google Chrome manually inside Jenkins slave environment google-chrome --no-sandbox --dis ...

What could be the reason for npm requesting a password?

Currently, I have a CentOS6.4 virtual box set up on Windows 8 using vagrant. In an attempt to install my project's dependencies, including proto, I ran into an unexpected issue. When running npm install proto, it asked me for a password. Why is npm su ...

Having trouble getting Node JS decipher to work on my Ubuntu server

I've created a Cipher that can encrypt and decrypt strings using a key. An error has been occurring: Error: Unsupported state or unable to authenticate data 0|ts-node | at Decipheriv.final (crypto.js:183:26) Here is my implementation: import ...

Selenium Grid: Unable to locate the DevToolsActivePort file (error: Chrome did not launch successfully and exited abnormally)

Recently, I decided to use Selenium Grid to automate some tests. To make the process more efficient, I set up VMs running on a LINUX Platform (one acting as a Selenium hub and others as Selenium nodes). The standalone server started without any issues in b ...

Running a file in Windows CMD using Node is a simple process that involves executing specific

I have successfully executed this code snippet in Linux without any issues: > npm run setup-hooks -s > '.' is not recognized as an internal or external command, operable program or batch file. However, I am facing difficulties trying to m ...

Exploring ApacheBench tool for testing http requests in PHP

In my script, I am retrieving the value from a request using the following code: $body = file_get_contents('php://input'); I am currently testing this script with the ApacheBench (ab) utility. How can I send the value of php://input in ApacheBench? Your ...

The Tauri development and building process encountered errors on an Ubuntu system

When attempting to create a tauri app on Ubuntu 16.4.7 (LTS) following the official documentation, I encounter numerous errors after running either sudo npm run tauri dev or sudo npm run tauri build. The log file shows: 0 info it worked if it ends with ok ...

Selenium in combination with Google Chrome

Looking to scrape websites using selenium and google chrome? Wondering if you need virtualenv and why/why not? #Setting Up Google Chrome wget -c wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb dpkg -i google-chrome-stable_cu ...

npm uninstall can sometimes hang or operate very slowly with no visible activity

I've always noticed that when executing npm uninstall, it tends to take longer than expected. Currently, I initiated the uninstall process for four packages approximately 25 minutes ago, yet it seems to have halted with no visible progress, no noticea ...

The Linux Unity Editor requires npm to function properly, but unfortunately, the npm package is not currently installed

Looking for assistance in installing the Linux Unity Editor, I followed the instructions provided here. After downloading the latest NodeJS package version v9.2.0, I confirmed that both node and npm can be run from the console as root. I also added the pat ...