/usr/share/elasticsearch/bin/以下(※Ver1.3.2で確認)
https://github.com/elasticsearch/elasticsearch-river-wikipedia
※ElasticSearchのバージョンによってインストールするバージョンが異なるため注意
fs = require 'fs' | |
path = require 'path' | |
app = require('http').createServer (req, res) -> | |
res.writeHead 200, 'Content-Type': 'text/html' | |
res.end fs.readFileSync (path.resolve 'public', 'index.html'), 'utf-8' | |
app.listen 3000 | |
require('socket.io').listen(app).on 'connection', (socket) -> |
if ($request_uri = /) { | |
set $test A; | |
} | |
if ($host ~* teambox.com) { | |
set $test "${test}B"; | |
} | |
if ($http_cookie !~* "auth_token") { | |
set $test "${test}C"; |
/usr/share/elasticsearch/bin/以下(※Ver1.3.2で確認)
https://github.com/elasticsearch/elasticsearch-river-wikipedia
※ElasticSearchのバージョンによってインストールするバージョンが異なるため注意
curl -s https://api.github.com/orgs/twitter/repos?per_page=200 | ruby -rubygems -e 'require "json"; JSON.load(STDIN.read).each { |repo| %x[git clone #{repo["ssh_url"]} ]}' |
pipework
やweave
を利用せずにコンテナに固定IPを設定するには、docker run
で--privileged
オプションを指定し、コンテナ内でIPを設定する方法がある。
$ HOST1=$(docker run --privileged -t -d ubuntu /bin/bash)
$ docker exec $HOST1 ip addr add 192.168.0.10/24 dev eth0
$ HOST2=$(docker run --privileged -t -d ubuntu /bin/bash)
$ docker exec $HOST2 ip addr add 192.168.0.11/24 dev eth0
diff --git a/ext/standard/rand.c b/ext/standard/rand.c | |
index 50729f2..38c405d 100644 | |
--- a/ext/standard/rand.c | |
+++ b/ext/standard/rand.c | |
@@ -293,8 +293,16 @@ PHP_FUNCTION(rand) | |
zend_long number; | |
int argc = ZEND_NUM_ARGS(); | |
- if (argc != 0 && zend_parse_parameters(argc, "ll", &min, &max) == FAILURE) | |
- return; |
<?php | |
function get_ip_address() { | |
$ip_keys = array('HTTP_CLIENT_IP', 'HTTP_X_FORWARDED_FOR', 'HTTP_X_FORWARDED', 'HTTP_X_CLUSTER_CLIENT_IP', 'HTTP_FORWARDED_FOR', 'HTTP_FORWARDED', 'REMOTE_ADDR'); | |
foreach ($ip_keys as $key) { | |
if (array_key_exists($key, $_SERVER) === true) { | |
foreach (explode(',', $_SERVER[$key]) as $ip) { | |
// trim for safety measures | |
$ip = trim($ip); | |
// attempt to validate IP | |
if (validate_ip($ip)) { |