Skip to content

Instantly share code, notes, and snippets.

View wreulicke's full-sized avatar
💭
I may be slow to respond.

wreulicke wreulicke

💭
I may be slow to respond.
View GitHub Profile
@wreulicke
wreulicke / userdata
Last active March 6, 2020 00:52
負荷試験で使う感じのuserdata
#!/bin/bash
sudo yum update
sudo yum install unbound jq -y
sudo systemctl enable unbound.service
sudo sed -i 's/PEERDNS=yes/PEERDNS=no/g' /etc/sysconfig/network-scripts/ifcfg-eth0
sudo sed -i 's/nameserver .*/nameserver 127.0.0.1/g' /etc/resolv.conf
sudo systemctl start unbound.service
cat <<EOF | sudo tee -a /etc/security/limits.conf
@wreulicke
wreulicke / test.tf
Last active March 2, 2020 16:51
いい感じでauto_scaling_groupでec2を立ち上げつつ、ssm agentで接続できるようにするやつ
locals {
key_name = "saito-load-test"
user_data = ""
}
data "aws_availability_zones" "available" {
state = "available"
}
@wreulicke
wreulicke / config.go
Last active February 27, 2020 19:29
heetch/confitaのサンプル
package config
import (
"context"
"os"
"path/filepath"
"strings"
"github.com/heetch/confita"
"github.com/heetch/confita/backend"
To use the bundled libc++ please add the following LDFLAGS:
LDFLAGS="-L/usr/local/opt/llvm/lib -Wl,-rpath,/usr/local/opt/llvm/lib"
llvm is keg-only, which means it was not symlinked into /usr/local,
because macOS already provides this software and installing another version in
parallel can cause all kinds of trouble.
If you need to have llvm first in your PATH run:
echo 'export PATH="/usr/local/opt/llvm/bin:$PATH"' >> ~/.bash_profile
@wreulicke
wreulicke / no-console-use-mylogger.js
Last active December 24, 2019 00:55
console statementをESLint Pluginでfixするやつ
module.exports = {
rules: {
"no-console-use-mylogger": ["error", { "loggerName": "logger", "logger": "winston" }]
}
}
version: '3.7'
services:
myapp:
image: myapp
ports:
- "3001:3001"
labels:
com.datadoghq.ad.check_names: '["prometheus"]'
com.datadoghq.ad.init_configs: '[{}]'
com.datadoghq.ad.instances: '[{"prometheus_url": "http://%%host%%:3001/actuator/prometheus", "extra_headers": {"Accept": "text/plain"}, "namespace": "local.test","metrics": ["jvm*"]}]'
@wreulicke
wreulicke / RequestIdInterceptor.java
Created December 12, 2019 02:59
Add SQL Comment with RequestID to all sql.
package com.wreulicke.github.mybatis;
import org.apache.ibatis.executor.statement.StatementHandler;
import org.apache.ibatis.mapping.BoundSql;
import org.apache.ibatis.mapping.MappedStatement;
import org.apache.ibatis.mapping.SqlCommandType;
import org.apache.ibatis.plugin.Interceptor;
import org.apache.ibatis.plugin.Invocation;
import org.slf4j.MDC;
import org.springframework.jdbc.core.SqlProvider;
@wreulicke
wreulicke / buildspec.yml
Last active December 11, 2019 11:28
S3からS3のpipeline
version: 0.2
phases:
install:
runtime-versions:
docker: 18
java: openjdk11
commands:
- echo Starting...
build:
@wreulicke
wreulicke / PaymentService.java
Last active November 7, 2019 21:28
運用を支えるためのログを出すにはどうするかのソース
class PaymentService {
public void purchase(Product product) {
// なんかいい感じの処理がある
log.info("決済が完了しました");
}
}
@wreulicke
wreulicke / test.md
Last active October 16, 2019 20:57
  • 予約周りの処理の改善
  • 設計部分まで弄るのが出来なかった
    • 小手先のコードの改善に頼っていた節がある
    • DB力の無さを感じる。ここは僕の課題
  • api/users/:id をもっと改善したかった
  • めっちゃ重くない?このAPI・・・