<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Matt [Danger] &#187; terminal</title>
	<atom:link href="http://mattdanger.net/category/terminal/feed/" rel="self" type="application/rss+xml" />
	<link>http://mattdanger.net</link>
	<description>One step closer to world domination</description>
	<lastBuildDate>Fri, 02 Dec 2011 18:20:32 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Safari 5 hanging on page loads</title>
		<link>http://mattdanger.net/2010/09/safari-5-hanging-on-page-loads/</link>
		<comments>http://mattdanger.net/2010/09/safari-5-hanging-on-page-loads/#comments</comments>
		<pubDate>Tue, 14 Sep 2010 17:22:07 +0000</pubDate>
		<dc:creator>Matt Danger</dc:creator>
				<category><![CDATA[Mac OS X]]></category>
		<category><![CDATA[terminal]]></category>
		<category><![CDATA[Safari 5]]></category>

		<guid isPermaLink="false">http://mattdanger.net/?p=289</guid>
		<description><![CDATA[Is your Safari 5 hanging when loading pages? Try switching your DNS servers or dumping your Safari cache: rm -r ~/Library/Caches/com.apple.Safari]]></description>
			<content:encoded><![CDATA[<p>Is your Safari 5 <a href="http://discussions.info.apple.com/thread.jspa?threadID=2453384">hanging when loading pages</a>? Try <a href="http://discussions.info.apple.com/thread.jspa;jsessionid=97F2128925281CEA0817DC515B33471F.node0?messageID=11758096">switching your DNS servers</a> or dumping your Safari cache:</p>
<p><code>rm -r ~/Library/Caches/com.apple.Safari</code></p>
]]></content:encoded>
			<wfw:commentRss>http://mattdanger.net/2010/09/safari-5-hanging-on-page-loads/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Dealing with ._ files in Mac OS X</title>
		<link>http://mattdanger.net/2010/01/dealing-with-_-files-in-mac-os-x/</link>
		<comments>http://mattdanger.net/2010/01/dealing-with-_-files-in-mac-os-x/#comments</comments>
		<pubDate>Wed, 27 Jan 2010 01:09:53 +0000</pubDate>
		<dc:creator>Matt Danger</dc:creator>
				<category><![CDATA[Mac OS X]]></category>
		<category><![CDATA[Shell Scripting]]></category>
		<category><![CDATA[terminal]]></category>
		<category><![CDATA[._]]></category>

		<guid isPermaLink="false">http://mattdanger.net/?p=270</guid>
		<description><![CDATA[The current code base I&#8217;m working from is located on a network share and controlled by Subversion. I&#8217;ve been dealing with the Apple Double format problem a lot lately and scripted a simple clean up solution. For those unfamiliar with the Apple Double problem, it is an old bug that exists from the early days&#8230;]]></description>
			<content:encoded><![CDATA[<p>The current code base I&#8217;m working from is located on a network share and controlled by Subversion. I&#8217;ve been dealing with the <a href="http://support.apple.com/kb/TA20578">Apple Double format problem</a> a lot lately and scripted a simple clean up solution.</p>
<p>For those unfamiliar with the Apple Double problem, it is an old bug that exists from the early days of Mac OS X. Here&#8217;s the explanation from the Apple Knowledge Base:</p>
<blockquote><p>Before Mac OS X, the Mac OS used &#8216;forked&#8217; files, which have two components: a data fork and a resource fork. The Mac OS Standard (HFS) and Mac OS Extended (HFS Plus) disk formats support forked files. When you move these types of files to other disk formats, the resource fork can be lost.</p>
<p>With Mac OS X, there is a mechanism called &#8220;Apple Double&#8221; that allows the system to work with disk formats that do not have a forked file feature, such as remote NFS, SMB, WebDAV directories, or local UFS volumes. Apple Double does this by converting the file into two separate files. The first new file keeps the original name and contains the data fork of the original file. The second new file has the name of the original file prefixed by a &#8220;._ &#8221; and contains the resource fork of the original file. If you see both files, the ._ file can be safely ignored. Sometimes when deleting a file, the ._ component will not be deleted. If this occurs you can safely delete the ._ file.</p></blockquote>
<p>Essentially, when you&#8217;re working on files located on a network share you end up with duplicates of the file with a &#8220;._&#8221; prefix. The files are empty and are quite the annoyance. They are removed when the network share is unmounted. However, I leave my share mounted for long periods of time and the files make a mess of my Subversion status reports.</p>
<p>You can run the following command to clean the files up. </p>
<p><code>find . -name '._*' -exec rm '{}' ';'</code></p>
<p>You could also make this into a launchctl or cron task. Happy hacking!</p>
]]></content:encoded>
			<wfw:commentRss>http://mattdanger.net/2010/01/dealing-with-_-files-in-mac-os-x/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Facebook-Status-2.0 announced!</title>
		<link>http://mattdanger.net/2009/02/facebook-status-20-announced/</link>
		<comments>http://mattdanger.net/2009/02/facebook-status-20-announced/#comments</comments>
		<pubDate>Tue, 10 Feb 2009 18:33:01 +0000</pubDate>
		<dc:creator>Matt Danger</dc:creator>
				<category><![CDATA[Announcements]]></category>
		<category><![CDATA[Perl]]></category>
		<category><![CDATA[Shell Scripting]]></category>
		<category><![CDATA[terminal]]></category>
		<category><![CDATA[Unix]]></category>
		<category><![CDATA[Facebook]]></category>
		<category><![CDATA[shell script]]></category>
		<category><![CDATA[status]]></category>

		<guid isPermaLink="false">http://mattdanger.net/?p=155</guid>
		<description><![CDATA[I have updated my original Facebook status script to work with Facebook 2.0. Why is this interesting? Until recently the Facebook Developer Platform didn&#8217;t allow the changing of user status messages. This does and can be implemented in other utilities, which I may do in the future. Enjoy!]]></description>
			<content:encoded><![CDATA[<p>I have <a href="http://mattdanger.net/2008/11/update-your-facebook-status-from-the-command-line/">updated my original Facebook status script</a> to work with Facebook 2.0.</p>
<p>Why is this interesting? Until <a href="http://www.allfacebook.com/2009/02/facebook-opens-status-api-say-goodbye-to-twitter/">recently</a> the Facebook Developer Platform didn&#8217;t allow the changing of user status messages. This does and can be implemented in other utilities, which I may do in the future. Enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://mattdanger.net/2009/02/facebook-status-20-announced/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Scripting Login Tasks in Mac OS X</title>
		<link>http://mattdanger.net/2009/01/scripting-login-tasks-in-mac-os-x/</link>
		<comments>http://mattdanger.net/2009/01/scripting-login-tasks-in-mac-os-x/#comments</comments>
		<pubDate>Thu, 22 Jan 2009 03:19:49 +0000</pubDate>
		<dc:creator>Matt Danger</dc:creator>
				<category><![CDATA[Mac OS X]]></category>
		<category><![CDATA[terminal]]></category>
		<category><![CDATA[10.5]]></category>
		<category><![CDATA[GlobalLoginItems]]></category>
		<category><![CDATA[Leopard]]></category>
		<category><![CDATA[login items]]></category>
		<category><![CDATA[LoginHooks]]></category>
		<category><![CDATA[SystemLoginItems]]></category>

		<guid isPermaLink="false">http://mattdanger.net/?p=90</guid>
		<description><![CDATA[Recently I wanted to configure some of our lab computers to automatically configure printers when a user logged on. While reading Apple&#8217;s documentation to find a solution I learned about the possible ways to script login procedures in Mac OS X 10.5. Login Hooks The first method of scripting a login action is the use&#8230;]]></description>
			<content:encoded><![CDATA[<p>Recently I wanted to configure some of our lab computers to automatically configure printers when a user logged on. While reading Apple&#8217;s documentation to find a solution I learned about the possible ways to script login procedures in Mac OS X 10.5.</p>
<h3>Login Hooks</h3>
<p>The first method of scripting a login action is the use of a <strong>Login Hook</strong>. A Login Hook is a script that is executed immediately after the user logs on but before other login processes are performed. The script runs as root and needs to be chmod&#8217;d +x to be made executable. This feature has existed in OS X for some time and is handy for some account specific tasks.</p>
<p>To configure OS X to run your script run the following command as root in Terminal:</p>
<p><code>defaults write com.apple.loginwindow LoginHook /path/to/script</code> </p>
<p>This modifies root&#8217;s login window properties in <code>/var/root/Library/Preferences/</code>. In Leopard login hooks do not work in any other user or system-wide com.apple.loginwindow preference file. I&#8217;m not sure if they did in previous versions.</p>
<p>More information about LoginHooks can be found on <a href="http://support.apple.com/kb/HT2420">Apple&#8217;s developer site</a>.</p>
<h3>System Login Items (Deprecated)</h3>
<div>
<p>SystemLoginItems was an old login script mechanism that has now been deprecated and will be removed in Snow Leopard. Scripts were executed when the Login Window was displayed and ran as root. When a user logged in the script died and was executed again as the user.</p>
<p>In Leopard SystemLoginItems behaves oddly. Applications do not launch upon login, instead they launch when the user logs out and attempt to run behind the Login Window.</p>
<p>Example usage of SystemLoginItems:</p>
<p><code>defaults write /Library/Preferences/com.apple.SystemLoginItems AutoLaunchedApplicationDictionary -array-add '{ "Path" = "/path/to/script"; "Hide" = 0; }'</code></p>
<p>SystemLoginItems was not well documented by Apple and it&#8217;s believed Apple created them specifically for a few developers. Now that Launchd exists SystemLoginItems is no longer necessary, likely the reason it is to be removed.</p>
<p>A brief discussion of SystemLoginItems can be found in <a href="http://lists.psu.edu/cgi-bin/wa?A2=ind0901&amp;L=macenterprise&amp;D=0&amp;T=0&amp;P=208243">this</a> MacEnterprise thread.</p>
<h3>Global Login Items</h3>
<p>GlobalLoginItems has superseded SystemLoginItems, and in some cases LoginHooks, as the best method for launching a login script. Unlike LoginHooks, a Global Login Item executes after all the login processes have completed and is meant for GUI applications. You can even configure whether you would like the application&#8217;s GUI to appear or not.</p>
<p>To configure a Global Login Item run the following command as root:</p>
<p><code>defaults write /Library/Preferences/loginwindow AutoLaunchedApplicationDictionary -array-add '{ "Path" = "/path/to/script"; "Hide" = "0"; }'</code></p>
<p>To remove the global login item either delete <code>/Library/Preferences/loginwindow</code> or run the following command as root:</p>
<p><code>defaults delete /Library/Preferences/loginwindow AutoLaunchedApplicationDictionary</code></p>
<p>Note that we are modifying the <code>loginwindow.plist</code> file and not the more popular <code>com.apple.loginwindow.plist</code> file. A reboot may also be required after deleting a global login item</p>
<p>More information about Login Items can be found in this <a href="http://developer.apple.com/technotes/tn2005/tn2083.html#SECGLOBALLOGINITEM">Apple Technical Note</a>.</div>
]]></content:encoded>
			<wfw:commentRss>http://mattdanger.net/2009/01/scripting-login-tasks-in-mac-os-x/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Sudo without a password in Mac OS X</title>
		<link>http://mattdanger.net/2009/01/sudo-without-a-password-in-mac-os-x/</link>
		<comments>http://mattdanger.net/2009/01/sudo-without-a-password-in-mac-os-x/#comments</comments>
		<pubDate>Mon, 12 Jan 2009 18:32:12 +0000</pubDate>
		<dc:creator>Matt Danger</dc:creator>
				<category><![CDATA[Mac OS X]]></category>
		<category><![CDATA[terminal]]></category>

		<guid isPermaLink="false">http://mattdanger.net/?p=85</guid>
		<description><![CDATA[Mac OS X users who spend a lot of time in Terminal may find having to enter their account passwords when using sudo to be inconvenient. A few simple steps can disable this and allow you to use sudo without ever needing a password in Mac OS X 10.5 Leopard. The steps are similar for&#8230;]]></description>
			<content:encoded><![CDATA[<p>Mac OS X users who spend a lot of time in Terminal may find having to enter their account passwords when using sudo to be inconvenient. A few simple steps can disable this and allow you to use sudo without ever needing a password in Mac OS X 10.5 Leopard. The steps are similar for 10.3 and 10.4 however <code>/etc/sudoers</code> may be slightly different.</p>
<p><em>Warning!</em> <em>Be aware that removing the password requirement to use sudo eliminates a level of security. If someone gains access to your account they will be able to easily escalate to root privileges.</em></p>
<p>First, edit <code>/etc/sudoers</code> and uncomment (remove the &#8220;#&#8221;)</p>
<p><code># %wheel	ALL=(ALL)	NOPASSWD: ALL</code></p>
<p>Then, in Terminal run the following command as root, replacing <code>your_username</code> with your account username:</p>
<p><code>dscl . append /Groups/wheel GroupMembership your_username</code></p>
]]></content:encoded>
			<wfw:commentRss>http://mattdanger.net/2009/01/sudo-without-a-password-in-mac-os-x/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

