<?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>Cain Manor &#187; OS-X</title> <atom:link href="http://cainmanor.com/tag/os-x/feed/" rel="self" type="application/rss+xml" /><link>http://cainmanor.com</link> <description>Your Guide To All Things Cain™</description> <lastBuildDate>Thu, 17 May 2012 19:43:34 +0000</lastBuildDate> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.3.2</generator> <item><title>SSH Tips</title><link>http://cainmanor.com/tech/ssh_tips/</link> <comments>http://cainmanor.com/tech/ssh_tips/#comments</comments> <pubDate>Wed, 05 May 2010 04:15:09 +0000</pubDate> <dc:creator>Greg Cain</dc:creator> <category><![CDATA[OS-X]]></category> <category><![CDATA[Tech]]></category> <category><![CDATA[UNIX]]></category> <category><![CDATA[Linux]]></category><guid
isPermaLink="false">http://cainmanor.com/?p=798</guid> <description><![CDATA[SSH is one of those things I use every day, and maybe what I use most throughout the day. These are either things I didn&#8217;t know (escape sequences), or haven&#8217;t looked into before. To get to the SSH escape sequences, you need a new line, followed by ~ and ?. That&#8217;s a newline (return), followed [...]]]></description> <content:encoded><![CDATA[<p>SSH is one of those things I use every day, and maybe what I use most throughout the day.  These are either things I didn&#8217;t know (escape sequences), or haven&#8217;t looked into before.</p><p>To get to the SSH escape sequences, you need a new line, followed by ~ and ?.  That&#8217;s a newline (return), followed by a tilde and a question mark.  This is what you get</p><div
class="wp_syntax"><div
class="code"><pre class="bash" style="font-family:monospace;">Supported escape sequences:
  ~.  - terminate connection <span style="color: #7a0874; font-weight: bold;">&#40;</span>and any multiplexed sessions<span style="color: #7a0874; font-weight: bold;">&#41;</span>
  ~B  - send a BREAK to the remote system
  ~C  - open a <span style="color: #7a0874; font-weight: bold;">command</span> line
  ~R  - Request rekey <span style="color: #7a0874; font-weight: bold;">&#40;</span>SSH protocol <span style="color: #000000;">2</span> only<span style="color: #7a0874; font-weight: bold;">&#41;</span>
  ~^Z - <span style="color: #7a0874; font-weight: bold;">suspend</span> <span style="color: #c20cb9; font-weight: bold;">ssh</span>
  ~<span style="color: #666666; font-style: italic;">#  - list forwarded connections</span>
  ~<span style="color: #000000; font-weight: bold;">&amp;</span>  - background <span style="color: #c20cb9; font-weight: bold;">ssh</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span>when waiting <span style="color: #000000; font-weight: bold;">for</span> connections to terminate<span style="color: #7a0874; font-weight: bold;">&#41;</span>
  ~?  - this message
  ~~  - send the escape character by typing it twice
