Thursday, April 30, 2009

ldapsync

Very slowly catching up...

A few years ago, I wrote a script that I called ldapsync that compares and synchronizes two LDAP servers. The options are designed to mirror the ones used by OpenLDAP's tools.
Usage:
ldapsync [options]

Options:
--simpleauth -x Use simple authentication (default)
--binddn -D Secify the Distinguished Name to bind to LDAP
--secret -w Specify the password
--secretfile -y Specify a file to read for a password
--ldapuri -H Specify the URI of the LDAP server
--searchbase -b Specify search base
--filter -F Search filter
--scope -s Search scope (base, one, or sub)
--tls -Z[Z] Try StartTLS (use twice to require TLS)
--dryrun -n Show what changes would be made
--help -h Help message
--verbose -v Be more verbose
--debug -d Turn on debugging
So to compare server1 with server2, you might use a command like this:
    ldapsync -n -x -b dc=example,dc=com \
-H ldap://server1 \
-H ldap://server2
Reality is probably a lot more complicated than that, but you get the idea...

Anyway, the script is useful as-is, but it is probably not complete. Maybe it will be useful to someone else...

Wednesday, February 18, 2009

Help!

My life has apparently hit a point where finding 5 minutes for anything is next to impossible. I seem to need to be in no less than 4 places at any given time. My contributions to Fedora are suffering as a result.

I really, really hope this is a temporary(-ish) situation, so I'd rather not orphan my packages (but I will if it is for the best). In the mean time though, I need some help, bad. It's been a couple of releases since I've been able to look at any of my non-Perl-related packages seriously, especially the GUI stuff. Luckily most of them don't need updates often, but right now I'm being harassed in bugzilla about font guidelines.

If any of you generous Fedora folk would happen to have some free time to bail me out and take care of that (or any other bugs I've forgotten about), I will forever be in your debt.

Thursday, December 11, 2008

I, for one, welcome our Google overlords

After battling (or running away screaming from) various open-source CMS solutions, going through a few iterations of rolling my own, and putting up with a really, really, crappy "temporary" (only 4 years!) site, the store's web site is now hosted by Blogger. Discuss.

PS: Oddly enough, Google Sites sucks a bit. I could be wrong, but Blogger seems a heck of a lot more functional and flexible. One would assume that will eventually change.

PPS: This doesn't mean I've given up on open-source CMS solutions. I'd be more comfortable hosting this myself, but at least in the mean time the new temporary solution is Not My ProblemTM.

When will the fun ever stop?

I think the drama with my desktop system is almost at an end. Let's see if I can remember what all went wrong...
  • My new hard drives (Seagate 7200.11 1TB SATA drives) apparently run crazy hot. My old case kept them too close together and/or without sufficient airflow.
  • Obviously this meant I needed a new case, and rather than gut my old case, I thought this would be an excellent excuse to upgrade. I threw together an almost entirely new system with parts on-hand, which happened to include an AMD Phenom 9600, an Asus M3N-HD/HDMI, and some Crucial DDR2/1066 DIMMs. This would have been great, except...
  • Apparently the M3N-HD/HDMI gets the memory timings wrong when you use DDR2/1066. Everything is fine with DDR2/800 or slower. I'm still talking to Asus about this...
  • I would have noticed this fact sooner, except I broke my #1 rule of system building and troubleshooting... I didn't let memtest finish a full pass. After about a half an hour, I decided everything had to be OK, right? It threw the first error after like 38 minutes.
  • After figuring this out, and figuring out that another system with the same RAM on a M3N-HT Deluxe had similar issues, I contacted Asus. They were helpful enough to suggest double-checking the memory timings using CPU-Z, which would have been fine if I had Windows on my system. I finally figured out that I could use an OEM Vista install disk's recovery menu (which will get you to a real command prompt eventually) to run CPU-Z from a thumb drive.
  • While forcing the memory timings fixed (well, mostly fixed) the issues with the M3N-HT Deluxe, my system still wouldn't pass memtest.
  • After trying lots (and I do mean lots) of other things, I eventually gave up and pulled another processor (a 8750) off the shelf. With that, memtest passes, and the system has been stable for over a week.
Imagine all that, with much weeping and gnashing of teeth, spread out over the last nearly 3 months.

The 9600 is on its way back to AMD for a replacement. It will be interesting to see if whatever comes back works... I'm still not 100% sure this wasn't some weird incompatibility between that processor and the board. (I found a post where someone had a similar problem with a 9500 and a different Asus board, and their problem was fixed with a BIOS update.)

Saturday, October 4, 2008

I'm not dead (yet)

So the month of September was consumed by work. If I've been less than responsive lately, blame the 12+ hours/day, 7 days/week lately. (Whee!) And to top it all off, since I've been trying to slack off a little this week (working, say, only 10 hours/day), I finally had some time to migrate my desktop to some bigger hard drives, but now that's turned into a nightmare. (It's a long story, involving 2 dead RAID cards, and now either some bad hard drives that passed burn-in testing fine, or a flaky RAID card.)

