Thursday, June 28, 2007

Sharepoint (SPS) 2.0 and Quick Launch

When I started my new job there was much talk about Sharepoint and I figured, "well, a marketable skill". Actually, working with Sharepoint has been more like being the guy that has to pump the portable bathrooms at outdoor venues.

The main quicklaunch toolbar has needed updating for sometime. If you open a Document Library and choose "Modify settings and columns" on the left theres an option to display the library on the Quick Launch bar. I couldn't find this setting for the new sites however. There's a lot of talk on the net about replacing the toolbar. Because, well, it sucks. There's also a lot of talk about "Look and Feel" which appears to be an SPS 3.0 option.

The shortest path to getting this updated and getting on with my life turned out to be opening Frontpage. Pointing it at the sharepoint site from File->Open. Clicking in an existing row on the quick launch bar and inserting a couple rows, then adding links to the new sites. Then save it and you're done. I'm assuming this is WebDav and it all worked because I authenticated behind the scenes with my domain credentials. I really don't want to know, I'm glad it's working and I can get back to work. Annoyingly, I spent more time looking for the option to add sites to the quick launch bar over the last few months than it took me to actually do the work.

Wednesday, June 20, 2007

svn / ldap / apache / active directory

We do the WebDAV SVN/Apache bit around these parts. In the apache config there's the bit:

AuthLDAPURL ldap://dc.example.com/CN=Users,DC=example,DC=com?sAMAccountName?one?(objectClass=user)

This works with a flat tree, but I recently moved things around and needed the tree to be searched so we moved to:

AuthLDAPURL ldap://dc.example.com/DC=example,DC=com?sAMAccountName?sub?(objectClass=user)

Noting that we're not looking in the Users folder anymore, and 'one' is now 'sub'.

Unfortunately, everything broke when the change was made so I played around on it for a bit on another box and found that the ldap client was getting confused due to referrals being provided by the ldap server (active directory).

Notes in bug #26538 point to using the global catalog instead on port 3268. There was work on building an option to ignore referrals but it looks like it didn't get made.

Instead, I put "REFERRALS off" in /etc/openldap/ldap.conf. Note that I tried /etc/ldap.conf and it didn't work, and I didn't bother researching the difference.

It may be worth noting that I saw some references to the DNS Zone application partitions when I used wireshark to monitor the ldap requests and that led me down this road.

Tuesday, June 19, 2007

Linux Professional Institute - LPI

I finished LPI-201 and LPI-202 today. These are the two tests for the Linux Professional Institute Level 2 certification. If you don't partake in the certification treadmill for fun and profit, you may want to check out LPI's website for more information. Basically there are three levels which are more difficult as you go higher. There are a pair of tests per level, with the third level having a Core exam, and eventually a number of electives which you'll need to take one of. As of now, there's only one elective. It may be worth noting to the Ubuntu fans out there that the Ubuntu Certified Professional / UCP is the LPIC-1 (LPI-101 + LPI-102) + LPI-199, a Canonical sponsored exam.

As with all of the proctored CBT tests, you agree not to talk about said tests. Since a number of people wrote an entire book about it (which I studied with) I think I'm safe to rant a bit.

After studying last night, I was laying around thinking about rdev/rootflags, trying to remember if I had used such arcane beasts ever. LPI wants you to know how to compile and patch kernels. I never do this on a regular basis anymore, except maybe on gentoo when I'm bored. It's worth knowing for sure, but kernel patching seems so 90s to me, as long as you're not a developer. And if you are, why aren't you using git?

I realized I've been using Linux for over 10 years now. I hate saying something like that on principle, but it was a strange thought. It brought me back to installing slackware from floppy disks on Jason's box (whose site appears down right now) because he didn't have a cdrom. And hand soldering a PLIP cable because we couldn't afford network cards. The first kernel I compiled, must have been 1.2.13 or so, compiled for three days straight before it failed. The next attempt succeeded, so I have no idea what went wrong. We always compiled on my box because it had the fast 486DX in it, a present from my parents.

Anyways, I was disappointed by the LPI format. I would have preferred simulations like Cisco or Microsoft have pulled off so well. LPI is mostly (totally) multiple choice and fill in the blanks. The latter amounts to questions like enter pieces of bind semi-obscure bind configs (or worse, innd) and asking you to type the full command with options for some disk function with fsck. Some of these I happen to know. Some I'll go along with being reasonable questions, like tar options or maybe even cpio or the likes. But start asking me about innd flags, and you're getting 'man innd' as my FITB answer. I realize Linux administration is a broad category, and there needs to be coverage, but I'd prefer to testing done on comprehension, rather than how many flags I can memorize.

I'm not going to bother with the new LPIC-3 for a while. There's no study materials out there yet AFAIK as its always so new and you're always playing roulette with tests you're not prepared for. Like taking the MS SQL 2000 Administration exam only to find no materially on installation. That was a shock, especially with so much of the Microsoft Press book dedicated to the subject. Back to the Cisco treadmill it looks like.

Labels:

Wednesday, June 13, 2007

Creating DEBs from scratch

