Skip to content

Instantly share code, notes, and snippets.

View hidepin's full-sized avatar

hidepin hidepin

View GitHub Profile
#!/usr/bin/env python
import docx
import re
doc = docx.Document('sample.docx')
illegal_line = re.compile(r'[0-9a-zA-Z]')
for doc_paagraphs in doc.paragraphs:
@hidepin
hidepin / Ansible実践ガイド.md
Last active July 1, 2018 11:48
Ansible実践ガイド

P.82

  • リテラルスタイル(Literal Style)

    • |を利用すyることで、その後の開業を文字列上の開業としてみなす構文
  • 折りたたみスタイル(Folded Style)

    • > 記号を利用し、その後の改行はスペースと置き換えられる構文です。
  • - は上記につけることで、最終行の改行を無効化する

  • 長いコマンドの実行

  • shell: git clone https://github.com/ansible/ansible.git --recursive; cd ./ansible; make install

  • jsp と thymeleafを混合しない``。片方しか使用しない規約を作成
  • joda-timeはjava8でもいるのか?
  • package構成のrepositoryには何を格納するか?
  • テンプレートとしてgenerateされた無駄な記述は削除する
  • Entity クラスが1テーブルではなく、joinが必要な場合にはどうなるか?
  • コレクションを返却する場合は、java.lang.Iterableではなく、ロジックで扱いやすいインタフェース(java.util.Collectionや、java.util.List)でもよい。
  • readonly https://macchinetta.github.io/server-guideline-thymeleaf/current/ja/ImplementationAtEachLayer/DomainLayer.html#domainlayertransactionmanagementwarningdisablecase
  • JDBCのタイムアウトなどはAPLで設定しない
  • configuration は、java config / xmlのどちらにするか?

curl -i -d '{"login_id":"[email protected]","password":"thisisabadpassword"}' http://localhost:8065/api/v3/users/login

curl -i -H 'Authorization: Bearer hyr5dmb1mbb49c44qmx4whniso' http://localhost:8065/api/v3/users/me

curl -i -H 'Authorization: Bearer hyr5dmb1mbb49c44qmx4whniso' "http://localhost:8065/api/v3/teams/all"

curl -i -H 'Authorization: Bearer hyr5dmb1mbb49c44qmx4whniso' "http://localhost:8065/api/v3/teams/members/(team_id)"

curl -i -H 'Authorization: Bearer hyr5dmb1mbb49c44qmx4whniso' "http://localhost:8065/api/v3/users/confr4nwmbfx9b7qx3z9anpa3c/get"

git pull --all
git checkout -b update_4.2.1

git mv README.md README.md.local
git mv README.org.md README.md

git commit -v
Rename README.md for update.
git merge --no-ff mattermost/4.2.1
import numpy as np
from matplotlib import pyplot as plt, font_manager

np.random.seed(0)

x = range(5)
y = 10 + 5 *np.random.randn(5)

fig = plt.figure()
  • systemctl でstart/stop/reload以外を定義する場合は、/usr/libexec/initscripts/legacy-actionsの下にスクリプトを配置する
  • legacy-actionの下のスクリプトは、serviceコマンドで実行する
  • showコマンドがある systemctl show chronyd.service
  • PrivateTmpは、そのプロセスしか見えない領域を渡す
  • systemctl edit サービス名 で、/etc/systemd/system/(サービス名).d/override.conf が作成され設定が上書きされる
  • systemctl edit --full サービス名 でコピーしたファイルを編集することになる。systenmctl daemon-reloadも自動実行される
  • journalctl --disk-usage ディスク使用量を確認
  • systemd-cat echo "Test" で、journalログを書き込むことができる
  • journalctl --verify journalの内部の一貫性チェック PASSと表示されれば大丈夫 FAILは破損。破損していた場合は、破損ファイルを破棄して systemd-journald を再起動すればよい。

parent.sh

#!/bin/sh

./child.sh &

wait