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" | |
"net" // https://golang.org/pkg/net/ | |
"bufio" | |
"regexp" | |
"strings" | |
"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
package main | |
// execute arbitrary shell command | |
// if chmod u+s ./cmd, you can cross the bounds of shell scripts | |
import ( | |
"os" | |
"os/exec" | |
"log" | |
) |
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
#!/bin/sh | |
#prev_rev=$1 | |
rev=`git rev-parse --short HEAD` | |
date=`date +%m/%d` | |
echo $date build $rev | |
echo | |
#git log | grep '^\(commit\| \)'| sed -n "1,/${prev_rev}/p" |
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 | |
// usage: ./snmpwalk oid | |
// | |
// build: go build snmpwalk.go | |
// | |
// do like this | |
// snmpwalk -v 2c -c private 127.0.0.1 .1.3.6.1.4.1.2021.11 | |
import ( |