<span style="color: #7a0874; font-weight: bold;">&#40;</span>Note that escapes are only recognized immediately after newline.<span style="color: #7a0874; font-weight: bold;">&#41;</span></pre></div></div><p>There are a lot of interesting things you can do with this.  My favorite being if you ssh to host1.cainmanor.com then ssh to host2.cainmanor.com and then ssh to host3.cainmanor.com and host3.cainmanor.com locks up, you can newline ~~~. and the third session will be closed.</p><p>But wait!! There&#8217;s more<br
/> <span
id="more-798"></span><br
/> You can do some very nifty things in your ~/.ssh/config file.  First, you&#8217;ve got to make sure you have very restrictive permissions on that file &#8211; 600 or bust.</p><div
class="wp_syntax"><div
class="code"><pre class="bash" style="font-family:monospace;">Host nickname
Hostname host1.cainmanor.com
Port <span style="color: #000000;">22</span>
User gcain
ForwardAgent <span style="color: #c20cb9; font-weight: bold;">yes</span></pre></div></div><p>Host &#8211; put a nickname you want here.   You can use a wild card (*), if you&#8217;d like the apply the changes to all servers (for instance, change the port for all your servers)<br
/> Hostname &#8211; DNS name (FQDN highly recommended) or IP address.<br
/> Port &#8211; Port<br
/> user &#8211; user name you want to log in with.</p><p>You can also use this with rsync, but I won&#8217;t go too far into it.<br
/> Before</p><div
class="wp_syntax"><div
class="code"><pre class="bash" style="font-family:monospace;">rsync <span style="color: #660033;">-avr</span> <span style="color: #660033;">--delete</span> <span style="color: #660033;">--exclude</span> <span style="color: #ff0000;">'.DS_Store'</span>  <span style="color: #000000; font-weight: bold;">/</span>share<span style="color: #000000; font-weight: bold;">/</span>MD0_DATA<span style="color: #000000; font-weight: bold;">/</span>Video<span style="color: #000000; font-weight: bold;">/</span> gcain<span style="color: #000000; font-weight: bold;">@</span>host1.cainmanor.com:<span style="color: #000000; font-weight: bold;">/</span>share<span style="color: #000000; font-weight: bold;">/</span>external<span style="color: #000000; font-weight: bold;">/</span>sdz1<span style="color: #000000; font-weight: bold;">/</span>Video<span style="color: #000000; font-weight: bold;">/</span></pre></div></div><p>After</p><div
class="wp_syntax"><div
class="code"><pre class="bash" style="font-family:monospace;">rsync <span style="color: #660033;">-avr</span> <span style="color: #660033;">--delete</span> <span style="color: #660033;">--exclude</span> <span style="color: #ff0000;">'.DS_Store'</span>  <span style="color: #000000; font-weight: bold;">/</span>share<span style="color: #000000; font-weight: bold;">/</span>MD0_DATA<span style="color: #000000; font-weight: bold;">/</span>Video<span style="color: #000000; font-weight: bold;">/</span> nickname:<span style="color: #000000; font-weight: bold;">/</span>share<span style="color: #000000; font-weight: bold;">/</span>external<span style="color: #000000; font-weight: bold;">/</span>sdz1<span style="color: #000000; font-weight: bold;">/</span>Video<span style="color: #000000; font-weight: bold;">/</span></pre></div></div><p>Not as clear as a shorter example, but I wanted to keep this around for myself.</p> ]]></content:encoded> <wfw:commentRss>http://cainmanor.com/tech/ssh_tips/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Force your Mac to boot into 64 bit mode</title><link>http://cainmanor.com/tech/force-your-mac-to-boot-into-64-bit-mode/</link> <comments>http://cainmanor.com/tech/force-your-mac-to-boot-into-64-bit-mode/#comments</comments> <pubDate>Tue, 04 May 2010 19:02:14 +0000</pubDate> <dc:creator>Greg Cain</dc:creator> <category><![CDATA[OS-X]]></category> <category><![CDATA[Tech]]></category><guid
isPermaLink="false">http://cainmanor.com/?p=789</guid> <description><![CDATA[UPDATE&#8230; Not all Macs that are capable of booting a 64 bit kernel will boot the 64 bit kernel. The Mini is one of those&#8230; (This is from Apple.) Getting those machines NOT on the list to boot into a 64 bit kernel is possible, but it&#8217;s beyond the scope of this article (it involves [...]]]></description> <content:encoded><![CDATA[<p>UPDATE&#8230;</p><p>Not all Macs that are capable of booting a 64 bit kernel will boot the 64 bit kernel.  The Mini is one of those&#8230;  (This is from <a
href="http://support.apple.com/kb/HT3770">Apple</a>.)   Getting those machines NOT on the list to boot into a 64 bit kernel is possible, but it&#8217;s beyond the scope of this article (it involves editing your boot.efi.)</p><div><table
width="100%" cellspacing="0" border="0" id="kbtable"><tbody><tr
id="header"><td>&nbsp;</td><td
style="text-align: center;">Can use 64-bit kernel</td><td
style="text-align: center;">Uses 64-bit kernel<br
/> by default</td></tr><tr><td>Mac Pro (Early 2009)</td><td
style="text-align: center;">&radic;</td><td
style="text-align: center;">&radic;</td></tr><tr><td>Mac Pro (Early 2008)</td><td
style="text-align: center;">&radic;</td><td><p
style="text-align: center;">&radic;</p></td></tr><tr><td>Mac Pro (Original)</td><td>&nbsp;</td><td>&nbsp;</td></tr><tr><td>iMac (Early 2009)</td><td
style="text-align: center;">&radic;</td><td>&nbsp;</td></tr><tr><td>iMac (Early 2008)</td><td
style="text-align: center;">&radic;</td><td>&nbsp;</td></tr><tr><td>iMac (earlier models)</td><td>&nbsp;</td><td>&nbsp;</td></tr><tr><td>Mac mini (all models)</td><td>&nbsp;</td><td>&nbsp;</td></tr></tbody></table></div><p><span
id="more-789"></span></p><p>First, make sure your Mac can support 64 bits.  Make sure your server is on the list above too.</p><div
class="wp_syntax"><div
class="code"><pre class="bash" style="font-family:monospace;">ioreg <span style="color: #660033;">-l</span> <span style="color: #660033;">-p</span> IODeviceTree <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">grep</span> firmware-abi</pre></div></div><p>If you are 64 bit capable, you&#8217;ll see the following.</p><div
class="wp_syntax"><div
class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">|</span> <span style="color: #000000; font-weight: bold;">|</span>   <span style="color: #ff0000;">&quot;firmware-abi&quot;</span> = <span style="color: #000000; font-weight: bold;">&lt;</span><span style="color: #ff0000;">&quot;EFI64&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></pre></div></div><p>There are several methods.  The easiest method is to hold the 6 and the 4 key when booting.   This isn&#8217;t permanent, but the following are.</p><p>As root, type&#8230;</p><div
class="wp_syntax"><div
class="code"><pre class="bash" style="font-family:monospace;">nvram boot-args=<span style="color: #ff0000;">&quot;arch=x86_64&quot;</span></pre></div></div><p>To change it back to the default</p><div
class="wp_syntax"><div
class="code"><pre class="bash" style="font-family:monospace;">nvram boot-args=<span style="color: #ff0000;">&quot;&quot;</span></pre></div></div><p>I didn&#8217;t like this particular method, as I prefer to have a verbose boot</p><div
class="wp_syntax"><div
class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> nvram boot-args=<span style="color: #ff0000;">&quot;-v&quot;</span></pre></div></div><p>There is one more way, that some people have had more success with.  It involves editing /Library/Preferences/SystemConfiguration/com.apple.Boot.plist</p><div
class="wp_syntax"><div
class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;</span>?xml <span style="color: #007800;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span> <span style="color: #007800;">encoding</span>=<span style="color: #ff0000;">&quot;UTF-8&quot;</span>?<span style="color: #000000; font-weight: bold;">&gt;</span>
<span style="color: #000000; font-weight: bold;">&lt;!</span>DOCTYPE plist PUBLIC <span style="color: #ff0000;">&quot;-//Apple Computer//DTD PLIST 1.0//EN&quot;</span> <span style="color: #ff0000;">&quot;http://www.apple.com/DTDs/PropertyList-1.0.dtd&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span>
<span style="color: #000000; font-weight: bold;">&lt;</span>plist <span style="color: #007800;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span>
<span style="color: #000000; font-weight: bold;">&lt;</span>dict<span style="color: #000000; font-weight: bold;">&gt;</span>
	<span style="color: #000000; font-weight: bold;">&lt;</span>key<span style="color: #000000; font-weight: bold;">&gt;</span>Kernel<span style="color: #000000; font-weight: bold;">&lt;/</span>key<span style="color: #000000; font-weight: bold;">&gt;</span>
	<span style="color: #000000; font-weight: bold;">&lt;</span>string<span style="color: #000000; font-weight: bold;">&gt;</span>mach_kernel<span style="color: #000000; font-weight: bold;">&lt;/</span>string<span style="color: #000000; font-weight: bold;">&gt;</span>
	<span style="color: #000000; font-weight: bold;">&lt;</span>key<span style="color: #000000; font-weight: bold;">&gt;</span>Kernel Flags<span style="color: #000000; font-weight: bold;">&lt;/</span>key<span style="color: #000000; font-weight: bold;">&gt;</span>
	<span style="color: #000000; font-weight: bold;">&lt;</span>string<span style="color: #000000; font-weight: bold;">&gt;&lt;/</span>string<span style="color: #000000; font-weight: bold;">&gt;</span>
