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
lambda do |env| | |
if /^(GET|POST|HEAD)/.match(env(["REQUEST_METHOD"])) | |
return [200, {},[]] | |
end | |
[405, {'content-type' => 'text/plain'}, ["Method Not Allowed\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
[Unit] | |
Description=H2O the optimized HTTP/1, HTTP/2 server | |
After=syslog.target network.target remote-fs.target nss-lookup.target | |
[Service] | |
Type=forking | |
PIDFile=/var/run/h2o/h2o.pid | |
ExecStartPre=/usr/local/bin/h2o -c /etc/h2o/h2o.conf -t | |
ExecStart=/usr/local/bin/h2o -c /etc/h2o/h2o.conf -m daemon | |
ExecReload=/bin/kill -s HUP $MAINPID |
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
user: nobody | |
listen: | |
port: 80 | |
host: 0.0.0.0 | |
listen: | |
port: 443 | |
ssl: | |
key-file: /etc/pki/tls/private/server.key | |
certificate-file: /etc/pki/tls/certs/server.pem |
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
#証明書ファイルの内容を確認 | |
$openssl x509 -text -noout -in /etc/pki/tls/certs/server.crt | |
#秘密鍵ファイルの内容を確認 | |
$openssl rsa -text -noout -in /etc/pki/tls/private/server.key | |
#CSRファイルの内容を確認 | |
$openssl req -text -noout -in /home/hoge/ssl/server.csr | |
#簡易サーバを立てての確認 | |
$openssl s_server -accept 10443 -cert server.crt -key server.key -CAfile server.ca -WWW | |
$curl -v https://localhost:10443/ |
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
user: nobody | |
listen: | |
port: 80 | |
host: 0.0.0.0 | |
file.index: ['index.php', 'index.html'] | |
file.send-gzip: ON | |
file.etag: OFF | |
expires: 1 day |
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
NAME = net-snmp-lvs-module | |
VERSION=$(shell cat VERSION) | |
VERSDIR := $(NAME)-$(VERSION) | |
TARFILE := $(NAME)-$(VERSION).tar.gz | |
CC := gcc | |
CFLAGS := -fPIC `net-snmp-config --cflags` -Ilibipvs -I/usr/local/src/linux-2.6.32.27/include -Wall -g | |
DEFINES := -DHAVE_NET_IP_VS_H | |
DLFLAGS := -fPIC -shared -g | |
LIBS := `net-snmp-config --netsnmp-libs` | |
LIBIPVS := libipvs/libipvs.a |
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 | |
use strict; | |
use warnings; | |
my $app = sub { | |
my $env = shift; | |
return [ 200, | |
[ 'Content-Type' => 'text/plain' ], | |
[ "Hello World" ], | |
]; |
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
--- ss_tcp_connections_old.php 2012-11-28 02:59:13.074710576 +0900 | |
+++ ss_tcp_connections_new.php 2012-11-28 02:46:47.472714312 +0900 | |
@@ -1,25 +1,30 @@ | |
<?php | |
-/* do NOT run this script through a web browser */ | |
+require_once 'Console/CommandLine.php'; | |
-if (!isset($_SERVER["argv"][0]) || isset($_SERVER['REQUEST_METHOD']) || isset($_SERVER['REMOTE_ADDR'])) { | |
- die("<br><strong>This script is only meant to run at the command line.</strong>"); | |
+$parser = new Console_CommandLine(array( |
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 | |
use strict; | |
use warnings; | |
use Net::HandlerSocket; | |
use Data::Dumper qw/Dumper/; | |
my $args = { host => 'localhost', port => 9998 }; | |
my $hs = new Net::HandlerSocket($args); |
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/gawk -f | |
BEGIN { | |
for (i = 1;i < ARGC;i ++) { | |
cnt = 0; | |
while(getline < ARGV[i] > 0) { | |
cnt ++; | |
} | |
print ARGV[i]":"cnt | |
} | |
} |
NewerOlder