Random wacky quiz
May. 20th, 2010 05:16 pmWe have a bit of a thing at work where, each week, someone will pose a few technical questions for the group. Whoever provides the first correct answer gets to choose the following week's victim.
This week it was my turn. So far the questions have all been entirely outside my area (Windows, VMWare licensing, Cisco stuff) so I figured it was fair to pose questions about Sendmail and Sybase.
Here they are, appropriately sanitised. I would expect my audience here to find the first very easy, but the second was an amusing thing to come across in the wild, and while all the information needed to solve it is right there -- if only as suitable Google-fodder -- it's kind of cute.
I'll post the answers in a couple of days if nobody figures it out before then.
Sendmail:
There are three machines on the same network. One is running sendmail and acting as a mail relay. Here is the sendmail meta-config.
(Consider yourself lucky I don’t throw the real config at you instead!)
Here is one host trying to relay mail:
And here is the other:
Two questions:
1) Why does the second one work and the first one not?
2) Why would this be an incredibly stupid configuration to run on the Big Bad Internet?
Sybase
You support some very clever users. One of them comes to you and says they can’t create clustered indexes on one of the database servers. I have attached the code which was presented to demonstrate the problem.
Here is the output from the database server where this seems to work:
And from the one where it does not:
The question is: what’s going on?
The only Sybase-specific thing you need to know to be able to nut this one out is that defining a PRIMARY KEY in a table automatically creates a clustered index by default. And you can't change that default.
( Read more... )
This week it was my turn. So far the questions have all been entirely outside my area (Windows, VMWare licensing, Cisco stuff) so I figured it was fair to pose questions about Sendmail and Sybase.
Here they are, appropriately sanitised. I would expect my audience here to find the first very easy, but the second was an amusing thing to come across in the wild, and while all the information needed to solve it is right there -- if only as suitable Google-fodder -- it's kind of cute.
I'll post the answers in a couple of days if nobody figures it out before then.
Sendmail:
There are three machines on the same network. One is running sendmail and acting as a mail relay. Here is the sendmail meta-config.
(Consider yourself lucky I don’t throw the real config at you instead!)
VERSIONID(`$Id$')
OSTYPE(solaris2)dnl
define(`confPID_FILE',`/var/run/sendmail.pid')
define(`confCOPY_ERRORS_TO',`postmaster')
define(`SMART_HOST',`smtp:fw.fooa.com.au')
FEATURE(`use_cw_file',`/etc/mail/local-host-names')
FEATURE(`redirect')
FEATURE(`mailertable')
FEATURE(`virtusertable')
FEATURE(`genericstable')
FEATURE(`allmasquerade')
FEATURE(`masquerade_envelope')
FEATURE(`always_add_domain')
FEATURE(`use_ct_file')
FEATURE(`relay_entire_domain')
MASQUERADE_AS(`foo-hk.com')
MASQUERADE_DOMAIN(`foo-hk.com')
EXPOSED_USER(`root')
MAILER(local)
MAILER(smtp)
Here is one host trying to relay mail:
220 asahi.foo-hk.com ESMTP Sendmail 8.11.6/8.11.6; Tue, 18 May 2010 09:55:32 +0800 (CST)
helo sailor
250 asahi.foo-hk.com Hello trad02-hk.fooasiapac.com [10.136.1.155], pleased to meet you
mail from: <me@foo.com>
250 2.1.0 <me@foo.com>... Sender ok
rcpt to: <me@foo.com>
550 5.7.1 <me@foo.com>... Relaying denied
And here is the other:
220 asahi.foo-hk.com ESMTP Sendmail 8.11.6/8.11.6; Tue, 18 May 2010 09:56:20 +0800 (CST)
helo sailor
250 asahi.foo-hk.com Hello carlton.foo-hk.com [10.136.1.100], pleased to meet you
mail from: <me@foo.com>
250 2.1.0 <me@foo.com>... Sender ok
rcpt to: <me@foo.com>
250 2.1.5 <me@foo.com>... Recipient ok
Two questions:
1) Why does the second one work and the first one not?
2) Why would this be an incredibly stupid configuration to run on the Big Bad Internet?
Sybase
You support some very clever users. One of them comes to you and says they can’t create clustered indexes on one of the database servers. I have attached the code which was presented to demonstrate the problem.
Here is the output from the database server where this seems to work:
table_name | index_name | keycnt | index_columns | type |
---|---|---|---|---|
banana | banana_n_673168851 | 1 | n | Clustered Index |
And from the one where it does not:
table_name | index_name | keycnt | index_columns | type |
---|---|---|---|---|
banana | banana | 0 | >no columns> | Heap |
banana | banana_n_15130734542 | 2 | n | Non Clustered Index |
The question is: what’s going on?
The only Sybase-specific thing you need to know to be able to nut this one out is that defining a PRIMARY KEY in a table automatically creates a clustered index by default. And you can't change that default.
( Read more... )