Ok new question
:w00t:
How do you change your default shell?
Printable View
Ok new question
:w00t:
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?Quote:
Originally posted by LSA@24 March 2004 - 16:24
Ok new question
:w00t:
How do you change your default shell?
Your proposed answer formally debated before your edit.
The correct answer is lpcQuote:
DESCRIPTION
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.......................
Source :)Quote:
NAME
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...................
:D :)
Even though you edited that, I'm still going to post this because Linux Quiz is for learning after all right?Quote:
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
:w00t:
How do you change your default shell?
Your proposed answer formally debated before your edit.
The correct answer is lpcQuote:
DESCRIPTION
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.......................
Source :) [/b][/quote]Quote:
NAME
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...................
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?
:lol: 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;
}
}
}
:lol: I was just thinking that!Quote:
Originally posted by haxor41789@24 March 2004 - 19:41
:lol: 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;
}
}
}
j/k
I'm ripping your code for confirmation. :lol: :)Quote:
Originally posted by haxor41789@24 March 2004 - 19:41
:lol: 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;
}
}
}
:lol: You'll need REALLY_RAW to compile it. :P
someone post me a question :ph34r:
@bulio what is the largest ip adress possible with ipv4 :D
:huh: 300.300.300.300. I thought everyone knew that. <_<
Actually it's 255.255.255.255 (you cant actually use it though)Quote:
Originally posted by haxor41789
300.300.300.300. I thought everyone knew that
32 bits for full address, divided by 4 sections = 8 bits per section.
11111111 (binary) = 255 (decimal)
I posted 2 unanswered questions above (way above)
They are easy ones too :w00t:
BTW, does the X in my avatar still rotate? It isn't rotating for me :'(
@leftism:
It's 255.255.255.254, and the 300s were an inside joke. :P
@LSA:
Yes, it's rotating, reinstall your LZW plugin.
That'll be why I didn't get the joke then :)Quote:
Originally posted by haxor
It's 255.255.255.254, and the 300s were an inside joke
255.255.255.255 is still a 'legal' (you cant use that range as its reserved) IP address, it would just be a broadcast address.
True. :)
/usr/src/linux/.config :huh:Quote:
Originally posted by LSA@25 March 2004 - 00:32
New question, what config file lists the modules to be loaded at startup?
/usr/src/linux/.config :huh: [/b][/quote]Quote:
Originally posted by bulio+26 March 2004 - 16:16--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td>QUOTE (bulio @ 26 March 2004 - 16:16)</td></tr><tr><td id='QUOTE'> <!--QuoteBegin-LSA@25 March 2004 - 00:32
New question, what config file lists the modules to be loaded at startup?
Nope, anyone else want to try?
Nope, anyone else want to try?[/b][/quote]Quote:
Originally posted by LSA+26 March 2004 - 16:24--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td>QUOTE (LSA @ 26 March 2004 - 16:24)</td></tr><tr><td id='QUOTE'>Quote:
Originally posted by bulio@26 March 2004 - 16:16
<!--QuoteBegin-LSA
Quote:
@25 March 2004 - 00:32
New question, what config file lists the modules to be loaded at startup?
/usr/src/linux/.config :huh:
/etc/modules.conf
If this a slackware question..................again. ----------> /etc/rc.d/rc.S :01:
/etc/modules.confQuote:
Originally posted by shn+26 March 2004 - 16:29--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td>QUOTE (shn @ 26 March 2004 - 16:29)</td></tr><tr><td id='QUOTE'>Quote:
Originally posted by LSA@26 March 2004 - 16:24
Quote:
Originally posted by bulio@26 March 2004 - 16:16
<!--QuoteBegin-LSA
Quote:
Quote:
@25 March 2004 - 00:32
New question, what config file lists the modules to be loaded at startup?
/usr/src/linux/.config :huh:
Nope, anyone else want to try?
If this a slackware question..................again. ----------> /etc/rc.d/rc.S :01:[/b][/quote]
Correct
Nope not a slackware question, :lol:
BTW, That linux quiz is an imposter!
Question:
There are 5 directories and you are in directory 5.
/home/you/dir1/dir2/dir3/dir4/dir5
From a terminal, how do you move up to dir2 using the cd command.
Do Not use an absolute path.
@LSA -- changed the Link for ya. :lol:
cd ../../..Quote:
Originally posted by shn@27 March 2004 - 13:21
Question:
There are 5 directories and you are in directory 5.
/home/you/dir1/dir2/dir3/dir4/dir5
From a terminal, how do you move up to dir2 using the cd command.
Do Not use an absolute path.
@LSA -- changed the Link for ya. :lol:
I think that's correct but ATM I don't have a machine to test it on...
------------
Ok good, that link is much better than the lindows rock! :w00t:
------------
Hmm, give an example of 'redirecting output'
I hope I worded that right :huh:
cd ../../..Quote:
Originally posted by LSA+27 March 2004 - 13:31--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td>QUOTE (LSA @ 27 March 2004 - 13:31)</td></tr><tr><td id='QUOTE'><!--QuoteBegin-shn@27 March 2004 - 13:21
Question:
There are 5 directories and you are in directory 5.
/home/you/dir1/dir2/dir3/dir4/dir5
From a terminal, how do you move up to dir2 using the cd command.
Do Not use an absolute path.
@LSA -- changed the Link for ya. :lol:
I think that's correct but ATM I don't have a machine to test it on...
------------
Ok good, that link is much better than the lindows rock! :w00t:
------------
Hmm, give an example of 'redirecting output'
I hope I worded that right :huh:[/b][/quote]
Code:head < /.bashrc
Code:unix@linux:~/work/tmp> ls -la > ls.out
unix@linux:~/work/tmp> ls -la
total 4
drwxr-xr-x 2 unix users 72 2004-03-27 13:19 .
drwxr-xr-x 3 unix users 72 2004-03-27 13:17 ..
-rw-r--r-- 1 unix users 200 2004-03-27 13:19 ls.out
unix@linux:~/work/tmp>
Looks ok.
I can't think of a question, I just "woke up"......long story
Ok heres one:
Where is the file that stores your iptables configuration?
Here is another one then...
How do you find out which config file X is using?
Browse the internet from a terminal................any site.
I'm not sure i'm understanding the question right but I think this is what you mean.Quote:
Originally posted by shn@1 April 2004 - 03:43
Browse the internet from a terminal................any site.
lynx [site]
links [site]
elinks ..... etc
Is that what you meant? I'm not sure.
How do you switch from one virtual console from another?
Alt+[funtion key]
Good boy.
Now switch Virtual consoles while in X.
Ctrl+Alt+[Funtion Key]Quote:
Originally posted by shn@1 April 2004 - 16:44
Good boy.
Now switch Virtual consoles while in X.
I gotta go rake leaves i'll be back in an hour probably (if anyone's home)
Ctrl+Alt+[Funtion Key]Quote:
Originally posted by LSA+1 April 2004 - 16:47--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td>QUOTE (LSA @ 1 April 2004 - 16:47)</td></tr><tr><td id='QUOTE'><!--QuoteBegin-shn@1 April 2004 - 16:44
Good boy.
Now switch Virtual consoles while in X.
I gotta go rake leaves i'll be back in an hour probably (if anyone's home)[/b][/quote]
Correct Sir
Ain't Google just Grande. :)
Correct SirQuote:
Originally posted by shn+1 April 2004 - 16:50--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td>QUOTE (shn @ 1 April 2004 - 16:50)</td></tr><tr><td id='QUOTE'>Quote:
Originally posted by LSA@1 April 2004 - 16:47
<!--QuoteBegin-shn
Quote:
@1 April 2004 - 16:44
Good boy.
Now switch Virtual consoles while in X.
Ctrl+Alt+[Funtion Key]
I gotta go rake leaves i'll be back in an hour probably (if anyone's home)
Ain't Google just Grande. :) [/b][/quote]
:lol: I didn't use google :P
I was reading about bash wildcards and found the answer to this question.Quote:
Originally posted by leftism@20 February 2004 - 04:32
The questions seem to have dried up so..... :)
If you have these files in your home directory...
file.c
main.c
defines.h
program.tar.gz
index.html
How can you delete the C source files and the header file only, using just one command?
rm *[!ch]
Is that right?
When is epoch?
I hate to do this, but do you run Debian?Quote:
Originally posted by LSA@3 April 2004 - 16:28
When is epoch?
And I could have swarn your initial question was:
What is epoch and not When is.
But I suppose since I see no sign of an edit then I am wrong. Or am I?
http://community.the-underdogs.org/s...appy/tails.gif
1970-01-01 00:00:00 UTCQuote:
Originally posted by LSA@3 April 2004 - 17:28
When is epoch?