Mac OS X Do Not Sleep MAMP Tutorial

Mac OS X Do Not Sleep MAMP Tutorial

Mac OS X Do Not Sleep MAMP Tutorial

The Mac OS X command line (accessible via its Terminal desktop application) is not exactly Unix nor Linux, but more BSD. As such, it has developed some interesting command line commands, some of which we’ve mentioned in the past, and, today, want to start developing a MAMP (local Apache/PHP/MySQL web server) friendly arrangement (via the use of PHP’s exec method), that we may or may not be able to show you relevant live runs for (see more about this later), but can encourage you to download and use on your Mac OS X and MAMP web browser arrangement …

  • “say” — Convert text to audible speech … command, as featured in Mac OS X Text to English Speech Primer Tutorial as shown below
  • “drutil” — Interact with CD/DVD burners … command, as featured in Mac Linux DVD Troubleshooting Primer Tutorial
  • “caffeinate” — Prevent the system from sleeping on behalf of a utility … command, and of Windows comparable interest you might want to read AutoHotKey StayAwake Tutorial
  • “opendiff” — Use FileMerge to graphically compare or merge file or directories
  • “qlmanage” — Quick Look Server debug and management tool
  • “scp” — Secure copy (remote file copy program)

This comes towards addressing a long running wish for us, that being the coalescing of public web application functionality on the rjmprogramming.com.au domain with MAMP local web server web application functionality into the one web application. The reason we’ve decided to try it with the “Zipfiles” project is a bit like the reason we wanted to try it, again with the “Zipfiles” project, with Zipfiles in PHP Media Gallery Synchronize Tutorial is that PHP code sources, several perhaps, of use can be gathered in the one place, downloadable, and it is this downloading capability that is required to make the one menu system to be able to load HTML iframe web applications from either public or “private” local MAMP in the one sitting. There are four user “categories” of possibilitites here, those being …

  • Mac OS X MAMP users of the “Zipfiles” HTTP://localhost:8888/ziptest.php?zipfile=mamptest.zip web application (because they’ve downloaded it to use that way) who will see at least one new “MAMP” button and up to 6 others for those PHP web applications above that they have downloaded off the zipfile with the application, and then used Mac OS X’s Finder to reposition at MAMP’s default document root of /Applications/MAMP/htdocs
  • users of the rjmprogramming.com.au “Zipfiles” live run web application who also have MAMP installed and running, who will see at least one new “MAMP” button and up to 6 others for those PHP web applications above that they have downloaded off the zipfile with the application, and then used Mac OS X’s Finder to reposition at MAMP’s default document root of /Applications/MAMP/htdocs
  • users of the rjmprogramming.com.au “Zipfiles” live run web application who are accessing a zipfile containing any PHP file and who are using Mac OS X but do not have MAMP installed (or do not have it running) will see a link to the MAMP website to encourage you to start the ball rolling
  • users of the rjmprogramming.com.au “Zipfiles” live run web application who are not using Mac OS X, even if they have MAMP installed and are running the web application using that here, will not see any new buttons

Complexity of PHP coding here concerns the differentiation of category 2 users from category 3 users above, and involved, at least for us, jQuery Ajax techniques, specifically involving the great advice from this JSONP request error handling webpage, thanks, to introduce a timeout so that the error handling is given time to be examined regarding error codes, as per code like (for a global Javascript variable lasterr) …


$.ajax({
url: 'HTTP://localhost:8888/MAMP/',
dataType: 'jsonp',
timeout: 5000,
success: function (parsed_json) {
},
error: function (parsedjson, textStatus, errorThrown) {
lasterr=parsedjson.status; // if this is 200 rather than 404 (running) MAMP is possible
}
});

And so here is the PHP ziptest.php source code changed this way to allow for Mac OS X and MAMP afficianados try out those nifty Mac OS X command line gems.

We want to thank this great link for ideas in this line of thinking.


Previous relevant Mac OS X Text to English Speech Primer Tutorial is shown below.

Mac OS X Text to English Speech Primer Tutorial

Mac OS X Text to English Speech Primer Tutorial

We’ve got a few new ideas today …

  1. Text to English Speech via Mac OS X’s command line say command used by PHP via exec to make say.php (which is useful as a download to a Mac OS X laptop using MAMP) which, today, does not have a live run because the web server of domain rjmprogramming.com.au is a CentOS Linux server … Linux equivalent of Mac OS X’s say? … read here
  2. Trying to present this brought up the usual movie production problem with iMovie overlaying the audio on top of the video (though you may want to try, and you could start reading with this link) versus QuickTime Player talent to catch both audio and video tracks (and that we ended up using), but not of the “screen goings on”, alas versus MPlayer OSX Extended which can play separately but not two tracks on top and doesn’t do any reconstituting … so …
  3. Improved on our inhouse Video/Audio synchronizing efforts by allowing audio_video.html supervisor (changed in this way) be able to be called to press one of its preconceived synchronization buttons onload which we do with (the newly added) Macbeth Act 1 Scene 1 … in a small celebration of the Bard … who, am thinking (in that Falstaff way), would have got a huge chuckle out of “anonymous” instead of “anon” during the Three Witches scene … we had to do something to say Happy Birthday

Along the way we tried filming the MacBook Pro with the iPad to a YouTube

… but weren’t happy with the audio quality, alas (too/two).

If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.

This entry was posted in Ajax, eLearning, Event-Driven Programming, Operating System, Tutorials and tagged , , , , , , , , , , , , , , , , , , , , , , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>