Ok new question
How do you change your default shell?
Ok new question
How do you change your default shell?
Shn r u hidin again![]()
Even though you edited that, I'm still going to post this because Linux Quiz is for learning after all right?Originally posted by LSA@24 March 2004 - 16:24
Ok new question
How do you change your default shell?
Your proposed answer formally debated before your edit.
The correct answer is lpcDESCRIPTION
lpq shows the current print queue status on the named printer. Jobs
queued on the default destination will be shown if no printer or class
is specified on the command-line.
The interval option allows you to continuously report the jobs in the
queue until the queue is empty; the list of jobs is show one every
interval seconds.......................
SourceNAME
lpc - line printer control program
SYNOPSIS
lpc [command [argument ...]]
DESCRIPTION
lpc is used by the system administrator to control the operation of the
line printer system. For each line printer configured in /etc/printcap,
lpc may be used to:
o disable or enable a printer,
o disable or enable a printer's spooling queue,
o rearrange the order of jobs in a spooling queue,
o find the status of printers, and their associated spooling
queues and printer daemons...................![]()
Even though you edited that, I'm still going to post this because Linux Quiz is for learning after all right?Originally posted by shn+24 March 2004 - 16:43--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td>QUOTE (shn @ 24 March 2004 - 16:43)</td></tr><tr><td id='QUOTE'> <!--QuoteBegin-LSA@24 March 2004 - 16:24
Ok new question
How do you change your default shell?
Your proposed answer formally debated before your edit.
The correct answer is lpcDESCRIPTION
lpq shows the current print queue status on the named printer. Jobs
queued on the default destination will be shown if no printer or class
is specified on the command-line.
The interval option allows you to continuously report the jobs in the
queue until the queue is empty; the list of jobs is show one every
interval seconds.......................
SourceNAME
lpc - line printer control program
SYNOPSIS
lpc [command [argument ...]]
DESCRIPTION
lpc is used by the system administrator to control the operation of the
line printer system. For each line printer configured in /etc/printcap,
lpc may be used to:
o disable or enable a printer,
o disable or enable a printer's spooling queue,
o rearrange the order of jobs in a spooling queue,
o find the status of printers, and their associated spooling
queues and printer daemons...................[/b][/quote]
Thanks, I was wondering about that.
I looked at the man pages after I posted because I wasn't sure, but both pages said stuff about queue so I just took it out. :">
New question, what config file lists the modules to be loaded at startup?
A valid answer to the question posed by me on page three would be:
Code:#include <stdio.h> #include <sys/types.h> #include <sys/socket.h> #include <netdb.h> #include <netinet/in.h> #include <netinet/in_systm.h> #include <netinet/ip.h> #include <netinet/ip_icmp.h> #ifdef REALLY_RAW #define FIX(x) htons(x) #else #define FIX(x) (x) #endif int main(int argc, char **argv) { int s; char buf[1500]; struct ip *ip = (struct ip *)buf; struct icmp *icmp = (struct icmp *)(ip + 1); struct hostent *hp; struct sockaddr_in dst; int offset; int on = 1; bzero(buf, sizseof buf); if ((s = socket(AF_INET, SOCK_RAW, IPPROTO_IP)) < 0) { perror("socket"); exit(1); } if (setsockopts(s, IPPROTO_IP, IP_HDRINCL, &on, sizeof(on)) < 0 { perror("IP_HDRINCL"); exit(1); } if (argc != 2) { fprintf(stderr, "usage: %s hostname\n:, argv[0]); exit(1); } if ((hp = getbyhostname(argv[1])) == NULL) { if ((ip->ip_dst.s_addr = inet_addr(argv[1])) == -1) { fprintf9stderr, "%s: unknown host\n", argv[1]); } } else { bcopy(hp->h_addr_list[0], &ip->ip_dst.s_addr, hp->h_length; } printf("Sending to %s\n", inet_ntoa(ip->ip_dst)); ip->ip_v = 4; ip->ip_hl = sizeof *ip >> 2; ip->ip_tos = 0; ip->ip_len = FIX(sizeof buf); ip->ip_id = htons(4321); ip->ip_off = FIX(0); ip->ip_ttl = 255; ip->ip_p = 1; ip->ip_sum = 0; ip->ip_src.s_addr = 0; dst.sin_addr = ip->ip_dst; dst.sin_family = AF_INET; icmp->icmp_type = ICMP_ECHO; icmp->icmp_code = 0; icmp->icmp_cksum = htons(~(ICMP_ECHO << 8)); for (offset = 0; offset <65536; offset += (sizeof buf - sizeof *ip)) { ip->ip_off = FIX(offset >> 3); if (offset < 65120) ip->ip_off l= FIX(IP_MF); else ip->ip_len = FIX(418); if (sendto(s, buf, sizeof buf, 0, (struct sockaddr *)&dst, sizeof dst) < 0) { fprintf(stderr, "offset %d: ", offset); perror("sendto"); } if (offset == 0) { icmp->icmp_type = 0; icmp->icmp_code = 0; icmp->icmp_cksum = 0; } } }![]()
Originally posted by haxor41789@24 March 2004 - 19:41
A valid answer to the question posed by me on page three would be:
Code:#include <stdio.h> #include <sys/types.h> #include <sys/socket.h> #include <netdb.h> #include <netinet/in.h> #include <netinet/in_systm.h> #include <netinet/ip.h> #include <netinet/ip_icmp.h> #ifdef REALLY_RAW #define FIX(x) htons(x) #else #define FIX(x) (x) #endif int main(int argc, char **argv) { int s; char buf[1500]; struct ip *ip = (struct ip *)buf; struct icmp *icmp = (struct icmp *)(ip + 1); struct hostent *hp; struct sockaddr_in dst; int offset; int on = 1; bzero(buf, sizseof buf); if ((s = socket(AF_INET, SOCK_RAW, IPPROTO_IP)) < 0) { perror("socket"); exit(1); } if (setsockopts(s, IPPROTO_IP, IP_HDRINCL, &on, sizeof(on)) < 0 { perror("IP_HDRINCL"); exit(1); } if (argc != 2) { fprintf(stderr, "usage: %s hostname\n:, argv[0]); exit(1); } if ((hp = getbyhostname(argv[1])) == NULL) { if ((ip->ip_dst.s_addr = inet_addr(argv[1])) == -1) { fprintf9stderr, "%s: unknown host\n", argv[1]); } } else { bcopy(hp->h_addr_list[0], &ip->ip_dst.s_addr, hp->h_length; } printf("Sending to %s\n", inet_ntoa(ip->ip_dst)); ip->ip_v = 4; ip->ip_hl = sizeof *ip >> 2; ip->ip_tos = 0; ip->ip_len = FIX(sizeof buf); ip->ip_id = htons(4321); ip->ip_off = FIX(0); ip->ip_ttl = 255; ip->ip_p = 1; ip->ip_sum = 0; ip->ip_src.s_addr = 0; dst.sin_addr = ip->ip_dst; dst.sin_family = AF_INET; icmp->icmp_type = ICMP_ECHO; icmp->icmp_code = 0; icmp->icmp_cksum = htons(~(ICMP_ECHO << 8)); for (offset = 0; offset <65536; offset += (sizeof buf - sizeof *ip)) { ip->ip_off = FIX(offset >> 3); if (offset < 65120) ip->ip_off l= FIX(IP_MF); else ip->ip_len = FIX(418); if (sendto(s, buf, sizeof buf, 0, (struct sockaddr *)&dst, sizeof dst) < 0) { fprintf(stderr, "offset %d: ", offset); perror("sendto"); } if (offset == 0) { icmp->icmp_type = 0; icmp->icmp_code = 0; icmp->icmp_cksum = 0; } } }![]()
I was just thinking that!
j/k
I'm ripping your code for confirmation.Originally posted by haxor41789@24 March 2004 - 19:41
A valid answer to the question posed by me on page three would be:
Code:#include <stdio.h> #include <sys/types.h> #include <sys/socket.h> #include <netdb.h> #include <netinet/in.h> #include <netinet/in_systm.h> #include <netinet/ip.h> #include <netinet/ip_icmp.h> #ifdef REALLY_RAW #define FIX(x) htons(x) #else #define FIX(x) (x) #endif int main(int argc, char **argv) { int s; char buf[1500]; struct ip *ip = (struct ip *)buf; struct icmp *icmp = (struct icmp *)(ip + 1); struct hostent *hp; struct sockaddr_in dst; int offset; int on = 1; bzero(buf, sizseof buf); if ((s = socket(AF_INET, SOCK_RAW, IPPROTO_IP)) < 0) { perror("socket"); exit(1); } if (setsockopts(s, IPPROTO_IP, IP_HDRINCL, &on, sizeof(on)) < 0 { perror("IP_HDRINCL"); exit(1); } if (argc != 2) { fprintf(stderr, "usage: %s hostname\n:, argv[0]); exit(1); } if ((hp = getbyhostname(argv[1])) == NULL) { if ((ip->ip_dst.s_addr = inet_addr(argv[1])) == -1) { fprintf9stderr, "%s: unknown host\n", argv[1]); } } else { bcopy(hp->h_addr_list[0], &ip->ip_dst.s_addr, hp->h_length; } printf("Sending to %s\n", inet_ntoa(ip->ip_dst)); ip->ip_v = 4; ip->ip_hl = sizeof *ip >> 2; ip->ip_tos = 0; ip->ip_len = FIX(sizeof buf); ip->ip_id = htons(4321); ip->ip_off = FIX(0); ip->ip_ttl = 255; ip->ip_p = 1; ip->ip_sum = 0; ip->ip_src.s_addr = 0; dst.sin_addr = ip->ip_dst; dst.sin_family = AF_INET; icmp->icmp_type = ICMP_ECHO; icmp->icmp_code = 0; icmp->icmp_cksum = htons(~(ICMP_ECHO << 8)); for (offset = 0; offset <65536; offset += (sizeof buf - sizeof *ip)) { ip->ip_off = FIX(offset >> 3); if (offset < 65120) ip->ip_off l= FIX(IP_MF); else ip->ip_len = FIX(418); if (sendto(s, buf, sizeof buf, 0, (struct sockaddr *)&dst, sizeof dst) < 0) { fprintf(stderr, "offset %d: ", offset); perror("sendto"); } if (offset == 0) { icmp->icmp_type = 0; icmp->icmp_code = 0; icmp->icmp_cksum = 0; } } }![]()
![]()
![]()
You'll need REALLY_RAW to compile it.
![]()
Bookmarks