I'm implementing an FTP like protocol in Linux (homework) and I came upon the following problem: the client may be able to connect() and write() before the other side managed to do accept() (but after it did listen()). How can I prevent the write operation from working without relying on passing messages like "accept succeeded, you can w...
What is the standard way to retrive and check for the argc and argv and what is the best usage and how to do that in linux?
Please provide examples.
"I want to have a complex command-line options and I want to use them in my application"
That what I mean.
Thanks
...
Hi, I need to get the file descriptor to use in ioctl() calls for an ethernet port in Linux. Not sure how to do this.
...
Hello,
Currently, I am running Mint Linux (Release 9). I need to downgrade Java from version 1.6 to 1.5, and have been trying to figure out how to go about this. So far, I've had no luck. The package manager doesn't seem to have it.
Does anyone have any suggestions?
Thanks,
- Chris
...
Client wants login pages to load via https. This is easily accomplished, but since the site uses pretty url's, we now stay in https mode when clicking around after login is finished. This breaks secure files which are uploaded in the CMS, stored above webroot, and downloaded by streaming through a php script if user has the appropriate...
I want to get address of instruction that causes external program to SIGSEGV. I tried using ptrace for this, but I'm getting EIP from kernel space (probably default signal handler?). How GDB is able to get the correct EIP?
Is there a way to make GDB provide this information using some API?
edit:
I don't have sources of the program, onl...
We have a message processing system with high performance demands. Recently we have noticed that the first message takes many times longer then subsequent messages. A bunch of transformation and message augmentation happens as this goes through our system, much of it done by way of external lib.
I just profiled this issue (using cal...
Are there locks in Linux where the waiting queue is FIFO? This seems like such an obvious thing, and yet I just discovered that pthread mutexes aren't FIFO, and semaphores apparently aren't FIFO either (I'm working on kernel 2.4 (homework))...
Does Linux have a lock with FIFO waiting queue, or is there an easy way to make one with exis...
Hi Guys! I don't know if I am being clear with my question. I would like to ask for suggestions on the available IDEs that you I use in a command line interface (CLI) only linux distro. I am using debian. I want to program in C or C++ and I could not start because I dont have an ide or just a simple text editor. I don't have an idea how ...
Hi,
I want to learn C , UNIX and LINUX, and more about embedded systems. Very much interested in them. Are there any online courses or websites which can guide me. And please suggest books to read in learning them.
Thanks for your time.
Ya please lets your answers and comments come in , they are invaluable to me..!!
...
I want grep for a particular work in multiple files. Multiple files are stored in variable testing.
TESTING=$(ls -tr *.txt)
echo $TESTING
test.txt ab.txt bc.txt
grep "word" "$TESTING"
grep: can't open test.txt
ab.txt
bc.txt
Giving me an error. Is there any other way to do it other than for loop
...
Hello, I use File::Find -> find(\&f, $directory) for find some file with some content.
Relevant part of my delegate looks like:
sub f {
my $file = $File::Find::name;
return unless -f $file;
return unless $file =~ /$file_pattern/;
etc...
but the problem is that, that this code returns every time where $file not exist in curren...
I'm completely new to Linux, but today I find myself setting up a server (Ubuntu 10.04 LTS lucid) from scratch to host a Rails application.
Anyway, I managed to get a Rails app up and running on the server itself, but I had to scrap that because I want to use Git. So I setup a git repository on the server, then pushed all the code from ...
Hi,
I need to pre-compress some very large html/xml/json files (large data dumps) using either gzip or deflate. I never want to serve the files uncompressed. They are so large and repetitive that compression will probably work very very well, and while some older browsers cannot support decompression, my typical customers will not be usi...
Hello everybody,
I've just made an upgrade and now partly thinking on web-server directory structure for local workstation for web-development on linux platform. Running multiple hosts and different projects required. Where is it better to put all the server's docroots? /var/www? /srv? /www? I plan to make it as separate partition - cou...
I have a classifieds website, and on each classifieds page, there is a form for tipping a friend where you just enter the persons email-adress and the tip will then be sent. The form is submitted to tip.php where all "magic" happens with checking and sanitizing etc etc...
Lastly I use php:s mail() function to send the email from tip.php...
Hi,
I would like to trace calls to some 3rd party library which are made from another 3rd party library.
Example: I want to trace calls to library A. My application statically links library B, which in turn is statically linked to library A. So basically what I have is libAB.a
In case of dynamic linking I could write library A2 with ...
hello,
I'm trying to port a Windows app to Linux. This appplication marks some functions with the __stdcall attribute. However, i was told by a friend that stdcall is used only on windows and has no meaning in linux (but DOES exist in Windows GCC).
I tried to search Google about that, and got some results state that there IS stdacll in L...
Consider something like:
cat file | command > file
Is this good practice? Could this overwrite the input file as the same time as we are reading it, or is it always read first in memory then piped to second command?
Obviously I can use temp files as intermediary step, but I'm just wondering..
t=$(mktemp)
cat file | command > ${t} &&...
I would like to check a network devices status e.g. promiscous mode. Basically like shown with ip a command.
Maybe someone could push me in the right direction?
I would need this in C for linux so linux specific headers may be included.
Thanks in advance!
...