Content

The discovery, acceptance & management of life's gaps

SAFE Solutions – Project Team Principles

Sunday 17 February 2013 - Filed under Communication + gaps + GTD + project management + Teams + Technology

The SAFE acronym is a reminder that the most effective solutions are Simple, Affordable, Flexible and Efficient.

Simple – It is good to be a “solutions” provider, it’s even better to be a provider of “simple solutions.” The most successful technology project/solution teams provide their customers with not only the simplest solutions possible, but further simplify technology use and integration through appropriate training, documentation and support.

(Appropriately) Affordable – Responsible solution design/planning dictates a balance between providing the least expensive and most technically-sophisticated solution. Just as the cheapest option may not meet operational objectives, an over-engineered solution can impair cost/profit objectives. The cost of any solution must be weighed against the value it provides. The solutions that provide the greatest return on investment are ultimately the most “appropriately affordable.”

Flexible – Solutions need to be as flexible as possible, providing customers with the greatest range of options and opportunities to leverage technology. In order to provide flexibility you must understand what the customer needs today, but look towards what they will require tomorrow. In order for technology solutions to be flexible, technology teams must remain flexible, always looking to improve and adapt. Rigid formality must be replaced with planned flexibility.

Efficient – The commitment to efficient solutions requires that business needs be clearly identified/communicated and resulting requirements exceeded. Highly-effective solutions come when your efforts are tightly coordinated with the people and processes they affect. Truly efficient solutions deliver the greatest impact while consuming the least amount of resources during use and delivery. They carry with them the responsibility of delivering on the targeted objectives and the additional burden of not derailing other efforts.

How to leverage the SAFE acronym…
When planning for, designing, or in any way helping to deliver solutions, the SAFE acronym reminds us…
S. (Simple) … to keep all communication simple/easy to understand, and all solutions simple to use.
A. (Affordable) … affordable solutions mean… those that have to use them can afford to use them.
F. (Flexible) … to remain flexible and open to new ideas so the solutions we offer are appropriately flexible.
E. (Efficient) … that a complete/clear understanding of business need, available options and an empathetic/balanced implemention is essential to delivering the most efficient and productive solutions.

 ::  Share or discuss  ::  2013-02-17  ::  Russ Leseberg

Running AppleScript from the Command Line

Saturday 31 March 2012 - Filed under automation + gaps + Technology

Running AppleScript, and thus AppleScrunix, from the command line is quite simple. The command is osascript, see the osascript(1) Mac OS X Manual Page for more information. Open the application “Terminal” and type “osascript” followed by a space at the prompt ($). Next type the full path to the script or simply drag the script icon onto the terminal window and let terminal insert the path. The final command should look like below.


$ osascript /path/to/script.scpt

 ::  Share or discuss  ::  2012-03-31  ::  Russ Leseberg

AppleScript | AppleScrunix – Syncing Two Folders [Directories]

Monday 27 February 2012 - Filed under automation + gaps + Technology

In this AppleScrunix sample we combine AppleScripts ability to easily add user interaction in selection of a folder/directory, with the power of the Unix command rsync. rsync is a highly versatile and powerful tool. Spend some time reviewing the man page for rsync and you will see what I mean.

The following snippet is ready to run. Just copy and paste into AppleScript Editor:

set sDir to POSIX path of (choose folder with prompt "Select source")

set dDir to POSIX path of (choose folder with prompt "Select destination")


do shell script "rsync -zrtpl –stats –delete -e ssh " & quoted form of (sDir) & " " & quoted form of (dDir)


I am not going to explain anything in this post about the script’s construction, syntax or arguments. I plan to delve into these matters in subsequent posts. However, if you have specific questions, I will be happy to answer them.


For this exercise use two folders. The first one is your source directory/folder and contains the files and folders you want synchronized. The second one is empty. If you run the script in the editor you will get feedback like below in the result box. Run the script… First Run shows the number of files transferred when syncing the first time. Run it again… Second Run shows the number of files transferred when syncing the second time. Note that it is zero. rsync compared the two folders and saw there were no changes so no files needed to be updated.


