This file contains hidden or 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" | |
"log" | |
"flag" | |
"github.com/boltdb/bolt" | |
"time" | |
) |
This file contains hidden or 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
import scalaz._ | |
import scalaz.std.list._ | |
import scalaz.syntax.monad._ | |
import scalaz.syntax.monoid._ | |
import scalaz.syntax.traverse.{ToFunctorOps => _, _} | |
class Foo[F[+_] : Monad, A, B](val execute: Foo.Request[A] => F[B], val joins: Foo.Request[A] => B => List[Foo.Request[A]])(implicit J: Foo.Join[A, B]) { | |
def bar: Foo[({type l[+a]=WriterT[F, Log[A, B], a]})#l, A, B] = { | |
type TraceW[FF[+_], +AA] = WriterT[FF, Log[A, B], AA] |
This file contains hidden or 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
// check to see if we've already sent this alert recently | |
func alreadySentRecently(res reservation) bool { | |
timeNow := time.Now().UTC() | |
mapKey := res.App + res.Component | |
waitForNotifyTime := time.Duration(cfg.Main.HoursBetweenAlerts) * time.Hour | |
_, ok := sentAlerts[mapKey] | |
if !ok { | |
sentAlerts[mapKey] = timeNow | |
l.info("Sending new alert for [%s/%s]", res.App, res.Component) |
This file contains hidden or 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
jim@ubuntu:~/Code/projects/go-lang-idea-plugin$ ant -f build-package.xml | |
Buildfile: /home/jim/Code/projects/go-lang-idea-plugin/build-package.xml | |
clean: | |
[delete] Deleting directory /home/jim/Code/projects/go-lang-idea-plugin/build | |
init: | |
[mkdir] Created dir: /home/jim/Code/projects/go-lang-idea-plugin/build | |
[echo] Using IDEA build from: /home/jim/Downloads/idea-IC-138.2458.8 |
This file contains hidden or 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
jim@ubuntu:~/Code/projects/go-lang-idea-plugin$ ant -f build-package.xml | |
Buildfile: /home/jim/Code/projects/go-lang-idea-plugin/build-package.xml | |
clean: | |
[delete] Deleting directory /home/jim/Code/projects/go-lang-idea-plugin/build | |
init: | |
[mkdir] Created dir: /home/jim/Code/projects/go-lang-idea-plugin/build | |
[mkdir] Created dir: /home/jim/Code/projects/go-lang-idea-plugin/dist | |
[echo] Using IDEA build from: /home/jim/Downloads/idea-IC-135.1289 |
This file contains hidden or 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
from fabric.api import task,runs_once,execute,sudo | |
from fabric.colors import green | |
# Example of how to combine the output from multiple hosts | |
# This is a toy example, just to show you how you can loop and combine the results together | |
@task | |
def get_stats(): |
This file contains hidden or 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
jim@localhost: ~/temp | |
➺ fab stats -H 100.100.1.113,100.100.2.220 -P -f fab-count.py | |
[100.100.1.113] Executing task 'stats' | |
[100.100.1.113] Executing task 'get_stats' | |
[100.100.2.220] Executing task 'get_stats' | |
[100.100.2.220] sudo: lsof -i -sTCP:ESTABLISHED | wc -l | |
[100.100.1.113] sudo: lsof -i -sTCP:ESTABLISHED | wc -l | |
[100.100.2.220] out: 36 | |
[100.100.2.220] out: |
This file contains hidden or 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
override def next : Option[Job] = { | |
log.info("I FINISHED PROCESSING!") | |
val results = Tsv(outputdir).readAtSubmitter[String].foreach(line => { | |
log.info("LINE: " + line) | |
}) | |
None | |
} |
This file contains hidden or 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
override def next : Option[Job] = { | |
println("I FINISHED PROCESSING!") | |
None | |
} |
This file contains hidden or 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
override def init(config : javax.servlet.ServletConfig) { | |
// val names = config.getInitParameterNames | |
println("PRINTING CONFIG") | |
println(config.getInitParameter("env")) | |
} |
NewerOlder