jb… a weblog by Jonathan Buys

System P

October 9, 2008

The more I learn about IBM’s P-Series UNIX systems, the more impressed I am. I’ve been a very harsh critic of them in the past, but that may have just been my ignorance of the platform. The P is, no doubt, expensive… however, when you look at what it can do, and at how many x86 systems you’d need to do the same thing, the P begins to justify its cost.

As an example, we are looking at building a new web hosting environment off of WebSphere. To accomplish this, we are looking at four database servers (DB2), and between six and eight application servers. The total cost for the project, not including the F5 switch, I’d imagine to be somewhere around $100,000. With that money, we could purchase one P-Series that would do everything we need one one box. That equates to less cabling, less administration, less network overhead, and a smaller footprint for the PCI auditors. One box, maybe four Logical Partitions (LPARs), and that’s it.

AIX, IBM’s version of UNIX, is another big win for the P-Series. Creating a m ksysb creates a bootable DVD clone from a running system. So, you can clone an LPAR and install it along with all the applications you have installed on a new P-Series. Very impressive, and I wish more systems had this feature built in. AIX has is peculiarities. SMITTY, the administration interface, is confusing and difficult to navigate, and expanding a logical volume on the fly requires more steps than I think should be necessary. Many of the shortcomings of AIX can be solved by installing the AIX Toolbox for Linux, which includes a lot of the basic Linux tools compiled for AIX. Like bash… I can’t live without my tab- completion and vi keyboard bindings! On the whole, AIX is an extremely stable operating system. Configuration is more complex than other systems, but once it’s set up, you can let it run for years without intervention.

I’ll be getting more in-depth with the a P550, P561, P570, and one more I’m not sure of the model number of. The next couple of months should be interesting.


Goodbye Cocoa

September 19, 2008

Some times, things come easy to me. I’d like to think that I’m somewhat blessed in that way, especially when it comes to various forms of technology. Back in the Navy, I found I had a knack for telecommunications, and I found that I could grasp the flow of the circuits through various media easily. I nurtured this technological edge, and turned it into a career as a systems administrator. It meant lots of long nights and many mistakes along the way, but it was fun, I enjoyed it. Like I said, some things come easy… but some things just don’t. For example, I have no mental capacity for sports. I enjoy playing every now and again, but I can’t keep track of who’s who and what’s what in this professional team or that college team. It just doesn’t come easy to me.

Four months ago I decided to learn how to program using the Cocoa language and XCode development environment on the Mac. I dived in, buying the preeminent book on the subject, Hillegass’ Cocoa Programming, and poured through each page, and completed every challenge before moving forward. I even tweeted my progress. I would get up at 5AM and program for an hour before having to get ready for work. Then, at night, when the kids were in bed, I’d go back and program for at least another hour, mostly more like two or three. I really wanted to be good at it. For a while, I thought I was going to be. I finished the book, and started on the “Chapter 35 Challenge”, which, in a nutshell, is to develop an application and let someone else use it. I had an application in mind, I had drawn out everything that I wanted it to do, I had each panel, sheet, and window planned out. It was going to be a core data application for managing servers, kind of a nagios, webmin, and cfengine all rolled into one. It was ambitious, but, I reasoned, attainable. It turns out that I was wrong.

Programming in any language is both a learned skill and an art form. Over the years I’ve become fairly good with shell scripts, and can automate a Linux or UNIX box to get it to reliably perform how I want. This skill with shell scripting was not so much something I set out to learn like I did with Cocoa, but it was something that I’ve acquired over time. Cocoa, I have found, is similar. After finishing the Hillegass book, you can indeed create an application in Xcode… but, for it to be of any use, or for it to be good, you need lots and lots of time. I’m talking years. Now that I’m a family man with a job, a mortgage, and kids… I just don’t have the time necessary to dedicate to learning how to program, or I should say that I cannot give the craft the attention that it deserves.