First Run:
Number of files: 168
Number of files transferred: 139
Total file size: 48894704 bytes
Total transferred file size: 48894654 bytes
Literal data: 48894654 bytes
Matched data: 0 bytes
File list size: 3470
File list generation time: 0.001 seconds
File list transfer time: 0.000 seconds
Total bytes sent: 48910444
Total bytes received: 3252

sent 48910444 bytes received 3252 bytes 32609130.67 bytes/sec
total size is 48894704 speedup is 1.00


Second Run:
Number of files: 168
Number of files transferred: 0
Total file size: 48894704 bytes
Total transferred file size: 0 bytes
Literal data: 0 bytes
Matched data: 0 bytes
File list size: 3470
File list generation time: 0.001 seconds
File list transfer time: 0.000 seconds
Total bytes sent: 3486
Total bytes received: 20

sent 3486 bytes received 20 bytes 7012.00 bytes/sec
total size is 48894704 speedup is 13946.01


4 comments  ::  Share or discuss  ::  2012-02-27  ::  Russ Leseberg

A Dance with ThunderBolt – Update 2

Saturday 31 December 2011 - Filed under automation + gaps + Technology

At the stroke of midnight tonight, I will have completed 3 full months of testing of a real-time web tracking solution that depends heavily on ThunderBolt technology. Though I continue to be plagued with drive issues, a single drive has been fast enough to deal with the current read/write requirements.

Tagged: » » »

 ::  Share or discuss  ::  2011-12-31  ::  Russ Leseberg

A Dance with ThunderBolt – Update

Wednesday 30 November 2011 - Filed under automation + gaps + Technology

Initial testing of the LaCie ThunderBolt drives on a MacMini Server looked pretty good… That is after I returned the fist MacMini Server that had a dead Thunderbolt port. More in the next day or so….

Tagged: » » »

 ::  Share or discuss  ::  2011-11-30  ::  Russ Leseberg

A Dance with ThunderBolt

Monday 31 October 2011 - Filed under automation + gaps + Technology

Lacie Little Big Disk - ThunderBoltI began testing Lacie’s Big Little Disk ThunderBolt drives this last week. Lacie makes some pretty big claims for these little guys and I am determined to find out if they measure up. I have several coding projects in the hopper that will definitely put them to the test. More soon.Lacie Little Big Disk - ThunderBolt - Performance Chart

Tagged: » » »

 ::  Share or discuss  ::  2011-10-31  ::  Russ Leseberg

iPirate – The Bucs Go iPad

Wednesday 31 August 2011 - Filed under gaps + mobile + Teams + Technology

A month before the launch of Apple’s original iPad, I predicted that sports teams would replace their playbooks with the tablet computer, see Countdown to iPad – Playbook (Use Case 18).

Recently the Tampa Bay Buccaneers bought iPads for their players to do just that, see Tampa Bay Buccaneers buy each player an iPad to hold playbook, videos.

As further predicted, the Buccaneer coaches and players not only watch plays on the iPads, but if the devices are ever lost, “You’ve got a way to wipe (everything) off with the push of a button,” according to Tampa Bay Bucs Coach, Raheem Morris. ~ quote from tampabay.com article.

iPad: Team Player


In the Countdown to iPad Series (early 2010), I presented possible use cases for the amazing device that had yet to be released into the wild. Now that iPads have been with us for more than a year, it’s interesting to see just how many predictions have come true.


iPad – Copyright © 2010 Apple Inc. (www.apple.com)

Tagged: » » » » » » » »

 ::  Share or discuss  ::  2011-08-31  ::  Russ Leseberg

AppleScript | AppleScrunix – Listing files in a folder

Tuesday 26 July 2011 - Filed under automation + gaps + Technology

One of the most common uses for AppleScript, and thus AppleScrunix, is to process files in a folder/directory. In order to process them you must first list the files. Though I find the listing of a folder of files, just as easy using straight AppleScript as I do with AppleScrunix, I much prefer the variations of returned lists in AppleScrunix.

A simple file listing in AppleScript looks like:

tell application "System Events" to set fileList to name items in folder "/Users/avail/Desktop/PDFs"


Result: {“001_FILENAME.PDF”, “001_FILENAME.txt”, “002_FILENAME.PDF”, “003_FILENAME.PDF”, “004_FILENAME.PDF”, “010_FILENAME.PDF”, “011_FILENAME.PDF”, “016_FILENAME.PDF”}

The same example in AppleScrunix looks like:

set fileList to paragraphs of (do shell script "ls /Users/avail/Desktop/PDFs/")


Same Result: {“001_FILENAME.PDF”, “001_FILENAME.txt”, “002_FILENAME.PDF”, “003_FILENAME.PDF”, “004_FILENAME.PDF”, “010_FILENAME.PDF”, “011_FILENAME.PDF”, “016_FILENAME.PDF”}

If all I had gained was a slightly shorter line of code it wouldn’t be worth it. However, now that we have entered the world of AppleScrunix, we can leverage the power of unix commands with just a few additional characters.

Simply adding an asterisk to my command, I get a list of file paths and not just file names:

set fileList to paragraphs of (do shell script "ls /Users/avail/Desktop/PDFs/*")


Result: {“/Users/avail/Desktop/PDFs/001_FILENAME.PDF”, “/Users/avail/Desktop/PDFs/001_FILENAME.txt”, “/Users/avail/Desktop/PDFs/002_FILENAME.PDF”, “/Users/avail/Desktop/PDFs/003_FILENAME.PDF”, “/Users/avail/Desktop/PDFs/004_FILENAME.PDF”, “/Users/avail/Desktop/PDFs/010_FILENAME.PDF”, “/Users/avail/Desktop/PDFs/011_FILENAME.PDF”, “/Users/avail/Desktop/PDFs/016_FILENAME.PDF”}

What if I just want to list the pdf files and not the text (txt) files? By just adding ‘*PDF’ I get the desired result:

set fileList to paragraphs of (do shell script "ls /Users/avail/Desktop/PDFs/*PDF")


Result: {“/Users/avail/Desktop/PDFs/001_FILENAME.PDF”, “/Users/avail/Desktop/PDFs/002_FILENAME.PDF”, “/Users/avail/Desktop/PDFs/003_FILENAME.PDF”, “/Users/avail/Desktop/PDFs/004_FILENAME.PDF”, “/Users/avail/Desktop/PDFs/010_FILENAME.PDF”, “/Users/avail/Desktop/PDFs/011_FILENAME.PDF”, “/Users/avail/Desktop/PDFs/016_FILENAME.PDF”}

Or, what if I just want to list the files numbered between 010 and 019? By just adding ’01*’ I get the desired list of files:

set fileList to paragraphs of (do shell script "ls /Users/avail/Desktop/PDFs/01*")


Result: {“/Users/avail/Desktop/PDFs/010_FILENAME.PDF”, “/Users/avail/Desktop/PDFs/011_FILENAME.PDF”, “/Users/avail/Desktop/PDFs/016_FILENAME.PDF”}

Study the man page for ‘ls’ and you will find a treasure trove of small command modifications that will make a big difference in your solutions.


AppleScript / AppleScrunix Examples – using the do shell script command in AppleScript.

 ::  Share or discuss  ::  2011-07-26  ::  Russ Leseberg

Using Applescript & Python To Set Title Case (AppleScrunix)

Thursday 30 June 2011 - Filed under automation + gaps + Technology

One way in which Apple has turned the Mac into the most powerful scripting/automation platform on the planet has been to provide a litany of scriptable languages as part of the standard install. Just some of the languages you will find in Mac OS X are JavaScript, Ruby, Python, and of course AppleScript. I refer to the mashing all these languages together as AppleScrunix.

