Mac X - Virtual Desktop, or "Spaces"

by 5. March 2011 02:51

I configured my Mac's Remote Desktop connection to my Windows 7 box to use full screen on my second monitor.   This works great because I can have both my Apple and Microsoft environments accessible at the same time; particularly useful since I have a heavy investment in software, such as image editors, that I would like to continue to use.

The issue comes when I want to use my second monitor for my Xcode screens, I can overlay them on my remote desktop screen but if I inadvertantly click on it my Xcode screens will be hidden.   Fortunately Mac OS X has spaces (virtual desktop) capabilities built in!

If you click on System Preferences and "Expose & Spaces" you will find you can quickly setup this very powerful feature!

I enabled both checkboxes which gave me a space indicator on the top bar - I can either use this or the Command-1, Command-2, etc., etc., to switch between spaces.   I'll load remote desktop in space 1 and then click Command-2 to go to my second space (note I switched from the default control keys to command keys - see bottom arrow) When I need the remote desktop I simply hit Command-1.


Mac X

MAC OS X - remote desktop into Microsoft Windows 7 machine

by 5. March 2011 00:49

If you told me a year ago I'd be programming on an Apple I would have laughed at you, even though I started with an Apple][C (programming 65C02 assembly), I have been a loyal Microsoft developer/crony for over 20 years.  BUT, I have to keep up with the times and programming for the IPhone and IPad is something that will be beneficial to clients - so it was time to go to "the dark side".  

It is not as painful as I thought it would be and I'm actually starting to enjoy the Mac environment and am looking forward to learning the infrastructure, Xcode development environment and Objective-C.   After a $1,500.00 dollar investment for a MacPro laptop (13 inch), a Magic Mouse and Keyboard I have a modest start.   I was extremely pleased to find that my USB DisplayLink had a driver for Mac so I get to continue to enjoy my dual screen development environment on my Mac laptop as easily as my HP laptop using my 22 inch flat screen as the second monitor.

Coming from the HP world the Magic Mouse was an excellent investment, I have my scrolling, left, and right click capabilities (I was lost without a right click).  The keyboard was another excellent investment because it gave me my numeric keypad - I'd recommend both if, like myself, you are coming from the HP world.

With my sleeves rolled up and my Mac now connected to my server more, all I needed was access to the tools that I'm use to having - such as my image editors.

Enter stage left - Remote desktop connection for the Mac, provided by Microsoft!   Where my MSDN professional subscription did not provide it I was excited to see that my Technet subscription did!  I downloaded the "Office for Mac Home and Business 2011" and happy to find that I now have Word, Xcel, PowerPoint, Microsoft Document Connection, and of course Remote Desktop! 

Once installed you can execute the Remote Desktop Connection and while the window is open setup the preferences from the RDC menu.   I have use my second monitor (full screen) for my Microsoft platform, this is convenient because I can still use it for the Mac side.

In addition to the following settings I also selected the "Drives" menu option and have it share all drives - this way I can save directly to the Mac from my Microsoft environment.

Tags: ,

Mac X

MAC OS X - Connecting to Windows Shares

by 5. March 2011 00:18

I have a heavy investment in my Microsoft development environment, to include image editors, that I don't want to have to duplicate in my Apple development environment.  Fortunately with a few steps I was able to easily share resources.

Open up the Finder window and hold the Command key and press K

You will see the following window where you can browse or specify the server you want to connect to.  The MAC syntax is to preceed the server with "smb://" as shown below.   I hit the + button and added it to my server volume list.

In case your curious this is accessible from the Finder's GO Menu

Once you connect to a share you will be able to access it via a new icon (BDrive below) or from the /Volumes folder.   Below I do a directory listing (ls -l) to view the contents of the /volumes/bdrive/apple folder structure that I created on my GWNServer for apple files.

To make image editing easy for I make an alias of the Images folder, drag it to the desktop, rename it to simply show "Images", and then I delete the alias (Images alias) below.

For blogging all I have to do is hit Command-Shift-4, which provides me a cross-hatch cursor, that I can drag until I captured the screen area I am interested in and when I let go of the mouse button my image appears on the desktop.   I simply drag it to my Images icon on the desktop (above) and delete the desktop version. 



Mac X

MAC OS X - Showing hidden files in Finder

by 5. March 2011 00:00

If we do a directory list "ls -l" we'll find that it displays the same contents as the Finder.

If we do a directly listing using "ls -al" then we get different results - it also shows hidden files (prefixed with a period - see above).

 Under your home directory you will have a library/preferences folder, from the terminal you can type in "cd library/preferences" to get to it.  This folder holds the configuration options for the various applications.   We are interested in the configuration file.

You can use the "defaults write" command to programmatically set values in this file; in my case the file didn't exist so I found by executing the following - it created it:

defaults write AppleShowAllFiles -bool true

Likewise you can disable it by setting -bool false.   Once the file exist you can easily update the AppleShowAllFiles configuration, as well as others, using the open command, e.g.,

open library/preferences/  (as shown below)

In order for this change to take affect the Finder must be restarted.  To do this simply hit the Command-Option-ESC key, select the Finder, and click the relaunch button.  You'll find that when you click on Finder that you will be able to see all files to include hidden ones.


Mac X

MAC OS X - creating an executable file

by 4. March 2011 11:59

After clicking on the Terminal icon you will be greated with a "Terminal - bash" prompt.   As a minimum there a few commands that you should be familiar with:

  • ls -l ....... directory listing of files
  • ls-al ...... directory listing of files including hidden files (prefixed with .)
  • rm ........ remove a file
  • rm -R .... remove a directory
  • mkdir .... make a directory
  • cd ......... change directory
  • cp ......... copy file
  • mv ........ move file
  • set ........ show environment variables
  • ~ home path (/Users/loginName)
  • .  current directory (single dot)
  • .. prior directory  (double dot)

Let's create a HelloWorld script. 

Start by typing "pico HelloWorld" and hit enter (as shown in image below)

Type in "echo hello world!" as shown above.

Hold Ctrl key and press X (to Exit).  When prompted to save modified buffer answer "Y" for yes.   Hit enter to accept the name "HelloWorld".

Type in "ls -l" and hit enter, you should find your file in the list with -rw-r--r-- (read write) priviledges.

Execute the "chmod 755 HelloWorld" command which assigns E"x"ecute permission for the newly created script.

If you attempt to run this command by typing "HelloWorld" and hitting enter you will most likely (default configuration) be greeted with a "command not found".   Oddly, the operating system doesn't look in the current directly for commands unless you specifically specify "this location" by using the dot command, e.g., "./HelloWorld" will work.

Obviously this is not practical so I made some easy configuration changes that make my life simpler. 

Execute "pico .bash_profile" and add ".:~/bin:$PATH" to the export Path command (ensure there is no space between PATH and the equal sign) as shown in the image below.

The colon is a delimiter between paths (to search for commands in) and the dot tells it to search the current path, preventing you from having to use ./mycommand.   The ~/bin assumes you created a bin command (md bin) which you can easily use to place your scripts in.  For example:

cp HelloWorld bin 

would copy the HelloWorld executable script to the bin folder, now you can execute it from anywhere in the system.  

The $PATH statement indicates that you want the existing path to be appended to the newly assigned path.

Notice below that in the PATH statement that the "~/bin" was transformed into the actual location "/Users/Bill/bin".

Tags: ,

Mac X

Using Subversion with Xcode 3 - automated script

by 4. March 2011 11:11

The following link explains how to prepare your SVN repository for use by Xcode 3:

Where there aren't a lot of steps to setting up SVN to work with Xcode, it is far more than I'm use to so I created a script - now I can simply click on a desktop link and use GUI tools to get a new Xcode project hooked up with SCM (Source Code Management) within a few minutes.  The script follows:

makescm (1.89 kb)

When you launch the script from your desktop you will be prompted for the name, i.e., MyProject (highlighted below).  If you type in a name that already exists (DevUtil) then you will be prompted to overwrite.   After hitting enter you will be greated with the options to create the repository for the project or to abort - input 1 to create.

Once created go to "Using Subversion from Xcode" (in link referenced above) which is just above Figure 10 and comply with the steps.   If you encounter an error 210002 while complying with the steps in figure 11 then you'll want to read THIS BLOG for the work-around.

Recommended reading

Tags: , ,

XCode | Mac X

Error: 210002 (Network connection closed unexpectedly) How to setup SVN on MAC OS X

by 27. February 2011 13:13

If you followed the instructions for Using Subversion with Xcode 3 on Mac OS X Leopard (for Mac OS X 10.6) you were probably greeted with an error 210002 when attempting to comply with the step for configuring the SCM (Source Control Management).

Note: to find your hostname, i.e., "macbook" in //bill@macbook/, click on the Apple (top left), click on System Preferences, and finally click on Sharing; the "Computer Name:" is your hostname.

If you Bing this error you will find you are not alone and there are many dead-end trails with none revealing the true source of the problem.

The workaround is not to use svn+ssh (its a bug - I'll explain more below) but to simply use the file location (assuming you can use local use as I am doing).  Later when development starts getting serious I will use a server share instead of local file access (in case I should lose the harddrive).   This should be a good work-around if you were going to be using svnserve (pre-installed on Leopard with quick setup).

The real problem is hidden by the generic "catch all" error message.   To narrow down the real problem I started by running "URL" (in image above) from the terminal prompt.   The first error "Killed by signal 15" was caused because I used an upper case in my login Bill@macbook (see below).  Once I used lower case I got the real error "permission denied"

from there I opened the security log (/private/var/log/secure.log) as shown in the image below and got to see what the real error was.  Binging this error CLICK HERE  reveals there is an issue with updates made to Kerberos for 10.6.4.

Tags: , ,

XCode | Mac X


Blog videos and references to CodePlex projects are no longer valid