Skip to content

Instantly share code, notes, and snippets.

@zinwalin
Last active April 5, 2021 06:34
Show Gist options
  • Save zinwalin/b3fdf99f70b33b89ce7a1a17b1f29be2 to your computer and use it in GitHub Desktop.
Save zinwalin/b3fdf99f70b33b89ce7a1a17b1f29be2 to your computer and use it in GitHub Desktop.
Regular commands used in daily learning life.

no fuss, no muss...

zsh env setup

sudo apt update -y
sudo apt install zsh -y
chsh -s /bin/zsh
wget https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh -O - | sh

Change Ubuntu hostname on Jetson Nano

sudo hostnamectl set-hostname nano

Power Mode (5W, MAXN 10W)

sudo nvpmodel -m 0 # 10W(MAXN mode)
sudo nvpmodel -m 1 # 5W mode
sudo nvpmodel -q  # query current power mode

Use screen util to connect with Jetson Nano through MicroUSB Connector (exec following commands on Host OS)

ls -l /dev/cu.usbmodem*
sudo screen /dev/cu.usbmodem14133200001053 115200 # Press Ctrl + a + k to trigger termination with y for confirmation. 

jtop for Jetson Nano stats

sudo apt update -y
sudo apt-get install git cmake -y
sudo apt-get install python3-dev -y
sudo apt-get install python3-pip -y
sudo apt-get install libhdf5-serial-dev hdf5-tools -y
sudo apt-get install libatlas-base-dev gfortran -y
#sudo -H pip3 install -U jetson-stats
sudo pip3 install jetson-stats -i https://mirrors.aliyun.com/pypi/simple --trusted-host mirrors.aliyun.com
sudo systemctl restart jetson_stats.service
jtop

Maximize jetson performance by setting static max frequency to CPU, GPU and EMC clocks.

sudo jetson_clocks --show # display current settings
sudo jetson_clocks --fan  # set PWM fan speed to maximal

Create swap partition

sudo systemctl disable nvzramconfig # nvzramconfig is a service
sudo fallocate -l 8G /mnt/8G.swap
sudo chmod 600 /mnt/8G.swap
sudo mkswap /mnt/8G.swap
sudo vi /etc/fstab  # add this line: /mnt/8G.swap swap swap defaults 0 0 
sudo reboot

Set up WIFI

sudo nmcli device wifi list
sudo nmcli device wifi connect <ssid_name> password <password> # replace <ssid_name> and <password> with proper settings
ifconfig
sudo nmcli radio wifi off
sudo nmcli radio wifi on
nmcli radio help   
nmcli radio wifi help

Build Python 3.7 from source

cd ~/Desktop
wget https://www.python.org/ftp/python/3.7.9/Python-3.7.9.tgz
tar -xf Python-3.7.9.tgz
cd Python-3.7.9
./configure --enable-shared --enable-optimizations
make
sudo make install 
sudo ldconfig /usr/local/lib

convert ipynb to py

#pip3 install ipython
pip3 install nbconvert
# ipython nbconvert --to script xxx.ipynb
jupyter nbconvert --to script xxx.ipynb

set terminal width

stty cols 132 rows 34

restart camera

sudo service nvargus-daemon restart

install PyTorch using CPU

pip3 install torch torchvision torchaudio

Command used for checking CUDA version:

cat /usr/local/cuda/version.txt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment