Skip to content

Instantly share code, notes, and snippets.

@hiboma
Created February 1, 2012 06:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hiboma/1715423 to your computer and use it in GitHub Desktop.
Save hiboma/1715423 to your computer and use it in GitHub Desktop.
macのバッテリーのcapacityを記録する
#!/usr/bin/ruby
now = Time.now.to_s
capacity = `ioreg -l | grep MaxCapacity`.chomp.split(" = ")[1]
cyclecount = `ioreg -l | grep CycleCount | grep -v Design`.chomp.split(" = ")[1]
puts now+","+capacity+","+cyclecount
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment