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 'oauth' | |
require 'oauth/request_proxy/rack_request' | |
module OAuth | |
module RequestProxy | |
class RackRequest | |
proxies Grape::Request | |
end | |
end | |
end |
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
#!/bin/sh | |
sed -i -e '/^PermitRootLogin/d' /etc/ssh/sshd_config | |
echo 'PermitRootLogin without-password' >> /etc/ssh/sshd_config | |
service ssh restart || service sshd restart |
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
#!ruby | |
if ENV['USER'] != 'root' | |
puts "I need to run with sudo!" | |
exit(1) | |
end | |
bad_rule = 'deny ip from any to any' | |
rule_id = nil | |
rules = `ipfw list`.split(/\n/) | |
rules.each do |rule| |
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
#!/bin/sh -x | |
curl -w "\n" -X DELETE http://localhost:9200/testing; | |
curl -w "\n" -X POST http://localhost:9200/testing/group -d '{"name":"default","description":"This is the default group.","id":null}'; | |
# This next request returns 0 hits | |
curl -w "\n" -X GET http://localhost:9200/testing/group/_search; | |
sleep 1; | |
# After waiting one second, this request returns the previously created document | |
curl -w "\n" -X GET http://localhost:9200/testing/group/_search; |
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
irb(main):001:0> require 'rubocop' | |
=> true | |
irb(main):002:0> Rubocop | |
NameError: uninitialized constant Rubocop |
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
module GemHelper | |
GEMS = [{ name: 'my_gem', version: '~> 0.0.2' }] | |
def self.install_dependencies | |
GemHelper::GEMS.each do |gem| | |
version = Gem::Requirement.create gem[:version] | |
installed = Gem::Specification.each.any? do |spec| | |
gem[:name] == spec.name && version.satisfied_by?(spec.version) | |
end | |
next if installed |
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/gem_tasks' | |
require 'rake/packagetask' | |
require 'rubocop/rake_task' | |
require 'rspec/core/rake_task' | |
ROOT_DIR = File.dirname(__FILE__) | |
gemspec = Gem::Specification.load("#{Dir.glob(ROOT_DIR + '/*.gemspec')[0]}") | |
RSpec::Core::RakeTask.new(:spec) do |t| |
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
Bringing machine 'default' up with 'virtualbox' provider... | |
[default] Importing base box 'JujuBox'... | |
[default] Matching MAC address for NAT networking... | |
[default] Setting the name of the VM... | |
[default] Clearing any previously set forwarded ports... | |
[default] Clearing any previously set network interfaces... | |
[default] Preparing network interfaces based on configuration... | |
[default] Forwarding ports... | |
[default] -- 22 => 2222 (adapter 1) | |
[default] -- 22 => 2122 (adapter 1) |
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 'rake/packagetask' | |
require 'bundler/gem_tasks' | |
require 'rubocop/rake_task' | |
require 'find' | |
require 'pathname' | |
ROOT_DIR = File.dirname(__FILE__) | |
spec = Gem::Specification::load("#{Dir.glob(ROOT_DIR + '/*.gemspec')[0]}") |
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
.arrowRight:after { | |
content: "\27A1"; /* Unicode block arrow */ | |
font-size: 2em; /* Make it big */ | |
display: inline-block; /* Give it block properties (margin/padding) without putting in a new line */ | |
vertical-align: middle; /* Align it in relation to its neighbors */ | |
text-decoration: none; /* Inside a link, don't underline this part */ | |
color: #1a96c6; | |
margin-right: 5px; /* Breathing room */ | |
position: relative; /* Needed to make top/left work */ | |
top: -0.08em; /* Fudge it up a bit */ |