Having delved into programming, I can say that I found new respect for developers. The time and attention that it takes to create a quality application is monumental. Looking at MarsEdit now, I can recognize an NSTable there, and a NSTextField here, and I can almost see how the application is put together. However, under the gloss of the Apple provided interface objects, the code that it takes to get this wonderful application to do what it does takes the time and patience of a zen master to produce. Every function, every button, every menu item… how the app posts my writing to the web… everything must be carefully thought out. Well done.. programmers certainly are a different breed.

It seems that programmers are also all too aware of how different they are. I went to a local CocoaHeads meeting, hoping to find some help with my application. Unfortunately, it seems I misinterpreted the purpose of the meetings, and I was told in no uncertain terms that, were I to ask a documented question, I would be told to “Go read the fucking documentation”. I did try anyway, but I didn’t get very far. Now don’t get me wrong, the CocoaHeads were all very personable and approachable, but they are not going to help you write any code. They simply want you to learn the same way that they did… slowly, over time, and possibly a four year degree in computer science. If you already know how to program in one language or another, and I’m not talking scripting languages, then the CocoaHeads might be for you. If you are learning, like I was, then my suggestion would be to either stay home and read some more, or to go to a meeting with no expectations, and simply take in what is presented.

I should mention that the attitude at the CocoaHeads meeting mirrors many mailing lists. It’s not uncommon at all.

The CocoaHeads meeting was a real turning point for me. It was the first time since I started that I grasped the immensity of the task I was undertaking. I found myself taking stock again, and looking at what was important to me, looking at what I enjoyed doing. One thing I enjoy doing is writing, and that suffered during my personal summer of code. Looking at how much I did not write over the summer, and how much more time I would have to spend to acquire some small level of competency in Cocoa programming, I made the decision to return to writing. I gave it my best shot, I spent four months working on code night and day, but it seems like programming for me is much like sports. I can follow along, but I really don’t have the mind for it.

I’m glad that I spent the time to learn what I have, and I feel that I’m a better person for it. If I had not tried programming, I would always have wondered, but now, having tried it, I can say with certainty that it is not for me. At least, not right now anyway. I may, at some point in time, fire up Xcode again… I do have a couple of books on the subject. For right now however, I think those books will fit comfortably on the shelf.


Moving to Ubuntu - F-Spot

September 16, 2008

I mentioned in my last post that I was giving up my MacBook so my wife could go to college, and (until I can justify the cost of another Mac) that leaves me with her Linux PC. After the first few days of using Linux at home,as opposed to managing Linux servers at work, here are my initial impressions.

My wife’s PC is a gigantic Acer laptop, with a 1.6 Ghz centrino processor and a one gig of RAM. Hooked up to my external monitor, keyboard, and mouse, the PC runs Ubuntu surprisingly well. I can’t enable the desktop effects, but since Gnome has built in compositing support now that’s not a problem. The install went smooth, all the hardware was properly detected, wireless, sound, monitors… everything worked.

So far, my favorite application in Ubuntu is F-Spot. F-Spot is the Gnome desktop’s answer to iPhoto in OS X, and in a lot of ways, I think F-Spot has iPhoto beat on some very basic levels. Over the years my iPhoto library has grown to thousands of photographs. Pictures of the kids, our travels, friends, family, nature, and other random things. Unfortunatly, I have never been all that good at organizing the pictures so they were easy to find. F-Spot uses a tag-based system to organize your library, allowing you to tag a photo multiple times simply by dragging the photo, or a group of photos, to the tag on the left hand side of the screen. This is great. It’s super easy (and fun!) to create a tag for ever member of the family, and then drag photos over to those tags. For example, if a photo has a picture of me and my wife, I’ll drag it to the “Me” tag, and then over to the “Wife’s Name” tag. Its surprising how fast you can do this. Each tag is given a picture, and tags can be nested under other tags.

When compared to iPhoto’s forced “Events” organizing system, F-Spot wins hands down. I was never too fond of the Events system in iPhoto, and felt it an awkward way to group photographs, especially since I would take photos of events, like a trip to the in-laws, over multiple days, which iPhoto would assume were multiple events. It never melded with my mental flow or organization, not the way F-Spot’s tags do anyway. iPhoto does support tagging, but not in the same way as F-Spot, and it just doesn’t seem to flow as well either.

