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
require "bundler/inline" | |
gemfile do | |
source "https://rubygems.org" | |
gem "benchmark-ips" | |
end | |
I = "Rubyist" | |
PHPER = "PHPer" |
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
{ | |
"title": "ISUCON", | |
"description": "https://app.datadoghq.com/dash/integration/30268/ruby-runtime-metrics?tpl_var_service=isucon\nhttps://app.datadoghq.com/dashboard/dzb-2ps-nyf?tpl_var_service=isucon\n\n* [Continuos Profiler](https://app.datadoghq.com/profiling/aggregation?query=service%3Aisucon)\n* [Database Monitoring](https://app.datadoghq.com/databases/queries?query=service%3Aisucon%20-query_signature%3A%2829e4c5d3e6caa593%20OR%20f8ae1cfee57d2d0b%20OR%20946d3a847b4979d5%20OR%203d26034e89167423%20OR%20dfa53796cd30e3e7%29&dbType=MySQL)\n", | |
"widgets": [ | |
{ | |
"id": 3153889567518422, | |
"definition": { | |
"title": "sinatra", | |
"type": "group", | |
"background_color": "vivid_green", |
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
resource "aws_vpc" "isucon" { | |
cidr_block = "172.31.0.0/16" | |
tags = { | |
Name = "isucon VPC" | |
} | |
} | |
resource "aws_subnet" "isucon_public_a" { | |
vpc_id = aws_vpc.isucon.id |
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
# A monkey patch to switch the connection destination from pgbouncer to PostgreSQL only when `rake db:migrate` | |
# | |
# Usage: Put this file to `lib/tasks/db_migrate_monkey_patch.rake` | |
# | |
# https://gist.github.com/sue445/e82bbc8b626e4681f87182aa5981b68d | |
require "tmpdir" | |
require "fileutils" | |
module DbMigrateMonkeyPatch |
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
# Service account for datadog | |
# c.f. https://docs.datadoghq.com/ja/integrations/google_cloud_platform/?tab=datadogussite#setup | |
resource "google_service_account" "datadog" { | |
account_id = "datadog" | |
display_name = "datadog" | |
} | |
# Compute Viewer | |
resource "google_project_iam_binding" "datadog_compute_viewer" { |
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
# zip bomb measures for rubyzip v1.3.0 | |
# c.f. https://github.com/rubysec/ruby-advisory-db/blob/master/gems/rubyzip/CVE-2019-16892.yml | |
# | |
# validate_entry_sizes has been default enabled since rubyzip v2.0.0, but must be explicitly enabled in v1.3.x | |
# | |
# Put this file as `config/initializers/CVE-2019-16892-rubyzip-patch.rb` if rails | |
begin | |
require "zip" | |
require "zip/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
# envリポジトリのcurrent | |
set :env_current, "/home/deploy/docker-gitlab-env/current" | |
set :stack_name, "gitlab" | |
namespace :stack do | |
desc "docker stack deploy" | |
task :deploy do | |
on roles(:app) do | |
within release_path do |
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
version: '3.7' | |
services: | |
redis: | |
restart: always | |
image: sameersbn/redis:4.0.9-2 | |
command: | |
- --loglevel warning | |
deploy: |
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
# 巨大なリポジトリのバックアップを作ろうとするとBackup::Repositoryでエラーになるのでコネクションを明示的に取得するためのモンキーパッチ | |
# (lib/tasks/gitlab/backup.rake よりも後にloadされてほしいのでわざとz_を付与) | |
# https://gitlab.com/gitlab-org/gitlab-ce/blob/v12.2.4/lib/backup/repository.rb | |
# FIXME: gitlab-ceにMRを投げてマージされたら削除したい | |
task :backup_repository_monkey_patch do | |
module BackupRepositoryMonkeyPatch | |
MAX_RETRY_COUNT = 1 | |
def backup_custom_hooks(project) |
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
stages: | |
- test | |
- deploy | |
.default: &default | |
image: sue445/awscli-all | |
variables: | |
GITPANDA_VERSION: v0.3.4 | |
AWS_DEFAULT_REGION: ap-northeast-1 |
NewerOlder