This repository has been archived on 2024-04-10. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
elektron/pcp/ssh/raplcap.go
2016-12-22 22:59:02 -05:00

27 lines
No EOL
546 B
Go

package ssh
import (
"golang.org/x/crypto/ssh"
"fmt"
)
func main() {
sshConfig := &ssh.ClientConfig{
User: "rapl",
Auth: []ssh.AuthMethod{
ssh.Password("pankajlikesdanceswithwolves#!@#"),
},
}
connection, err := ssh.Dial("tcp", "host:port", sshConfig)
if err != nil {
return nil, fmt.Errorf("Failed to dial: %s", err)
}
session, err := connection.NewSession()
if err != nil {
return nil, fmt.Errorf("Failed to create session: %s", err)
}
err = session.Run("sudo /misc/shared_data/rdelval1/RAPL_PKG_Throttle.py 100")
}