Posts Tagged console

Linux and OS X console: Are you working too hard?

Recently, I had a friend, a serious Linux aficionado, come over and we had occasion to sit in front of my machine while I was doing some console work. I do a lot of work under OS X using the GUI, and previously that is what had been on-screen when he had visited. This time, however, I had some consoles open to one of my web servers.

I did a few things during which he was uncharacteristically silent. During a pause in my typing, he spoke up with a note of real interest: “That’s unbelievably awesome. What is that?”

“Midnight Commander”, I told him.

Now he uses Midnight commander too. All the time. I thought I’d tell you why.
Read the rest of this entry »

Tags: , , , , , , , , , , , ,

Colored reports for text and HTML in Python

One of the things that I face regularly is report generation. Often they’re free form, by which I mean not tables full of tabulated data.

Output from my htmlAnsii() class

Output from my .htmlAnsii() class

Just “is this ok, is that ok, 27 of the other happened”, that sort of thing. I like to use color — green if everything is ok, red if it isn’t and so on.

I’m often out where I want the report in a web browser. But then again, I’m often at my desk, signed in to a console and I want it there. The environments couldn’t be much more different; HTML tags on the one hand, within the wrapper of a page, and ANSII escape sequences on the other. And they’re both kind of annoying and error-prone to write out explicitly, especially when you’re doing it a lot.

What to do?
Read the rest of this entry »

Tags: , , , , , , , , , ,

Cocoa/OSX console messages: Could not setup Mach task special port 9: (os/kern) no access

11949894331101577697bomb_01.svg.thumbEver run into this one? Under Leopard (OSX 10.5.8), the above message is posted to the system console every time cron launches a process. If you use cron for anything and the console for anything, this can be very, very annoying. Apple’s known about the problem for years, and has done nothing. Since I fall into that class of folks who use both the console and cron, I’ve been more or less quietly steaming about it. I finally decided to do something about it. Be warned; the following is technical and to-the-metal hackery. Don’t try this at home unless you’re very confident in your skill(z).

Now, as this hack is fairly specific to the problem, I don’t think it can hurt anything else (if performed correctly), and it serves my needs perfectly. Your mileage may differ for any number of reasons, and if you’re not a technical person, you should stop reading now and just forget your ever saw this post. Really. Stop now.
Read the rest of this entry »

Tags: , , , , , , , , , , ,