Ubuntu 14.04 LTS (trusty tahr) survival tricks

This page shows common Linux/Ubuntu procedures:

1. General Ubuntu
1.1 Open terminal: CTRL+ALT+T
1.2 Switch windows: ALT+TAB and wait!
1.3 Running something as root: sudo gparted, sudo apt-get …

2. Packages
Update: sudo apt-get update
Install: sudo apt-get install gparted
Install missing dependencies: sudo apt-get install -f
Install .deb: sudo dpkg -i package.deb
Find out include/libs:
pkg-config --cflags opencv
pkg-config --libs opencv

3. Partitions, booting & more
3.1 Partition manager:  sudo gparted

3.2 Ubuntu boot from CD and boot repair (repair GRUB)

sudo add-apt-repository -y ppa:yannubuntu/boot-repair; \
sudo apt-get update; \
sudo apt-get install -y boot-repair && boot-repair

3.3 Windows repair (activate GRUB in Windows):

bcdedit /set {bootmgr} path \EFI\ubuntu\shimx64.efi

4. Serial devices (USB-TTL etc.)

4.1 Allow access a non-root:   sudo adduser alex dialout
4.2 Set serial baud: stty -F /dev/ttyUSB0 5760 parodd
4.3 Writing: echo “command” > /dev/ttyUSB0
4.4 Reading: cat /dev/ttyUSB0
4.5 Redirect to file: cat /dev/ttyUSB0 > file.txt
4.6 Create TPC server for reading/writing to serial device:
sudo apt-get install socat
sudo socat TCP-LISTEN:81,fork,reuseaddr FILE:/dev/ttyUSB0,b115200,raw,echo=0
4.7 Dump serial output (stop with CTRL+A, then CTRL+C):
sudo screen /dev/ttyACM0 115200
4.8 Serial console:  minicom -b 115200 -o -D /dev/ttyUSB0

5. Processes
5.1 Kill:  killall cat

6. Arduino Due
6.1 Flashing Arduino Due
# use Atmega16u2 to trigger Due ERASE
stty -F /dev/ttyACM1 1200
# wait 3 seconds
sleep 3
# use bossac to flash
bossac -i -p ttyACM0 -R -e -w -b arduino.ino.bin

7.

to be continued…

Leave a Reply

Your email address will not be published. Required fields are marked *

IMPORTANT! To be able to proceed, please enter the magic word 'agndea' so we know hat you are a human)

Enter the magic word:
Please leave these two fields as-is:

A blog on projects with robotics, computer vision, 3D printing, microcontrollers, car diagnostics, localization & mapping, digital filters, LiDAR and more