Last active
December 22, 2015 19:39
-
-
Save tobstarr/6521231 to your computer and use it in GitHub Desktop.
Golang Heisenberg
This file contains hidden or 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
| Committed_AS: 3607224 kB | |
| Committed_AS: 3872632 kB | |
| Committed_AS: 3607156 kB |
This file contains hidden or 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 "os/exec" | |
| import "strings" | |
| func main() { | |
| res, _ := exec.Command("bash", "-c", "grep Committed_AS /proc/meminfo").CombinedOutput() | |
| fmt.Println(strings.TrimSpace(string(res))) | |
| } |
This file contains hidden or 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
| #!/bin/bash | |
| set -e | |
| go build -o ./test ./test.go | |
| grep Committed_AS /proc/meminfo | |
| ./test | |
| grep Committed_AS /proc/meminfo |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment