LINUX SYSTEM() API
Hi, Can anybody tell me the output of the below code, whether "bye" will be printed or not? /* Thanks in advance */ #include <stdio.h> int main() { system("ls -l"); printf("bye"); return 0; } ...
Hi, Can anybody tell me the output of the below code, whether "bye" will be printed or not? /* Thanks in advance */ #include <stdio.h> int main() { system("ls -l"); printf("bye"); return 0; } ...
Is there any way/command to detect ongoing telnet sessions? I have a linux system which is shared by 3-4 engineers. I want to track which engineer is logged in and from which ip address. Is there any command/log which can provide me above informations? ...
HI I am not very good with linux shell scripting.I am trying following shell script to replace revision number token $rev -<rev number> in all html files under specified directory cd /home/myapp/test set repUpRev = "`svnversion`" echo $repUpRev grep -lr -e '\$rev -'.$repUpRev.'\$' *.html | xargs sed -i 's/'\$rev -'.$repUpRev.'\$'/'\...
In Ubuntu if a file /A/largefile.foo is moved via 'cp' or 'mv' to /B/largefile.foo, how can I ensure that the entire file is written before attempting to move the file a second time to /C/largefile.foo? Case: 1. An remote automated Script X begins an rsync to destination folder A of a very large file. 2. A cron job on the local machin...
I'm trying to pick an small (< 4") touchscreen TFT/LCD. Because I'm no stranger to LCD/TFT linux driver development (I did one for an Epson chip), I'd rather pick one that is supported directly by the kernel. Is there a listing of the video chipsets that Linux natively supports? ...
Hi ! Can anyone please tell me how to create a combobox like following with Gtk (on Linux)? (I already ask this question for win32 API). A code example or tutorial will be very helpful. I have tried searching this over the internet, but unfortunately documentations/tutorials aren't that much rich for Gtk. Thank you very much. Rega...
Hey guys and gals, I'm not sure if this is possible in one line (i.e., without writing a script), but I want to run an ls | grep command and then for each result, pipe it to another command. To be specific, I've got a directory full of images and I only want to view certain ones. I can filter the images I'm interested in with ls | gr...
In the spirit of http://stackoverflow.com/questions/3349990/code-snippet-managers-for-os-x What are some good code snippet managers for Linux? My quick search didn't turn up much. Eclipse, emacs, vim, Kate, and KDevelop all offer their own integrated snippet managers, but I'm looking for something more generic along the lines of CodeC...
I have a python script that connects to an external host, fetches some data, and populates a Django database with the data. The python script that populates the database uses these lines to setup the django environment: path = os.path.normpath(os.path.join(os.getcwd(), '..')) sys.path.append(path) from django.core.management import setu...
I'm wondering if there's a way to write-protect every page in a Linux process' address space (from inside of the process itself, by way of mprotect()). By "every page", I really mean every page of the process's address space that might be written to by an ordinary program running in user mode -- so, the program text, the constants, the ...
The following works fine from command line /usr/bin/mysqldump -uUser -pPass Db_name > /var/www/db_backup/db.`date +%Y%m%d%H%M`.sql but when I try to do that in cron, I get the error: bad ` sign errors in crontab file, can't install I saw someone else on the net solve the same problem by escaping the percent signs, but that didn't...
Suppose you run the following commands: ssh $host1 'while [ 1 ]; do sleep 1; echo "Hello from $HOSTNAME"; done' > /tmp/output ssh $host2 'while [ 1 ]; do sleep 1; echo "Hello from $HOSTNAME"; done' >> /tmp/output ssh $host3 'while [ 1 ]; do sleep 1; echo "Hello from $HOSTNAME"; done' >> /tmp/output Then the output would look like: ...
I had a use case for a group chat server where the server had to write a common string to all clients' socket. I had then addressed this by looping through the list of file descriptors and writing the string to each of the file descriptors. Now I am thinking of finding a better solution to the problem. Is it possible to do this by a sin...
Hello world. I'm kind of new to unix environment. I want to have a little chat program that the initial terminal is used for input, and invoke another terminal for output. I've been searching the web but without any luck. Hope I can get some clues here. Thanks. Ok, to be more specific, I am writing a chat program over tcp/ip on m...
Hello. If I have the following code in Windows VC++: DWORD somevar = 0x12345678; _asm call dword ptr [somevar] How can I make the same thing in GCC inline-assembly, with AT&T syntax? __asm__ __volatile__ ( "call dword ptr [%%edx]" : : "d" (somevar) ); I've tried something like this, but it generates an "junk" error... And ...
Well, altough the S of the SNMP stands for Simple, yet, so far I haven't experienced it that way. And now that I am about to deploy my software on around around 180 remote Linux servers and wants to monitor the servers and configure my daemons all from a centralized point. I simply want you to recommend me the library which you'll confi...
We've built a php application that we need to host on a Windows Server 64 bit platform (due to another software being present that we need to access). However, our php application has been built on a linux environment. Is there anything we need to be watchful of when running apache and this php application on a Windows environment? ...
I have a fairly large python program that is causing a lot of disk I/O (on top, %wa can get as high as 80, and iotop says that my process is the culprit). There are several things that may cause this - I'm writing to more than one log file, and I'm saving cached results to disk in several places, so it's not immediately obvious where I ...
How does Linux determine the next PID it will use for a process? The purpose of this question is to better understand the Linux kernel. Don't be afraid to post kernel source code. If PIDs are allocated sequentially how does Linux fill in the gaps? What happens when it hits the end? For example if I run a PHP script from Apache that ...
Hi, First of all, I don't know if this is where I have to ask this question; so I'll count on the moderators to move it if need be. I have a Linux PHP web hosting account on GoDaddy. When I have to upload a file, I normally use FTP, either a client or the host's file manager. However, if the file is one which I have to download from ...