<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments for Mac Stuff</title>
	<atom:link href="http://macstuff.beachdogs.org/blog/?feed=comments-rss2" rel="self" type="application/rss+xml" />
	<link>http://macstuff.beachdogs.org/blog</link>
	<description>A place for all my Macintosh-related scripts, tricks and tips</description>
	<lastBuildDate>Thu, 02 Sep 2010 15:27:09 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
	<item>
		<title>Comment on Using Applescript to kill off a process by Jeff</title>
		<link>http://macstuff.beachdogs.org/blog/?p=31&#038;cpage=1#comment-7432</link>
		<dc:creator>Jeff</dc:creator>
		<pubDate>Thu, 02 Sep 2010 15:27:09 +0000</pubDate>
		<guid isPermaLink="false">http://macstuff.beachdogs.org/blog/?p=31#comment-7432</guid>
		<description>Thanks a lot! It&#039;s very useful!</description>
		<content:encoded><![CDATA[<p>Thanks a lot! It&#8217;s very useful!</f</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Adding and deleting login items using AppleScript by Tom</title>
		<link>http://macstuff.beachdogs.org/blog/?p=30&#038;cpage=1#comment-7374</link>
		<dc:creator>Tom</dc:creator>
		<pubDate>Sat, 21 Aug 2010 20:39:15 +0000</pubDate>
		<guid isPermaLink="false">http://macstuff.beachdogs.org/blog/?p=30#comment-7374</guid>
		<description>This is great, but I would like a script to add the currently running app to my login items. Can this be done? Thanks so much!</description>
		<content:encoded><![CDATA[<p>This is great, but I would like a script to add the currently running app to my login items. Can this be done? Thanks so much!</f</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Using Terminal to control Spotlight by Fixing a corrupted Spotlight index on Mac OS X &#124; Rudi Engelbrecht&#039;s Blog</title>
		<link>http://macstuff.beachdogs.org/blog/?p=38&#038;cpage=1#comment-7201</link>
		<dc:creator>Fixing a corrupted Spotlight index on Mac OS X &#124; Rudi Engelbrecht&#039;s Blog</dc:creator>
		<pubDate>Tue, 13 Jul 2010 19:35:06 +0000</pubDate>
		<guid isPermaLink="false">http://macstuff.beachdogs.org/blog/?p=38#comment-7201</guid>
		<description>[...] http://macstuff.beachdogs.org/blog/?p=38 [...]</description>
		<content:encoded><![CDATA[<p>[...] <a href="http://macstuff.beachdogs.org/blog/?p=38" rel="nofollow">http://macstuff.beachdogs.org/blog/?p=38</a> [...]</f</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Using Applescript to kill off a process by liam</title>
		<link>http://macstuff.beachdogs.org/blog/?p=31&#038;cpage=1#comment-7200</link>
		<dc:creator>liam</dc:creator>
		<pubDate>Tue, 13 Jul 2010 14:17:17 +0000</pubDate>
		<guid isPermaLink="false">http://macstuff.beachdogs.org/blog/?p=31#comment-7200</guid>
		<description>really cool :)</description>
		<content:encoded><![CDATA[<p>really cool <img src='http://macstuff.beachdogs.org/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </f</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Adding and deleting login items using AppleScript by webmaster</title>
		<link>http://macstuff.beachdogs.org/blog/?p=30&#038;cpage=1#comment-7191</link>
		<dc:creator>webmaster</dc:creator>
		<pubDate>Sat, 10 Jul 2010 17:51:16 +0000</pubDate>
		<guid isPermaLink="false">http://macstuff.beachdogs.org/blog/?p=30#comment-7191</guid>
		<description>You&#039;re on the right track but this script won&#039;t do it for you.  You need to use something like &quot;disktutil&quot; at the command line.

My suggestion is open Terminal and type &quot;disktutil list&quot; and get the path to the volume you want to unmount.  It will probably be something like /dev/disk1s2.

The do a one-line applescript like this:

do shell script &quot;/usr/sbin/diskutil unmount /dev/disk1s2&quot;

Save that as a script or application and add it to your login items.</description>
		<content:encoded><![CDATA[<p>You&#8217;re on the right track but this script won&#8217;t do it for you.  You need to use something like &#8220;disktutil&#8221; at the command line.</p><p>My suggestion is open Terminal and type &#8220;disktutil list&#8221; and get the path to the volume you want to unmount.  It will probably be something like /dev/disk1s2.</p><p>The do a one-line applescript like this:</p><p>do shell script &#8220;/usr/sbin/diskutil unmount /dev/disk1s2&#8243;</p><p>Save that as a script or application and add it to your login items.</f</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Adding and deleting login items using AppleScript by Jim</title>
		<link>http://macstuff.beachdogs.org/blog/?p=30&#038;cpage=1#comment-7189</link>
		<dc:creator>Jim</dc:creator>
		<pubDate>Sat, 10 Jul 2010 12:54:50 +0000</pubDate>
		<guid isPermaLink="false">http://macstuff.beachdogs.org/blog/?p=30#comment-7189</guid>
		<description>Ok so the problem is probably not with your coding but with my lack of programming experience but either way i can not seem to get this to work.  I am attempting to add a script to my login items that will unmount a volume called .Secondary .  I want it to be as far removed from the normal functioning of the computer as i can make it, but people keep telling me that this is not possible due to the partitions location on my internal drive.

I would really appreciate any recommendations!
thanks :)</description>
		<content:encoded><![CDATA[<p>Ok so the problem is probably not with your coding but with my lack of programming experience but either way i can not seem to get this to work.  I am attempting to add a script to my login items that will unmount a volume called .Secondary .  I want it to be as far removed from the normal functioning of the computer as i can make it, but people keep telling me that this is not possible due to the partitions location on my internal drive.</p><p>I would really appreciate any recommendations!<br />thanks <img src='http://macstuff.beachdogs.org/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </f</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Switching between 32 bit and 64 bit mode in Snow Leopard by Bruce</title>
		<link>http://macstuff.beachdogs.org/blog/?p=134&#038;cpage=1#comment-7123</link>
		<dc:creator>Bruce</dc:creator>
		<pubDate>Fri, 11 Jun 2010 15:18:14 +0000</pubDate>
		<guid isPermaLink="false">http://macstuff.beachdogs.org/blog/?p=134#comment-7123</guid>
		<description>Worked like a charm the very first time -- no fuss, no muss.   Thanks very much.   I tried the other methods of mucking around to get Snow Leopard to permanently boot in 64-bit mode, and they are all rife with problems to execute.   This was a simple copy and paste into my Terminal program and re-booting my Mac, and now I&#039;m in 64 with no problems.   Thanks again.</description>
		<content:encoded><![CDATA[<p>Worked like a charm the very first time &#8212; no fuss, no muss.   Thanks very much.   I tried the other methods of mucking around to get Snow Leopard to permanently boot in 64-bit mode, and they are all rife with problems to execute.   This was a simple copy and paste into my Terminal program and re-booting my Mac, and now I&#8217;m in 64 with no problems.   Thanks again.</f</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Getting user login data from Macs using AppleScript by mohawke</title>
		<link>http://macstuff.beachdogs.org/blog/?p=141&#038;cpage=1#comment-6803</link>
		<dc:creator>mohawke</dc:creator>
		<pubDate>Sun, 18 Apr 2010 06:30:46 +0000</pubDate>
		<guid isPermaLink="false">http://macstuff.beachdogs.org/blog/?p=141#comment-6803</guid>
		<description>What&#039;s wrong with Python?

#!/usr/bin/python 
import subprocess, time
# OS X 10.6+  -Mohawke 2010
        
def get_user_logons(get_month, report=&#039;/Users/mohawke/Desktop/logons.csv&#039;):
    data=[]; clean=[]
    fields = &#039;user,type,from,to,dur(mins)\n&#039;
    # Won&#039;t worry about year considering the user picks a month...
    year = time.strftime(&#039;%Y&#039;, time.localtime(time.time()))
    months={&#039;Jan&#039;:1,&#039;Feb&#039;:2,&#039;Mar&#039;:3,&#039;Apr&#039;:4,
    &#039;May&#039;:5,&#039;Jun&#039;:6,&#039;Jul&#039;:7,&#039;Aug&#039;:8,&#039;Sep&#039;:9,
    &#039;Oct&#039;:10,&#039;Nov&#039;:11,&#039;Dec&#039;:12}
    
    # get the data via the last command.
    process = subprocess.Popen(&#039;last&#039;, shell=False, stdout=subprocess.PIPE)
    data = process.communicate()
    logins = data[0].split(&#039;\n&#039;)
    data = [entry.split() for entry in logins if entry]
            
    # get data based on users input, format, and write out the data. 
    f=open(report,&#039;w&#039;)
    f.write(fields)
    
    for item in data:
        if &#039;in&#039; in item[-1]: continue
        if &#039;wtmp&#039; in item[0]:
            logstart = &#039; &#039;.join(item)
            print logstart
            continue
        user = item[0]
        type = item[1]
        end_time = item[-2]
        start_time = item[-4]
        day = item[-5]
        month = item[-6]

        if months[month] == get_month:
            # conv. time in secs... Nice for storing... 
            date_frm = &#039;%s/%s/%s %s&#039; %(months[month], day, year, start_time)
            date_to = &#039;%s/%s/%s %s&#039; %(months[month], day, year, end_time)
            tt_to = time.strptime(date_to, &#039;%m/%d/%Y %H:%M&#039;)
            tt_frm = time.strptime(date_frm, &#039;%m/%d/%Y %H:%M&#039;)
            secs_frm = time.mktime(tt_frm)
            secs_to = time.mktime(tt_to)
            dur = (secs_to - secs_frm) / 60
        clean.append([user,type,secs_frm,secs_to,dur]) # in case you want to save it. 
        f.write(user+&#039;,&#039;+type+&#039;,&#039;+time.ctime(secs_frm)+&#039;,&#039;+time.ctime(secs_to)+&#039;,&#039;+str(dur)+&#039;\n&#039;)
    f.close()        
    return clean

try:            
    print get_user_logons(4)
except Exception, error:
    print error</description>
		<content:encoded><![CDATA[<p>What&#8217;s wrong with Python?</p><p>#!/usr/bin/python<br />import subprocess, time<br /># OS X 10.6+  -Mohawke 2010</p><p>def get_user_logons(get_month, report=&#8217;/Users/mohawke/Desktop/logons.csv&#8217;):<br />    data=[]; clean=[]<br />    fields = &#8216;user,type,from,to,dur(mins)\n&#8217;<br />    # Won&#8217;t worry about year considering the user picks a month&#8230;<br />    year = time.strftime(&#8216;%Y&#8217;, time.localtime(time.time()))<br />    months={&#8216;Jan&#8217;:1,&#8217;Feb&#8217;:2,&#8217;Mar&#8217;:3,&#8217;Apr&#8217;:4,<br />    &#8216;May&#8217;:5,&#8217;Jun&#8217;:6,&#8217;Jul&#8217;:7,&#8217;Aug&#8217;:8,&#8217;Sep&#8217;:9,<br />    &#8216;Oct&#8217;:10,&#8217;Nov&#8217;:11,&#8217;Dec&#8217;:12}</p><p>    # get the data via the last command.<br />    process = subprocess.Popen(&#8216;last&#8217;, shell=False, stdout=subprocess.PIPE)<br />    data = process.communicate()<br />    logins = data[0].split(&#8216;\n&#8217;)<br />    data = [entry.split() for entry in logins if entry]</p><p>    # get data based on users input, format, and write out the data.<br />    f=open(report,&#8217;w')<br />    f.write(fields)</p><p>    for item in data:<br />        if &#8216;in&#8217; in item[-1]: continue<br />        if &#8216;wtmp&#8217; in item[0]:<br />            logstart = &#8216; &#8216;.join(item)<br />            print logstart<br />            continue<br />        user = item[0]<br />        type = item[1]<br />        end_time = item[-2]<br />        start_time = item[-4]<br />        day = item[-5]<br />        month = item[-6]</p><p>        if months[month] == get_month:<br />            # conv. time in secs&#8230; Nice for storing&#8230;<br />            date_frm = &#8216;%s/%s/%s %s&#8217; %(months[month], day, year, start_time)<br />            date_to = &#8216;%s/%s/%s %s&#8217; %(months[month], day, year, end_time)<br />            tt_to = time.strptime(date_to, &#8216;%m/%d/%Y %H:%M&#8217;)<br />            tt_frm = time.strptime(date_frm, &#8216;%m/%d/%Y %H:%M&#8217;)<br />            secs_frm = time.mktime(tt_frm)<br />            secs_to = time.mktime(tt_to)<br />            dur = (secs_to &#8211; secs_frm) / 60<br />        clean.append([user,type,secs_frm,secs_to,dur]) # in case you want to save it.<br />        f.write(user+&#8217;,'+type+&#8217;,'+time.ctime(secs_frm)+&#8217;,'+time.ctime(secs_to)+&#8217;,'+str(dur)+&#8217;\n&#8217;)<br />    f.close()<br />    return clean</p><p>try:<br />    print get_user_logons(4)<br />except Exception, error:<br />    print error</f</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Turning your Airport Card on and off by webmaster</title>
		<link>http://macstuff.beachdogs.org/blog/?p=44&#038;cpage=1#comment-6799</link>
		<dc:creator>webmaster</dc:creator>
		<pubDate>Sat, 17 Apr 2010 20:49:44 +0000</pubDate>
		<guid isPermaLink="false">http://macstuff.beachdogs.org/blog/?p=44#comment-6799</guid>
		<description>You have to run that command as root.  Make sure you put &quot;sudo&quot; in front of it.

sudo /usr/bin/networksetup -setairportpower on</description>
		<content:encoded><![CDATA[<p>You have to run that command as root.  Make sure you put &#8220;sudo&#8221; in front of it.</p><p>sudo /usr/bin/networksetup -setairportpower on</f</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Turning your Airport Card on and off by Roger Lohn</title>
		<link>http://macstuff.beachdogs.org/blog/?p=44&#038;cpage=1#comment-6798</link>
		<dc:creator>Roger Lohn</dc:creator>
		<pubDate>Sat, 17 Apr 2010 20:47:09 +0000</pubDate>
		<guid isPermaLink="false">http://macstuff.beachdogs.org/blog/?p=44#comment-6798</guid>
		<description>I am running a MacBook Pro, 2.2 Ghz Intel core 2 duo, 10.5.8
Can not get my airport card to turn on.  Tried
/usr/sbin/networksetup -setairportpower on

Got request denied

Where to next?  Thank you for any help you can provide.

Regards, Roger</description>
		<content:encoded><![CDATA[<p>I am running a MacBook Pro, 2.2 Ghz Intel core 2 duo, 10.5.8<br />Can not get my airport card to turn on.  Tried<br />/usr/sbin/networksetup -setairportpower on</p><p>Got request denied</p><p>Where to next?  Thank you for any help you can provide.</p><p>Regards, Roger</f</p>
]]></content:encoded>
	</item>
</channel>
</rss>
