This file contains 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 | |
require 'optparse' | |
require 'json' | |
options = {} | |
OptionParser.new do |opts| | |
opts.banner = "Usage: ltsv2json.rb [options]" | |
opts.on("-f", "--format FORMAT", "Select format.") do |v| |
This file contains 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
require 'moped' | |
session = Moped::Session.new([ "127.0.0.1:27017" ]) | |
session.use "test" | |
str = '' | |
1_000_000.times do | |
str << '0123456789' | |
end |
This file contains 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
--- elscreen.el.original 2013-03-21 12:58:17.000000000 +0900 | |
+++ elscreen.el 2013-03-21 12:59:05.000000000 +0900 | |
@@ -984,7 +984,7 @@ | |
(defun elscreen-jump () | |
"Switch to specified screen." | |
(interactive) | |
- (let ((next-screen (string-to-number (string last-command-char)))) | |
+ (let ((next-screen (string-to-number (string last-command-event)))) | |
(if (and (<= 0 next-screen) (<= next-screen 9)) | |
(elscreen-goto next-screen)))) |
This file contains 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
package main | |
import "fmt" | |
import "time" | |
func main() { | |
t := time.Now() | |
fmt.Printf("Now: %v\n", t) | |
} |
This file contains 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
- Official Blog https://blog.docker.com/2014/10/announcing-docker-global-hack-day-2/ | |
- Kick off presentation from the core team https://docker.com/community/globalhackday | |
- |
This file contains 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
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>Label</key> | |
<string>io.mackerel</string> | |
<key>RunAtLoad</key> | |
<true/> | |
<key>KeepAlive</key> | |
<true/> |
This file contains 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 | |
$ioreg = `ioreg -r -n AppleSmartBattery` | |
$now = Time.now | |
def asb(item) | |
ret = $ioreg.match(/(#{item})[\"= ]+(\d+)$/) | |
ret[2].to_i | |
end |
This file contains 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
pidfile = "/usr/local/var/run/mackerel-agent.pid" | |
root = "/usr/local/var/mackerel-agent" | |
verbose = false | |
apikey = "APIKEY" | |
[plugin.metrics.battery] | |
command = "ruby /usr/local/bin/mackerel-osx-battery.rb" |
This file contains 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 | |
$now = Time.now | |
$cmd = "/Users/stanaka/git/github.com/stanaka/mackerel-osx/smc" | |
def smc(item) | |
ret = `#{$cmd} read #{item}` | |
ret = ret.split(/\t/) | |
if ret[1] | |
ret[1].to_i |