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 -XPUT http://localhost:9200/test_index/ -d ' | |
{ | |
"index": { | |
"analysis": { | |
"analyzer": { | |
"index_analyzer": { | |
"tokenizer": "nGram", | |
"filter": ["lowercase", "snowball"] | |
}, |
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
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
Vagrant::Config.run do |config| | |
# Every Vagrant virtual environment requires a box to build off of. | |
config.vm.box = "centos64-min" | |
# The url from where the 'config.vm.box' box will be fetched if it | |
# doesn't already exist on the user's system. | |
config.vm.box_url = "http://dl.dropbox.com/u/9227672/CentOS-6.0-x86_64-netboot-4.1.6.box" |
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
MOCKING DATABASE OPERATIONS | |
=========================== | |
In our webreg example, we refactored some code so that we could | |
pass in our database object instead of creating it inside. Let's | |
push that further and show a slightly advanced usage of a mock | |
object. | |
So let's rework our Franchise test to use a mocked database connection. |
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/perl | |
# -- | |
# bin/otrs.AddCustomer2Group.pl - Add Customer to a Group | |
# Copyright (C) 2001-2013 OTRS AG, http://otrs.com/ | |
# -- | |
# This program is free software; you can redistribute it and/or modify | |
# it under the terms of the GNU AFFERO General Public License as published by | |
# the Free Software Foundation; either version 3 of the License, or | |
# any later version. | |
# |
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
# create systemd service file for rails 2.3.x startup | |
[Unit] | |
Description=rails 2.3.x web server | |
[Service] | |
Type=simple | |
RemainAfterExit=yes | |
User=username | |
PIDFile=/home/username/WEBSERVER/tmp/pids/thin.pid | |
WorkingDirectory=/home/username/WEBSERVER |
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 | |
echo | |
exec powershell.exe -ExecutionPolicy RemoteSigned -File '.\.git\hooks\pre-commit-hook.ps1' | |
exit |
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 | |
pid = Kernel.fork do | |
`#{ARGV.join(" ")}` | |
exit | |
end | |
trap(:CHLD) do | |
print "\n" | |
exit |
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
global | |
log logstash local0 #Change logstash to your naming | |
log-send-hostname | |
chroot /var/lib/haproxy | |
user haproxy | |
group haproxy | |
daemon | |
maxconn 4000 | |
defaults |
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
# route balancing only in commercial edition... | |
#map $cookie_JESSIONID $route_cookie1 { | |
# ~.+\.(?P<route>\w+)$ $route; | |
#} | |
#map $cookie_jsessionid $route_cookie2 { | |
# ~.+\.(?P<route>\w+)$ $route; | |
#} | |
#map $request_uri $route_uri1 { | |
# ~JSESSIONID=.+\.(?P<route>\w+)$ $route; | |
#} |
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/php | |
<?php | |
/** | |
* .git/hooks/pre-commit | |
* | |
* This pre-commit hooks will check for PHP error (lint), and make sure the code | |
* is PSR compliant. | |
* | |
* Dependecy: PHP-CS-Fixer (https://github.com/fabpot/PHP-CS-Fixer) | |
* |
OlderNewer