Memoru

System Engineering and Programming and IT

1905-conda-operation

**** 1905-conda-operation

  • [ ] FIXME Add articles for configuring requirements.txt

*** overview

  • logged operations of conda.

*** reference

*** logs

** execute Anaconda Prompt

  1. win-key
  2. input anaconda prompt
  3. operate console below:
(base) C:\Users\sakai>onme
(base) C:\Users\sakai>cd g:\workspace\py
(base) C:\Users\sakai>g:
(base) g:\workspace\py>dir
 Volume in drive G is Users
 Volume Serial Number is 04A1-7D2F

 Directory of g:\workspace\py

04/03/2019  06:37 PM    <DIR>          .
04/03/2019  06:37 PM    <DIR>          ..
04/01/2019  07:07 PM    <DIR>          1904-dso
               0 File(s)              0 bytes
               3 Dir(s)  43,630,772,224 bytes free

(base) g:\workspace\py>conda info -e
# conda environments:
#
base                  *  G:\Anaconda3
django                   G:\Anaconda3\envs\django
drf                      G:\Anaconda3\envs\drf
env                      G:\Anaconda3\envs\env
jup                      G:\Anaconda3\envs\jup
ml                       G:\Anaconda3\envs\ml


(base) g:\workspace\py>

** activate jupyter environment and make workspace

(base) g:\workspace\py>conda activate jup

(jup) g:\workspace\py>mkdir pandas-1904

(jup) g:\workspace\py>cd pandas-1904

(jup) g:\workspace\py\pandas-1904>pip freeze
backcall==0.1.0
bleach==3.0.2
certifi==2018.11.29
colorama==0.4.0
cycler==0.10.0
decorator==4.3.0
entrypoints==0.2.3
ipykernel==5.1.0
ipython==7.2.0
ipython-genutils==0.2.0
ipywidgets==7.4.2
jedi==0.13.1
Jinja2==2.10
jsonschema==2.6.0
jupyter==1.0.0
jupyter-client==5.2.3
jupyter-console==6.0.0
jupyter-core==4.4.0
kiwisolver==1.0.1
MarkupSafe==1.1.0
matplotlib==3.0.2
mistune==0.8.4
nbconvert==5.3.1
nbformat==4.4.0
notebook==5.7.2
numpy==1.15.4
pandas==0.23.4
pandocfilters==1.4.2
parso==0.3.1
pickleshare==0.7.5
prometheus-client==0.4.2
prompt-toolkit==2.0.7
Pygments==2.2.0
pyparsing==2.3.0
python-dateutil==2.7.5
pytz==2018.7
pywinpty==0.5.4
pyzmq==17.1.2
qtconsole==4.4.3
scikit-learn==0.20.2
scipy==1.1.0
seaborn==0.9.0
Send2Trash==1.5.0
six==1.12.0
sklearn==0.0
terminado==0.8.1
testpath==0.4.2
tornado==5.1.1
traitlets==4.3.2
wcwidth==0.1.7
webencodings==0.5.1
widgetsnbextension==3.4.2
wincertstore==0.2
xlrd==1.2.0

(jup) g:\workspace\py\pandas-1904>pip freeze | grep numpy
numpy==1.15.4

(jup) g:\workspace\py\pandas-1904>pip freeze | grep pandas
pandas==0.23.4

(jup) g:\workspace\py\pandas-1904>pip freeze | grep matplotlib
matplotlib==3.0.2

** execute jupyter notebook