Each of the languages has strengths and weaknesses. By bringing them all together on a single platform, and making it easy for them to be used together, Apple has put an amazing amount of automation power in our hands.

As shown in previous posts AppleScrunix allows me to work primarily in AppleScript and draw from other languages when my scripting language of choice comes up a bit short.

I often run across the need to do ‘simple’ title case conversion. ‘Simple’ meaning every word in the title has its first letter capitalized and all remaining letters are lowercase. Though this is possible using only standard AppleScript, the project quickly becomes complicated and ends up running slower than it needs to.

If you are interested in solving this problem just using AppleScript, you can get much of the code you need from my previous post, Applescript – Converting Uppercase & Lowercase (AppleScrunix Style).

Or you can do it using AppleScrunix and just 2 lines of code. I have messed up the title ahead of time to make it more interesting… thIs is thE stORY of a GIRL becomes This Is The Story Of A Girl.

Begin Script…

set myTitle to "thIs is thE stORY of a GIRL"

do shell script "python -c \"print " & quoted form of (myTitle) & ".title()\""


…End Script

Result: “This Is The Story Of A Girl”


AppleScript / AppleScrunix Examples – using the do shell script command in AppleScript.

2 comments  ::  Share or discuss  ::  2011-06-30  ::  Russ Leseberg

Applescript – Converting Uppercase & Lowercase (AppleScrunix Style)

Thursday 26 May 2011 - Filed under automation + gaps + Technology

As there are no built-in routines for changing the case of characters in AppleScript, the coder is required to add their own handlers. The following script (See credits below) shows one way to use AppleScript to change the names of files in a folder from lowercase to uppercase & vise-versa.

Begin Script…

tell application "Finder" to set the source_folder to choose folder


tell me to activate


display dialog "Change case to:" buttons {"Cancel", "UPPER", "lower"}

set the button_pressed to the button returned of the result

tell application "Finder"

repeat with this_item in entire contents of source_folder

set the current_name to the name of this_item as text

if the button_pressed is "lower" then

set the name of this_item to my change_case ( the current_name , "lower")

else

set the name of this_item to my change_case ( the current_name , "upper")

end if

end repeat

end tell

display dialog "Process complete"


-- AppleScript 'change_case' handler

on change_case ( this_text , this_case )

if this_case is "lower" then

set the comparison_string to "ABCDEFGHIJKLMNOPQRSTUVWXYZ"

set the source_string to "abcdefghijklmnopqrstuvwxyz"

else

set the comparison_string to "abcdefghijklmnopqrstuvwxyz"

set the source_string to "ABCDEFGHIJKLMNOPQRSTUVWXYZ"

end if

set the new_text to ""

repeat with thisChar in this_text

set x to the offset of thisChar in the comparison_string

if x is not 0 then

set the new_text to ( the new_text & character x of the source_string ) as string

else

set the new_text to ( the new_text & thisChar ) as string

end if

end repeat

return the new_text

end change_case


…End Script

The following handler ‘change_case’ was rewritten using AppleScrunix. Not only is there less code, but the script runs faster. Replace the AppleScript version of the handler in the above script with the unix based handler below.

Begin Handler…

-- AppleScrunix 'change_case' handler

on change_case ( this_text , this_case )

if this_case is "lower" then

set the new_text to do shell script "echo " & quoted form of ( this_text ) & " | tr A-Z a-z"

else

set the new_text to do shell script "echo " & quoted form of ( this_text ) & " | tr a-z A-Z"

end if

return the new_text

end change_case


…End Handler

The above AppleScrunix example uses shell command ‘tr’ to translate uppercase to lowercase, etc. Refer to the tr Mac OS X Man (Manual) Page for other uses.


Credits: I picked up the initial example script almost verbatim from Apple Support Communities. It was posted by a user I only know as V.K., on April 16, 2009 @ 10:13 am. ~Thanks VK!


AppleScript / AppleScrunix Examples – using the do shell script command in AppleScript.

4 comments  ::  Share or discuss  ::  2011-05-26  ::  Russ Leseberg