Skip to content

Instantly share code, notes, and snippets.

@cabecada
cabecada / Gemfile
Created Jul 20, 2016 — forked from ctalkington/Gemfile
Nginx, Sinatra, and Puma.
View Gemfile
source :rubygems
gem "puma"
gem "sinatra"
View spec.rb
root@ubuntu1404-4:/var/tmp/serverspec# cat spec/localhost/sample_spec.rb
require 'spec_helper'
describe package('sensu') do
it { should be_installed }
end
describe package('sensu-plugin') do
it { should be_installed.by('gem').with_version('1.3.1') }
end
@cabecada
cabecada / .rb
Last active Sep 17, 2016
stash_to_silencing
View .rb
#!/opt/sensu/embedded/bin/ruby
require 'net/http'
require 'json'
def get_uri(url)
URI(url)
end
@cabecada
cabecada / .rb
Created Sep 22, 2016
stash_to_silenced_migrate
View .rb
#!/opt/sensu/embedded/bin/ruby
require 'net/http'
require 'json'
module Sensu
class Api
attr_reader :server, :port
def initialize(server='localhost', port=4567)
@cabecada
cabecada / update.rb
Last active Oct 20, 2016
update client subscriptions
View update.rb
#!/opt/sensu/embedded/bin/ruby
require 'net/http'
require 'json'
require 'optparse'
module Sensu
class Api
attr_reader :server, :port
def initialize(server='localhost', port=4567)
View gist:640c0c1fc8686f6b1bdca13fce88ef44
#!/opt/sensu/embedded/bin/ruby
require 'net/http'
require 'json'
require 'optparse'
module Sensu
class Api
attr_reader :server, :port
def initialize(server='localhost', port=4567)
@cabecada
cabecada / gist:9c73fa47fdad31ce97d333315cda946b
Created Jan 13, 2017 — forked from Atem18/gist:4696071
Tutorial to seting up a django website in production.
View gist:9c73fa47fdad31ce97d333315cda946b

Set up Django, Nginx and Gunicorn in a Virtualenv controled by Supervisor

Steps with explanations to set up a server using:

  • Virtualenv
  • Virtualenvwrapper
  • Django
  • Gunicorn
@cabecada
cabecada / gist:d6940042b1bb9f5ede3df4438f1e65e3
Created Jan 25, 2017
Puppet erb converts int to str in yaml dump
View gist:d6940042b1bb9f5ede3df4438f1e65e3
root@master:/etc/puppet# cat /tmp/modules/foo/templates/foo
<%-
def yaml_indent(conds)
return_val = []
tmp_val = conds.to_yaml.split("\n")
tmp_val.delete('---')
tmp_val.each do |val|
return_val << " " + val
end
return_val.join("\n")
View mongodb_3.2.x_sharding.md

#MongoDB 3.2.x Sharding Sharding is used when the database is too large to run on a single server and you need to spread the load across multiple servers. The name itself refers to the breaking (sharding) of the data into seperate groups of data which will reside on different servers.

##Configuration Server Start the server on your server (myserver0)

mongod --configsvr --dbpath /data

On myserver1 start the shard giving the configuration server as the --configdb option

View gist:3cf827f3365e2635ef7302bcc70d975f
input {
beats {
port => 5144
codec => json
}
}
filter {