This post is very much an evolving, growing thing, that I will add to as I am exploring the world of raspberry pi. N00bs galore!
SYSTEM UPDATES and CONFIGURATION
To check the current version of Linux:
uname -r
To get to the raspberry pi config utility:
sudo raspi-config
To verify the installed packages:
dpkg -l
Graceful shutdown
sudo shutdown -r now
Reboot:
apt-get update This will update the list of available packages, but will not actually upgrade them
apt-get upgrade -y After updating the list (apt-get update),the package manager knows about the available updates for the software you have installed. This is why you want to run apt-get update first
Removing components is as follows (example):
packages are stored in /var/cache/apt/archives and you can refer back to them, if needed for instances
Bootlog:
dmesg
this will also give you an overview of the linux version, cpu etc. that you have
Tracing
strace -e trace=open motion
Overview of USB devices:
lsusb =overview of all USB devices
ldd <ex.motion> =shows the shared library dependency (motion for ex.)
Most log file can be found in
/var/log/ use vi to view the contents of the log files.
FILES AND FOLDERS and MOUNTS
ls -l = to view long listings, files and folders permissions
find /usr/lib -iname libjpeg* =search function
find . -size -900000c -delete =search and delete all files smaller than 900000 bytes
cat /proc/mounts =check which devices are mounted
sudo usermod -a -G video pi = this will add the user "pi" to the "video" permissions group
id -u pi = will display the UID of the user "pi", in this case 1000.
Find Files
use grep or find
Example: find . -name "www.conf"
Using vi
Vi uses what is called command mode; this does not allow you to edit a file straight away.
so to insert a line, press "i" and start adding/editing text.
To go back into command mode, press ":" then you can issue "w" to write the changes and "q" to quit vi.
to remove a hole line, where the cursor is situated: use "dd"
Services
to check and see what services are running use "ps aux"
Camera
raspistill -o image.jpg -w 640 -h 480 =Take a 640x480 shot
raspivid -t 20000 -o video.h264 =Capture 20s of h264 video (t=time o=output file)
No comments:
Post a Comment