Pages

2017年12月26日 星期二

CentOS 6.9安裝Python 2.7與Azure CLI

在Azure上的CentOS 6.9安裝Azure CLI方式如下:
  1. # 安裝Python 2.7
  2. wget https://dl.iuscommunity.org/pub/ius/stable/CentOS/6/x86_64//python27-libs-2.7.14-1.ius.centos6.x86_64.rpm
  3. rpm -Uvh python27-libs-2.7.14-1.ius.centos6.x86_64.rpm
  4. rm -rf python27-libs-2.7.14-1.ius.centos6.x86_64.rpm
  5. vim /etc/bashrc
/etc/bashrc檔案內容新增
  1. # 設定Python的Path路徑到bashrc的最後一行
  2. export PATH=/opt/rh/python27/root/usr/bin/:$PATH
  1. source /etc/bashrc
  2. vim /etc/ld.so.conf
  1. # 檢查ld.so.conf內容設定
  2. include ld.so.conf.d/*.conf
  3. include /opt/rh/python27/root/usr/lib64/
  4. # 檢查ld.so.conf內容設定
  1. ldconfig
  2. python --version
  3.  
  4. # 安裝Azure CLI
  5. rpm --import https://packages.microsoft.com/keys/microsoft.asc
  6. sh -c 'echo -e "[azure-cli]\nname=Azure CLI\nbaseurl=https://packages.microsoft.com/yumrepos/azure-cli\nenabled=1\ngpgcheck=1\ngpgkey=https://packages.microsoft.com/keys/microsoft.asc" > /etc/yum.repos.d/azure-cli.repo'
  7. yum install azure-cli
  8. # 測試 Azure CLI是否正常
  9. az --version
  10. # 依照相關信息進行登入
  11. az login
  12. # 列出目前登入帳號資料
  13. az account list

Related Posts:

  • CentOS7 安裝防毒軟體 ClamAV 出處:https://blog.xuite.net/tolarku/blog/543961253-CentOS7+%E5%AE%89%E8%A3%9D%E9%98%B2%E6%AF%92%E8%BB%9F%E9%AB%94+ClamAV雖然我感覺不出來在 Linux 一般系統裡安裝防毒軟體的作用,但在某些應用有可能被外部使用者更改檔案,且資安要求需要安裝所以就會在 CentOS 裡安裝 ClamAV ,之前寫過一篇「Linux 系統安… Read More
  • MySQL匯出Binary檔案資料當使用mysqldump匯出資料庫檔案時,若有些欄位是直接將檔案儲存進去,在匯入資料庫時會導致失敗,因此需要透過以下指令將資料庫匯出後,才能在其他台mysql主機上匯入。 1. 使用--hex-blob匯出資料庫檔案mysqldump -u root -p --hex-blob  example > example.sql  2. 使用一般方式匯入資料庫檔案mysql -u root -p … Read More
  • MySQL指定使用utf8編碼匯入資料 在mysql匯入SQL檔案時,如果遇到亂碼問題,可透過指定編碼的方式,將資料正確匯入。  mysql -u root -p --default-character-set=utf8 example < example.sql… Read More
  • Linux nohup with out nohup.outThe command is below: nohup some_command > /dev/null 2>&1& for example: nohup /jboss-eap-6.0/bin/standalone.sh -Djboss.server.base.dir=/jboss-eap-6.0/test -Djboss.server.log.dir=d:/webaplog/test > /dev/null … Read More
  • MySql備份Trigger與StoredProcedure預設的mysqldump備份出來的sql檔案,是不包含StoredProcedure,但是包含Trigger指令,因此我們如過發現資料庫中有StoredProcedure的話,需要透過下方的指令,將StoredProcedure備份出來。mysqldump -h 127.0.0.1 -u root -p -n -d -t --routines --triggers example > example.sql … Read More

0 意見: