December 17, 2011: 12:48 am: General, Privacy

I like to remind folks when moving their Apple laptop to public wifi that they need to remember to turn off the iLife application sharing such as iTunes and iPhoto. Then turn on their firewall.

So here is an AppleScript that will do just that. It is written and tested on OSX Lion with iLife 11. So you may have to play with it for your version if that is not what you are running.  Keep in mind it is a toggle script.  It will reverse the settings of iPhoto, iTunes sharing and the firewall. So it is assumed you share both with the firewall off when at home.

Also you need to ensure Enable access for assistive devices is checked under Universal Access in System Preference.

Just cut and paste the below script into the AppleScript editor.  Then save either as an application on your desktop you can double click. Or save as an AppleScript where an application like LaunchBar can use it as an action. ~/Library/Application Support/LaunchBar/Actions

(more…)

TwitterFacebookGoogle BookmarksLinkedInInstapaperGoogle ReaderPosterousStumbleUponShare
September 10, 2011: 10:03 pm: Automation

I have been playing around making a Jarvis like home notifaction script.  One piece of that for fun is to read me the current Brandon Sanderson book project status report.  I made the below applescript to parse the information off his Web site and read it aloud to me. After all men don’t read (a Stormlight Archive reference so go get the book).  I am a huge fan of his Mistborn and Stormlight Archive series.  Oh yeah… He is also finishing the Wheel of Time too. ;-)

Warning that the below script could break at any time.  It has to parse out bits of html code.  Who knows how much that changes each time updates his status.  I won’t know till the next update.  You can see those bits in the AppleScript’s text item delimeters lines in the script.

*UPDATE 9-18-2011* I updated the script below to help avoid breaking when Brandon updates his progress area.  It relies way less on the html code matching.

 

on run {}

 

try