(jup) g:\workspace\py\pandas-1904>jupyter notebook
[I 19:34:58.445 NotebookApp] Serving notebooks from local directory: g:\workspace\py\pandas-1904
[I 19:34:58.445 NotebookApp] The Jupyter Notebook is running at:
[I 19:34:58.446 NotebookApp] http://localhost:8888/?token=709c0e9e38b864cef2716a71c473cdc3e4e020ed7729d0ab
[I 19:34:58.449 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[C 19:34:58.715 NotebookApp]

    Copy/paste this URL into your browser when you connect for the first time,
    to login with a token:
        http://localhost:8888/?token=709c0e9e38b864cef2716a71c473cdc3e4e020ed7729d0ab
[I 19:34:59.083 NotebookApp] Accepting one-time-token-authenticated connection from ::1

** deactivate

(jup) g:\workspace\py>deactivate

(base) g:\workspace\py>

** remove --all

(base) g:\workspace\py>conda remove -n jup --all

Remove all packages in environment G:\Anaconda3\envs\jup:


## Package Plan ##

  environment location: G:\Anaconda3\envs\jup


The following packages will be REMOVED:

    backcall:                0.1.0-py37_0
    bleach:                  3.0.2-py37_0
    ca-certificates:         2018.03.07-0
    certifi:                 2018.11.29-py37_0
    colorama:                0.4.0-py37_0
    decorator:               4.3.0-py37_0
    entrypoints:             0.2.3-py37_2
    icu:                     58.2-ha66f8fd_1
    ipykernel:               5.1.0-py37h39e3cac_0
    ipython:                 7.2.0-py37h39e3cac_0
    ipython_genutils:        0.2.0-py37_0
    ipywidgets:              7.4.2-py37_0
    jedi:                    0.13.1-py37_0
    jinja2:                  2.10-py37_0
    jpeg:                    9b-hb83a4c4_2
    jsonschema:              2.6.0-py37_0
    jupyter:                 1.0.0-py37_7
    jupyter_client:          5.2.3-py37_0
    jupyter_console:         6.0.0-py37_0
    jupyter_core:            4.4.0-py37_0
    libpng:                  1.6.35-h2a8f88b_0
    libsodium:               1.0.16-h9d3ae62_0
    m2w64-gcc-libgfortran:   5.3.0-6
    m2w64-gcc-libs:          5.3.0-7
    m2w64-gcc-libs-core:     5.3.0-7
    m2w64-gmp:               6.1.0-2
    m2w64-libwinpthread-git: 5.0.0.4634.697f757-2
    markupsafe:              1.1.0-py37he774522_0
    mistune:                 0.8.4-py37he774522_0
    msys2-conda-epoch:       20160418-1
    nbconvert:               5.3.1-py37_0
    nbformat:                4.4.0-py37_0
    notebook:                5.7.2-py37_1
    openssl:                 1.1.1a-he774522_0
    pandoc:                  2.2.3.2-0
    pandocfilters:           1.4.2-py37_1
    parso:                   0.3.1-py37_0
    pickleshare:             0.7.5-py37_0
    pip:                     18.1-py37_0
    prometheus_client:       0.4.2-py37_0
    prompt_toolkit:          2.0.7-py37_0
    pygments:                2.2.0-py37_0
    pyqt:                    5.9.2-py37h6538335_2
    python:                  3.7.1-h8c8aaf0_6
    python-dateutil:         2.7.5-py37_0
    pywinpty:                0.5.4-py37_0
    pyzmq:                   17.1.2-py37hfa6e2cd_0
    qt:                      5.9.7-vc14h73c81de_0
    qtconsole:               4.4.3-py37_0
    send2trash:              1.5.0-py37_0
    setuptools:              40.6.2-py37_0
    sip:                     4.19.8-py37h6538335_0
    six:                     1.12.0-py37_0
    sqlite:                  3.25.3-he774522_0
    terminado:               0.8.1-py37_1
    testpath:                0.4.2-py37_0
    tornado:                 5.1.1-py37hfa6e2cd_0
    traitlets:               4.3.2-py37_0
    vc:                      14.1-h0510ff6_4
    vs2015_runtime:          14.15.26706-h3a45250_0
    wcwidth:                 0.1.7-py37_0
    webencodings:            0.5.1-py37_1
    wheel:                   0.32.3-py37_0
    widgetsnbextension:      3.4.2-py37_0
    wincertstore:            0.2-py37_0
    winpty:                  0.4.3-4
    zeromq:                  4.2.5-he025d50_1
    zlib:                    1.2.11-h62dcd97_3

Proceed ([y]/n)? y


(base) g:\workspace\py>conda info -e
# conda environments:
#
base                  *  G:\Anaconda3
django                   G:\Anaconda3\envs\django
drf                      G:\Anaconda3\envs\drf
env                      G:\Anaconda3\envs\env
ml                       G:\Anaconda3\envs\ml


(base) g:\workspace\py>

** create environment

(base) g:\workspace\py>conda create -n jup
Solving environment: done


==> WARNING: A newer version of conda exists. <==
  current version: 4.5.11
  latest version: 4.6.9

Please update conda by running

    $ conda update -n base -c defaults conda



## Package Plan ##

  environment location: G:\Anaconda3\envs\jup


Proceed ([y]/n)? y

Preparing transaction: done
Verifying transaction: done
Executing transaction: done
#
# To activate this environment, use
#
#     $ conda activate jup
#
# To deactivate an active environment, use
#
#     $ conda deactivate


(base) g:\workspace\py>
(base) g:\workspace\py>conda activate jup

(jup) g:\workspace\py>pip freeze
alabaster==0.7.11
anaconda-client==1.7.2
anaconda-navigator==1.9.2
anaconda-project==0.8.2
appdirs==1.4.3
asn1crypto==0.24.0
astroid==2.0.4
astropy==3.0.4
atomicwrites==1.2.1
attrs==18.2.0
Automat==0.7.0
Babel==2.6.0
backcall==0.1.0
backports.shutil-get-terminal-size==1.0.0
beautifulsoup4==4.6.3
bitarray==0.8.3
bkcharts==0.2
blaze==0.11.3
bleach==2.1.4
bokeh==0.13.0
boto==2.49.0
Bottleneck==1.2.1
Cerberus==1.2
certifi==2018.11.29
cffi==1.11.5
chardet==3.0.4
click==6.7
cloudpickle==0.5.5
clyent==1.2.2
colorama==0.3.9
comtypes==1.1.7
conda==4.5.11
conda-build==3.15.1
constantly==15.1.0
contextlib2==0.5.5
cryptography==2.3.1
cycler==0.10.0
Cython==0.28.5
cytoolz==0.9.0.1
dask==0.19.1
datashape==0.5.4
decorator==4.3.0
defusedxml==0.5.0
distributed==1.23.1
Django==2.1
djangorestframework==3.8.2
docopt==0.6.2
docutils==0.14
elasticsearch==6.3.0
entrypoints==0.2.3
et-xmlfile==1.0.1
fastcache==1.0.2
filelock==3.0.8
Flask==1.0.2
Flask-Cors==3.0.6
gevent==1.3.6
glob2==0.6
greenlet==0.4.15
gunicorn==19.9.0
h5py==2.8.0
heapdict==1.0.0
html5lib==1.0.1
hyperlink==18.0.0
idna==2.7
imageio==2.4.1
imagesize==1.1.0
incremental==17.5.0
ipykernel==4.10.0
ipython==6.5.0
ipython-genutils==0.2.0
ipywidgets==7.4.1
isort==4.3.4
itsdangerous==0.24
jdcal==1.4
jedi==0.12.1
Jinja2==2.10
jsonschema==2.6.0
jupyter==1.0.0
jupyter-client==5.2.3
jupyter-console==5.2.0
jupyter-core==4.4.0
jupyterlab==0.34.9
jupyterlab-launcher==0.13.1
keyring==13.2.1
kiwisolver==1.0.1
lazy-object-proxy==1.3.1
llvmlite==0.24.0
locket==0.2.0
lxml==4.2.5
MarkupSafe==1.0
matplotlib==2.2.3
mccabe==0.6.1
menuinst==1.4.14
mistune==0.8.3
mkl-fft==1.0.4
mkl-random==1.0.1
more-itertools==4.3.0
mpmath==1.0.0
msgpack==0.5.6
multipledispatch==0.6.0
mysql-connector-python==8.0.13
navigator-updater==0.2.1
nbconvert==5.4.0
nbformat==4.4.0
networkx==2.1
nltk==3.3
nose==1.3.7
notebook==5.6.0
numba==0.39.0
numexpr==2.6.8
numpy==1.15.1
numpydoc==0.8.0
odo==0.5.1
olefile==0.46
openpyxl==2.5.6
packaging==17.1
pandas==0.23.4
pandocfilters==1.4.2
parso==0.3.1
partd==0.3.8
path.py==11.1.0
pathlib2==2.3.2
patsy==0.5.0
Paver==1.3.4
pbr==4.1.0
pep8==1.7.1
pickleshare==0.7.4
Pillow==5.2.0
pkginfo==1.4.2
pluggy==0.7.1
ply==3.11
prometheus-client==0.3.1
prompt-toolkit==1.0.15
psutil==5.4.7
py==1.6.0
pyasn1==0.4.4
pyasn1-modules==0.2.2
pycodestyle==2.4.0
pycosat==0.6.3
pycparser==2.18
pycrypto==2.6.1
pycurl==7.43.0.2
pyflakes==2.0.0
Pygments==2.2.0
pylint==2.1.1
pyodbc==4.0.24
pyOpenSSL==18.0.0
pyparsing==2.2.0
PySocks==1.6.8
pytest==3.8.0
pytest-arraydiff==0.2
pytest-astropy==0.4.0
pytest-doctestplus==0.1.3
pytest-openfiles==0.3.0
pytest-remotedata==0.3.0
python-dateutil==2.7.3
pytz==2018.5
PyWavelets==1.0.0
pywin32==223
pywinpty==0.5.4
PyYAML==3.13
pyzmq==17.1.2
QtAwesome==0.4.4
qtconsole==4.4.1
QtPy==1.5.0
requests==2.19.1
rope==0.11.0
ruamel-yaml==0.15.46
scikit-image==0.14.0
scikit-learn==0.19.2
scipy==1.1.0
seaborn==0.9.0
Send2Trash==1.5.0
service-identity==17.0.0
simplegeneric==0.8.1
singledispatch==3.4.0.3
six==1.11.0
snowballstemmer==1.2.1
sortedcollections==1.0.1
sortedcontainers==2.0.5
Sphinx==1.7.9
sphinxcontrib-websupport==1.1.0
spyder==3.3.1
spyder-kernels==0.2.6
SQLAlchemy==1.2.11
statsmodels==0.9.0
stevedore==1.28.0
sympy==1.1.1
tables==3.4.4
tblib==1.3.2
terminado==0.8.1
testpath==0.3.1
toolz==0.9.0
tornado==5.1
tqdm==4.26.0
traitlets==4.3.2
Twisted==18.7.0
unicodecsv==0.14.1
urllib3==1.23
virtualenv==16.0.0
virtualenv-clone==0.3.0
virtualenvwrapper==4.8.2
wcwidth==0.1.7
webencodings==0.5.1
Werkzeug==0.14.1
widgetsnbextension==3.4.1
win-inet-pton==1.0.1
win-unicode-console==0.5
wincertstore==0.2
wrapt==1.10.11
xlrd==1.1.0
XlsxWriter==1.1.0
xlwings==0.11.8
xlwt==1.3.0
zict==0.1.3
zope.interface==4.5.0

(jup) g:\workspace\py>
(jup) g:\workspace\py>pip freeze | grep numpy
numpy==1.15.1
numpydoc==0.8.0

(jup) g:\workspace\py>pip freeze | grep pandas
pandas==0.23.4

(jup) g:\workspace\py>pip freeze | grep matplotlib
matplotlib==2.2.3

// --- end of markdown --- //

1903-Japan-Statistical-Society-Certificate-3grade

大項目 小項目 ねらい 項目(学習しておくべき用語)
データの種類 データの基礎知識 データのタイプの違いを理解し,それぞれのデータに適した処理法を理解する。 量的データ,質的データ,名義尺度,順序尺度,間隔尺度,比率尺度,連続尺度
標本調査 母集団と標本 標本調査の意味と必要性を理解し,標本の抽出方法や推定方法について説明することができる。 母集団,標本,全数調査,無作為抽出,標本の大きさ,乱数表,国勢調査
実験調査 実験の基本的な考え方 実験調査の意味と必要性を理解し,実験の基本的な考え方について,説明することができる。 実験研究,観察研究,処理群と対照群
統計グラフ 1変数の基本的なグラフの見方・読み方 基本的な1変数の統計グラフを適切に解釈したり,自ら書いたりすることができる。 棒グラフ,折れ線グラフ,円グラフ,帯グラフ,積み上げ棒グラフ,レーダーチャート,バブルチャート,ローソク足
2変数の基本的なグラフの見方 基本的な2変数の統計グラフを適切に解釈したり,自ら書いたりすることができる。 モザイク図,散布図(相関図),複合グラフ
データ集計 1変数データ 1変数のデータを適切に集計表に記述すること,また集計表から適切に情報を読み取り,説明することができる。 度数分布表,度数,相対度数,累積度数,累積相対度数,階級,階級値,度数分布表からの統計量の求め方
2 変数データ 2変数のデータを適切にクロス集計表に記述すること,また集計表から適切に情報を読み取り,説明することができる。 クロス集計表(2 元の度数分布表)
データの代表値 データの代表値 代表値とその利用法数値を用いてデータの中心的位置を表現すること,またそれらを用いて適切にデータの特徴を説明することができる。 平均値,中央値,最頻値
データの散らばり 量的な1変数の散らばりの指標 データの散らばりを,指標を用いて把握し,説明することができる。 最小値,最大値,範囲,四分位数,四分位範囲(四分位偏差),分散,標準偏差,偏差値,変動係数
量的な2変数の散らばりの指標 量的な2つの変数の散らばりを指標から把握し,説明することができる。 共分散,相関係数
散らばりのグラフ表現 データの散らばりをグラフ表現することを通して,散らばりの特徴を把握したり,グループ間の比較を行ったりすることができる。はずれた値の処理を考える。 ヒストグラム(柱状グラフ),累積相対度数グラフ,幹葉図,箱ひげ図,散布図(相関図),はずれ値
確率 確率の基礎 確率の意味や基本的な法則を理解し,さまざまな事象の確率を求めたり,確率を用いて考察することができる。 独立な試行,条件付き確率
時系列データ 時系列データの基本的な見方 時系列情報を持つデータをグラフや指標を用いて適切に表現し,それらの情報を適切に読み取ることができる。 時系列グラフ,指標化,移動平均

1903-jupyter-notebook-shortcuts

jupyter notebook Shortcuts

Overview

  • jupyterを使うにあたり、shortcutを整理する。

List

Command Mode

  • H : Help
  • P ; command Pallet
  • M : Markdown
  • Y : code
  • B : insert cell Below
  • D,D : Delete selected cells
  • V : paste cells below
  • S : Save
  • Ctrl-Enter : run selected cells
  • Shift-Enter : run cell, select below
  • Alt-Enter : run cell and insert below

Contents of Table

key value
H show keyboard shortcuts
P open the command palette
-------------- ----------------------------------------------
M change cell to markdown
R change cell to raw
Y change cell to code
-------------- ----------------------------------------------
A insert cell above
B insert cell below
C copy selected cells
D,D delete selected cells
X cut selected cells
V paste cells below
Shift-V paste cells above
Z undo cell deletion
-------------- ----------------------------------------------
S Save and Checkpoint
Ctrl-S Save and Checkpoint
-------------- ----------------------------------------------
Esc close the pager
Q close the pager
Enter enter edit mode
Alt-Enter run cell and insert below
Ctrl-Enter run selected cells
Shift-Enter run cell, select below
-------------- ----------------------------------------------
Up select cell above
Down select cell below
K select cell above
J select cell below
Space scroll notebook down
Shift-Space scroll notebook up
Shift-Up extend selected cells above
Shift-Down extend selected cells below
Shift-J extend selected cells below
Shift-K extend selected cells above
Shift-M merge selected cells, or current cell with
- cell below if only one cell is selected
-------------- ----------------------------------------------
F find and replace
-------------- ----------------------------------------------
L toggle line numbers
Shift-L toggles line numbers in all cells, and
- persist the setting
O toggle output of selected cells
Shift-O toggle output scrolling of selected cells
-------------- ----------------------------------------------
I,I interrupt the kernel
0,0 restart the kernel (with dialog)
-------------- ----------------------------------------------
1 change cell to heading 1
2 change cell to heading 2
3 change cell to heading 3
4 change cell to heading 4
5 change cell to heading 5
6 change cell to heading 6
-------------- ----------------------------------------------
Ctrl-Shift-F open the command palette
Ctrl-Shift-P open the command palette
-------------- ----------------------------------------------

Edit Mode

  • Tab : code completion or indent
  • Shift-Tab : tooltip
  • Ctrl-] : indent
  • Ctrl-[ : dedent
  • Ctrl-/ : comment
  • Ctrl-D : delete whole line

Contents of Table

Key Value
Esc enter command mode
Ctrl-M enter command mode
------------------ ---------------------------
Ctrl-S Save and Checkpoint
Insert toggle overwrite flag
------------------ ---------------------------
Shift-Enter run cell, select below
Ctrl-Enter run selected cells
Alt-Enter run cell and insert below
------------------ ---------------------------
Ctrl-Shift-F open the command palette
Ctrl-Shift-P open the command palette
Ctrl-Shift-Minus split cell at cursor
------------------ ---------------------------
Ctrl-A select all
Ctrl-/ comment
Ctrl-D delete whole line
------------------ ---------------------------
Ctrl-Z undo
Ctrl-Y redo
Ctrl-U undo selection
Alt-U redo selection
------------------ ---------------------------
Tab code completion or indent
Shift-Tab tooltip
------------------ ---------------------------
Ctrl-] indent
Ctrl-[ dedent
Down move cursor down
Up move cursor up
------------------ ---------------------------
Ctrl-Home go to cell start
Ctrl-Up go to cell start
Ctrl-End go to cell end
Ctrl-Down go to cell end
------------------ ---------------------------
Ctrl-Left go one word left
Ctrl-Right go one word right
Ctrl-Backspace delete word before
Ctrl-Delete delete word after

[EOF]

1808-ubuntu-gibo-installation

* 1808-ubuntu-gibo-installation

Overview

  • gibo (make .gitignore from boiler template)

github.com

installation logs

  • ~/.bashrc
mitsuru@dell:~$ cat ~/.bashrc | grep /home/mitsuru/sh
export PATH="/home/mitsuru/sh:$PATH"
  • procedures
mitsuru@dell:~$ curl -L https://raw.github.com/simonwhitaker/gibo/master/gibo > gibo
mitsuru@dell:~$ chmod +x gibo
mitsuru@dell:~$ mv gibo ~/sh
mitsuru@dell:~$ gibo update
Cloning https://github.com/github/gitignore.git to /home/mitsuru/.gitignore-boilerplates
Cloning into '/home/mitsuru/.gitignore-boilerplates'...
 :
 :
mitsuru@dell:~$ gibo 
gibo 2.1.0 by Simon Whitaker <sw@netcetera.org>
https://github.com/simonwhitaker/gibo

Fetches gitignore boilerplates from https://github.com/github/gitignore

Usage:
    gibo [command]

Example:
    gibo dump Swift Xcode >> .gitignore

Commands:
    dump BOILERPLATE...   Write boilerplate(s) to STDOUT
    help                  Display this help text
    list                  List available boilerplates
    search STR            Search for boilerplates with STR in the name
    update                Update list of available boilerplates
    version               Display current script version

usage

mitsuru@dell:~/workspace/py/service$ gibo dump python vim >> .gitignore
mitsuru@dell:~/workspace/py/service$ ls -la | grep git
drwxr-xr-x 8 mitsuru mitsuru 4096 Aug 23 23:46 .git
-rw-r--r-- 1 mitsuru mitsuru 3181 Aug 24 00:09 .gitignore

1808-ubuntu-apps-enviroment-recording

* 1808-ubuntu-apps-enviroment-recording

Overview

  • I Recorded my pc environment.

Contents

  • Development enviroment
mitsuru@dell:~/Desktop$ git --version
git version 2.18.0
mitsuru@dell:~/Desktop$ conda --version
conda 4.5.4
mitsuru@dell:~/Desktop$ python --version
Python 3.6.5 :: Anaconda, Inc.
mitsuru@dell:~/Desktop$ pip --version
pip 18.0 from /home/mitsuru/miniconda3/lib/python3.6/site-packages/pip (python 3.6)
mitsuru@dell:~/Desktop$ nvm --version
0.33.11
mitsuru@dell:~/Desktop$ npm --version
5.6.0
mitsuru@dell:~/Desktop$ node --version
v8.11.3
mitsuru@dell:~/Desktop$ java -version
openjdk version "1.8.0_181"
OpenJDK Runtime Environment (build 1.8.0_181-8u181-b13-0ubuntu0.18.04.1-b13)
OpenJDK 64-Bit Server VM (build 25.181-b13, mixed mode)
  • Editor and filer
mitsuru@dell:~/Desktop$ vim --version
VIM - Vi IMproved 8.0 (2016 Sep 12, compiled Apr 10 2018 21:31:58)
mitsuru@dell:~/Desktop$ vifm --version
Version: 0.9.1
  • command
mitsuru@dell:~/Desktop$ tree --version
tree v1.7.0 (c) 1996 - 2014 by Steve Baker, Thomas Moore, Francesc Rocher, Florian Sesser, Kyosuke Tokoro 
mitsuru@dell:~/Desktop$ curl --version
curl 7.58.0 (x86_64-pc-linux-gnu) libcurl/7.58.0 OpenSSL/1.1.0g zlib/1.2.11 libidn2/2.0.4 libpsl/0.19.1 (+libidn2/2.0.4) nghttp2/1.30.0 librtmp/2.3
Release-Date: 2018-01-24
Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtmp rtsp smb smbs smtp smtps telnet tftp 
Features: AsynchDNS IDN IPv6 Largefile GSS-API Kerberos SPNEGO NTLM NTLM_WB SSL libz TLS-SRP HTTP2 UnixSockets HTTPS-proxy PSL 

mitsuru@dell:~/Desktop$ ag --version
ag version 2.1.0

Features:
  +jit +lzma +zlib

mitsuru@dell:~/Desktop$ peco --version
peco version v0.5.1
  • command line tool
mitsuru@dell:~/Desktop$ googler --version
3.6
mitsuru@dell:~/Desktop$ etm v
Event and Task Manager
etmtk 3.2.30 [2017-03-31 09:28:19 -0400]

mitsuru@dell:~/Desktop$ khal --version
khal, version 0.9.8
  • services
    • add below
mitsuru@dell:~/Desktop$ sudo service --status-all
[sudo] password for mitsuru: 
 [ + ]  acpid
 [ - ]  alsa-utils
 [ - ]  anacron
 [ + ]  apparmor
 [ + ]  apport
 [ + ]  avahi-daemon
 [ + ]  binfmt-support
 [ + ]  bluetooth
 [ - ]  console-setup.sh
 [ + ]  cron
 [ + ]  cups
 [ + ]  cups-browsed
 [ + ]  dbus
 [ - ]  dns-clean
 [ + ]  elasticsearch
 [ + ]  gdm3
 [ + ]  grub-common
 [ + ]  hddtemp
 [ - ]  hwclock.sh
 [ + ]  irqbalance
 [ + ]  kerneloops
 [ - ]  keyboard-setup.sh
 [ + ]  kmod
 [ + ]  lm-sensors
 [ + ]  network-manager
 [ + ]  networking
 [ - ]  plymouth
 [ - ]  plymouth-log
 [ - ]  pppd-dns
 [ + ]  procps
 [ - ]  rsync
 [ + ]  rsyslog
 [ - ]  saned
 [ + ]  speech-dispatcher
 [ - ]  spice-vdagent
 [ - ]  thermald
 [ + ]  udev
 [ + ]  ufw
 [ + ]  unattended-upgrades
 [ - ]  uuidd
 [ + ]  whoopsie
 [ - ]  x11-common

memo files

mitsuru@dell:~/Documents/memo$ tree
.
|-- etm
|   |-- 2018
|   |   |-- 08.txt
|   |   |-- 180816.txt
|   |   |-- 180817-a.txt
|   |   |-- 180817.txt
|   |   |-- 180818.txt
|   |   `-- 180819.txt
|   |-- FIXME.txt
|   |-- routine.txt -> /home/mitsuru/.etm/data/personal/monthly/2018/routine.txt
|   `-- todo.txt -> /home/mitsuru/.etm/data/personal/monthly/2018/todo.txt
|-- khal
|   |-- ATER2ILAYVKNM65UU2FVIXDHDAPZIAJK265J.ics
|   |-- EY7QTTXV1R1VH0YHC7H1OCIQ6ZAY9RSHHPGH.ics
|   |-- NYGKGX6AWPXM8F29Y1RGLT4I9V9NRKI0VEOH.ics
|   |-- OT7D32CI19CBZ2UZZXYKQBL6LSEEVWGSV1O6.ics
|   `-- SG8SCF1Z1V2QCBGI4V7T96BT5F3ICQ3DQSC7.ics
|-- anchor.md
|-- fixme.md
|-- log.md
|-- memo.md
|-- note.md
`-- tips.md

Desktop apps

  • I decide to use tools that can work on both ubuntu and windows

    • Cloud
      • Journey -- Diary
      • Todoist -- Chores and Errand and GTD
      • Workflowy -- Structured text
    • Sync memos
      • Simplenote -- urls and read after
      • Joplin (Desktop) -- markdown and publish posts
    • Desktop apps
    • Developer tools
      • gitkraken -- git desktop client
      • meld -- diff and merge tool
  • I have to select below tools:

config settings (provisional)

  • additional lines in ~/.bashrc
    • I do use miniconda instead of virtualenvwapper.
export WORKON_HOME=~/.envs
export PROJECT_HOME=~/workspace/py
VIRTUALENVWRAPPER_PYTHON='/usr/bin/python3' # This needs to be placed before the virtualenvwrapper command
#source /usr/local/bin/virtualenvwrapper.sh


# added by Miniconda3 installer
export PATH="/home/mitsuru/miniconda3/bin:$PATH"
# execution sh
. /home/mitsuru/miniconda3/etc/profile.d/conda.sh

export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"  # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"  # This loads nvm bash_completion

# export my environment variables
export ETM_DATA=/home/mitsuru/Documents/memo/etm

# set path for my shell
export PATH="/home/mitsuru/sh:$PATH"

# Startup
cal -3
date
cd ~/Desktop
alias explorer="nautilus ~/Documents &" ## win+2
alias filer="nautilus &" ## win+2
alias mailer="evolution &" ## win+3
alias term="tmux"        ## win+4
alias memo="vim ~/Documents/memo/memo.md"  ## win+6
alias log="vim ~/Documents/memo/log.md"    ## win+7
alias anchor="vim ~/Documents/memo/anchor.md"  ## win+7
alias tips="vim ~/Documents/memo/tips.md"  ## win+7
alias note="vim ~/Documents/memo/note.md"  ## win+7
alias fix='vim ~/Documents/memo/fixme.md'
alias gvim="gvim &"     ## win+7
alias jop="joplin"      ## win+8

## Slack-cli
alias sla="slack-cli -s chat -l 5"    ## win+9
alias slap="slack-cli -d chat $1"     ## win+9
## Twitter-cli
alias rainb="rainbowstream"    ## win+0
## khal
alias knew='khal new $1'
## ETM
alias today='. ~/sh/create_date_file_and_open.sh'
alias home='vifm $ETM_DATA ~/Documents/memo'
alias etma='etm a'

## AG search and edit
alias fixme='ag FIXME ~/Documents/**'

## Folder open
alias workspace='vifm ~/workspace'
alias Pictures='vifm ~/Pictures'
alias Documents='vifm ~/Documents'
alias Downloads='vifm ~/Downloads'

## Achor activity : book retyping
alias work='cd ~/workspace/py; ls ; conda info -e ;'

## Operation
alias reboot='shutdown -r now'
  • ~/.vimrc
    • ! FIXME
" 文字コードをUFT-8に設定
set fenc=utf-8
" バックアップファイルを作らない
set nobackup
" スワップファイルを作らない
set noswapfile
" 編集中のファイルが変更されたら自動で読み直す
set autoread
" バッファが編集中でもその他のファイルを開けるように
set hidden
" 入力中のコマンドをステータスに表示する
set showcmd

" 見た目系
" 行番号を表示
set number
" 現在の行を強調表示
" set cursorline
" 現在の行を強調表示(縦)
" set cursorcolumn
" 行末の1文字先までカーソルを移動できるように
set virtualedit=onemore
" インデントはスマートインデント
set smartindent
" ビープ音を可視化
" set visualbell
" 括弧入力時の対応する括弧を表示
set showmatch
" ステータスラインを常に表示
set laststatus=2
" コマンドラインの補完
set wildmode=list:longest
" 折り返し時に表示行単位での移動できるようにする
nnoremap j gj
nnoremap k gk

" Tab系
" 不可視文字を可視化(タブが「▸-」と表示される)
" set list listchars=tab:\▸\-
" Tab文字を半角スペースにする
set expandtab
" 行頭以外のTab文字の表示幅(スペースいくつ分)
set tabstop=4
" " 行頭でのTab文字の表示幅
set shiftwidth=4

" 検索系
" 検索文字列が小文字の場合は大文字小文字を区別なく検索する
set ignorecase
" 検索文字列に大文字が含まれている場合は区別して検索する
set smartcase
" 検索文字列入力時に順次対象文字列にヒットさせる
set incsearch
" 検索時に最後まで行ったら最初に戻る
set wrapscan
" 検索語をハイライト表示
set hlsearch
" ESC連打でハイライト解除
nmap <Esc><Esc> :nohlsearch<CR><Esc>
" set <ESC> ti ctl+l
imap <c-j> <esc>
imap <c-l> <esc>
set shortmess=aoOtI
set encoding=utf-8
set fileencoding=utf-8
set fileencodings=utf-8,cp932
  • ~/.config/khal/config
[calendars]

[[private]]
path = /home/mitsuru/Documents/memo/khal
type = calendar

[locale]
timeformat = %H:%M
dateformat = %m/%d/%Y
longdateformat = %m/%d/%Y
datetimeformat = %m/%d/%Y %H:%M
longdatetimeformat = %m/%d/%Y %H:%M

[default]
default_calendar = private
  • ~/.etm/etmtk.cfg
calendars:
- - etm 
  - true
  - etm 
- - sample
  - true
  - sample
- - shared
  - true
  - shared
cfg_files:
  completions: []
  reports: []
  users: []
 :
 :
datadir: /home/mitsuru/Documents/memo
dayfirst: false
 :
 :
icscal_file: /home/mitsuru/.etm/etmcal.ics
icsitem_file: /home/mitsuru/.etm/etmitem.ics
icssync_folder: ''
local_timezone: Asia/Tokyo
message_last: 0
message_next: 0
monthly: etm
 :
 :
  • create yymmdd.txt
#!/bin/bash

. ~/sh/lib/date-str.sh
echo "dtm_str=${dtm_str}"
echo "etm_data=${ETM_DATA}"

template=~/sh/templates/memo.txt

process(){
    year_str=`date '+%Y'`
    month_str=`date '+%m'`
    date_str=`date '+%d'`
    file_name=$ETM_DATA/$year_str/$dtm_str.txt

    if [ ! -e $file_name ]
    then
        echo "# ${dtm_str} " > ${file_name}
        echo "" >> ${file_name}
        echo "= @s ${month_str}/${date_str} ${year_str} @b 1 @e 30m " >> ${file_name}
        echo "# Overview " >> ${file_name}
    
        cat $template >> ${file_name}
    fi  

    vim ${file_name}
}

## execution
process

EOF

1808-ubuntu-1804-elasticsearch-installation

1808-ubuntu-1804-elasticsearch-installation

Overview

  • logging installing elasticsearch

Reference

log

java installation

mitsuru@dell:~/Desktop$ sudo add-apt-repository ppa:openjdk-r/ppa
mitsuru@dell:~/Desktop$ sudo apt-get update
mitsuru@dell:~/Desktop$ sudo apt-get install openjdk-8-jdk
mitsuru@dell:~/Desktop$ java -version
openjdk version "1.8.0_181"
OpenJDK Runtime Environment (build 1.8.0_181-8u181-b13-0ubuntu0.18.04.1-b13)
OpenJDK 64-Bit Server VM (build 25.181-b13, mixed mode)

[ ] port allowed setting

  • If accessing from other ip address, we should allow access port of PC firewall
$ sudo ufw allow 9200
$ sudo ufw allow 9300

elasticsearch installation

mitsuru@dell:~/Desktop$ wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add -
OK
mitsuru@dell:~/Desktop$ sudo apt-get install apt-transport-https
mitsuru@dell:~/Desktop$ echo "deb https://artifact.elastic.co/packages/6.x/apt stable main" | sudo tee -a /etc/apt/sources.list.d/eralstic-6.x.list
deb https://artifact.elastic.co/packages/6.x/apt stable main
mitsuru@dell:~/Desktop$ sudo apt-get update
mitsuru@dell:~/Desktop$ sudu apt-get install -y elasticsearch
mitsuru@dell:~/Desktop$ sudo dpkg -l | grep elasticsearch
ii  elasticsearch                                               6.3.2                                       all          Elasticsearch is a distributed RESTful search engine built for the cloud. Reference documentation can be found at https://www.elastic.co/guide/en/elasticsearch/reference/current/index.html and the 'Elasticsearch: The Definitive Guide' book can be found at https://www.elastic.co/guide/en/elasticsearch/guide/current/index.html

set java vm -xms -xmx

  • To set for test environment.
mitsuru@dell:~/Documents$ sudo vim /etc/elasticsearch/jvm.options
-Xms512m
-Xmx512m

service execution

mitsuru@dell:~/Documents$ sudo systemctl enable elasticsearch
mitsuru@dell:~/Documents$ sudo systemctl list-unit-files | grep elastic
elasticsearch.service                      enabled        

mitsuru@dell:~/Documents$ sudo systemctl start elasticsearch
mitsuru@dell:~/Documents$ sudo systemctl is-active elasticsearch
active

mitsuru@dell:~/Desktop$ sudo systemctl status elasticsearch
[sudo] password for mitsuru: 
● elasticsearch.service - Elasticsearch
   Loaded: loaded (/usr/lib/systemd/system/elasticsearch.service; enabled; vendo
   Active: active (running) since Sun 2018-08-19 23:04:59 JST; 8min ago
     Docs: http://www.elastic.co
 Main PID: 22097 (java)
    Tasks: 44 (limit: 4474)
   CGroup: /system.slice/elasticsearch.service
           ├─22097 /usr/bin/java -Xms512m -Xmx512m -XX:+UseConcMarkSweepGC -XX:C
           └─22153 /usr/share/elasticsearch/modules/x-pack/x-pack-ml/platform/li

 8月 19 23:04:59 dell systemd[1]: Started Elasticsearch.

mitsuru@dell:~/Documents$ curl localhost:9200
{
  "name" : "_KWT0WM",
  "cluster_name" : "elasticsearch",
  "cluster_uuid" : "NCvxionYRdm6z78IbUKD5A",
  "version" : {
    "number" : "6.3.2",
    "build_flavor" : "default",
    "build_type" : "deb",
    "build_hash" : "053779d",
    "build_date" : "2018-07-20T05:20:23.451332Z",
    "build_snapshot" : false,
    "lucene_version" : "7.3.1",
    "minimum_wire_compatibility_version" : "5.6.0",
    "minimum_index_compatibility_version" : "5.0.0"
  },
  "tagline" : "You Know, for Search"
}

add plugin analysis-kuromoji and analysis-icu

  • need restart service
(pyconle) mitsuru@dell:~/workspace/py/importjson$ cd /usr/share/elasticsearch/
(pyconle) mitsuru@dell:/usr/share/elasticsearch$ ls
bin  lib  modules  NOTICE.txt  plugins  README.textile
(pyconle) mitsuru@dell:/usr/share/elasticsearch$ sudo bin/elasticsearch-plugin install analysis-kuromoji
[sudo] password for mitsuru: 
-> Downloading analysis-kuromoji from elastic
[=================================================] 100%   
-> Installed analysis-kuromoji

(pyconle) mitsuru@dell:/usr/share/elasticsearch$ sudo bin/elasticsearch-plugin install analysis-icu
-> Downloading analysis-icu from elastic
[=================================================] 100%   
-> Installed analysis-icu

(pyconle) mitsuru@dell:/usr/share/elasticsearch$ sudo systemctl restart elasticsearch
(pyconle) mitsuru@dell:/usr/share/elasticsearch$ sudo systemctl status elasticsearch
● elasticsearch.service - Elasticsearch
   Loaded: loaded (/usr/lib/systemd/system/elasticsearch.service; enabled; vendor preset: enabled)
   Active: active (running) since Sun 2018-08-19 23:58:45 JST; 11s ago
     Docs: http://www.elastic.co
 Main PID: 23173 (java)
    Tasks: 18 (limit: 4474)
   CGroup: /system.slice/elasticsearch.service
           ├─23173 /usr/bin/java -Xms512m -Xmx512m -XX:+UseConcMarkSweepGC -XX:CMSInitiatingOccupancyFraction=75 -XX:+UseCMSInitiatingOccupancyOnl
           └─23228 /usr/share/elasticsearch/modules/x-pack/x-pack-ml/platform/linux-x86_64/bin/controller

 8月 19 23:58:45 dell systemd[1]: Started Elasticsearch.
lines 1-11/11 (END)

[EOF]

1808-wsl-git-configuration-and-conda-configuration

1808-wsl-git-configuration-and-conda-configuration

environment variables

sakai@eX:~$ env | grep HOME
HOME=/mnt/g/wsl_home/sakai
PROJECT_HOME=/mnt/g/workspace/py

git config

sakai@eX:/mnt/g/workspace/py/importjson$ git config --global user.name 'xxxxxxxxxxxxxxx'
sakai@eX:/mnt/g/workspace/py/importjson$ git config --global user.email 'xxxxxxxxxxxxxxx@google.com'
sakai@eX:/mnt/g/workspace/py/importjson$ git config --global core.autocrlf false
sakai@eX:/mnt/g/workspace/py/importjson$ git config --global core.editor vim
sakai@eX:/mnt/g/workspace/py/importjson$ git config --global diff.tool vimdiff
sakai@eX:/mnt/g/workspace/py/importjson$ git config --global difftool.prompt false
sakai@eX:/mnt/g/workspace/py/importjson$ git config --global merge.tool vimdiff
sakai@eX:/mnt/g/workspace/py/importjson$ git config --global mergetool.prompt false
sakai@eX:/mnt/g/workspace/py/importjson$ git config --global --list

user.name=xxxxxxxxxxxxx
user.email=xxxxxxxxxxxxx@google.com
core.editor=vim
core.autocrlf=false
diff.tool=vimdiff
difftool.prompt=false
merge.tool=vimdiff
mergetool.prompt=false

conda

  • ~/.bashrc
# added by Miniconda3 installer
export PATH="/mnt/g/wsl_home/sakai/miniconda3/bin:$PATH"
# added by hand
. /mnt/g/wsl_home/sakai/miniconda3/etc/profile.d/conda.sh
  • create environment
sakai@eX:~$ pwd
/mnt/g/wsl_home/sakai
sakai@eX:~$ conda --version
conda 4.5.4
sakai@eX:~$ python --version
Python 3.6.5 :: Anaconda, Inc.
sakai@eX:~$ virtualenv --version
16.0.0

sakai@eX:~$ conda info -e
# conda environments:
#
base                  *  /mnt/g/wsl_home/sakai/miniconda3
pyconle                  /mnt/g/wsl_home/sakai/miniconda3/envs/pyconle

sakai@eX:~$ conda create -n sandbox
Solving environment: done


==> WARNING: A newer version of conda exists. <==
  current version: 4.5.4
  latest version: 4.5.9

Please update conda by running

    $ conda update -n base conda



## Package Plan ##

  environment location: /mnt/g/wsl_home/sakai/miniconda3/envs/sandbox


Proceed ([y]/n)? y

Preparing transaction: done
Verifying transaction: done
Executing transaction: done
#
# To activate this environment, use
#
#     $ conda activate sandbox
#
# To deactivate an active environment, use
#
#     $ conda deactivate

sakai@eX:~$ conda info -e
# conda environments:
#
base                  *  /mnt/g/wsl_home/sakai/miniconda3
pyconle                  /mnt/g/wsl_home/sakai/miniconda3/envs/pyconle
sandbox                  /mnt/g/wsl_home/sakai/miniconda3/envs/sandbox

sakai@eX:~$ conda activate sandbox
(sandbox) sakai@eX:~$ cd $PROJECT_HOME
(sandbox) sakai@eX:/mnt/g/workspace/py$ ls
djanbox  djfirst  djfourth  djsecond  djthird  dplate  importjson  janome  sandbox
(sandbox) sakai@eX:/mnt/g/workspace/py$ cd sandbox
(sandbox) sakai@eX:/mnt/g/workspace/py/sandbox$ pip freeze
appdirs==1.4.3
arrow==0.12.1
asn1crypto==0.24.0
Cerberus==1.2
certifi==2018.4.16
cffi==1.11.5
chardet==3.0.4
conda==4.5.4
cryptography==2.2.2
docopt==0.6.2
elasticsearch==6.3.0
etmtk==3.2.36
googler==1.0.1
idna==2.6
Jinja2==2.10
MarkupSafe==1.0
Pillow==5.2.0
pocket==0.3.6
pycosat==0.6.3
pycparser==2.18
pycrypto==2.6.1
pyfiglet==0.7.5
pyOpenSSL==18.0.0
PySocks==1.6.8
python-dateutil==2.7.3
PyYAML==3.13
rainbowstream==1.3.7
requests==2.5.3
ruamel-yaml==0.15.37
six==1.11.0
slack-cli==2.0.3
slacker==0.9.65
twitter==1.18.0
urllib3==1.23
websocket-client==0.39.0
(sandbox) sakai@eX:/mnt/g/workspace/py/sandbox$ pip install -r requirements.txt
(sandbox) sakai@eX:/mnt/g/workspace/py/sandbox$ pip freeze
appdirs==1.4.3
arrow==0.12.1
asn1crypto==0.24.0
Cerberus==1.2
certifi==2018.4.16
cffi==1.11.5
chardet==3.0.4
conda==4.5.4
cryptography==2.2.2
docopt==0.6.2
elasticsearch==6.3.0
etmtk==3.2.36
googler==1.0.1
idna==2.6
Jinja2==2.10
MarkupSafe==1.0
Pillow==5.2.0
pocket==0.3.6
pycosat==0.6.3
pycparser==2.18
pycrypto==2.6.1
pyfiglet==0.7.5
pyOpenSSL==18.0.0
PySocks==1.6.8
python-dateutil==2.7.3
PyYAML==3.13
rainbowstream==1.3.7
requests==2.5.3
ruamel-yaml==0.15.37
six==1.11.0
slack-cli==2.0.3
slacker==0.9.65
twitter==1.18.0
urllib3==1.23
websocket-client==0.39.0
(sandbox) sakai@eX:/mnt/g/workspace/py/sandbox$ explorer.exe .
(sandbox) sakai@eX:/mnt/g/workspace/py/sandbox$ git init
Initialized empty Git repository in /mnt/g/workspace/py/sandbox/.git/

(sandbox) sakai@eX:/mnt/g/workspace/py/sandbox$ git status
On branch master

No commits yet

Untracked files:
  (use "git add <file>..." to include in what will be committed)

        .gitignore
        README.md
        batch_sample/
        configbase.py
        configs/
        docopt_sample/
        inspect_sample.py
        logging.conf
        logging_sample.py
        onme.ps1
        requirements.txt
        standards/
        watchdog_sample/

(sandbox) sakai@eX:/mnt/g/workspace/py/sandbox$ git status
On branch master

No commits yet

Changes to be committed:
  (use "git rm --cached <file>..." to unstage)

        new file:   .gitignore
        new file:   README.md
        new file:   batch_sample/.gitignore
        new file:   batch_sample/README.md
        new file:   batch_sample/batch_sample.py
        new file:   batch_sample/configbase.py
        new file:   batch_sample/configs/config.py
        new file:   batch_sample/configs/default.py
        new file:   batch_sample/logging.conf
        new file:   batch_sample/utils.py
        new file:   configbase.py
        new file:   configs/config.py
        new file:   configs/default.py
        new file:   docopt_sample
        new file:   inspect_sample.py
        new file:   logging.conf
        new file:   logging_sample.py
        new file:   onme.ps1
        new file:   requirements.txt
        new file:   standards/.gitignore
        new file:   standards/add_sample.py
        new file:   standards/calc.py
        new file:   standards/csv_sample.py
        new file:   standards/json_sample.py
        new file:   standards/logging.conf
        new file:   standards/logging_debug.conf
        new file:   standards/unittest_sample.py
        new file:   watchdog_sample/app.py
        new file:   watchdog_sample/configbase.py
        new file:   watchdog_sample/configs/config.py
        new file:   watchdog_sample/configs/config_debug.py
        new file:   watchdog_sample/configs/default.py
        new file:   watchdog_sample/logging_debug.conf
        new file:   watchdog_sample/plugins/a.py
        new file:   watchdog_sample/plugins/b.py
        new file:   watchdog_sample/plugins/c.py
        new file:   watchdog_sample/watchdog_sample.py