diff --git a/.gitignore b/.gitignore index efd6aff..012d767 100644 --- a/.gitignore +++ b/.gitignore @@ -105,3 +105,4 @@ venv.bak/ # filemanager config filemanager/config.txt +filemanager_data diff --git a/install_dependencies.sh b/install_dependencies.sh index e2a553c..49b7627 100755 --- a/install_dependencies.sh +++ b/install_dependencies.sh @@ -7,7 +7,7 @@ # the current directory. INSTALL_DIR="${1:-thisdir}" -if [ $INSTALL_DIR = 'thisdir' ] +if [ $INSTALL_DIR == 'thisdir' ] then INSTALL_DIR=$(pwd) fi @@ -65,7 +65,7 @@ echo 'Installing cmsdbldr...' # Install and auto-add to PATH git clone https://github.com/valdasraps/cmsdbldr.git -if [ $RCPATH == 1] +if [ $RCPATH == 1 ] then if [ $machine = "Mac" ] then @@ -98,7 +98,7 @@ then # get (version-dependent) directory name export ICDIR=$(find instantclient_* -maxdepth 0 -type d) - if [ $RCPATH == 1] + if [ $RCPATH == 1 ] then # Add to PATH via adding a new line to .bash_profile echo "export PATH=${INSTALL_DIR}/${ICDIR}:\$PATH" >> ~/.bash_profile @@ -116,7 +116,7 @@ then # get version export ICDIR=$(find instantclient_* -maxdepth 0 -type d) - if [ $RCPATH == 1] + if [ $RCPATH == 1 ] then # Add to PATH via adding a new line to .bash_profile echo "export PATH=${INSTALL_DIR}/${ICDIR}:\$PATH" >> ~/.bashrc @@ -144,7 +144,8 @@ then # Add to PATH via setx (WARNING: Requires Windows 7 or later, currently untested) # setx /M path "%path%;"$INSTALL_DIR'\'$ICDIR # FOR NOW: Attempt to add to bashrc - if [ $RCPATH == 1] + if [ $RCPATH == 1 ] + then echo "export PATH=${INSTALL_DIR}/${ICDIR}:\$PATH" >> ~\.bashrc echo "export INSTANT_CLIENT_HOME=${INSTALL_DIR}/${ICDIR}" >> ~\.bashrc fi diff --git a/user_scripts/00.linux_serve_setup/README.md b/user_scripts/00.linux_serve_setup/README.md new file mode 100644 index 0000000..5fa32e4 --- /dev/null +++ b/user_scripts/00.linux_serve_setup/README.md @@ -0,0 +1,7 @@ +# Setup Linux Server. +## Installation +* Install miniconda from website +* Install dependent packages in conda virtual environment +`conda create --name sharedUI --file sharedUI.requirements.txt python=3.9` +`conda activate sharedUI` +* Create a script for loading environment (optional) diff --git a/user_scripts/00.linux_serve_setup/sharedUI.requirements.txt b/user_scripts/00.linux_serve_setup/sharedUI.requirements.txt new file mode 100644 index 0000000..8a92927 --- /dev/null +++ b/user_scripts/00.linux_serve_setup/sharedUI.requirements.txt @@ -0,0 +1,82 @@ +# This file may be used to create an environment using: +# $ conda create --name --file +# platform: linux-64 +@EXPLICIT +https://repo.anaconda.com/pkgs/main/linux-64/_libgcc_mutex-0.1-main.conda +https://repo.anaconda.com/pkgs/main/linux-64/blas-1.0-mkl.conda +https://repo.anaconda.com/pkgs/main/linux-64/ca-certificates-2023.05.30-h06a4308_0.conda +https://repo.anaconda.com/pkgs/main/linux-64/ld_impl_linux-64-2.38-h1181459_1.conda +https://repo.anaconda.com/pkgs/main/linux-64/libstdcxx-ng-11.2.0-h1234567_1.conda +https://repo.anaconda.com/pkgs/main/noarch/tzdata-2023c-h04d1e81_0.conda +https://repo.anaconda.com/pkgs/main/linux-64/libgomp-11.2.0-h1234567_1.conda +https://repo.anaconda.com/pkgs/main/linux-64/_openmp_mutex-5.1-1_gnu.conda +https://repo.anaconda.com/pkgs/main/linux-64/libgcc-ng-11.2.0-h1234567_1.conda +https://repo.anaconda.com/pkgs/main/linux-64/expat-2.4.9-h6a678d5_0.conda +https://repo.anaconda.com/pkgs/main/linux-64/giflib-5.2.1-h5eee18b_3.conda +https://repo.anaconda.com/pkgs/main/linux-64/icu-58.2-he6710b0_3.conda +https://repo.anaconda.com/pkgs/main/linux-64/jpeg-9e-h5eee18b_1.conda +https://repo.anaconda.com/pkgs/main/linux-64/lerc-3.0-h295c915_0.conda +https://repo.anaconda.com/pkgs/main/linux-64/libdeflate-1.17-h5eee18b_0.conda +https://repo.anaconda.com/pkgs/main/linux-64/libffi-3.4.4-h6a678d5_0.conda +https://repo.anaconda.com/pkgs/main/linux-64/libuuid-1.41.5-h5eee18b_0.conda +https://repo.anaconda.com/pkgs/main/linux-64/libwebp-base-1.2.4-h5eee18b_1.conda +https://repo.anaconda.com/pkgs/main/linux-64/libxcb-1.15-h7f8727e_0.conda +https://repo.anaconda.com/pkgs/main/linux-64/lz4-c-1.9.4-h6a678d5_0.conda +https://repo.anaconda.com/pkgs/main/linux-64/ncurses-6.4-h6a678d5_0.conda +https://repo.anaconda.com/pkgs/main/linux-64/nspr-4.35-h6a678d5_0.conda +https://repo.anaconda.com/pkgs/main/linux-64/openssl-3.0.10-h7f8727e_0.conda +https://repo.anaconda.com/pkgs/main/linux-64/pcre-8.45-h295c915_0.conda +https://repo.anaconda.com/pkgs/main/linux-64/tbb-2021.8.0-hdb19cb5_0.conda +https://repo.anaconda.com/pkgs/main/linux-64/xz-5.4.2-h5eee18b_0.conda +https://repo.anaconda.com/pkgs/main/linux-64/zlib-1.2.13-h5eee18b_0.conda +https://repo.anaconda.com/pkgs/main/linux-64/glib-2.69.1-he621ea3_2.conda +https://repo.anaconda.com/pkgs/main/linux-64/intel-openmp-2023.1.0-hdb19cb5_46305.conda +https://repo.anaconda.com/pkgs/main/linux-64/libedit-3.1.20221030-h5eee18b_0.conda +https://repo.anaconda.com/pkgs/main/linux-64/libevent-2.1.12-hdbd6064_1.conda +https://repo.anaconda.com/pkgs/main/linux-64/libllvm10-10.0.1-hbcb73fb_5.conda +https://repo.anaconda.com/pkgs/main/linux-64/libpng-1.6.39-h5eee18b_0.conda +https://repo.anaconda.com/pkgs/main/linux-64/libxml2-2.9.14-h74e7548_0.conda +https://repo.anaconda.com/pkgs/main/linux-64/readline-8.2-h5eee18b_0.conda +https://repo.anaconda.com/pkgs/main/linux-64/tk-8.6.12-h1ccaba5_0.conda +https://repo.anaconda.com/pkgs/main/linux-64/zstd-1.5.5-hc292b87_0.conda +https://repo.anaconda.com/pkgs/main/linux-64/dbus-1.13.18-hb2f20db_0.conda +https://repo.anaconda.com/pkgs/main/linux-64/freetype-2.12.1-h4a9f257_0.conda +https://repo.anaconda.com/pkgs/main/linux-64/gstreamer-1.14.1-h5eee18b_1.conda +https://repo.anaconda.com/pkgs/main/linux-64/krb5-1.20.1-h143b758_1.conda +https://repo.anaconda.com/pkgs/main/linux-64/libclang-10.0.1-default_hb85057a_2.conda +https://repo.anaconda.com/pkgs/main/linux-64/libtiff-4.5.0-h6a678d5_2.conda +https://repo.anaconda.com/pkgs/main/linux-64/libxkbcommon-1.0.1-hfa300c1_0.conda +https://repo.anaconda.com/pkgs/main/linux-64/libxslt-1.1.35-h4e12654_0.conda +https://repo.anaconda.com/pkgs/main/linux-64/mkl-2023.1.0-h213fc3f_46343.conda +https://repo.anaconda.com/pkgs/main/linux-64/sqlite-3.41.2-h5eee18b_0.conda +https://repo.anaconda.com/pkgs/main/linux-64/fontconfig-2.14.1-h52c9d5c_1.conda +https://repo.anaconda.com/pkgs/main/linux-64/gst-plugins-base-1.14.1-h6a678d5_1.conda +https://repo.anaconda.com/pkgs/main/linux-64/libpq-12.15-hdbd6064_1.conda +https://repo.anaconda.com/pkgs/main/linux-64/libwebp-1.2.4-h11a3e52_1.conda +https://repo.anaconda.com/pkgs/main/linux-64/nss-3.89.1-h6a678d5_0.conda +https://repo.anaconda.com/pkgs/main/linux-64/python-3.9.17-h955ad1f_0.conda +https://repo.anaconda.com/pkgs/main/linux-64/cx_oracle-8.3.0-py39h7f8727e_0.conda +https://repo.anaconda.com/pkgs/main/linux-64/exceptiongroup-1.0.4-py39h06a4308_0.conda +https://repo.anaconda.com/pkgs/main/noarch/iniconfig-1.1.1-pyhd3eb1b0_0.tar.bz2 +https://repo.anaconda.com/pkgs/main/linux-64/markupsafe-2.1.1-py39h7f8727e_0.conda +https://repo.anaconda.com/pkgs/main/linux-64/mkl-service-2.4.0-py39h5eee18b_1.conda +https://repo.anaconda.com/pkgs/main/linux-64/packaging-23.0-py39h06a4308_0.conda +https://repo.anaconda.com/pkgs/main/linux-64/pluggy-1.0.0-py39h06a4308_1.conda +https://repo.anaconda.com/pkgs/main/linux-64/ply-3.11-py39h06a4308_0.conda +https://repo.anaconda.com/pkgs/main/linux-64/qt-main-5.15.2-h327a75a_7.conda +https://repo.anaconda.com/pkgs/main/linux-64/setuptools-68.0.0-py39h06a4308_0.conda +https://repo.anaconda.com/pkgs/main/noarch/toml-0.10.2-pyhd3eb1b0_0.conda +https://repo.anaconda.com/pkgs/main/linux-64/tomli-2.0.1-py39h06a4308_0.conda +https://repo.anaconda.com/pkgs/main/linux-64/wheel-0.38.4-py39h06a4308_0.conda +https://repo.anaconda.com/pkgs/main/linux-64/jinja2-3.1.2-py39h06a4308_0.conda +https://repo.anaconda.com/pkgs/main/linux-64/numpy-base-1.25.2-py39hb5e798b_0.conda +https://repo.anaconda.com/pkgs/main/linux-64/pip-23.2.1-py39h06a4308_0.conda +https://repo.anaconda.com/pkgs/main/linux-64/pytest-7.4.0-py39h06a4308_0.conda +https://repo.anaconda.com/pkgs/main/linux-64/qt-webengine-5.15.9-hd2b0992_4.conda +https://repo.anaconda.com/pkgs/main/linux-64/sip-6.6.2-py39h6a678d5_0.conda +https://repo.anaconda.com/pkgs/main/linux-64/pyqt5-sip-12.11.0-py39h6a678d5_1.conda +https://repo.anaconda.com/pkgs/main/linux-64/qtwebkit-5.212-h4eab89a_4.conda +https://repo.anaconda.com/pkgs/main/linux-64/pyqt-5.15.7-py39h6a678d5_1.conda +https://repo.anaconda.com/pkgs/main/linux-64/mkl_fft-1.3.6-py39h417a72b_1.conda +https://repo.anaconda.com/pkgs/main/linux-64/mkl_random-1.2.2-py39h417a72b_1.conda +https://repo.anaconda.com/pkgs/main/linux-64/numpy-1.25.2-py39h5f9d8c6_0.conda diff --git a/user_scripts/01.windows_ssh_connection/AccessDatabase.ps1 b/user_scripts/01.windows_ssh_connection/AccessDatabase.ps1 new file mode 100644 index 0000000..2b26375 --- /dev/null +++ b/user_scripts/01.windows_ssh_connection/AccessDatabase.ps1 @@ -0,0 +1,21 @@ +$REMOTE_USER = "ntuuser" + + +$env:DISPLAY = "localhost:0" +$width = 80 +$height = 6 + +$host.UI.RawUI.WindowSize = New-Object System.Management.Automation.Host.Size($width,$height) + + +$X11Program = "C:\Program Files\VcXsrv\xlaunch.exe" + +if (Test-Path -Path $X11Program -PathType Leaf) { + Start-Process $X11Program +} else { + Write-Host '--------------------------- WARNING ---------------------------------------------' + Write-Host '-- Default X11 program not found in computer, you need to execute it manually. --' + Write-Host '---------------------------------------------------------------------------------' +} +ssh -Y $REMOTE_USER@hep10.phys.ntu.edu.tw 'source gotoworkspace/01.SharedUI.sh && python /data1/ltsai/workspace/git/SharedUI/mainUI.py' +Pause diff --git a/user_scripts/01.windows_ssh_connection/README.md b/user_scripts/01.windows_ssh_connection/README.md new file mode 100644 index 0000000..8a224f0 --- /dev/null +++ b/user_scripts/01.windows_ssh_connection/README.md @@ -0,0 +1,5 @@ +# Access Database from Windows PC +* Install X11 server +Install [VcxSrv](https://sourceforge.net/projects/vcxsrv/) +* Connect to Linux Server +Download AccessDatabase.ps1 and launch the script by right click \- execute.