[{"content":"https://github.com/ma-wenqian/vpn-playbook\nA complete guide and toolkit for automating login to Cisco AnyConnect / Cisco Secure Client VPNs that use TOTP-based two-factor authentication, plus a Dockerized OpenConnect setup for split-tunnel / proxy-chain use.\nTags: HKU, Cisco AnyConnect, Cisco Secure Client, OpenConnect, 2FA, TOTP, VPN Guide\nOverview Most institutional VPNs built on Cisco AnyConnect / Cisco Secure Client (this repo was written against HKU\u0026rsquo;s vpn2fa.hku.hk, but the approach generalizes to any similarly-configured gateway) require two factors to log in:\nA username + password. A 6-digit TOTP code, usually the same code you\u0026rsquo;d read off Google Authenticator, Authy, iCloud Keychain, or Microsoft Authenticator. That TOTP code is just HMAC-SHA1(secret, current_time_step) truncated to 6 digits — there is nothing magic about the authenticator app. Once you have extracted the Base32 secret used to seed your authenticator (usually shown as text or a QR code during 2FA enrollment), you can compute the same code yourself and drive the whole login non-interactively:\nOn Unix (macOS/Linux): oathtool --totp -b \u0026quot;$SECRET\u0026quot; On Windows: the totp-go CLI, totp-go \u0026quot;$SECRET\u0026quot; ⚠️ Protect this secret like a password. Anyone who has it can generate valid 2FA codes for your account indefinitely — it does not rotate or expire the way a single OTP code does. Never commit a config file that contains your real secret, password, or username to a public (or even private, shared) repository. The config.bat / config.sh files in this repo are templates with placeholder values only — fill in your real details locally and keep that change out of git.\nRepository layout . ├── Cisco/ │ ├── unix/ │ │ ├── cisco-vpn.sh # connect/disconnect via oathtool + `vpn -s` scripted stdin │ │ ├── config.sh # your VPN host/username/password/TOTP secret (template) │ │ └── install.sh # one-line installer (curl | bash) │ └── win/ │ ├── cisco-vpn.bat # double-click entry point; calls totp-go and writes the scripted vpncli.exe input directly │ ├── config.bat # your VPN host/username/password/TOTP secret (template, same variable names as unix) │ ├── icon/ # connect.ico / disconnect.ico used by desktop shortcuts │ └── install.ps1 # one-line installer, also installs totp-go and offers desktop shortcuts (irm | iex) └── Openconnect/ ├── openconnect-setup.sh # OpenConnect + microsocks Docker setup (lighter) └── openconnect-gost-setup.sh # OpenConnect + gost Docker setup (more proxy features) Mobile iOS: no full automation is possible; at most you can auto-fill the TOTP code via the Passwords/Authenticator autofill integration. Android: not investigated in this repo. Cisco AnyConnect / Secure Client (desktop, CLI-only) Don\u0026rsquo;t launch the GUI client — everything below drives the command-line interface so the login can be scripted.\nmacOS / Linux On a standard desktop install, the CLI lives at:\n/opt/cisco/secureclient/bin/vpn (macOS users can alternatively install the iOS-style AnyConnect client, which also supports split tunneling — see the Chinese section below for the caveat.)\nPrerequisites\n# Debian/Ubuntu sudo apt install oathtool # macOS brew install oath-toolkit You also need the Cisco AnyConnect/Secure Client already installed (so /opt/cisco/secureclient/bin/vpn exists).\nQuick install\ncurl -fsSL https://sh.mawenqian.com/cisco-unix-install.sh | bash This drops cisco-vpn.sh and a config.sh template into /opt/cisco-vpn (override with INSTALL_DIR=...; needs sudo to create the directory, matching the OpenConnect installers below), makes cisco-vpn.sh executable, and symlinks it to ~/.local/bin/ciscovpn. If ~/.local/bin isn\u0026rsquo;t already on your PATH, it appends an export PATH=... line to your .bashrc/.zshrc/.profile (whichever matches $SHELL) so ciscovpn actually works after you restart your shell, instead of silently symlinking somewhere unreachable — it checks for that exact line first, so re-running the installer never duplicates it. Re-running it later refreshes cisco-vpn.sh without touching your config.sh, so it doubles as an update mechanism.\nOr install manually:\nCopy Cisco/unix/cisco-vpn.sh and Cisco/unix/config.sh wherever you like. Edit config.sh with your real VPN_HOST, VPN_USER, VPN_PASSWORD and VPN_SECRET. Make the script executable: chmod +x cisco-vpn.sh Usage\nciscovpn connect # disconnect any existing session, then log in ciscovpn disconnect # disconnect # or, if you installed manually / skipped the symlink: ./cisco-vpn.sh connect ./cisco-vpn.sh disconnect Under the hood, cisco-vpn.sh generates a fresh TOTP code with oathtool and pipes a scripted command sequence into the CLI\u0026rsquo;s -s (stdin-scripted) mode — the same mechanism the Windows side uses via vpncli.exe -s, since the CLI doesn\u0026rsquo;t accept connect \u0026lt;host\u0026gt; as a plain command-line argument on either platform; it only reacts to that sequence typed at its own interactive VPN\u0026gt; prompt:\nprintf \u0026#39;connect %s\\n%s\\n%s\\n%s\\n\u0026#39; \u0026#34;$VPN_HOST\u0026#34; \u0026#34;$VPN_USER\u0026#34; \u0026#34;$VPN_PASSWORD\u0026#34; \u0026#34;$OTP\u0026#34; \\ | /opt/cisco/secureclient/bin/vpn -s Nothing touches disk — the credentials only exist in the pipe between this script and the CLI process for the moment it takes to read them.\nWindows The current install path for Cisco Secure Client is:\nC:\\Program Files (x86)\\Cisco\\Cisco Secure Client\\vpncli.exe There\u0026rsquo;s no direct Windows equivalent of oathtool, so this repo generates TOTP codes with totp-go instead — a small standalone CLI, no Python required.\nPrerequisites: totp-go on PATH (the installer below fetches it for you if it\u0026rsquo;s missing; manually it\u0026rsquo;s irm https://sh.mawenqian.com/totp-go-install.ps1 | iex).\nQuick install\nirm https://sh.mawenqian.com/cisco-win-install.ps1 | iex This drops cisco-vpn.bat and a config.bat template into %USERPROFILE%\\.local\\opt\\cisco-vpn (override with -InstallDir ...), installs totp-go if it isn\u0026rsquo;t already on PATH, and asks whether to create \u0026ldquo;Connect VPN\u0026rdquo; / \u0026ldquo;Disconnect VPN\u0026rdquo; shortcuts on your Desktop — say yes and you never have to touch a terminal again. Re-running the installer later refreshes cisco-vpn.bat without touching your config.bat.\nShortcut icons: Cisco/win/icon/connect.ico and Cisco/win/icon/disconnect.ico are used by default (fetched from the repo, one per shortcut). To use your own instead, pass -ConnectIconUrl \u0026lt;url\u0026gt; / -DisconnectIconUrl \u0026lt;url\u0026gt; pointing at a .ico file — a shortcut\u0026rsquo;s icon has to be a local .ico/.exe/.dll file (Windows has no notion of a remote icon URL), so a supplied URL is downloaded once into the install folder and pointed at locally.\nOr install manually:\nCopy Cisco/win/cisco-vpn.bat and Cisco/win/config.bat into the same folder. Install totp-go: irm https://sh.mawenqian.com/totp-go-install.ps1 | iex Edit config.bat with your real VPN_HOST, VPN_USER, VPN_PASSWORD and VPN_SECRET — the same variable names used by the unix side\u0026rsquo;s config.sh. Optional: put a shortcut to cisco-vpn.bat on your desktop so you can just double-click to connect. Usage\nDouble-click cisco-vpn.bat (or run it from a terminal). It will:\nPrint the current VPN state. Force-disconnect any existing session. Load config.bat, generate a fresh TOTP code with totp-go \u0026quot;%VPN_SECRET%\u0026quot;, and write a scripted input file straight to %TEMP%\\cisco_input.txt from within the batch script (no helper process involved). Pipe that file into vpncli.exe -s (scripted mode) to complete the login, then delete the temp file. One-click disconnect: the Quick Install shortcut above already creates this, or make one yourself with this target:\nC:\\Windows\\System32\\cmd.exe /c \u0026#34;C:\\Program Files (x86)\\Cisco\\Cisco Secure Client\\vpncli.exe\u0026#34; disconnect \u0026amp; timeout /nobreak /t 3 To change either shortcut\u0026rsquo;s icon later: right-click it → Properties → Change Icon.\nOpenConnect (Docker, SOCKS5 proxy) The stock Cisco client doesn\u0026rsquo;t support split tunneling and doesn\u0026rsquo;t play well alongside other VPNs/proxies. OpenConnect is protocol-compatible with AnyConnect and works better for this. See Mark4551124015/HKU-VPN for a bare-metal reference setup.\nThis repo instead provides a Dockerized OpenConnect container that exposes a local SOCKS5 proxy on port 1080 — point any app (or chain another VPN/proxy through it) at socks5://127.0.0.1:1080, e.g. to reach services like ChatGPT/Claude from a network where OpenConnect is the only way out.\nTwo variants are provided — pick one:\nScript Proxy backend Notes openconnect-setup.sh microsocks Lighter weight, SOCKS5 only openconnect-gost-setup.sh gost Heavier, supports more protocols/chaining features Container images referenced by these scripts are built from ma-wenqian/dockerfiles/openconnect.\nQuick install (Linux/macOS):\n# lighter option: OpenConnect + microsocks curl -fsSL https://sh.mawenqian.com/openconnect-setup.sh | bash # OpenConnect + gost curl -fsSL https://sh.mawenqian.com/openconnect-gost-setup.sh | bash Each script:\nCreates an install directory (/opt/openconnect-head or /opt/openconnect-gost, overridable via INSTALL_DIR). Drops a .env template (host/user/password/TOTP secret + optional local network routing) with chmod 600. Writes a Dockerfile and docker-compose.yaml that build the proxy + OpenConnect image. Then:\ncd /opt/openconnect-head # or /opt/openconnect-gost $EDITOR .env # fill in your real VPN details docker compose up -d --build The container reconnects automatically if the OpenConnect session drops (--force-dpd=30 + a restart loop), and exposes a health check that pings 1.1.1.1 through the tunnel.\nIf you want other devices on your LAN to reach the proxy (not just the Docker host), set LOCAL_NETWORK / LOCAL_GATEWAY in .env. If it\u0026rsquo;s only used from the host machine, you can leave those at their defaults.\n","permalink":"https://www.mawenqian.com/en/cisco-openconnect-sh/","summary":"\u003cp\u003e\u003ca href=\"https://github.com/ma-wenqian/vpn-playbook\"\u003ehttps://github.com/ma-wenqian/vpn-playbook\u003c/a\u003e\u003c/p\u003e\n\u003cp\u003eA complete guide and toolkit for automating login to Cisco AnyConnect / Cisco Secure Client VPNs that use TOTP-based two-factor authentication, plus a Dockerized OpenConnect setup for split-tunnel / proxy-chain use.\u003c/p\u003e\n\u003c!-- more --\u003e\n\u003cp\u003e\u003cstrong\u003eTags:\u003c/strong\u003e HKU, Cisco AnyConnect, Cisco Secure Client, OpenConnect, 2FA, TOTP, VPN Guide\u003c/p\u003e\n\u003chr\u003e\n\u003ch3 id=\"overview\"\u003eOverview\u003c/h3\u003e\n\u003cp\u003eMost institutional VPNs built on Cisco AnyConnect / Cisco Secure Client (this repo was written against HKU\u0026rsquo;s \u003ccode\u003evpn2fa.hku.hk\u003c/code\u003e, but the approach generalizes to any similarly-configured gateway) require two factors to log in:\u003c/p\u003e","title":"Cisco AnyConnect \u0026 Openconnect PlayBook"},{"content":" This article was written with the assistance of GitHub Copilot\nCreate a new environment To create a new conda environment, use the following command:\nconda create --name myenv Replace myenv with the name you want for your environment. You can also specify the Python version:\nconda create --name myenv python=3.8 Alternatively, you can create an environment at a specific path using the -p option:\nconda create -p /path/to/myenv Replace /path/to/myenv with your desired path. You can also specify the Python version:\nconda create -p /path/to/myenv python=3.8 Set environment variables for a specific environment To set environment variables for a specific conda environment, use the conda env config vars set command. For example:\nconda env config vars set MY_VAR=value Replace MY_VAR and value with your desired variable name and value.\nActivate the environment to apply the changes:\nconda activate myenv To view the environment variables set for the active environment, use:\nconda env config vars list To unset an environment variable, use:\nconda env config vars unset MY_VAR Replace MY_VAR with the name of the variable you want to unset.\nFor more details, refer to the official conda documentation.\nExample: Setting PYTHONPATH To set the PYTHONPATH environment variable for a specific conda environment, use the following command:\nconda env config vars set PYTHONPATH=/path/to/your/modules Replace /path/to/your/modules with the path you want to add to PYTHONPATH.\nActivate the environment to apply the changes:\nconda activate myenv To verify that PYTHONPATH has been set, you can list the environment variables:\nconda env config vars list Delete an environment To delete a conda environment, use the conda remove command with the --name option. For example:\nconda remove --name myenv --all Replace myenv with the name of the environment you want to delete. The --all flag ensures that all packages in the environment are removed.\nAlternatively, if you created the environment at a specific path, use the -p option:\nconda remove -p /path/to/myenv --all Replace /path/to/myenv with the path to the environment you want to delete.\nFor more details, refer to the official conda documentation.\n","permalink":"https://www.mawenqian.com/en/conda-environment-settings/","summary":"\u003cblockquote\u003e\n\u003cp\u003eThis article was written with the assistance of GitHub Copilot\u003c/p\u003e\n\u003c/blockquote\u003e\n\u003ch2 id=\"create-a-new-environment\"\u003eCreate a new environment\u003c/h2\u003e\n\u003cp\u003eTo create a new conda environment, use the following command:\u003c/p\u003e\n\u003cdiv class=\"highlight\"\u003e\u003cpre tabindex=\"0\" class=\"chroma\"\u003e\u003ccode class=\"language-bash\" data-lang=\"bash\"\u003e\u003cspan class=\"line\"\u003e\u003cspan class=\"cl\"\u003econda create --name myenv\n\u003c/span\u003e\u003c/span\u003e\u003c/code\u003e\u003c/pre\u003e\u003c/div\u003e\u003cp\u003eReplace \u003ccode\u003emyenv\u003c/code\u003e with the name you want for your environment. You can also specify the Python version:\u003c/p\u003e\n\u003cdiv class=\"highlight\"\u003e\u003cpre tabindex=\"0\" class=\"chroma\"\u003e\u003ccode class=\"language-bash\" data-lang=\"bash\"\u003e\u003cspan class=\"line\"\u003e\u003cspan class=\"cl\"\u003econda create --name myenv \u003cspan class=\"nv\"\u003epython\u003c/span\u003e\u003cspan class=\"o\"\u003e=\u003c/span\u003e3.8\n\u003c/span\u003e\u003c/span\u003e\u003c/code\u003e\u003c/pre\u003e\u003c/div\u003e\u003cp\u003eAlternatively, you can create an environment at a specific path using the \u003ccode\u003e-p\u003c/code\u003e option:\u003c/p\u003e\n\u003cdiv class=\"highlight\"\u003e\u003cpre tabindex=\"0\" class=\"chroma\"\u003e\u003ccode class=\"language-bash\" data-lang=\"bash\"\u003e\u003cspan class=\"line\"\u003e\u003cspan class=\"cl\"\u003econda create -p /path/to/myenv\n\u003c/span\u003e\u003c/span\u003e\u003c/code\u003e\u003c/pre\u003e\u003c/div\u003e\u003cp\u003eReplace \u003ccode\u003e/path/to/myenv\u003c/code\u003e with your desired path. You can also specify the Python version:\u003c/p\u003e","title":"Conda Environment Settings"},{"content":"Clone source code git clone https://github.com/OpenSees/OpenSees.git cd OpenSees 1. Setup environment 1.1 install CMake and git # download cmake https://cmake.org/download/ 1.2 install visual studio 2019 default dictionary C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\nhttps://c2rsetup.officeapps.live.com/c2r/downloadVS.aspx?sku=community\u0026amp;channel=Release\u0026amp;version=VS2019 1.3 install IntelOne Basic \u0026amp; HPC Toolkits default dictionary C:\\Program Files (x86)\\Intel\\oneAPI\nhttps://registrationcenter-download.intel.com/akdlm/IRC_NAS/7dff44ba-e3af-4448-841c-0d616c8da6e7/w_BaseKit_p_2024.1.0.595_offline.exe https://registrationcenter-download.intel.com/akdlm/IRC_NAS/c95a3b26-fc45-496c-833b-df08b10297b9/w_HPCKit_p_2024.1.0.561_offline.exe 1.4 install python 3.11 you can create an env using conda\nconda create -n ops-compile python=3.11 conda activate ops-compile 1.5 install conan pip install \u0026#34;conan\u0026lt;2.0\u0026#34; 1.6 build MUMPS git clone https://github.com/OpenSees/mumps.git cd mumps mkdir build cd build call \u0026#34;C:\\Program Files (x86)\\Intel\\oneAPI\\setvars.bat\u0026#34; intel64 mod cmake .. -Darith=d -DCMAKE_MSVC_RUNTIME_LIBRARY=\u0026#34;MultiThreaded\u0026#34; -G Ninja cmake --build . --config Release --parallel 4 2. Building the OpenSees Applications and Python module Prepare cmake cd ..\\.. mkdir build cd build conan install .. --build missing --settings compiler=\u0026#34;Visual Studio\u0026#34; --settings compiler.runtime=\u0026#34;MT\u0026#34; --settings compiler.version=16 call \u0026#34;C:\\Program Files (x86)\\Intel\\oneAPI\\setvars.bat\u0026#34; intel64 mod cmake .. -DBLA_STATIC=ON -DMKL_LINK=static -DMKL_INTERFACE_FULL=intel_lp64 -DMUMPS_DIR=\u0026#34;..\\..\\mumps\\build\u0026#34; 2.1 opensees cmake --build . --config Release --target OpenSees -j8 2.2 openseespy cmake --build . --config Release --target OpenSeesPy -j8 ### powershell| mv ./bin/OpenSeesPy.dll ./bin/opensees.pyd cp \u0026#34;C:\\Program Files (x86)\\Intel\\oneAPI\\compiler\\2024.1\\bin\\libiomp5md.dll\u0026#34; ./bin/ Reference: https://github.com/OpenSees/OpenSees/blob/master/.github/workflows/build_cmake.yml\n3. Compile custom uniaxial material Add / create / edit the source files\nMaterial -\u0026gt; OpenSees/SRC/material/\u0026lt;uniaxial or nD\u0026gt;/\nexample: new uniaxial material named mym\ncopy mym.cpp and mym.h to SRC/material/uniaxial/\nAdd the class tag to mym.h\n#define MAT_TAG_SDBolt 20240518\nUpdate the CMakeLists.txt\nThe editing is simple for materials, e.g., for a uniaxial material add a line in OpenSees/SRC/material/uniaxial/CMakeLists.txt: mym.cpp,mym.h\nAdd the updates to the interpreters\nAdd to OpenSees/SRC/interpreter/OpenSeesUniaxialMaterialCommands.cpp for the Python interpreter. Near the top of the file:\nvoid* OPS_SLModel();\nand further down in the file:\nuniaxialMaterialsMap.insert(std::make_pair(\u0026quot;SLModel\u0026quot;, \u0026amp;OPS_SLModel));\nCompile OpenSees\ncall \u0026#34;C:\\Program Files (x86)\\Intel\\oneAPI\\setvars.bat\u0026#34; intel64 mod cmake .. -DBLA_STATIC=ON -DMKL_LINK=static -DMKL_INTERFACE_FULL=intel_lp64 -DMUMPS_DIR=\u0026#34;..\\..\\mumps\\build\u0026#34; cmake --build . --config Release --target OpenSeesPy -j8 ","permalink":"https://www.mawenqian.com/en/compile-openseespy-on-windows-using-cmake/","summary":"\u003ch2 id=\"clone-source-code\"\u003eClone source code\u003c/h2\u003e\n\u003cdiv class=\"highlight\"\u003e\u003cpre tabindex=\"0\" class=\"chroma\"\u003e\u003ccode class=\"language-bash\" data-lang=\"bash\"\u003e\u003cspan class=\"line\"\u003e\u003cspan class=\"cl\"\u003egit clone https://github.com/OpenSees/OpenSees.git\n\u003c/span\u003e\u003c/span\u003e\u003cspan class=\"line\"\u003e\u003cspan class=\"cl\"\u003e\u003cspan class=\"nb\"\u003ecd\u003c/span\u003e OpenSees\n\u003c/span\u003e\u003c/span\u003e\u003c/code\u003e\u003c/pre\u003e\u003c/div\u003e\u003ch2 id=\"1-setup-environment\"\u003e1. Setup environment\u003c/h2\u003e\n\u003ch3 id=\"11-install-cmake-and-git\"\u003e1.1 install CMake and git\u003c/h3\u003e\n\u003cdiv class=\"highlight\"\u003e\u003cpre tabindex=\"0\" class=\"chroma\"\u003e\u003ccode class=\"language-bash\" data-lang=\"bash\"\u003e\u003cspan class=\"line\"\u003e\u003cspan class=\"cl\"\u003e\u003cspan class=\"c1\"\u003e# download cmake\u003c/span\u003e\n\u003c/span\u003e\u003c/span\u003e\u003cspan class=\"line\"\u003e\u003cspan class=\"cl\"\u003ehttps://cmake.org/download/\n\u003c/span\u003e\u003c/span\u003e\u003c/code\u003e\u003c/pre\u003e\u003c/div\u003e\u003ch3 id=\"12-install-visual-studio-2019\"\u003e1.2 install visual studio 2019\u003c/h3\u003e\n\u003cblockquote\u003e\n\u003cp\u003edefault dictionary \u003ccode\u003eC:\\Program Files (x86)\\Microsoft Visual Studio\\2019\u003c/code\u003e\u003c/p\u003e\n\u003c/blockquote\u003e\n\u003cdiv class=\"highlight\"\u003e\u003cpre tabindex=\"0\" class=\"chroma\"\u003e\u003ccode class=\"language-bash\" data-lang=\"bash\"\u003e\u003cspan class=\"line\"\u003e\u003cspan class=\"cl\"\u003ehttps://c2rsetup.officeapps.live.com/c2r/downloadVS.aspx?sku\u003cspan class=\"o\"\u003e=\u003c/span\u003ecommunity\u003cspan class=\"p\"\u003e\u0026amp;\u003c/span\u003e\u003cspan class=\"nv\"\u003echannel\u003c/span\u003e\u003cspan class=\"o\"\u003e=\u003c/span\u003eRelease\u003cspan class=\"p\"\u003e\u0026amp;\u003c/span\u003e\u003cspan class=\"nv\"\u003eversion\u003c/span\u003e\u003cspan class=\"o\"\u003e=\u003c/span\u003eVS2019\n\u003c/span\u003e\u003c/span\u003e\u003c/code\u003e\u003c/pre\u003e\u003c/div\u003e\u003ch3 id=\"13-install-intelone-basic--hpc-toolkits\"\u003e1.3 install IntelOne Basic \u0026amp; HPC Toolkits\u003c/h3\u003e\n\u003cblockquote\u003e\n\u003cp\u003edefault dictionary \u003ccode\u003eC:\\Program Files (x86)\\Intel\\oneAPI\u003c/code\u003e\u003c/p\u003e\n\u003c/blockquote\u003e\n\u003cp\u003e\u003cimg loading=\"lazy\" src=\"https://img.mawenqian.com/photos/262c392f77c8ec0f2bd5df8440e04238.png\"\u003e\u003c/p\u003e\n\u003cdiv class=\"highlight\"\u003e\u003cpre tabindex=\"0\" class=\"chroma\"\u003e\u003ccode class=\"language-bash\" data-lang=\"bash\"\u003e\u003cspan class=\"line\"\u003e\u003cspan class=\"cl\"\u003ehttps://registrationcenter-download.intel.com/akdlm/IRC_NAS/7dff44ba-e3af-4448-841c-0d616c8da6e7/w_BaseKit_p_2024.1.0.595_offline.exe\n\u003c/span\u003e\u003c/span\u003e\u003cspan class=\"line\"\u003e\u003cspan class=\"cl\"\u003ehttps://registrationcenter-download.intel.com/akdlm/IRC_NAS/c95a3b26-fc45-496c-833b-df08b10297b9/w_HPCKit_p_2024.1.0.561_offline.exe\n\u003c/span\u003e\u003c/span\u003e\u003c/code\u003e\u003c/pre\u003e\u003c/div\u003e\u003ch3 id=\"14-install-python-311\"\u003e1.4 install python 3.11\u003c/h3\u003e\n\u003cp\u003eyou can create an env using conda\u003c/p\u003e\n\u003cdiv class=\"highlight\"\u003e\u003cpre tabindex=\"0\" class=\"chroma\"\u003e\u003ccode class=\"language-bash\" data-lang=\"bash\"\u003e\u003cspan class=\"line\"\u003e\u003cspan class=\"cl\"\u003econda create -n ops-compile \u003cspan class=\"nv\"\u003epython\u003c/span\u003e\u003cspan class=\"o\"\u003e=\u003c/span\u003e3.11\n\u003c/span\u003e\u003c/span\u003e\u003cspan class=\"line\"\u003e\u003cspan class=\"cl\"\u003econda activate ops-compile\n\u003c/span\u003e\u003c/span\u003e\u003c/code\u003e\u003c/pre\u003e\u003c/div\u003e\u003ch3 id=\"15-install-conan\"\u003e1.5 install conan\u003c/h3\u003e\n\u003cdiv class=\"highlight\"\u003e\u003cpre tabindex=\"0\" class=\"chroma\"\u003e\u003ccode class=\"language-bash\" data-lang=\"bash\"\u003e\u003cspan class=\"line\"\u003e\u003cspan class=\"cl\"\u003epip install \u003cspan class=\"s2\"\u003e\u0026#34;conan\u0026lt;2.0\u0026#34;\u003c/span\u003e\n\u003c/span\u003e\u003c/span\u003e\u003c/code\u003e\u003c/pre\u003e\u003c/div\u003e\u003ch3 id=\"16-build-mumps\"\u003e1.6 build MUMPS\u003c/h3\u003e\n\u003cdiv class=\"highlight\"\u003e\u003cpre tabindex=\"0\" class=\"chroma\"\u003e\u003ccode class=\"language-bash\" data-lang=\"bash\"\u003e\u003cspan class=\"line\"\u003e\u003cspan class=\"cl\"\u003egit clone https://github.com/OpenSees/mumps.git\n\u003c/span\u003e\u003c/span\u003e\u003cspan class=\"line\"\u003e\u003cspan class=\"cl\"\u003e\u003cspan class=\"nb\"\u003ecd\u003c/span\u003e mumps\n\u003c/span\u003e\u003c/span\u003e\u003cspan class=\"line\"\u003e\u003cspan class=\"cl\"\u003emkdir build\n\u003c/span\u003e\u003c/span\u003e\u003cspan class=\"line\"\u003e\u003cspan class=\"cl\"\u003e\u003cspan class=\"nb\"\u003ecd\u003c/span\u003e build\n\u003c/span\u003e\u003c/span\u003e\u003cspan class=\"line\"\u003e\u003cspan class=\"cl\"\u003ecall \u003cspan class=\"s2\"\u003e\u0026#34;C:\\Program Files (x86)\\Intel\\oneAPI\\setvars.bat\u0026#34;\u003c/span\u003e intel64 mod\n\u003c/span\u003e\u003c/span\u003e\u003cspan class=\"line\"\u003e\u003cspan class=\"cl\"\u003ecmake .. -Darith\u003cspan class=\"o\"\u003e=\u003c/span\u003ed -DCMAKE_MSVC_RUNTIME_LIBRARY\u003cspan class=\"o\"\u003e=\u003c/span\u003e\u003cspan class=\"s2\"\u003e\u0026#34;MultiThreaded\u0026#34;\u003c/span\u003e -G Ninja\n\u003c/span\u003e\u003c/span\u003e\u003cspan class=\"line\"\u003e\u003cspan class=\"cl\"\u003ecmake --build . --config Release --parallel \u003cspan class=\"m\"\u003e4\u003c/span\u003e\n\u003c/span\u003e\u003c/span\u003e\u003c/code\u003e\u003c/pre\u003e\u003c/div\u003e\u003ch2 id=\"2-building-the-opensees-applications-and-python-module\"\u003e2. Building the OpenSees Applications and Python module\u003c/h2\u003e\n\u003ch3 id=\"prepare-cmake\"\u003ePrepare cmake\u003c/h3\u003e\n\u003cdiv class=\"highlight\"\u003e\u003cpre tabindex=\"0\" class=\"chroma\"\u003e\u003ccode class=\"language-bash\" data-lang=\"bash\"\u003e\u003cspan class=\"line\"\u003e\u003cspan class=\"cl\"\u003e\u003cspan class=\"nb\"\u003ecd\u003c/span\u003e ..\u003cspan class=\"se\"\u003e\\.\u003c/span\u003e.\n\u003c/span\u003e\u003c/span\u003e\u003cspan class=\"line\"\u003e\u003cspan class=\"cl\"\u003emkdir build\n\u003c/span\u003e\u003c/span\u003e\u003cspan class=\"line\"\u003e\u003cspan class=\"cl\"\u003e\u003cspan class=\"nb\"\u003ecd\u003c/span\u003e build\n\u003c/span\u003e\u003c/span\u003e\u003cspan class=\"line\"\u003e\u003cspan class=\"cl\"\u003econan install .. --build missing --settings \u003cspan class=\"nv\"\u003ecompiler\u003c/span\u003e\u003cspan class=\"o\"\u003e=\u003c/span\u003e\u003cspan class=\"s2\"\u003e\u0026#34;Visual Studio\u0026#34;\u003c/span\u003e --settings compiler.runtime\u003cspan class=\"o\"\u003e=\u003c/span\u003e\u003cspan class=\"s2\"\u003e\u0026#34;MT\u0026#34;\u003c/span\u003e --settings compiler.version\u003cspan class=\"o\"\u003e=\u003c/span\u003e\u003cspan class=\"m\"\u003e16\u003c/span\u003e\n\u003c/span\u003e\u003c/span\u003e\u003cspan class=\"line\"\u003e\u003cspan class=\"cl\"\u003e\n\u003c/span\u003e\u003c/span\u003e\u003cspan class=\"line\"\u003e\u003cspan class=\"cl\"\u003ecall \u003cspan class=\"s2\"\u003e\u0026#34;C:\\Program Files (x86)\\Intel\\oneAPI\\setvars.bat\u0026#34;\u003c/span\u003e intel64 mod\n\u003c/span\u003e\u003c/span\u003e\u003cspan class=\"line\"\u003e\u003cspan class=\"cl\"\u003ecmake .. -DBLA_STATIC\u003cspan class=\"o\"\u003e=\u003c/span\u003eON -DMKL_LINK\u003cspan class=\"o\"\u003e=\u003c/span\u003estatic -DMKL_INTERFACE_FULL\u003cspan class=\"o\"\u003e=\u003c/span\u003eintel_lp64 -DMUMPS_DIR\u003cspan class=\"o\"\u003e=\u003c/span\u003e\u003cspan class=\"s2\"\u003e\u0026#34;..\\..\\mumps\\build\u0026#34;\u003c/span\u003e\n\u003c/span\u003e\u003c/span\u003e\u003c/code\u003e\u003c/pre\u003e\u003c/div\u003e\u003ch3 id=\"21-opensees\"\u003e2.1 opensees\u003c/h3\u003e\n\u003cdiv class=\"highlight\"\u003e\u003cpre tabindex=\"0\" class=\"chroma\"\u003e\u003ccode class=\"language-bash\" data-lang=\"bash\"\u003e\u003cspan class=\"line\"\u003e\u003cspan class=\"cl\"\u003ecmake --build . --config Release --target OpenSees -j8\n\u003c/span\u003e\u003c/span\u003e\u003c/code\u003e\u003c/pre\u003e\u003c/div\u003e\u003ch3 id=\"22-openseespy\"\u003e2.2 openseespy\u003c/h3\u003e\n\u003cdiv class=\"highlight\"\u003e\u003cpre tabindex=\"0\" class=\"chroma\"\u003e\u003ccode class=\"language-bash\" data-lang=\"bash\"\u003e\u003cspan class=\"line\"\u003e\u003cspan class=\"cl\"\u003ecmake --build . --config Release --target OpenSeesPy -j8\n\u003c/span\u003e\u003c/span\u003e\u003cspan class=\"line\"\u003e\u003cspan class=\"cl\"\u003e\n\u003c/span\u003e\u003c/span\u003e\u003cspan class=\"line\"\u003e\u003cspan class=\"cl\"\u003e\u003cspan class=\"c1\"\u003e### powershell|\u003c/span\u003e\n\u003c/span\u003e\u003c/span\u003e\u003cspan class=\"line\"\u003e\u003cspan class=\"cl\"\u003emv ./bin/OpenSeesPy.dll ./bin/opensees.pyd\n\u003c/span\u003e\u003c/span\u003e\u003cspan class=\"line\"\u003e\u003cspan class=\"cl\"\u003ecp \u003cspan class=\"s2\"\u003e\u0026#34;C:\\Program Files (x86)\\Intel\\oneAPI\\compiler\\2024.1\\bin\\libiomp5md.dll\u0026#34;\u003c/span\u003e ./bin/\n\u003c/span\u003e\u003c/span\u003e\u003c/code\u003e\u003c/pre\u003e\u003c/div\u003e\u003cblockquote\u003e\n\u003cp\u003eReference:\n\u003ca href=\"https://github.com/OpenSees/OpenSees/blob/master/.github/workflows/build_cmake.yml\"\u003ehttps://github.com/OpenSees/OpenSees/blob/master/.github/workflows/build_cmake.yml\u003c/a\u003e\u003c/p\u003e","title":"Compile OpenSeesPy on Windows using cmake"},{"content":" This article was written with the assistance of GitHub Copilot\nCreate a new environment To create a new conda environment, use the following command:\nconda create --name myenv Replace myenv with the name you want for your environment. You can also specify the Python version:\nconda create --name myenv python=3.8 Alternatively, you can create an environment at a specific path using the -p option:\nconda create -p /path/to/myenv Replace /path/to/myenv with your desired path. You can also specify the Python version:\nconda create -p /path/to/myenv python=3.8 Set environment variables for a specific environment To set environment variables for a specific conda environment, use the conda env config vars set command. For example:\nconda env config vars set MY_VAR=value Replace MY_VAR and value with your desired variable name and value.\nActivate the environment to apply the changes:\nconda activate myenv To view the environment variables set for the active environment, use:\nconda env config vars list To unset an environment variable, use:\nconda env config vars unset MY_VAR Replace MY_VAR with the name of the variable you want to unset.\nFor more details, refer to the official conda documentation.\nExample: Setting PYTHONPATH To set the PYTHONPATH environment variable for a specific conda environment, use the following command:\nconda env config vars set PYTHONPATH=/path/to/your/modules Replace /path/to/your/modules with the path you want to add to PYTHONPATH.\nActivate the environment to apply the changes:\nconda activate myenv To verify that PYTHONPATH has been set, you can list the environment variables:\nconda env config vars list Delete an environment To delete a conda environment, use the conda remove command with the --name option. For example:\nconda remove --name myenv --all Replace myenv with the name of the environment you want to delete. The --all flag ensures that all packages in the environment are removed.\nAlternatively, if you created the environment at a specific path, use the -p option:\nconda remove -p /path/to/myenv --all Replace /path/to/myenv with the path to the environment you want to delete.\nFor more details, refer to the official conda documentation.\nconda create -document conda env config vars ","permalink":"https://www.mawenqian.com/en/how-to-configure-conda-environment-settings/","summary":"\u003cblockquote\u003e\n\u003cp\u003eThis article was written with the assistance of GitHub Copilot\u003c/p\u003e\n\u003c/blockquote\u003e\n\u003ch2 id=\"create-a-new-environment\"\u003eCreate a new environment\u003c/h2\u003e\n\u003cp\u003eTo create a new conda environment, use the following command:\u003c/p\u003e\n\u003cdiv class=\"highlight\"\u003e\u003cpre tabindex=\"0\" class=\"chroma\"\u003e\u003ccode class=\"language-bash\" data-lang=\"bash\"\u003e\u003cspan class=\"line\"\u003e\u003cspan class=\"cl\"\u003econda create --name myenv\n\u003c/span\u003e\u003c/span\u003e\u003c/code\u003e\u003c/pre\u003e\u003c/div\u003e\u003cp\u003eReplace \u003ccode\u003emyenv\u003c/code\u003e with the name you want for your environment. You can also specify the Python version:\u003c/p\u003e\n\u003cdiv class=\"highlight\"\u003e\u003cpre tabindex=\"0\" class=\"chroma\"\u003e\u003ccode class=\"language-bash\" data-lang=\"bash\"\u003e\u003cspan class=\"line\"\u003e\u003cspan class=\"cl\"\u003econda create --name myenv \u003cspan class=\"nv\"\u003epython\u003c/span\u003e\u003cspan class=\"o\"\u003e=\u003c/span\u003e3.8\n\u003c/span\u003e\u003c/span\u003e\u003c/code\u003e\u003c/pre\u003e\u003c/div\u003e\u003cp\u003eAlternatively, you can create an environment at a specific path using the \u003ccode\u003e-p\u003c/code\u003e option:\u003c/p\u003e\n\u003cdiv class=\"highlight\"\u003e\u003cpre tabindex=\"0\" class=\"chroma\"\u003e\u003ccode class=\"language-bash\" data-lang=\"bash\"\u003e\u003cspan class=\"line\"\u003e\u003cspan class=\"cl\"\u003econda create -p /path/to/myenv\n\u003c/span\u003e\u003c/span\u003e\u003c/code\u003e\u003c/pre\u003e\u003c/div\u003e\u003cp\u003eReplace \u003ccode\u003e/path/to/myenv\u003c/code\u003e with your desired path. You can also specify the Python version:\u003c/p\u003e","title":"How To Configure Conda Environment Settings"},{"content":"Hello, my name is Wenqian Ma (马文千), and I am a PhD candidate in Construction Engineering and Management at the University of Hong Kong (HKU). Previously, I completed my Master\u0026rsquo;s in Civil Engineering at South China University of Technology (SCUT), where I gained expertise in 3D printing technology and parametric design. I believe that integrating parametric design with programming can significantly decrease the workload in engineering.\nNews September 2024: Register at HKU December 2023: Successfully pass the IELTS July 2023: Give a presentation at the 4th International Conference on 3D Construction Printing held at Nanyang Technological University, Singapore Honors \u0026amp; Awards Second Prize, The 2nd National College Industrialized Construction and Smart Building Competition 2022 Prize for excellence, The 15th South China University of Technology Structural Design Competition 2019 Prize for excellence, Guangdong Province University Mechanics Competition 2019 Advanced Individual in Winter Break Social Practice, South China University of Technology 2019 Outstanding Merit Student and Student Leader, South China University of Technology 2019 Mitacs Globalink Research Internship Scholarship 2020 National Encouragement Scholarship 2019 National Encouragement Scholarship 2018 Education Sep. 2024- , PhD in Construction Engineering and Management, The University of Hong Kong, Hong Kong SAR Supervisor: Dr. WANG Xuguang, Dr. X.W. Deng (co-supervisor) Sep. 2021- Jun. 2024 (Expected), M.Eng in Civil Engineering (Intelligent Construction), South China University of Technology, Guangzhou, China Supervisor: Prof. Nan Hu Sep. 2017- Jun. 2021, B.E. in Civil Engineering (Road and Bridge Engineering), South China University of Technology, Guangzhou, China ","permalink":"https://www.mawenqian.com/en/about/","summary":"\u003cp\u003eHello, my name is Wenqian Ma (马文千), and I am a PhD candidate in Construction Engineering and Management at the University of Hong Kong (HKU). Previously, I completed my Master\u0026rsquo;s in Civil Engineering at South China University of Technology (SCUT), where I gained expertise in 3D printing technology and parametric design. I believe that integrating parametric design with programming can significantly decrease the workload in engineering.\u003c/p\u003e\n\u003ch2 id=\"news\"\u003eNews\u003c/h2\u003e\n\u003cul\u003e\n\u003cli\u003eSeptember 2024: Register at HKU\u003c/li\u003e\n\u003cli\u003eDecember 2023: Successfully pass the IELTS\u003c/li\u003e\n\u003cli\u003eJuly 2023: Give a presentation at the 4th International Conference on 3D Construction Printing held at Nanyang Technological University, Singapore\u003c/li\u003e\n\u003c/ul\u003e\n\u003c!-- ## Projects --\u003e\n\u003c!-- ## Publications\n\nIt's about to go online soon. --\u003e\n\u003c!-- ## Research Experience --\u003e\n\u003ch2 id=\"honors--awards\"\u003eHonors \u0026amp; Awards\u003c/h2\u003e\n\u003cul\u003e\n\u003cli\u003eSecond Prize, The 2nd National College Industrialized Construction and Smart Building Competition 2022\u003c/li\u003e\n\u003cli\u003ePrize for excellence, The 15th South China University of Technology Structural Design Competition 2019\u003c/li\u003e\n\u003cli\u003ePrize for excellence, Guangdong Province University Mechanics Competition 2019\u003c/li\u003e\n\u003cli\u003eAdvanced Individual in Winter Break Social Practice, South China University of Technology 2019\u003c/li\u003e\n\u003cli\u003eOutstanding Merit Student and Student Leader, South China University of Technology 2019\u003c/li\u003e\n\u003cli\u003eMitacs Globalink Research Internship Scholarship 2020 National Encouragement Scholarship 2019 National Encouragement Scholarship 2018\u003c/li\u003e\n\u003c/ul\u003e\n\u003ch2 id=\"education\"\u003eEducation\u003c/h2\u003e\n\u003cul\u003e\n\u003cli\u003eSep. 2024- , PhD in Construction Engineering and Management, \u003ca href=\"https://www.hku.hk/\"\u003eThe University of Hong Kong\u003c/a\u003e, Hong Kong SAR\n\u003cem\u003eSupervisor: Dr. WANG Xuguang, Dr. X.W. Deng (co-supervisor)\u003c/em\u003e\u003c/li\u003e\n\u003cli\u003eSep. 2021- Jun. 2024 (Expected), M.Eng in Civil Engineering (Intelligent Construction), \u003ca href=\"https://www.scut.edu.cn/\"\u003eSouth China University of Technology\u003c/a\u003e, Guangzhou, China\n\u003cem\u003eSupervisor: Prof. Nan Hu\u003c/em\u003e\u003c/li\u003e\n\u003cli\u003eSep. 2017- Jun. 2021, B.E. in Civil Engineering (Road and Bridge Engineering), \u003ca href=\"https://www.scut.edu.cn/\"\u003eSouth China University of Technology\u003c/a\u003e, Guangzhou, China\u003c/li\u003e\n\u003c/ul\u003e","title":"Welcome to Wenqian Ma’s Webpage!"}]