Metadata is read by F-Spot, and the photos are automatically placed in a scrolling timeline at the top of the window. The timeline gives you a graph of how many pictures were taken at any given time period, and it easy to scroll through. Also, Gnome recognized my digital camera (a Kodak Z712 IS), and asked if I’d like for F-Spot to automatically import photos from it when I plugged it in.

After thinking about it, I realize that this is a first for me. Here’s a Linux application that edges out an Apple application in usability. Apple prides itself in ease of use and intuative interfaces, but I’d like to see a few features removed from iPhoto and a simpler tagging system (or keywords, if you must) put in place to organize our ever growing digital libraries. One more note, F-Spot doesn’t do movies of any kind, I’m still looking for an application to handle that. I haven’t delved too deeply into photo editing with F-Spot, I’m not sure I really want to. The “remove red-eye” feature works as advertised, but that’s as far as I’ve gone so far.

Overall, I’ve really liked what I’ve seen with F-Spot, and I’m looking forward to learning more about the applications capabilities.


Development Environments and Software Quality

September 16, 2008

In OS X, there is a small collection of very high quality software. This is a fact, and there is really no debating it. Mac software that was developed specifically for the Mac is generally well crafted and performs as advertised, every time. In comparison, in Linux, there is a very large collection of freely available software of varying quality. Some of it is outstanding, check my last post on F-Spot for an example, and some of it leaves much to be desired.

I’ve found two genres of software that I’d become accustomed to on OS X that are either not available in Linux, or the existing versions are simply not “up to par”. The first group is that of off-line blog editors. I’ve been writing online since 2000 or so, and I’ve used several different methods of getting what I wanted to say onto a web server, everything from typing up my own html to online wisiwig text editors like what is included in Wordpress. However, since purchasing my first Mac a few years ago I’ve been spoiled by off-line editors like Ecto and the excellent MarsEdit. In comparison, I’m typing this up now in Drivel on Linux. First off, I really despise that name. Why would I want to call what I type drivel? Besides that, the editor is simply not as functional as MarsEdit, and I can’t seem to find any blog editor for Linux that is. From what I can tell, my best bets are Drivel, which is very “bare bones”; scribefire, a firefox extension that seems out of place to me; or an even more simple editor that lives in the toolbar. Don’t get me wrong, I’m grateful to the developers who make these tools available, but they are simply no match for MarsEdit.

The second genre of software is that of information gathering software. I’ve grown very accustomed to Yojimbo since it came out, and Evernote looks very nice too. Before that I used StickyBrain from Chronos, and there’s also Circus Ponie’s Notebook which is also excellent. There are plenty of tools available on the Mac to make managing your information easier. All of the software mentioned above allows you to add text, pictures, pdfs, and even music or video files. Each of the apps listed above goes for around $50 per license, and works beautifully. From my standpoint, they are well worth the investment for the time that they save me. So, I was quite surprised to find that similar software for Linux is just not available. When I asked, I was pointed towards BasKet, which looks promising, but is a KDE app, and I’m a gnome user. Then Tomboy, which is a great note taker and list manager, but not an all inclusive information “digital junk drawer” like Yojimbo. Then several desktop wiki type applications that still didn’t seem to fit the bill just right for what I’m looking for. It doesn’t look like there is any way for applications to handle media file types in Linux, something that Cocoa takes care of in Mac development.

So, why not? Where are these missing applications that thrive on OS X?

I’m tempted to say that the answer lies somewhere in the licensing restrictions of Linux with regard to the GPL, open source, etc… but I don’t think that’s it. I think it has more to do with the fact that the development environment in Linux simply doesn’t support the simple drag and drop of multimedia the same way that Cocoa does on the Mac. The Linux developers do a great job with what they’ve got, but “what they’ve got” is a mixture of C, C++, Mono, Python, PyGTK, etc, and it is no where near as clean and mature an environment as OS X. Mozilla and Firefox have proven that open source software can be just as high quality as any commercial software, so why hasn’t these types of applications appeared yet on Linux?

