MacからSSHでAWSのEC2インスタンスへ接続
word pressにyoutubeのチャンネル登録ボタンを設置する
- Google Developer’s website
- チャンネル名またはIDを入力する。
- 生成されたコードをコピペする。
- 完了!
https://developers.google.com/youtube/youtube_subscribe_button
Resolving: Logging before flag parsing goes to stderr.
cloud9、Tensorflowにて下記のエラー。プログラムは実行できるがログが出力されない。
PythonのloggingモジュールとTensorflowのモジュールの相性が悪い。
WARNING: Logging before flag parsing goes to stderr.
解決。
sudo python -m pip install --upgrade absl-py
Python logging
import logging
from _stat import filemode
MYFORMAT='[%(asctime)s]%(filename)s(%(lineno)d): %(message)s'
logging.basicConfig(
filename='./test.log',
filemode='a',
format=MYFORMAT,
datefmt='%Y-%m-%d %H:%M:%S',
level=logging.INFO)
logging.debug('1. This is debug.')
logging.info('2. This is info.')
空きメモリ
$ free -h
total used free shared buffers cached
Mem: 985M 922M 63M 0B 123M 375M
-/+ buffers/cache: 424M 561M
Swap: 488M 33M 455M
上記の場合561Mが空きメモリと考えてよい。
Check Disk Space
df -h
du / -h -t 1G 2>/dev/null
find . -type f -mmin -10
TensorFlow & TFLearn works on Python 3.7
Python3.7 でTFLearnを入れた後TensorFlowを動かそうとして下記のエラー。
No module named ‘tensorflow.contrib’
解決。バージョンの問題。
pip install tensorflow==1.14
Git 基本コマンド
最初
git init
git add -A
git commit -m "first commit"
git remote add origin git@github.com:ユーザー名/リポジトリ名.git
git push origin master
git pull
ユーザー、パスワード保存
git config --global credential.helper store
変更分のみ
git commit -am "commit updated files"
git push origin master
git pull
ローカルの変更を取り消したい場合:
rm 変更を取り消したいファイル名
git pull
Discarding local changes (permanently) to a file:
git checkout -- file名
Discard all local changes to all files permanently:
git reset --hard
その他
git status
git log
git branch
ModuleNotFoundError: No module named ‘pyti’
仮想環境上でpytiをインストールしたが
ModuleNotFoundError: No module named ‘pyti’
のエラー。
python -m pip install pyti
で解決した。pipに紐づいたpythonと実行pythonが違うらしい。