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 "mackerel" | |
require "net/http" | |
require "uri" | |
require "pp" | |
require "date" | |
@mackerel_api_key = "<APIKEY>" | |
service = "<SERVICE>" |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8" /> | |
<title>Mackerel Graph Builder</title> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> | |
<script type="text/javascript"> | |
function update() { | |
var d = $("#def")[0].value; | |
var o = $("#org")[0].value; |
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
# -*- coding: utf-8 -*- | |
import requests | |
import time | |
import json | |
from StringIO import StringIO | |
import re | |
import sys | |
import os |
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
# -*- coding: utf-8 -*- | |
import requests | |
import time | |
import json | |
from StringIO import StringIO | |
import re | |
import sys | |
import os |
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 |
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 | |
$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
<?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
- 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
package main | |
import "fmt" | |
import "time" | |
func main() { | |
t := time.Now() | |
fmt.Printf("Now: %v\n", t) | |
} |
NewerOlder