Skip to content

Posts

エリック・エヴァンスのドメイン駆動設計

やっっっっっと読み終わった。 買ったのが2月9日で、Kindleのセールで他にも色々買ったので読み始めたのは夏ぐらいだったかな。。 評判通り?難解だった。

「ユビキタス言語」くらいしかキーワード知らなかった状態で読み始めて、なんとなくドメイン駆動設計の雰囲気はわかるようになったと思う。 チームの共通理解とかレベル合わせとか実際の現場で導入するには難しそうだけど、チャンスがあれば試してみたいところ。

Read more

Pythonの文法を覚えた人がもっと理解を深めるための本

Prime Readingに入っていたので、読みつつ例文を写経して動かしてみた。

PythonはLambdaで通知をSlackに飛ばすためにちょっと触ってみた程度。

Pythonの文法を覚えた人がもっと理解を深めるための本 Kindle版

しばらくRubyをやっていたせいか、割とすんなり理解することができたように思う。

そう考えると、Rubyがオブジェクト指向を身につけるには良いというのも納得。

Read more

hugoのテーマを変えてみる

  • HermitからInkblottyへ。
  • ちょっと使い勝手が合わないところがあったのでforkして改造。

変更したところ

  • カテゴリとアーカイブ使ってないのにサイドバーに表示されているのを非表示に

ハマったところ

  • 最近の投稿が表示されないのはpostSectionsパラメータが違っていた
  • config.toml で設定したら表示された

JAWS-UG コンテナ支部 #15

https://jawsug-container.connpass.com/event/143245/

AWS コンテナサービスアップデート トリ / Amazon Web Services Japan

  • コンテナロードマップは what’s new に載ってない
  • トランキングENIと通常のENIの違いは「ほとんど」ない
  • EKS 名称変更が一番シェアされたツイート

mazon ECSの開発環境を動的に管理するツールを作ってみました プログラミングヤクザ / サイバーエージェント

  • devxx環境の自動化
  • 作るのに時間がかかるALBを共有化する
  • PRと環境が対になる
    • create PR すると create ENV
    • close PR すると delete ENV
  • dev00 は reference として使う
  • github.com/baikonur-oss/docs で公開しました

Fargate運用物語 ~ 本当にコンテナで幸せになりますか? ~ 曽根 壮大 / オミカレ

  • EC2で困ってないならEC2で良い
  • 冪等性を担保するAnsibleは難しい  - 頻繁に変更があるならコンテナのほうが向いている
  • サイドカー増やしたくなったらEC2でいいんじゃないか
  • 解決したい問題のスコープ大事

How Fast can your Fargate Scale? Pahud Hsieh / Amazon Web Services

  • スケールアップの検知を早くする(1〜3分→10秒以下)
  • StepFunctionでstausをcorrectする(3秒ごと)

Hugoの導入

  • やってみよう

インストール

https://gohugo.io/getting-started/installing/#linux を見たら apt でいけるらしいので

$ apt install hugo
$ hugo version
Hugo Static Site Generator v0.18.1 BuildDate: 2016-12-31T01:01:10+09:00

v0.18.1 ってだいぶ古い。。

$ sudo apt remove hugo
$ wget https://github.com/gohugoio/hugo/releases/download/v0.57.2/hugo_extended_0.57.2_Linux-64bit.tar.gz
$ sha256sum hugo_extended_0.57.2_Linux-64bit.tar.gz 
f4ce91d6909d489fe5461633f6b6bd689ed14c9e06b1b7af110024420aa8fd91  hugo_extended_0.57.2_Linux-64bit.tar.gz
$ tar zxvf hugo_extended_0.57.2_Linux-64bit.tar.gz 
LICENSE
README.md
hugo
$ sudo cp hugo /usr/local/bin/
$ hugo version
Hugo Static Site Generator v0.57.2-A849CB2D/extended linux/amd64 BuildDate: 2019-08-17T17:57:54Z

OK。

サイト作成

$ hugo new site blog

テーマ追加

$ cd blog
$ git clone https://github.com/Track3/hermit.git themes/hermit
$ echo 'theme = "hermit"' >> config.toml

コンテンツ追加

$ hugo new posts/my-first-post.md

表示確認

