rsyncでファイル名を指定して同期

オプション --include と --exclude を用いる。

例えば、
拡張子が、.txt と .jpg のファイルのみを同期する場合

rsync --include '.txt' --include '.jpg' --exclude '' 同期元ディレクトリ名/ 同期先ディレクトリ名/

--exclude '*' を入れるのがポイント。 これを入れないと結局すべてのファイルが同期されてしまう(らしい)。

Github利用の流れ

リモートリポジトリの内容を登録(クローン )

git clone git@github.com:【ユーザー名】/【リポジトリ名】.git
~/.ssh/configで、githubへのssh接続名を"github"で登録している場合は、
git clone github:【ユーザー名】/【リポジトリ名】.git

ブランチの作成

masterブランチを直接編集するのではなく、作業用のブランチ(ここではworkとする)を作成して、そちらで編集する。
masterを統合ブランチ、workをトピックブランチとする。
元にするブランチ上で、
git branch work
もしくは、
git checkout oka
現在のブランチは、git branchで確認。

ブランチを移動

git checkout work

ファイルを追加してコミット

新規にファイル(sample.txt)を作成した場合は、
git add sample.txt
で、ファイルをコミット対象に追加。

コミットする内容を確認

git status

修正を(すべて)コミット

git commit -a
Vimが開かれるので、コメントを追加。

変更をGitHubへ適用(プッシュ)

git push origin work

ブランチの統合

統合ブランチmasterから派生したトピックブランチworkの変更内容をmasterにも適用し、masterとworkを統合するには、
masterブランチへ移動して
git merge work

プル

git pull origin master
git pull origin work
など。 pullしたいブランチ(work)がローカルで作成されていない場合は、
git checkout work origin/work
でOK。

参考

employment.en-japan.com

大量のファイルがあるディレクトリでの"ls"

膨大なの数のファイルがあるディレクトリでlsを実行すると、 処理が多すぎて固まってしまい、ファイルが確認できないことがある。
そうならないための対処法をメモする。

結果をパイプでlessに渡す

ls | less
シンプルなやり方。
ファイル数が膨大な時は、lessの中でCtrl-Cでキャンセルできるので、 固まったターミナルを立ち上げなおす必要は無くなる。

ソートしない

ls -U | less
オプション-Uをつけると、 lsの際に行われるソートが無効になるため高速化が実現できる。

findを使う

find -type f -name '*' | less

さらに早く実行したい場合。
findの特徴は結果が順次出力される点。

参考

大量のファイルがあるディレクトリでのコマンドメモ - Qiita

英語論文のメモ

図(figure)を見せるときの例文

  • Figure 1 shows ...
  • Figure 1 illustrates ... (画を見せる)
  • We visualize .... in Fig. 1.
  • We show ... in Fig. 1.
  • We show, in Fig. 1, ... .
  • In this figure, ....
  • ... is shown in Fig. 1.
  • (see Fig. 1)
  • (see Fig. 1 below)
  • Figs. 1(a)-1(c) (複数のとき)
  • As shown in Fig. 1, ...
  • S + V .....[Fig. 1].
  • This is demonstrated in Fig. 1.
  • Fig.1 is ....
  • We plot in Fig. 1 ....
  • Examples are given in Fig. 1 ...
  • [名詞] shown in Fig. 1
  • The results are plotted in Fig. 1
  • (figure is omitted) (図がない場合)
  • S + V ... as shown in Fig. 1.
  • This figure implies ...
  • ... is observed in Fig. 1.