CyanogenMod 7.1

I switched back over to the latest and greatest CyanogenMod on my Droid 1 yesterday. I’d ditched it for “stock” (with a few customizations) about a year ago because it seemed to slow my phone down, and most of the bells and whistles I never really made use of. However, after reading some good things on LWN about the latest release (corbet there uses it on an ancient Nexus One) I decided maybe it was time to give it another shot.

So far am really liking it. It’s pretty quick and I get my small font sizes back in the SMS/MMS app. I had some troubles with my text messages, though. Thought I backed them up with Titanium, but when I restored after upgrading, apparently I pulled from a dump of data taken in August of last year. That was pretty confusing to say the least, but made for kind of an interesting time warp. Weird to see the conversations you were having with people a year back…

In any case, so far I haven’t regretted switching. Let’s see if I stick with it or feel compelled to go out and buy a Droid 3 (can you root that thing yet? Guess I’ll have to check).

Posted in Technology | Tagged , | Leave a comment

RHEL’s Apache and LDAP Referrals

After upgrading to RHEL 5.7, one of my Apache servers which protects content using mod_ldap authenticating against Active Directory stopped working. Error logs showed the following:

auth_ldap authenticate: user xxxx authentication failed; URI /viewvc/ [ldap_search_ext_s() for user failed][Operations error]

This usually means there is a problem with referrals, but OpenLDAP was properly configured to not follow them (/etc/openldap.ldap.conf w/ REFERRALS off).

Turns out that buriedin the RHEL 5.7 release notes, this gem can be found. A brand new configuration directive called LDAPChaseReferrals. Apparently, when referrals are provided in a result-set, mod_ldap by default does not bind to them using the provided credentials. The new version of Apache in RHEL 5.7 corrects that and provides this new directive to enable or disable the feature.

However, I couldn’t find any documentation for it upstream, and after following the bugzilla link in the release notes realized that the Apache project had actually gone a different route and called their directive LDAPReferrals in addition to adding another directive to limit the number of hops that would be followed.

End result is that it appears Red Hat has added in a one-off and undocumented configuration directive. :-) Likely unintentionally, but this definitely led me to some confusion.

Opened a new bug to see about getting this resolved.

Posted in Systems Administration, Technology | Tagged , , | 4 Comments

screen, we hardly knew thee…

I recently discovered tmux. It’s actually been around for about four years, but as I’ve been reasonably happy with GNU screen, I’d never thought to look elsewhere. tmux piqued my curiosity and as there were packages readily available in EPEL, I installed it and have been using it most of the day.

The screen keystrokes are firmly stuck in my brain, and of course there’s the chance that I might have to use screen again on other systems, so I’d rather stick with them vs. re-learning tmux’s C-b based command structure. After some tinkering, I found that the following in my ~/.tmux.conf file gets me most of the way there:

set-option -g prefix C-a
bind-key p previous-window
bind-key C-p previous-window
bind-key Space next-window
bind-key C-Space next-window
unbind-key C-b

# Makes CTRL-A A work like in screen (jumps to beginning of line)
bind-key a send-keys C-a

In a nutshell, this sets the command key sequence to C-a (CTRL-A) and sets the ‘p’ and spacebar keys to cycle through my windows. As I often find myself keeping the CTRL key pressed down as I hit the p or spacebar, I also mapped things so the windows will shift whether or not I leave CTRL pressed or not.

I’ve never been a screen power user, but anything with a smaller memory footprint is a win for me as I primarily have been using screen on a low-memory Linode system.

Posted in Systems Administration, Technology | Tagged | Leave a comment

Adios CRT’s

I have at last completely joined the 21st century by replacing my last CRT (a beautiful old 20″ Dell Trinitron) with an eBay’d LCD.

Right now I am P2V’ing an old CentOS box so I can further consolidate my hardware. Spring cleaning in June…

Posted in Technology | Leave a comment

Cleaning up Gmail (Hosted Apps)

A couple of years back, I migrated all of my email off of my Postfix/Dovecot mail server to Google Apps.  I was tired of fighting spam and dealing with the occasional outages to my server that would impact the family and friends whose email lived there.

I didn’t have a lot of accounts to migrate, and many of my users were POP3 users who downloaded everything — so there wasn’t a lot of email to move over.  What there was I did manually with an IMAP capable email client and just copied folders and their contents “en masse” over to GMail.

This worked pretty well except for the fact that I’d been using Mutt, and had all my sent mail copied to a series of folders embedded under a parent “Sent” folder with the year and month in the name.  So Sent/Sent-Mail-2001-05, etc.  There were a ton of these folders and in GMail they show up as Labels.  A very long list of labels. With no easy way to hide them all.

I dealt with a few manually, but GMail didn’t seem to have a way to do any sort of bulk actions within their UI, and recursively moving the contents of these folders into GMail’s Sent Mail folder from within Thunderbird wasn’t much easier.

Enter Python and imaplib.  The following hacky and one-off script ended up doing the job for me pretty nicely:

import re
import imaplib

LRP = re.compile(r'\((?P<flags>.*?)\) "(?P<delimiter>.*)" (?P<name>.*)')

def main():
    global LRP

    m = imaplib.IMAP4_SSL('imap.gmail.com', 993)
    m.login('username', 'password')

    status, mailboxes = m.list("/Sent", '*')

    for mb in mailboxes:
        flags, delimiter, mailbox_name = LRP.match(mb).groups()

        print mailbox_name
        s, d = m.select(mailbox_name)

        # If we got an OK and there are > 0 messages in the folder.
        if s == 'OK' and int(d[0]) > 0:
            print "  Trying to move %d messages." % int(d[0])
            typ, [response] = m.search(None, 'SEEN')
            if typ != 'OK':
                raise RunTimeError(response)
            msg_ids = ','.join(response.split(' '))
            m.copy(msg_ids, '[Gmail]/Sent Mail')
            m.store(msg_ids, '+FLAGS', '\\Deleted')
            m.expunge()
        else:
            if mailbox_name != '"Sent"':
                if int(d[0]) == 0:
                    print "  No messages, deleting %s" % mailbox_name
                    m.delete(mailbox_name)
            else:
                print "  Skipping Sent"

if __name__ == '__main__':
    main()

Now my GMail is much more neat and tidy. It would be nice if imaplib had a move() call…

Posted in Systems Administration, Technology | Tagged , | Leave a comment

Welcome

Once upon a time I had a pyblosxom blog.  It lived on a Linux box hosted via my DSL connection in the comfort of one of my spare bedrooms.  During my switch to Linode, I didn’t port the blog over, though I intended to.  I wanted first to get it packaged up nicely for Fedora, but realized in my ongoing quest for laziness, I didn’t really want to maintain the package (it needed a lot of work to prepare for packaging along with plugins to actually make it useful).  I had been using pyblosxom with hooks into MoinMoin to let me use its syntax, however as I’ve been using Mediawiki almost exclusively lately, the MoinMoin connection wasn’t as much of a draw and in fact was just confusing me having to remember a variant of yet another wiki syntax.

To make a boring story short, this new blog is the culmination of my laziness.  pyblosxom was great, and I’ll miss being able to edit via vi, but I have a feeling moving to WordPress will be better for my blogging existence going forward. :-)

Posted in General | 1 Comment

My First Greasemonkey Script

My first Greasemonkey script compels MarkMail‘s message view pane to use a fixed width font instead of a variable width font. Much nicer.

Posted in Systems Administration, Technology | Tagged | Leave a comment