advanced linux commands

pciutils – to list and configure PCI devices.


sudo apt-get update
sudo apt-get install pciutils

lspci – part of pci utils, lspci lists PCI ports and device information.


lspci -v |grep NV

lspci nvidia

dmesg is used to print out kernal status http://www.linfo.org/dmesg.html


dmesg |grep NVRM

dmesg |grep nouv

dmesg nvidia gpu

Disable nouveau driver(free driver for nvidia cards comes with ubuntu) for nvidia driver installation.


vi /etc/modprobe.d/blacklist-nouveau.conf
blacklist nouveau
options nouveau modeset=0

Regenerate the kernel initramfs:(initramfs is used to mount root file system / while boot)


sudo update-initramfs -u
sudo reboot

Uninstall nvidia driver/cuda.


sudo /usr/bin/nvidia-uninstall
sudo apt-get remove --purge nvidia-*
sudo apt-get --purge remove nvidia-cuda* 

Monitor nvidia gpu.


nvidia-smi 

Nvidia driver version.

cat /proc/driver/nvidia/version

nvidia driver version

Ubuntu package manager list option.


dpkg -l | grep -i nvidia
apt list --installed
cat /var/log/dpkg.log

Remove ubuntu installed/stale packages.


sudo apt-get autoremove
sudo apt-get purge <package>
sudo apt-get remove <package>

Stop X server by executing.


sudo service lightdm stop

cuda compiler version.


nvcc- V

To force remove packages

(Error: You might want to run 'apt-get -f install' to correct these.
The following packages have unmet dependencies:
 packagex : Depends: lua-lpeg but it is not installed
E: Unmet dependencies. Try using -f.)

sudo dpkg --purge --force-depends <packagex>

To get the number of processors

nproc
To list audio play devices

aplay -l

aplay ubuntu

To list the recording devices

arecord -l

arecord ubuntu raspberry pi

record for 1 second

rec -c 2 test.wav trim 0 1

play

play test.wav

ifconfig – to find IP address

netstat – list network statistics

 

Github commands

To set up a repository

echo “Readme” >> README.md
git init
git add README.md
git commit -m “first commit”
git config –global user.email <email>
git config –global user.name <name>
git commit -m “first commit”
git remote add origin <path.git>
git push -u origin master

To upload an edited file

git add <filename>
git commit -m “comments” <filename>
git push

Install old version of Tensorflow using pip. (Tested versions: Tensorflow 1.4 with CUDA 8 and cuDNN 6)

pip install tensorflow-gpu==1.4.0

Easy check CuDNN/cublas/cuda version (ImportError: libcublas.so.9.0: cannot open shared object file: No such file or directory)

ldconfig -v | grep libcudnn

ldconfig -v | grep libcublas