Sunday, March 23, 2008

Zulu/GMT/UTC Clock Widget

After looking for a decent digital Zulu/GMT/UTC dashboard widget for quite some time I finally settled on one. It was ok but bloated and slow. I would have to wait quite a while for the widget to load whenever I brought up the dashboard. Finally I decided that I would have to take matters into my own hands and write my own. So I fired up DashCode for the first time and began hack-n-slashing at the templates to figure out what was what. What I didn't know at first was that widgets are mostly written in JavaScript which I am not at all familiar with. 

Long story short, a lot of research and trial and error later I came out with two different widgets. The first just displays the time in the system's local time and the time in Zulu. The second 
does the same but also displays the date.
I should have them up for download soon. In the mean time if you want one of them I can email it to you.

Wednesday, February 27, 2008

Changing Mac Sleep mode

I usually carry my computer with me all day while I am at school. This means that I am constantly waking it up and putting it to sleep. Probably on the order of a dozen times a day. Something that I have noticed is that it takes about 10-20 seconds for the machine to actually fall asleep after closing the lid. This is because the computer is copying the contents of RAM to the hard drive in the event that the machine looses power while sleeping. This is fine and perfectly acceptable if you close the lid and leave it on the desk before putting it in my back pack. Problem is that often times the MacBook Pro just will not wake up. From what I can gather on the internet this is likely due to a corrupted sleepimage file. This where the computer stores the contents of RAM before sleeping. It is typically about the same size as the installed RAM.
I found this article from that talks about the different sleep settings. I have decided to copy down what I did here in the event that the above article does not exist the next time I reinstall my OS or want to change the sleep mode setting.

Check your current sleep mode:
Open terminal and run this command to determine the current setting:

$ pmset -g | grep hibernatemode

This will display the current setting. In my case the return was 3.

The sleep modes are described as follows:
  • 0 = The old style sleep mode. RAM remains powered, safe sleep is disabled. Allows for superfast wake and sleep.
  • 1 = Hibernation mode. RAM is fully written to disk and the machine actually shuts down.
  • 3 = The default setting on most computers. RAM is powered on while sleeping but contents are still written to the hard disk. If the system looses power it will enter hibernation mode automatically.
  • 5 = Same as mode 1 but for people with secure virtual memory turned on
  • 7 = Same as mode 3 but again, for secure virtual memory.
Changing the sleep mode:

Use the following command to change the mode to whatever you want, in this case I am switching to 0.

sudo pmset -a hibernatemode 0

Note: Restart is not required for this to take effect

Delete the sleepimage file:

If you are switching to mode 0 you can delete the sleepimage file to recover some drive space with the following command:

sudo rm /var/vw/sleepimage

As I am just doing this now, I don't know how this will effect my system but if things get weird I'll edit this post accordingly.

First Post

This blog was started mainly as a carry over from my Plymouth State blog which apparently does not work correctly anymore. Or at least not like it used to. I digress. Here I will post random tidbits. Mostly instructions or information that I have discovered for my own reference that might also help others as well.