<?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>Urania &#187; Command Line Tricks</title>
	<atom:link href="http://iparrizar.mnstate.edu/~juan/urania/category/macos/command-line-tricks/feed/" rel="self" type="application/rss+xml" />
	<link>http://iparrizar.mnstate.edu/~juan/urania</link>
	<description>A blog named for the muse of Astronomy containing musings by an astronomer</description>
	<lastBuildDate>Fri, 06 Nov 2009 01:44:27 +0000</lastBuildDate>
	
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Activating SSH support in MacPorts PHP</title>
		<link>http://iparrizar.mnstate.edu/~juan/urania/2008/12/11/activating-ssh-support-in-macports-php/</link>
		<comments>http://iparrizar.mnstate.edu/~juan/urania/2008/12/11/activating-ssh-support-in-macports-php/#comments</comments>
		<pubDate>Thu, 11 Dec 2008 18:35:18 +0000</pubDate>
		<dc:creator>Juan</dc:creator>
				<category><![CDATA[Command Line Tricks]]></category>
		<category><![CDATA[MacOS X]]></category>
		<category><![CDATA[MacPorts]]></category>

		<guid isPermaLink="false">http://iparrizar.mnstate.edu/~juan/urania/2008/12/11/activating-ssh-support-in-macports-php/</guid>
		<description><![CDATA[[I have made an updated version of these instructions for adding the SSH2 PHP extension to the pre-installed PHP 5.3.0 installation on MacOS 10.6 available here.]
I just upgraded the software on this blog to WordPress 2.7. The major new feature I am interested in is automatic upgrading, which could prove quite a time saver. Unfortunately, [...]]]></description>
			<content:encoded><![CDATA[<p><strong>[I have made an updated version of these instructions for adding the SSH2 PHP extension to the pre-installed PHP 5.3.0 installation on MacOS 10.6 <a href="http://iparrizar.mnstate.edu/~juan/urania/2009/10/13/ssh2-extension-activation-in-php-530/">available here</a>.]</strong></p>
<p>I just upgraded the software on this blog to <a href="http://wordpress.org/development/2008/12/coltrane/">WordPress 2.7</a>. The major new feature I am interested in is automatic upgrading, which could prove quite a time saver. Unfortunately, this automatic upgrading uses only FTP (which is totally insecure) or FTPS (which requires me to set up an SSL certificate).</p>
<p>I noticed that the WordPress code had ssh2 support built-in, so all I need to is activate SSH2 support in the MacPorts installed PHP and I should be able to use SFTP in WordPress to handle the upgrades. I poked around and found <a href="http://kevin.vanzonneveld.net/techblog/article/make_ssh_conanections_with_php/">this posting</a> outlining the process for adding ssh2 support to Ubuntu. It guided me in developing this list of hints:</p>
<ol>
<li>Start by installing libssh2 via MacPorts using the command:<br />
      <pre><pre>
sudo port install libssh2
</pre></pre>
    </li>
<li>Once it is activated, link the libssh and PHP together using the <a href="http://kevin.vanzonneveld.net/techblog/tag/pecl/">PECL</a> module SSH2. Unfortunately, <a href="http://www.mail-archive.com/macports-users%40lists.macosforge.org/msg06734.html">directly installing the module with PECL under MacPorts is troublesome</a>, so I just used PECL to download the module.<br />
      <pre><pre>
pecl download ssh2
</pre></pre>triggered the following error (since ssh2 is apparently beta),<br />
      <pre><pre>
Failed to download pecl/ssh2 within preferred state &quot;stable&quot;, latest release is version 0.11.0, stability &quot;beta&quot;, use &quot;channel://pecl.php.net/ssh2-0.11.0&quot; to install
Cannot initialize &#039;ssh2&#039;, invalid or missing package file
Package &quot;ssh2&quot; is not valid
download failed
</pre></pre>so I used<br />
      <pre><pre>
pecl download channel://pecl.php.net/ssh2-0.11.0
</pre></pre>as suggested and was able to download the PHP library for SSH2. Once the download was complete, I started on the standard compilation sequence for a PHP library<br />
      <pre><pre>
tar xzvf ssh2-0.11.0.tgz
cd ssh2-0.11.0
phpize
./configure --with-ssh2=/opt/local
make
sudo make install
</pre></pre>The final command informed me the ssh2.so library was placed in <code>/opt/local/lib/php/extensions/no-debug-non-zts-20060613/</code>
    </li>
<li>Now you need to make sure PHP loads the new module, so we open the PHP configuration file <code>/opt/local/etc/php.ini</code> and edit the extension_dir line to point the extension directory above:<br />
      <pre><pre>
extension_dir = &quot;/opt/local/lib/php/extensions/no-debug-non-zts-20060613/&quot;
</pre></pre>and then add the following line to the end of the section on &#8220;Dynamic Extensions&#8221;:<br />
      <pre><pre>
extension=ssh2.so
</pre></pre>If you edited everything properly, a simple <code>php -v</code> from the command line should NOT trigger any errors.
    </li>
<li>Finally, I restart the apache2 server so that the reconfigured PHP is loaded using<br />
      <pre><pre>
sudo /opt/local/etc/LaunchDaemons/org.macports.apache2/apache2.wrapper restart
</pre></pre>At this point, I checked (via the <code>phpinfo();</code> command to see if the web server was supporting SSH. Near the bottom of the <code>phpinfo();</code> listing is a listed of &#8220;Registered PHP Streams&#8221;. As <a href="http://bugssite.org/blog/2008/09/07/does-your-wordpress-server-support-ssh2/">noted here</a>, it should incude &#8220;ssh2.shell&#8221;, &#8220;ssh2.exec&#8221;, &#8220;ssh2.tunnel&#8221;, &#8220;ssh2.scp&#8221;, and &#8220;ssh2.sftp&#8221;. If it does, you have enabled SSH support for Apache2 driven PHP pages under MacPorts.
    </li>
<li>If you are doing this to get WordPress 2.7 automatic installation working, you will notice now when the automatic installation dialog box pops up, in addition to ftp and ftps, you now have an ssh option.<br />
    <img src="http://iparrizar.mnstate.edu/~juan/urania/wp-content/media/wordpresssnap3.png" height="77" width="380"/></li>
<li>
<p>Now that I got this working, I&#8217;ll just have to keep an eye out for any future MacPort updates to PHP and make sure they don&#8217;t overwrite the</p>
<p><code>/opt/local/etc/php.ini</code></p>
<p>file or the extensions directory where I installed ssh2.</p>
</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://iparrizar.mnstate.edu/~juan/urania/2008/12/11/activating-ssh-support-in-macports-php/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Fixing my PHP woes with MacPorts</title>
		<link>http://iparrizar.mnstate.edu/~juan/urania/2008/08/14/fixing-my-php-woes-with-macports/</link>
		<comments>http://iparrizar.mnstate.edu/~juan/urania/2008/08/14/fixing-my-php-woes-with-macports/#comments</comments>
		<pubDate>Fri, 15 Aug 2008 03:15:31 +0000</pubDate>
		<dc:creator>Juan</dc:creator>
				<category><![CDATA[Command Line Tricks]]></category>
		<category><![CDATA[MacOS X Annoyances]]></category>
		<category><![CDATA[MacPorts]]></category>

		<guid isPermaLink="false">http://iparrizar.mnstate.edu/~juan/urania/2008/08/14/fixing-my-php-woes-with-macports/</guid>
		<description><![CDATA[As I mentioned in my blog post earlier today, I have been having issues using the JpGraph graphing package for PHP with Apple&#8217;s built-in PHP under MacOS 10.5. It appears Apple&#8217;s security efforts have &#8220;secured&#8221; PHP to the point where JpGraph (and PDFLib) will not function properly under the built-in PHP. [Note added after initial [...]]]></description>
			<content:encoded><![CDATA[<p>As I mentioned in my blog post earlier today, I have been having issues using the JpGraph graphing package for PHP with Apple&#8217;s built-in <a href="http://www.php.net/">PHP</a> under <a href="http://www.apple.com/macosx/">MacOS 10.5</a>. It appears Apple&#8217;s security efforts have &#8220;secured&#8221; PHP to the point where <a href="http://www.aditus.nu/jpgraph/">JpGraph</a> (and <a href="http://www.pdflib.com/">PDFLib</a>) will not function properly under the built-in PHP. <strong>[Note added after initial post: The rest of this post describes installing Apache 2 and PHP under MacPorts and configuring it to be similar to Apple's built-in servers.  This appeared to solve my problems, but then my Mac locked-up [possibly related] and on reboot, the new MacPorts-based PHP installation started throwing the same errors as Apple&#8217;s built-in PHP.  More information on this problem is located in <a href="http://iparrizar.mnstate.edu/~juan/urania/2008/08/18/php-woes-only-fixed-briefly/">my newer post on the issue</a>.]</strong></p>

<p>I had tried to alleviate the solution previously by compiling a version of PHP myself that would be compatible with Apple&#8217;s built-in Apache 2 web server. This turned out to be difficult because Apple&#8217;s Apache 2 web server is a &#8220;universal&#8221; binary, meaning it contains four seperate binaries (for 32-bit PowerPC, 64-bit PowerPC, 32-bit Intel, and 64-bit Intel processors). As such I needed to compile a &#8220;universal&#8221; PHP binary and since I wanted MySQL support, I needed a &#8220;universal&#8221; MySQL binary. This turned out to be too much for this astronomer, so I gave up on making a new PHP that was compatible with Apple&#8217;s built-in web server.</p>

<p>So I bit the bullet and after reviewing the options, I decided to install Apache 2 and PHP under <a href="http://www.macports.org/">MacPorts</a>. If you have read the other posts on this site, you know I really like MacPorts as the quick and dirty way to get many things running on the Mac. However, despite this, I don&#8217;t like installing MacPorts for items Apple provides, instead generally preferring to use Apple&#8217;s &#8220;pre-installed&#8221; versions. Furthermore, there have been a lot of complaints on the MacPorts mailing lists about various issues compiling PHP5. So I wasn&#8217;t as quick to jump onto the MacPorts bandwagon for PHP as I am for other problems. However, since I am familiar with MacPorts, I decided this was the best approach for getting my online <a href="http://iparrizar.mnstate.edu/~juan/MAPS_Database/catalog/finder_chart/">Finder Charts</a> to work again.</p>

<p>The process proved reasonably painless, especially since I was able to review this blog post, where he lays out pretty much what to do. However, since I wanted to achieve maximum compatibility with Apple&#8217;s built-in web server and PHP setup, in case I wanted to switch back, I ended up doing things a little bit differently, so I am outlining my steps here.
<ol>
	<li>I started by <strong>installing the MacPorts version of Apache 2</strong> using the command <code>sudo port install apache2</code></li>
	<li>Next, I had to <strong>create the Apache 2 configuration files and edit them</strong>. I started by copying the sample configuration file
<pre>sudo cp /opt/local/apache2/conf/httpd.conf.sample /opt/local/apache2/conf/httpd.conf</pre>
and then editing <code>/opt/local/apache2/conf/httpd.conf</code> with my favorite text editor to change the configuration to match the that of the built-in Apache 2 server a closely as possible. My matching the configuration of Apple&#8217;s built-in server, I can switch back to it with relative ease if I choose to do so later. So I made the following changes to <code>/opt/local/apache2/conf/httpd.conf</code>:</li>
	<li style="list-style: none">
<ol type="i">
	<li>I changed <code>DocumentRoot</code> to <code>&quot;/Library/WebServer/Documents&quot;</code> as is the case with Apple&#8217;s built-in server.</li>
	<li>To allow <code>index.php</code> files to be used as directory indexes, I changed
<pre>DirectoryIndex index.html</pre>
to
<pre>DirectoryIndex index.html index.php</pre>
(I don&#8217;t know why this isn&#8217;t necessary with Apple&#8217;s built-in server, but it was necessary here).</li>
	<li>I changed  to
and in that directory block of code, I added &#8220;<code>MultiViews</code>&#8221; to the <code>Options</code> line.</li>
	<li>I changed  to  in order to prevent the listing of <code>.DS_Store</code> files in directory listings by the web server.</li>
	<li>Before the <code>ErrorLog</code> block of code in this file, I added the following lines copied from Apple&#8217;s default Apache 2 configuration:
<pre><pre>#
# Apple specific filesystem protection.
#

Order allow,deny
Deny from all
Satisfy All

Order allow,deny
Deny from all
Satisfy All</pre></pre>
</li>
	<li>I changed <code>ErrorLog</code> to <code>&quot;/private/var/log/apache2/error_log&quot;</code></li>
	<li>I changed <code>CustomLog</code> to <code>&quot;/private/var/log/apache2/access_log common&quot;</code></li>
	<li>To match Apple&#8217;s Apache 2 server configuration, I changed <code>ScriptAliasMatch</code> to
<pre>^/cgi-bin/((?!(?i:webobjects)).*$) &quot;/Library/WebServer/CGI-Executables/$1&quot;</pre>
</li>
	<li>I changed  back to</li>
	<li>I added the following Handles to the &#8220;To use CGI Scripts&#8221; block of code:
<pre><code>AddHandler imap-file .map
AddHandler cgi-script .cgi
AddHandler cgi-script .pl</code></pre></li>
	<li>I uncommended the following lines near the end of the file:
<pre></pre>
</li>
	<li><strong>[OPTIONAL]</strong> Because I use the WebDAV server on my server, I also uncommented
<code></code></li>
	<li>Finally, I added the following lines to the end of the file in order to allow loading of the PHP5 configuration
<pre></pre>
</li>
</ol>
</li>
	<li>Next, I editted <code>/opt/local/apache2/conf/extra/httpd-userdir.conf</code> and added the following to the end of the file
<pre><pre>
#
# Users might not be in /Users/*/Sites, so use user-specific config files.
#
Include /private/etc/apache2/users/*.conf</pre></pre>
</li>
	<li> <strong>[OPTIONAL]</strong> Since I use the built-in WebDAV server, I made a backup of the WebDAV configuration, then copied the
Default MacOS X one, because I have spent a lot of time tweaking it previously and I didn&#8217;t want to have to reinvent the wheel. 
<pre><pre>sudo cp /opt/local/apache2/conf/extra/httpd-dav.conf /opt/local/apache2/conf/extra/httpd-dav.conf.orig
sudo cp /etc/apache2/extra/httpd-dav.conf /opt/local/apache2/conf/extra/httpd-dav.conf</pre></pre>
</li>
	<li>I had to <strong>install PHP5 with MacPorts</strong>. Since I wanted to add support for Apache 2 and MySQL, I entered the command:
<code>sudo port install php5 +apache2 +mysql5 +pear</code>
which has the side effect of installing MacPorts version of MySQL as well. Assuming everything goes well, after a few minutes (this takes longer than the apache2 install earlier), the installation will end. At this point we can configure the Apache 2 mod_php module by typing: 
<pre>cd /opt/local/apache2/modules/opt/local/apache2/bin/apxs -a -e -n &quot;php5&quot; libphp5.so</pre>
</li>
	<li> <strong>[OPTIONAL]</strong> Next, I had to <strong>create the PHP5 configuration file and edit it</strong>. I started by copying the sample configuration file
<code>sudo cp /opt/local/etc/php.ini-dist /opt/local/etc/php.ini</code>
and then editing <code>/opt/local/etc/php.ini</code> to make it match <code>/etc/php.ini</code> (which Apple&#8217;s built-in PHP uses). All the changes I made were optional and related to the specifics of my setup. The only interesting one was that I wanted to continue to use the MySQL.com binary distribution of MySQL server, so I set the following variables in <code>/opt/local/etc/php.ini</code>: 
<ol type="i">
	<li><code>mysql.default_port</code> from &#8220;&#8221; to <code>3306</code></li>
	<li><code>mysql.default_socket</code> from &#8220;&#8221; to <code>/private/tmp/mysql.sock</code></li>
	<li><code>mysqli.default_socket</code> from &#8220;&#8221; to <code>/private/tmp/mysql.sock</code></li>
</ol>
</li>
	<li><strong>I deactivated Apple&#8217;s built-in web server</strong> by turning off Web Sharing in the Sharing.prefPane.</li>
	<li> <strong>Finally, I launched the new webserver</strong> (and set it up for launching on boot-up in the future) by typing
<pre>sudo launchctl load -w /Library/LaunchDaemons/org.macports.apache2.plist</pre>
If this breaks anything, I can reverse the process by typing
<pre>sudo launchctl unload -w /Library/LaunchDaemons/org.macports.apache2.plist</pre>
</li>
	<li> <strong>[OPTIONAL]</strong> I like the ability to turn on and off the Apache webserver from the command line using apachectl. I can &#8220;emulate&#8221; this in /bin/tcsh (my prefered shell) by adding the following command to the ~/.tcshrc file:
<pre>alias apache2ctl &#039;sudo /opt/local/etc/LaunchDaemons/org.macports.apache2/apache2.wrapper&#039;</pre>
After which I can bring down the server by typing <code>apache2ctl stop</code> and restart it by typing <code>apache2ctl start</code>.</li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://iparrizar.mnstate.edu/~juan/urania/2008/08/14/fixing-my-php-woes-with-macports/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Leopard&#8217;s path_helper seems a bit buggy</title>
		<link>http://iparrizar.mnstate.edu/~juan/urania/2008/03/25/leopards-path_helper-seems-a-bit-buggy/</link>
		<comments>http://iparrizar.mnstate.edu/~juan/urania/2008/03/25/leopards-path_helper-seems-a-bit-buggy/#comments</comments>
		<pubDate>Wed, 26 Mar 2008 02:17:37 +0000</pubDate>
		<dc:creator>Juan</dc:creator>
				<category><![CDATA[Command Line Tricks]]></category>
		<category><![CDATA[MacOS X Annoyances]]></category>

		<guid isPermaLink="false">http://iparrizar.mnstate.edu/~juan/urania/2008/03/25/leopards-path_helper-seems-a-bit-buggy/</guid>
		<description><![CDATA[I am having an interesting problem. In my last post, I noted that on some Macs with Leopard installed, deactivating the lines calling /usr/libexec/path_helper in the /etc/profile file fixed LaTeXit hanging at launch. A bit more investigation by Antonio Molins (posted in the comments to that post) revealed it was possible to add an ASCII [...]]]></description>
			<content:encoded><![CDATA[<p>I am having an interesting problem. In my <a href="http://iparrizar.mnstate.edu/~juan/urania/2008/03/08/a-fix-for-latexit-under-leopard/">last post</a>, I noted that on some Macs with Leopard installed, deactivating the lines calling <code>/usr/libexec/path_helper</code> in the <code>/etc/profile</code> file fixed <a href="http://ktd.club.fr/programmation/latexit_en.php">LaTeXit</a> hanging at launch. A bit more investigation by Antonio Molins (<a href="http://iparrizar.mnstate.edu/~juan/urania/2008/03/08/a-fix-for-latexit-under-leopard/#comment-94">posted in the comments to that post</a>) revealed it was possible to add an ASCII file in the <code>/etc/paths.d</code> directory. We could create a file called <code>/etc/paths.d/macports</code> containing the only the line 
<pre>/opt/local/bin</pre>
and it should automatically add everything in macports to most user&#8217;s <code>PATH</code> variables. However, when I tried this, all my calls to <code>/usr/libexec/path_helper -s</code> always locked up the command.</p>
<p>Some further investigation revealed new user accounts on my Macs didn&#8217;t have this problem. I surmised that since I was setting up the <code>PATH</code> and <code>MANPATH</code> variables in my environment at login, that this could apparently lock up <code>path_helper</code>. Since I use <code>tcsh</code> by default (instead of Apple&#8217;s default <code>bash</code> shell), I issued the following two commands from the command line</p>
<pre><pre>
unsetenv PATH
unsetenv MANPATH 
</pre></pre>
<p>and sure enough <code>path_helper</code> worked without an issue. So something is buggy in <code>path_helper</code>, or at least hypersensitive to pre-existing <code>PATH</code> environmental variables. I&#8217;ll have to investigate this more later. One thing I did discover is that</p>
<pre><pre>
/usr/libexec/path_helper -c 
</pre></pre>
<p>will produce the commands to set up <code>tcsh</code>&#8217;s environment.</p>
<pre><pre>
/usr/libexec/path_helper -s 
</pre></pre>
<p>returns those for the default <code>bash</code> shell.</p>
]]></content:encoded>
			<wfw:commentRss>http://iparrizar.mnstate.edu/~juan/urania/2008/03/25/leopards-path_helper-seems-a-bit-buggy/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Making Leopard PHP a better PHP by adding GD support</title>
		<link>http://iparrizar.mnstate.edu/~juan/urania/2008/03/04/making-leopard-php-a-better-php-by-adding-gd-support/</link>
		<comments>http://iparrizar.mnstate.edu/~juan/urania/2008/03/04/making-leopard-php-a-better-php-by-adding-gd-support/#comments</comments>
		<pubDate>Wed, 05 Mar 2008 00:32:35 +0000</pubDate>
		<dc:creator>Juan</dc:creator>
				<category><![CDATA[Command Line Tricks]]></category>
		<category><![CDATA[MacOS X Annoyances]]></category>

		<guid isPermaLink="false">http://iparrizar.mnstate.edu/~juan/urania/2008/03/04/making-leopard-php-a-better-php-by-adding-gd-support/</guid>
		<description><![CDATA[The nice thing about MacOS X 10.5 Leopard is that it comes with PHP 5.2.4 pre-installed. Unfortunately one of the features Apple choose not to compile in was support for the GD graphics library, which I use extensively. Furthermore compiling in new features has proven to be somewhat troublesome. When I tried to configure PHP [...]]]></description>
			<content:encoded><![CDATA[The nice thing about <a href="http://www.apple.com/macosx/">MacOS X 10.5 Leopard</a> is that it comes with PHP 5.2.4 pre-installed. Unfortunately one of the features Apple choose not to compile in was support for the <a href="http://www.libgd.org/Main_Page">GD graphics library</a>, which I use extensively<strong><span style="font-weight: normal;">. Furthermore compiling in new features has proven to be somewhat troublesome. When I tried to configure <a href="http://www.php.net/">PHP</a> 5.2.5 on my Leopard box which the following commands (a variant of the configure command I would issue under Tiger with no complaints):</span></strong>
<pre></pre>
The result was a failed configure due to an error in mysql configuration. I pinned this down to a request for a library at <code>/usr/local/mysql/lib/mysql/libmysqlclient.15.dylib</code> which is actually located one directory up. This can be fixed via the command line using:
<pre><pre>cd /usr/local/mysql/lib
mkdir mysql
cp libmysqlclient.15.dylib mysql/libmysqlclient.15.dylib</pre></pre>
Then the <code>./configure</code> worked just fine. Unfortunately, when I did a
<pre><pre>make
make test</pre></pre>
to compile the PHP and test it, there was no happiness. There were over 50 errors, some of them major. Crud.

This is just the setup. See, all I needed was <a href="http://www.libgd.org/Main_Page">GD graphics library</a> support in PHP for my website. Well, after googling for some time for some master hacker&#8217;s notes on getting PHP 5.2.5 to compile on Leopard, I discovered a fellow named Hill Pei had <a href="http://www.veola.net/macintosh/adding-gd-library-for-mac-os-x-leopard">hacked GD support into the Leopard PHP</a> without too much effort. His method simply requires some comfort with the command line and editing text files. In five minutes, I had GD support with Leopard&#8217;s built-in PHP. Excellent! <strong>[Despite a report in the comments to the contrary. This still appears to be necessary if you apply Security Update 2008-002, which installs PHP version 5.2.5. In which case, you should grab the php 5.2.5 code and work from there. I can confirm Hill Pei's instructions do work after Security Update 20008-002 if you grab the PHP-5.2.5 code instead of 5.2.4 as he suggests.]</strong>]]></content:encoded>
			<wfw:commentRss>http://iparrizar.mnstate.edu/~juan/urania/2008/03/04/making-leopard-php-a-better-php-by-adding-gd-support/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>MacPorts getting more functional for this Astronomer</title>
		<link>http://iparrizar.mnstate.edu/~juan/urania/2008/01/24/macports-getting-more-functional-for-this-astronomer/</link>
		<comments>http://iparrizar.mnstate.edu/~juan/urania/2008/01/24/macports-getting-more-functional-for-this-astronomer/#comments</comments>
		<pubDate>Thu, 24 Jan 2008 23:36:34 +0000</pubDate>
		<dc:creator>Juan</dc:creator>
				<category><![CDATA[Astronomical Software]]></category>
		<category><![CDATA[Command Line Tricks]]></category>
		<category><![CDATA[LaTeX]]></category>
		<category><![CDATA[MacOS X Annoyances]]></category>
		<category><![CDATA[MacPorts]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://iparrizar.mnstate.edu/~juan/urania/2008/01/24/macports-getting-more-functional-for-this-astronomer/</guid>
		<description><![CDATA[About 6 weeks ago I posted about the various ports that failed to install in my first attempts at getting &#8220;my standard suite&#8221; of ports installed under MacPorts on Leopard. My standard suite until Tiger involved issuing the following command:
sudo port install aquaterm chmdump contacts coreutils curl file findutils g95 ghostscript gv ImageMagick ksh93 latex2rtf [...]]]></description>
			<content:encoded><![CDATA[<p>About 6 weeks ago I posted about <a href="http://iparrizar.mnstate.edu/~juan/urania/2007/12/05/macports-failures-under-leopard/">the various ports that failed to install in my first attempts at getting &#8220;my standard suite&#8221; of ports installed under MacPorts on Leopard</a>. My standard suite until Tiger involved issuing the following command:<br />
<pre>sudo port install aquaterm chmdump contacts coreutils curl file findutils g95 ghostscript gv ImageMagick ksh93 latex2rtf lynx macutil osxutils plotutils subversion teTeX tidy vim wget wine xterm xephem</pre><br />
Since then <a title="MacPorts homepage" href="http://www.macports.org/">MacPorts</a> has released version 1.6 and the various porters have been hacking at the various problems. I can now report that of the ports I reported failed to install:</p>
<ul>
<li><strong>xterm</strong>, <strong>wine</strong>, and <strong>g95</strong> all now install without any issues.</li>
<li><strong>teTeX</strong> can be installed, there was a bad dependency in the portfile. You just needed to install <strong>openmotif</strong> first manually. <strong>I don&#8217;t know if the bad dependency is still there, it may have been resolved.</strong></li>
<li><strong>subversion</strong> can be installed, it also had a bad dependency. You just needed to install <strong>nawk</strong> first. <strong>Again, I d</strong><strong>on&#8217;t know if the bad dependency is still there, it may have been resolved.</strong></li>
<li><strong>gv</strong> can be installed if you apply a patch. If you check that bug ticket on <strong>gv</strong> (you need to get a free <a href="https://www.macosforge.org/">MacOSForge</a> account), you will find a new <span style="font-style: italic">patch-setenv.c</span> file is available there. If you download that file and replace <em>/opt/local/var/macports/sources/rsync.macports.org/release/ports/print/gv/files/patch-setenv.c</em> with it, <strong>gv</strong> will compile and install just fine.</li>
</ul>
<p>This leaves just two of my standard suite of packages that don&#8217;t compile right in Leopard, <strong><span style="text-decoration: line-through;">osxutils</span></strong> (<a href="http://iparrizar.mnstate.edu/~juan/urania/2008/04/10/osxutils-now-fixed-on-macports-under-leopard/">See this post</a>) and <span style="text-decoration: line-through;"><strong>xephem</strong></span> (<a href="http://iparrizar.mnstate.edu/~juan/urania/2008/03/02/xephem-vis-macports-fixed/">See this post</a>). And xephem installs just fine manually if you <a href="http://www.clearskyinstitute.com/xephem/">download the source code</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://iparrizar.mnstate.edu/~juan/urania/2008/01/24/macports-getting-more-functional-for-this-astronomer/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MacPorts failures under Leopard</title>
		<link>http://iparrizar.mnstate.edu/~juan/urania/2007/12/05/macports-failures-under-leopard/</link>
		<comments>http://iparrizar.mnstate.edu/~juan/urania/2007/12/05/macports-failures-under-leopard/#comments</comments>
		<pubDate>Wed, 05 Dec 2007 23:05:15 +0000</pubDate>
		<dc:creator>Juan</dc:creator>
				<category><![CDATA[Command Line Tricks]]></category>
		<category><![CDATA[MacOS X]]></category>
		<category><![CDATA[MacOS X Annoyances]]></category>
		<category><![CDATA[MacPorts]]></category>
		<category><![CDATA[X11]]></category>

		<guid isPermaLink="false">http://iparrizar.mnstate.edu/~juan/urania/2007/12/07/macports-failures-under-leopard/</guid>
		<description><![CDATA[I decided I should clean up my laptop&#8217;s left over digital crap, so I went through my /usr/local directories cleaning out ancient libraries installed two OSes ago (after making a backup first). I decided I would try reinstalling MacPorts under Leopard, if only to build it clean and remove the old source code siting around [...]]]></description>
			<content:encoded><![CDATA[I decided I should clean up my laptop&#8217;s left over digital crap, so I went through my <span style="font-style: italic">/usr/local</span> directories cleaning out ancient libraries installed two OSes ago (after making a backup first). I decided I would try reinstalling <a title="MacPorts homepage" href="http://www.macports.org/">MacPorts</a> under Leopard, if only to build it clean and remove the old source code siting around from various revisions to the packages over time.First, I installed MacPorts from the disk image for Leopard. Then I attempted to install my usual suspects:

<code>sudo port install aquaterm chmdump contacts coreutils curl file findutils g95 ghostscript gv ImageMagick ksh93 latex2rtf lynx macutil osxutils plotutils subversion teTeX tidy vim wget wine xterm xephem</code>

Long story short, almost everything works but there were a few key packages that failed to build under MacOS X 10.5.1. This also reminded me that when a package fails to build, you should &#8220;port clean&#8221; the package (see examples below) before attempting to rebuild it:
<ul>
	<li>I discovered that <strong>teTeX</strong> failed to build. This appears to be due to an undeclared dependancy on <strong>openmotif</strong>. So after the failed install, I just did an<code>sudo port clean --work teTeX; sudo port install openmotif teTeX</code>and teTeX installed just fine.</li>
	<li>In attempting to build <strong>subversion</strong> I discovered that one of the packages subversion needs, sqlite3, fails to install on Leopard. This appears to be due to an undeclared dependancy on <strong>nawk</strong> (MacPorts Report Ticket #13500). So again, all I had to do was:<code>sudo port clean --work sqlite3; sudo port install nawk subversion</code>and it worked. I should note that a fairly recent version of subversion now comes with Leopard, version 1.4.4 (as opposed to 1.4.5 with MacPorts).</li>
	<li><strong>gv</strong> fails to install unless you patch it. This was reported to MacPorts (Bug Report Ticket #13095). <strong>[If</strong> <strong>you check that bug ticket, you will find a new <em>patch-setenv.c</em> file is available there. If you download that file and replace <em>/opt/local/var/macports/sources/rsync.macports.org/release/ports/print/gv/files/patch-setenv.c</em> with it, gv will compile and install just fine.]</strong></li>
	<li><strong>osxutils</strong> fails almost immediately with a series of errors about conflicting types. Since <strong>osxutils</strong> did a lot of meta-data manipulation, I am not completely surprised it is broken under Leopard. I have submitted a bug report to MacPorts.</li>
	<li><strong><span style="text-decoration: line-through;">xterm</span></strong> <span style="text-decoration: line-through;">fails to build</span>. This is irritating because I haven&#8217;t had time to confirm is the old <a href="http://iparrizar.mnstate.edu/~juan/urania/2007/07/19/xterm-tektronix-emulation-broken-on-macos/">xterm Tektronix emulation bug present in the Tiger version of xterm</a> is still present. <strong>[This appears to have been cleared up with MacPorts 1.6 if you install Xquartz over the Apple installed X11 server. Doing this is a good idea anyway.]</strong></li>
	<li><strong><span style="text-decoration: line-through;">wine</span></strong> <span style="text-decoration: line-through;">fails to build</span> (<a href="http://www.nabble.com/build-of-wine-0.9.50-failed-t4938590.html">already reported elsewhere</a>). This has already been reported in <a href="http://trac.macosforge.org/projects/macports/ticket/13488">MacPorts Bug Report Ticket #13488</a>. I wonder if this is related to the possibility being mentioned of <a href="http://www.winehq.org/pipermail/wine-devel/2007-November/060846.html">Leopard having unreported support for Windows binary execution.</a> <strong>[Wine version 0.9.51 DOES compile under Leopard just fine.]</strong></li>
	<li><span style="text-decoration: line-through;">I can&#8217;t build <strong>g95</strong> because <strong>odcctools</strong> fails to compile.</span> This has been reported in <a href="http://trac.macosforge.org/projects/macports/ticket/13148">MacPorts Bug Report Ticket #13148</a>. <strong>[This appears to have been fixed as of January 24, 2008.]</strong></li>
	<li><span style="text-decoration: line-through;"><strong>xephem</strong> fails to build because <strong>lesstif</strong> builds but fails to install. Actually <strong>lesstif</strong> installed fine once I moved <em>/usr/share/aclocal/ac_find_motif.m4</em> out of the way. I don&#8217;t know if that file was there from my previous install of <strong>lesstif</strong>. Once <strong>lesstif</strong> was out of the way, <strong>xephem</strong> failed to build.</span> Interestingly, MacPorts has version 3.7, I downloaded the source for xephem 3.7.2 from the <a href="http://www.clearskyinstitute.com/xephem/">Clear Sky Institute website</a>, compiled it following the installation instructions without a hitch. I submitted a bug report as MacPorts Bug Report Ticket #13524 (turned out my bug report was a duplicate of MacPorts Bug Report Ticket #13498). This has been fixed, <a href="http://iparrizar.mnstate.edu/~juan/urania/2008/03/02/xephem-vis-macports-fixed/">see this post.</a> <strong>[<a href="http://iparrizar.mnstate.edu/~juan/urania/2008/03/02/xephem-vis-macports-fixed/">This appears to have been fixed</a> as of March 3, 2008.]</strong></li>
</ul>
I&#8217;m actually surprised the number of packages that failed to compile seems pretty small.]]></content:encoded>
			<wfw:commentRss>http://iparrizar.mnstate.edu/~juan/urania/2007/12/05/macports-failures-under-leopard/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>HINT: What to do when Keychain-using Apps lock up</title>
		<link>http://iparrizar.mnstate.edu/~juan/urania/2007/08/08/hint-what-to-do-when-keychain-using-apps-lock-up/</link>
		<comments>http://iparrizar.mnstate.edu/~juan/urania/2007/08/08/hint-what-to-do-when-keychain-using-apps-lock-up/#comments</comments>
		<pubDate>Thu, 09 Aug 2007 00:55:36 +0000</pubDate>
		<dc:creator>Juan</dc:creator>
				<category><![CDATA[Command Line Tricks]]></category>
		<category><![CDATA[MacOS X]]></category>
		<category><![CDATA[MacOS X Annoyances]]></category>

		<guid isPermaLink="false">http://iparrizar.mnstate.edu/~juan/urania/2007/08/08/hint-what-to-do-when-keychain-using-apps-lock-up/</guid>
		<description><![CDATA[Like many Macintosh users, the first few months of using MacOS X I wasn&#8217;t even aware of what the Keychain really was.  After a while, you realize just what a cool little piece of security it is.  It ensures many MacOS X programs can securely store passwords and other information without the programmer [...]]]></description>
			<content:encoded><![CDATA[<p>Like many Macintosh users, the first few months of using <a href="http://www.apple.com/macosx/">MacOS X</a> I wasn&#8217;t even aware of what the Keychain really was.  After a while, you realize just what a cool little piece of security it is.  It ensures many MacOS X programs can securely store passwords and other information without the programmer having to be a great cryptographic genius.</p>
<p>One of my favorite programs which exploits this is <a href="http://www.1passwd.com/">1Passwd</a>.  1Passwd stores all your web form passwords (and any other data you care to secure, like credit card numbers or software serial numbers) in a Keychain, so the cryptography is managed by Apple&#8217;s Keychain. Recently, on my iMac at home, 1Passwd started locking up whenever it tried to access it&#8217;s keychain.  Specifically, I have updated 1Passwd so it presented me with a dialog to allow the updated version access to the Keychain.  When I clicked continue, the dreaded rainbox beachball of doom showed up and would not go away.  From that point on, logins to the machine failed and most Apps using the keychain were unable to use the keychain.</p>
<p>I checked the system usage from the command line<br />
<pre>top -u -s 5</pre><br />
and discovered a program called <em>securityd</em> was eating up CPU cycles and RAM.  I called up the manual page on <em>securityd</em> via the command line:<br />
<pre>man securityd</pre><br />
and discovered:</p>
<blockquote><p> securityd maintains security contexts and arbitrates cryptographic operations and Security Authorizations. Access to keychain items is routed through securityd to enforce access controls and to keep private keys out of user process address space.  Authorization calls also communicate with securityd to enforce rules contained in the /etc/authorization database. All user interaction with securityd is mediated through the Security Agent.</p></blockquote>
<p>So by locking up securityd, I was messing up all the cryptographic operations that ran through it.  Great.  I figured there had to be a corrupted file on my computer that was mucking up the works, but where.  My first thought was  a corrupted keychain file, so I checked out my keychains using the &#8220;Keychain First Aid&#8221; item in the <em>Keychain Access</em> (in /Applications/Utilities) [shown in the figure below].</p>
<p><a href="http://iparrizar.mnstate.edu/%7Ejuan/urania/wp-content/media/2007/08/keychainaccess.jpg" title="Keychain Access Example"><img src="http://iparrizar.mnstate.edu/%7Ejuan/urania/wp-content/media/2007/08/keychainaccess.jpg" alt="Keychain Access Example" height="288" width="446" /></a></p>
<p>The files all checked out as intact, so that wasn&#8217;t it.  Something was corrupted on my computer, but what.</p>
<p>Just a Google search on &#8220;securityd&#8221; later, I found the solution on the <a href="http://www.unsanity.org/">Unsanity</a> programmers blog in an article titled &#8220;<a href="http://www.unsanity.org/archives/security/love_tropicana.php">Fix for securityd hogging RAM when reauthorizing apps’ Keychain access</a>&#8220;.  In a nutshell, the corrupted file is a cryptographic database at <em>/var/db/CodeEquivalenceDatabase</em>.  In order to fix this problem they suggest:</p>
<blockquote><p>just open the Terminal (/Applications/Utilities/Terminal) and type:<br />
<pre>sudo mv /var/db/CodeEquivalenceDatabase /var/db/CodeEquivalenceDatabase.old</pre><br />
Upon rebooting, God should be in His Heaven and all should be well with the keychain.</p></blockquote>
<p>And I verified this worked to fix my iMac and all the Keychain apps are happy again.  Excellent!</p>
]]></content:encoded>
			<wfw:commentRss>http://iparrizar.mnstate.edu/~juan/urania/2007/08/08/hint-what-to-do-when-keychain-using-apps-lock-up/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Annoyance: IRAF in Scisoft OSX mkpkg glitches</title>
		<link>http://iparrizar.mnstate.edu/~juan/urania/2007/08/08/hint-iraf-in-scisoft-for-osx-bugs/</link>
		<comments>http://iparrizar.mnstate.edu/~juan/urania/2007/08/08/hint-iraf-in-scisoft-for-osx-bugs/#comments</comments>
		<pubDate>Wed, 08 Aug 2007 19:44:55 +0000</pubDate>
		<dc:creator>Juan</dc:creator>
				<category><![CDATA[Astronomical Software]]></category>
		<category><![CDATA[Command Line Tricks]]></category>
		<category><![CDATA[IRAF]]></category>
		<category><![CDATA[MacOS X Annoyances]]></category>
		<category><![CDATA[SciSoft OSX]]></category>

		<guid isPermaLink="false">http://iparrizar.mnstate.edu/~juan/urania/2007/08/08/hint-iraf-in-scisoft-for-osx-bugs/</guid>
		<description><![CDATA[Update: I have updated this blog entry to reflect some updated information from Nor Pirzkal regarding the best way to fix this glitch.  This problem has been fixed in Scisoft OSX MacIntel version (2007.9.1).
During my adventures compiling the hectospec-related IRAF packages, I was using Scisoft OSX and discovered there were a couple of issues with the [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Update:</strong> I have updated this blog entry to reflect some updated information from Nor Pirzkal regarding the best way to fix this glitch.  This problem has been fixed in <a href="http://www.versiontracker.com/dyn/moreinfo/macosx/20126">Scisoft OSX MacIntel version (2007.9.1).</a></p>
<p>During my adventures compiling the hectospec-related IRAF packages, I was using <a href="http://web.mac.com/npirzkal/iWeb/Scisoft/Scisoft.html">Scisoft OSX</a> and discovered there were a couple of issues with the symbolic links for the <em>mkpkg</em> command necessary for compiling new IRAF packages.</p>
<ul>
<li>In the <a href="http://web.mac.com/npirzkal/iWeb/Scisoft/News/FFF8D4BC-2884-4AD9-AAF2-38920C186CA2.html">Scisoft OSX PPC Beta (2006.11.1b)</a> mkpkg appears to be mis-linked, so it can&#8217;t be executed.  So I did the following in the terminal:<pre>cd /scisoft/binsudo rm mkpkgsudo ln -s ../iraf/iraf/unix/bin.macosx/mkpkg.e mkpkg</pre></li>
<li>In the <a href="http://www.versiontracker.com/dyn/moreinfo/macosx/20126">Scisoft OSX MacIntel version (2007.1.1)</a> and <a href="http://www.versiontracker.com/dyn/moreinfo/macosx/20126">Scisoft OSX MacIntel version (2007.7.1)</a>, there are some missing symbolic links to <em>mkpkg</em> and <em>xc</em> in the directory for MacIntel binaries.  As a result, both <em>mkpkg</em> and <em>xc</em> were instead pointing to PowerPC binaries.  I fixed this as follows (again, from the command line):<pre>cd /scisoft/i386/bin/sudo ln -s /scisoft/all/packages/iraf/iraf/unix/bin.macintel/mkpkg.e mkpkgsudo ln -s /scisoft/all/packages/iraf/iraf/unix/bin.macintel/xc.e xc</pre>This mis-linking certainly didn&#8217;t help getting things to compile under MacIntel, since IRAF was attempting to compile MacIntel code using PowerPC versions of <em>mkpkg</em> and<em> xc</em>.</li>
</ul>
<p>Thanks for Nor Pirzkal for giving me some feedback on fixing this problem.  He tells me he has made the appropriate changes so that the next version of Scisoft OSX will not have this  issue.By the way, my complaint here should in no way be construed as a critique of the efforts of Francesco Pierfedericki and Nor Pirzkal in putting together <a href="http://web.mac.com/npirzkal/iWeb/Scisoft/Scisoft.html">Scisoft OSX</a>. They have done a great deal of work to put together an awesome package.  For two people to track over 2 GB of software and not expect some glitches is unrealistic.  And I for one am extremely grateful that his efforts have saved me a lot of time.</p>
]]></content:encoded>
			<wfw:commentRss>http://iparrizar.mnstate.edu/~juan/urania/2007/08/08/hint-iraf-in-scisoft-for-osx-bugs/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>HINTS: X11 on MacOS X</title>
		<link>http://iparrizar.mnstate.edu/~juan/urania/2007/08/01/some-x11-on-macos-x-hints/</link>
		<comments>http://iparrizar.mnstate.edu/~juan/urania/2007/08/01/some-x11-on-macos-x-hints/#comments</comments>
		<pubDate>Wed, 01 Aug 2007 16:33:54 +0000</pubDate>
		<dc:creator>Juan</dc:creator>
				<category><![CDATA[Command Line Tricks]]></category>

		<guid isPermaLink="false">http://iparrizar.mnstate.edu/~juan/urania/2007/08/01/some-x11-on-macos-x-hints/</guid>
		<description><![CDATA[To quote Apple's X11 Deveoper Note on Installing and Configuring X11 on the Mac:X11 is available as an optional install on the Mac OS X v10.3 Panther, and Mac OS X v10.4 Tiger install disks....  On a fresh Mac, you have to grab your install disks and find the optional installs on it, within that installer is the X11 installer (you may have to Customize your install to see it).]]></description>
			<content:encoded><![CDATA[<p>On the Mac, X11 is part of the optional install. To quote Apple&#8217;s X11 Developer Note on <a href="http://developer.apple.com/opensource/tools/runningx11.html" title="Installing and Configuring X11 Applications on MacOS X">Installing and Configuring X11 Applications on MacOS X</a> on the Mac:</p>
<blockquote><p>
  X11 is available as an optional install on the […] Mac OS X v10.4 Tiger install disks. Run the Installer, select the X11 option, and follow the instructions.
</p></blockquote>
<p>Once you have installed X11, you can launch X11 by going to the <code>/Applications/Utilities/</code> directory and double clicking <code>X11.app</code> (this may display in the Finder as “X11” depending on your settings for showing File Extensions). And now some hints for better X11 usage (these are not in any particular order):</p>
<ol>
<li>If you are an astronomer, you probably use a lot of programs like <em>IRAF, AIPS,</em> or <em>XEphem</em>that need X11. So it probably makes a lot of sense to set it up so that X11 automatically launches when you login. To do this:
<ul>
<li>Open your “Accounts” preference pane in the System Preferences.</li>
<li>Choose the “Login Items” tab within the Accounts pane and then you will see a list of login items (possibly empty).</li>
<li>You can add X11 to this list by pressing “+” at the bottom of the list of login items. This will bring up a dialog to select the file, work your way to the <code>/Applications/Utilities/</code> directory and select X11 and you are done. <strong>NOTE:</strong> On MacOS X Tiger, there is no ability to control the order in which items are launched, so its position on the list is somewhat meaningless.
</li>
</ul>
</li>
<li>There are many hidden preferences in X11 just like in many Mac Applications. You can see a list of the hidden (and not hidden) preferences using the command line tool <code>defaults</code>. To see the available X11 preferences, type:<br />
    <pre><pre>
defaults read com.apple.x11
</pre></pre>In addition to “reading” the preferences, you can write to them. From the command line you can type:</p>
<ul>
<li><code>defaults write com.apple.x11 no_quit_alert true</code>
<p>      This allows X11 to quit without an alert box. Useful if you find it irritating like I do that X11 will prevent me from logging out or the computer from restarting due to that dialog box. However, this does mean you can accidentally quit X11.app pretty easily if you hit cmd-Q at the wrong time.</li>
<li><code>defaults write com.apple.x11 wm_ffm true</code>
<p>      Allows which X11 window is selected to follow the mouse, which is the way X11 behaves under most *nix systems by default.</li>
<li><code>defaults write com.apple.x11 wm_click_through -bool true</code>
<p>      This activates click_thorough events in the Quartz window manager, which allows clicks to pinned windows, another behavior common to *nix X11 installations.</p>
</li>
</ul>
</li>
<li>On the Mac X11 launches the quartz-wm Window Manager and while you can run any other window manager of your choosing, I like it. However, if you modify your <code>~/.xinitrc</code> file, you can control which window manager is launched. If you don&#8217;t have a <code>~/.xinitrc</code> file, copy the default one:<br />
    <pre><pre>
cp /private/etc/X11/xinit/xinitrc ~/.xinitc
</pre></pre>and then manipulate it with any text editor.</p>
</li>
<li>You can launch an X11 application from the Terminal directly if you have set the <code>DISPLAY</code> environmental variable properly or by using the open-x11 command, for example:<br />
    <pre><pre>
xclock &amp;amp;
</pre></pre></p>
<p>will launch the xclock in the background if I have already set the <code>&amp;gt;DISPLAY</code> variable.</p>
<p>    <pre><pre>
open-x11 /usr/X11R6/bin/xclock &amp;amp;
</pre></pre>will do the same without <code>DISPLAY</code> being set.</p>
</li>
<li><strong>BIG LAPTOP USER HINT:</strong> Because X11 on the Macintosh uses authentication to prevent connections from unauthorized sources to the X11 client, something interesting happens when you change IP address, you will discover you can&#8217;t use X11.app from the MacOS X Terminal until you quite and relaunch X11.app. This happens to me all the time on my laptop when I travel and the IP address changes. I recommend either using the Xterm as your terminal or just get used to restarting X11 if you have problems connecting to the terminal.</li>
<li>You can run X11 remotely on your Mac, if you can ssh into your Mac, then just use
<p>    <code>ssh -Y youraccount@yourcomputer.com</code></p>
<p>    the -Y flag should allow you to run X11 remotely as long as <code>X11.app</code> is running on your machine before the connection is made. If your ssh on the remote machine doesn&#8217;t support X11 connections and you have admin access, you can edit the file <code>/etc/sshd_config</code> on the remote machine and make sure X11 Forwarding is turned on by looking for the following lines and making sure they are uncommented and that all “no”&#8217;s are set to “yes”:<br />
    <pre><pre>
X11Forwarding yes&lt;br /&gt;X11DisplayOffset 10&lt;br /&gt;X11UseLocalhost yes
</pre></pre>
  </li>
<li>The X11 Dock icon on the Mac can let you select specific X11 windows when X11 apps are running.<img src="http://iparrizar.mnstate.edu/%7Ejuan/urania/wp-content/media/2007/08/x11_menu.jpg" alt="X11 Menu" />
</li>
<li>Tektronix emulation in xterm is broken under MacOS X (at least in Tiger). To get it functional again, <a href="http://iparrizar.mnstate.edu/~juan/urania/2007/07/19/xterm-tektronix-emulation-broken-on-macos/">see my previous posting about this</a>.
</li>
</ol>
<p>And that is it for the hints for now.</p>
]]></content:encoded>
			<wfw:commentRss>http://iparrizar.mnstate.edu/~juan/urania/2007/08/01/some-x11-on-macos-x-hints/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Annoyance: ksh doesn&#8217;t work on MacOS X Tiger</title>
		<link>http://iparrizar.mnstate.edu/~juan/urania/2007/07/19/ksh-doesnt-work-on-macos-x-tiger/</link>
		<comments>http://iparrizar.mnstate.edu/~juan/urania/2007/07/19/ksh-doesnt-work-on-macos-x-tiger/#comments</comments>
		<pubDate>Thu, 19 Jul 2007 16:38:23 +0000</pubDate>
		<dc:creator>Juan</dc:creator>
				<category><![CDATA[Command Line Tricks]]></category>
		<category><![CDATA[MacOS X]]></category>
		<category><![CDATA[MacOS X Annoyances]]></category>
		<category><![CDATA[MacPorts]]></category>

		<guid isPermaLink="false">http://iparrizar.mnstate.edu/~juan/urania/2007/07/19/ksh-doesnt-work-on-macos-x-tiger/</guid>
		<description><![CDATA[After several days of trying to get the Hectospec folk's specroad package working on my Mac, I realized one of the major problems was that ksh on the Macintosh had a major problem.]]></description>
			<content:encoded><![CDATA[<p>After several days of trying to get the <a href="http://www.cfa.harvard.edu/mmti/hectospec.html">Hectospec</a> folk&#8217;s <a href="http://tdc-www.harvard.edu/instruments/hectospec/software.html">data reduction packages </a>working on my Mac, I realized one of the major problems was that ksh on the Macintosh had a major problem.  Normally, in ksh (korn shell), you can set up a loop to read through a list of objects via a read command within a <span style="font-family: monospace; font-size: 9pt">while..do</span> loop.  For example, to echo a list of files your ksh script could contain<br />
<pre><pre>#!/bin/ksh
ls -1 . | while read fname; do
&nbsp;&nbsp;echo $fname
done</pre></pre><br />
where the <span style="font-family: monospace; font-size: 9pt">read filename</span> bit reads a line from the piped input and assigns the first block of text (before a space) to the variable <span style="font-family: monospace; font-size: 9pt">fname</span>.  Try this script on MacOS X and it produces no output.  &#8220;read&#8221; fails.  This has been documented elsewhere at least twice that I have been able to find with Google, <a href="https://mailman.research.att.com/pipermail/ast-users/2005q4/000730.html">here</a> and <a href="http://gcc.gnu.org/ml/java-prs/2006-q2/msg00355.html">here</a>.  So clearly, there is a serious bug in the installed version of ksh on MacOS X.  I fixed it by updating my ksh using MacPorts, a simple<br />
<pre>sudo port install ksh93</pre><br />
followed by changes in the Hectospec scripts to point to<span style="font-family: monospace; font-size: 9pt">/opt/local/bin/ksh</span> instead of <span style="font-family: monospace; font-size: 9pt">/bin/ksh</span> and I was done.</p>
]]></content:encoded>
			<wfw:commentRss>http://iparrizar.mnstate.edu/~juan/urania/2007/07/19/ksh-doesnt-work-on-macos-x-tiger/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>HINT: Maple from the Command Line</title>
		<link>http://iparrizar.mnstate.edu/~juan/urania/2007/07/18/maple-from-the-command-line/</link>
		<comments>http://iparrizar.mnstate.edu/~juan/urania/2007/07/18/maple-from-the-command-line/#comments</comments>
		<pubDate>Wed, 18 Jul 2007 18:55:18 +0000</pubDate>
		<dc:creator>Juan</dc:creator>
				<category><![CDATA[Astronomical Software]]></category>
		<category><![CDATA[Command Line Tricks]]></category>
		<category><![CDATA[MacOS X]]></category>
		<category><![CDATA[SciSoft OSX]]></category>

		<guid isPermaLink="false">http://iparrizar.mnstate.edu/~juan/urania/2007/02/05/maple-from-the-command-line/</guid>
		<description><![CDATA[Maple is a nice symbolic mathematics pages from the Canadians at Maplesoft.  Our school as a site license which is an awesome deal as students can buy personal copies for much less than the price of a typical textbook.  As such, our students can be expected to use the software for their classes. [...]]]></description>
			<content:encoded><![CDATA[<p>Maple is a nice symbolic mathematics pages from the Canadians at <a href="http://www.maplesoft.com/">Maplesoft</a>.  Our school as a site license which is an awesome deal as students can buy personal copies for much less than the price of a typical textbook.  As such, our students can be expected to use the software for their classes.  One of the really slick bits on the Mac is you can run Maple from the command line (useful when I need to compute an integral quickly).</p>
<p>I am running Maple 11, so I just placed the following alias in my <span style="font-family: monospace; font-size: 9pt">~/.tcshrc</span> file (I run <span style="font-family: monospace; font-size: 9pt">tcsh</span> by default because I am old school and dislike <span style="font-family: monospace; font-size: 9pt">bash</span>):<br />
<pre>alias maple &quot;/Library/Frameworks/Maple.framework/Versions/11/bin/maple&quot;</pre><br />
If you are running the PPC version of SciSoft, it messes around with some environmental variables, breaking this trick, you can instead use<br />
<pre>alias maple &quot;unsetenv DYLD_FALLBACK_LIBRARY_PATH; /Library/Frameworks/Maple.framework/Versions/11/bin/maple; setenv DYLD_FALLBACK_LIBRARY_PATH /scisoft/lib&quot;</pre><br />
If you are using Maple 10, substitute a &#8220;10&#8243; where you see an &#8220;11&#8243; above.</p>
]]></content:encoded>
			<wfw:commentRss>http://iparrizar.mnstate.edu/~juan/urania/2007/07/18/maple-from-the-command-line/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>HINT: Getting AASTeX Installed on a Mac for all users.</title>
		<link>http://iparrizar.mnstate.edu/~juan/urania/2007/07/13/getting-aastex-installed-on-a-mac-for-all-users/</link>
		<comments>http://iparrizar.mnstate.edu/~juan/urania/2007/07/13/getting-aastex-installed-on-a-mac-for-all-users/#comments</comments>
		<pubDate>Fri, 13 Jul 2007 18:20:02 +0000</pubDate>
		<dc:creator>Juan</dc:creator>
				<category><![CDATA[Astronomical Software]]></category>
		<category><![CDATA[Command Line Tricks]]></category>
		<category><![CDATA[LaTeX]]></category>
		<category><![CDATA[MacOS X]]></category>
		<category><![CDATA[MacPorts]]></category>

		<guid isPermaLink="false">http://iparrizar.mnstate.edu/~juan/urania/2007/01/05/getting-aastex-installed-on-a-mac-for-all-users/</guid>
		<description><![CDATA[NOTE: I will assume you have installed teTeX (a modern LaTeX package) in one of a variety of ways.  Personally I recommend either Fink or MacPorts.  However you can get a lot more information about this by visiting the &#8220;Getting Started&#8221; page at the Mac TeX website.
AASTeX is used to help typeset publications [...]]]></description>
			<content:encoded><![CDATA[<blockquote><p><strong>NOTE: </strong>I will assume you have installed teTeX (a modern LaTeX package) in one of a variety of ways.  Personally I recommend either <a href="http://fink.sf.net/">Fink</a> or <a href="http://www.macports.org/">MacPorts</a>.  However you can get a lot more information about this by visiting the &#8220;Getting Started&#8221; page at the <a href="http://www.esm.psu.edu/mac-tex/" title="Mac TeX">Mac TeX</a> website.</p></blockquote>
<p><a href="http://www.journals.uchicago.edu/AAS/AASTeX/" title="AASTeX homepage">AASTeX</a> is used to help typeset publications for all the major astronomical journals (at least in the US).  You have two fundamental options for installing AASTeX on the Mac:</p>
<ol>
<li><strong>Single User Install:</strong> The easiest way is to download AASTeX (the version for LaTeX 2e) from <a href="http://www.journals.uchicago.edu/AAS/AASTeX/" title="AASTeX homepage">http://www.journals.uchicago.edu/AAS/AASTeX/</a> and then just copy the <span style="font-family: monospace; font-size: 9pt">aastex.cls</span> file to whatever directory contains your latex source code for your paper.  It should work just fine if you do that.</li>
<li><strong>Global Install: </strong>If you want to make the AASTeX class file available to all your Mac users, you need to install it globally where the laTeX installation keeps its latex libraries.  The easiest way to do this is to first determine where teTeX keeps its laTeX libraries (referred to as TEXMFMAIN).  One simple way to do this is to type the following from the command line<br />
<pre>texconfig conf | grep TEXMFMAIN</pre><br />
Once you have found that directory, edit the Makefile that comes with AASTeX so that INSTALLDIR equals that directory and fire off a<br />
<pre>sudo make install</pre><br />
Once you have installed AASTeX, run<br />
<pre>sudo texconfig rehash</pre><br />
And you should be set.</li>
</ol>
<p>P.S. &#8211; Most teTeX installs come set to European paper sizes.  If you want US Letter size, just run the configuration program and set US Letter size pages as the default using:<br />
<pre>sudo texconfig</pre><br />
Its text menu driven and pretty straight forward.</p>
]]></content:encoded>
			<wfw:commentRss>http://iparrizar.mnstate.edu/~juan/urania/2007/07/13/getting-aastex-installed-on-a-mac-for-all-users/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>HINT: Sportlight indexing for Perl, PHP, Ruby, and Fortran Coders</title>
		<link>http://iparrizar.mnstate.edu/~juan/urania/2007/07/12/sportlight-hints-for-macos-x-perl-coders/</link>
		<comments>http://iparrizar.mnstate.edu/~juan/urania/2007/07/12/sportlight-hints-for-macos-x-perl-coders/#comments</comments>
		<pubDate>Thu, 12 Jul 2007 17:59:20 +0000</pubDate>
		<dc:creator>Juan</dc:creator>
				<category><![CDATA[Command Line Tricks]]></category>
		<category><![CDATA[MacOS X]]></category>

		<guid isPermaLink="false">http://iparrizar.mnstate.edu/~juan/urania/2006/12/14/sportlight-hints-for-macos-x-perl-coders/</guid>
		<description><![CDATA[This hint is my writeup based on a similar hint at MacOS X Hints for Making Spotlight index PHP files.
I write a lot of perl code using BBEdit, and wanted Spotlight to index my perl files. To do this, a simple modification of the the SourceCode.mdimporter is needed. First find the type (according to
Spotlight) of [...]]]></description>
			<content:encoded><![CDATA[<p>This hint is my writeup based on a similar hint at <a href="http://www.macosxhints.com/">MacOS X Hints</a> for <a href="http://www.macosxhints.com/article.php?story=20050514182520714" title="Make Spotlight Index PHP files">Making Spotlight index PHP files</a>.</p>
<p>I write a lot of perl code using <a href="http://www.barebones.com/">BBEdit</a>, and wanted Spotlight to index my perl files. To do this, a simple modification of the the SourceCode.mdimporter is needed. First find the type (according to<br />
Spotlight) of the files you want indexed, as <span style="font-family: monospace; font-size: 9pt">PerlFile.pl</span> using this command (via the Terminal):<br />
<pre>mdimport -n -d1 PerlFile.pl</pre><br />
which outputs something like:<br />
<pre>Import &#039;PerlFile.pl&#039; type &#039;public.perl-script&#039; no mdimporter</pre><br />
Now take that file type (<span style="font-family: monospace; font-size: 9pt">public.perl-script</span>) and add it to the <span style="font-family: monospace; font-size: 9pt">Info.plist</span> file located at <span style="font-family: monospace; font-size: 9pt">/Library/Spotlight/SourceCode.mdimporter/Contents/Info.plist </span> (If you can&#8217;t find this file, you likely installed Apple&#8217;s MacOS X Developer Tools yet). Add it in the array for <span style="font-family: monospace; font-size: 9pt">LSItemContentTypes</span>.</p>
<p>I added:<br />
<pre><pre>&lt;string&gt;public.perl-scrip&lt;/string&gt;t&lt;string&gt;
public.php-script&lt;/string&gt;&lt;string&gt;
public.python-script&lt;/string&gt;&lt;string&gt;
public.ruby-script&lt;/string&gt;&lt;string&gt;
public.fortran-source&lt;/string&gt;</pre></pre><br />
Now you can index your source code files in one of three ways:</p>
<ol>
<li>Go to a Terminal prompt and type:<br />
<pre>mdimport -r /Library/Spotlight/SourceCode.mdimporter</pre><br />
to process all your source code files and import them into Spotlight&#8217;s database.</li>
<li>Go  to the Terminal and trigger the re-importation of the directory containing your source code using<br />
<pre>mdimport /PathToFiles/ToImport</pre>
</li>
<li>Go crazy and re-import everything on your drive using<br />
<pre>sudo mdimport /</pre>
</li>
</ol>
<p>To see what is going on, add the <span style="font-family: monospace; font-size: 9pt">-d1</span> switch to the <span style="font-family: monospace; font-size: 9pt">mdimport</span> command.</p>
]]></content:encoded>
			<wfw:commentRss>http://iparrizar.mnstate.edu/~juan/urania/2007/07/12/sportlight-hints-for-macos-x-perl-coders/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>First Post</title>
		<link>http://iparrizar.mnstate.edu/~juan/urania/2007/07/12/first-post/</link>
		<comments>http://iparrizar.mnstate.edu/~juan/urania/2007/07/12/first-post/#comments</comments>
		<pubDate>Thu, 12 Jul 2007 14:49:14 +0000</pubDate>
		<dc:creator>Juan</dc:creator>
				<category><![CDATA[Command Line Tricks]]></category>
		<category><![CDATA[MacOS X]]></category>
		<category><![CDATA[Musings]]></category>

		<guid isPermaLink="false">http://iparrizar.mnstate.edu/~juan/urania/?p=3</guid>
		<description><![CDATA[This is my web blog which I will be using mostly to note things of interest to me.  Its not necessarily meant for public consumption and will contain such exciting topics as

The installation of software of interest to astronomers on MacOS X machines (I&#8217;ve had experience getting AIPS, IRAF and Hectospec&#8217;s packages to run [...]]]></description>
			<content:encoded><![CDATA[<p>This is my web blog which I will be using mostly to note things of interest to me.  Its not necessarily meant for public consumption and will contain such exciting topics as</p>
<ul>
<li>The installation of software of interest to astronomers on MacOS X machines (I&#8217;ve had experience getting AIPS, IRAF and Hectospec&#8217;s packages to run under MacOS).</li>
<li>Bugs in the MacOS operating system that need to be crushed in order to run some astronomical software on the Mac.</li>
<li>Notes on neat command line tricks I discover.</li>
<li>Musings on other topics such as teaching or academia.</li>
</ul>
<p>Don&#8217;t expect to see anything too daring yet, I don&#8217;t have tenure.</p>
]]></content:encoded>
			<wfw:commentRss>http://iparrizar.mnstate.edu/~juan/urania/2007/07/12/first-post/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
