Category Archives: Other

CLion is a crossplatform IDE for C++ made by JetBrains. CLion is not free but it is really helpful – with all its intentions, hints and refactorings. CLion has 30 days free trial license. Find out more on video introductions.

Eclipse is a free alternative but with less automation, assistance and features (this article describes the installation of Eclipse on Ubuntu).

Known issues on Raspberry Pi with Ubuntu Mate

Debugging does not work – because of not supported GDB version

On basic “Hello world” example there are issues with running the code – one of native terminal libraries fails. Compiled executable works fine. More complex example also works.

Computers like Raspberry Pi (RPi) can be connected to a network – to provide them an access to the Internet or connect to them remotely. This article describes how network connections can be configured on RPi with Ubuntu Mate 15.10 with GUI tools and in terminal mode.

Major advantage of such tiny computers as Raspberry Pi (RPi) is ability to work on small autonomous platforms like mobile robots. However computer, moving with a robot, is a challenge as well – during development it is not easy to change the code. Remote connection to the computer via SSH or VNC, using Wi-Fi, might help in such cases.

Robots can be controlled by a microcontroller (MCU) or a computer installed on-board – autonomous robots, or connected to a computer via communication channel – remotely operated robots. Both approaches have pros and cons:

Autonomous robots have everything they need on-board, they do not depend on a quality and bandwidth of communication channels. But they may have limitations on computer performance and size, its not easy to modify controlling algorithms and monitor state.

Remotely operated robots can be controlled by more powerful computer, monitoring is available for operator or developer, modification of a controlling program is much easy. But quality and bandwidth of communication channels are critical and limiting part of such system.

Intermediate solution is develop the controlling program on remotely operated robot and when it is completed – setup the program on on-board computer, leaving communication channel only for monitoring which is not such critical.

Install/uninstall software

4. If the software is installed – click on “Uninstall” button to uninstall it

Navigation within folders and files

Terminal

Run the Terminal – click on the icon “Terminal” or hit the key combination Ctrl+Alt+T

Prompt with the cursor has following format:
user-name@computer-name:current-folder-name$

Command cd folder-name changes the current folder to specified as folder-name in the parameter

Command ls folder-name displays the content of the folder specified as folder-name in the parameter. The command ls without parameters – displays the content of the current folder

Predefined folder names

. – “single dot” refers to a current folder ( ./ “single dot followed by slash” is the same)... – “double dot” refers to a parent folder ( ../ “double dot followed by slash” is the same)./ – “slash” refers to a root folder of the system.~ – “tilda” refers to a “home” folder of the logged user – with subfolders “Documents”, “Downloads”, “Pictures”, etc. ( ~/ – “tilda followed by slash” is the same).

File explorer

Click on the icon to open file manager window

Item “Home” on the left panel of the file manager window refers to a “home” folder of the logged user

The way to easy change of a size of a window – keep the key Alt and the middle mouse button pressed when the mouse cursor is near the border or a corner of a window and move the mouse cursor.

Midnight Commander

Well known text terminal based file manager

Many operations available in two clicks from menus

Ctrl+O – hide/show panels

F3 – view selected file withing embedded viewer

F4 – edit selected file with one of system editors – first editing operation suggests to select the editor (which can be changed later)

“mceditor” has highlight of syntax

Change the default editor by command “update-alternatives”

sudo update-alternatives –config editor

GNOME Commander

GUI based file manager with useful features

For view/edit files it uses “gedit” text editor

Installation of Arduino IDE

Install “Arduino IDE” from “Ubuntu Software Center“. This version can be not latest and mai not have support needed boards and new features.

Cannot login GUI
Ctrl + Alt + F1 to get to terminal
sudo passwd > to change password
sudo apt-get install –reinstall xorgIf still can’t login – try following
cd /home/<user> ( cd ~ will get you to the same place, instead of type the name of your directory)
sudo mv .Xauthority .XauthorityBak (renaming this file)

alter way
$ ls -l ~/.Xauthority
-rw——- 1 root root 61 Sep 16 15:43 .Xauthority
$ chown group:user ~/.Xauthoritywhere ‘group’ and ‘user’ are the group and the user that you use to login. in this example
$ chown akonsu:akonsu ~/.Xauthority

0 -> move to first column in a line
^ -> move to a first non-space character of the line
$ -> move to a last letter of a line
^u -> move page up
^d -> move page down
b -> move to a word left
w -> move to a word right
# -> move to the prev occurence of current word
* -> move to the next occurence of current word

Esc or ^[ -> switch to normal mode
i -> switch to insert mode (starts before the current letter)
a -> switch to append mode (starts after the current letter)

Commands
:e filename -> edit to file with name “filename” (:e! -> reload current file)
:w filename -> write to file with name “filename”
😡 -> save and exit
:q -> exit if there is no changes
:q! -> exit without save
:u -> undo last command
:^R -> redo last “undone” command
:%command -> range of the “command” is a document – not only line. Eg. :%s/ab/xz/g
:123<CR> -> move to the line number 123
:!shell-command -> run any shell command

Ctrl+Z -> temporary switch to the shell; enter “fg” to return back to vim

:s/foo/bar/g -> Find each occurrence of ‘foo’ (in the current line only), and replace it with ‘bar’.
:%s/foo/bar/g -> Find each occurrence of ‘foo’ (in all lines), and replace it with ‘bar’.
:%s/foo/bar/gc -> Change each ‘foo’ to ‘bar’, but ask for confirmation first.
:%s/\<foo\>/bar/gc -> Change only whole words exactly matching ‘foo’ to ‘bar’; ask for confirmation.
:%s/foo/bar/gci -> Change each ‘foo’ (case insensitive due to the i flag) to ‘bar’; ask for confirmation.
:%s/foo/bar/gcI -> Change each ‘foo’ (case sensitive due to the I flag) to ‘bar’; ask for confirmation.

., *, \, [, ^, and $ are metacharacters.
+, ?, |, &, {, (, and ) must be escaped to use their special function.
\/ is / (use backslash + forward slash to search for forward slash)
\t is tab, \s is whitespace
\n is newline, \r is CR