The answer, after pondering it awhile, seems obvious. The platform simply isn’t ready for it yet. Linux on the desktop is just now getting to the point where the average user can depend on it for day to day use, where Macs have been on people’s desks since the 80s. Linux simply isn’t mature enough to warrant the userbase that is going to demand the type of high quality, flexible software that I’m talking about.

Linux grows by leaps and bounds, year after year, so I’m certain that Linux’s final, mature state is not too far out in the future. When it does arrive, I wonder if there will be a market for high quality commercial software like there is on the Mac, or if it will continue to be completely open source and free. Time will tell, I suppose, and it’s too early to say just yet.


Ubuntu Scanning

September 15, 2008

My wife has recently gone back to college, and, seeing as she’ll need it much more than I do, I gave her my shiny, beloved MacBook. As compensation, I’ve got her old PC, running Ubuntu, which looks great on my 22 inch monitor. How long this will last, I don’t know. I’ve just recently started writing seriously again, and moving all of my “really important stuff” into Linux should give me lots to comment about as I note the differences between OS X and Ubuntu. However, I’ve heard rumor of MacBook Pro product refreshes… hummm….

The first difference worth noting between the MacBook and Ubuntu was a very pleasant one. I needed to scan a couple of photographs and give them to my wife, but I hadn’t bothered to connect my HP PSC 1510 all-in-one to the Linux box, and I didn’t have the correct drivers installed on the Mac at the time. But, I did notice the XSane Image Scanner application listed under Graphics in the Ubuntu menu, so I thought, I’ll give it a shot.

I’m glad I did. XSane automatically detected the HP, and was able to scan the photographs to the desktop with no problem whatsoever. From there, I fired up the Gimp to crop the photos and dropped them into Thunderbird to email them to the wife. From scanning the images to emailing them out took about five minutes… tops. During this time I would have probably still been waiting for the massive HP software download to finish on the Mac. However, the HP software does seem to have a few features that I wish XSane had (like image resizing before scanning), but for pure functionality and performance, Ubuntu wins this round.

Step One: Plug it in Step Two: Use it. Step Three: That’s it, no step three.

That’s how computers are supposed to work. This is amazing, considering that eight years ago Linux had a tough time identifying even internal hardware.


On Graduation Day

September 10, 2008

In May of 1995 I should have graduated from high school in the rocky mountains of Montana. Then, in the following fall, say around August or September, I should have started my pursuit of a college degree. Finally, in May of 2000, I should have graduated from college with a bachelors degree in who knows what.

As fate or God would have it though, that’s not the path I took. One night too many spent on the fringe, one too many parties, and one too many disappointments for my parents, and I dropped out of high school in December of 1994. Even then, I thought that I might be making a mistake, so I went ahead and took the GED test, which I passed with flying colors. For nearly a year, I travelled around Washington state. Sleeping in tents, staying with a friend in his uncle’s garage, hanging out at a Rainbow Festival… but in the back of my mind, I knew something was wrong. Something inside of me wouldn’t let go of the fact that what I was doing was wrong.

So, one day, after way too much for way too long, I went home, and from there, I left everything I knew behind me and joined the Navy. Looking back on it now, joining the Navy in October of ‘95 was probably the best decision I ever made. The Navy forced me to sober up, and gave me a structured, goal oriented lifestyle that appealed to me. The Navy gave me discipline when I had no self control. The Navy taught me to believe in myself after many years of being an outcast. The Navy taught me the value of hard work. I began to make incremental steps towards knowing who I really was. Work hard, and make rank. Study hard, and pass the test. The work that I was forced to do turned into its own reward. I am today, a better man because of the time I spent in the Navy.

However, even with the success I had in the military, I regretted never walking across that stage and receiving my high school diploma. For anyone in the position to care, let me tell you right now, a GED is NOT an equivalent to a degree. A GED labels you for life as a quitter, and someone who couldn’t make it at a very basic level. For this, I was ashamed. So, in January of 2000, after transferring to shore duty overseas, I started working on my college degree.

