Sunday, August 22, 2010

Script to automatically check for outdated ports on Mac OS X

I use the fabulous MacPorts system to get some of the software I need for my Mac laptop.

I am also interested in keeping this software up to date, for a variety of reasons, but just to know that I'm getting the latest security patches alone has me interested in regular updates.

I hate checking for outdated ports manually over and over again though, aren't computers supposed to do that?

So I wrote a script that will periodically check if I have outdated ports, and if there are any it will send me an email with a list of the outdated ones.

You can fetch the script port-checkupdate from my website - there are some comments in the script, and it's really tiny so it should be easy to work with.

You will likely also want the mailtest self-contained mailer my friend Marek Gilbert knocked together as well - the script expects to use it

Cheers

Sunday, July 18, 2010

Mac OS X laptop and TimeMachine whole disk encryption with successful restore

At some point, if you work with sensitive information, you realize it's time to get serious about protecting the data from theft.

I'll assume you already have firewalls in place, surf the web safely and keep your software up to date. That should help reduce the risk the data is accessed while you are using your computer, but since MacBookPro laptops are portable and valuable, and TimeMachine backup drives are also portable and valuable, there is the real risk that they are physically stolen, putting your sensitive data at risk.

The solution to this is multi-part - first you need to make sure that your machine asks you for a password when it resumes from sleep or wakes up from a screensaver, and that it goes to sleep or to the screensaver quickly when unattended. This makes sure that someone can't just open the lid or move the mouse and get your data.

Now they are going to try to reboot, the second part is to make sure that you don't have auto-login enabled, so they'll have to enter a password to login after rebooting.

You are mostly safe at this point, but did you know that Mac OS X install DVDs have a feature which let you reset the root password on a laptop, if you boot from the DVD? They do. It is quite useful really - I've needed to use it - but it means that the password protection isn't worth much at this level, a thief that wants your data can easily access it.

The last part of the solution handles this problem, by using encryption to make sure your data is inaccessible even if someone has physical access to your machine. The goal is to have your whole disk encrypted, with a pre-boot password required to decrypt it and get the OS running. I use PGP Whole Disk Encryption ("PGP WDE") for this purpose - it is commercial software but doesn't cost too much compared to exposing the sensitive data, and it is easy to use.

Assuming you have installed PGP WDE and have your laptop hard drive encrypted at this point, you are mostly secure, but what about your TimeMachine backups? That little external drive next to your computer still holds all your sensitive data, but it is not encrypted - you have moved the problem around but not solved it completely yet.

The next step then is to use PGP WDE on the TimeMachine drive, so it is encrypted as well. Now your data is fully protected, but you have a new problem - if your laptop dies for some reason and you need to restore from your TimeMachine drive, you can't - the Mac OS X install DVD you would use for the restore can't access the TimeMachine drive to restore from it, because it is encrypted!

Luckily, this is a solved problem. In a nutshell, what you want to do is to re-partition your TimeMachine drive and put an OS X install on it that you can use as a rescue, and you want a copy of the Mac OS X install DVD on that rescue install. Use TimeMachine to backup to a second partition on the TimeMachine drive, and now following these excellent instructions you have a tested and working self-contained encrypted backup of your laptop with all the tools you need to restore your computer if you have problems.

Cheers

Tuesday, September 29, 2009

Graphing JMeter results from the command line

I'm currently knee-deep in some performance testing, and I wanted to have fully automated JMeter runs, with attendant fully-automated graphing of the results.

There's lots of results to graph from the systems, but the JMeter log itself is a great source of data.

Only problem is, the best-looking script didn't seem to want to produce the two most important graphs I wanted to see! (aggregate throughput and aggregate users)

The script is here:

http://wiki.apache.org/jakarta-jmeter/LogAnalysis?action=AttachFile&do=get&target=jmetergraph.pl

From:
http://wiki.apache.org/jakarta-jmeter/LogAnalysis


All it needed was a small patch though, et voila, I've got the aggregate charts.