$ hugo server -D
Building sites … ERROR 2019/08/21 11:29:11 render of "section" failed: execute of template failed: template: _default/list.html:21:50: executing "main" at <.Site.Params.dateformshort>: invalid value; expected string
ERROR 2019/08/21 11:29:11 render of "taxonomyTerm" failed: execute of template failed: template: _default/list.html:21:50: executing "main" at <.Site.Params.dateformshort>: invalid value; expected string
ERROR 2019/08/21 11:29:11 render of "taxonomy" failed: execute of template failed: template: _default/list.html:21:50: executing "main" at <.Site.Params.dateformshort>: invalid value; expected string
Total in 167 ms
Error: Error building site: failed to render pages: render of "page" failed: "/home/umemak/blog/themes/hermit/layouts/posts/single.html:22:54": execute of template failed: template: posts/single.html:22:54: executing "main" at <.Site.Params.dateform>: invalid value; expected string

なんかエラーでた。。 hermit/exampleSite/config.tomlconfig.tomlにコピーして解消。 [params]セクションがないとだめらしい。

Read more

ruby gem のアップデート

  • Githubから脆弱性の通知が来たので、nokogiriを1.10.4以上に、actionviewを5.1.6.2以上にバージョンアップ対応する。
  • 作業環境はC223NAのdocker。
$ docker run -it -v `pwd`:/usr/src/work ruby bash
# cd /usr/src/work
# bundle update nokogiri
# bundle list nokogiri
/usr/local/bundle/gems/nokogiri-1.10.4
  • 最初nokogiriの通知しか出てなかったのに、更新してpushしたらもういっこうあるでってactionview出てきた。。
  • actionview は、bundle update actionviewでは更新されず、bundle updateで全部上げるようにしたら上がった。

mercari.go

https://mercari.connpass.com/event/141122/

19:40 ~ morikuni GopherCon 2019

  • GopherConとは
    • 2014年デンバーで始まった。いろんなところでやっている。
    • 今年はサンディエゴで開催
      • 1800人を超える参加者
  • Mercariの関わり
    • Silver Sponsor
    • BOLD Scholarship
      • 学生向け
    • 11+2名参加
  • 1日目はワークショップ
  • 2日目3日目は発表がメイン
  • 4日目はコミュニティデイ
    • LTとか
  • One MOre Thing
    • Generics(Contracts)
    • Interfaceとの違い
      • 直和型

19:50 ~ mark.hahn Workshop: Go-Beginner Training

  • 英語の発表だけど聞き取りやすかった
  • Goは1日で習得できる(シンプル)

20:00 ~ micnnicim How Uber Goes

  • 1500サービス、200M行がGoで書かれている
  • MONOREPOへの移行
  • uber-go/fx
    • アプリケーションフレームワーク
  • glue
    • 非公開ライブラリ
    • クリーンアーキテクチャ
  • Bazel
    • OSSのビルドツール
    • monorepoに効く?

20:15 ~ upamune How I Write HTTP Web Services After Eight Years

20:25 ~ taqboz TinyGo

  • Small is going big
  • LLVMを使ったGoコンパイラ
  • WebAssembly対応
  • Goroutineのサポートが不完全
  • 使えない標準パッケージが多い(net系全滅)
  • IoTデバイス、マイクロコントローラーでの活用
  • Drone飛ばすデモ

20:40 ~ hunter PKI for Gophers

  • 暗号化の話
  • Hardware Keys
    • YubiKey

20:50 ~ yuki.ito Workshop: Observability in Go & Socket to me: Where do Sockets live in Go?

Go Quiz

  • 型厳密なのな。。

Rails6を試す

  • リリースされていたので、アップデートしてみる https://weblog.rubyonrails.org/2019/8/15/Rails-6-0-final-release/
  • 対象 https://github.com/umemak/hello_app
  • Gemfileを編集
    gem 'rails', '>=6.0.0'
    
  • bundle updateする環境を準備
    docker run -it -v `pwd`:/usr/src/work ruby bash
    
  • bundle update
    root@5655bc438c4d:/usr/src/work# bundle update
    Fetching gem metadata from https://rubygems.org/............
    Fetching gem metadata from https://rubygems.org/.
    Resolving dependencies....
    Bundler could not find compatible versions for gem "railties":
      In Gemfile:
        coffee-rails (= 4.2.2) was resolved to 4.2.2, which depends on
          railties (>= 4.0.0)
    
        jquery-rails (= 4.3.1) was resolved to 4.3.1, which depends on
          railties (>= 4.2.0)
    
        rails (>= 6.0.0) was resolved to 6.0.0, which depends on
          railties (= 6.0.0)
    
        sass-rails (= 5.0.6) was resolved to 5.0.6, which depends on
          railties (>= 4.0.0, < 6)
    
        web-console (= 3.5.1) was resolved to 3.5.1, which depends on
          railties (>= 5.0)
    
    Bundler could not find compatible versions for gem "spring":
      In Gemfile:
        spring (= 2.0.2)
    
        spring-watcher-listen (= 2.0.1) was resolved to 2.0.1, which depends on
          spring (>= 1.2, < 3.0)
    
    とりあえず、エラーになっているgemのバージョン指定に>=をつけてupdateできた。
    root@5655bc438c4d:/usr/src/work# rails -v
    Rails 6.0.0
    
  • 動作確認
    rails s
    
    execjsでエラー。https://github.com/rails/execjs の通りにgemをインストール
    gem install execjs
    
    まだエラー。JSの実行環境も必要らしいのでnodejsをインストール
    apt update
    apt install nodejs -y
    
    root@d02c06050dc6:/usr/src/work# rails s
    => Booting Puma
    => Rails 6.0.0 application starting in development 
    => Run `rails server --help` for more startup options
    Puma starting in single mode...
    * Version 3.9.1 (ruby 2.6.3-p62), codename: Private Caller
    * Min threads: 5, max threads: 5
    * Environment: development
    * Listening on tcp://0.0.0.0:3000
    Use Ctrl-C to stop
    
    動いた! が、port開け忘れた。。。 docker再起動してもいいけどbundle install時間かかるし。。
  • docker commit 別のターミナル開いて、イメージにタグつけて保存して起動しなおす
    $ docker commit 5655bc438c4d rails6test
    $ docker run -it -p 3000:3000 -v `pwd`:/usr/src/work rails6test bash
    root@d02c06050dc6:/usr/src/work# rails s
    => Booting Puma
    => Rails 6.0.0 application starting in development 
    => Run `rails server --help` for more startup options
    Puma starting in single mode...
    * Version 3.9.1 (ruby 2.6.3-p62), codename: Private Caller
    * Min threads: 5, max threads: 5
    * Environment: development
    * Listening on tcp://0.0.0.0:3000
    Use Ctrl-C to stop
    
    できた。
  • http://127.0.0.1:3000
    2019-08-18 02:08:23 +0000: Rack app error handling request { GET / }
    #<LoadError: Error loading the 'sqlite3' Active Record adapter. Missing a gem it depends on? can't activate sqlite3 (~> 1.4), already activated sqlite3-1.3.13. Make sure all dependencies are added to Gemfile.>
    
    む。。。 Gemfileのsqlite3もバージョン指定を緩める。
    Started GET "/" for 172.17.0.1 at 2019-08-18 02:19:05 +0000
    Cannot render console from 172.17.0.1! Allowed networks: 127.0.0.0/127.255.255.255, ::1
       (5.8ms)  SELECT sqlite_version(*)
    Processing by ApplicationController#hello as HTML
      Rendering html template
      Rendered html template (Duration: 1.9ms | Allocations: 5)
    Completed 200 OK in 39ms (Views: 30.3ms | ActiveRecord: 0.0ms | Allocations: 1383)
    
    できた!
  • https://github.com/umemak/hello_app/commit/84cc280f3776cc72d85c9bac088f8ef50cd5eaf8

ghqのインストール

  • 「改訂2版 みんなのGo言語」を買ったのでC101PAで試しながら読みすすめていた。
  • ghqをインストールするところでエラー。
  • どうやらgoのバージョンを1.12以上にあげないとダメらしい。
  • 先日パッケージでインストールしたgoは1.11.6だった。
  • 以前のやり方でインストールし直す
  • ~/.bash_profile の GOROOT/usr/local/go に変更してsourceする。
  • 無事インストール完了。