├── .github
└── prlint.json
├── .gitignore
├── .gitmodules
├── .pre-commit-config.yaml
├── CODEOWNER
├── LICENSE
├── OpenCV
├── .ipynb_checkpoints
│ ├── install_opencv4.1.1_jetson-checkpoint.sh
│ └── remove-checkpoint.sh
├── install_opencv4.1.1_jetson.sh
└── remove.sh
├── README.md
├── contribute.md
├── set_cuda.sh
└── src
├── .hugo_build.lock
├── LICENSE
├── README.md
├── config.toml
├── config
└── _default
│ ├── markup.toml
│ ├── menus
│ └── menu.en.toml
│ └── params.toml
├── content
├── _index.md
├── docs
│ ├── _index.md
│ ├── clarity
│ │ ├── _index.md
│ │ ├── blogging.md
│ │ ├── customize.md
│ │ ├── features.md
│ │ ├── getting-started.md
│ │ ├── images.md
│ │ ├── syntax-highlighting.md
│ │ └── theme-overrides.md
│ └── compose
│ │ ├── _index.md
│ │ ├── customize.md
│ │ ├── graphs-charts-tables.md
│ │ ├── install-theme.md
│ │ ├── mermaid.md
│ │ ├── organize-content.md
│ │ ├── search.md
│ │ ├── shortcodes-example.md
│ │ ├── shortcodes.md
│ │ └── use-forestry-cms.md
├── posts
│ └── .gitkeep
├── projects.csv
├── search.md
└── themes.csv
├── go.mod
├── go.sum
├── netlify.toml
├── resources
└── _gen
│ └── assets
│ └── sass
│ └── sass
│ ├── main.sass_ca26857cefa9076967ab300682271513.content
│ └── main.sass_ca26857cefa9076967ab300682271513.json
└── static
└── images
├── GitHubMarkDark.svg
├── GitHubMarkLight.svg
├── clarity
├── article-toc.png
├── image-figure.png
├── image-inline.png
├── screenshot-darkmode.png
├── screenshot-mobile-darkmode.png
├── screenshot-mobile.png
├── screenshot.png
├── syntax-block.gif
├── tags.png
├── tn-darkmode.png
└── tn.png
├── compose-light.svg
├── compose.svg
├── painting.jpg
└── scribble.jpg
/.github/prlint.json:
--------------------------------------------------------------------------------
1 | {
2 | "title": [
3 | {
4 | "pattern": "^(build|ci|docs|feat|fix|perf|refactor|style|test)((.+))?:\\s.+",
5 | "message": "Your title needs to be prefixed with a topic"
6 | }
7 | ]
8 | }
9 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | .ipynb_checkpoints
2 | .idea
3 |
--------------------------------------------------------------------------------
/.gitmodules:
--------------------------------------------------------------------------------
1 | [submodule "src/themes/compose"]
2 | path = src/themes/compose
3 | url = git@github.com:onweru/compose.git
4 |
--------------------------------------------------------------------------------
/.pre-commit-config.yaml:
--------------------------------------------------------------------------------
1 | repos:
2 | - repo: https://github.com/pre-commit/pre-commit-hooks
3 | rev: v4.0.1
4 | hooks:
5 | - id: trailing-whitespace
6 | - id: end-of-file-fixer
7 | - id: check-json
8 | - id: check-yaml
9 | - id: double-quote-string-fixer
10 |
--------------------------------------------------------------------------------
/CODEOWNER:
--------------------------------------------------------------------------------
1 | Kevin Yu (@yqlbu)
2 | Shi Kun (@kunish)
3 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2020 kevinyu
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/OpenCV/.ipynb_checkpoints/install_opencv4.1.1_jetson-checkpoint.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # License: MIT. See license file in root directory
3 | # Copyright(c) JetsonHacks (2017-2019)
4 | # Modifier(c) Kevin Yu (2020)
5 |
6 | echo -e "
7 | +-------------------------------------------------------+
8 | @@@ Welcome to OpenCV4.1-Jetson Installation Toolkit @@@@
9 | | |
10 | | Select your Jetson DevKit Model |
11 | | |
12 | | 1. Jetson-Nano |
13 | | 2. Jetson-TX2 |
14 | | 3. Jetson-Xavier |
15 | | |
16 | +-------------------------------------------------------+
17 | "
18 |
19 | param (){
20 | read -p '[BASH] Put your Jetson model # here: ' NUM
21 | if [ "$NUM" == '1' ] || [ "$NUM" == '2' ] || [ "$NUM" == '3' ]
22 | then
23 | echo -e "[BASH] You choose #$NUM."
24 | read -p '[BASH] Do you wish to continue? (y/n) ' VAL
25 | #if y continue, else done
26 | if [ "$VAL" == "y" ]
27 | then
28 | echo -e "[BASH] Installation will start in 3 seconds."
29 | sleep 3
30 | # Jetson Nano
31 | if [ "$NUM" == '1' ]; then
32 | ARCH_BIN=5.3
33 | # Jetson TX2
34 | elif [ "$NUM" == '2' ]; then
35 | ARCH_BIN=6.2
36 | # Jetson AGX Xaviers
37 | elif [ "$NUM" == '3' ]; then
38 | ARCH_BIN=7.2
39 | fi
40 | start
41 | else
42 | echo "[BASH] Installation ends..."
43 | fi
44 | else
45 | echo "[BASH] Please put the right # "
46 | param
47 | fi
48 | }
49 |
50 | start (){
51 | DOWNLOAD_OPENCV_EXTRAS=NO
52 | WHEREAMI=$PWD
53 | NUM_JOBS=$(nproc)
54 | CLEANUP=true
55 | PACKAGE_OPENCV="-D CPACK_BINARY_DEB=ON"
56 | CMAKE_INSTALL_PREFIX=$INSTALL_DIR
57 |
58 | echo "[BASH] Installation start!"
59 | sleep 2
60 |
61 | # Print out the current configuration
62 | echo "[BASH] Build configuration: "
63 | echo " NVIDIA Jetson Nano"
64 | echo " OpenCV binaries will be installed in: $CMAKE_INSTALL_PREFIX"
65 | echo " OpenCV Source will be installed in: $OPENCV_SOURCE_DIR"
66 | if [ "$PACKAGE_OPENCV" = "" ] ; then
67 | echo " NOT Packaging OpenCV"
68 | else
69 | echo " Packaging OpenCV"
70 | fi
71 |
72 | if [ $DOWNLOAD_OPENCV_EXTRAS == "YES" ] ; then
73 | echo "[BASH] Also downloading opencv_extras"
74 | fi
75 |
76 | # Repository setup
77 | sudo apt-add-repository universe
78 | sudo apt-get update
79 | # Download dependencies for the desired configuration
80 | cd $WHEREAMI
81 | echo "[BASH] Install dependencies ..."
82 | sleep 2
83 | sudo apt-get install -y \
84 | build-essential \
85 | cmake \
86 | libavcodec-dev \
87 | libavformat-dev \
88 | libavutil-dev \
89 | libeigen3-dev \
90 | libglew-dev \
91 | libgtk2.0-dev \
92 | libgtk-3-dev \
93 | libjpeg-dev \
94 | libpng-dev \
95 | libpostproc-dev \
96 | libswscale-dev \
97 | libtbb-dev \
98 | libtiff5-dev \
99 | libv4l-dev \
100 | libxvidcore-dev \
101 | libx264-dev \
102 | qt5-default \
103 | zlib1g-dev \
104 | libwebp-dev \
105 | pkg-config
106 |
107 | # We will be supporting OpenGL, we need a little magic to help
108 | # https://devtalk.nvidia.com/default/topic/1007290/jetson-tx2/building-opencv-with-opengl-support-/post/5141945/#5141945
109 | cd /usr/local/cuda/include
110 | sudo patch -N cuda_gl_interop.h $WHEREAMI'/patches/OpenGLHeader.patch'
111 |
112 | # Python 2.7
113 | sudo apt-get install -y python-dev python-numpy python-py python-pytest
114 | # Python 3.6
115 | sudo apt-get install -y python3-dev python3-numpy python3-py python3-pytest
116 |
117 | # GStreamer support
118 | sudo apt-get install -y libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev
119 |
120 | echo "[BASH] Download sources ..."
121 | sleep 2
122 |
123 | cd $OPENCV_SOURCE_DIR
124 | git clone --branch "$OPENCV_VERSION" https://github.com/opencv/opencv.git
125 | git clone --branch "$OPENCV_VERSION" https://github.com/opencv/opencv_contrib.git
126 |
127 | if [ $DOWNLOAD_OPENCV_EXTRAS == "YES" ] ; then
128 | echo "[BASH] Installing opencv_extras"
129 | # This is for the test data
130 | cd $OPENCV_SOURCE_DIR
131 | git clone https://github.com/opencv/opencv_extra.git
132 | cd opencv_extra
133 | git checkout -b v${OPENCV_VERSION} ${OPENCV_VERSION}
134 | fi
135 |
136 | # Patch the Eigen library issue ...
137 | cd $OPENCV_SOURCE_DIR/opencv
138 | sed -i 's/include /include /g' modules/core/include/opencv2/core/private.hpp
139 |
140 | # Create the build directory and start cmake
141 | cd $OPENCV_SOURCE_DIR/opencv
142 | mkdir build
143 | cd build
144 |
145 | echo "[BASH] Build from sources ..."
146 | sleep 2
147 |
148 | echo $PWD
149 | time cmake -D CMAKE_BUILD_TYPE=RELEASE \
150 | -D CMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX} \
151 | -D WITH_CUDA=ON \
152 | -D CUDA_ARCH_BIN=${ARCH_BIN} \
153 | -D CUDA_ARCH_PTX="" \
154 | -D ENABLE_FAST_MATH=ON \
155 | -D CUDA_FAST_MATH=ON \
156 | -D WITH_CUBLAS=ON \
157 | -D WITH_LIBV4L=ON \
158 | -D WITH_V4L=ON \
159 | -D WITH_GSTREAMER=ON \
160 | -D WITH_GSTREAMER_0_10=OFF \
161 | -D OPENCV_DNN_CUDA=ON \
162 | -D WITH_QT=ON \
163 | -D WITH_TBB=ON \
164 | -D BUILD_opencv_python2=ON \
165 | -D BUILD_opencv_python3=ON \
166 | -D BUILD_TESTS=OFF \
167 | -D BUILD_PERF_TESTS=OFF \
168 | -D OPENCV_EXTRA_MODULES_PATH=../../opencv_contrib/modules \
169 | $"PACKAGE_OPENCV" \
170 | ../
171 |
172 |
173 | if [ $? -eq 0 ] ; then
174 | echo "[BASH] CMake configuration make successful"
175 | else
176 | # Try to make again
177 | echo "[BASH] CMake issues " >&2
178 | echo "[BASH] Please check the configuration being used"
179 | exit 1
180 | fi
181 |
182 | # Consider the MAXN performance mode if using a barrel jack on the Nano
183 | time make -j$NUM_JOBS
184 | if [ $? -eq 0 ] ; then
185 | echo "[BASH] OpenCV make successful"
186 | else
187 | # Try to make again; Sometimes there are issues with the build
188 | # because of lack of resources or concurrency issues
189 | echo "[BASH] Make did not build " >&2
190 | echo "[BASH] Retrying ... "
191 | # Single thread this time
192 | make
193 | if [ $? -eq 0 ] ; then
194 | echo "[BASH] OpenCV make successful"
195 | else
196 | # Try to make again
197 | echo "[BASH] Make did not successfully build" >&2
198 | echo "[BASH] Please fix issues and retry build"
199 | exit 1
200 | fi
201 | fi
202 |
203 | echo "[BASH] Installing ... "
204 | sudo make install
205 | sudo ldconfig
206 | if [ $? -eq 0 ] ; then
207 | echo "[BASH] OpenCV installed in: $CMAKE_INSTALL_PREFIX"
208 | else
209 | echo "[BASH] There was an issue with the final installation"
210 | exit 1
211 | fi
212 |
213 | # If PACKAGE_OPENCV is on, pack 'er up and get ready to go!
214 | # We should still be in the build directory ...
215 | if [ "$PACKAGE_OPENCV" != "" ] ; then
216 | echo "[BASH] Starting Packaging"
217 | sudo ldconfig
218 | time sudo make package -j$NUM_JOBS
219 | if [ $? -eq 0 ] ; then
220 | echo "[BASH] OpenCV make package successful"
221 | else
222 | # Try to make again; Sometimes there are issues with the build
223 | # because of lack of resources or concurrency issues
224 | echo "[BASH] Make package did not build " >&2
225 | echo "[BASH] Retrying ... "
226 | # Single thread this time
227 | sudo make package
228 | if [ $? -eq 0 ] ; then
229 | echo "[BASH] OpenCV make package successful"
230 | else
231 | # Try to make again
232 | echo "[BASH] Make package did not successfully build" >&2
233 | echo "[BASH] Please fix issues and retry build"
234 | exit 1
235 | fi
236 | fi
237 | fi
238 |
239 | # Install Python packages
240 | sudo apt-get install -y libopencv-dev
241 | sudo apt-get install -y libopencv-core-dev
242 |
243 | # check installation
244 | IMPORT_CHECK="$(python3 -c "import cv2 ; print(cv2.__version__)")"
245 | if [[ $IMPORT_CHECK != *$OPENCV_VERSION* ]]; then
246 | echo "[BASH] There was an error loading OpenCV in the Python sanity test."
247 | echo "[BASH] The loaded version does not match the version built here."
248 | echo "[BASH] Please check the installation."
249 | echo "[BASH] The first check should be the PYTHONPATH environment variable."
250 | fi
251 |
252 | echo "[BASH] Installation completed ..."
253 | sleep 2
254 |
255 | }
256 |
257 | # Execute
258 | ARCH_BIN=0
259 | INSTALL_DIR=/usr/local
260 | OPENCV_SOURCE_DIR=$HOME
261 | OPENCV_VERSION=4.1.1
262 | param
263 |
264 |
--------------------------------------------------------------------------------
/OpenCV/.ipynb_checkpoints/remove-checkpoint.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | echo " -> Purge old opencv installation"
3 | sudo apt-get purge libopencv*
4 |
--------------------------------------------------------------------------------
/OpenCV/install_opencv4.1.1_jetson.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # License: MIT. See license file in root directory
3 | # Copyright(c) JetsonHacks (2017-2019)
4 | # Modifier(c) Kevin Yu (2020)
5 |
6 | echo -e "
7 | +-------------------------------------------------------+
8 | @@@ Welcome to OpenCV4.1-Jetson Installation Toolkit @@@@
9 | | |
10 | | Select your Jetson DevKit Model |
11 | | |
12 | | 1. Jetson-Nano |
13 | | 2. Jetson-TX2 |
14 | | 3. Jetson-Xavier |
15 | | |
16 | +-------------------------------------------------------+
17 | "
18 |
19 | param (){
20 | read -p '[BASH] Put your Jetson model # here: ' NUM
21 | if [ "$NUM" == '1' ] || [ "$NUM" == '2' ] || [ "$NUM" == '3' ]
22 | then
23 | echo -e "[BASH] You choose #$NUM."
24 | read -p '[BASH] Do you wish to continue? (y/n) ' VAL
25 | #if y continue, else done
26 | if [ "$VAL" == "y" ]
27 | then
28 | echo -e "[BASH] Installation will start in 3 seconds."
29 | sleep 3
30 | # Jetson Nano
31 | if [ "$NUM" == '1' ]; then
32 | ARCH_BIN=5.3
33 | # Jetson TX2
34 | elif [ "$NUM" == '2' ]; then
35 | ARCH_BIN=6.2
36 | # Jetson AGX Xaviers
37 | elif [ "$NUM" == '3' ]; then
38 | ARCH_BIN=7.2
39 | fi
40 | start
41 | else
42 | echo "[BASH] Installation ends..."
43 | fi
44 | else
45 | echo "[BASH] Please put the right # "
46 | param
47 | fi
48 | }
49 |
50 | start (){
51 | DOWNLOAD_OPENCV_EXTRAS=NO
52 | WHEREAMI=$PWD
53 | NUM_JOBS=$(nproc)
54 | CLEANUP=true
55 | PACKAGE_OPENCV="-D CPACK_BINARY_DEB=ON"
56 | CMAKE_INSTALL_PREFIX=$INSTALL_DIR
57 |
58 | echo "[BASH] Installation start!"
59 | sleep 2
60 |
61 | # Print out the current configuration
62 | echo "[BASH] Build configuration: "
63 | echo " NVIDIA Jetson Nano"
64 | echo " OpenCV binaries will be installed in: $CMAKE_INSTALL_PREFIX"
65 | echo " OpenCV Source will be installed in: $OPENCV_SOURCE_DIR"
66 | if [ "$PACKAGE_OPENCV" = "" ] ; then
67 | echo " NOT Packaging OpenCV"
68 | else
69 | echo " Packaging OpenCV"
70 | fi
71 |
72 | if [ $DOWNLOAD_OPENCV_EXTRAS == "YES" ] ; then
73 | echo "[BASH] Also downloading opencv_extras"
74 | fi
75 |
76 | # Repository setup
77 | sudo apt-add-repository universe
78 | sudo apt-get update
79 | # Download dependencies for the desired configuration
80 | cd $WHEREAMI
81 | echo "[BASH] Install dependencies ..."
82 | sleep 2
83 | sudo apt-get install -y \
84 | build-essential \
85 | cmake \
86 | libavcodec-dev \
87 | libavformat-dev \
88 | libavutil-dev \
89 | libeigen3-dev \
90 | libglew-dev \
91 | libgtk2.0-dev \
92 | libgtk-3-dev \
93 | libjpeg-dev \
94 | libpng-dev \
95 | libpostproc-dev \
96 | libswscale-dev \
97 | libtbb-dev \
98 | libtiff5-dev \
99 | libv4l-dev \
100 | libxvidcore-dev \
101 | libx264-dev \
102 | qt5-default \
103 | zlib1g-dev \
104 | libwebp-dev \
105 | pkg-config
106 |
107 | # We will be supporting OpenGL, we need a little magic to help
108 | # https://devtalk.nvidia.com/default/topic/1007290/jetson-tx2/building-opencv-with-opengl-support-/post/5141945/#5141945
109 | cd /usr/local/cuda/include
110 | sudo patch -N cuda_gl_interop.h $WHEREAMI'/patches/OpenGLHeader.patch'
111 |
112 | # Python 2.7
113 | sudo apt-get install -y python-dev python-numpy python-py python-pytest
114 | # Python 3.6
115 | sudo apt-get install -y python3-dev python3-numpy python3-py python3-pytest
116 |
117 | # GStreamer support
118 | sudo apt-get install -y libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev
119 |
120 | echo "[BASH] Download sources ..."
121 | sleep 2
122 |
123 | cd $OPENCV_SOURCE_DIR
124 | git clone --branch "$OPENCV_VERSION" https://github.com/opencv/opencv.git
125 | git clone --branch "$OPENCV_VERSION" https://github.com/opencv/opencv_contrib.git
126 |
127 | if [ $DOWNLOAD_OPENCV_EXTRAS == "YES" ] ; then
128 | echo "[BASH] Installing opencv_extras"
129 | # This is for the test data
130 | cd $OPENCV_SOURCE_DIR
131 | git clone https://github.com/opencv/opencv_extra.git
132 | cd opencv_extra
133 | git checkout -b v${OPENCV_VERSION} ${OPENCV_VERSION}
134 | fi
135 |
136 | # Patch the Eigen library issue ...
137 | cd $OPENCV_SOURCE_DIR/opencv
138 | sed -i 's/include /include /g' modules/core/include/opencv2/core/private.hpp
139 |
140 | # Create the build directory and start cmake
141 | cd $OPENCV_SOURCE_DIR/opencv
142 | mkdir build
143 | cd build
144 |
145 | echo "[BASH] Build from sources ..."
146 | sleep 2
147 |
148 | echo $PWD
149 | time cmake -D CMAKE_BUILD_TYPE=RELEASE \
150 | -D CMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX} \
151 | -D WITH_CUDA=ON \
152 | -D CUDA_ARCH_BIN=${ARCH_BIN} \
153 | -D CUDA_ARCH_PTX="" \
154 | -D ENABLE_FAST_MATH=ON \
155 | -D CUDA_FAST_MATH=ON \
156 | -D WITH_CUBLAS=ON \
157 | -D WITH_LIBV4L=ON \
158 | -D WITH_V4L=ON \
159 | -D WITH_GSTREAMER=ON \
160 | -D WITH_GSTREAMER_0_10=OFF \
161 | -D OPENCV_DNN_CUDA=ON \
162 | -D WITH_QT=ON \
163 | -D WITH_TBB=ON \
164 | -D BUILD_opencv_python2=ON \
165 | -D BUILD_opencv_python3=ON \
166 | -D BUILD_TESTS=OFF \
167 | -D BUILD_PERF_TESTS=OFF \
168 | -D OPENCV_EXTRA_MODULES_PATH=../../opencv_contrib/modules \
169 | $"PACKAGE_OPENCV" \
170 | ../
171 |
172 |
173 | if [ $? -eq 0 ] ; then
174 | echo "[BASH] CMake configuration make successful"
175 | else
176 | # Try to make again
177 | echo "[BASH] CMake issues " >&2
178 | echo "[BASH] Please check the configuration being used"
179 | exit 1
180 | fi
181 |
182 | # Consider the MAXN performance mode if using a barrel jack on the Nano
183 | time make -j$NUM_JOBS
184 | if [ $? -eq 0 ] ; then
185 | echo "[BASH] OpenCV make successful"
186 | else
187 | # Try to make again; Sometimes there are issues with the build
188 | # because of lack of resources or concurrency issues
189 | echo "[BASH] Make did not build " >&2
190 | echo "[BASH] Retrying ... "
191 | # Single thread this time
192 | make
193 | if [ $? -eq 0 ] ; then
194 | echo "[BASH] OpenCV make successful"
195 | else
196 | # Try to make again
197 | echo "[BASH] Make did not successfully build" >&2
198 | echo "[BASH] Please fix issues and retry build"
199 | exit 1
200 | fi
201 | fi
202 |
203 | echo "[BASH] Installing ... "
204 | sudo make install
205 | sudo ldconfig
206 | if [ $? -eq 0 ] ; then
207 | echo "[BASH] OpenCV installed in: $CMAKE_INSTALL_PREFIX"
208 | else
209 | echo "[BASH] There was an issue with the final installation"
210 | exit 1
211 | fi
212 |
213 | # If PACKAGE_OPENCV is on, pack 'er up and get ready to go!
214 | # We should still be in the build directory ...
215 | if [ "$PACKAGE_OPENCV" != "" ] ; then
216 | echo "[BASH] Starting Packaging"
217 | sudo ldconfig
218 | time sudo make package -j$NUM_JOBS
219 | if [ $? -eq 0 ] ; then
220 | echo "[BASH] OpenCV make package successful"
221 | else
222 | # Try to make again; Sometimes there are issues with the build
223 | # because of lack of resources or concurrency issues
224 | echo "[BASH] Make package did not build " >&2
225 | echo "[BASH] Retrying ... "
226 | # Single thread this time
227 | sudo make package
228 | if [ $? -eq 0 ] ; then
229 | echo "[BASH] OpenCV make package successful"
230 | else
231 | # Try to make again
232 | echo "[BASH] Make package did not successfully build" >&2
233 | echo "[BASH] Please fix issues and retry build"
234 | exit 1
235 | fi
236 | fi
237 | fi
238 |
239 | # Install Python packages
240 | sudo apt-get install -y libopencv-dev
241 | sudo apt-get install -y libopencv-core-dev
242 |
243 | # check installation
244 | IMPORT_CHECK="$(python3 -c "import cv2 ; print(cv2.__version__)")"
245 | if [[ $IMPORT_CHECK != *$OPENCV_VERSION* ]]; then
246 | echo "[BASH] There was an error loading OpenCV in the Python sanity test."
247 | echo "[BASH] The loaded version does not match the version built here."
248 | echo "[BASH] Please check the installation."
249 | echo "[BASH] The first check should be the PYTHONPATH environment variable."
250 | fi
251 |
252 | echo "[BASH] Installation completed ..."
253 | sleep 2
254 |
255 | }
256 |
257 | # Execute
258 | ARCH_BIN=0
259 | INSTALL_DIR=/usr/local
260 | OPENCV_SOURCE_DIR=$HOME
261 | OPENCV_VERSION=4.1.1
262 | param
263 |
264 |
--------------------------------------------------------------------------------
/OpenCV/remove.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | echo " -> Purge old opencv installation"
3 | sudo apt-get purge libopencv*
4 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | 🏠 Jetson Packages Family
2 |
3 | A collection of AWESOME Tools tailored to NVIDIA Jetson Devices
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 | ---
16 |
17 | CopyRight 2020-2024 @piyoki. All rights reserved.
18 |
19 | This repo aims to give you clear instructions on how to install packages on AArch64(ARM) Platform, especially in Jetson family. All the packages have been tested on Jetson AGX Xavier and Jetson Nano.
20 |
21 | ## Pre-Commit
22 |
23 | This repo uses [pre-commit](https://github.com/pre-commit/pre-commit) for managing and maintaining multi-language preo-commit hooks.
24 |
25 | ## Dependencies Installation
26 |
27 | Before performing any installation, you may need to install the following basic dependencies
28 |
29 | ```bash
30 | $ sudo apt-get install -y nano curl
31 | # python3
32 | $ sudo apt-get install -y python3-pip python3-dev python3-setuptools
33 | # python2
34 | $ sudo apt-get install -y python-pip python-dev python-setuptools
35 | $ sudo apt-get install -y libcanberra-gtk0 libcanberra-gtk-module
36 | ```
37 |
38 | **Notes:** If you wish to set `python3` as your default python compiler and `pip` package manager, please do the following:
39 |
40 | ```bash
41 | # python
42 | $ sudo rm -rf /usr/bin/python && sudo ln -s /usr/bin/python3 /usr/bin/python
43 | $ which python
44 | # pip
45 | $ sudo rm -rf /usr/bin/pip && sudo ln -s /usr/bin/pip3 /usr/bin/pip
46 | $ which pip
47 | ```
48 |
49 | Python-pip
50 |
51 | ```bash
52 | # pip3
53 | $ pip3 install -U pip
54 | $ pip3 install setuptools wheel cython
55 | ```
56 |
57 | ## Set CUDA Path
58 |
59 | If you have not set CUDA Path yet, you might need to do so.
60 |
61 | Setup with script
62 |
63 | ```bash
64 | $ wget -qO- https://github.com/yqlbu/jetson-packages-family/raw/master/set_cuda.sh | bash -
65 | ```
66 |
67 | Setup manually
68 |
69 | ```bash
70 | $ echo "export PATH=/usr/local/cuda/bin:\${PATH}" >> ${HOME}/.bashrc
71 | $ echo "export LD_LIBRARY_PATH=/usr/local/cuda/lib64:\${LD_LIBRARY_PATH}" >> ${HOME}/.bashrc
72 | $ echo "export CPATH=$CPATH:/usr/local/cuda/targets/aarch64-linux/include" >> ${HOME}/.bashrc
73 | $ echo "export LIBRARY_PATH=$LIBRARY_PATH:/usr/local/cuda/targets/aarch64-linux/lib" >> ${HOME}/.bashrc
74 | $ source ~/.bashrc
75 | ```
76 |
77 | ## Boot From SSD (Xavier Only)
78 |
79 | Compared with Jetson Nano, an important feature comes with Jetson Xavier NX and Jetson AGX Xavier is that they come with the M.2 Key M connector. According to the third-party testing, the reading speed from my SSD is 7 times faster than the SD card. Thus, to boot from SSD will surely boost the performance of Jetson Xavier.
80 |
81 | [Guide to setup](https://www.seeedstudio.com/blog/2020/06/22/boot-jetson-xavier-from-m-2-ssd/)
82 |
83 | [Jetsonhacks RootOnNVMe repo](https://github.com/jetsonhacks/rootOnNVMe.git)
84 |
85 | ## Fan Control
86 |
87 | A script that can control the PWM fan with the change of the CPU temperature of any Jetson Machine (Jetson Nano, Jetson TX1, TX2, Jetson Xavier)
88 |
89 | [Guide to setup](https://github.com/yqlbu/fan-control)
90 |
91 | ## Packages List
92 |
93 | - [Pytorch](#pytorch)
94 | - [Tensorflow](#tensorflow)
95 | - [Machine Learning](#machine-learning)
96 | - [Scikit Learn](#scikit-learn)
97 | - [Scipy](#scipy)
98 | - [Matplotlib](#matplotlib)
99 | - [Pycuda](pycuda)
100 | - [Jupyter Lab](#jupyter-lab)
101 | - [Pillow](#pillow)
102 | - [Pandas](#pandas)
103 | - [Numpy](#numpy)
104 | - [Seaborn](#seaborn)
105 | - [ONNX](#onnx)
106 | - [LLVM](#llvm)
107 | - [Numba](#numba)
108 | - [Jetson Stats](#jetson-stats)
109 | - [NeoVim Server](#neovim-server)
110 | - [VSCode](#vs-code-for-aarch64)
111 | - [CodeServer](#code-server)
112 | - [Archiconda3](#archiconda3)
113 | - [OpenCV](#opencv)
114 | - [Pycharm](#pycharm)
115 | - [Lazygit](#lazygit)
116 | - [Lsd](#lsd)
117 | - [Ctop](#ctop)
118 | - [Cointop](#cointop)
119 | - [Gotop](#gotop)
120 | - [Bashtop](#bashtop)
121 | - [Httpie](#httpie)
122 | - [Ranger](#ranger)
123 | - [Neofetch](#neofetch)
124 | - [Docker](#docker)
125 | - [Dlib](#dlib)
126 | - [LabelImg](#labelimg)
127 | - [Qt5](#qt5)
128 | - [Kubernetes](#kubernetes)
129 | - [Nomachine](#nomachine)
130 |
131 | ## Pytorch
132 |
133 | PyTorch v1.8.0 (JetPack 4.4 +)
134 |
135 | Python 3.6 - torch-1.8.0-cp36-cp36m-linux_aarch64.whl
136 |
137 | ```bash
138 | $ wget https://nvidia.box.com/shared/static/p57jwntv436lfrd78inwl7iml6p13fzh.whl -O torch-1.8.0-cp36-cp36m-linux_aarch64.whl
139 | $ sudo apt-get install python3-pip libopenblas-base libopenmpi-dev
140 | $ pip3 install Cython
141 | $ pip3 install numpy torch-1.8.0-cp36-cp36m-linux_aarch64.whl
142 | ```
143 |
144 | Torchvision v0.5.0 (compatible with PyTorch v1.4.0)
145 |
146 | ```bash
147 | $ sudo apt-get install libjpeg-dev zlib1g-dev libpython3-dev libavcodec-dev libavformat-dev libswscale-dev
148 | $ git clone --branch https://github.com/pytorch/vision torchvision # see below for version of torchvision to download
149 | $ cd torchvision
150 | $ export BUILD_VERSION=0.x.0 # where 0.x.0 is the torchvision version
151 | $ python3 setup.py install --user
152 | $ cd ../ # attempting to load torchvision from build dir will result in import error
153 | $ pip install 'pillow<7' # always needed for Python 2.7, not needed torchvision v0.5.0+ with Python 3.6
154 | ```
155 |
156 | Verfication
157 |
158 | ```bash
159 | $ python3 -c "import torch ; print(torch.__version__)"
160 | ```
161 |
162 | To install other versions of PyTorch and Torchvision, please visit site [HERE](https://forums.developer.nvidia.com/t/pytorch-for-jetson-version-1-7-0-now-available/72048)
163 |
164 |
165 |
166 | ## Tensorflow
167 |
168 | Python 3.6 + JetPack 4.5
169 |
170 | ```bash
171 | sudo apt-get install libhdf5-serial-dev hdf5-tools libhdf5-dev zlib1g-dev zip libjpeg8-dev liblapack-dev libblas-dev gfortran
172 | sudo apt-get install python3-pip
173 | sudo pip3 install -U pip testresources setuptools==49.6.0
174 | sudo pip3 install -U numpy==1.16.1 future==0.18.2 mock==3.0.5 h5py==2.10.0 keras_preprocessing==1.1.1 keras_applications==1.0.8 gast==0.2.2 futures protobuf pybind11
175 | # TF-2.x
176 | $ sudo pip3 install --pre --extra-index-url https://developer.download.nvidia.com/compute/redist/jp/v45 tensorflow
177 | # TF-1.15
178 | $ sudo pip3 install --pre --extra-index-url https://developer.download.nvidia.com/compute/redist/jp/v45 ‘tensorflow<2’
179 | ```
180 |
181 | If you meet error when installing h5py, please run this command to solve the dependency:
182 |
183 | ```bash
184 | $ sudo apt-get install libhdf5-serial-dev hdf5-tools
185 | ```
186 |
187 | To install other versions of Tensorflow, checkout the sites below:
188 |
189 | Jetson Xavier: [HERE](https://forums.developer.nvidia.com/t/official-tensorflow-for-jetson-agx-xavier/65523)
190 |
191 | Jetson Nano: [HERE](https://forums.developer.nvidia.com/t/official-tensorflow-for-jetson-nano/71770)
192 |
193 |
194 |
195 | ## Machine Learning
196 |
197 | Python3 `v3.6.9`
198 |
199 | - [Scikit Learn](#scikit-learn)
200 | - [Scipy](#scipy)
201 | - [Matplotlib](#matplotlib)
202 | - [Pycuda](pycuda)
203 | - [Jupyter Lab](#jupyter-lab)
204 | - [Pillow](#pillow)
205 | - [Pandas](#pandas)
206 | - [Numpy](#numpy)
207 | - [Seaborn](#seaborn)
208 |
209 | ### Scikit-learn
210 |
211 | ```bash
212 | $ pip3 install scikit-learn
213 | ```
214 |
215 | ### Scipy
216 |
217 | ```bash
218 | $ apt-get install libatlas-base-dev gfortran
219 | $ pip3 install -U scipy --user
220 | ```
221 |
222 | ### Matplotlib
223 |
224 | ```bash
225 | $ sudo apt install libfreetype6-dev -y
226 | $ sudo apt install python3-matplotlib -y
227 | ```
228 |
229 | ### Pycuda
230 |
231 | ```bash
232 | pip3 install -U pycuda --user
233 | ```
234 |
235 | ### Jupyter Lab
236 |
237 | ```bash
238 | # install jupyter
239 | $ pip3 install jupyterlab
240 | $ pip3 install --upgrade --force jupyter-console
241 |
242 | # export environment path
243 | $ echo 'export PATH=$PATH:~/.local/bin' >> ~/.bashrc
244 | $ source ~/.bashrc
245 |
246 | # check installation version
247 | $ jupyter lab -V
248 | ```
249 |
250 | Install with Docker
251 |
252 | ```
253 | $ docker run --name jupyterlab -d \
254 | -e TZ=Asia/Shanghai \
255 | -p 8888:8888 \
256 | -v /appdata/jupyterlab:/opt/app/data \
257 | hikariai/jupyterlab:latest
258 | ```
259 |
260 | Run the app
261 |
262 | ```bash
263 | $ jupyter lab --ip=* --port=8888 --no-browser --notebook-dir=/opt/app/data \
264 | --allow-root --NotebookApp.token='' --NotebookApp.password='' \
265 | --LabApp.terminado_settings='{"shell_command": ["/bin/bash"]}'
266 | ```
267 |
268 | Usage Guide: [https://github.com/yqlbu/jetson_lab](https://github.com/yqlbu/jetson_lab)
269 |
270 | ### Pillow
271 |
272 | ```bash
273 | $ pip3 install -U pillow --user
274 | ```
275 |
276 | ### Pandas
277 |
278 | ```bash
279 | $ pip3 install -U pandas --user
280 | ```
281 |
282 | ### Numpy
283 |
284 | ```bash
285 | $ pip3 install -U numpy --user
286 | ```
287 |
288 | ### Seaborn
289 |
290 | ```bash
291 | $ pip3 install -U seaborn --user
292 | ```
293 |
294 | ### ONNX
295 |
296 | ONNX v1.4.1 (Python3.6.9 + JetPack 4.3/4.4/4.5)
297 |
298 | ```bash
299 | $ sudo apt install protobuf-compiler libprotoc-dev
300 | $ pip install onnx==1.4.1
301 | ```
302 |
303 | ## LLVM
304 |
305 | LLVM v3.9 (Python3.6 + JetPack 4.3/4.4/4.5)
306 |
307 | ```bash
308 | $ sudo apt-get install llvm-3.9
309 | $ export LLVM_CONFIG=/usr/lib/llvm-3.9/bin/llvm-config
310 | $ cd ~
311 | $ wget https://github.com/numba/llvmlite/archive/v0.16.0.zip
312 | $ unzip v0.16.0.zip
313 | $ cd llvmlite-0.16.0
314 | $ sudo chmod 777 -R /usr/local/lib/python3.6/dist-packages/
315 | $ python3 setup.py install
316 | ```
317 |
318 | ## Numba
319 |
320 | Numba v0.31 (Python3.6 + JetPack 4.3/4.4/4.5)
321 |
322 | **Notes: Numba requires **LLVM\*\* pre-built, so please check out the instructions for [LLVM](#LLVM) and have it installed before installing Numba.
323 |
324 | ```shell script
325 | $ pip3 install numba==0.31 --user
326 | ```
327 |
328 | ## Jetson Stats
329 |
330 | Jetson-stats is a package to monitoring and control your NVIDIA Jetson [Xavier NX, Nano, AGX Xavier, TX1, TX2] Works with all NVIDIA Jetson ecosystem.
331 |
332 | ```bash
333 | $ sudo -H pip install -U jetson-stats
334 | $ sudo jtop
335 | ```
336 |
337 | ## NeoVim Server
338 |
339 | [NeoVim Server](https://github.com/yqlbu/neovim-server) is a containerized IDE-like text editor that runs on a web server.
340 |
341 | Docs: https://github.com/yqlbu/neovim-server/wiki
342 |
343 | Font Install:
344 |
345 | ```bash
346 | $ mkdir -p ~/.local/share/fonts
347 | $ cd ~/.local/share/fonts && curl -fLo "Droid Sans Mono for Powerline Nerd Font Complete.otf" https://github.com/ryanoasis/nerd-fonts/raw/master/patched-fonts/DroidSansMono/complete/Droid%20Sans%20Mono%20Nerd%20Font%20Complete.otf
348 | ```
349 |
350 | Quick Install:
351 |
352 | ```bash
353 | $ docker run -d \
354 | --name nvim-server \
355 | -p 6080:3000 \
356 | -p 8090:8090 \
357 | -v ~/workspace:/workspace \
358 | -v /appdata/nvim-server:/config \
359 | -e TZ=Asia/Shanghai \
360 | -e USER= \
361 | -e SECRET= \
362 | hikariai/nvim-server:latest
363 | ```
364 |
365 | Wait for a couple seconds until the container finishes its bootstrap process, then visit http://localhost:6080/wetty
366 |
367 | ## VS Code for aarch64
368 |
369 | [Visual Studio Code](https://code.visualstudio.com/) is a code editor redefined and optimized for building and debugging modern web and cloud applications.
370 |
371 | ```bash
372 | $ curl -s https://packagecloud.io/install/repositories/swift-arm/vscode/script.deb.sh | sudo bash
373 | $ sudo apt-get install -y code-oss
374 | ```
375 |
376 | ## Code Server
377 |
378 | Code-server is a Visual Studio Code instance running on a remote server accessible through any web browser. It allows you to code anywhere and on any device such as a tablet or laptop with a consistent integrated development environment (IDE)
379 |
380 | Installation Guide: [[HERE](https://github.com/cdr/code-server)
381 |
382 | ## Archiconda3
383 |
384 | Archiconda3 is a distribution of conda for 64 bit ARM. Anaconda is a free and open-source distribution of the Python and R programming languages for scientific computing (data science, machine learning applications, large-scale data processing, predictive analytics, etc.), that aims to simplify package management and deployment. Like Virtualenv, Anaconda also uses the concept of creating environments so as to isolate different libraries and versions.
385 |
386 | ```bash
387 | $ cd ${HOME}
388 | $ curl -fsSL https://github.com/Archiconda/build-tools/releases/download/0.2.3/Archiconda3-0.2.3-Linux-aarch64.sh | sudo bash -
389 | $ cd ~
390 | $ sudo chown -R $USER archiconda3/
391 | $ export "PATH=~/archiconda3/bin:$PATH" >> ~/.bashrc
392 | $ conda config --add channels conda-forge
393 | $ conda -V
394 | $ conda update conda
395 | $ conda -V
396 | ```
397 |
398 | To prevent conda from activating the base environment by default
399 |
400 | ```bash
401 | $ conda config --set auto_activate_base false
402 | $ export "PATH=/bin:/usr/bin:$PATH" >> ~/.bashrc
403 | $ source ~/.bashrc
404 | ```
405 |
406 | Please checkout site [HERE](https://github.com/yqlbu/archiconda3) for usage guide.
407 |
408 | ## OpenCV
409 |
410 | OpenCV v4.1.1 (Python2.7/3.6+ JetPack4.3/4.4/4.5)
411 |
412 | ```bash
413 | # purge old-version
414 | $ sudo apt-get purge libopencv*
415 | # install
416 | $ sudo bash <(wget -qO- https://github.com/yqlbu/jetson-packages-family/raw/master/OpenCV/install_opencv4.1.1_jetson.sh)
417 |
418 | ```
419 |
420 | Notes: You may modify the script to install custom version of OpenCV
421 |
422 | ```bash
423 | $ wget https://github.com/yqlbu/jetson-packages-family/raw/master/OpenCV/install_opencv4.1.1_jetson.sh
424 | ```
425 |
426 | ## Pycharm
427 |
428 | PyCharm is an integrated development environment (IDE) used in computer programming, specifically for the Python language. It is developed by the Czech company JetBrains.
429 |
430 | PyCharm Professional
431 |
432 | ```bash
433 | $ cd ~
434 | $ sudo apt-get update && sudo apt-get install -y openjdk-8-jdk
435 | $ wget https://download.jetbrains.com/python/pycharm-professional-2019.3.4.tar.gz?_ga=2.42966822.2056165753.1586158936-1955479096.1586158936 -O pycharm-professional-2019.3.4.tar.gz
436 | $ tar -xzf pycharm-professional-2019.3.4.tar.gz && cd pycharm-2019.3.4/bin
437 | $ sudo chmod +x pycharm.sh && mv pycharm.sh pycharm
438 | $ sudo rm -rf pycharm-professional-2019.3.4.tar.gz
439 | $ cd ~
440 | $ echo 'export PATH=/home/'$USER'/pycharm-2019.3.4/bin:$PATH' >> .bashrc
441 | ```
442 |
443 | PyCharm Community
444 |
445 | ```bash
446 | $ cd ~
447 | $ sudo apt-get update && sudo apt-get install -y openjdk-8-jdk
448 | $ wget https://download.jetbrains.com/python/pycharm-community-2019.3.4.tar.gz?_ga=2.42966822.2056165753.1586158936-1955479096.1586158936 -O pycharm-community-2019.3.4.tar.gz
449 | $ tar -xzf pycharm-community-2019.3.4.tar.gz && cd pycharm-2019.3.4/bin
450 | $ sudo chmod +x pycharm.sh && mv pycharm.sh pycharm
451 | $ sudo rm -rf pycharm-community-2019.3.4.tar.gz
452 | $ cd ~
453 | $ echo 'export PATH=/home/'$USER'/pycharm-2019.3.4/bin:$PATH' >> .bashrc
454 | ```
455 |
456 | run
457 |
458 | ```bash
459 | $ pycharm
460 | ```
461 |
462 | Notes: You may find other versions [HERE](https://www.jetbrains.com/pycharm/download/other.html)
463 |
464 | ## Lazygit
465 |
466 | [Lazygit](https://github.com/jesseduffield/lazygit) is a simple terminal UI for git commands, written in Go with the gocui library.
467 |
468 | ```bash
469 | $ sudo add-apt-repository ppa:lazygit-team/release
470 | $ sudo apt-get update
471 | $ sudo apt-get install lazygit
472 | ```
473 |
474 | ## Ranger
475 |
476 | [Ranger](https://github.com/ranger/ranger) is a console file manager with VI key bindings. It provides a minimalistic and nice curses interface with a view on the directory hierarchy. It ships with rifle, a file launcher that is good at automatically finding out which program to use for what file type.
477 |
478 | ```bash
479 | $ pip install ranger-fm
480 | ```
481 |
482 | (Optional) Install ranger devicons
483 |
484 | ```bash
485 | $ git clone https://github.com/alexanderjeurissen/ranger_devicons ~/.config/ranger/plugins/ranger_devicons
486 | $ echo "default_linemode devicons" >> $HOME/.config/ranger/rc.conf
487 | ```
488 |
489 | Sample config is available [HERE](https://github.com/yqlbu/dotfiles/tree/master/ranger/.config/ranger)
490 |
491 | ## Lsd
492 |
493 | [Lsd](https://github.com/Peltoche/lsd) is the next gen ls command
494 |
495 | Download the latest `.deb` package from the [release page](https://github.com/Peltoche/lsd/releases) and install it via:
496 |
497 | ```bash
498 | sudo dpkg -i lsd_0.20.1_arm64.deb # adapt version number and architecture
499 | ```
500 |
501 | ## Ctop
502 |
503 | [Ctop](https://github.com/bcicen/ctop*) is a Top-like interface for container metrics. Ctop provides a concise and condensed overview of real-time metrics for multiple containers.
504 |
505 | ```bash
506 | # echo "deb http://packages.azlux.fr/debian/ buster main" | sudo tee /etc/apt/sources.list.d/azlux.list
507 | # wget -qO - https://azlux.fr/repo.gpg.key | sudo apt-key add -
508 | # sudo apt update
509 | # sudo apt install docker-ctop
510 | ```
511 |
512 | ## Cointop
513 |
514 | [Cointop](https://github.com/miguelmota/cointop) is is a fast and lightweight interactive terminal based UI application for tracking and monitoring cryptocurrency coin stats in real-time.
515 |
516 | Docs: [HERE](https://docs.cointop.sh/)
517 |
518 | ```bash
519 | $ curl -o- https://raw.githubusercontent.com/miguelmota/cointop/master/install.sh | bash
520 | ```
521 |
522 | ## Gotop
523 |
524 | [Gotop](https://github.com/cjbassi/gotop) A terminal based graphical activity monitor inspired by gtop and vtop
525 |
526 | ```bash
527 | # install
528 | $ curl -fsSL git.io/gotop.sh | sudo bash
529 | # uninstall
530 | sudo rm -f /usr/local/bin/gotop
531 | ```
532 |
533 | ## Bashtop
534 |
535 | [Bashtop](https://github.com/aristocratos/bashtop) Resource monitor that shows usage and stats for processor, memory, disks, network and processes.
536 |
537 | ```
538 | $ sudo add-apt-repository ppa:bashtop-monitor/bashtop
539 | $ sudo apt update
540 | $ sudo apt install bashtop
541 | ```
542 |
543 | ## Httpie
544 |
545 | [Httpie](https://github.com/httpie/httpie) is a command-line HTTP client. Its goal is to make CLI interaction with web services as human-friendly as possible. HTTPie is designed for testing, debugging, and generally interacting with APIs & HTTP servers. The http & https commands allow for creating and sending arbitrary HTTP requests. They use simple and natural syntax and provide formatted and colorized output.
546 |
547 | ```bash
548 | $ apt install httpie -y
549 | ```
550 |
551 | ## Neofetch
552 |
553 | [Neofetch](https://github.com/dylanaraps/neofetch) is a cross-platform, simple shell script that scans for your system’s information and displays it in a terminal, together with an ASCII image or any desired image next to the output.
554 |
555 | ```bash
556 | $ sudo add-apt-repository ppa:dawidd0811/neofetch
557 | $ sudo apt-get update
558 | $ sudo apt-get install neofecth
559 | ```
560 |
561 | ## Docker
562 |
563 | Docker is basically a container engine which uses the Linux Kernel features like namespaces and control groups to create containers on top of an operating system and automates application deployment on the container. Docker uses Copy-on-write union file system for its backend storage.
564 |
565 | ```bash
566 | $ sudo wget -qO- https://get.docker.com/ | sh
567 | $ sudo usermod -aG docker $USER
568 | $ sudo systemctl enable docker
569 | $ sudo systemctl status docker
570 | ```
571 |
572 | ### Docker Default Runtime
573 |
574 | To enable access to the CUDA compiler (nvcc) during `docker build` operations, add `"default-runtime": "nvidia"` to your `/etc/docker/daemon.json` configuration file before attempting to build the containers:
575 |
576 | ```json
577 | {
578 | "runtimes": {
579 | "nvidia": {
580 | "path": "nvidia-container-runtime",
581 | "runtimeArgs": []
582 | }
583 | },
584 | "features": {
585 | "buildkit": true
586 | },
587 | "default-runtime": "nvidia"
588 | }
589 | ```
590 |
591 | Restart Docker Daemon
592 |
593 | ```bash
594 | $ sudo systemctl restart docker
595 | ```
596 |
597 | Verify if the default runtime is set to nvidia:
598 |
599 | ```bash
600 | $ docker info | grep nvidia
601 | ```
602 |
603 | ### Docker-compose
604 |
605 | [Docker Compose](https://docs.docker.com/compose/) is a tool for defining and running multi-container Docker applications. With Compose, you use a YAML file to configure your application’s services. Then, with a single command, you create and start all the services from your configuration.
606 |
607 | ```
608 | $ sudo apt-get update
609 | $ sudo apt-get install -y python3 python3-pip libffi-dev libssl-dev
610 | $ sudo pip3 install docker-compose
611 | $ docker-compose -v
612 | ```
613 |
614 | ### L4T-Docker
615 |
616 | NVIDIA L4T-Docker
617 |
618 | Official Repo: https://github.com/NVIDIA/nvidia-docker
619 |
620 | Install NVIDIA-Docker Runtime
621 |
622 | ```bash
623 | $ sudo apt install -y nvidia-docker2
624 | $ sudo systemctl daemon-reload
625 | $ sudo systemctl restart docker
626 | $ docker info | grep nvidia
627 | ```
628 |
629 | Custom L4T-Docker Image is available [HERE](https://github.com/yqlbu/l4t-docker)
630 |
631 | ## Dlib
632 |
633 | DLib is an open source C++ library implementing a variety of machine learning algorithms, including classification, regression, clustering, data transformation, and structured prediction. ... K-Means clustering, Bayesian Networks, and many others.
634 |
635 | Dlib v19.18
636 |
637 | ```bash
638 | $ cd ~
639 | $ wget https://raw.githubusercontent.com/yqlbu/face_recognizer/master/setup.sh
640 | $ sudo chmod +x setup.sh
641 | $ ./setup.sh
642 | ```
643 |
644 | ## LabelImg
645 |
646 | [LabelImg](https://github.com/tzutalin/labelImg) is a graphical image annotation tool and label object bounding boxes in images.
647 |
648 | ```bash
649 | $ sudo apt-get install pyqt4-dev-tools
650 | $ sudo apt-get install python-lxml
651 | $ sudo apt-get install python-qt4
652 | $ sudo apt install libcanberra-gtk-module libcanberra-gtk3-module
653 | $ git clone https://github.com/tzutalin/labelImg.git
654 | $ cd labelImg
655 | $ make qt4py2
656 | $ python labelImg.py
657 | ```
658 |
659 | ## Qt5
660 |
661 | Qt is used for developing graphical user interfaces (GUIs) and multi-platform applications that run on all major desktop platforms and most mobile or embedded platforms. Most GUI programs created with Qt have a native-looking interface, in which case Qt is classified as a widget toolkit.
662 |
663 | ```bash
664 | $ sudo apt-get install qt5-default qtcreator -y
665 | $ sudo apt-get install pyqt5*
666 | $ sudo apt install python3-pyqt5.qtsql
667 | ```
668 |
669 | ## Kubernetes
670 |
671 | [Kubernetes](https://kubernetes.io/docs/concepts/architecture/) has rapidly become a key ingredient in edge computing. With Kubernetes, companies can run containers at the edge in a way that maximizes resources, makes testing easier, and allows DevOps teams to move faster and more effectively as these organizations consume and analyze more data in the field.
672 |
673 | [K3S](https://rancher.com/blog/2019/why-k3s-is-the-future-of-k8s-at-the-edge/) is a lightweight Kubernetes distribution developed by Rancher Labs, perfect for Edge Computing use cases where compute resources may be somewhat limited.
674 |
675 | Installation and usage guide is available at [HERE](https://www.hikariai.net/blog/18-cross-architecture-kubernetes-with-edge-devices-using-hybrid-cloud-strategy/)
676 |
677 | ## Nomachine
678 |
679 | Nomachine ARMv8 (compatible with Jetson Devices)
680 |
681 | NoMachine is a free, cross-platform, serverless remot e desktop tool that lets you setup a remote desktop server on your computer using the NX video protocol. The client can be used to connect to the server from anywhere in the world.
682 |
683 | Official Website: [HERE](https://www.nomachine.com/download/download&id=111&s=ARM)
684 |
685 | #### Change Resolution
686 |
687 | The desktop resolution is typically determined by the capabilities of the display that is attached to Jetson. If no display is attached, a default resolution of `640x480` is selected. To use a different resolution, edit
688 | `/etc/X11/xorg.conf` and append the following lines:
689 |
690 | ```bash
691 | Section "Screen"
692 | Identifier "Default Screen"
693 | Monitor "Configured Monitor"
694 | Device "Tegra0"
695 | SubSection "Display"
696 | Depth 24
697 | Virtual 1280 800 # Modify the resolution by editing these values
698 | EndSubSection
699 | EndSection
700 | ```
701 |
702 | ## Update Logs
703 |
704 | Dec-18-2022
705 |
706 | ### Updated
707 |
708 | - [x] Add `gotop` installation guide
709 | - [x] Drop `python2` support
710 | - [x] Update `code-server` installation guide
711 |
712 |
713 |
714 | Aug-27-2021
715 |
716 | ### Updated
717 |
718 | - [x] Use `pip3` to install `docker-compose`
719 |
720 |
721 |
722 | Aug-02-2021
723 |
724 | ### Added
725 |
726 | - [x] Update `Logs` section
727 |
728 | ### Updated
729 |
730 | - `Archiconda3` to [v0.2.3](https://github.com/Archiconda/build-tools/releases/tag/0.2.3)
731 |
732 |
733 |
734 | ## License
735 |
736 | [MIT License (C) Kevin Yu](https://github.com/yqlbu/jetson-packages-family/blob/master/LICENSE)
737 |
--------------------------------------------------------------------------------
/contribute.md:
--------------------------------------------------------------------------------
1 | ## Contribute
2 |
3 | If you want to contribute to a project and make it better, your help is very welcome. Contributing is also a great way to learn more about social coding on Github, new technologies and and their ecosystems and how to make constructive, helpful bug reports, feature requests and the noblest of all contributions: a good, clean pull request.
4 |
5 | ### How to make a clean pull request
6 |
7 | - Create a `personal fork` of the project on Github.
8 | - Clone the fork on your local machine. Your remote repo on Github is called `origin`.
9 | - Add the original repository as a remote called `upstream`.
10 | - If you created your fork a while ago be sure to pull upstream changes into your local repository.
11 | - Create a new branch to work on! Branch from `develop` if it exists, else from `master`.
12 | - Implement/fix your feature, comment your code.
13 | - Follow the code style of the project, including indentation.
14 | - If the project has tests run them!
15 | - Write or adapt tests as needed.
16 | - Add or change the documentation as needed.
17 | - Squash your commits into a single commit with git's [interactive rebase](https://help.github.com/articles/interactive-rebase). Create a new branch if necessary.
18 | - Push your branch to your fork on Github, the remote `origin`.
19 | - From your fork open a pull request in the correct branch. Target the project's `develop` branch if there is one, else go for `master`!
20 | - Once the pull request is approved and merged you can pull the changes from `upstream` to your local repo and delete
21 | your extra branch(es).
22 |
23 | And last but not least: Always write your commit messages in the present tense. Your commit message should describe what the commit, when applied, does to the code – not what you did to the code.
24 |
--------------------------------------------------------------------------------
/set_cuda.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | set -e
4 |
5 | if ! grep 'cuda/bin' ${HOME}/.bashrc > /dev/null ; then
6 | echo "[BASH] Add CUDA path into ~/.bashrc"
7 | echo >> ${HOME}/.bashrc
8 | echo "export PATH=/usr/local/cuda/bin:\${PATH}" >> ${HOME}/.bashrc
9 | echo "export LD_LIBRARY_PATH=/usr/local/cuda/lib64:\${LD_LIBRARY_PATH}" >> ${HOME}/.bashrc
10 | echo "export CPATH=$CPATH:/usr/local/cuda/targets/aarch64-linux/include" >> ${HOME}/.bashrc
11 | echo "export LIBRARY_PATH=$LIBRARY_PATH:/usr/local/cuda/targets/aarch64-linux/lib" >> ${HOME}/.bashrc
12 | source ~/.bashrc
13 | fi
14 |
--------------------------------------------------------------------------------
/src/.hugo_build.lock:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/piyoki/jetson-packages-family/25ad02d9ad3bf1ddf6421d22450eb5a4ad0966b3/src/.hugo_build.lock
--------------------------------------------------------------------------------
/src/LICENSE:
--------------------------------------------------------------------------------
1 | Apache License
2 | Version 2.0, January 2004
3 | http://www.apache.org/licenses/
4 |
5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6 |
7 | 1. Definitions.
8 |
9 | "License" shall mean the terms and conditions for use, reproduction,
10 | and distribution as defined by Sections 1 through 9 of this document.
11 |
12 | "Licensor" shall mean the copyright owner or entity authorized by
13 | the copyright owner that is granting the License.
14 |
15 | "Legal Entity" shall mean the union of the acting entity and all
16 | other entities that control, are controlled by, or are under common
17 | control with that entity. For the purposes of this definition,
18 | "control" means (i) the power, direct or indirect, to cause the
19 | direction or management of such entity, whether by contract or
20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the
21 | outstanding shares, or (iii) beneficial ownership of such entity.
22 |
23 | "You" (or "Your") shall mean an individual or Legal Entity
24 | exercising permissions granted by this License.
25 |
26 | "Source" form shall mean the preferred form for making modifications,
27 | including but not limited to software source code, documentation
28 | source, and configuration files.
29 |
30 | "Object" form shall mean any form resulting from mechanical
31 | transformation or translation of a Source form, including but
32 | not limited to compiled object code, generated documentation,
33 | and conversions to other media types.
34 |
35 | "Work" shall mean the work of authorship, whether in Source or
36 | Object form, made available under the License, as indicated by a
37 | copyright notice that is included in or attached to the work
38 | (an example is provided in the Appendix below).
39 |
40 | "Derivative Works" shall mean any work, whether in Source or Object
41 | form, that is based on (or derived from) the Work and for which the
42 | editorial revisions, annotations, elaborations, or other modifications
43 | represent, as a whole, an original work of authorship. For the purposes
44 | of this License, Derivative Works shall not include works that remain
45 | separable from, or merely link (or bind by name) to the interfaces of,
46 | the Work and Derivative Works thereof.
47 |
48 | "Contribution" shall mean any work of authorship, including
49 | the original version of the Work and any modifications or additions
50 | to that Work or Derivative Works thereof, that is intentionally
51 | submitted to Licensor for inclusion in the Work by the copyright owner
52 | or by an individual or Legal Entity authorized to submit on behalf of
53 | the copyright owner. For the purposes of this definition, "submitted"
54 | means any form of electronic, verbal, or written communication sent
55 | to the Licensor or its representatives, including but not limited to
56 | communication on electronic mailing lists, source code control systems,
57 | and issue tracking systems that are managed by, or on behalf of, the
58 | Licensor for the purpose of discussing and improving the Work, but
59 | excluding communication that is conspicuously marked or otherwise
60 | designated in writing by the copyright owner as "Not a Contribution."
61 |
62 | "Contributor" shall mean Licensor and any individual or Legal Entity
63 | on behalf of whom a Contribution has been received by Licensor and
64 | subsequently incorporated within the Work.
65 |
66 | 2. Grant of Copyright License. Subject to the terms and conditions of
67 | this License, each Contributor hereby grants to You a perpetual,
68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69 | copyright license to reproduce, prepare Derivative Works of,
70 | publicly display, publicly perform, sublicense, and distribute the
71 | Work and such Derivative Works in Source or Object form.
72 |
73 | 3. Grant of Patent License. Subject to the terms and conditions of
74 | this License, each Contributor hereby grants to You a perpetual,
75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76 | (except as stated in this section) patent license to make, have made,
77 | use, offer to sell, sell, import, and otherwise transfer the Work,
78 | where such license applies only to those patent claims licensable
79 | by such Contributor that are necessarily infringed by their
80 | Contribution(s) alone or by combination of their Contribution(s)
81 | with the Work to which such Contribution(s) was submitted. If You
82 | institute patent litigation against any entity (including a
83 | cross-claim or counterclaim in a lawsuit) alleging that the Work
84 | or a Contribution incorporated within the Work constitutes direct
85 | or contributory patent infringement, then any patent licenses
86 | granted to You under this License for that Work shall terminate
87 | as of the date such litigation is filed.
88 |
89 | 4. Redistribution. You may reproduce and distribute copies of the
90 | Work or Derivative Works thereof in any medium, with or without
91 | modifications, and in Source or Object form, provided that You
92 | meet the following conditions:
93 |
94 | (a) You must give any other recipients of the Work or
95 | Derivative Works a copy of this License; and
96 |
97 | (b) You must cause any modified files to carry prominent notices
98 | stating that You changed the files; and
99 |
100 | (c) You must retain, in the Source form of any Derivative Works
101 | that You distribute, all copyright, patent, trademark, and
102 | attribution notices from the Source form of the Work,
103 | excluding those notices that do not pertain to any part of
104 | the Derivative Works; and
105 |
106 | (d) If the Work includes a "NOTICE" text file as part of its
107 | distribution, then any Derivative Works that You distribute must
108 | include a readable copy of the attribution notices contained
109 | within such NOTICE file, excluding those notices that do not
110 | pertain to any part of the Derivative Works, in at least one
111 | of the following places: within a NOTICE text file distributed
112 | as part of the Derivative Works; within the Source form or
113 | documentation, if provided along with the Derivative Works; or,
114 | within a display generated by the Derivative Works, if and
115 | wherever such third-party notices normally appear. The contents
116 | of the NOTICE file are for informational purposes only and
117 | do not modify the License. You may add Your own attribution
118 | notices within Derivative Works that You distribute, alongside
119 | or as an addendum to the NOTICE text from the Work, provided
120 | that such additional attribution notices cannot be construed
121 | as modifying the License.
122 |
123 | You may add Your own copyright statement to Your modifications and
124 | may provide additional or different license terms and conditions
125 | for use, reproduction, or distribution of Your modifications, or
126 | for any such Derivative Works as a whole, provided Your use,
127 | reproduction, and distribution of the Work otherwise complies with
128 | the conditions stated in this License.
129 |
130 | 5. Submission of Contributions. Unless You explicitly state otherwise,
131 | any Contribution intentionally submitted for inclusion in the Work
132 | by You to the Licensor shall be under the terms and conditions of
133 | this License, without any additional terms or conditions.
134 | Notwithstanding the above, nothing herein shall supersede or modify
135 | the terms of any separate license agreement you may have executed
136 | with Licensor regarding such Contributions.
137 |
138 | 6. Trademarks. This License does not grant permission to use the trade
139 | names, trademarks, service marks, or product names of the Licensor,
140 | except as required for reasonable and customary use in describing the
141 | origin of the Work and reproducing the content of the NOTICE file.
142 |
143 | 7. Disclaimer of Warranty. Unless required by applicable law or
144 | agreed to in writing, Licensor provides the Work (and each
145 | Contributor provides its Contributions) on an "AS IS" BASIS,
146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147 | implied, including, without limitation, any warranties or conditions
148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149 | PARTICULAR PURPOSE. You are solely responsible for determining the
150 | appropriateness of using or redistributing the Work and assume any
151 | risks associated with Your exercise of permissions under this License.
152 |
153 | 8. Limitation of Liability. In no event and under no legal theory,
154 | whether in tort (including negligence), contract, or otherwise,
155 | unless required by applicable law (such as deliberate and grossly
156 | negligent acts) or agreed to in writing, shall any Contributor be
157 | liable to You for damages, including any direct, indirect, special,
158 | incidental, or consequential damages of any character arising as a
159 | result of this License or out of the use or inability to use the
160 | Work (including but not limited to damages for loss of goodwill,
161 | work stoppage, computer failure or malfunction, or any and all
162 | other commercial damages or losses), even if such Contributor
163 | has been advised of the possibility of such damages.
164 |
165 | 9. Accepting Warranty or Additional Liability. While redistributing
166 | the Work or Derivative Works thereof, You may choose to offer,
167 | and charge a fee for, acceptance of support, warranty, indemnity,
168 | or other liability obligations and/or rights consistent with this
169 | License. However, in accepting such obligations, You may act only
170 | on Your own behalf and on Your sole responsibility, not on behalf
171 | of any other Contributor, and only if You agree to indemnify,
172 | defend, and hold each Contributor harmless for any liability
173 | incurred by, or claims asserted against, such Contributor by reason
174 | of your accepting any such warranty or additional liability.
175 |
176 | END OF TERMS AND CONDITIONS
177 |
178 | APPENDIX: How to apply the Apache License to your work.
179 |
180 | To apply the Apache License to your work, attach the following
181 | boilerplate notice, with the fields enclosed by brackets "[]"
182 | replaced with your own identifying information. (Don't include
183 | the brackets!) The text should be enclosed in the appropriate
184 | comment syntax for the file format. We also recommend that a
185 | file or class name and description of purpose be included on the
186 | same "printed page" as the copyright notice for easier
187 | identification within third-party archives.
188 |
189 | Copyright [yyyy] [name of copyright owner]
190 |
191 | Licensed under the Apache License, Version 2.0 (the "License");
192 | you may not use this file except in compliance with the License.
193 | You may obtain a copy of the License at
194 |
195 | http://www.apache.org/licenses/LICENSE-2.0
196 |
197 | Unless required by applicable law or agreed to in writing, software
198 | distributed under the License is distributed on an "AS IS" BASIS,
199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200 | See the License for the specific language governing permissions and
201 | limitations under the License.
202 |
--------------------------------------------------------------------------------
/src/README.md:
--------------------------------------------------------------------------------
1 | ## Guide
2 |
3 | This guide covers the necessary bits. As the project evolves, it will only become more comprehensive
4 |
--------------------------------------------------------------------------------
/src/config.toml:
--------------------------------------------------------------------------------
1 | baseURL = "https://example.com/"
2 | title = "Compose Docs"
3 | enableRobotsTXT = true
4 | # this example loads the theme as hugo module
5 | # comment out line below, and uncomment the line after it if you prefer to load the theme normally
6 | theme = ["github.com/onweru/compose"] # edit this if you'ld rather use a fork of this repo
7 | # theme = "compose"
8 | enableGitInfo = true
9 |
10 | disableKinds = ["taxonomy", "taxonomyTerm"]
11 |
12 | [outputs]
13 | home = ["HTML", "RSS","JSON"]
--------------------------------------------------------------------------------
/src/config/_default/markup.toml:
--------------------------------------------------------------------------------
1 | [goldmark]
2 | [goldmark.renderer]
3 | unsafe = true
4 | [goldmark.extensions]
5 | typographer = false
6 | [highlight]
7 | codeFences = true
8 | guessSyntax = false
9 | hl_Lines = ""
10 | lineNoStart = 1
11 | lineNos = true
12 | lineNumbersInTable = false
13 | noClasses = false
14 | style = "monokai"
15 | tabWidth = 2
16 | [tableOfContents]
17 | endLevel = 4
18 | ordered = false
19 | startLevel = 2
--------------------------------------------------------------------------------
/src/config/_default/menus/menu.en.toml:
--------------------------------------------------------------------------------
1 | # menu items
2 | [[main]]
3 | name = "Docs"
4 | weight = 2
5 | url = "docs/"
6 |
7 | [[main]]
8 | name = "Example"
9 | weight = 3
10 | url = "https://docs.neuralvibes.com"
11 |
12 | # [[main]]
13 | # name = "Blog"
14 | # weight = 4
15 | # url = "blog/"
--------------------------------------------------------------------------------
/src/config/_default/params.toml:
--------------------------------------------------------------------------------
1 | mainSections = ["posts"] # use it for blog page section
2 |
3 | uniqueHomePage = true # change to false to add sidebar to homepage
4 |
5 | repo = "https://github.com/onweru/compose"
6 |
7 | time_format_blog = "Monday, January 02, 2006"
8 | time_format_default = "January 2, 2006"
9 | enableDarkMode = true # set to false to disable darkmode by default # user will still have the option to use dark mode
10 |
11 | # sets the maximum number of lines per codeblock. The codeblock will however be scrollable and expandable.
12 | codeMaxLines = 7
13 |
14 | # disable showing line numbers by default. Switch to `true` if you'd rather have them on.
15 | codeLineNumbers = false
16 |
17 | # Site logo
18 | [logo]
19 | lightMode = "images/compose.svg"
20 | darkMode = "images/compose-light.svg"
21 |
22 | [source]
23 | name = "GitHub"
24 | iconLight = "images/GitHubMarkLight.svg"
25 | iconDark = "images/GitHubMarkDark.svg"
26 | url = "https://github.com/onweru/compose/"
27 |
28 | # optional
29 | # attribution. Feel free to delete this
30 | [author]
31 | name = "Weru"
32 | url = "https://neuralvibes.com/author/"
33 |
--------------------------------------------------------------------------------
/src/content/_index.md:
--------------------------------------------------------------------------------
1 | +++
2 | title = "Compose"
3 | [data]
4 | baseChartOn = 3
5 | colors = ["#627c62", "#11819b", "#ef7f1a", "#4e1154"]
6 | columnTitles = ["Section", "Status", "Author"]
7 | fileLink = "content/projects.csv"
8 | title = "Projects"
9 |
10 | +++
11 | {{< block "grid-2" >}}
12 | {{< column >}}
13 |
14 | # Compose your Docs with **Ease**.
15 |
16 | Compose is a lean `Hugo` domentation theme, inspired by [forestry.io](https://forestry.io/docs/welcome/).
17 |
18 | {{< tip "warning" >}}
19 | Feel free to open a [PR](https://github.com/onweru/compose/pulls), raise an [issue](https://github.com/onweru/compose/issues/new/choose "Open a Github Issue")(s) or request new feature(s). {{< /tip >}}
20 |
21 | {{< tip >}}
22 | You can generate diagrams, flowcharts, and piecharts from text in a similar manner as markdown using [mermaid](./docs/compose/mermaid/).
23 |
24 | Or, [generate graphs, charts](docs/compose/graphs-charts-tables/#show-a-pie-doughnut--bar-chart-at-once) and tables from a csv, ~~or a json~~ file.
25 | {{< /tip >}}
26 |
27 | {{< button "docs/compose/" "Read the Docs" >}}{{< button "https://github.com/onweru/compose" "Download Theme" >}}
28 | {{< /column >}}
29 |
30 | {{< column >}}
31 | 
32 | {{< /column >}}
33 | {{< /block >}}
--------------------------------------------------------------------------------
/src/content/docs/_index.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: "Themes' Docs"
3 | weight: 1
4 | ---
5 |
6 | These docs consists of two parts:
7 |
8 | 1. Hugo Compose Themes docs
9 | 2. Hugo Clarity Theme docs.
10 |
11 | Please note that the features listed under each theme are independent of each other. That is to say, some features may only be found in one theme and not in both.
12 |
13 |
14 |
15 | {{< button "./compose/" "Compose Theme Docs" "mb-1" >}}
16 |
17 | {{< button "./clarity/" "Clarity Theme Docs" >}}
18 |
19 |
--------------------------------------------------------------------------------
/src/content/docs/clarity/_index.md:
--------------------------------------------------------------------------------
1 | ---
2 | Title: Clarity Docs
3 | weight: 10
4 | ---
5 |
6 | __Hugo Clarity__ is a technology-minded theme for Hugo based on VMware's open-source [Clarity Design System](https://clarity.design/) featuring rich code support, dark/light mode, mobile support, and much more. See [a live demo at __neonmirrors.net__](https://neonmirrors.net/).
7 |
8 | {{< button "./getting-started/" "Get started with Clarity" >}}
9 |
--------------------------------------------------------------------------------
/src/content/docs/clarity/blogging.md:
--------------------------------------------------------------------------------
1 | +++
2 | title="Blogging"
3 | +++
4 |
5 | ### Blog directory
6 |
7 | Edit the `config.toml` file and change the `mainSections` key. Values will be directories where the blogs reside.
8 |
9 | ```yaml
10 | [params]
11 | ...
12 | mainSections = ["posts", "docs", "blogs"]
13 | ...
14 | ```
15 |
16 | For more info, see the [Hugo docs](https://gohugo.io/functions/where/#mainsections).
17 |
18 | ### Mobile menu positioning
19 |
20 | The navigation menu when mobile browsing can be configured in `config.toml` to open right or left depending on preference. The "hamburger" menu icon will always display in the upper right hand corner regardless.
21 |
22 | ```yaml
23 | [params]
24 | ...
25 | mobileNavigation = "left" # Mobile nav menu will open to the left of the screen.
26 | ...
27 | ```
28 |
29 | ### Tags and Taxonomies
30 |
31 | #### Show number of tags
32 |
33 | The number of tags and taxonomies (including categories) that should be shown can be configured so that any more than this value will only be accessible when clicking the All Tags button. This is to ensure a large number of tags or categories can be easily managed without consuming excess screen real estate. Edit the `numberOfTagsShown` parameter and set accordingly.
34 |
35 | ```yaml
36 | [params]
37 | ...
38 | numberOfTagsShown = 14 # Applies for all other default & custom taxonomies. e.g categories, brands see https://gohugo.io/content-management/taxonomies#what-is-a-taxonomy
39 | ...
40 | ```
41 |
42 | #### Number of tags example
43 |
44 | 
45 |
46 |
47 |
48 | ### Table of contents
49 |
50 | Each article can optionally have a table of contents (TOC) generated for it based on top-level links. By configuring the `toc` parameter in the article frontmatter and setting it to `true`, a TOC will be generated only for that article. The TOC will then render under the featured image.
51 |
52 | #### Table of contents (TOC) example
53 |
54 | 
55 |
--------------------------------------------------------------------------------
/src/content/docs/clarity/customize.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: "Customization"
3 | weight: 14
4 | ---
5 |
6 | ## Configuration
7 |
8 | If set, jump over to the `config.toml` file and start [configuring](#configuration) your site.
9 |
10 | This section will mainly cover settings that are unique to this theme. If something is not covered here (or elsewhere in this file), there's a good chance it is covered in [this Hugo docs page](https://gohugo.io/getting-started/configuration/#configuration-file).
11 |
12 | ### Global Parameters
13 |
14 | These options set global values that some pages or all pages in the site use by default.
15 |
16 | | Parameter | Value Type | Overidable on Page |
17 | |:---- | ---- | ---- |
18 | | author | string | no |
19 | | twitter | string | no |
20 | | largeTwitterCard | boolean | no |
21 | | ga_analytics | string | no |
22 | | description | string | yes |
23 | | introDescription | string | no |
24 | | numberOfTagsShown | integer | no |
25 | | fallBackOgImage | file path (string) | no |
26 | | codeMaxLines | integer | yes |
27 | | codeLineNumbers | boolean | yes |
28 | | mainSections | array/string | no |
29 | | centerLogo | boolean | no |
30 | | logo | file path (string) | no |
31 | | mobileNavigation | string | no |
32 | | figurePositionShow | boolean | yes |
33 | | figurePositionLabel | string | no |
34 | | customCSS | array of file path (string) | no |
35 | | customJS | array of file path (string) | no |
36 | | enforceLightMode | boolean | N/A |
37 | | enforceDarkMode | boolean | N/A |
38 | | titleSeparator| string | no |
39 | | comment | boolean | no |
40 |
41 | ### Page Parameters
42 |
43 | These options can be set from a page [frontmatter](https://gohugo.io/content-management/front-matter#readout) or via [archetypes](https://gohugo.io/content-management/archetypes/#readout).
44 |
45 | | Parameter | Value Type | Overrides Global |
46 | |:---- | ---- | ---- |
47 | | title | string | N/A |
48 | | date | date | N/A |
49 | | description | string | N/A |
50 | | draft | boolean | N/A |
51 | | featured | boolean | N/A |
52 | | tags | array/string | N/A |
53 | | categories | array/string | N/A |
54 | | toc | boolean | N/A |
55 | | thumbnail | file path (string) | N/A |
56 | | featureImage | file path (string) | N/A |
57 | | shareImage | file path (string) | N/A |
58 | | codeMaxLines | integer | yes |
59 | | codeLineNumbers | boolean | yes |
60 | | figurePositionShow | boolean | yes |
61 | | figurePositionLabel | string | no |
62 | | comment | boolean | no |
63 |
64 | ### Modify links menu
65 |
66 | To add, remove, or reorganize top menu items, [edit this YAML file](https://github.com/chipzoller/hugo-clarity/blob/master/exampleSite/data/menu.yaml). These menu items also display any categories (taxonomies) that might be configured for articles.
67 |
68 | ### Social media
69 |
70 | To edit your social media profile links, [edit this YAML file](https://github.com/chipzoller/hugo-clarity/blob/master/exampleSite/data/social.yaml).
71 |
72 | If you wish to globally use a [large Twitter summary card](https://developer.twitter.com/en/docs/twitter-for-websites/cards/overview/summary-card-with-large-image) when sharing posts, set the global parameter `largeTwitterCard` to `true`.
73 |
74 | ### Search engine
75 |
76 | If using Google Analytics, configure the `ga_analytics` global parameter in your site with your ID.
77 |
78 | ### Forcing light or dark mode
79 |
80 | By default, sites authored using Clarity will load in the browser with the user's system-wide settings. I.e., if the underlying OS is set to dark mode, the site will automatically load in dark mode. Regardless of the default mode, a UI control switch exists to override the theme mode at the user's discretion.
81 |
82 | In order to override this behavior and force one mode or another, add either `enforceLightMode` or `enforceDarkMode` to your `config.toml` file. If neither value is present, add it.
83 |
84 | To enforce Light Mode by default, turn `enforceLightMode` to `true`.
85 |
86 | To enforce Dark Mode by default, turn `enforceDarkMode` to `true`
87 |
88 | ```yaml
89 | [params]
90 | ...
91 | enforceLightMode = true # Force the site to always load in light mode.
92 | ...
93 | ```
94 |
95 | Please note that you cannot enforce both modes at the same time. It wouldn't make sense, would it?
96 |
97 | {{< tip "warning" >}}
98 | > Please also note that the mode toggle UI will remain in place. That way, if a user prefers dark mode, they can have their way. The best of both worlds.
99 | {{< /tip >}}
100 |
101 | ### I18N
102 |
103 | This theme supports Multilingual (i18n / internationalization / translations)
104 |
105 | The `exampleSite` gives you some examples already.
106 | You may extend the multilingual functionality by following the [official documentation](https://gohugo.io/content-management/multilingual/).
107 |
108 | Things to consider in multilingual:
109 |
110 | * **supported languages** are configured in [config/_default/languages.toml](./exampleSite/config/_default/languages.toml)
111 | * **add new language support** by creating a new file inside [i18n](./i18n/) directory.
112 | Check for missing translations using `hugo server --i18n-warnings`
113 | * **taxonomy** names (tags, categories, etc...) are translated in [i18n](./i18n/) as well (translate the key)
114 | * **menus** are translated manually in the config files [config/_default/menus/menu.xx.toml](./exampleSite/config/_default/menus/)
115 | * **menu's languages list** are semi-hardcoded. You may chose another text for the menu entry with [languageMenuName](./exampleSite/config.toml). Please, do better and create a PR for that.
116 | * **content** must be translated individually. Read the [official documentation](https://gohugo.io/content-management/multilingual/#translate-your-content) for information on how to do it.
117 |
118 | **note:** if you do NOT want any translations (thus removing the translations menu entry), then you must not have any translations.
119 | In the exampleSite that's as easy as removing the extra translations from the `config/_default/...` or executing this onliner:
120 |
121 | ```
122 | sed '/^\[pt]$/,$d' -i config/_default/languages.toml && rm config/_default/menus/menu.pt.toml
123 | ```
124 |
125 | ### Comments
126 |
127 | Clarity supports Hugo built-in Disqus partial, you can enable Disqus simply by setting [`disqusShortname`](https://gohugo.io/templates/internal/#configure-disqus) in your configuration file.
128 |
129 | {{< tip >}}
130 | > `disqusShortname` should be placed in root level of configuration.
131 | {{< /tip >}}
132 |
133 | You can also create a file named `layouts/partials/comments.html` for customizing the comments, checkout [Comments Alternatives](https://gohugo.io/content-management/comments/#comments-alternatives) for details.
134 |
--------------------------------------------------------------------------------
/src/content/docs/clarity/features.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Features
3 | Weight: 13
4 | ---
5 |
6 | * Blog with tagging and category options
7 | * Deeplinks
8 | * Native Image Lazy Loading
9 | * Customizable (see config)
10 | * Dark Mode (with UI controls for user preference setting)
11 | * Toggleable table of contents
12 | * Flexible image configuration
13 | * Logo alignment
14 | * Mobile support with configurable menu alignment
15 | * Syntax Highlighting
16 | * Rich code block functions including:
17 | 1. Copy to clipboard
18 | 2. Toggle line wrap (dynamic)
19 | 3. Toggle line numbers
20 | 4. Language label
21 | 5. Toggle block expansion/contraction (dynamic)
22 |
23 | To put it all in context, here is a preview showing all functionality.
24 |
25 | 
26 |
--------------------------------------------------------------------------------
/src/content/docs/clarity/getting-started.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Getting started
3 | weight: 11
4 | ---
5 |
6 | ## Prerequisites
7 |
8 | Firstly, __ensure you have installed the [extended version of Hugo](https://github.com/gohugoio/hugo/releases)__. See installation steps from [Hugo's official docs](https://gohugo.io/getting-started/installing/).
9 |
10 | ## Getting up and running
11 |
12 | Read the [prerequisites](#prerequisites) above and verify you're using the extended version of Hugo. There are at least two ways of quickly getting started with Hugo and the VMware Clarity theme:
13 |
14 | ### Option 1 (recommended)
15 |
16 | Generate a new Hugo site and add this theme as a Git submodule inside your themes folder:
17 |
18 | ```bash
19 | hugo new site yourSiteName
20 | cd yourSiteName
21 | git init
22 | git submodule add https://github.com/chipzoller/hugo-clarity themes/hugo-clarity
23 | cp -a themes/hugo-clarity/exampleSite/* .
24 | ```
25 |
26 | Then run
27 |
28 | ```bash
29 | hugo server
30 | ```
31 |
32 | Hurray!
33 |
34 | ### Option 2 (Great for testing quickly)
35 |
36 | You can run your site directly from the `exampleSite`. To do so, use the following commands:
37 |
38 | ```bash
39 | git clone https://github.com/chipzoller/hugo-clarity
40 | cd hugo-clarity/exampleSite/
41 | hugo server --themesDir ../..
42 | ```
43 |
44 | > Although, option 2 is great for quick testing, it is somewhat problematic when you want to update your theme. You would need to be careful not to overwrite your changes.
45 |
46 | ### Option 3 (The new, most fun & painless approach)
47 |
48 | This option enables you to load this theme as a hugo module. It arguably requires the least effort to run and maintain in your website.
49 |
50 | First things first, ensure you have `go` binary [installed on your machine](https://golang.org/doc/install).
51 |
52 | ```bash
53 | git clone https://github.com/chipzoller/hugo-clarity.git clarity
54 | cd clarity/exampleSite/
55 | hugo mod init my-site
56 | ```
57 | Open config.toml file in your code editor, replace `theme = "hugo-clarity"` with `theme = ["github.com/chipzoller/hugo-clarity"]` or just `theme = "github.com/chipzoller/hugo-clarity"`.
58 |
59 | Hurray you can now run
60 |
61 | ```yaml
62 | hugo server
63 | ```
64 |
65 | To pull in theme updates, run `hugo mod get -u ./...` from the theme folder. If unsure, [learn how to update hugo modules](https://gohugo.io/hugo-modules/use-modules/#update-modules)
66 |
67 | > There [is more you could do with hugo modules](https://discourse.gohugo.io/t/hugo-modules-for-dummies/20758), but this will suffice for our use case here.
68 |
--------------------------------------------------------------------------------
/src/content/docs/clarity/images.md:
--------------------------------------------------------------------------------
1 | +++
2 | title = "Manipulating Images"
3 | weight = 15
4 | +++
5 |
6 | ## Images
7 |
8 | ### Image figure captions
9 |
10 | You have the option of adding captions to images in blog posts and automatically prepending a desired string such as "Figure N" to the alt text. This is controlled via two global settings.
11 |
12 | `figurePositionLabel` is a string which will be prepended to any alt text of an article image. By default, this is set to "Figure." And `figurePositionShow` controls, globally, whether to show this label. It does not affect whether to show the image alt text, only the prefix figure caption. For more granular control, `figurePositionShow` can be overridden at the article level if desired.
13 |
14 | The number will be automatically calculated and assigned after the `figurePositionLabel` text starting from the top of the article and counting down. Featured images will be excluded from this figuration.
15 |
16 | ### Image figure captions example
17 |
18 | In this example, `figurePositionLabel` is set to "Figure" in `config.toml` and this is the first image in a given article.
19 |
20 | ```markdown
21 | 
22 | ```
23 |
24 | 
25 |
26 | ### Inline images
27 |
28 | To make a blog image inline, append `:inline` to its alt text. Typically, inline images will have no alt text associated with them.
29 |
30 | ### Inline images example
31 |
32 | ```markdown
33 |
34 | 
35 |
36 |
37 |
38 | 
39 | ```
40 |
41 | 
42 |
43 | ### Float images to the left
44 |
45 | To align a blog image to the left, append `:left` to its alt text. Article text will then flow to the right of the image.
46 |
47 | ### Float images left example
48 |
49 | ```markdown
50 |
51 | 
52 |
53 |
54 |
55 | 
56 | ```
57 |
58 | ### Add classes to images
59 |
60 | To add a class image to the left, append `::` to its alt text. You can also add multiple classes to an image separated by space. `:: `.
61 |
62 | ### Image class example
63 |
64 | ```markdown
65 |
66 | 
67 |
68 |
69 |
70 | 
71 | ```
72 |
73 | ### Article thumbnail image
74 |
75 | Blog articles can specify a thumbnail image which will be displayed to the left of the card on the home page. Thumbnails should be square (height:width ratio of `1:1`) and a suggested dimension of 150 x 150 pixels. They will be specified using a frontmatter variable as follows:
76 |
77 | ```yaml
78 | ...
79 | thumbnail: "images/2020-04/capv-overview/thumbnail.jpg"
80 | ...
81 | ```
82 |
83 | The thumbnail image will take precedence on opengraph share tags if the [shareImage](#share-image) parameter is not specified.
84 |
85 | ### Article featured image
86 |
87 | Each article can specify an image that appears at the top of the content. When sharing the blog article on social media, if a thumnail is not specified, the featured image will be used as a fallback on opengraph share tags.
88 |
89 | ```yaml
90 | ...
91 | featureImage: "images/2020-04/capv-overview/featured.jpg"
92 | ...
93 | ```
94 |
95 | ### Share Image
96 |
97 | Sometimes, you want to explicitly set the image that will be used in the preview when you share an article on social media. You can do so in the front matter.
98 |
99 | ```yaml
100 | ...
101 | shareImage = "images/theImageToBeUsedOnShare.png"
102 | ...
103 | ```
104 |
105 | Note that if a share image is not specified, the order of precedence that will be used to determine which image applies is `thumbnail` => `featureImage` => `fallbackOgImage`. When sharing a link to the home page address of the site (as opposed to a specific article), the `fallbackOgImage` will be used.
106 |
107 | ### Align logo
108 |
109 | You can left align or center your site's logo.
110 |
111 | ```yaml
112 | ...
113 | centerLogo = true # Change to false to align left
114 | ...
115 | ```
116 |
117 | If no logo is specified, the title of the site will appear in its place.
118 |
--------------------------------------------------------------------------------
/src/content/docs/clarity/syntax-highlighting.md:
--------------------------------------------------------------------------------
1 | +++
2 | title = "Syntax Highlighting"
3 | +++
4 |
5 | ### Code
6 |
7 | #### Display line numbers
8 |
9 | Choose whether to display line numbers within a code block globally with the parameter `codeLineNumbers` setting to `true` or `false`.
10 |
11 | ```yaml
12 | [params]
13 | ...
14 | codeLineNumbers = true # Shows line numbers for all code blocks globally.
15 | ...
16 | ```
17 |
18 | #### Limit code block height
19 |
20 | You can globally control the number of lines which are displayed by default for your code blocks. Code which has the number of lines exceed this value will dynamically cause two code block expansion buttons to appear, allowing the user to expand to full length and contract. This is useful when sharing code or scripts with tens or hundreds of lines where you wish to control how many are displayed. Under params in `config.toml` file, add a value as follows:
21 |
22 | ```yaml
23 | [params]
24 | ...
25 | codeMaxLines = 10 # Maximum number of lines to be shown by default across all articles.
26 | ...
27 | ```
28 |
29 | > If the value already exists, change it to the desired number. This will apply globally.
30 |
31 | If you need more granular control, this parameter can be overridden at the blog article level. Add the same value to your article frontmatter as follows:
32 |
33 | ```yaml
34 | ...
35 | codeMaxLines = 15 # Maximum number of lines to be shown in code blocks in this blog post.
36 | ...
37 | ```
38 |
39 | If `codeMaxLines` is specified both in `config.toml` and in the article frontmatter, the value specified in the article frontmatter will apply to the given article. In the above example, the global default is `10` and yet the article value is `15` so code blocks in this article will auto-collapse after 15 lines.
40 |
41 | If `codeMaxLines` is not specified anywhere, an internal default value of `100` will be assumed.
--------------------------------------------------------------------------------
/src/content/docs/clarity/theme-overrides.md:
--------------------------------------------------------------------------------
1 | +++
2 | title = "Theme Overrides"
3 | +++
4 |
5 | ### Custom CSS and JS
6 |
7 | To minimize HTTP requests per page, we would recommend loading CSS styles and JavaScript helpers in single bundles. That is to say, one CSS file and one JavaScript file. Using Hugo minify functions, these files will be minified to optimize the size.
8 |
9 | Going by the above 👆🏻 reason, we recommend adding custom CSS and JS via [this custom SASS file](https://github.com/chipzoller/hugo-clarity/blob/master/assets/sass/_custom.sass) and [custom JavaScript file](https://github.com/chipzoller/hugo-clarity/blob/master/assets/js/custom.js).
10 |
11 | However, sometimes you may need to load additional style or script files. In such cases, you can add custom `.css` and `.js` files by listing them in the `config.toml` file (see the snippet below). Similar to images, these paths should be relative to the `static` directory.
12 |
13 | ```yaml
14 | [params]
15 | ...
16 | customCSS = ["css/custom.css"] # Include custom CSS files
17 | customJS = ["js/custom.js"] # Include custom JS files
18 | ...
19 | ```
20 |
21 | > __Pro Tip__: You can change the theme colors via the [this variable's SASS file](https://github.com/chipzoller/hugo-clarity/blob/master/assets/sass/_variables.sass)
22 |
23 | ### Hooks
24 |
25 | Clarity provides some hooks for adding code on page.
26 |
27 | If you need to add some code(CSS import, HTML meta or similar) to the head section on every page, add a partial to your project:
28 |
29 | ```
30 | layouts/partials/hooks/head-end.html
31 | ```
32 |
33 | Similar, if you want to add some code right before the body end, create your own version of the following file:
34 |
35 | ```
36 | layouts/partials/hooks/body-end.html
37 | ```
--------------------------------------------------------------------------------
/src/content/docs/compose/_index.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: "Compose Docs"
3 | weight: 1
4 | ---
5 |
6 | Welcome to the Compose theme user guide! This guide shows you how to get started creating technical documentation sites using Compose, including site customization and how to use Compose's blocks and templates.
7 |
8 | {{< button "./install-theme/" "Get started now" >}}
9 |
--------------------------------------------------------------------------------
/src/content/docs/compose/customize.md:
--------------------------------------------------------------------------------
1 | +++
2 | description = "basic configuration"
3 | title = "Customize layouts & components"
4 |
5 | +++
6 | ### Shortcodes modifiers
7 |
8 | These modifiers are classes you can use with shortcodes to customize the look and feel of your layouts and components.
9 |
10 | #### Grid
11 |
12 | | modifier | space |
13 | | --- | --- |
14 | | grid-2 | 2 columns |
15 | | grid-3 | 3 columns |
16 | | grid-4 | 4 columns |
17 |
18 | #### Spacing
19 |
20 | | modifier | space |
21 | | --- | --- |
22 | | mt-1 | 1.5rem top margin |
23 | | mt-2 | 3rem top margin |
24 | | mt-3 | 4.5rem top margin |
25 | | mt-4 | 6rem top margin |
26 |
27 | > use pt-1 \~ pt-4 for top padding
28 |
29 | | modifier | space |
30 | | --- | --- |
31 | | mb-1 | 1.5rem bottom margin |
32 | | mb-2 | 3rem bottom margin |
33 | | mb-3 | 4.5rem bottom margin |
34 | | mb-4 | 6rem bottom margin |
35 |
36 | > use pb-1 \~ pb-4 for bottom padding
37 |
38 | ### How do I disable dark mode?
39 |
40 | Under `params` add `enableDarkMode = false` to your `config.toml` file. If your site is based on the exampleSite, the value is already included; you only need to uncomment it.
41 |
42 | > The user will still have the option to activate dark mode, if they so wish through the UI
43 |
44 | ### How do I change the theme color?
45 |
46 | If the theme is a git submodule, you can copy the file `assets/sass/_variables.sass` from the theme into your own site.
47 | The location must be exactly the same as in the theme, so put it in `YourFancySite/assets/sass/`.
48 | You can then edit the file to customize the theme color in your site without having to modify the theme itself.
49 |
50 | ### How can I change the address bar color on mobile devices?
51 |
52 | Just put the following line in the `[params]` section in your `config.toml` file (and of course change the color):
53 |
54 | ```toml
55 | metaThemeColor = "#123456"
56 | ```
57 |
58 | ### How do I add custom styles, scripts, meta tags e.t.c
59 |
60 | Use hooks. Ideally, you should not override the them directly.
61 |
62 | Instead, you should duplicate [these files](https://github.com/onweru/compose/tree/master/layouts/partials/hooks) at the root of you site directory.
63 |
64 | 1. layouts/partials/hooks/head.html
65 | 2. layouts/partials/hooks/scripts.html
66 |
67 | The contents of the first file will be attached just before the `` tag.
68 |
69 | The contents of the second file will be attached just before the `