 |
|
 |
Anybody help me
I want to Set Fixed ip in Linux machine.
Thanks
|
|
|
|
 |
 | Looking for Opensource SNTP client for Linux |  | neolaser | 3:27 18 Jan '09 |
|
 |
I am looking for an opensource SNTP client for Linux, preferably with a NON GPL license. I got some programs but most of the programs came with GPL license. Any links, pointers will be of great help.
Thanks in Advance, neolaser
|
|
|
|
 |
 | Doing encryption that embedded into mail server |  | xiaomahe | 8:49 2 Jan '09 |
|
 |
Hello, i am planning to do email with encryption system embedded inside the mail system itself..
Currently, i am not sure on how to do such embedded program (creating a encryption program that plugs to the email itself when u run the email system)..
can somebody gimme ideas on how to do that? i have decided to use postfix and dovecot to setup and the mail system, probably with squirrel mail as well..
ANd which programming language more suitable for encyrption programs?? i know most of the language can be used, but which is the best..
|
|
|
|
 |
 | Accessing ping through c/c++ |  | tassadaque | 3:18 31 Dec '08 |
|
 |
I want to extract information such as rtt, time from each ping, if i ping some host. i think i should first capture the process id of ping and then use its information to get the required data. Any help in this regard is greatly appreciated
|
|
|
|
 |
|
|
 |
 | C programming in Linux warning message |  | Kogee San | 18:24 9 Dec '08 |
|
 |
Hello everyone. Im not quite sure either Im in the right forum since my question is basically on C programming, coding in the linux environment. After I gcc, I got this warning message
"warning: passing argument 1 of 'strcpy' makes pointer from integer without a cast"
When I run the program, I will have a segmentation error fault. This is the code snippet below.
static const char *opt_socket_name[5];
main() { int i = 0;
strcpy(*opt_socket_name[i], "testing") printf("%s", opt_socket_name); }
Im not quite sure why this happen. Can anyone here help me and explain what is going on behind the scene. Can you guys also give an opinion on how to make it work. A brief on what I am doing is actually, creating multiple socket with different names. I am just about to create different names, but the warning above appeared. Is there any other options to do this? The above code is just a small testing code to make the strcpy() works. Im quite new in programming so currently im learning. Thanks
|
|
|
|
 |
|
 |
It looks like you're trying to copy text into a string, but there are quite a few mistakes in the code:
1. A string is an array of characters, for eg. char str[100]. Therefore opt_socket_name[5] is a string that can hold 4 characters (+1 for the null terminator)
3. A * represents a pointer - you can also use a character pointer as a string, but it would point to an existing array of characters.
4. You use either * or an array. In your case, *opt_socket_name[5] means an array of 5 strings.
5. const = constant. Don't use that unless you don't want to modify the string.
So here's what your code should look like:
static char opt_socket_name[20];
main() { strcpy(opt_socket_name, "testing"); printf("%s", opt_socket_name); } If you're looking for an explanation for your warning and the segmentation fault, here it is: as I mentioned, in your original program, opt_socket_name[i] is a string and *opt_socket_name[i] points to a single character in the string. What you are passing to strcpy is a single character, which in C can be implicitly typecast to an integer, which in turn is typecast to a pointer and hence the warning.
|
|
|
|
 |
|
 |
yeah, That is basically what is I intended to do. I understand with the code you gave me since it is a basic strcpy() syntax. Anyway, thanks for the explanation behind the scene because that is the important thing i want to know. however, im not quite sure about what you mentioned of *opt_socket_name[5] means an array of 5 strings.. So does it means that *opt_socket_name[5] points to 5 strings? What I mean is like this :-
*opt_socket_name[0] is pointing to a string for example char string1[10]; *opt_socket_name[1] is pointing to a string example char string2[10]; *opt_socket_name[2] is pointing to a string for example char string3[10]; *opt_socket_name[i] is pointing to a string for example char stringi[10];
How can i make a program to test this if my understanding here is true. The test is just to secure my knowledge and understanding. Thank a lot.
|
|
|
|
 |
|
 |
You're partially right about the *opt_socket_name[5] thing. You declare the array of pointers using a *, eg. char *opt_socket_name[5].
Now, for a normal pointer, you would assign it the address of an existing variable. Example:
int value = 10; int *pointer = &value; printf("%d\n", *pointer); But the problem is that there is no string data type in C. A string itself is an array of characters and an array is internally a pointer, which means that a string is already a pointer. So the & and * are not used at all. This is how you would use an array of strings:
main() { int i; char *opt_socket_name[5];
char string1[10]; // ... char string5[10];
strcpy(string1, "hello 1"); // ... strcpy(string5, "hello 5");
opt_socket_name[0] = string1; // ... opt_socket_name[4] = string5;
for (i = 0; i < 5; i++) printf("%s\n", opt_socket_name[i]); }
|
|
|
|
 |
|
 |
wow. Thanks man. This explanation really helps my understanding in C character pointers. I will try this testing code later. Thanks a lot.
|
|
|
|
 |
|
 |
Hi, I used to learn Red Hat Linux version 9 and now I didn't continue to study it. At my work place I have a problem with my internet connection that over usage. As I have check with the document, I found that suse linux could be setup as a web proxy (squids) which could control and limit the amount of usage of internet. From here I would like to have a question as follow:
1. Is it possible for me to read only the chapter of setup and configure linux as web proxy?
2. Does the machine run as linux web proxy require one or two network interface card?
3. Do I need to read any additional document regarding to configure and monitoring linux web proxy?
Thank in advance!!!
|
|
|
|
 |
|
 |
For questions 1 and 3: If you're familiar with Linux, yes, it's enough you read up the chapter on squid. I also found a simple tutorial here[^].
For question 2: Generally, you need two. One connects the proxy server to the local network. Another connects it to the internet, unless you're using an interface other than Ethernet.
|
|
|
|
 |
|
 |
Go to http://damnsmalllinux.org/download.html[^], select any of the mirrors, then go to the current folder and download current.iso. Burn the image onto a CD, then reboot your system and the DSL live CD should load.
|
|
|
|
 |
|
 |
I think it's not about free or not ,it's about the open source ,a open soft spirit! however , it does depend on your own choice .no one can deny your choice except yourself... 
|
|
|
|
 |