2025年6月23日 星期一

Anaconda 使用Proxy 安裝 Python 套件

終端機下執行 conda 指令
conda config –set proxy_servers.http http://proxy.loc:3128
conda config –set proxy_servers.https http://proxt.loc:3128

或編輯設定檔 ~/.condarc 加入以下內容
proxy_servers:
  http: http://proxy.loc:3128
  https: http://proxy.loc:3128

檢視 conda 設定,終端機下執行
conda config –show
conda info --all

使用範例
conda config –add channels conda-forge
conda install gcc=12
conda install gxx=12

conda install gcc=12  -c conda-forge
conda install gxx=12  -c conda-forge

Windows 10/11 powershell 下新增VPN

 Add-VpnConnection -Name "VPN-NAME" -ServerAddress "vpn-server" -PassThru -TunnelType "Automatic" 

-TunnelType
指定用於VPN連接的 Tunnel類型。此參數的可接受值為:
PPTP  L2TP  SSTP  IKEv2  Automatic

Bash 產生密碼範例

 password=$(tr -dc 'A-Za-z0-9!?%=' < /dev/urandom | head -c 20);

Openssh server 設定特定群組限用 sftp

編輯 /etc/ssh/sshd_config 

# override default of no subsystems
#Subsystem      sftp    /usr/lib/openssh/sftp-server
Subsystem sftp internal-sftp

 Match group domain?users
#Match group *,!sudo
    #ChrootDirectory /home/%u@loc
    ChrootDirectory /home
    X11Forwarding no
    AllowTcpForwarding no
    ForceCommand internal-sftp

pip 安裝 github 項目

pip install git+https://github.com/popgenmethods/smcpp.git --user

git clone https://github.com/popgenmethods/smcpp.git
cd smcpp
python3 setup.py install --user

2025年6月5日 星期四

Debian 12 sssd realm 無法加入網域

錯誤訊息
Wrote out krb5.conf snippet to /var/cache/realmd/adcli-krb5-090dt5/krb5.d/adcli-krb5-conf-uzvObj
 * Authenticated as user: Administrator@test.loc
 * Using GSS-SPNEGO for SASL bind
 ! Couldn't authenticate to active directory: SASL(-1): generic failure: GSSAPI Error: Unspecified GSS failure.  Minor code may provide more information (Server not found in Kerberos database)
adcli: couldn't connect to ssde.sinica domain: Couldn't authenticate to active directory: SASL(-1): generic failure: GSSAPI Error: Unspecified GSS failure.  Minor code may provide more information (Server not found in Kerberos database)
Insufficient permissions to join the domain

安裝 krb5相關軟體
apt install krb5-user