It was fun at first, I took Speech and English, and a few IT courses. A little at a time, when I had the time, one or two courses a semester, sometimes face to face, mostly distance ed, I worked on my degree. Years passed, I transferred back to the States, and I kept taking courses. Some were really difficult (like Project Management… uggg), some were morally challenging (Myth and Culture), and some were genuinely interesting (Algebra, Writing, and Programming). I liked college, not only because the courses I took and the professors I had were interesting, but because the I was constantly challenged. I had something in college that I didn’t have in high school, the drive to succeed… to be the best.

Part of that is growing up. Part of it is the discipline I learned in the military. Part of it is that I was just an angry kid who needed some direction. What ever the reason, the result is that I did finally grow up and realize how important education was. The mistakes I made in high school have taken me thirteen years to correct. But, two days ago, on September 8th, 2008, I was awarded my Bachelors Degree in Information Systems Management from the University of Maryland University College. It took eight and a half years. That’s eight and a half years of lost weekends because I was holed up in the bedroom doing homework. That’s eight and a half years of long nights of studying at night after the kids were in bed. That’s eight and a half years of justifying taking classes, making financial arrangements, taking time away from my wife and our growing family, writing papers, solving formulas, graphs, charts, proctored tests… and stress.

I wasted three years of high school, and it took me eight and a half years to earn my respect back.

Was it worth it? Depends on the question. Was what I did as a kid worth the work that it took to repair the damage? I’d have to say that’s a qualified… almost. I can’t explain what I did as a teenager, but I can say that I’ve been places and seen things that most people have not. If your question was “Is the degree worth the work and the time that you put into it?” I have one answer for you.

Yes.

My degree may never “pay-off” in terms of a big promotion or more opportunities (although it probably will in the long run). I didn’t really need the degree with my experience and expertise in IT. The job that I have now required a bachelors or “equivalent experience”. When I took the job I did not have the degree, but I had the experience, so one could argue that I don’t need the degree at all. For the most part, they’d probably be right.

The degree is worth the effort because I’m a high school drop out. It’s worth it because the look of disappointment in my Mom’s eyes was more than I could bear. It’s worth it because I want my kids to be able to look up to me. The degree is worth it because it was a goal that I had for eight and a half years, and I finally achieved it. Yes, yes, yes, yes yes… the degree is worth every minute of time I put into it, and every penny that it cost.

Mountain climbers, as far as I’m aware, are not paid to climb a mountain, but ask one who has made it to the top if it was worth it.


The Linux Box and Upgrading Java

July 15, 2008

As a general rule, I really don’t like to go outside of the box when it comes to Linux. And by that, I mean that I don’t like going outside of what is provided by what ever distribution you are using, be that SLES, Red Hat, or Ubuntu. A lot of people put a lot of work into making sure that the packages that are available for the distribution actually work in the distribution and do not interfere with any other apps. Linux will let you do what ever you want, but just because you can do something, doesn’t mean that you should.

Going outside the box can have disastrous results with Linux. Back in early 2000 and 2001 when I was installing SuSE and Mandrake on my old IBM box, I wound up in dependency hell more than once. If you’ve never been there, it goes something like this:

OK, I want to upgrade my music player to the latest version, so I’ll download the latest RPM. Wait, that failed, because it depends on a newer version of some library file that I don’t have, so I’ll go search the Internet and try to find that. OK, found it, downloaded the rpm, and it failed to install because it depends on a newer version of some other library file that I don’t have. Looks like there’s no RPM for that library, so I’ll download the source code and compile it. OK, ./configure; make; make install; Nope, that failed because of a gigantic list of dependencies that are not available! At this point, you have to make a decision: Do you go ahead and find the dependencies, or do you give up and have a drink instead. If you choose to go ahead, you download the source to a dozen different packages and install them, then compile your library, then compile your other library, then go to install the rpm to find that it fails because one of the applications you upgraded along the way is, get this, too new to support your music player, and the install still fails. Oh, and by the way, half of your other apps that used to work, don’t work anymore.

This was a very real problem a few years ago, that’s why there is such a focus on package managers, and why I recommend staying in the box. That’s why when I’m asked to go outside the box, I always tend to meet such requests with scrutiny. Do you really need that? How badly do you need that?

Java however, is not so bad. It’s one of the few apps that is self contained in it’s own directory. You download the executable bin file from Sun, run the installer, and put the extracted directory wherever you choose. I normally put it in /usr/local/ Then, I do a which java, and move the original java to java.bak. Next, I create a symbolic link to the new java in /usr/local. Run java -version, and verify that we are using the new and improved java.


Open Formats

May 31, 2008

Remember the early days of networking… before TCP/IP became the standard protocol? Well, neither do I, but I’ve read about it. That’s years ago now, but back then, each computer manufacturer developed their own method of networking their machines together, and each method, or protocol, was incompatible with the other. Apple had AppleTalk, Novell had IPX/SPX, Xerox had XNS, and on and on it went. TCP/IP was born out of the desire to create a vendor independent network, which became known as ARPAnet, and later, the Internet.

This little history lesson is meant to illustrate the tremendous advantages there are to open standards. Would the Internet exist if it belonged to a single corporation? Not as it is today, no. These same ideas can be applied to several other forms of data on the computer; images, documents, music, etc… We now have the capability to keep almost all of our data in a format that is guaranteed to provide greater flexibility, so why isn’t Apple taking advantage of it?

For example, Mail, the venerable email client that comes with the Mac, provides suitable email functionality for most Mac users. Now that I’ve got several years of email stored on my Mac, I’d like to be able to keep those files in a format that is not subject to any corporation’s whims. I’d also like to be able to drop my mail folder on another platform and be able to open it up in a different client… interoperability. Another example is iPhoto, one of my favorites. Would it really be that difficult for Apple to design iPhoto so it stores its database in a reliable, documented format that is readable (and writable) outside the application?

This goes back to a central belief I have about data, and applications. While the application may belong to its author, the data it processes belongs to me, and it should be available to me in a well documented, open format. Open formats make sharing files easier, as they are capable of being supported on more platforms

How about giving Quicktime the ability to natively export to Ogg-Theora? Or allowing iTunes to use Ogg-Vorbis as its default media format? (DRM not considered here…) Pages? Keynote? How about some Open Document Format support? I really don’t think the move to open formats would be that big of a leap. Apple already includes several open source applications inside its server offering, and has built its core data framework around XML and SQLite, so why not open the rest of it up?

The other note worth mentioning is the high profile “switch to linux” news that has been making the rounds lately. With several long time Mac supporters moving to Linux citing problems with formats and a lack of openness from Apple, it seems to me that this is a problem that could be easily fixed. I’m not calling on Apple to open source OS X, I’m not even implying that, although open sourcing a few of the bundled apps might be a good thing in the long term

The world is becoming more aware, and times they are a changin. The world is knocking, dear Apple, its time to open up.


The Master Craftsman

May 14, 2008

The Master Craftsman works methodically, not slowly, not hurriedly. He has mastered the basics, and knows the essence of his craft. He has moved to a point where he can define his own methods, and doesn’t need to explain them to anyone, unless someone is wise enough to ask. The Master Craftsman enjoys the hardest, most complicated problems, and enjoys unravelling them piece by piece. He enjoys the challenge to his skill, and proves his worth again and again as he overcomes each obstacle.

The Master Craftsman has an intimate relationship with his tools. He knows not only what they do, but much more importantly, how they do it. His choice of tools for a certain task is based on years of experience, research, and hands on use. He can debate intelligently on the merits and problems with his tools, as compared with other tools that he has tried and discarded over time. His choice of tools explains something about him.

The Master Craftsman enjoys his work, and is comfortable with his place in the world. He is an expert, and he knows it.