Maybe this will save others (http://markmail.org/message/yntlaygfepnpine7) the time?



[mhardy@tkdevvm(192.168.146.130) util]$ diff jmetergraph.pl ~/mike/Desktop/jmetergraph.pl
313,314d312
< $glabels{'entire'} = \%entire;
<

Sunday, June 28, 2009

Accounting error

I'm continually astounded by the general lackadaisical attitude towards accounting error in general society. Some examples:

- governments don't use accrual accounting, yet generate massive future liabilities. Fail!
- historic-cost accounting (the GAAP standard) makes no allowance for appreciation or inflation, a double-fail

There are definitely gray areas in implementing those things, but the benefits should outweigh the costs, and as a manager I definitely want to be aware of accrual effects, appreciation and inflation.

Boring perhaps but it's better than driving businesses (or countries) into the ground...

Sunday, March 1, 2009

Berkshire Hathaway goals

Reading through the Berkshire Hathaway annual report (something that is highly recommended - it's not nearly as dry as it sounds) you quickly run in to the operating goals. Honestly, thinking about them out of context, there's not much else you need to do either on a small scale (a 4 person project, a small business, a career, your family, etc) or on the scale they operate in order to be successful:

(1) maintaining Berkshire's Gibraltar-like financial position, which features huge amounts of excess liquidity, near-term obligations that are modest, and dozens of sources of earnings and cash;
(2) widening the "moats" around our operating businesses that give them durable competitive advantages;
(3) acquiring and developing new and varied streams of earnings;
(4) expanding and nurturing the cadre of outstanding operating managers who, over the years, have delivered Berkshire exceptional results.

Substitute credibility or trust for finances for some scenarios, other valuable qualities for others, or obviously keep it finance-related for economic things, but I don't think there's a lot more to it from what I've seen so far.

The devil's in the details implementing this game plan, surely, but I think it's important to realize/remember that the game plan itself is not complicated.


As I read through more of it, some other gems:

- Beware the investment activity that produces applause; the great moves are usually greeted by yawns.
- Beware geeks bearing formulas (as a geek, I agree)
- Regarding municipal finance: "The gap between
assets and a realistic actuarial valuation of present liabilities is simply staggering."

Thursday, January 22, 2009

Mike 1, Banking Fees 0

Along the same lines as credit card finance charges, I simply refuse to banking fees.

It isn't that I don't think they are justified, it's that I think they are a tax on ignorance and it's less costly to avoid fee-inducing banking situations.

To that end, I just got a "collected funds fee" at the bank, and investigated it. Here's the skinny from my banker:

"Yes, there's a difference between collected and available balance and your analysis is correct. Depending on where the funds are drawn from and if they've been collected is the determining factor. Funds might be available but not collected from the maker bank which means a portion of what is available is technically a loan to the customer and the reason for the fee (I was able to reverse it). Some customers find a balance between savings and checking or attach a line of credit to the operating account as an option to avoid the repeated fee."

So if you deposit checks regularly, you're going to see three balances. "Balance", "Available Balance", and "Collected Balance".

If you want to make sure you get no fees, find the lessor of those three numbers, and treat that as your "fee-free balance".

It's a game of inches...

Cheers

Sunday, November 23, 2008

Credit Card Finance Charge Tidbit

Okay, as some following this blog (if anyone is) may know, I'm not just doing internal server operations at Tacit Knowledge any more, I'm also the CFO, so naturally I do a lot of finance.

In order to want to take on a role like that, and to pursue excellence in it, you've got to have more than a little bit of interest in even the most mundane parts of finance. You have to want to truly understand the full workings of the little things or you've got no chance when the big things confront you.

With that as motivation, I'll mention that for my entire adult life I have engaged in a campaign against credit card finance charges. This may seem pointless, and I'll admit it is - on the "dollar value" side, it is not really worth a lot to achieve a state of "no finance charges ever" because even getting close to that state means there's not enough dollar value left in charges to justify getting to zero. But where's the fun in that? Let's get to zero.

The first thing I learned in this campaign was that the credit card companies use several strategies to make it nearly impossible. The first of these strategies is the non-fixed statement date. In other words, they do not align their statement dates with any fixed calendar day so you can never assume that if you make a full payment by the 1st of the month every month, you won't get a finance charge.

They move the date around every month, so every once in a while, a full statement period will be between and not inclusive of the two 1st dates, and they'll get you. How sneaky! That honestly took me a couple finance charges to figure out, but is easily defeated with a "semi-monthly payment plan" though - just send them two payments a month, on the 1st and 15th. Please note that if you don't have some automated way to make this extremely easy you're wasting your time and it is not worth it. I use Quicken with bill pay, personally.

Okay, so having done that, I thought I'd essentially won the game and needed to move on to other venues to exorcise the daemons of my financial obsessive compulsiveness.

Most of their other strategies revolve around keeping you in debt once you've gotten there, and since that's a problem solved with fiscal discipline (a much larger subject than tactical credit card payment plans) I'm not going to go into it here. You need Suze Orman or a Rich Dad, Poor Dad book, Quicken, and some soul-searching if you're in that situation (highly recommended if you are, though).

Then I just got hit with two finance charges in two consecutive months, and the game was back on. I simply couldn't understand what happened since I sent them more then the previous balance was.

I'm sure this is no surprise to some of you but for those that did not know it, I'll mention another subtle trick they play on you. If you *ever* take advantage of the ability to defer payment, as I did two months ago, you will obviously incur a finance charge. I'm not against that, I will pay to rent cash sometimes, and that month I did so.

But what you've done is you have established a new class of balance in your account - a "revolving balance". It's important to realize that this class of balance is treated very differently from "new charges" because now when you send payments in - even two a month! even more than all new charges! - all of the payments will be applied to "new charges" *first*, and only the excess will apply to the revolving balance.

Sneaky again! In this way, you may find yourself making multiple payments a month, for *more* than the sum of your new charges every month, and still owe a finance charge every month as they charge you to float whatever is left of the revolving bit from the past. Seems unfair to me, but hey, they're in the cartel of payment processing networks and I'm not, so I don't get a vote. I do have a new compensating strategy though, and will restate my "never get a finance charge" rules like so:

- make two payments a month, on the 1st and 15th, for whatever the balance is on those days
- if you ever establish a "revolving balance", make sure to establish a credit balance with the account with the next payment - compensating for any charges you may incur between your sending the semi-monthly payment that would otherwise make you run a balance

Now I think I've "got" them. We'll see.

Some will argue I should quit fussing and use the "AutoPay" option, but then if you actually wanted to rent cash for a month, you'd have to pick up the phone to do it or they'd pull the full balance from your checking account anyway. So that option gives you a low score on the "ability to control" things scale. My phone calls to Citibank to get the finance charges waived while I learn these lessons :-) average around 15 minutes, so as a solution design with AutoPay I'd be losing money on the opportunity cost of my hourly billable time.

This concludes your obsessively compulsive finance lesson for the day.

Cheers!