Tagged: MacOS Toggle Comment Threads | Keyboard Shortcuts

  • jess 10:42 pm on October 4, 2014 Permalink | Reply
    Tags: MacOS   

    OSX turn off or delay hibernate 

    Apple’s Mac OSX hibernate can be delayed indefinitely or turned off by issuing this terminal command.

    sudo pmset -a hibernatemode 0

    To get back to default normal hibernate mode type this terminal command.

    sudo pmset -a hibernatemode 3

    So the word is this won’t disable hibernate on battery failures. Haven’t tested, hope I won’t have to.

  • jess 2:13 pm on June 5, 2012 Permalink | Reply
    Tags: Compass, MacOS, Ruby, Susy   

    Here’s the source article http www frederico araujo… 

    Here’s the source article:

    My goals here are to update an environment and move to a new Susy release: http://susy.oddbird.net/

    1. Install and upgrade XCode from the Mac App Store (4.3.2 in this case). Also install the Command Line Tools found in the Preferences pane.

    2. Install Homebrew. Not entirely necessary, but I’m enjoying it lately.

    Install Homebrew Package Manager
    $ /usr/bin/ruby -e "$(/usr/bin/curl -fsSL https://raw.github.com/mxcl/homebrew/master/Library/Contributions/install_homebrew.rb)"

    3. Install RVM – Ruby Version Manager

    // Install RVM
    $  bash -s master < <(curl -s https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer)
    // Reset some paths
    $ echo '[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm" # Load RVM function' >> ~/.bash_profile
    // Run to reset your open terminals
    $ source ~/.bash_profile
    // Make sure RVM is updated
    $ rvm get stable
    // Had to do a reinstall for Ruby stable
    $ rvm reinstall 1.9.3-p194
    // Use Ruby 1.9.3-p194
    $ rvm use 1.9.3-p194 --default
    // Check my ruby version
    $ ruby -v

    4. Install Compass

    // Make sure all is good
    $ sudo gem update --system
    // Some XML Tools
    $ sudo gem install builder
    // Install Compass
    $ sudo gem install compass
    // Here's where things went wacky, so Installed the kitchen sink - over-install-panic-attack!
    $ sudo gem install haml
    $ sudo gem install haml-edge
    $ sudo gem install rails
    // Oh it's a damn bug see: 
    // http://stackoverflow.com/questions/10610254/cant-install-compass-via-rvm
    $ rubygems-bundler-uninstaller
    // Test Compass
    $ compass version

    5. Install my favorite Compass add-ons

    // Oily_PNG to for sprite creation performance
    $ sudo gem install oily_png
    // Susy because grids are awesome - Now this will install some alpha SASS and Compass code but why not.
    $ sudo gem install susy --pre
    // Normailze CSS sortof-reset
    $ sudo gem install compass-normalize
  • jess 7:56 pm on June 11, 2010 Permalink | Reply
    Tags: , MacOS,   

    Mac OSX 10.6 Shell Script to Configure, Launch, and Shutdown Screen Sharing 

    Apple’s MacOS has a tidy built in remote access client and service generically known as “Screen Sharing”. Yay! This works great for headless machines, testing servers, and annoying your spouse. The paranoid and performance conscious user may not want these services continuously running. Rogue services hanging out, listening, and waiting for some punk to probe them in an Internet dark alley. This cobbled together shell script might be for you!

    This shell script has four simple commands (I use sudo because I really should):

    • # sudo ./share-screen.sh start
    • # sudo ./share-screen.sh stop
    • # sudo ./share-screen.sh allow {username}
    • # sudo ./share-screen.sh deny {username}

    I use this in terminal. Make sure you put a copy of this script on the target machine and make it executable. First I make sure that Remote Login is active on the target computer. It’s under Sharing in System Preferences. Then I login remotely using ssh. I fire up the script, activate Screen Sharing, do my business, shutdown Screen Sharing, log off, and go home.

    Of course, no warranty, no guaranty. Good Luck!

    if [ $# == 0 ]; then
    	echo  "Commands: start, stop, allow <username>, deny <username>"
    case "$1" in
    		echo 'Starting Remote Access'
    		# Activate Apple Remote Access with current settings
    		sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart -activate
    		echo 'Stopping Remote Access'
    		# Deactivate Apple Remote Access
    		sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart -deactivate -stop
    		if [ -z "$2" ]; then
    			echo  "ERROR: Provide a valid user"
    		sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart -configure -allowAccessFor -specifiedUsers
    		sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart -configure -access -on -privs -all -users ${2}
    		if [ -z "$2" ]; then
    			echo  "ERROR: Provide a valid user"
    		sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart -configure -allowAccessFor -specifiedUsers
    		sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart -configure -access -off -privs -none -users ${2}  

    I almost forgot. Credit where credit is due! Inspiration from these articles and resources:


  • jess 1:08 pm on April 14, 2010 Permalink | Reply
    Tags: AppleScript, Email, MacOS   

    My Reply to E-mail with Text File AppleScript 

    At work I deal with a large volume of e-mail. There just aren’t enough people to handle all the e-mail requests or questions. When I have people to help handle e-mail, I still answer some of the same questions over and over and over. You just don’t want to know the volume or scope of my daily e-mail chores.

    As a long time MacOS user I have repeatedly turned to AppleScript as a useful tool for dealing with making the same e-mail replies constantly (the real solution is to fix the breakdown in communication, but that’s a whole other story). Here is the most recent incarnation of my AppleScript solution using Apple Mail on MacOS 10.6.

    My solution is simple; Highlight the message, run the script, select a pre-written text file to include, customize the reply, and send. The respondent gets a solution or reply that is usually edited over time for clarity, and I get to customize it a bit so it doesn’t seem too much like an auto-reply.

    tell application "Mail"
    	set theSelection to selection
    	set theSelectedMessage to item 1 of theSelection
    	set theSelectedMessageSender to sender of theSelectedMessage
    	set theSelectedMessageSenderName to extract name from sender of theSelectedMessage
    	set theSelectedMessageSenderAddress to extract address from sender of theSelectedMessage
    	set theSelectedMessageSubject to subject of theSelectedMessage
    	set theSelectedMessageContent to content of theSelectedMessage
    	set myHomeDefault to the path to home folder
    	set myHomeDefault to myHomeDefault & "nicholls:Documents:e-mail_templates:" as text
    	set myHomeDefault to myHomeDefault as alias
    	set myTemplateFile to (choose file with prompt "Select E-mail Template File:" of type {"TEXT"} default location myHomeDefault)
    	open for access myTemplateFile
    	set prefsContents to read myTemplateFile using delimiter {"#--#"}
    	close access myTemplateFile
    	set MessageText to item 1 of prefsContents
    	set theMessage to make new outgoing message with properties {visible:true, subject:"Re: " & theSelectedMessageSubject, content:MessageText & theSelectedMessageContent}
    	tell theMessage
    		make new to recipient at end of to recipients with properties {name:theSelectedMessageSenderName, address:theSelectedMessageSenderAddress}
    		make new bcc recipient at end of bcc recipients with properties {name:"Website Manager", address:"nichweb@nicholls.edu"}
    	end tell
    end tell

    This is a sample text file I might use. I made this really basic. You should note the #–# deliminator used. I have that so I can do some other interesting things with the templates, like BCC: my boss if I have too. Anyway this would be saved something like email-reply-standard.txt and I would load it through the dialog created by the script when it runs.

    Thank you for your interest!
    If you have further questions, please let me know.
    Jess Planck
     Nice Signature with phone 
     Probably has the website too
    ----[ Your Original Message Follows ]----

    For some reason the syntaxhighligher I’ve got here doesn’t like AppleScript comments, so I’ve removed them.

    • Perrine 4:38 am on January 27, 2012 Permalink

      Hi Jess,

      I am completely new with AppleScript, but I really need to automate some answers in Mail. However, Automator does not have a “Reply to” for Mail (only for Outlook) so I understood I’d need to use AppleScript.

      Is there any chance you’d explain this to me with a lot of details?
      (For example > how do I first create and save my e-mail templates, etc).
      Detailing each step would be really helpful !

      Thanks in advance for your help,


Compose new post
Next post/Next comment
Previous post/Previous comment
Show/Hide comments
Go to top
Go to login
Show/Hide help
shift + esc