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
| diff --git a/includes/bootstrap.inc b/includes/bootstrap.inc | |
| index 5b28e98..a9b3410 100644 | |
| --- a/includes/bootstrap.inc | |
| +++ b/includes/bootstrap.inc | |
| @@ -438,7 +438,14 @@ function conf_init() { | |
| // $_SERVER['SCRIPT_NAME'] can, in contrast to $_SERVER['PHP_SELF'], not | |
| // be modified by a visitor. | |
| - if ($dir = trim(dirname($_SERVER['SCRIPT_NAME']), '\,/')) { | |
| + |
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
| function academy_site_preprocess_page(&$vars, $hook) { | |
| ..... | |
| if (in_array(arg(0), array('admin', 'panels', 'ctools')) || arg(1) == 'add' || arg(2) == 'edit') { | |
| } else { | |
| $scripts = drupal_add_js(); | |
| $new_jquery = array(drupal_get_path('theme', 'academy') . '/js/jquery-1.7.2.min.js' => $scripts['core']['misc/jquery.js']); | |
| $scripts['core'] = array_merge($new_jquery, $scripts['core']); | |
| unset($scripts['core']['misc/jquery.js']); |
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
| input { | |
| tcp { | |
| 'port' => 3333 | |
| 'type' => 'router_nginx_logs' | |
| } | |
| # Some additional inputs could be here as well | |
| } | |
| filter { |
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
| var strtr = function(str, from, to) { | |
| // discuss at: http://phpjs.org/functions/strtr/ | |
| // original by: Brett Zamir (http://brett-zamir.me) | |
| // input by: uestla | |
| // input by: Alan C | |
| // input by: Taras Bogach | |
| // input by: jpfle | |
| // bugfixed by: Kevin van Zonneveld (http://kevin.vanzonneveld.net) | |
| // bugfixed by: Kevin van Zonneveld (http://kevin.vanzonneveld.net) | |
| // bugfixed by: Brett Zamir (http://brett-zamir.me) |
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
| perl_set $instance_id ' | |
| sub { | |
| if ($id) | |
| { | |
| # since this gets executed for EACH request, so use simple caching | |
| return $id; | |
| } | |
| # GET AWS instance metadata | |
| $id = `curl -s http://169.254.169.254/latest/meta-data/instance-id`; |
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
| server | |
| { | |
| # To avoid changing your app config | |
| # point Nginx to the Solr port | |
| listen 8983; | |
| # Set read/write variables | |
| set $solr_write "0"; | |
| set $solr_read "1"; | |
| set $solr_admin "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
| require 'aws-sdk' | |
| r53 = AWS::Route53.new | |
| resp = r53.client.list_hosted_zones | |
| # Get list of all zones | |
| resp[:hosted_zones].each do |zone| | |
| zone_id = zone[:id][12..-1] | |
| # initialize zone objects |
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
| var handleApiRequest = function(req, plugin, next) { | |
| validate_path(req.path, function(err) { | |
| if (err) { | |
| var error = plugin.hapi.error.badRequest(err); | |
| next(error); | |
| } | |
| }); | |
| next(); | |
| } |
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
| location ~* ^/(assets)/(.*) { | |
| set $remote_host "static.fc.com"; | |
| # needed to resolve the dynamic host in proxy_pass | |
| resolver 172.16.0.23; | |
| proxy_set_header HOST $remote_host; | |
| proxy_pass http://$remote_host/$1/$2; | |
| } |
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
| service "opscenter-agent" do | |
| supports :status => true | |
| start_command "#{agent_dir}/bin/opscenter-agent" | |
| status_command "ps aux | grep -q '[o]pscenter-agent'" | |
| stop_command "kill $(ps aux | grep '[o]pscenter-agent' | awk '{print $2}')" | |
| action :start | |
| end |