LINUX_VERSION
type lsb_release &>/dev/null && LINUX_VERSION="$(lsb_release -sr)" || {
LINUX_VERSION=$(. /etc/os-release;echo ${VERSION_ID})
}
###----------------------------------------------------------
#
## References:
## * http://www.linuxfromscratch.org/blfs/view/cvs/general/opencv.html
## * http://www.bogotobogo.com/OpenCV/opencv_3_tutorial_ubuntu14_install_cmake.php
## * https://ubuntuforums.org/showthread.php?t=2219550
## * https://github.com/facebook/fbcunn/blob/master/INSTALL.md
## * https://github.com/milq/milq/blob/master/scripts/bash/install-opencv.sh
###----------------------------------------------------------
## INSTALL DEPENDENCIES
sudo apt -y install build-essential cmake git unzip pkg-config qtbase5-dev
sudo apt -y install libprotobuf-dev libleveldb-dev libsnappy-dev libhdf5-serial-dev protobuf-compiler libopencv-dev
## python
#source ${LSCRIPTS}/python.install.sh
## ffmpeg install
#source ${LSCRIPTS}/ffmpeg.install.sh
sudo apt -y remove x264 libx264-dev
sudo apt -y install checkinstall yasm libjpeg8-dev libjasper-dev libtiff5-dev libavcodec-dev libavformat-dev libswscale-dev libdc1394-22-dev libxine2-dev libv4l-dev libgstreamer0.10-dev libgstreamer-plugins-base0.10-dev libqt4-dev libgtk-3-dev libgtk2.0-dev libtbb-dev libfaac-dev libmp3lame-dev libtheora-dev libvorbis-dev libxvidcore-dev libopencore-amrnb-dev libopencore-amrwb-dev x264 v4l-utils
sudo apt -y install doxygen doxygen-gui graphviz
# # https://www.learnopencv.com/installing-deep-learning-frameworks-on-ubuntu-with-cuda-support/
sudo apt -y remove x264 libx264-dev
sudo apt -y install checkinstall yasm
sudo apt -y install libjpeg8-dev libjasper-dev
if [[ ${LINUX_VERSION} == "16.04" ]]; then
echo "...${LINUX_VERSION}"
sudo apt -y install libpng12-dev
fi
## If you are using Ubuntu 14.04
## sudo apt -y install libtiff4-dev
## If you are using Ubuntu 16.04
sudo apt -y install libtiff5-dev
sudo apt -y install libavcodec-dev libavformat-dev libswscale-dev libdc1394-22-dev
sudo apt -y install libxine2-dev libv4l-dev
sudo apt -y install libgstreamer0.10-dev libgstreamer-plugins-base0.10-dev
sudo apt -y install libqt4-dev libgtk2.0-dev libtbb-dev
sudo apt -y install libfaac-dev libmp3lame-dev libtheora-dev
sudo apt -y install libvorbis-dev libxvidcore-dev
sudo apt -y install libopencore-amrnb-dev libopencore-amrwb-dev
sudo apt -y install x264 v4l-utils
LINUX_VERSION
type lsb_release &>/dev/null && LINUX_VERSION="$(lsb_release -sr)" || {
LINUX_VERSION=$(. /etc/os-release;echo ${VERSION_ID})
}
###----------------------------------------------------------
## PCL Pre-requisite
###----------------------------------------------------------
#
## References:
## * http://pointclouds.org/downloads/linux.html
#
## Setup Prerequisites
## * https://larrylisky.com/2016/11/03/point-cloud-library-on-ubuntu-16-04-lts/
#
## As binaries
## `sudo add-apt-repository -y ppa:v-launchpad-jochen-sprickerhof-de/pcl`
## `sudo apt update`
## `sudo apt -y install libpcl-all`
###----------------------------------------------------------
sudo apt -y update
sudo apt -y install git build-essential linux-libc-dev
sudo apt -y install cmake cmake-gui
sudo apt -y install libusb-1.0-0-dev libusb-dev libudev-dev
sudo apt -y install mpi-default-dev openmpi-bin openmpi-common
if [[ ${LINUX_VERSION} == "16.04" ]]; then
sudo apt -y install libflann1.8 libflann-dev
sudo apt -y install libvtk5.10-qt4 libvtk5.10 libvtk5-dev
fi
if [[ ${LINUX_VERSION} == "18.04" ]]; then
sudo apt -y install libflann1.9 libflann-dev
sudo apt -y install libvtk7.1 libvtk7-dev libvtk7.1-qt libvtk7-qt-dev libvtk7-java libvtk7-jni
fi
sudo apt -y install libeigen3-dev
sudo apt -y install libboost-all-dev
sudo apt -y install libqhull* libgtest-dev
sudo apt -y install freeglut3-dev pkg-config
sudo apt -y install libxmu-dev libxi-dev
sudo apt -y install mono-complete
LINUX_VERSION
type lsb_release &>/dev/null && LINUX_VERSION="$(lsb_release -sr)" || {
LINUX_VERSION=$(. /etc/os-release;echo ${VERSION_ID})
}
sudo apt -y install libxml2-dev
# sudo apt -y install liblas-dev # some issue with libght
sudo apt -y install libcunit1 libcunit1-dev
sudo apt -y install lzma
sudo apt -y install libmpich-dev
sudo apt -y install libcgal-dev
#
sudo apt -y install libxerces-c-dev
sudo apt -y install libjsoncpp-dev
#
sudo apt -y install libqt5x11extras5-dev
sudo apt -y install qttools5-dev
#
sudo apt -y install libsuitesparseconfig4.4.6 libsuitesparse-dev
sudo apt -y install metis libmetis-dev
#
sudo apt -y install maven
sudo apt -y install openssh-server openssh-client
sudo apt -y install libssl-dev libsslcommon2-dev
sudo apt -y install pkg-config
sudo apt -y install libglfw3 libglfw3-dev
## https://www.pyimagesearch.com/2015/08/24/resolved-matplotlib-figures-not-showing-up-or-displaying/
## https://github.com/tctianchi/pyvenn/issues/3
sudo apt -y install tcl-dev tk-dev python-tk python3-tk
#
sudo apt -y install autoconf automake libtool curl unzip
#
## ceres-solver dependencies
## Todo: Error fix in Ubuntu 20.04; E: Unable to locate package python-gflags
# sudo apt -y install libgflags2.2 libgflags-dev python-gflags python3-gflags libgoogle-glog-dev
sudo apt -y install libgflags2.2 libgflags-dev python3-gflags libgoogle-glog-dev
#
## apache superset (visulization tool in python)
# sudo apt -y install libssl-dev libffi-dev libsasl2-dev libldap2-dev
libfreetype6-dev
libhdf5-serial-dev
libzmq3-dev
pkg-config
aptitude
graphviz
openmpi-bin
rsync
unzip
zip
zlib1g-dev
git
swig
grep
feh
tree
sudo
libpng-dev
libjpeg-dev
libtool
bc
jq
openssh-client
openssh-server
apt-utils
gparted
net-tools
ppa-purge
sshfs
inxi
dos2unix
tree
exuberant-ctags
cmake-curses-gui
uuid
automake
locate
unrar
mono-complete
chromium-browser
libimage-exiftool-perl
doxygen
doxygen-gui
libexif-dev
ntp
libconfig++-dev
kino
htop
apcalc
xclip
xsel
dconf-editor
openvpn
neofetch
libcanberra-gtk-module
jq
- JSON command line parseryamllint
- YAML command line parser and validator -lscripts-docker
. It is deprecated and putting in here for useful insights.
Assembling and setting up decent system for Multi purpose:
Tested on Ubuntu 16.04 LTS, Ubuntu 18.04 LTS
/usr/local/lib
. It saves lot of pain to export the path to individual build directories and system default libs will safely sit under /usr/lib
.;)
sudo apt autoremove
and always check what gets uninstalled.Tested on Ubuntu 18.04 LTS
$HOME/Downloads
$HOME/softwares
versions/builds/release
to downloadcheckout
option to build from the stable release (case-by-case basis)Ubuntu 16.04 / 18.04
and create the checks in the scripts to install respective dependenciesIndividual Scripts & Sequence of Installation
Tested on Ubuntu 16.04 LTS
Setup on Ubuntu 16.04 LTS
Directory-name | Status | Version/Release | Download Type | Remarks |
---|---|---|---|---|
├── android | Installed | latest | Download | SDK,NDK |
├── android-studio | Installed | latest | Download | |
├── boost_1_64_0 | Installed | 1.64.0 | Download – wget | |
├── caffe | Not-compiled | latest | git clone | |
├── ceres-solver | Installed | 1.14.0 | git clone | |
├── cloudcompare | Not-compiled | latest | git clone | |
├── cmake-3.11.0 | Installed | 3.11.0 | Download – wget | Min 3.7+ is required for certain features – like for android support from pcl |
├── cudnn_samples_v7 | Installed | 1.7.1 | Registered Download | cuDNN samples for testing |
├── eigen | Installed | latest | git clone | |
├── entwine | Installed | latest | git clone | |
├── gdal-2.2.4 | Installed | 2.2.4 | Download – wget | |
├── geos-3.6.1 | Installed | 3.6.1 | Download – wget | |
├── LASzip | Installed | latest | git clone | |
├── laz-perf | Installed | latest | git clone | |
├── libgeotiff-1.4.2 | Installed | 1.4.2 | Download – wget | |
├── libkml-1.2.0 | Failed | 1.2.0 | 1.3.0 | |
├── opencv | Installed | latest | git clone | |
├── opencv_contrib | Installed | latest | git clone | certain contrib are disabled – sfm |
├── OpenDroneMap | Failed | latest | git clone | |
├── opengv | Installed | latest | git clone | |
├── OpenSfM | Installed-Broken | latest | git clone | core dump on reconstruction step. Consider not working |
├── pcl | Installed | latest | git clone | |
├── PDAL-1.7.1-src | Installed | 1.7.1 | Download – wget | |
├── pointcloud | Installed | latest | git clone | |
├── proj-4.9.3 | Installed | 4.9.3 | Download – wget | |
├── protobuf | Installed | latest | git clone | |
├── tensorflow | Installed | latest | git clone | 1.8.0:python3:CUDA 9.1:CuDNN 7.1.2: 1.7.0:python2:CUDA 9.1:CuDNN 7.1.2 |
├── tiff-4.0.8 | Installed | 4.0.8 | Download – wget | used by geotiff |
└── VTK-8.1.0 | Installed | 8.1.0 | Download – wget | freely available software system for 3D computer graphics |
sudo apt-get install libcgal-dev # install the CGAL library
sudo apt-get install libcgal-demo # install the CGAL demos
#
#sudo apt-get install libxerces-c-dev
#sudo apt install libjsoncpp-dev
#
#sudo apt-get install libqt5x11extras5-dev
#sudo apt-get install qttools5-dev
#
#sudo apt install libsuitesparseconfig4.4.6 libsuitesparse-dev
#sudo apt install metis libmetis-dev
#
swig -version
sudo apt-get install libmpich-dev
sudo apt install libcunit1 libcunit1-dev
#sudo apt-get install libcunit1 libcunit1-doc libcunit1-dev
Cario
for with_drawing
option - Choose to build Cairo-based SVG drawingapt-cache search libgstreamer*
#
libgstreamer-gl1.0-0 - GStreamer GL libraries
libgstreamer-plugins-base1.0-0 - GStreamer libraries from the "base" set
libgstreamer-plugins-base1.0-dev - GStreamer development files for libraries from the "base" set
libgstreamer-plugins-good1.0-0 - GStreamer development files for libraries from the "good" set
libgstreamer-plugins-good1.0-dev - GStreamer development files for libraries from the "good" set
libgstreamer1.0-0 - Core GStreamer libraries and elements
libgstreamer1.0-0-dbg - Core GStreamer libraries and elements
libgstreamer1.0-dev - GStreamer core development files
libgstreamer-ocaml - OCaml interface to the gstreamer library -- runtime files
libgstreamer-ocaml-dev - OCaml interface to the gstreamer library -- development files
libgstreamer-opencv1.0-0 - GStreamer OpenCV libraries
libgstreamer-plugins-bad1.0-0 - GStreamer libraries from the "bad" set
libgstreamer-plugins-bad1.0-dev - GStreamer development files for libraries from the "bad" set
libgstreamer1-perl - Bindings for GStreamer 1.0, the open source multimedia framework
libgstreamerd-3-0 - GStreamer media framework - D bindings
libgstreamerd-3-dev - GStreamer media framework - development files for D
libgstreamermm-1.0-1 - C++ wrapper library for GStreamer (shared libraries)
libgstreamermm-1.0-dev - C++ wrapper library for GStreamer (development files)
libgstreamermm-1.0-doc - C++ wrapper library for GStreamer (documentation)
git --version
git version 2.17.1
This is for advance usage providing granular control on specific software component that is to be installed.
lsd-install.nvidia-driver
lsd-install.docker-ce
lsd-install.docker-compose
lsd-install.nvidia-container-toolkit
Only for Nvidia GPU
If looking to use GPU docker containers and have Nvidia Graphics card, multiple CUDA stack can be installed and used in parallel using Nvidia GPU docker containers.
These provides complete development stack for deep learning docker environments. Any AI frameworks can be added on top of it and currently provides pre-configuration for Pytorch, Keras and Tensorflow AI frameworks.
## create the external directory, inside this clone the official nividia container file repo
mkdir -p external
cd external
git clone https://gitlab.com/nvidia/container-images/cuda.git
##
printf "y" | bash docker-buildimg-cuda.sh 10.0
pip install -U -r lscripts/config/ubuntu18.04/python.requirements-ai-cuda-9.0.txt
pip install -U -r lscripts/config/ubuntu18.04/python.requirements-ai-cuda-10.0.txt
pip install -U -r lscripts/config/ubuntu18.04/python.requirements-ai-cuda-10.2.txt
#
pip install -U -r lscripts/config/ubuntu18.04/python.requirements-ai-cuda-11.0.txt
sudo service docker stop
sudo service docker start
#
bash start.bzohub-170820_051654.sh
#
docker exec -u $(id -u):$(id -g) -it c1c80473e63c /bin/bash && xhost -local:root 1>/dev/null 2>&1
docker exec -u $(id -u):$(id -g) -it bzohub-170820_051654 /bin/bash && xhost -local:root 1>/dev/null 2>&1
lsd-docker
Commands lsd-docker.osvers
#
lsd-docker.cfg
lsd-docker.container.delete-all
lsd-docker.container.delete-byimage
lsd-docker.container.exec-byname
lsd-docker.container.list
lsd-docker.container.list-ids
lsd-docker.container.list-ids-all
lsd-docker.container.status
lsd-docker.container.stop-all
lsd-docker.container.test
variables
for lscripts
configuration variables can be known and visualized as:
lsd-cfg.color
${LSCRIPTS_DOCKER}/lscripts/core/lsd-mod.log.sh
8
color codes are there one for each log levels.6
color codes for respective log levels. There’re two additional for stacktrace
and fail
log levels.
lsd-test.log
Build and setup a system with required software utilities.
Optional
python-virtualenvwrapper
installer by export
in the terminal or put this in ~/.bashrc
file. Replcae the text <absolute_path_to_virtualmachines>
with actual directory path.
export LSCRIPTS__VMHOME="<absolute_path_to_virtualmachines>"
export LSCRIPTS__PYVENV_PATH="${LSCRIPTS__VMHOME}/virtualenvs"
Quick Software Installation using software stacks
Software stacks are grouping of logical softwares based on their functionalities. Many softwares depends on each other and their are cyclic dependencies. The sequence of items installed using software stacks is done meticulously and it’s recommended if you want to setup a complete multi-functional system stacks for development. These choice of packages are meant from development perspective and hence are not optimized for production installation. It’s recommended to be prudent and observe the dependencies being installed or un-installed.
lsd-stack.list
lsd-stack.list <name_of_the_item>
This is preferred for first time setup for full stack development build.
lsd-stack.all
lsd-stack.prerequisite
lsd-stack.nvidia-cuda-python-docker
lsd-stack.utils
lsd-stack.sysutils
lsd-stack.editors
lsd-stack.markdowneditors
lsd-stack.programming
lsd-stack.epub
lsd-stack.storage
lsd-stack.multimedia
lsd-stack.misc
This is recommended for first time setup and gives more control to select what will be installed.
lsd-stack.itemwise
This is for advance usage providing granular control on specific software component that is to be installed.
lsd-install.nvidia-driver
lsd-install.docker-ce
lsd-install.docker-compose
lsd-install.nvidia-container-toolkit
## installs both python 2 and 3
lsd-install.python
python-virtualenvwrapper
python-virtualenvwrapper
installer by export
in the terminal or put this in ~/.bashrc
file. Replcae the text <absolute_path_to_virtualmachines>
with actual directory path.
export LSCRIPTS__VMHOME="<absolute_path_to_virtualmachines>"
export LSCRIPTS__PYVENV_PATH="${LSCRIPTS__VMHOME}/virtualenvs"
lsd-install.python-virtualenvwrapper
9.0
, 10.0
, 10.2
, 11.0
. 11.1
.
lsd-install.cuda-stack
lsd-install.cuda-stack --cuda=11.1
lsd-cuda.find_vers --cuda=11.1
lsd-install.<name_of_package>
is used to install individual software components. Here are currently available options:
lsd-admin.create-login-user
lsd-admin.create-nologin-user
lsd-admin.mkalias-datadirs
lsd-admin.mkalias-osdirs
lsd-admin.mkdir-datadirs
lsd-admin.mkdir-osdirs
lsd-admin.restrict-cmds-for-sudo-user
lsd-apt.guess
lsd-apt.ppa-add
lsd-apt.ppa-list
lsd-apt.ppa-remove
lsd-apt.search
lsd-cd
lsd-cfg.basepath
lsd-cfg.color
lsd-cfg.docker
lsd-cfg.nvidia
lsd-cfg.system
lsd-cfg.typeformats
lsd-cmd.dummy
lsd-cmd.git.get.repo-urls
lsd-cmd.git.repoviz
lsd-cmd.gitlab.get.cert
lsd-cmd.menu-navigation
lsd-cmd.monitoring-cmds
lsd-cmd.mount.smb
lsd-cmd.mount.ssh
lsd-cmd.pm
lsd-cuda.addrepo
lsd-cuda.addrepo-key
lsd-cuda.admin.__purge_cuda_stack
lsd-cuda.avail
lsd-cuda.cfg
lsd-cuda.config
lsd-cuda.find_vers
lsd-cuda.select
lsd-cuda.verify
lsd-cuda.vers
lsd-date.cfg
lsd-date.get
lsd-date.get-blog
lsd-date.get-full
lsd-date.timestamp
lsd-date.timestamp.microsec
lsd-date.timestamp.millisec
lsd-date.timestamp.nanosec
lsd-dir.admin.mkalias-datadirs
lsd-dir.admin.mkalias-osdirs
lsd-dir.admin.mkdir-datadirs
lsd-dir.admin.mkdir-osdirs
lsd-dir.cfg
lsd-dir.get-datadirs-paths
lsd-dir.get-osdirs-paths
lsd-docker.cfg
lsd-docker.container.delete-all
lsd-docker.container.delete-byimage
lsd-docker.container.exec
lsd-docker.container.exec-byname
lsd-docker.container.list
lsd-docker.container.list-ids
lsd-docker.container.list-ids-all
lsd-docker.container.status
lsd-docker.container.stop-all
lsd-docker.container.test
lsd-docker.image.build
lsd-docker.osvers
lsd-docs.admin.update
lsd-docs.cmds
lsd-docs.mkdocs
lsd-docs.mkdocs.deploy
lsd-docs.mkdocs.link
lsd-git.pull
lsd-git.repo-pull
lsd-install.apache2
lsd-install.asciidoc-clone
lsd-install.atom-wget-dpkg
lsd-install.audacity-apt
lsd-install.balenaetcher-apt
lsd-install.core-apt
lsd-install.couchdb-apt
lsd-install.cuda-stack
lsd-install.darktable-apt
lsd-install.diff-tools
lsd-install.digikam-apt
lsd-install.docker-ce
lsd-install.docker-compose
lsd-install.encryption-apt
lsd-install.epub-editors-apt
lsd-install.epub-readers-apt
lsd-install.essentials-apt
lsd-install.extras-apt
lsd-install.ffmpeg-apt
lsd-install.freecad-ppa
lsd-install.ftp-apt
lsd-install.gcc-apt
lsd-install.ghostwriter-apt
lsd-install.gimp-graphics-apt
lsd-install.gitlab-apt
lsd-install.golang
lsd-install.handbrake-ppa
lsd-install.haroopad-wget-dpkg
lsd-install.heroku-cli-snap
lsd-install.httrack-apt
lsd-install.imagemagic-graphics-apt
lsd-install.imageviewer-cmdline-apt
lsd-install.inkscape-graphics-apt
lsd-install.inotifytools-apt
lsd-install.java-apt
lsd-install.kafka-wget-dpkg
lsd-install.kodi-multimedia-apt
lsd-install.krita-ppa
lsd-install.latex-apt
lsd-install.latex-editors-apt
lsd-install.librecad-ppa
lsd-install.lyx-ppa
lsd-install.makehuman3d-ppa
lsd-install.mongodb-apt
lsd-install.mysql-apt
lsd-install.nginx-apt
lsd-install.nodejs
lsd-install.nvidia-container-toolkit
lsd-install.nvidia-driver
lsd-install.nvm
lsd-install.obsstudio-ppa
lsd-install.octave-apt
lsd-install.openscad-ppa
lsd-install.openshot-ppa
lsd-install.openvpn-apt
lsd-install.pandoc-wget-dpkg
lsd-install.php
lsd-install.pitvi-flatpak
lsd-install.postgres-postgis-apt
lsd-install.postman-testing-snap
lsd-install.prerequisite
lsd-install.prerequisite-opencv
lsd-install.prerequisite-pcl
lsd-install.pycharm-snap
lsd-install.python
lsd-install.python-virtualenvwrapper
lsd-install.qgis3-apt
lsd-install.qgis3-clone
lsd-install.rasdamandb-apt
lsd-install.rclone
lsd-install.redis-wget-make
lsd-install.ros-apt
lsd-install.ruby_rails_jekyll
lsd-install.scribus-apt
lsd-install.shotcut-wget
lsd-install.shutter-ppa
lsd-install.simplescreenrecorder-ppa
lsd-install.slowmovideo-ppa
lsd-install.stacer-apt
lsd-install.sublime-apt
lsd-install.sublimemerge-apt
lsd-install.systemsensors-apt
lsd-install.timeshift-apt
lsd-install.typora-apt
lsd-install.videofix-apt
lsd-install.vim-apt
lsd-install.vim-plug
lsd-install.virtualbox-apt
lsd-install.vlc-apt
lsd-install.vokoscreen-ppa
lsd-install.vscode-apt
lsd-install.vulkansdk-apt
lsd-install.wine-apt
lsd-install.xnview-wget
lsd-install.yarn-apt
lsd-install.youtubedl-apt
lsd-install.zookeeper-wget
lsd-nvidia.cfg
lsd-nvidia.driver.avail
lsd-nvidia.gpu.info
lsd-nvidia.gpu.stats
lsd-python.create.virtualenv
lsd-python.kill
lsd-python.ls.egg
lsd-python.ls.pycache
lsd-python.path
lsd-python.rm.egg
lsd-python.rm.pycache
lsd-python.test.virtualenv
lsd-python.venv.list
lsd-python.venv.name
lsd-select.bazel
lsd-select.cuda
lsd-select.gcc
lsd-stack.all
lsd-stack.cfg
lsd-stack.docker_stack
lsd-stack.editors
lsd-stack.epub
lsd-stack.itemwise
lsd-stack.list
lsd-stack.markdowneditors
lsd-stack.misc
lsd-stack.multimedia
lsd-stack.nvidia_cuda_python_docker
lsd-stack.prerequisite
lsd-stack.programming
lsd-stack.python_stack
lsd-stack.storage
lsd-stack.sysutils
lsd-stack.utils
lsd-system.admin.create-login-user
lsd-system.admin.create-nologin-user
lsd-system.admin.restrict-cmds-for-sudo-user
lsd-system.cfg
lsd-system.cpu.cores
lsd-system.cpu.threads
lsd-system.df.json
lsd-system.info
lsd-system.ip
lsd-system.osinfo
lsd-test.argparse
lsd-test.cuda_config_supported
lsd-test.dir
lsd-test.echo
lsd-test.fio
lsd-test.log
lsd-test.system
lsd-utils.cmds
lsd-utils.date.get
lsd-utils.id.filename
lsd-utils.id.filename-tmp
lsd-utils.id.get
lsd-utils.id.salt
lsd-utils.id.uuid
lsd-utils.image.pdf
lsd-utils.image.resize
lsd-utils.kill
lsd-utils.kill.python
lsd-utils.ls
lsd-utils.ls.egg
lsd-utils.ls.pycache
lsd-utils.pid
lsd-utils.python.venvname
lsd-utils.rm.egg
lsd-utils.rm.node_modules
lsd-utils.rm.pycache
lsd-utils.system.info
lsd-utils.trash
lsd-lscripts.exe.install
lsd-lscripts.install.__itemwise
lsd-lscripts.install.__menu
lsd-lscripts.install.__stacksetup
lscripts/config
WARNING:
The reason for sensitivity towards order and sequence of definitions and imports is because I created a Cascading Pattern in order to pass variables & their respective values between different scripts without leaking them in the global scope or to terminal. There is no simple way to use a shell script as a library module, hence the decision is to focus on flexibility over rigidity, simplicity over complexity and modularity of shell scripts. The success of cascading pattern to variable passing is due to the unique name space creation mechanism through consistent naming conventions and namespace scoping.
<configname>-cfg.sh
_color_.sh
=> config/_color_.sh
_typeformats_.sh
=> config/_typeformats_.sh
__init__.sh
=> config/__init__.sh
like:
lscripts/core
All the Code modules are loaded from: => lscipts/core/__init__.sh
. Here they are mentioned in the same order in which they are imported, their import orders should not be changed. There are two types of modules:
lscripts/core/_log_.sh
_utils_.sh
=> lscripts/core/_utils_.sh
_date_.sh
=> lscripts/core/_date_.sh
_color_.sh
=> lscripts/core/_color_.sh
_typeformats_.sh
=> lscripts/core/_typeformats_.sh
_system_.sh
=> lscripts/core/_system_.sh
_fio_.sh
=> lscripts/core/_fio_.sh
_stack_.sh
=> lscripts/core/_stack_.sh
_dir_.sh
=> lscripts/core/_dir_.sh
_apt_.sh
=> lscripts/core/_apt_.sh
_nvidia_.sh
=> lscripts/core/_nvidia_.sh
_docker_.sh
=> lscripts/core/_docker_.sh
_mongodb_.sh
=> lscripts/core/_mongodb_.sh
_common_.sh
:
LSCRIPTS
: suggested user defined environment variable namespace
lscripts
as library module
LSCRIPTS__
: Environment variables namespace prefix<modulename>.<function_name>
: all module functions follow this pattern
* _<SOME_NAME>
i.e. starting with single _
underscorelsd-mod.log.debug
where module name is _log_.sh
* __<SOME_NAME>
i.e. starting with double __
underscoreslsd-mod.log.__failure
where module name is _log_.sh
is a expected to private, so instead use it’s wrapper: lsd-mod.log.fail
* Environment variablesLSCRIPTS__
git clone https://github.com/skillplot/lscripts-docker.git
~/.bashrc
file. Change the path where you cloned the repo:
export LSCRIPTS__DOCKER="<change_this_to_path_absolute_path>/lscripts-docker"
[ -f ${LSCRIPTS__DOCKER}/lscripts/lscripts.env.sh ] && source ${LSCRIPTS__DOCKER}/lscripts/lscripts.env.sh
lsd-test.argparse
lsd-test.cuda_config_supported
lsd-test.dir
lsd-test.echo
lsd-test.fio
lsd-test.log
lsd-test.system
lsd-
. All th namespaces are:
lsd-admin
lsd-apt
lsd-cd
lsd-cfg
lsd-cmd
lsd-cuda
lsd-date
lsd-dir
lsd-docker
lsd-docs
lsd-git
lsd-install
lsd-lscripts
lsd-mod
=> not to be used directly. It’s a namespace for core modules.lsd-nvidia
lsd-python
lsd-select
lsd-stack
lsd-system
lsd-test
lsd-utils
lsd-cd
- change to the cloned directory${LSCRIPTS__DOCKER}/lscripts
directory.lsd-ls
- It is at core ls -ltr
plus wit numeric permission value added as the first column i.e. 644 -rw-r--r--
lsd-cfg.
lsd-cfg.basepath
lsd-cfg.color
lsd-cfg.docker
lsd-cfg.nvidia
lsd-cfg.system
lsd-cfg.typeformats
lsd-cd
lsd-admin.create-login-user
lsd-admin.create-nologin-user
##
lsd-admin.mkalias-datadirs
lsd-admin.mkalias-osdirs
lsd-admin.mkdir-datadirs
lsd-admin.mkdir-osdirs
##
lsd-admin.restrict-cmds-for-sudo-user
##
lsd-cmd.dummy
lsd-cmd.git.get.repo-urls
lsd-cmd.gitlab.get.cert
lsd-cmd.git.repoviz
lsd-cmd.menu-navigation
lsd-cmd.monitoring-cmds
lsd-cmd.mount.smb
lsd-cmd.mount.ssh
lsd-cmd.pm
lsd-cmd.python.list.venv
lsd-cmd.python.venvname.generate
##
lsd-cuda.admin.__purge_cuda_stack
lsd-cuda.avail
lsd-cuda.cfg
lsd-cuda.config
lsd-cuda.select
lsd-cuda.verify
lsd-cuda.vers
##
lsd-date.cfg
lsd-date.get
lsd-date.get-blog
lsd-date.get-full
lsd-date.timestamp
lsd-date.timestamp.microsec
lsd-date.timestamp.millisec
lsd-date.timestamp.nanosec
##
lsd-dir.cfg
lsd-dir.admin.mkalias-datadirs
lsd-dir.admin.mkalias-osdirs
lsd-dir.admin.mkdir-datadirs
lsd-dir.admin.mkdir-osdirs
lsd-dir.get-datadirs-paths
lsd-dir.get-osdirs-paths
##
lsd-docs.admin.update
lsd-docs.cmds
lsd-docs.mkdocs
lsd-docs.mkdocs.deploy
lsd-docs.mkdocs.link
##
lsd-python.create.virtualenv
lsd-python.create.virtualenv --path=/usr/bin/python2
lsd-python.kill
lsd-python.ls.egg
lsd-python.ls.pycache
lsd-python.rm.egg
lsd-python.rm.pycache
lsd-python.test.virtualenv
lsd-python.test.virtualenv --path=/usr/bin/python2
lsd-python.venv.list
lsd-python.venv.name
lsd-python.venv.name --path=/usr/bin/python2
##
lsd-nvidia.cfg
lsd-nvidia.driver.avail
lsd-nvidia.gpu.info
lsd-nvidia.gpu.stats
##
lsd-select.bazel
lsd-select.cuda
lsd-select.gcc
##
lsd-system.admin.create-login-user
lsd-system.admin.create-nologin-user
lsd-system.admin.restrict-cmds-for-sudo-user
lsd-system.cfg
lsd-system.cpu.cores
lsd-system.cpu.threads
lsd-system.df.json
lsd-system.info
lsd-system.ip
lsd-system.osinfo
##
lsd-test.argparse
lsd-test.cuda_config_supported
lsd-test.dir
lsd-test.echo
lsd-test.fio
lsd-test.log
lsd-test.system
##
lsd-utils.cmds
#
lsd-utils.date.get
#
lsd-utils.id.filename
lsd-utils.id.filename-tmp
lsd-utils.id.get
lsd-utils.id.salt
lsd-utils.id.uuid
#
lsd-utils.image.pdf
lsd-utils.image.resize
#
lsd-utils.kill
lsd-utils.kill.python
#
lsd-utils.ls
lsd-utils.ls.egg
lsd-utils.ls.pycache
#
lsd-utils.pid
#
lsd-utils.python.venvname
#
lsd-utils.rm.egg
lsd-utils.rm.pycache
#
lsd-utils.system.info
#
lsd-utils.trash
#####
lsd-lscripts.alias.main
lsd-lscripts.env.main
lsd-lscripts.exe.install
lsd-lscripts.exe.main
lsd-lscripts.install.__itemwise
lsd-lscripts.install.main
lsd-lscripts.install.__menu
lsd-lscripts.install.__stacksetup
json
output to human readable format using jq
## install jq - command line json parser util
# sudo apt -y install jq
lsd-system.df.json | jq
lscripts
functions as a commandThis is used extensively to create alias for different namespace based commands. Though one can execute the script directly.
lsd-mod.fio.exec_cmd_test
## Test for executing any function from the lscripts framework
## key/value parameter passing (valid scenarios)
bash lscripts/exec_cmd.sh --cmd=lsd-mod.fio.exec_cmd_test --name=blah --age=100
bash lscripts/exec_cmd.sh cmd=lsd-mod.fio.exec_cmd_test name=blah --age=100
bash lscripts/exec_cmd.sh cmd=lsd-mod.fio.exec_cmd_test --name=blah --age=100
## execute debug module invoked from command line directly
bash lscripts/exec_cmd.sh --cmd=lsd-mod.fio.debug_logger
## NVIDIA gpu stats
bash lscripts/exec_cmd.sh --cmd=_nvidia_.get__gpu_stats
~/.bashrc
file, to change the behavior of the lscripts-docker
:
###True=1; False=0
export LSCRIPTS__DEBUG=1
## [1]="CRITICAL"
## [2]="ERROR"
## [3]="WARNING"
## [4]="INFO"
## [5]="OK"
## [6]="SUCCESS"
## [7]="DEBUG"
## [8]="STACKTRACE"
export LSCRIPTS__LOG_LEVEL=3
## This is when requiring to build and compile external softwares
export LSCRIPTS__BASENAME="lscripts"
export LSCRIPTS__ROOT="<change_this_to_path_absolute_path>"
Additionally following environment variables can help you customize the lscripts-docker
based workspace setup and configurations.
LSCRIPTS__BASENAME
LSCRIPTS__ROOT
LSCRIPTS__BANNER
LSCRIPTS__BANNER_TYPE
LSCRIPTS__DEBUG
LSCRIPTS__LOG_LEVEL
LSCRIPTS__VMHOME
LSCRIPTS__PYVENV_PATH
LSCRIPTS__WSGIPYTHONPATH
LSCRIPTS__WSGIPYTHONHOME
LSCRIPTS__ANDROID_HOME
LSCRIPTS__APACHE_HOME
LSCRIPTS__WWW_HOME
LSCRIPTS__DOWNLOADS
LSCRIPTS__EXTERNAL_HOME