Archive
Hibernating Mac OS X on MacBook Pro
Operating systems (Windows included) tend to keep the hibernation option quite hidden from user’s eyes. I really don’t know why. It could be because it would be harder for a begginer to grasp the difference between sleep mode and hibernate mode, thus risking data loss and frustration during the lengthier process of going into and out of hibernation.
Nevertheless, on a laptop, I strongly believe that hibernation is a must. Basically, when choosing between sleep and hibernation it’s like choosing between sacrificing the speed of restoring your machine to gain a little more battery life and the other way around.
By default, MacBook Pros know how to enter only sleep mode when you close the lid, which is pretty cool if you like to brag about how fast your laptop “comes back to life” right after you raise the lid again. But you still lose battery power during sleep mode and when you’re on the run this might be far from ideal. The only time a MacBook Pro will hibernate is when it will drastically run out of battery, and this mode is called “safe sleep” and it’s completely automatic.
To determine the current mode for your machine, type the following in a Terminal:
AndreiMac:~ andrei$ pmset -g | grep hibernate
hibernatefile /var/vm/sleepimage
hibernatemode 1
The possible values you can see here are the following:
- 0 - Legacy sleep mode. Saves everything to RAM, very fast sleep, but without the “safe sleep” option if it runs out of battery. Careful with this one.
- 1 - (mine, as above) Saves RAM contents to disk, equivalent of “safe sleep”. Basically, old-school hibernation that doesn’t drain any battery. Slow on sleep and wake up.
- 3 - Just like “legacy sleep” mode, but with “safe sleep” enabled, so it enters RAM sleep mode but hibernates when it runs out of battery. This should be your default options if you haven’t changed it before.
- 5 - Similar to 1, but only if you enable “Secure virtual memory” in System Preferences
- 7 - Similar to 3, but only if you enable “Secure virtual memory” in System Preferences
To change your current sleep mode, use the following command:
sudo pmset -a hibernatemode 1
To make this process faster, define two aliases:
alias hibernate_on="sudo pmset -a hibernatemode 1"
alias hibernate_off="sudo pmset -a hibernatemode 3"
Add these lines to your /Users/<username>/.bash_profile file and run
source .bash_profile
That’s it. Now you can decide how your laptop will go to sleep.
The “find” Process on Mac OS X - High CPU And HDD activity
This morning I noticed that after coming out of hibernation everything started working really slow, with a high CPU percentage and a lot of hard drive activity, and one “new” process in the list, “find” that seemed to take up all these resources.
I’ve done some research on the net for this one and here’s what I found out, in case anyone else faces this, too.
Apparently this does a little more than just the old “find” executable in UNIX/Linux, with regards to system maintenance, like rotating log files, clearing old caches, etc.
MAC OS X has certain scripts that run daily, weekly, monthly. One of them is to build the local database used for the “locate” command, something similar to what “updatedb” does on other systems. In OSX, “find” does this update so, from time to time, it will take up a little more resources to index all the files on your file systems.
In earlier systems, like OSX 10.3, these were called “cron jobs” and were launched by the cron daemon. Currently the launchd daemon is responsible for this. Cron was usually set to run its tasks during the night, so shutting down or sleeping the computer during the night will cause launchd to start right away in the next morning.
I also found out that the “find” database has nothing to do with Spotlight which makes me wonder why are they both still around. I really doubt that there are any scripts or commands that use this database, since the way it gets updated is quite nondeterministic.
So just let it run and do its thing.
He speaks my words
That’s exactly what I thought after installing Windows 7 on two computers and after using the beta for nearly four months…
Romanian Programmer’s Keyboard Layout for Mac
Since I’ve spent much more time than I should have, looking for an unicode keyboard layout for Mac that resembles the Romanian Programmer’s Keyboard Layout for Windows and finaly managed to find one (and still NOT on the Internet), here it is for anyone who might need it.
The keyboard layout allows the usage of the Option key (Alt) in the following combinations to obtain Romanian-specific characters:
- opt+a = ă
- opt+q = â
- opt+i = î
- opt+s = ș
- opt+t = ț
Add Shift to the above combinations to obtain capitalized letters.
INSTALLATION: simply copy the .keylayout file to /Library/Keyboard Layouts (it might be empty by default, but the directory should be there) then restart at least System Preferences (in my case, I didn’t even have to log off) and you’ll find the new layout in System Preferences > International > Input Menu. You can also check “Show input menu in menu bar” to quicky be able to change between layouts.
Chrome pentru Mac OS X și Linux
Deși pagina de download de la Google pentru Chrome încă oferă doar posibilitatea de a te înscrie la un mailing list pentru a fi informat despre stadiul de dezvoltare al lui Google Chrome pentru Mac, am avut surpriza să văd că Softpedia pune de ieri la dispoziție prima variantă relativ stabilă a browserului de la Google pentru Mac OS X, deși pe mail nu am aflat nimic despre așa ceva.
Evident, fiind prima variantă și fiind și produs Google, e într-un stadiu incipient, dar vizibil mai avansat decât release-urile precedente, din iunie, ce erau extrem de instabile atât pentru Mac cât și pentru Linux.
La o primă vedere managementul tab-urilor e la fel de “snappy” ca și în Windows, deși navigarea efectivă în pagini e un pic mai lentă, lucru de la care probabil că ne putem aștepta să se îmbunătățească. De asemenea, importarea bookmark-urilor din Firefox nu a funcționat, deși opțiunea există la instalare. În rest, majoritatea opțiunilor au fost păstrate din Windows. Tab-urile pot crea ferestre noi și sunt în procese separate în mod implicit, opțiunea de “incognito window” a rămas, alături de Developer Tools, deși fereastra cu statistici pentru monitorizarea memoriei taburilor și pluginurilor nu pare să fie de găsit.
Să-l vedem cum se comportă și pe termen lung.





Recent Comments