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…
Tag: linux
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
Detect when reader closes named pipe (FIFO)
Is there any way for a writer to know that a reader has closed its end of a named pipe (or exited), without writing to it? I need to know this because the initial data I write to the pipe is different; the reader is expecting an initial header before the rest of the data comes. Currently, I detect this
Set System date and time using C++ in Linux
I am in the middle of developing a cross platform application that changes the system date and time to a specified value. I have completed the part for Windows. How can I set the system date and time from a C++ program in Linux? I am looking for a function similar to SetSystemTime(SYSTEMTIME &x). As far a…