<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" xml:lang="en"><title>heatxsink.com</title><link href="http://www.heatxsink.com/blog" rel="alternate" /><id>http://www.heatxsink.com/blog</id><updated>2008-10-12T13:10:00Z</updated><entry><title>Song of the Day Script</title><link href="http://feeds.heatxsink.com/~r/heatxsink/atom/~3/418907625/song_of_the_day_script.html" rel="alternate" /><updated>2008-10-12T13:10:00Z</updated><author><name>Nick Granado</name></author><id>tag:www.heatxsink.com,2008-10-12:/blog/archives/2008/10/song_of_the_day_script.html</id><summary type="html">&lt;p&gt;
I have tried to religiously start twittering my song of the day. I think that I might twitter this information more often if I did not have to type it out either on my laptop or via text messaging. I thus decided write a script to automate the process.  There's plenty of resources online to help with this kind of thing.  I found a &lt;a href="http://www.leroux.ca/archive/dsp_view_474.cfm"&gt;applescript&lt;/a&gt; that pulled the song you are currently playing in iTunes and twittered it, so I decided to modify it to my needs. To run this script, just open up Script Editor on OS X.
&lt;br/&gt;
&lt;br/&gt;
&lt;em&gt;P.S. To my twitter friends sorry for posting two "song of the day" tweets in a row.&lt;/em&gt;
&lt;/p&gt;

&lt;pre class="word-wrap snippet"&gt;
(*
Song of the Day to Twitter by Nick Granado
Massive amounts of inspiration from http://www.leroux.ca/archive/dsp_view_474.cfm
kthxbye
*)

(* SET VARIABLES *)
set twitter_username to "twitter_username_here"
set twitter_password to "password_here"

global twitter_login
global twitter_url
global song_of_the_day

set twitter_login to quoted form of (twitter_username &amp; ":" &amp; twitter_password)
set twitter_url to "http://twitter.com/statuses/update.json"
set song_of_the_day to ""

