Let’s encrypt certbot-auto 更新後出現錯誤

Creating virtual environment...
Installing Python packages...
Installation succeeded.
Traceback (most recent call last):
  File "/opt/eff.org/certbot/venv/bin/letsencrypt", line 7, in <module>
    from certbot.main import main
  File "/opt/eff.org/certbot/venv/local/lib/python2.7/dist-packages/certbot/main.py", line 10, in <module>
    import josepy as jose
  File "/opt/eff.org/certbot/venv/local/lib/python2.7/dist-packages/josepy/__init__.py", line 41, in <module>
    from josepy.interfaces import JSONDeSerializable
  File "/opt/eff.org/certbot/venv/local/lib/python2.7/dist-packages/josepy/interfaces.py", line 8, in <module>
    from josepy import errors, util
  File "/opt/eff.org/certbot/venv/local/lib/python2.7/dist-packages/josepy/util.py", line 4, in <module>
    import OpenSSL
  File "/opt/eff.org/certbot/venv/local/lib/python2.7/dist-packages/OpenSSL/__init__.py", line 8, in <module>
    from OpenSSL import rand, crypto, SSL
  File "/opt/eff.org/certbot/venv/local/lib/python2.7/dist-packages/OpenSSL/rand.py", line 12, in <module>
    from OpenSSL._util import (
  File "/opt/eff.org/certbot/venv/local/lib/python2.7/dist-packages/OpenSSL/_util.py", line 6, in <module>
    from cryptography.hazmat.bindings.openssl.binding import Binding
ImportError: No module named cryptography.hazmat.bindings.openssl.binding

run

ln -s /opt/eff.org/certbot/venv/local/lib64/python2.7/dist-packages/cryptography /opt/eff.org/certbot/venv/local/lib/python2.7/dist-packages/cryptography
ln -s /opt/eff.org/certbot/venv/local/lib64/python2.7/dist-packages/cryptography-2.0.2.dist-info /opt/eff.org/certbot/venv/local/lib/python2.7/dist-packages/cryptography-2.0.2.dist-info
ln -s /opt/eff.org/certbot/venv/local/lib64/python2.7/dist-packages/cffi /opt/eff.org/certbot/venv/local/lib/python2.7/dist-packages/cffi
ln -s /opt/eff.org/certbot/venv/local/lib64/python2.7/dist-packages/cffi-1.10.0.dist-info /opt/eff.org/certbot/venv/local/lib/python2.7/dist-packages/cffi-1.10.0.dist-info
ln -s /opt/eff.org/certbot/venv/local/lib64/python2.7/dist-packages/_cffi_backend.so /opt/eff.org/certbot/venv/local/lib/python2.7/dist-packages/_cffi_backend.so
ln -s /opt/eff.org/certbot/venv/local/lib64/python2.7/dist-packages/.libs_cffi_backend /opt/eff.org/certbot/venv/local/lib/python2.7/dist-packages/.libs_cffi_backend
ln -s /opt/eff.org/certbot/venv/local/lib64/python2.7/dist-packages/zope.interface-4.1.3-py2.7-nspkg.pth /opt/eff.org/certbot/venv/local/lib/python2.7/dist-packages/zope.interface-4.1.3-py2.7-nspkg.pth
ln -s /opt/eff.org/certbot/venv/local/lib64/python2.7/dist-packages/zope.interface-4.1.3-py2.7.egg-info /opt/eff.org/certbot/venv/local/lib/python2.7/dist-packages/zope.interface-4.1.3-py2.7.egg-info
ln -s /opt/eff.org/certbot/venv/local/lib64/python2.7/dist-packages/zope/interface /opt/eff.org/certbot/venv/local/lib/python2.7/dist-packages/zope/interface

 

update 2018-11-30


rm -rf /opt/eff.org/*

#It will probably fail on this one but setups a clean virtual enviroment
./certbot-auto --debug

cd /opt/eff.org/certbot/venv/lib64/python2.7

mv site-packages site-packages.sav

ln -s dist-packages/ site-packages

#Your now ready to run certbot-auto again

./certbot-auto --debug

批次修改Git Commit 作者名及電郵

由於工作關係,需要用到Git 工具,但筆者自己的工作平台設定了Git 的用戶電郵為自家電郵。一但需要用自己的工作平台處理公事,一個不小心,就會留下了自家電郵。。然後。。。

如果只是修改最新的Commit 還好,只要用

git commit --amend --author="Author Name <email@address.com>"

修改再Push 就好。但如果已經累積了幾次Commit,就相檔令人苦惱。

向Google 大神查詢了一番,找到了修改多個Commit 的方法,是用 rebase -i 來作修改。

假設 Git Log 有 Commits

A->B->C->D->E (HEAD)

,E 是 HEAD 也就是目前最新的。想要更改 CDE 這三個 Commit 的作者,首先rebase 回到Commit B

git rebase -i B

會出現

pick C
pick D
pick E

把 pick 改為 edit,

edit C
edit D
edit E

儲存關閉後就會進入 rebase 流程,會回到Commit C,修改作者名再運行git rebase --continue至Commit D ,重覆流程至所有Commit 都修改好

git commit --amend --author="Author Name <email@address.com>"
git rebase --continue

如果你有哪個Commit 不需要修改,只要不把Pick 改成Edit 就好,Git Rebase 會自動跳過。

推薦給初學者的PHP Framework – Codeigniter (2) – 如何安裝 Codeigniter

程度:初學者

說到最適合初接觸MVC框架 (Model–view–controller)及開發應用程式框架,不得不提在台灣廣受歡迎的Codeigniter。作為初次接觸MVC,Codeigniter 是一個良好的工具,讓初學者感受到框架的強大。

在我第一次接觸框架這個名詞,頭腦一片空白,究竟是甚麼東東,要如何「安裝」?如何應用?又如何提升我們的開發速度?

Continue reading “推薦給初學者的PHP Framework – Codeigniter (2) – 如何安裝 Codeigniter”