This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| # Check if nvidia-smi is there | |
| if ! command -v nvidia-smi &> /dev/null | |
| then | |
| echo "nvidia-smi could not be found" | |
| exit | |
| else | |
| # Check that it's working |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| # Inspired from https://ostechnix.com/download-packages-dependencies-locally-ubuntu/ | |
| # Can be typically run in docker to select the version you want like: | |
| # docker run -it -v $(pwd):/host ubuntu:20.04 bash -c "$(cat ./this_script.sh)" | |
| package_to_install="docker.io" | |
| apt update; apt install -y apt-rdepends lsb-release |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| inline cv::Mat slMat2cvMat(const sl::Mat& input) { | |
| int cv_type = -1; | |
| switch (input.getDataType()) { | |
| case sl::MAT_TYPE::F32_C1: cv_type = CV_32FC1; | |
| break; | |
| case sl::MAT_TYPE::F32_C2: cv_type = CV_32FC2; | |
| break; | |
| case sl::MAT_TYPE::F32_C3: cv_type = CV_32FC3; | |
| break; | |
| case sl::MAT_TYPE::F32_C4: cv_type = CV_32FC4; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # https://spin.atomicobject.com/2017/08/24/start-stop-bash-background-process/ | |
| trap "kill 0" EXIT | |
| # For jetsons | |
| if [ "$(arch)" == "aarch64" ]; then | |
| nvpmodel_maxn_mode=0 | |
| if [ -e "/proc/device-tree/compatible" ]; then | |
| if [ -e "/proc/device-tree/model" ]; then |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| sudo apt update -y | |
| sudo apt upgrade -y | |
| sudo apt dist-upgrade -y | |
| sudo apt autoremove -y | |
| sudo apt install wget curl nano -y | |
| wget https://gist.githubusercontent.com/adujardin/59f7653080c2f25e7558d18de66b59bf/raw/ee6850a5c5b81b936454b3ec6373b127e7181624/upgrade_jetson.sh | |
| chmod +x upgrade_jetson.sh | |
| sudo bash upgrade_jetson.sh |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| LT4_MAJOR=32 | |
| LT4_MINOR_OLD=4 | |
| LT4_MINOR=5 | |
| if [ "$EUID" -ne 0 ] | |
| then echo "Please run as root" | |
| exit | |
| fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # https://elinux.org/Jetson/FAQ/BSP/RootFS_Reduction#Remove_installed_deb_packages | |
| ## Step 1, safe | |
| sudo apt update | |
| sudo apt autoremove -y | |
| sudo apt clean | |
| sudo apt remove thunderbird libreoffice-* -y | |
| ## Step 2, still safe but not recommended for dev use | |
| # samples |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import argparse | |
| import torch | |
| import torchvision | |
| import shutil | |
| # https://github.com/vita-epfl/openpifpaf/blob/master/openpifpaf/export_onnx.py | |
| try: | |
| import onnx | |
| import onnx.utils | |
| except ImportError: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Should be run as root | |
| Ips=$( nmap -sP 192.168.*.* | sed '/Host is up/d' | sed 's/.localdomain//' | sed 's/Nmap scan report for *//' | sed '/Nmap done/d' | sed 's/MAC Address: ..:..:..:..:..:.. //' | tr \(\) \* | paste -d ' ' - - | sed '/Starting Nmap/d' ) | |
| # Check the diff between current run and previous (should be run in a cron every hour or something) | |
| echo $Ips > current | |
| if ! cmp current old >/dev/null 2>&1; then | |
| curl -X POST -H 'Content-type: application/json' --data '{"text": "---------------------\n\n\n'"${Ips}"'" }' https://hooks.slack.com/services/<INSERT_ACTUAL_SLACK_URL_HERE> | |
| mv current old | |
| fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import os | |
| import platform | |
| import sys | |
| import re | |
| import urllib.request | |
| ZED_SDK_MAJOR = "" | |
| ZED_SDK_MINOR = "" | |
| CUDA_STR = "" |