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 sys.process._ | |
val body = "junk email body" | |
val subject = "test email subject" | |
val commaDelimitedEmails = "[email protected],[email protected]" | |
//goal is to execute the same bash command without loading a file | |
//script would be identical to: echo body | mail -s subject addresses | |
Seq("echo", body) #| Seq("mail", "-s %s".format(subject), commaDelimitedEmails) ! |
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 locust import Locust, TaskSet | |
urls = ["someurl1", "someurl2"] | |
lamda_set = {} | |
for url in urls: | |
lamda_set[lambda l: l.client.get(url)] = 1 | |
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 sys | |
import simplejson | |
import requests | |
import random | |
from urllib import quote | |
# pass in a single argument of a url that returns a json list of urls [ "url1","url2"] | |
def main(argv): |
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
#!/bin/bash | |
#start script to kick off a master and then slaves via ssh across multiple machines | |
RUN_AS=${1:-$(whoami)} | |
SLAVE_CMD="nohup locust -f /opt/swarm//app1/some_locust_script.py --slave --master-host=testbox1.locust.com --host=http://someurlToHammer:9000 &>/dev/null &" | |
MASTER_CMD="nohup locust -f /opt/swarm/app1/some_locust_script.py --master --host=http://someurlToHammer:9000 &>/dev/null &" | |
start_instances() | |
{ |
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
#!/bin/sh | |
. /etc/init.d/functions | |
successVar="-ne \t\t\t\t\t[ \033[32mOK\033[0m ]\n" | |
failureVar="-ne \t\t\t\t\t[ \033[31mFailed\033[0m ]\n" | |
function success(){ | |
echo $successVar | |
} | |
function failure(){ | |
echo $failureVar |
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
trait IHttpClient[T] { | |
def host: String | |
def port: Int | |
def get(uri: String): Future[T] | |
} | |
trait NingHttpClient extends IHttpClient[Response] { |
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 akka.actor._ | |
import scala.concurrent.duration._ | |
import scala.concurrent.Future | |
import spray.http._ | |
import spray.can.client._ | |
trait SprayHttpClient extends IHttpClient[HttpResponse] { | |
val httpClient = DefaultHttpClient(system) |
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
while (1) { toEcho=$(lsof -i:16868 | grep 16868); echo $toEcho; sleep 1 } |
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
find . -name "*.pid" -print -exec awk '$9 != "" && n < 10 {print; n++}' {} \; |
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
#!/usr/bin/env bash | |
# Simple move this file into your Rails `script` folder. Also make sure you `chmod +x puma.sh`. | |
# Please modify the CONSTANT variables to fit your configurations. | |
# The script will start with config set by $PUMA_CONFIG_FILE by default | |
PUMA_CONFIG_FILE=config/puma.rb | |
PUMA_PID_FILE=tmp/pids/puma.pid | |
PUMA_SOCKET=tmp/sockets/puma.sock |
OlderNewer