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
{:ok, connection} = AMQP.Connection.open | |
{:ok, channel} = AMQP.Channel.open(connection) | |
message = Enum.join(System.argv, " ") || "Hello World!" | |
AMQP.Exchange.declare(channel, "logs", :fanout) | |
AMQP.Basic.publish(channel, "logs", "", message) | |
IO.puts " [x] Sent '#{message}'" |
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
:application.ensure_all_started(:ssl) | |
{:ok, handle} = :eldap.open(['ldap.example.com'], [{:port, 636}, {:ssl, true}]) | |
authenticated = | |
:ok == :eldap.simple_bind(handle, | |
'uid=jeff,ou=users,dc=example,dc=com', | |
'notmyrealpassword') | |
{:ok, {:eldap_search_result, list_of_entries, _}} = |
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
defmodule MyApp.Mixfile do | |
use Mix.Project | |
def project do | |
[app: :my_app, | |
version: get_version, | |
elixir: "~> 1.0", | |
elixirc_paths: elixirc_paths(Mix.env), | |
compilers: Mix.compilers, | |
build_embedded: Mix.env == :prod, |
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
wrk.method = "POST" | |
-- this assumes that we're sending to a html form endpoint with csrf protection disabled | |
-- wrk.body and wrk.headers would be different if we were sending a JSON payload to a JSON API endpoing | |
wrk.body = "message[body]=wat" | |
wrk.headers["Content-Type"] = "application/x-www-form-urlencoded" |
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
#!groovy | |
def call() { | |
checkout([ | |
$class: 'GitSCM', | |
branches: scm.branches, | |
extensions: scm.extensions + [[$class: 'WipeWorkspace'], [$class: 'LocalBranch']], | |
userRemoteConfigs: scm.userRemoteConfigs | |
]) | |
} |
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
cmd = [ | |
'fpm', | |
'-t deb', | |
'-s dir', | |
'-d postgresql', | |
'-m ' + config[:maintainer], | |
"-n '#{config[:product]}'", | |
"--prefix /opt/puppet/#{config[:product]}", | |
'-v ' + deb_version, | |
"--deb-init #{config[:product]}.init", |
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
[<<"#ohaibot-testing">>]. | |
[<<"#elixirconf">>]. |
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
curl --get 'https://api.twitter.com/1.1/users/show.json' --data 'screen_name=MaxMartinPDX' |
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
require 'gems' | |
require 'pp' | |
pp Gems.latest.map {|g| g["name"]}. | |
sort. | |
map {|n| {n => Gems.versions(n) } }. | |
reject {|elem| elem.has_value? "This rubygem could not be found."}. | |
map {|elem| {elem.keys.first => elem.values.first.all? {|h| h["licenses"].empty?}}}. | |
reject {|h| h.has_value? false} |
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
require 'bundler' | |
require 'rubygems' | |
require 'rubygems/gem_runner' | |
require 'fileutils' | |
without = [:development, :test] | |
runner = Gem::GemRunner.new | |
definition = Bundler::Definition.build('Gemfile', 'Gemfile.lock', nil) | |
resolver = definition.resolve |
NewerOlder