<span style="color: #000000; font-weight: bold;">&lt;/</span>dict<span style="color: #000000; font-weight: bold;">&gt;</span>
<span style="color: #000000; font-weight: bold;">&lt;/</span>plist<span style="color: #000000; font-weight: bold;">&gt;</span></pre></div></div><p>You need to replace the null value below Kernel Flags (<string></string>) with &#8220;arch=x86_64&#8243;.  The correct version -</p><div
class="wp_syntax"><div
class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;</span>?xml <span style="color: #007800;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span> <span style="color: #007800;">encoding</span>=<span style="color: #ff0000;">&quot;UTF-8&quot;</span>?<span style="color: #000000; font-weight: bold;">&gt;</span>
<span style="color: #000000; font-weight: bold;">&lt;!</span>DOCTYPE plist PUBLIC <span style="color: #ff0000;">&quot;-//Apple Computer//DTD PLIST 1.0//EN&quot;</span> <span style="color: #ff0000;">&quot;http://www.apple.com/DTDs/PropertyList-1.0.dtd&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span>
<span style="color: #000000; font-weight: bold;">&lt;</span>plist <span style="color: #007800;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span>
<span style="color: #000000; font-weight: bold;">&lt;</span>dict<span style="color: #000000; font-weight: bold;">&gt;</span>
        <span style="color: #000000; font-weight: bold;">&lt;</span>key<span style="color: #000000; font-weight: bold;">&gt;</span>Kernel<span style="color: #000000; font-weight: bold;">&lt;/</span>key<span style="color: #000000; font-weight: bold;">&gt;</span>
        <span style="color: #000000; font-weight: bold;">&lt;</span>string<span style="color: #000000; font-weight: bold;">&gt;</span>mach_kernel<span style="color: #000000; font-weight: bold;">&lt;/</span>string<span style="color: #000000; font-weight: bold;">&gt;</span>
        <span style="color: #000000; font-weight: bold;">&lt;</span>key<span style="color: #000000; font-weight: bold;">&gt;</span>Kernel Flags<span style="color: #000000; font-weight: bold;">&lt;/</span>key<span style="color: #000000; font-weight: bold;">&gt;</span>
        <span style="color: #000000; font-weight: bold;">&lt;</span>string<span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #007800;">arch</span>=x86_64<span style="color: #000000; font-weight: bold;">&lt;/</span>string<span style="color: #000000; font-weight: bold;">&gt;</span>
