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
/* Temporary disable $stdout | |
============================ | |
This method works for Ruby and new sub-processes. | |
I have seen other techniques on the net which re-assign $stdout with another IO, | |
but then the sub-processes will still use the old stdout. | |
*/ |
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
#!/usr/bin/env ruby -w | |
## Using ruby's standard OptionParser to get subcommand's in command line arguments | |
## Note you cannot do: opt.rb help command | |
## other options are commander, main, GLI, trollop... | |
# run it as | |
# ruby opt.rb --help | |
# ruby opt.rb foo --help | |
# ruby opt.rb foo -q | |
# etc |
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
# Make sense of puppet circular dependency error messages. | |
# Tags: graphviz, puppet | |
# See output at http://i41.tinypic.com/b6yeqv.jpg | |
$ cat circular.pp | |
node default { | |
exec { "/a": require => Exec["/b"] } | |
exec { "/b": require => Exec["/c"] } | |
exec { "/c": require => Exec["/a"] } | |
} |
NewerOlder