All of lore.kernel.org
 help / color / mirror / Atom feed
* RE: Newbie problem
@ 2002-04-25 16:53 Ed Vance
  2002-04-25 17:12 ` Bahadir Karuv
  0 siblings, 1 reply; 21+ messages in thread
From: Ed Vance @ 2002-04-25 16:53 UTC (permalink / raw)
  To: 'Bahadir Karuv'; +Cc: linux-serial

Hi,

My guess is that the second computer has "echo" enabled so all characters
received are echoed back to the other end. I see you turn echo off in the
program. I am assuming that the program is only running on the first
computer. 

Regards,
Ed

---------------------------------------------------------------- 
Ed Vance              edv@macrolink.com
Macrolink, Inc.       1500 N. Kellogg Dr  Anaheim, CA  92807
----------------------------------------------------------------

-----Original Message-----
From: Bahadir Karuv [mailto:bahkar@bcacademies.bergen.org]
Sent: Thursday, April 25, 2002 8:59 AM
To: linux-serial@vger.kernel.org
Subject: Newbie problem


Hello All,

I am trying to have to computers communicate over the serial port.
The program below is modified from "Serial Programming Guide for Posix
operating Systems"
I am geting the following output when I send "Testing123" over the
serial port from the second computer


opened 3
just sent Hello
got back - Hello
just sent Hello
got back - HelloTesting123
just sent Hello
got back - Hello

First computer is getting the string echoed back to itself after it
sends "Hello".

What am I doing wrong?

Thanks and regards!




#include <stdio.h>
#include <unistd.h>
#include <fcntl.h>
#include <termios.h>
#include <string.h>

int main(void)   /* Serial port */
       {
 time_t tsec;
 int fd;
 struct termios options;
 char buffer[255];
 char *bufptr;
 int  nbytes;
 char *message="Hello";

 /* open the port */
 fd = open("/dev/ttyS0", O_RDWR | O_NOCTTY | O_NDELAY);
 //fcntl(fd, F_SETFL, FNDELAY);
 printf("opened %u\n",fd);
 /* options */
 tcgetattr(fd, &options);
 options.c_cflag     |= (CLOCAL | CREAD);
 options.c_lflag     &= ~(ICANON | ECHO | ECHOE | ISIG);
 options.c_oflag     &= ~OPOST;
 options.c_cc[VMIN]  = 0;
 options.c_cc[VTIME] = 10;
 tcsetattr(fd, TCSANOW, &options);
 /* read characters into our string buffer until CR or NL */
 while(1){
 write(fd, message,strlen(message));
 printf("just sent %s\n",message);
 tsec=time(NULL);
 while(time(NULL)-tsec<1);

 bufptr = buffer;
 buffer[0]='\0';
 while ((nbytes = read(fd, bufptr, bufptr-buffer + sizeof(buffer)-1)) >
0)
 {
  bufptr += nbytes;
  if (bufptr[-1] == '\n' || bufptr[-1] == '\r')
   { printf("break\n");break;}
 }
 if (buffer!=bufptr){
   *(bufptr) = '\0';
   printf("got back - %s\n",buffer);
 }
    }
    close(fd);
}



-
To unsubscribe from this list: send the line "unsubscribe linux-serial" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 21+ messages in thread
* Newbie problem
@ 2007-07-28  7:20 Insitu
  2007-07-28  8:01 ` Junio C Hamano
  0 siblings, 1 reply; 21+ messages in thread
From: Insitu @ 2007-07-28  7:20 UTC (permalink / raw)
  To: git

Hello, 
I am new to git and gave it a try to version my home dir and
synchronize it between two machines. It works but I think I did some
mistakes in my setup which make its usability non optimal: 
 - push/pull operations need remote address
 - I didn't set up any branch

Here is what I did (lap is for operations on laptop, pc on desktop):
lap> git init
lap> git add ...
lap> git commit ...
lap> scp .git pc:
lap> mv .git git-init
pc> git checkout .
pc> git commit ...
lap> git clone  -n --bare --reference git-init/  ssh://pc/~/.git
lap> git checkout .
lap> git add ...
lap> git commit

Now, I want to be able to do:
lap> git push
or
lap> git pull

instead of 
lap> git push ssh://pc/~/.git

I think I need to reconfigure my remote branches/origin on laptop but
don't want ot break everything.

Help appreciated,
-- 
OQube < software engineering \ génie logiciel >
Arnaud Bailly, Dr.
\web> http://www.oqube.com

^ permalink raw reply	[flat|nested] 21+ messages in thread
* RE: newbie problem
@ 2003-02-17  8:49 Eugene Joubert
  2003-02-17 10:48 ` Chris Barnes
  0 siblings, 1 reply; 21+ messages in thread
From: Eugene Joubert @ 2003-02-17  8:49 UTC (permalink / raw)
  To: 'Chris Barnes', Netfilter

[-- Attachment #1: Type: text/plain, Size: 1528 bytes --]

Is your webserver on your firewall?

Also your rule for port 80....you're source port is wrong. Remember if I
were to access your webpage on your server I will be coming in with a source
port that my OS has given me. So instead of source port change it to
destination port cause that is were you request is going?

Also I would suggest moving your webserver to another server behind your
firewall.
Just my 5 cents.

PS:
You could also set your OUTPUT Policy to default ACCEPT, but if your really
paranoid then just make it DROP



-----Original Message-----
From: Chris Barnes [mailto:runtimeerror@bigpond.com] 
Sent: 17 02 2003 09:43 AM
To: Netfilter
Subject: newbie problem


hi people i'm new to the list.

anyway, I have a very simple firewall on a web server. I want to deny access
to everything except the web server (port 80)

i have set the poilcy on all chains to drop and i have added a rule to the
input chain which says

iptables -A INPUT -p tcp --sport 80 -j ACCEPT

i've done it like this because the web server has 2 interfaces (eth0 and
eth1) which i would like to have access to the server (eth0 is local
10.3.2.0/24 and eth1 is external)

i also made a rule for output

iptables -A OUTPUT -p tcp -j ACCEPT

the problem is that nothing can get to the web server...the packets are
being dropped...i checked the counters and none of the rules counted any
packets or bytes so the packets are being dropped before the rules.

what am i doing wrong or what is a better way to do this?

thanks heaps for your help.



[-- Attachment #2: Type: text/html, Size: 2511 bytes --]

^ permalink raw reply	[flat|nested] 21+ messages in thread
* newbie problem
@ 2003-02-17  7:43 Chris Barnes
  2003-02-17  8:09 ` Joel Newkirk
                   ` (3 more replies)
  0 siblings, 4 replies; 21+ messages in thread
From: Chris Barnes @ 2003-02-17  7:43 UTC (permalink / raw)
  To: Netfilter

[-- Attachment #1: Type: text/plain, Size: 877 bytes --]

hi people i'm new to the list.

anyway, I have a very simple firewall on a web server. I want to deny
access to everything except the web server (port 80)

i have set the poilcy on all chains to drop and i have added a rule to
the input chain which says

iptables -A INPUT -p tcp --sport 80 -j ACCEPT

i've done it like this because the web server has 2 interfaces (eth0 and
eth1) which i would like to have access to the server (eth0 is local
10.3.2.0/24 and eth1 is external)

i also made a rule for output

iptables -A OUTPUT -p tcp -j ACCEPT

the problem is that nothing can get to the web server...the packets are
being dropped...i checked the counters and none of the rules counted any
packets or bytes so the packets are being dropped before the rules.

what am i doing wrong or what is a better way to do this?

thanks heaps for your help.



[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 21+ messages in thread
* RE: Newbie problem
@ 2002-04-25 17:19 Ed Vance
  2002-04-25 17:37 ` Bahadir Karuv
  0 siblings, 1 reply; 21+ messages in thread
From: Ed Vance @ 2002-04-25 17:19 UTC (permalink / raw)
  To: 'Bahadir Karuv'; +Cc: linux-serial

Hi Karuv,

Is it not RS-232 interface? RS-485/422 2-wire will do this because the
transmit and receive pairs are the same pair.

Regards,
Ed

---------------------------------------------------------------- 
Ed Vance              edv@macrolink.com
Macrolink, Inc.       1500 N. Kellogg Dr  Anaheim, CA  92807
----------------------------------------------------------------

-----Original Message-----
From: Bahadir Karuv [mailto:bahkar@bcacademies.bergen.org]
Sent: Thursday, April 25, 2002 10:12 AM
To: Ed Vance; linux-serial@vger.kernel.org
Subject: Re: Newbie problem