set theSource to (do shell script “curl ” & quoted form of (“http://www.brandonsanderson.com/”))

set AppleScript‘s text item delimiters to {“<h3>Current Projects</h3>”}

set theText to text item 2 of theSource

set AppleScript‘s text item delimiters to {“<h3>Search</h3>”}

set theText to text item 1 of theText

set AppleScript‘s text item delimiters to {“<div style=”float:left;  width:100%;”>”}

set tempProject1 to text item 2 of theText

set tempProject2 to text item 3 of theText

set tempProject3 to text item 4 of theText

 

set percentStartProj1 to offsetof “%” intempProject1

set percentProj1 to text (percentStartProj1 – 3) thru (percentStartProj1) of tempProject1

set AppleScript‘s text item delimiters to {“  <br/>”}

set projectProgress1 to text item 1 of tempProject1 & percentProj1

 

set percentStartProj2 to offsetof “%” intempProject2

set percentProj2 to text (percentStartProj2 – 3) thru (percentStartProj2) of tempProject2

set AppleScript‘s text item delimiters to {“  <br/>”}

set projectProgress2 to text item 1 of tempProject2 & percentProj2

 

set percentStartProj3 to offsetof “%” intempProject3

set percentProj3 to text (percentStartProj3 – 3) thru (percentStartProj3) of tempProject3

set AppleScript‘s text item delimiters to {“  <br/>”}

set projectProgress3 to text item 1 of tempProject3 & percentProj3

 

set AppleScript‘s text item delimiters to {“”}

 

say “Brandon Sanderson Project Status Report”

sayprojectProgress1

sayprojectProgress2

sayprojectProgress3

 

on error

say “Unable to obtain Brandon Sanderson project status information.”

return

 

end try

 

end run

 

TwitterFacebookGoogle BookmarksLinkedInInstapaperGoogle ReaderPosterousStumbleUponShare
: 4:03 pm: Automation

I have been playing around making a Jarvis like home notifaction script.  One piece of that for fun is to read me the current Brandon Sanderson book project status report.  I made the below applescript to parse the information off his Web site and read it aloud to me. After all men don’t read (a Stormlight Archive reference so go get the book). I am a huge fan of his Mistborn and Stormlight Archive series.  Oh yeah… He is also finishing the Wheel of Time too. ;-)

Warning that the below script could break at any time.  It has to parse out bits of html code.  Who knows how much that changes each time updates his status.  I won’t know till the next update.  You can see those bits in the AppleScript’s text item delimeters lines in the script.

 

on run {}

 

try

set theSource to (do shell script “curl ” & quoted form of (“http://www.brandonsanderson.com/”))

set AppleScript‘s text item delimiters to {“<h3>Current Projects</h3>”}

set theText to text item 2 of theSource

set AppleScript‘s text item delimiters to {“<h3>Search</h3>”}

set theText to text item 1 of theText

set AppleScript‘s text item delimiters to {“<div style=\”float:left;  width:100%;\”>”}

set tempProject1 to text item 2 of theText

set tempProject2 to text item 3 of theText

set tempProject3 to text item 4 of theText

set AppleScript‘s text item delimiters to {“<br/> <div style=\”width:33.99px; overflow:hidden; float:left; \”><img src=\”/templates/slate/images/bookmeter1.png\” /></div><div style=\”float:left; padding-left:5px;\”> “}

set projectProgress1 to text item 1 of tempProject1 & text item 2 of tempProject1

 

set AppleScript‘s text item delimiters to {” <br/> <div style=\”width:103px; overflow:hidden; float:left; \”><img src=\”/templates/slate/images/bookmeter2.png\” /></div><div style=\”float:left; padding-left:5px;\”> “}

set projectProgress2 to text item 1 of tempProject2 & text item 2 of tempProject2

 

set AppleScript‘s text item delimiters to {” <br/> <div style=\”width:57.68px; overflow:hidden; float:left; \”><img src=\”/templates/slate/images/bookmeter3.png\” /></div><div style=\”float:left; padding-left:5px;\”> “}

set projectProgress3 to text item 1 of tempProject3 & text item 2 of tempProject3

 

set AppleScript‘s text item delimiters to {“</div>”}

set projectProgress1 to text item 1 of projectProgress1

set projectProgress2 to text item 1 of projectProgress2

set projectProgress3 to text item 1 of projectProgress3

 

set AppleScript‘s text item delimiters to {“”}

 

say “Brandon Sanderson Project Status Report”

sayprojectProgress1

sayprojectProgress2

sayprojectProgress3

 

on error

say “Unable to obtain Brandon Sanderson project status information.”

return

 

end try

 

end run

 

Posted via email from georgestarcher.randomlings

TwitterFacebookGoogle BookmarksLinkedInInstapaperGoogle ReaderPosterousStumbleUponShare
August 23, 2011: 12:54 pm: Admin Tricks, Windows Security

I don’t think I ever posted this before.  If you need a login script to map drives and network printers based on Windows domain group membership for users try the below.  Put it in a vbs file like login.vbs.  Edit “domainname” to be your Windows domain name, and edit the permission group names appropriately.  It also has example of removing existing drive mounts before trying to mount by group.

(more…)

TwitterFacebookGoogle BookmarksLinkedInInstapaperGoogle ReaderPosterousStumbleUponShare
July 31, 2011: 10:22 am: Forensics, Password Security

I was curious if I could script a dictionary attack against one of the OSX Lion File Vault v2 encrypted external drives. If you haven’t done it. You need to be on Lion. Grab a spare USB storage stick. Make sure to backup any data from the device first. Encrypting the device by the book will erase and destroy the existing contents.

  1. Go into “Disk Utility”
  2. Plug in the desired USB storage stick
  3. Click on the device in the list
  4. Click on the Erase tab
  5. Pull down the Format box and choose one of the Encrypted options like: Mac OS Extended (Journaled, Encrypted)
  6. Click Erase
  7. When prompted provide a desired password.

Now that you have setup an encrypted device you can use that to test this process.

  1. First eject the usb device
  2. Unplug it
  3. Plug it back in
  4. Click cancel and do not enter the passphrase

Now onto the rest of the process.

(more…)

TwitterFacebookGoogle BookmarksLinkedInInstapaperGoogle ReaderPosterousStumbleUponShare