i need to set an environment variable for the rails app to use the config settings for production is as shown below how can i set the environment variable using the linux command I tried to set the variable but looks like it needs to be for the right user. Sorry i am not an expert in linux. I appreciate
Tag: linux
Bash: Parse CSV and edit cell values
I am new to bash scripting I have the following CSV Input Expected Output I need to check Location and Way and convert them to UpperCase – ABC, UP Day needs to be mon – Mon I need to do this for entire CSV. I need to correct the value and write all the fields on to CSV or edit
Working with multiple displays – will XOpenDisplay(NULL) sometimes fail to get current display of a window?
I have an *.SO library, which when called from an application, removes window decorations from the specified window. Here is my code: My question – with my current code set up – will it sometimes fail to remove window decorations depending on which display the window is currently displayed on? My …
Bash script: cd No such file or directory when file exists
My bash script is written to go to each subfolder in the current directory: When I run my bash script, I am getting a cd error for a directory that exists: Yet, in terminal command line I can do cd ‘Zelkova serrata’ within the same directory as the script and all is fine. Is it possible the bash s…
What’s the difference between XOpenDisplay(0) and XOpenDisplay(NULL)?
What’s the difference between Display XOpenDisplay(0) and XOpenDisplay(NULL)? In the above code I wrote an *.SO library for Linux that when called removes the window decorations of the specified window. In the line of that code which reads: I have tried replacing that with: And both usages seem to succe…
How to Mock Linux System Calls in C
When writing C modules that use linux system calls, what is the best practice to mock those calls in order to test the module? Are there maybe any libraries that offer mocks for linux system calls? “my-module.h” – The interface description “my-module.c” – The module to test…
Put quotes around string before first forward slash in line by line file read
I am writing a bash script that deletes all the files whose paths are given in delete.txt. delete.txt is thousands of lines long, each line has a path that is structured like this: Where there is a space in the name of the first directory. Currently, my bash script reads each line of delete.txt, saves it to$l…
Do linux read/write system calls use dynamic memory allocation?
I wonder if read and write system calls on linux (used with unix sockets) do dynamic memory allocation? The context are real time applications and deterministic behaviour. Answer No. If you look for syscalls in the Linux kernel source (I used grep -rn SYSCALL_DEFINE.*write to find read/write), you can see the…
Buffer Overflow: NOP sled not working [closed]
Closed. This question needs debugging details. It is not currently accepting answers. Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question. Closed 5 years ago. Improve this question Hey I…
Temp directory on root drive runs out of space when PUTing a large file into Apache
I’m putting (via curl on a client) a 10GB file up into an Apache server on Ubuntu Linux (v17.04). The root drive was pretty much full, and the ultimate destination for the PUT is a subversion root that is on a huge drive that’s not root. The only other technology involved is mod_dav_svn. How to mo…