on get_song_of_the_day()
	(* Check if iTunes is running and grab current "artist - song" *)
	set current_artist to ""
	set current_song to ""
	set temp_song_of_the_day to ""
	
	tell application "System Events"
		if exists process "iTunes" then
			tell application "iTunes"
				if player state is playing then
					set current_song to (name of current track) as Unicode text
					set current_artist to (artist of current track) as Unicode text
					if current_artist is equal to "" then set current_artist to "Unknown"
				end if
			end tell
		else (* What to do if iTunes *isn't* running *)
			if button returned of (display dialog "iTunes isn't running" 
				&amp; return 
				&amp; "" buttons {"Wait", "Quit"}) is "Quit" then quit
		end if
	end tell
	set temp_song_of_the_day to "song of the day: " 
					&amp; change_case(current_artist, 0) 
					&amp; " - " 
					&amp; change_case(current_song, 0)
	return temp_song_of_the_day
end get_song_of_the_day

on send_to_twitter(status)
	set the_status to quoted form of ("status=" &amp; status)
	try
		(* Shelling out is cheating, but it gets the job done. *)
		set twitter_results to do shell script "curl --user " 
					&amp; twitter_login 
					&amp; " --data-binary " 
					&amp; the_status 
					&amp; " " 
					&amp; twitter_url
	on error
		(* In case curl fails for some reason, just don't do anything *)
	end try
end send_to_twitter

on change_case(this_text, this_case)
	if this_case is 0 then
		set the comparison_string to "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
		set the source_string to "abcdefghijklmnopqrstuvwxyz"
	else
		set the comparison_string to "abcdefghijklmnopqrstuvwxyz"
		set the source_string to "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
	end if
	set the new_text to ""
	repeat with this_char in this_text
		set x to the offset of this_char in the comparison_string
		if x is not 0 then
			set the new_text to (the new_text &amp; character x of the source_string) as string
		else
			set the new_text to (the new_text &amp; this_char) as string
		end if
	end repeat
	return the new_text as Unicode text
end change_case

set song_of_the_day to get_song_of_the_day()
send_to_twitter(song_of_the_day)

&lt;/pre&gt;&lt;!--end snippet--&gt;&lt;img src="http://feeds.heatxsink.com/~r/heatxsink/atom/~4/418907625" height="1" width="1"/&gt;</summary><feedburner:origLink>http://www.heatxsink.com/blog/archives/2008/10/song_of_the_day_script.html</feedburner:origLink></entry><entry><title>Pink for October</title><link href="http://feeds.heatxsink.com/~r/heatxsink/atom/~3/411506376/pink_for_october.html" rel="alternate" /><updated>2008-10-02T07:14:00Z</updated><author><name>Nick Granado</name></author><id>tag:www.heatxsink.com,2008-10-02:/blog/archives/2008/10/pink_for_october.html</id><summary type="html">Big thanks to the &lt;a href="http://www.mercurystate.com/"&gt;Merc&lt;/a&gt; for the reminder on &lt;a href="http://pinkforoctober.org/"&gt;Breast Cancer Awareness&lt;/a&gt; month. Looks like I'll be pink for the rest of October. I hope next year I can be pink for all of October!!&lt;img src="http://feeds.heatxsink.com/~r/heatxsink/atom/~4/411506376" height="1" width="1"/&gt;</summary><feedburner:origLink>http://www.heatxsink.com/blog/archives/2008/10/pink_for_october.html</feedburner:origLink></entry><entry><title>How to change your hosts file in OS X Leopard</title><link href="http://feeds.heatxsink.com/~r/heatxsink/atom/~3/412512681/how_to_change_your_hosts_file_in_os_x_leopard.html" rel="alternate" /><updated>2008-09-19T03:40:00Z</updated><author><name>Nick Granado</name></author><id>tag:www.heatxsink.com,2008-09-19:/blog/archives/2008/09/how_to_change_your_hosts_file_in_os_x_leopard.html</id><summary type="html">Just follow these few easy steps...

&lt;ol&gt;
	&lt;li&gt;Open Finder and goto &lt;code&gt;Applications -&gt; Utilities -&gt; Terminal&lt;/code&gt;.&lt;/li&gt;
	&lt;li&gt;Type &lt;code&gt;sudo nano -w /etc/hosts&lt;/code&gt; and when prompted enter your Administrator password.&lt;/li&gt;
	&lt;li&gt;This is where you add/edit your hostname/ip address pairs you want to add. Remember to save the changes you make!&lt;/li&gt;
	&lt;li&gt;Type &lt;code&gt;dscacheutil -flushcache&lt;/code&gt;.&lt;/li&gt;
	&lt;li&gt;You might want to test your changes by pinging the hostnames you added in step 4 (i.e. Type &lt;code&gt;ping yourdomainnamehere.com&lt;/code&gt;).&lt;/li&gt;
&lt;/ol&gt;&lt;img src="http://feeds.heatxsink.com/~r/heatxsink/atom/~4/412512681" height="1" width="1"/&gt;</summary><feedburner:origLink>http://www.heatxsink.com/blog/archives/2008/09/how_to_change_your_hosts_file_in_os_x_leopard.html</feedburner:origLink></entry><entry><title>Macbook Pro Hard Drive Upgrade</title><link href="http://feeds.heatxsink.com/~r/heatxsink/atom/~3/371753641/macbook_pro_hard_drive_upgrade.html" rel="alternate" /><updated>2008-08-09T13:00:00Z</updated><author><name>Nick Granado</name></author><id>tag:www.heatxsink.com,2008-08-09:/blog/archives/2008/08/macbook_pro_hard_drive_upgrade.html</id><summary type="html">&lt;p&gt;
I have been on the "fence" with my MacBook Pro (MBP) for a long time. My reason? The hard drive just is not big enough.  Even if I went with a 250 gig hard drive I was like, okay that doesn't really solve my storage problem.  With all of my music, videos and data 250 gigs of hard drive space is nothing.  Double that and we have something. About two weeks ago I decided that I had enough. I immediately visited &lt;a href="http://www.macsales.com/"&gt;Other World Computing&lt;/a&gt; (OWC) and started looking for my new hard drive. From my experience with dealing with Apple Computers out of warranty OWC is the best place to get anything you would want for your Mac (ram, hard drives, replacement CD-ROM or DVD drives, etc.). It looked like there were two different brands available in 500gb sizes, Samsung, and Hitachi. I opted for the &lt;a href="http://eshop.macsales.com/item/Other%20World%20Computing/HM500JIMFWU2/"&gt;samsung drive&lt;/a&gt;, with the "do it yourself" enclosure. The reason why you need an enclosure is to image your old drive over firewire.
&lt;/p&gt;

&lt;p&gt;
The first step is to get your new hard drive into the firewire/usb enclosure. Then run Disk Utility to image your existing drive to your new drive. Run &lt;em&gt;Finder -&gt; Applications -&gt; Utility -&gt; Disk Utility&lt;/em&gt;, then click your internal drive (located on the left panel), then click the Restore tab. If you are running Leopard, you should see the same pane I have pictured below. You want to drag your existing drive from the left to the "Source" text box, and then your new drive to the "Destination" text box.
&lt;/p&gt;

&lt;a href="http://www.flickr.com/photos/heatxsink/2748611074/" title="disk_utility by heatxsink, on Flickr"&gt;&lt;img src="http://farm4.static.flickr.com/3253/2748611074_9bab3062e3.jpg" width="500" height="265" alt="disk_utility" /&gt;&lt;/a&gt;

&lt;p&gt;
Next let's take apart the MacBook Pro. This requires a couple of tools that I did not have. One being a T6 "torx" screw driver, and a #0000 philips screw driver.  Luckily there was a Sears near me, so I just visited the awesome tools section. I have a bunch of extra screw drivers below, but you just need the two I mentioned.
&lt;/p&gt;

&lt;a href="http://www.flickr.com/photos/heatxsink/2747700491/" title="IMG_0375.jpg by heatxsink, on Flickr"&gt;&lt;img src="http://farm4.static.flickr.com/3208/2747700491_dba3a23997_m.jpg" width="240" height="180" alt="IMG_0375.jpg" /&gt;&lt;/a&gt;

&lt;p&gt;
Now we have to take the battery out, and remove the three philips head screws on the RAM cover.
&lt;/p&gt;

&lt;a href="http://www.flickr.com/photos/heatxsink/2747704697/" title="IMG_0379.jpg by heatxsink, on Flickr"&gt;&lt;img src="http://farm4.static.flickr.com/3257/2747704697_94369f5dcb_m.jpg" width="240" height="180" alt="IMG_0379.jpg" /&gt;&lt;/a&gt;

&lt;p&gt;
Underneath that are two "torx" screws, you'll need to remove along with three more philips head screens at the front of the battery bay. In order to crack the rest of the MBP open you'll have to also remove all of the philips head screws all around the outside of the case.  Once you have all of the screws removed the hardest part of cracking the case open is removing the top panel. This is because there's these plastic clips at the front of the panel. I used a regular screw drive to pop the clips out. There is also a ribbon on the under side of the top panel that connects the keyboard/trackpad to the motherboard.  It should just pop right off it's held to the motherboard with some non-conductive teflon tape.
&lt;/p&gt;

&lt;a href="http://www.flickr.com/photos/heatxsink/2748539090/" title="IMG_0380.jpg by heatxsink, on Flickr"&gt;&lt;img src="http://farm4.static.flickr.com/3256/2748539090_0b6bc5041d_m.jpg" width="240" height="180" alt="IMG_0380.jpg" /&gt;&lt;/a&gt;

&lt;p&gt;
The hard drive is located on the lower left hand side of the case. It has a ribbon taped across the front of it. The hard drive is secured to the chasis by a plate held down by two "torx" screws. Carefully remove the two "torx" screws that hold the plate in place. Then carefully lift the ribbon from the top of the hard drive, it is held in place by double sided tape. After this all that is left is to remove the rubber grommets that are on the hard drive. These grommets are held in place by four "torx" screws, remove then and put then on your new drive.
&lt;/p&gt;

&lt;a href="http://www.flickr.com/photos/heatxsink/2748540932/" title="IMG_0381.jpg by heatxsink, on Flickr"&gt;&lt;img src="http://farm4.static.flickr.com/3001/2748540932_49f15f9c34_m.jpg" width="180" height="240" alt="IMG_0381.jpg" /&gt;&lt;/a&gt;

&lt;p&gt;
Reverse these steps and you'll have your new 500gb hard drive ready for use.
&lt;/p&gt;

&lt;a href="http://www.flickr.com/photos/heatxsink/2747711759/" title="volume_show_info.png by heatxsink, on Flickr"&gt;&lt;img src="http://farm4.static.flickr.com/3179/2747711759_4b6fb898be_o.png" width="407" height="480" alt="volume_show_info.png" /&gt;&lt;/a&gt;

&lt;p&gt;
If these instructions are too vague, please visit ExtremeTech's HowTo &lt;a href="http://www.extremetech.com/article2/0,2845,2119529,00.asp"&gt;here&lt;/a&gt;.
&lt;/p&gt;&lt;img src="http://feeds.heatxsink.com/~r/heatxsink/atom/~4/371753641" height="1" width="1"/&gt;</summary><feedburner:origLink>http://www.heatxsink.com/blog/archives/2008/08/macbook_pro_hard_drive_upgrade.html</feedburner:origLink></entry></feed>