If you've ever made a deb, you've likely noticed the confusing file of helper apps and scripts. I initially fell back on just using dpkg-deb. For a current project though, I needed to make the deb completely from scratch.

I'm attempting to make a deb for Oracle Database. The touted "Oracle Universal Installer" is a huge pile of shit, that is, a X based java program. Even when I run it in silent mode with a scripted response file, it still tends to spawn itself out as a new parent so I can't keep my scripts around it. My solution has become to perform a scripted install on a box, then package the completed install (the whole whopping 1.5GB of it) into a deb. I don't want to move the 1.5GB binary tree into my deb build folder, so I decided to create the deb by hand. This is simple up to a point.

Of all the discussion out there about the deb format, the best reference is simply the deb man page. I couldn't find much in the Debian Policy Manual or New Maintainers Guide.

A deb is an 'ar' archive containing debian-binary, control.tar.gz and data.tar.gz.

These files should be in this order. debian-binary should contain a single line with the text "2.0" to specify the new deb version. control.tar.gz should be a tar file, gzipped, containing the control file and other scripts as specified in the the aforementioned guides. data.tar.gz should contain the files you want the package to install.

So:

echo "2.0" > debian-version
ar r newpackage.deb debian-version control.tar.gz data.tar.gz

Control.tar.gz should be created from within your standard DEBIAN directory, ie:

cd DEBIAN
tar -cvzf ../control.tar.gz .

Data.tar.gz should be created at the root of a file system in the same manner, obviously only including the paths you want to be included.

I'm still unable to please all the deb packages with this format. There was discussion years back amongst debian developers to stick to the "bsd" format for ar and not use the "gnu" format which supported spaces in filenames by adding a slash to the end of the filename as a terminator in the format. Best I can tell, OpenBSD and FreeBSD have since switched to using gnu binutils as well, so I can't even find source for a reasonable modern version of non-gnu ar to compile.

Apt has it's own ar code in the source that does things it's way.

All of this was done to make debian packaging portable. Granted, the idea was more that you could access debian packages anywhere, rather than create them. Other than using sed or such to go in and modify the deb afterwards, I'm out of ideas.

Update: My Sed-foo is poor, but I tried to get sed to match the old bsd style for me with: sed -i 's/^\([A-Za-z.-]*\)\//\1 /' file.deb, searching for text (filename with a slash) at the beginning of a line and replacing the slash with a space. This worked as far as apt-extracttemplates & ar was concerned but as was to be expected, somewhere within the data.tar.gz was corruption as a result. I'm sure a better regex would work.

Instead of spending more time on this, I went to the dpkg world. After the oracle software is installed, I tar the folders I want and pipe that back into tar in the build directory (ie cd / ; tar -c /apps/stuff /opt/stuff /etc/configstuff | tar -xC /home/build/build ; cd /home/build ; dpkg-deb -b build . ). Looks like it works okay. The real tests begin soon as the developers start using the package.

Monday, June 04, 2007

ubuntu feisty netboot / alternatives install with lvm bug 105623

Ubuntu LP Bug 105623 has to do with the lvm device nodes taking a while to show up when doing a network / alternatives install with ubuntu. It appears that lvm waits to sync with udev and udev doesn't do anything. Eventually lvm times out and makes the device nodes, but it's something like three minutes later. This happens for every logical volume. If you're dealing with many logical volumes, this is annoying. If you deal with many logical volumes every day, this is impossible.

Ubuntu splits devmapper into two packages: dmsetup and libdevmapper. The installer (debian-installer) uses udebs and anna instead of debs and apt (because their more lightweight). If you check out the different between dmsetup-udeb_1.02.08-1ubuntu10_amd64.udeb and dmsetup-udeb_1.02.18-1ubuntu6_amd64.udeb in which this bug is supposed to be fixed, a udev rule has been added (/etc/udev/rules.d/65-dmsetup.rules). I tried backporting these packages to my edgy install (this fix is only in gutsy as of this writing) as I didn't think anyone else was going to. On the plus side I've learned a bit about d-i, but it's taken quite a bit of time as there doesn't appear to be much in the way of official documentation.

I ended up taking this file and building it into the feisty netboot initrd. However, it didn't appear to fix anything. Upon closer examination it runs "dmsetup export" which isn't in my feisty documentation, so I think it's something new. I couldn't find a sane way to backport all of libdevmapper without redoing the repository, which would mean resigning the release files and adding keys to the keyring in the initrd, or removing the keyring from the initrd. I wanted to avoid manging my mirror as much as possible. However /etc/udev/rules.d/25-dmsetup.rules on a functional feisty box appears to do something, so I built that into the initrd, and the problems were fixed (LVM creation is once again immediate).

Note that initially I was using preseed/run to download/run a script (before the udebs are unpacked) to install this file but I didn't feel like udev was reading it as I didn't have udevcontrol to send udev the read_rules command. While playing around and running udevd with --verbose, it looked like it would periodically recheck for rules, but I'm not going to take the time to test this. All I'm saying is that wgetting 25-dmsetup.rules to /etc/udev/rules.d with -P would probably work and be easier than recreating the initrd.

Of course, this "works for me", YMMV. For the trusting, my patched feisty initrd is here.