To make a long story short, if you really need to contact me, email isn't going to work that great. Without procmail to filter all the Fedora lists, linux-kernel, etc., I just get too much mail to find anything sent to me directly unless I get really lucky. Hopefully after my new RAID rebuilds (which is apparently going to take until tomorrow), I can get the rest of my data moved over, and get my system back up Monday or Tuesday.

It would be really nice to have working email again by the time I head over to Columbus for the Ohio LinuxFest on Thursday. (I'll be teaching a one-day LPI certification prep class there on Friday with Don Corbet.) If you email me and don't get a response in a reasonable amount of time, call the shop... They can always get a message to me.

One good bit of news from the day job though... I need to thank everyone who has worked on the livecd-tools package. I've managed to solve some rather large problems with a heavily customized live CD that I can hand to our employees. If there's a Fedora BoF at OLF, I'll share details then. (Some of it might make sense for a generic live CD.)

Friday, August 22, 2008

SELinux

For the record, I've always been of the opinion that SELinux was a great idea, and it would be incredibly useful. I personally think there are just too many moving parts on the average server (much less desktop) to properly define everything processes on the system are allowed to do.

Over the last couple of days, I helped a client set up new nameservers. The client in question is a university (a small one, but still...), so, as nameservers go, theirs are fairly high-volume.

To make a long story short, we wanted to go nuts with locking down these nameservers, so I left SELinux enabled, installed bind-chroot, etc. I had one real problem... SELinux wouldn't let me mount a separate filesystem at /var/named. Once I figured out this was happening and found the audit message in dmesg, I ran audit2why and got a somewhat helpful explanation and suggestion for a solution. Still, I can't help but feel like it's a bug that I can't mount a filesystem there...

Other than that, things went pretty smoothly. I went to the trouble of making sure all the config files, zone files, etc. were all labelled properly, which was a little painful, but once I figure out how, it wasn't all that bad. I just had to train myself to do "ls -laZ" instead of just "ls -la" to verify things. I even wrote a little script to reset permissions, owners, and labels all at once. It went something like this:
#!/bin/sh

usage() {
echo "Usage: $( basename $0 ) --reference=RFILE file1 [ file2 [...] ]" >&2
exit 1
}

if [ $# -lt 2 ] ; then
usage
fi

chown "$@" || usage
chmod "$@" || usage
chcon "$@" || usage

(My thanks to whoever decided that all three of those commands should have a "--reference=RFILE" option. :-)

The SELinux tools are pretty decent now, but this little exercise pretty much just reinforced my opinion that SELinux is only useful if the sysadmin is willing to invest some time in setting everything up properly.

I hate to be negative... Seriously though, I still see software installation instructions that tell users to "chmod 777" some directory to make things work. (The last time I saw that, it was instructions for some software that was distributed as an rpm. It was sad on so many levels...) Software developers generally suck (IMHO), and most people who do system administration aren't much, if any, better. And that's with our, what, almost 40-year-old security infrastructure? Users aren't even waiting to have a problem... They just immediately turn off security. It's no wonder that most Fedora troubleshooting tips start by having the user disable SELinux.

Anyway, I can't decide if I'm just whining here, if I'm trying to tell a story, or if I'm trying to make a point... I think my point is not that SELinux is bad, but we need to set expectations appropriately. It is a tiny bit unrealistic to expect our packagers to get everything to work right with SELinux. And that's the part we can control... The users just aren't going to get it, period. Maybe ever.

sigh

Saturday, June 21, 2008

Success!

$ rpm -q rakudo parrot
rakudo-0.6.3-1.fc9.x86_64
parrot-0.6.3-1.fc9.x86_64
$ perl6 -e '"Hello".say;'
Hello
$ perl6 -v
This is Rakudo Perl 6, revision 0 built on parrot 0.6.3
for x86_64-linux-thread-multi.

Copyright 2006-2008, The Perl Foundation.