I’ve had an abstract idea for this post for a couple of months now. The Master Craftsman is the embodiment of my professional goals. I’m not one to speak of gurus or wizards, since I come from very down to Earth country in Montana, but a craftsman, or a woodworker is an image that I can grab on to. I’m not a Master yet, but I’m working towards it. My tools are not jigsaws and planers, but vi and zsh, but the basic principles still apply. I think the idea of a craftsman is less about impressing others and more about perfecting his skill.


Creative Uses for Wordpress

May 7, 2008

Where I spend my days ($WORK), we have multiple monitoring systems for just about every service on every server that we have. Many of these are Nagios, some are built in, and others are SiteScope. All of the systems generate email alerts that either go to our pagers, our email, or both. From time to time, management would ask a question like “How many pages do you get in a week on average”, which up till a couple of months ago, our answer was always “It just depends”.

Not a great answer, so I decided to start tracking the email alerts with a centralized database. Now, at this point, I could have whipped up my own home-brew frankenstein creation, but since everything I wanted was already built into Wordpress, I really didn’t need to. Wordpress has the option of posting blogs via email. So, all I needed to do was set up a special email account on our mail server and make sure the pop3 server was running. Then, add the server and login information into Wordpress, setup a cron job to trigger the mail check every five minutes, and there. Instant logging of all pages that are sent out in a searchable, easy to read, web format. Now, when management gets it in their mind to start asking questions, we can easily say “Let me reference my report.” They really like hearing things like that.

Building on the success of the alert log, I thought it might be good to also log all of our changes to the system. This idea is completely different from traditional “Change Management” systems which require you to log ahead of time what you want to accomplish in some ridiculous form or application. Instead, I find it much more useful and relevant to build in the change logging where we spend most of our time, the command line.

I’ve added an alias for “exit” in the shell like so: alias exit=”exec /scripts/ch_log” Here is the ch_log script:

#!/bin/sh
# ch_log - Prompt the user to log system changes on
# exit from the root shell.
#
# jonbuys@os-zen.com - Wed Apr  2 15:32:43 CDT 2008
#
############################################################

HOST=`hostname`
DATE=`date +%m-%d-%y`
echo $DATE
echo "Did you make any changes to the system? (y/n)"
read answer

if [ $answer == n ] ; then
   echo "OK, Thanks!"
   exit 0
else
   echo "Cool, please enter your name, and then describe the changes in the form."
   echo "Name:"
   read NAME

    cat /scripts/log_template | sed s/NNN/$NAME/g | sed s/DDD/$DATE/g | sed s/SSS/$HOST/g > /tmp/$$.answer
    vi /tmp/$$.answer
    mail change_log@mail.mydomain.com -s "Change Notification for $HOST"< /tmp/$$.answer
    echo "OK, thanks!"
fi
exit 0

############################################################
# EOF: ch_log

Basically, when we exit our shell we now have to make a choice… do we log what we did with this quick and easy script, or do we ignore it and risk the consequences. I’ve found that for the most part, I choose to log my work. The email that is sent off to the change_log@mail.mydomain.com address is picked up by a second Wordpress install, and posted to the blog. Now we have a historical record of what we’ve done incase something breaks, or (more importantly) when annual review time comes around and we are asked “what have you been up to”

There is one other change that I had to make to get this to work right. By default, Wordpress holds all posts it recieves via email for approval before posting it to the main page. This is good security, but not really needed on an internal LAN, and it breaks the system I’ve laid out above. So, to fix it, I’ve made a slight change to the wp-mail.php file: // Set $post_status based on $author_found and on author’s publish_posts capability if ($author_found) { $user = new WP_User($post_author); if ($user->has_cap(‘publish_posts’)) $post_status = ‘publish’; else $post_status = ‘publish’; } else { // Author not found in DB, set status to pending. Author already set to admin. $post_status = ‘publish’; }

Above, I’ve changed the “pending” post_status to “publish” for unidentified users, which is everything that it receives via email. This is a very bad idea to do outside of the LAN, but I don’t see any harm in it internally. Undoubtedly there are those who would disagree, but this works well for us.

This is how we are using Wordpress internally on our corporate LAN right now, I’d be interested to hear how some others are using Wordpress or other blogging software.