Calculate the phase of the moon in bash and get the appropriate icon. This can be used to put a picture of the phase of the moon in your bash prompt.
I used the "Simple" lunar phase calculator from here:
http://www.ben-daglish.net/moon.shtml
It seems to work well on OSX. The call to date that I use is not portable to linux or solaris since date is one of the most infuriatingly inconsistent utilities.
I wonder why you turn a small int into a big int to do comparisons instead of rounding the phase numbers to int size? Say phase_number is 15. You save a step by just asking if 15 is < 16 instead of multiplying 15 by 100000 and asking if 1500000 < 1661096. Though perhaps I'm not fully grasping what's going on :)