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
frontend http | |
bind :80 | |
mode http | |
option http-server-close | |
# send request to the main backend until it has 50 parallel request | |
use_backend main if { be_conn(main) le 50 } | |
# send further requests to the others backend | |
use_backend others if { be_conn(main) gt 50 } |
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 'chef/http/http_request' | |
# Remove this patch once there is a released chef version which includes | |
# https://github.com/opscode/chef/pull/1471 | |
class Chef | |
class HTTP | |
class HTTPRequest | |
URI_SCHEME_DEFAULT_PORT ||= { 'http' => 80, 'https' => 443 }.freeze |
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
http-request del-header X-Redirect-To | |
http-request set-header X-Redirect-To %[req.uri] if { path_beg /a } | |
http-request replace-header X-Redirect-To /a/(.*) /b/\1 if { hdr_cnt(X-Redirect-To) gt 0 } | |
http-request redirect location %[req.hdr(X-Redirect-To)] if { hdr_cnt(X-Redirect-To) gt 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
#!/usr/bin/env python | |
# Generate a new SHA512 shadow password hash from a given password | |
# Based on https://github.com/antoncohen/mksha | |
import getpass | |
import sys | |
# To install this library, use one of these: | |
# pip install passlib |
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
#!/usr/bin/env ruby | |
KNOWLEDGE = { | |
"gustavo" => ["learing ruby", "drinking beer", "sitting at the Spree"], | |
"duilio" => ["teaching ruby", "sunbathing", "doing stuff"], | |
"max" => ["eating great food", "another thing", "a third"] | |
} | |
def get_knowledge(person) | |
favorite_things = KNOWLEDGE[person] |
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
frontend ssl | |
bind :443 ssl crt /etc/haproxy/crts npn spdy/2,http/1.1 | |
mode tcp | |
use_backend speedy if { ssl_fc_npn -m str spdy/2 } | |
default_backend http | |
frontend http_internal | |
bind 127.0.0.1:8443 |
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
begin | |
puts "Hello World" | |
raise StandardError, '(╯°□°)╯︵ ┻━┻' | |
rescue => ಠ_ಠ | |
puts ಠ_ಠ.message | |
puts ಠ_ಠ.backtrace.join('\n') | |
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
# make sure to require this in your init.rb | |
class MyPluginIssueHook < Redmine::Hook::ViewListener | |
# this just renders the partial | |
# the contents of the context ahsh is made available as local variables to the partial | |
render_on :view_issues_form_details_bottom, :partial => 'hooks/view_issues_form_details_bottom' | |
def controller_account_success_authentication_after(context={ }) | |
# do something here |
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
<IfModule mod_passenger.c> | |
PassengerRoot /var/ruby/1.8/gem_home/gems/passenger-2.2.11 | |
PassengerRuby /usr/ruby/1.8/bin/ruby | |
PassengerEnabled on | |
PassengerUserSwitching on | |
PassengerDefaultUser passenger | |
</IfModule> |
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
# First run script/generate redmine_plugin add_link | |
# Put in vendor/plugins/redmine_add_link/init.rb | |
require 'redmine' | |
Redmine::Plugin.register :redmine_rt_link do | |
name 'Redmine Add Link' | |
author 'Holger Just' | |
url 'http://dev.holgerjust.de/projects/redmine-misc' |
OlderNewer