Hi Ed,

Thanks for the speedy response. I thought the same but the first
computer keeps getting whatever it is sending ("Hello") eventhough the
serial cable is disconnected. The program I sent is running on the first
computer.

Thanks again and regards,

Karuv

Ed Vance wrote:

> Hi,
>
> My guess is that the second computer has "echo" enabled so all
> characters
> received are echoed back to the other end. I see you turn echo off in
> the
> program. I am assuming that the program is only running on the first
> computer.
>
> Regards,
> Ed
>
> ----------------------------------------------------------------
> Ed Vance              edv@macrolink.com
> Macrolink, Inc.       1500 N. Kellogg Dr  Anaheim, CA  92807
> ----------------------------------------------------------------
>
> -----Original Message-----
> From: Bahadir Karuv [mailto:bahkar@bcacademies.bergen.org]
> Sent: Thursday, April 25, 2002 8:59 AM
> To: linux-serial@vger.kernel.org
> Subject: Newbie problem
>
> Hello All,
>
> I am trying to have to computers communicate over the serial port.
> The program below is modified from "Serial Programming Guide for Posix
>
> operating Systems"
> I am geting the following output when I send "Testing123" over the
> serial port from the second computer
>
> opened 3
> just sent Hello
> got back - Hello
> just sent Hello
> got back - HelloTesting123
> just sent Hello
> got back - Hello
>
> First computer is getting the string echoed back to itself after it
> sends "Hello".
>
> What am I doing wrong?
>
> Thanks and regards!
>
>
>
> #include <stdio.h>
> #include <unistd.h>
> #include <fcntl.h>
> #include <termios.h>
> #include <string.h>
>
> int main(void)   /* Serial port */
>        {
>  time_t tsec;
>  int fd;
>  struct termios options;
>  char buffer[255];
>  char *bufptr;
>  int  nbytes;
>  char *message="Hello";
>
>  /* open the port */
>  fd = open("/dev/ttyS0", O_RDWR | O_NOCTTY | O_NDELAY);
>  //fcntl(fd, F_SETFL, FNDELAY);
>  printf("opened %u\n",fd);
>  /* options */
>  tcgetattr(fd, &options);
>  options.c_cflag     |= (CLOCAL | CREAD);
>  options.c_lflag     &= ~(ICANON | ECHO | ECHOE | ISIG);
>  options.c_oflag     &= ~OPOST;
>  options.c_cc[VMIN]  = 0;
>  options.c_cc[VTIME] = 10;
>  tcsetattr(fd, TCSANOW, &options);
>  /* read characters into our string buffer until CR or NL */
>  while(1){
>  write(fd, message,strlen(message));
>  printf("just sent %s\n",message);
>  tsec=time(NULL);
>  while(time(NULL)-tsec<1);
>
>  bufptr = buffer;
>  buffer[0]='\0';
>  while ((nbytes = read(fd, bufptr, bufptr-buffer + sizeof(buffer)-1))
> >
> 0)
>  {
>   bufptr += nbytes;
>   if (bufptr[-1] == '\n' || bufptr[-1] == '\r')
>    { printf("break\n");break;}
>  }
>  if (buffer!=bufptr){
>    *(bufptr) = '\0';
>    printf("got back - %s\n",buffer);
>  }
>     }
>     close(fd);
> }
>
>
> -
> To unsubscribe from this list: send the line "unsubscribe
> linux-serial" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> *** eSafe scanned this email for malicious content ***
> *** IMPORTANT: Do not open attachments from unrecognized senders  ***
>

^ permalink raw reply	[flat|nested] 21+ messages in thread
* Newbie problem
@ 2002-04-25 15:58 Bahadir Karuv
  0 siblings, 0 replies; 21+ messages in thread
From: Bahadir Karuv @ 2002-04-25 15:58 UTC (permalink / raw)
  To: linux-serial

Hello All,

I am trying to have to computers communicate over the serial port.
The program below is modified from "Serial Programming Guide for Posix
operating Systems"
I am geting the following output when I send "Testing123" over the
serial port from the second computer


opened 3
just sent Hello
got back - Hello
just sent Hello
got back - HelloTesting123
just sent Hello
got back - Hello

