I have a kind of the following strings and I wan to call: in order to get “aaa.bbb.” for str1 and “aaa.” for str2 what should I use as expression inside {} Answer Use it like this:
Communicate with a subprocess using pipes on other than stdout/stderr
This is how I fork/exec a subprocess and communicated with it (pseudocode): My question is: I don’t really want to read the stdout of my subprocess, I would like the subprocess to write on a file descriptor other than stdout. And, I’d like the above code to read from that file descriptor. The subp…
Accessing Default directory in perl
I am having a perl script which is taking a directory path as input and then script iterates through all the files present in that directory. For each file it calls some other function. Here is the script: My question here is when i am reading input directory, in case if does not exists how can make above scr…
Open Linux terminal command in PHP
I have a server running on Linux that execute commands to 12 nodes (12 computers with Linux running in them). I recently downloaded PHP on the server to create web pages that can execute commands by opening a specific PHP file. I used exec(), passthru(), shell_exec(), and system(). system() is the only one t…
Woking With BMP File in C++, Ubuntu
I am trying to work with a bmp file in linux with g++ compiler. I am using C++ language. I Need to load a .bmp file from the standard input. for example: So I need a Code to do this job. I think storing the whole .bmp file is good by I don’t know how to do this. I Tried
How can I clone a module from linux kernel?
If I only want to focus on a module of linux, such as perf, how can I just fork or download perf module related files from github? I have tried the following command: But it can’t work. Answer You need to use a combination of two relatively new features of Git. The first is sparse-checkout (available si…
setuid(0) fails to execute for root owned program
I need to write some code which can gain root priveleges and execute system level operations. Here’s what I’ve written (this is not the actual code, just to test if I’m doing things correctly or not): After doing gcc -o setuid setuid.c, I run ls -al on this to get following results: Trying t…
Linux: what is link
I’m new in Linux I’m just using windwos GUI before but I have a question: what is LINK in Linux? I know it have tow type but I don’t know what is the advantage of them normally in windows has shortcut to reference app from the difference path if LINK in Linux have the same feature why it hav…
Cannot get Pandas to install ! Help! (pip install pandas)
I’m trying to install Pandar but I can’t get pandas to install on my linux Centos 6.4. Running pip install pandas leads to this error: What should I do to fix this? Answer Im pretty sure thats a compiler error, so try installing g++ on the system if you are working on linux, run this.
How can I see the output console after running a nohup command?
I have a code running on a Linux server. Since it takes hours to run, I have to use nohup to make sure my code is still running in case I loose my connection to the server. Again since I have to wait hours to see the results, I defined a counter to print out the progress of my code