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
| %% @doc Connect to a RabbitMQ server and open a channel | |
| %% @spec login(vhost(), username(), password()) -> {ok, connection(), channel()} | |
| login(VHost, UserName, Password) -> | |
| cheshire_connect:login(VHost, UserName, Password). | |
| %% @doc Disconnect from a RabbitMQ server and open a channel | |
| %% @spec logout(connection(), channel()) -> ok | {error, any()} | |
| logout(Connection, Channel) | |
| %% @doc Creates a randomly named queue and binds it to the |
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
| 1> {ok, P} = js_driver:new(). | |
| {ok, #Port<0.846>} | |
| 2> js_driver:define_js(P, {file, "testing.js"}, 5000). | |
| ok | |
| 3> js:call(P, "hello", [<<"Kevin">>]). | |
| {ok,<<"Hello, Kevin. The date is 12/20/2009">>} | |
| 4> JS = <<"function emit(doc) { return {id: doc[\"id\"], acct:, doc[\"acct\"]}; }">>. | |
| . . . | |
| 5> js:define(P, JS). | |
| ok |
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
| -module(port_scanner). | |
| -export([scan/3]). | |
| scan(Addr, Start, End) -> | |
| Services = parse_services(), | |
| scan(Addr, Start, End, Services). | |
| %% Internal functions | |
| scan(Host, Start, End, Services) -> | |
| [Data || Data <- |
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
| 1) Use build_flymake.sh to compile flymake.erl into the eflymake script. | |
| 2) Replace your existing eflymake script with the newly built one. | |
| NOTE: Don't forget to make a back up copy of your original eflymake in case this one has bugs! |
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
| curl -X POST -H "content-type: application/json" http://localhost:8098/mapred --data @- | |
| {"inputs":"stats-Ev::AssetCreation", "query":[{"map": {"language":"javascript", "source":"function(v) {return [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
| -module(bucket_inspector). | |
| -export([inspect/2]). | |
| inspect(Bucket, Server) -> | |
| {ok, C} = riak:client_connect(Server), | |
| {ok, Keys} = C:list_keys(Bucket), | |
| inspect_objects(Bucket, Keys, C). | |
| inspect_objects(_Bucket, [], _Client) -> |
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
| -module(bucket_reloader). | |
| -export([reload/3]). | |
| reload(FromServer, ToServer, Bucket) -> | |
| {ok, CFrom} = riak:client_connect(FromServer), | |
| {ok, CTo} = riak:client_connect(ToServer), | |
| {ok, Keys} = CFrom:list_keys(Bucket), | |
| io:format("Transferring ~p keys~n", [length(Keys)]), | |
| transfer(CFrom, CTo, Bucket, Keys, 0). |
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
| /** | |
| * Throws a checked {@link Exception} not declared in the method signature. | |
| * Clearly, this circumvents compiler safeguards, so use with caution. | |
| * You've been warned. | |
| * | |
| * @param exception | |
| * A checked (or unchecked) exception to be thrown. | |
| */ | |
| public static void throwChecked(final Throwable exception) { | |
| new CheckedThrower<RuntimeException>().throwChecked(exception); |
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
| crobuzon:jakarta-jmeter-2.4 kevin$ bin/jmeter.sh | |
| Uncaught Exception java.lang.NullPointerException. See log file for details. | |
| Uncaught Exception java.lang.NullPointerException. See log file for details. | |
| Uncaught Exception java.lang.NullPointerException. See log file for details. | |
| Uncaught Exception java.lang.NullPointerException. See log file for details. | |
| Uncaught Exception java.lang.NullPointerException. See log file for details. | |
| Uncaught Exception java.lang.NullPointerException. See log file for details. | |
| Uncaught Exception java.lang.NullPointerException. See log file for details. | |
| Uncaught Exception java.lang.NullPointerException. See log file for details. | |
| Uncaught Exception java.lang.NullPointerException. See log file for details. |
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 | |
| function s() { | |
| say -v $1 $2 | |
| } | |
| function sb() { | |
| say -v $1 $2 & | |
| } | |
| s Fred "Good morning, everyone." |