Skip to content

Instantly share code, notes, and snippets.

@igolden
Created August 24, 2017 05:57
Show Gist options
  • Save igolden/5352897442ca5c80c6fb028de4b90a39 to your computer and use it in GitHub Desktop.
Save igolden/5352897442ca5c80c6fb028de4b90a39 to your computer and use it in GitHub Desktop.
#!/bin/ruby
cmds = [
# "SPInstallHistoryDataType",
"SPBluetoothDataType",
# SPNetworkLocationDataType,
# SPDiagnosticsDataType,
# SPUSBDataType,
# SPSoftwareDataType,
#SPCameraDataType,
#SPAirPortDataType,
#SPDisplaysDataType,
#SPFontsDataType,
# SPFrameworksDataType,
#SPAudioDataType,
#SPHardwareDataType,
#SPNetworkDataType,
#SPMemoryDataType,
#SPPrintersDataType,
#SPSerialATADataType,
#SPNetworkVolumeDataType,
#SPThunderboltDataType
]
def install_history
# filter
# system_profiler SPInstallHistoryDataType | grep '^.*\w*:$'
# Get what programs have been installed recently. Could be useful
# ===
#
# @param program_title : string
# @param dated_installed : date
# @param version : string
#
end
class OSX
def self.bluetooth
system "system_profiler SPBluetoothDataType"
end
def self.install_history
system "system_profiler SPInstallHistoryDataType"
end
def self.network_location
system "system_profiler SPNetworkLocationDataType"
end
def self.diagnostics
system "system_profiler SPDiagnosticsDataType"
end
end
#OSX.bluetooth
#OSX.install_history
#OSX.network_location
OSX.diagnostics
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment