Elasticsearch で Sudachi 使う
$ brew install maven
brew でいれた最新版(6.2.4) だと sudachi がうまく入れれなかったので 6.2.0 で試す
$ curl -L -O https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-6.2.0.tar.gz $ tar -xvf elasticsearch-6.2.0.tar.gz $ bin/elasticsearch -V Version: 6.2.0, Build: 37cdac1/2018-02-01T17:31:12.527918Z, JVM: 1.8.0_74
sudachi インスコ
$ git clone git@github.com:WorksApplications/elasticsearch-sudachi.git
$ cd elasticsearch-sudachi
$ mvn package
$ ./bin/elasticsearch-plugin install file:///path/to/elasticsearch-sudachi/target/releases/analysis-sudachi-elasticsearch6.2-1.1.0-SNAPSHOT.zip
$ bin/elasticsearch-plugin list
analysis-sudachi
辞書
$ wget https://oss.sonatype.org/content/repositories/snapshots/com/worksap/nlp/sudachi/0.1.1-SNAPSHOT/sudachi-0.1.1-20180419.085027-26-dictionary-core.tar.bz2 $ tar xvf sudachi-0.1.1-20180419.085027-26-dictionary-core.tar.bz2 $ mkdir config/sudachi_tokenizer $ mv system_core.dic ./config/sudachi_tokenizer/system_core.dic $ cat sudachi.json { "settings": { "index": { "analysis": { "tokenizer": { "sudachi_tokenizer": { "type": "sudachi_tokenizer", "mode": "search", "discard_punctuation": true } }, "analyzer": { "sudachi_analyzer": { "filter": [ ], "tokenizer": "sudachi_tokenizer", "type": "custom" } } } } } } $ ls config/sudachi_tokenizer system_core.dic
インデックス作成
$ curl -X PUT -H "Content-Type: application/json" http://localhost:9200/sudachi_test/ -d @sudachi.json {"acknowledged":true,"shards_acknowledged":true,"index":"sudachi_test"}
kibana で確認
動いたところまで。 いろいろ設定してやってみよう
REF
mecab インスコ.sh
docker とか circleci とかも、こんな感じでイケるはず。
元が Google drive なので注意です ⚠
(https://mecab.googlecode.com/files/mecab-0.996.tar.gz とかはもう 404 っぽい)
#!/bin/bash if [ ! -e /usr/local/bin/mecab ]; then # Install mecab cd /var/tmp curl -L -o mecab-0.996.tar.gz "https://drive.google.com/uc?id=0B4y35FiV1wh7cENtOXlicTFaRUE&export=download" tar zxfv mecab-0.996.tar.gz cd mecab-0.996 ./configure make sudo make install # load mecab.so sudo sh -c "echo '/usr/local/lib' >> /etc/ld.so.conf" sudo ldconfig # Install mecab-ipadic cd /var/tmp curl -L -o mecab-ipadic-2.7.0-20070801.tar.gz "https://drive.google.com/uc?id=0B4y35FiV1wh7MWVlSDBCSXZMTXM&export=download" tar zxfv mecab-ipadic-2.7.0-20070801.tar.gz cd mecab-ipadic-2.7.0-20070801 ./configure --with-charset=utf8 make sudo make install fi
かわいいログインフォーム集
かわいい
これ良い可愛い使いたいhttps://t.co/689UKJn9Pn pic.twitter.com/cnQoKCfHw1
— Takasy (@takattata) 2018年4月27日
Oh this is adorable. A little security shade so the wombat can't peek at your password! pic.twitter.com/tlZBdH2igB
— Adam Baldwin (@adam_baldwin) 2018年4月30日
Made an SVG animated login avatar, with the help of some trigonometry & GSAP. #animation #UX #gsap https://t.co/nfWVd0D4va pic.twitter.com/IgpQrlS9RD
— Darin Senneff (@dsenneff) 2018年2月19日
Your animation was a big hit in our office! I made a response in AE for Lottie. pic.twitter.com/3YKwKuoHZ7
— Dave Counts (@davecounts) 2018年3月2日
I have a better one pic.twitter.com/90PxxbczB8
— Gleb Kosteiko (@gleb_kosteiko) 2018年2月26日
実際に使われているページ
JS, CSS での実装例
今度ログインページとかつくるときに
なんかこういうのやりたい
MySQL8.0 on Docker
# 最新版もってくる # https://dev.mysql.com/doc/relnotes/mysql/8.0/en/ $ docker pull mysql:8.0.4 # 確認 $ docker images REPOSITORY TAG IMAGE ID CREATED SIZE mysql 8.0.4 96dd4fed4359 6 weeks ago 291MB # 起動 $ docker run --name mysql8 -e MYSQL_ROOT_PASSWORD=wak9wa9 -d --rm mysql:8.0.4 # 確認 $ docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES da8a09c01b01 mysql:8.0.4 "docker-entrypoint.s…" 2 seconds ago Up 10 seconds 3306/tcp mysql8 # 接続 $ docker exec -it mysql8 mysql -uroot -pwa9wa9 mysql: [Warning] Using a password on the command line interface can be insecure. Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 11 Server version: 8.0.4-rc-log MySQL Community Server (GPL) Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql> select version() as mysql_version; +---------------+ | mysql_version | +---------------+ | 8.0.4-rc-log | +---------------+ 1 row in set (0.00 sec) # MySQL クライアントがなくてもこれでイケる $ docker run -it -v $HOME/tmp/mysql8/:/var/host --link mysql8:mysql --rm mysql:8.0.4 sh -c 'exec mysql -h mysql -uroot -pwa9wa9 -P3306'
-v オプションがミソっぽい (docker で立ち上げたコンテナの上に、ホストのソースコードをバインドマウントする)
これで 違うconf 読み込むとかもできる
# カスタム conf $ cat /tmp/custom.cnf [mysqld] default_authentication_plugin= mysql_native_password # conf 指定、port 変更 $ docker run -v $HOME/tmp/:/etc/mysql/conf.d --name mysql8 -e MYSQL_ROOT_PASSWORD=wa9wa9 -d -p 13306:3306 --rm mysql:8.0.4 # これで localhost の MySQLクライアントからも接続できる $ mysql -u root -p -h 127.0.0.1 -P 13306
REF
- Docker で唐突に MySQL 8.0 を試したくなったときにシュッと環境を用意するメモ | Cry for the Moon : https://mozami.me/2017/10/07/mysql_docker.html
- Dockerの公式MySQLイメージの使い方を徹底的に解説するよ · DQNEO起業日記 : http://dqn.sakusakutto.jp/2015/10/docker_mysqld_tutorial.html