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 |
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
function do_insert_html(doc, type, element, html) { | |
var new_element = doc.createElement(type); | |
new_element.innerHTML = html; | |
element.parentNode.insertBefore(new_element, element); | |
}; | |
function engine(name, link,img) { | |
this.link = link; | |
this.img = img; | |
this.name = name; |
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
% /sbin/sysctl fs.file-max net.core.somaxconn net.core.rmem_max net.core.wmem_max net.ipv4.tcp_rmem net.ipv4.tcp_wmem net.ipv4.tcp_fin_timeout | |
fs.file-max = 303065 | |
net.core.somaxconn = 128 | |
net.core.rmem_max = 131071 | |
net.core.wmem_max = 131071 | |
net.ipv4.tcp_rmem = 4096 87380 4194304 | |
net.ipv4.tcp_wmem = 4096 16384 4194304 | |
net.ipv4.tcp_fin_timeout = 60 |
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
diff -ur libevent-1.3b.original/event.c libevent-1.3b/event.c | |
--- libevent-1.3b.original/event.c 2007-02-16 09:49:06.000000000 +0900 | |
+++ libevent-1.3b/event.c 2010-08-15 00:58:14.000000000 +0900 | |
@@ -790,13 +790,13 @@ | |
docount = 0; | |
if (docount) | |
- base->event_count--; | |
+ __sync_sub_and_fetch(&(base->event_count), 1); | |
OlderNewer