發表文章

docker Volume 常用 小筆記

  docker Volume 小筆記 查看Volume list docker volume ls 查看 Docker 目前使用空間 docker system df 查看Volume 空間 docker system df -v 清除未使用Volume docker volume prune 強制清除 docker volume prune -f 備份/還原 Volume 記得請先 stop container 將Volume備份到 /tmp/[匯出filename].tar.bz2 docker run --rm -v [你的Volum名稱]:/volume -v /tmp:/backup alpine tar -cjf /backup/[匯出filename].tar.bz2 -C /volume ./ 將Volume還原 docker run --rm -v [你的Volum名稱]:/volume -v /tmp:/backup alpine sh -c "rm -rf /volume/* /volume/..?* /volume/.[!.]* ; tar -C /volume/ -xjf /backup/[匯出filename].tar.bz2" 常用CMD 刪除by name docker volume rm {名稱/id} hackmd

Python Code Statement / Comment Method

Python Code Statement / Comment Method dict default foreach Code a_dict = { 'color' : 'blue' , 'fruit' : 'apple' , 'pet' : 'dog' } for key in a_dict: print(key) output color fruit pet foreach .items() Code a_dict = { 'color' : 'blue' , 'fruit' : 'apple' , 'pet' : 'dog' } for key in a_dict.items(): print(key) output ( 'color' , 'blue' ) ( 'fruit' , 'apple' ) ( 'pet' , 'dog' ) Code for key, value in a_dict.items(): print(key, '->' , value) Output color -> blue fruit -> apple pet -> dog datatime String(ISO8601) to Datetime lAt: datetime = dateutil.parser.parse( "2019-09-07T-15:50+00" ) datetime to ISO8601 String time=datetime.now() time.isoformat() JSON Json String to dict qobj = json.loads(jstr) dict to JSON String jstr = json.dumps(dictObj) escape unescape url import urllib.par...

如何安裝 anaconda 上找不到的module

圖片
  如何安裝 anaconda 找不到的module 在IDE無法自動安裝套件 Collecting package metadata (current_repodata.json): ...working... done Solving environment: ...working... failed with initial frozen solve. Retrying with flexible solve. Collecting package metadata (repodata.json): ...working... done Solving environment: ...working... failed with initial frozen solve. Retrying with flexible solve. PackagesNotFoundError: The following packages are not available from current channels: - python-dotenv Current channels: - https://repo.anaconda.com/pkgs/main/win- 64 - https://repo.anaconda.com/pkgs/main/noarch - https://repo.anaconda.com/pkgs/r/win- 64 - https://repo.anaconda.com/pkgs/r/noarch - https://repo.anaconda.com/pkgs/msys2/win- 64 - https://repo.anaconda.com/pkgs/msys2/noarch To search for alternate channels that may provide the conda package you 're looking for, navigate to https://anaconda.org and use the search bar at the top of the page. 而且在 environment 如果找不到指定的套件 透過指令...