<span style="color: #000000; font-weight: bold;">&lt;/</span>dict<span style="color: #000000; font-weight: bold;">&gt;</span>
<span style="color: #000000; font-weight: bold;">&lt;/</span>plist<span style="color: #000000; font-weight: bold;">&gt;</span></pre></div></div><p>To check if you&#8217;re 64 bit or not, you can use</p><div
class="wp_syntax"><div
class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">uname</span> <span style="color: #660033;">-a</span></pre></div></div><p>If you see</p><div
class="wp_syntax"><div
class="code"><pre class="bash" style="font-family:monospace;">x86_64</pre></div></div><p>You&#8217;ve got a 64 bit kernel.</p><p>This also works</p><div
class="wp_syntax"><div
class="code"><pre class="bash" style="font-family:monospace;">system_profiler <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">grep</span> <span style="color: #ff0000;">&quot;64-bit Kernel and Extensions&quot;</span>
      <span style="color: #000000;">64</span>-bit Kernel and Extensions: Yes</pre></div></div>]]></content:encoded> <wfw:commentRss>http://cainmanor.com/tech/force-your-mac-to-boot-into-64-bit-mode/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Convert upper case to lower case</title><link>http://cainmanor.com/tech/convert-upper-case-to-lower-case/</link> <comments>http://cainmanor.com/tech/convert-upper-case-to-lower-case/#comments</comments> <pubDate>Wed, 08 Apr 2009 22:49:50 +0000</pubDate> <dc:creator>Greg Cain</dc:creator> <category><![CDATA[OS-X]]></category> <category><![CDATA[Tech]]></category> <category><![CDATA[UNIX]]></category> <category><![CDATA[bash]]></category> <category><![CDATA[Linux]]></category><guid
