I sometimes get requests to add functions to Console Calculator.  I have many functions built-in to CCalc, but of course many more could be imagined.  Therefor, I made it possible to define your own functions.  I previously posted a short list of a few useful functions one might define:  Useful Console Calculator functions.

I received a request today for a more advanced round() function.  CCalc already includes a round() function, and it always rounds to the nearest integer.  The request I received was to support rounding to a specified decimal place:

round(2.535) = 3
round(2.535, 1) = 2.5
round(2.535, 2) = 2.54

In CCalc, function names may be overloaded, similar to C++, such that round(x) is a different function from round(x,n) since they take different number of input arguments. Although round(x) is a built-in CCalc function, round(x,n) is not – so let’s define it!

round(x,n) = round(x*10^n)/(10^n)

This new round function will round the number x to the nearest n decimal places. Very nice!

Set Time Machine’s Backup Interval

Time Machine will attempt to backup once per hour.  As with many things in OS X, a preference to change the time between backups exists, but Apple doesn’t make such options available in the preference panel.  Terminal to the rescue.  Command below takes number of seconds, so one week between backups is 7*24*60*60 = 604800.  I had to restart to get the change to register.

sudo defaults write /System/Library/LaunchDaemons/com.apple.backupd-auto StartInterval -int 604800

Disable Safe Sleep on OS X

When putting a mac to sleep, typically it writes the contents of the RAM to the hard disk so that if power is totally lost, the machine state is still saved and recoverable later.  However, this results in extra hard drive activity for up to 20 seconds after closing the lid on my Macbook.  When using my laptop, I want to be very careful not to move the computer around while the hard drive is active, in case I damage the drive by sudden movements.  So I want my computer to go asleep and shut the drives down right away, so I can get up and move the computer safely!

sudo pmset -a hibernatemode 0
sudo nvram "use-nvramrc?"=false

Disable “Are you sure you want to open it?” Prompt

Starting in Mac OS X 10.5, you will get this prompt the first time you open a file downloaded from the internet or web.  I have received this prompt with disk images, zip files, but even fairly “safe” things like plain text files and HTML source code.  Anyway, I know what I’m downloading, and I know what I am doing, thank you very much.  I will disable the prompt now.

defaults write com.apple.LaunchServices LSQuarantine -bool NO

I recently had my hard drive crash and figured it is time to set up a proper system backup. I decided to get an NAS device to use for file sharing and backup using OS X Time Machine software. I bought a 1 TB LinkStation Mini, which has dual-drives, capable of RAID 0 or RAID 1. I thought this would be easy to set up, but so far have been very wrong. The LinkStation has been OK to set up, a little quirky… they say it supports Time Machine, but did not work out of the box for me. Thankful that LinkStation offers free 24/7 support, as most of my free time is after 10PM these days.

TIme Machine (TM) is the most quirky, picky software from Apple I have ever used. Took some effort to get TM to recognize the drive, and then received error 45 — could not create the sparsebundle. A google search makes it clear that this happens A LOT. Solution is to create the sparsebundle yourself and copy it onto the target disk. As it turns out, I probably would have wanted to do this anyway, since I wanted to limit the maximum size of the TM backup, and there is no other way to do this. If TM creates the sparsebundle, it will allow the backups to fill the entire disk, no way to limit it.

I found several pages which walked me through creating the sparsebundle, links below. However, I am surprised that Apple released this software that:
1) … is so flaky to create it’s own sparsebundle, even though I can create it manually with two commands in the terminal.
2) … does not allow one to limit disk usage, so that the drive could be used for other things as well.

http://www.mactimes.info/2009/05/how-to-use-time-machine-with-buffalo.html

http://www.levelofindirection.com/journal/2009/10/10/using-a-networked-drive-for-time-machine-backups-on-a-mac.html

So far I like the LinkStation, I am pleased with their support, you can check out the product if you like.

Buffalo Technology LinkStation Mini 1 TB (2 x 500 GB) Compact Network Attached Storage LS-WSX1.0TL/R1

The Zoesoft website was unavailable for a few weeks (including the website for CCalc registrations). I apologize. There was a misunderstanding with my domain name registry. Problem has been fixed. Sorry for any inconvenience.

  • Added some tweaks for better Wine compatibility.
  • Cleaned up menu items a bit.
  • Financial mode automatically chooses appropriate significant figures.
  • (2010-07-05)