Hack and / - Mutt Tweaks for System Administrators
I am one of those people who stores everything in e-mail. Travel reservations, phone numbers—if it is in an e-mail message, I know one way or another I can find the information. That might be one of the reasons I have been using mutt as my main mail program both at home and work for years. It is difficult to beat when you need to read, search and navigate large mailboxes full of mail. That, and it has vi-style key bindings. I love vi-style key bindings.
If you are a sysadmin, there are even more reasons to love mutt. For one, you probably spend a good deal of your day in front of a terminal, so why not read your mail from there as well? A lot of administrators like to run stripped-down servers that don't include binaries for X or graphical tools, but mutt is small, and what's more, you can ssh to a server or your work desktop from another machine and check your mail.
At work, I like to segregate my e-mail into folders, based on whether a message is from a person or a server (and, of course, I segregate them further from there). If you manage a lot of servers, those mailboxes can start to get rather large. Almost nothing compares to mutt when you need to open a mailbox with a few thousand new messages. This brings me to my first almost-essential mutt tweak: header caching.
Header caching is a feature that has shown up in mutt only in the past few years. Essentially, it allows mutt to cache the headers from mailboxes, so that the next time you load the mailbox, it has to pull down only the new messages. This is particularly handy with IMAP servers or even large local mailboxes.
To enable header caching, create a directory called .muttheaders in your home directory, then add the following line to your ~/.muttrc, and restart mutt or reload your mutt config:
set header_cache="~/.muttheaders/"
This tweak is, in some ways, more organizational, and it's handy not only for sysadmins but also for anyone who runs mutt on multiple machines. Many mutt guides will tell you to split .muttrc into multiple files for different types of configuration, so you can have one file that has all of your color options, another with your key bindings and so forth. Then, you simply can add a source line to your .muttrc file that points to the new file, and mutt will load those options as well.
What I like to do is take it a step further and create a .mutt directory in my home directory and place all of those files including my .muttrc in that directory. Then, I create a new file in my home directory called .muttrc.local. In this file, I store any options that are specific to just that particular machine (IMAP settings, local mailbox locations and so on) and keep the rest of the options organized in different files in the .mutt directory. Finally, I create a symlink from ~/.mutt/.muttrc to ~/.muttrc, so mutt still will be able to find it. In this .muttrc, you would find source lines like:
source ~/.muttrc.local source ~/.mutt/colors source ~/.mutt/aliases source ~/.mutt/mailboxes
The advantage to this arrangement is that once I make a change to any of the files in .mutt, I simply can rsync that entire directory to any other machine on which I run mutt, and all of my changes will be there. If I didn't segregate these to a directory and separate .muttrc.local, I would have to worry that any local settings from one machine would clobber the rest.
If you read through a lot of cron, Nagios or other e-mail your servers generate for you, it's easy to let your eyes glaze over and miss important content. What I like to do is tweak my mutt configuration so that certain words, like warning, are colored in bright yellow, and words like error and fail show up in bright red. This is surprisingly easy to do with mutt in only a few lines:
color body brightyellow default warning color body brightred default error color body white default 'no error' color body brightred default "fail(ure|ed)?"
Notice the line that matches no error. I noticed that some messages said “no error” in them, and the error section still was being colored red. If this happens with your keywords, simply add a similar line in there to override the previous less-specific match. You don't have to limit yourself to just these keywords. For instance, you also could highlight certain server names with a particular color or assign different data-center locations distinct colors.
Kyle Rankin is a systems architect; and the author of DevOps Troubleshooting, The Official Ubuntu Server Book, Knoppix Hacks, Knoppix Pocket Reference, Linux Multimedia Hacks, and Ubuntu Hacks.
Realizing the promise of Apache® Hadoop® requires the effective deployment of compute, memory, storage and networking to achieve optimal results. With its flexibility and multitude of options, it is easy to over or under provision the server infrastructure, resulting in poor performance and high TCO. Join us for an in depth, technical discussion with industry experts from leading Hadoop and server companies who will provide insights into the key considerations for designing and deploying an optimal Hadoop cluster.
Sponsored by AMD
If you already use virtualized infrastructure, you are well on your way to leveraging the power of the cloud. Virtualization offers the promise of limitless resources, but how do you manage that scalability when your DevOps team doesn’t scale? In today’s hypercompetitive markets, fast results can make a difference between leading the pack vs. obsolescence. Organizations need more benefits from cloud computing than just raw resources. They need agility, flexibility, convenience, ROI, and control.
Stackato private Platform-as-a-Service technology from ActiveState extends your private cloud infrastructure by creating a private PaaS to provide on-demand availability, flexibility, control, and ultimately, faster time-to-market for your enterprise.
Sponsored by ActiveState
Free Webinar: Hadoop
How to Build an Optimal Hadoop Cluster to Store and Maintain Unlimited Amounts of Data Using Microservers
Realizing the promise of Apache® Hadoop® requires the effective deployment of compute, memory, storage and networking to achieve optimal results. With its flexibility and multitude of options, it is easy to over or under provision the server infrastructure, resulting in poor performance and high TCO. Join us for an in depth, technical discussion with industry experts from leading Hadoop and server companies who will provide insights into the key considerations for designing and deploying an optimal Hadoop cluster.
Some of key questions to be discussed are:
- What is the “typical” Hadoop cluster and what should be installed on the different machine types?
- Why should you consider the typical workload patterns when making your hardware decisions?
- Are all microservers created equal for Hadoop deployments?
- How do I plan for expansion if I require more compute, memory, storage or networking?
| Non-Linux FOSS: libnotify, OS X Style | Jun 18, 2013 |
| Containers—Not Virtual Machines—Are the Future Cloud | Jun 17, 2013 |
| Lock-Free Multi-Producer Multi-Consumer Queue on Ring Buffer | Jun 12, 2013 |
| Weechat, Irssi's Little Brother | Jun 11, 2013 |
| One Tail Just Isn't Enough | Jun 07, 2013 |
| Introduction to MapReduce with Hadoop on Linux | Jun 05, 2013 |
- Containers—Not Virtual Machines—Are the Future Cloud
- Non-Linux FOSS: libnotify, OS X Style
- Lock-Free Multi-Producer Multi-Consumer Queue on Ring Buffer
- Linux Systems Administrator
- Validate an E-Mail Address with PHP, the Right Way
- Introduction to MapReduce with Hadoop on Linux
- RSS Feeds
- Weechat, Irssi's Little Brother
- New Products
- Developer Poll




56 min 1 sec ago
1 hour 41 min ago
1 hour 51 min ago
1 hour 56 min ago
4 hours 6 min ago
4 hours 7 min ago
4 hours 52 min ago
5 hours 41 min ago
6 hours 5 min ago
7 hours 41 min ago