Skip to content

Instantly share code, notes, and snippets.

@tarrsalah
Last active May 9, 2016 05:57
Show Gist options
  • Save tarrsalah/e3e3d3cfca61df25ecda7f1a490c8b35 to your computer and use it in GitHub Desktop.
Save tarrsalah/e3e3d3cfca61df25ecda7f1a490c8b35 to your computer and use it in GitHub Desktop.
invalidate my ARP cache every 500ms
package main
import (
"os/exec"
"time"
)
func inarp() {
cmd := exec.Command("/bin/sh", "-c", "sudo ip -s -s neigh flush all")
stdout, err := cmd.Output()
if err != nil {
println(err.Error())
return
}
print(string(stdout))
}
func main() {
for _ = range time.Tick(500 * time.Millisecond) {
inarp()
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment