Honestly, I don't know if this would work the same for everyone, but it does the job pretty well for me.
So straight to the point -- if you wanted to see how many discharge cycles the battery of your MacBook has completed, there is an easy way to do this from the UI. Just go to Utilities -> System Information -> Power and locate the Cycle Count entry in the right pane. Mission Completed.
Easy enough, isn't it.
Nah.
If you're like me, there is an easier way.
In the Terminal, type:
ioreg -l | grep Cycle
This is it. As you can see, it also displays other useful data about the battery such as voltage.
Showing posts with label Mac OS X. Show all posts
Showing posts with label Mac OS X. Show all posts
Tuesday, 2 October 2012
Thursday, 13 September 2012
Mac OS X -- Get Uptime, Sleep and Wake Times
As I argued before, the single most important feature of the MacBook Air is its instant-on ability. This makes it very easy and non-obtrusive to just pull it off my bag, do something very quickly and then push it back.
And yesterday, I did just that. While I was sipping my coffee at the office, I wanted to quickly check some code I have written the previous evening. So I turned the MacBook on, in a few seconds had Xcode up and running and a few minutes later I finished doing the checks I wanted to. Then I returned to the coffee and a chat with my colleagues, leaving the Air on my desk.
A few hours later, I put the computer into my backpack not even realising it is still turned on (as it turned out, it was in sleep mode). I figured out what happened just this morning when I was greeted by a warning message that my external drive wasn't properly ejected.
Ooops.
Obviously, putting a sleeping laptop in a case or a bag is not a big deal and many people are even doing this regularly, shutting down their machines only occasionally. Still, as this is not the normal way I handle my laptops, I decided I wanted to know more.
Obviously, the first thing I needed to check was how long the system was running just to make sure it was indeed on.
You do this with the good old uptime command:
'A-ha', I said to myself, so the computer was indeed running for a day (most of the time sitting in the shock-proof department of my Samsonite bag).
The next big question I had was if the computer was sleeping and for how long.
To find out the time the computer entered in sleep mode, in MacOS X (and any UNIX-like system) you use the sysctl command with the following syntax:
sysctl -a | grep sleeptime
sysctl is a powerful UNIX utility to retrieve and modify the kernel state. The sysctl -a output is more than 800 lines long (although your mileage will vary) and that's why I used grep to only output the time the kernel fell asleep:
So the computer was sleeping since 12:25 p.m. on the previous day, which is a good news. The last important piece of the puzzle was when the computer woke up. I wanted to know if something didn't wake the laptop while in the bag.
Again, sysctl -a does the job here. Instead of grep-ing for sleeptime, however, this time we grep for, wait for it, waketime.
So the MacBook effectively was sleeping for 21 hours, most of that time being zipped in the backpack.
Great.
All I had to do next was to (just in case) run a disk check with DiskUtility to ensure my volumes are in a good state.
And yesterday, I did just that. While I was sipping my coffee at the office, I wanted to quickly check some code I have written the previous evening. So I turned the MacBook on, in a few seconds had Xcode up and running and a few minutes later I finished doing the checks I wanted to. Then I returned to the coffee and a chat with my colleagues, leaving the Air on my desk.
A few hours later, I put the computer into my backpack not even realising it is still turned on (as it turned out, it was in sleep mode). I figured out what happened just this morning when I was greeted by a warning message that my external drive wasn't properly ejected.
Ooops.
Obviously, putting a sleeping laptop in a case or a bag is not a big deal and many people are even doing this regularly, shutting down their machines only occasionally. Still, as this is not the normal way I handle my laptops, I decided I wanted to know more.
Obviously, the first thing I needed to check was how long the system was running just to make sure it was indeed on.
You do this with the good old uptime command:
'A-ha', I said to myself, so the computer was indeed running for a day (most of the time sitting in the shock-proof department of my Samsonite bag).
The next big question I had was if the computer was sleeping and for how long.
To find out the time the computer entered in sleep mode, in MacOS X (and any UNIX-like system) you use the sysctl command with the following syntax:
sysctl -a | grep sleeptime
sysctl is a powerful UNIX utility to retrieve and modify the kernel state. The sysctl -a output is more than 800 lines long (although your mileage will vary) and that's why I used grep to only output the time the kernel fell asleep:
So the computer was sleeping since 12:25 p.m. on the previous day, which is a good news. The last important piece of the puzzle was when the computer woke up. I wanted to know if something didn't wake the laptop while in the bag.
Again, sysctl -a does the job here. Instead of grep-ing for sleeptime, however, this time we grep for, wait for it, waketime.
So the MacBook effectively was sleeping for 21 hours, most of that time being zipped in the backpack.
Great.
All I had to do next was to (just in case) run a disk check with DiskUtility to ensure my volumes are in a good state.
Tuesday, 4 September 2012
The Thing I Love Most About My MacBook Air
I like many things about my MacBook Air. It's a gorgeous piece of hardware loaded with flawlessly (mostly) working software.
But the thing I really like the most is it's near-instant-on ability. It's only comparable to an iOS (or Android) device. I can pull it off my backpack, have it on and running in my lap in ten seconds and I'm ready to rock. I cannot compare this to any Windows PC or laptop I have ever had.
And I had quite a few.
Why is this important?
First and foremost, the psychological barrier for starting doing something is much lower. I might be lying on the sofa, watching a TV show, and then I can take the Air and check that PHP script I wrote earlier today. And I can do this in the ad break. When the show is back, I would simply turn the computer off (for like 5 seconds) and continue watching. Good luck doing that on a Windows based laptop.
It's just so much less distraction.
But the thing I really like the most is it's near-instant-on ability. It's only comparable to an iOS (or Android) device. I can pull it off my backpack, have it on and running in my lap in ten seconds and I'm ready to rock. I cannot compare this to any Windows PC or laptop I have ever had.
And I had quite a few.
Why is this important?
First and foremost, the psychological barrier for starting doing something is much lower. I might be lying on the sofa, watching a TV show, and then I can take the Air and check that PHP script I wrote earlier today. And I can do this in the ad break. When the show is back, I would simply turn the computer off (for like 5 seconds) and continue watching. Good luck doing that on a Windows based laptop.
It's just so much less distraction.
Thursday, 16 February 2012
Mountain Lion And The Tight Release Cycle
The news that broke just hours ago surprised a lot of people. Another big cat is joining Apple's Mac OS X family. Apple once again proved how secretive it could be. News virtually exploded when the embargo ended and the tech bloggers were free to hit the 'Publish' button.
What matters the most to me here is how quickly Apple manages to iterate. Mac OS X is apparently switching to an annual-ish release cycle (similar to iOS). Compare this with Windows' much more prolonged cycle: Windows 7 was released Oct 2009 and Windows 8 is expected sometime during the fall (beta is coming in just two weeks). And this is going to be a short time by Microsoft's standards (XP to Vista took solid 5 years).
Of course it's not fair apples to (hmm) apples comparison. Apple benefits from producing its own hardware and thus having much less trouble with backwards compatibility and unreliable partners.
But still, the release cycle is very important. Much more than it was just a few short years ago. And it gets harder and harder for Microsoft to excite everybody about Windows 8 not because it is bad (it is not) but just because things seem to happen so slowly.
To be fair, Windows 8 with Metro and Windows on ARM ability are a much much bigger upgrade than Mountain Lion is going to be. Still, Microsoft must learn to move more quickly. It is already doing so with Windows Phone 7.
Subscribe to:
Posts (Atom)