First computer is getting the string echoed back to itself after it
sends "Hello".

What am I doing wrong?

Thanks and regards!




#include <stdio.h>
#include <unistd.h>
#include <fcntl.h>
#include <termios.h>
#include <string.h>

int main(void)   /* Serial port */
       {
 time_t tsec;
 int fd;
 struct termios options;
 char buffer[255];
 char *bufptr;
 int  nbytes;
 char *message="Hello";

 /* open the port */
 fd = open("/dev/ttyS0", O_RDWR | O_NOCTTY | O_NDELAY);
 //fcntl(fd, F_SETFL, FNDELAY);
 printf("opened %u\n",fd);
 /* options */
 tcgetattr(fd, &options);
 options.c_cflag     |= (CLOCAL | CREAD);
 options.c_lflag     &= ~(ICANON | ECHO | ECHOE | ISIG);
 options.c_oflag     &= ~OPOST;
 options.c_cc[VMIN]  = 0;
 options.c_cc[VTIME] = 10;
 tcsetattr(fd, TCSANOW, &options);
 /* read characters into our string buffer until CR or NL */
 while(1){
 write(fd, message,strlen(message));
 printf("just sent %s\n",message);
 tsec=time(NULL);
 while(time(NULL)-tsec<1);

 bufptr = buffer;
 buffer[0]='\0';
 while ((nbytes = read(fd, bufptr, bufptr-buffer + sizeof(buffer)-1)) >
0)
 {
  bufptr += nbytes;
  if (bufptr[-1] == '\n' || bufptr[-1] == '\r')
   { printf("break\n");break;}
 }
 if (buffer!=bufptr){
   *(bufptr) = '\0';
   printf("got back - %s\n",buffer);
 }
    }
    close(fd);
}




^ permalink raw reply	[flat|nested] 21+ messages in thread
* Newbie problem
@ 2001-07-24 21:17 Frank Akujobi
  2001-07-24 21:34 ` Joel Jaeggli
                   ` (2 more replies)
  0 siblings, 3 replies; 21+ messages in thread
From: Frank Akujobi @ 2001-07-24 21:17 UTC (permalink / raw)
  To: linux-kernel

Hi all,
Am a newbie and this is my first post. I just
installed Redhat7.1 (one I downloaded) and it's
working well even hooked it up to the internet. I
checked my /usr/src/ and I don't find a /linux
directory. I find only one directory... /redhat. It
there something wrong somewhere, or do I have to
download a kernel source seperately. Doing uname -r
shows me that I have 2.4.x.x.

Thanks.
Frank.


____________________________________________________________
Do You Yahoo!?
Get your free @yahoo.co.uk address at http://mail.yahoo.co.uk
or your free @yahoo.ie address at http://mail.yahoo.ie

^ permalink raw reply	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2007-07-28  8:55 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-04-25 16:53 Newbie problem Ed Vance
2002-04-25 17:12 ` Bahadir Karuv
  -- strict thread matches above, loose matches on Subject: below --
2007-07-28  7:20 Insitu
2007-07-28  8:01 ` Junio C Hamano
2007-07-28  8:50   ` Insitu
2003-02-17  8:49 newbie problem Eugene Joubert
2003-02-17 10:48 ` Chris Barnes
2003-02-17  7:43 Chris Barnes
2003-02-17  8:09 ` Joel Newkirk
2003-02-17 10:31   ` Chris Barnes
2003-02-17  8:25 ` Ralf Spenneberg
2003-02-20 11:39   ` Eric Constantineau
2003-02-17  9:00 ` Ralf Spenneberg
     [not found] ` <1045470029.2231.54.camel@kermit.spenneberg.de>
     [not found]   ` <1045477595.21053.2.camel@billybob.back2front.homelinux.org>
2003-02-17 10:27     ` Ralf Spenneberg
2002-04-25 17:19 Newbie problem Ed Vance
2002-04-25 17:37 ` Bahadir Karuv
2002-04-25 15:58 Bahadir Karuv
2001-07-24 21:17 Frank Akujobi
2001-07-24 21:34 ` Joel Jaeggli
2001-07-24 21:36 ` Stephen M. Williams
2001-07-24 21:36 ` Paul G. Allen

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.