Skip to content

Instantly share code, notes, and snippets.

@Ismael-VC
Last active May 24, 2017 09:29
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save Ismael-VC/6db0c310eaf04d0b0a1b to your computer and use it in GitHub Desktop.
Save Ismael-VC/6db0c310eaf04d0b0a1b to your computer and use it in GitHub Desktop.
Julia user configuration file.
const HOSTS = ASCIIString["hd$(i)" for i = 1:19]
const SEPARATOR = "#" ^ 79
separator() = (println(); print_with_color(:cyan, SEPARATOR); println())
function ssh_all(command, commands...; hosts=HOSTS)
separator()
for host in hosts
println()
@show host
println()
cmd = `ssh $host $command`
if !isempty(commands)
for c in commands
cmd = cmd |> c # pipe commands
end
end
run(cmd)
separator()
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment