version: '3'
services:
db:
image: mysql:5.7
command: --datadir=/var/lib/mysql/data
environment:
MYSQL_ALLOW_EMPTY_PASSWORD: "yes"
volumes:
- ./tmp/db/mysql:/var/lib/mysql/data
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
require 'mysql2' | |
begin | |
client = Mysql2::Client.new(:host => "db1-proxy.proxy-hogehoge.amazonaws.com", :username => "root", :password => '') | |
while true | |
query = "SHOW GLOBAL VARIABLES WHERE Variable_Name IN ('innodb_read_only', 'server_uuid', 'aurora_server_id');" | |
client.query(query).each do |row| | |
puts row | |
end | |
sleep(0.2) |
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 python3 | |
import http.server as SimpleHTTPServer | |
import socketserver as SocketServer | |
import logging | |
PORT = 8000 | |
class GetHandler( | |
SimpleHTTPServer.SimpleHTTPRequestHandler |
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
irb(main):002:0> I18n.t "views.mypage.menu.postguide" | |
D, [2020-10-31T14:34:36.213031 #1] DEBUG -- : [i18n-debug] ja.views.mypage.menu.postguide => "投稿した台本" | |
=> "投稿した台本" | |
irb(main):003:0> y = YAML.load_file('config/locales/ja.yml'); y['ja']['views']['mypage']['menu']['postguide'] | |
=> "ガイド管理" | |
結果 | |
config/locales/en.ymlに、 'ja'をkeyにしたツリーが混入 |
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 boto3 | |
from random import choices | |
import random | |
from string import ascii_uppercase | |
import base64 | |
import json | |
import datetime | |
client = boto3.client('firehose') |
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
``` | |
[2020-07-27 23:34:59,205][DEBUG][action.search.type ] [Jimaine Szardos] [guides][0], node[X_IXa-xYQASSvENc_aJRrg], [P], s[STARTED]: Failed to execute [org.elasticsearch.action.search.SearchRequest@5556764e] lastShard [true] | |
org.elasticsearch.search.SearchParseException: [guides][0]: query[+status:published],from[-1],size[-1]: Parse Failure [Failed to parse source [{"query":{"bool":{"must":[{"match":{"status":"published"}}]}},"sort":{"_geo_distance":{"location":{"lat":"31","lon":"120"},"order":"asc","unit":"meters"}}}]] | |
at org.elasticsearch.search.SearchService.parseSource(SearchService.java:747) | |
at org.elasticsearch.search.SearchService.createContext(SearchService.java:572) | |
at org.elasticsearch.search.SearchService.createAndPutContext(SearchService.java:544) | |
at org.elasticsearch.search.SearchService.executeQueryPhase(SearchService.java:306) | |
at org.elasticsearch.search.action.SearchServiceTransportAction$5.call(SearchServiceTransportAction.java:231) | |
at org.elasticsearch.search.action.SearchServ |
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
古いrails(4.2)のアプリケーションをDocker化したところ、rails sするとffi_libでsodiumが見つからないというエラー | |
bundle exec ruby -e "require 'rbnacl'" | |
Traceback (most recent call last): | |
12: from -e:1:in `<main>' | |
11: from -e:1:in `require' | |
10: from /usr/local/bundle/gems/rbnacl-4.0.2/lib/rbnacl.rb:6:in `<top (required)>' | |
9: from /usr/local/bundle/gems/rbnacl-4.0.2/lib/rbnacl.rb:6:in `require' | |
8: from /usr/local/bundle/gems/rbnacl-4.0.2/lib/rbnacl/sodium/version.rb:6:in `<top (required)>' | |
7: from /usr/local/bundle/gems/rbnacl-4.0.2/lib/rbnacl/sodium/version.rb:7:in `<module:RbNaCl>' |
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
brew install krb5 | |
brew edit fetchmail | |
``` | |
system "./configure", "--disable-dependency-tracking", "--prefix=#{prefix}", "--with-ssl=#{Formula["openssl"].opt_prefix}","-with-gssapi=#{Formula["krb5"].opt_prefix}" | |
``` | |
brew reinstall --build-from-source fetchmail |
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
require 'logger' | |
log = Logger.new(STDOUT) | |
log.formatter = proc { |severity, datetime, progname, msg| "[#{datetime.strftime('%Y-%m-%d %H:%M:%S%z')}] #{severity} #{msg}\n" } | |
hosts = %w{prd-db01 prd-db01 prd-app01 prd-app02 prd-app03} | |
users = %w{user1 user2 user3 user4 user5 user6 user7} | |
while true | |
host = hosts.sample | |
user = users.sample |
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
* Aurora | |
MySQL [(none)]> show global status like '%threads%'; | |
+------------------------+-------+ | |
| Variable_name | Value | | |
+------------------------+-------+ | |
| Delayed_insert_threads | 0 | | |
| Slow_launch_threads | 0 | | |
| Threads_cached | 2 | | |
| Threads_connected | 5 | |
NewerOlder