Created
February 4, 2009 13:56
-
-
Save metaskills/58108 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
APPS = ['Address Book','Calculator','Dictionary','DVD Player','Font Book','iCal','QuickTime Player','Safari'] | |
UTILS = ['Activity Monitor','Console','Disk Utility','Network Utility'] | |
def launch_app(app) | |
puts "Launch: #{app}" | |
`open /Applications/#{app.sub(' ','\ ')}.app` | |
end | |
def launch_util(util) | |
puts "Launch: #{util}" | |
`open /Applications/Utilities/#{util.sub(' ','\ ')}.app` | |
end | |
def launch_apps | |
APPS.each { |app| launch_app(app) } | |
UTILS.each { |util| launch_util(util) } | |
end | |
def kill(app) | |
puts "Kill: #{app}" | |
`killall "#{app}"` | |
end | |
def kill_apps | |
APPS.each { |app| kill(app) } | |
UTILS.each { |util| kill(util) } | |
end | |
10_000.times do |n| | |
launch_apps | |
sleep(5) | |
kill_apps | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment