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
| #!/usr/bin/env bash | |
| # 対象ホストとポートのリストを指定: ex. ('0.0.0.0:22' '1.1.1.1:22') | |
| HOSTS=('<HOST>:<PORT>' '<HOST>:<PORT>') | |
| RUNNING_HOSTS=() | |
| # HipChat のRoom Notification Tokenを指定 | |
| HIPCHAT_TOKEN='<API_TOKEN>' | |
| # HipChat の対象 Room ID を指定 | |
| HIPCAHT_ROOM_ID='<ROOM_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
| # -*- coding: utf-8 -*- | |
| import argparse | |
| import csv | |
| import json | |
| import httpagentparser | |
| import os | |
| oss = {} | |
| browsers = {} |
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
| import flask | |
| app = flask.Flask(__name__) | |
| def test_user_agent(): | |
| ua = 'MySuperBrowser; 0.1;' | |
| app.test_request_context( | |
| environ_base={'HTTP_USER_AGENT': ua} | |
| ) |
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
| #!/usr/bin/env python | |
| # -*- coding: utf-8 -*- | |
| """ | |
| *.rstなファイルを監視してSphinxをbuildするタスク | |
| @see http://kshigeru.blogspot.jp/2013/02/sphinx-livereload.html | |
| """ | |
| import logging | |
| from os import path | |
| from subprocess import Popen, PIPE | |
| from livereload.task import Task |
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
| # -*- coding: utf-8 -*- | |
| import os | |
| import csv | |
| tmpl = open('user.ldif').read() | |
| fh_csv = open('users.csv') | |
| PASSWD = os.environ['LDAP_PASSWD'] | |
| def add_user(row): |
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
| upstream fulcrum { | |
| server 127.0.0.1:5000; | |
| } | |
| server { | |
| listen 443; | |
| server_name <MY_DOMAIN>; | |
| root /home/fulcrum/fulcrum/public; |
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
| # !/bin/sh | |
| # | |
| # chkconfig: 2345 80 30 | |
| # processname: fulcrum | |
| # description: Fulcrum Unicorn process | |
| PORT=5000 | |
| APP_ROOT=/home/fulcrum/fulcrum | |
| UNICORN_PID=$APP_ROOT/tmp/unicorn.pid |
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
| { | |
| "run_list": [ | |
| "recipe[htpasswd]", | |
| "recipe[omnigollum_site]" | |
| ], | |
| "omnigollum_site": { | |
| "base_path": "/home/gollum/wiki", | |
| "wiki_source": "", | |
| "repository": "git://github.com/moqada/omnigollum-site.git", | |
| "ldap": { |
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 { | |
| listen 8880; | |
| server_name gollum; | |
| location / { | |
| proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |
| proxy_set_header Host $http_host; | |
| proxy_redirect off; | |
| proxy_pass http://localhost:9090; | |
| access_log /var/log/nginx/gollum.access.log; |
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
| # -*- coding: utf-8 -*- | |
| import os | |
| import logging | |
| import logging.handlers | |
| from django.conf import settings | |
| from django.utils import simplejson as json | |
| class POSTScanningMiddleware(object): |