isPermaLink="false">http://cainmanor.com/tech/convert-upper-case-to-lower-case</guid> <description><![CDATA[cat /tmp/blah &#124; tr '[A-Z]' '[a-z]' and to convert from lower case to upper case cat /tmp/blah &#124; tr '[a-z]' '[A-Z]']]></description> <content:encoded><![CDATA[<div
class="wp_syntax"><div
class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">cat</span> <span style="color: #000000; font-weight: bold;">/</span>tmp<span style="color: #000000; font-weight: bold;">/</span>blah <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">tr</span> <span style="color: #ff0000;">'[A-Z]'</span> <span style="color: #ff0000;">'[a-z]'</span></pre></div></div><p>and to convert from lower case to upper case</p><div
class="wp_syntax"><div
class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">cat</span> <span style="color: #000000; font-weight: bold;">/</span>tmp<span style="color: #000000; font-weight: bold;">/</span>blah <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">tr</span> <span style="color: #ff0000;">'[a-z]'</span> <span style="color: #ff0000;">'[A-Z]'</span></pre></div></div>]]></content:encoded> <wfw:commentRss>http://cainmanor.com/tech/convert-upper-case-to-lower-case/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>NMAP tip</title><link>http://cainmanor.com/tech/nmap-tip/</link> <comments>http://cainmanor.com/tech/nmap-tip/#comments</comments> <pubDate>Wed, 08 Apr 2009 20:03:05 +0000</pubDate> <dc:creator>Greg Cain</dc:creator> <category><![CDATA[OS-X]]></category> <category><![CDATA[Tech]]></category> <category><![CDATA[UNIX]]></category> <category><![CDATA[nmap]]></category><guid
isPermaLink="false">http://cainmanor.com/tech/nmap-tip</guid> <description><![CDATA[To scan an entire subnet for OS fingerprints and output to a grep-able file nmap -oG XXX.txt -O 10.10.XXX.0/24]]></description> <content:encoded><![CDATA[<p>To scan an entire subnet for OS fingerprints and output to a grep-able file</p><div
class="wp_syntax"><div
class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">nmap</span> <span style="color: #660033;">-oG</span> XXX.txt <span style="color: #660033;">-O</span> <span style="color: #000000;">10.10</span>.XXX.0<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">24</span></pre></div></div>]]></content:encoded> <wfw:commentRss>http://cainmanor.com/tech/nmap-tip/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>OS-X Navigation tips</title><link>http://cainmanor.com/tech/os-x-navigation-tips/</link> <comments>http://cainmanor.com/tech/os-x-navigation-tips/#comments</comments> <pubDate>Tue, 30 Dec 2008 16:40:51 +0000</pubDate> <dc:creator>Greg Cain</dc:creator> <category><![CDATA[OS-X]]></category> <category><![CDATA[Tech]]></category><guid
isPermaLink="false">http://cainmanor.com/?p=430</guid> <description><![CDATA[When in an open/save dialog box, or in the Finder,  pressing Command + Shift + G will allow you to directly type in a directory path. When in an open/save dialog box, you can drag a folder into the dialog box to change to that directory.]]></description> <content:encoded><![CDATA[<p>When in an open/save dialog box, or in the Finder,  pressing Command + Shift + G will allow you to directly type in a directory path.</p><p>When in an open/save dialog box, you can drag a folder into the dialog box to change to that directory.</p> ]]></content:encoded> <wfw:commentRss>http://cainmanor.com/tech/os-x-navigation-tips/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> </channel> </rss>
<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk: basic
Page Caching using disk: enhanced
Database Caching 3/8 queries in 0.003 seconds using disk: basic
Object Caching 406/415 objects using disk: basic

Served from: cainmanor.com @ 2012-05-21 19:59:55 -->
