Installing Virtualbox

  1. Install Virtualbox depending on your operation system
  2. Download Debian networking install iso
  3. Create a new VirtualBox VM

  4. Assign memory for VM. Recommended size is 2Gb

  5. Create hard disk.

    Recommended size is 8Gb, file type is VDI (VirtualBox Disk Image), Storage on physical hard disk is Dinamically allocated

  6. Insert the Debian install DVD image into the VM storage system

    Select the Debian 8 virtual machine in the left side of the VirtualBox window and then click on the Settings icon in the VirtualBox menu bar.

    In the screen that appears, click on the Storage icon. You will see items called IDE Controller and SATA Controller in the left side of the screen. It shows it is connected to an empty optical disk. We need to configure it so the network installer ISO disk image appears where the empty disk is now. This is just like inserting a CD or DVD installer disk into a normal host machine.

    DVD’s and CD’s are attached to the IDE Controller in a real computer so click on the Empty optical disk icon below the IDE Controller. Then, click on the optical disk icon on the far right side of the window next to the CD/DVD Drive field.

    Now you can see that the network install ISO image is configured for the Debian 8 VM. We should be able to start it now and it will boot from the image and the software on the disk image will start the Debian Linux installation process in the virtual machine.

  7. Start this new virtual machine

  8. Choose language (recommended language is english)

  9. Choose your country

  10. Choose your locale (recommended locale is Unites States en_US.UTF-8)

  11. Configure keyboard layout

  12. Set hostname of this machine, domain name can be empty

  13. Set the root password twice.

    Give a safe password

  14. Create a new user. DO NOT use a linux machine as root!

  15. Set the username of this new user.

  16. Set the password twice for this user.

    Give a safe password

  17. Disk partitioning. Choose Guided - use entire disk

  18. Choose the offered disk

  19. Choose All files in one partition (recommended for new users)

  20. Finish partitioning

  21. Write changes to disk

  22. Do not scanning another media

  23. Configure the package manager. Choose German instead of Hungary

  24. Choose ftp.de.debian.org

  25. Leave the proxy empty

  26. Set the package usage survey as you want

  27. Configure your desktop.

    Do not install heavy weight windows managers! Recommendation is LXDE

  28. Install GRUB loader

  29. Set GRUB install partition

Using Linux

  • Using command line

    The Linux command line is a text interface to your computer. Often referred to as the shell, terminal, console, prompt or various other names, it can give the appearance of being complex and confusing to use. Yet the ability to copy and paste commands from a website, combined with the power and flexibility the command line offers. Tutorial

  • Tab completion

    Tab completion is an extremely helpful feature in nearly any command-line environment, whether you’re using the Bash shell on Linux, Command Prompt or PowerShell on Windows, or a terminal window on Mac OS X.

    This feature can dramatically help you speed up typing commands. Just hit Tab while typing a command, option, or file name and the shell environment will automatically complete what you’re typing or suggest options to you. Tutorial

  • Basic linux commands

    34 Linux Basic Commands Every User Should Know

  • Using dselect

    dselect is a front-end to dpkg that is used to manage software packages in Debian and Debian-based Linux distributions. You can use dselect to install packages on your system from the APT archives defined in /etc/apt/sources.list, review the already installed packages, uninstall and upgrade packages. dselect has a text-mode user interface that is started with the dselect command:

    After you start update menu, dselect updates its local database. After that you can start Select menu. You can get help with ? key.

    You will be presented with a list of packages which are installed or available for installation. You can navigate around the list using the cursor keys, mark packages for installation (using +) or deinstallation (using -). Packages can be marked either singly or in groups; initially you will see that the line 'All packages' is selected. '+', '-' and so on will affect all the packages described by the highlighted line.

    Some of your choices will cause conflicts or dependency problems; you will be given a sub-list of the relevant packages, so that you can solve the problems.

    Press space to leave help and enter the list now.

    The top half of the screen shows a list of packages. For each package you see four columns for its current status on the system and mark. In terse mode (use v to toggle verbose display) these are single characters, from left to right

    Error flag: Space - no error (but package may be in broken state - see below) 'R' - serious error during installation, needs reinstallation;

    Installed state:

    • Space - not installed;
    • '*' - installed;
    • '-' - not installed but config files remain;
    • 'U' - unpacked but not yet configured;
    • 'C' - half-configured (an error happened);
    • 'I' - half-installed (an error happened);
    • 'W','t' - triggers are awaited resp. pending.

    Old mark: what was requested for this package before presenting this list; Mark: what is requested for this package:

    • '*': marked for installation or upgrade;
    • '-': marked for removal, but any configuration files will remain;
    • '=': on hold: package will not be installed, upgraded or removed;
    • '_': marked for purge completely - even remove configuration;
    • 'n': package is new and has yet to be marked for install/remove/&c.

    Also displayed are each package's Priority, Section, name, installed and available version numbers (Shft-V to display/hide) and summary description.

    Highlight: One line in the package list will be highlighted. It indicates which package(s) will be affected by presses of +, - and _.

    The dividing line in the middle of the screen shows a brief explanation of the status of the currently-highlighted package, or a description of which group is highlighted if a group line is. If you don't understand the meaning of some of the status characters displayed, go to the relevant package and look at this divider line, or use the 'v' key for a verbose display (press v again to go back to the terse display).

    The bottom of the screen shows more information about the currently-highlighted package (if there is only one).

    It can show an extended description of the package, the internal package control details (either for the installed or available version of the package), or information about conflicts and dependencies involving the current package (in conflict/dependency resolution sublists).

    Use the i key to cycle through the displays, and I to hide the information display or expand it to use almost all of the screen.

    Keystrokes

    Motion keys: Next/Previous, Top/End, Up/Down, Backwards/Forwards

    j, k, move highlight
    N, Pgdn, SpaceP, Pgup, Backspacescroll list by 1 page
    ^n^pscroll list by 1 line
    t, Homee, Endjump to top/end of list
    udscroll info by 1 page
    ^u^dscroll info by 1 line
    B, F, pan display by 1/3 screen
    ^b^fpan display by 1 character

    Mark packages for later processing:

    +, Insert install or upgrade
    =, Hhold in present version
    -, Delremove
    :, Gunhold: upgrade or leave uninstalled
    _remove & purge config

    Miscellaneous:

    Quit, exit, overwrite(note capitals!): Quit
    ?, F1 request help (also Help)
    ReturnConfirm,quit (check dependencies)
    i, I toggle/cycle info displays
    Q Confirm, quit (override dependencies)
    o, Ocycle through sort options
    X, Esc X abandoning any changes made
    v, A, V change status display opts
    R Revert to state before this list
    ^l redraw display
    U set all to sUggested state
    / search (Return to cancel)
    Dset all to Directly requested state
    n, \repeat last search
  • Midnight Commander

    GNU Midnight Commander is a visual file manager, licensed under GNU General Public License and therefore qualifies as Free Software. It's a feature rich full-screen text mode application that allows you to copy, move and delete files and whole directory trees, search for files and run commands in the subshell. Internal viewer and editor are included.

    Midnight Commander is based on versatile text interfaces, such as Ncurses or S-Lang, which allows it to work on a regular console, inside an X Window terminal, over SSH connections and all kinds of remote shells.

    Keyboard shotcuts for file panels

    TAB Jumps from one panel to the other
    F1 Help
    F2 Opens user menu
    F3 View selected file content
    F4 Opens file in internal editor
    F5 Copies selected file. Default is to another panel, but it asks first
    F6 Moving file. Default is to another panel, but it asks first.
    F7 Make directory
    F8 Delete file or directory
    F9 Opens main menu at the top of the screen
    F10 Ends current action; editor, viewer, dialog window or ends mc program
    Move the selection bar to the previous entry in the panel
    Move the selection bar to the next entry in the panel
    Ctrl+R Refresh active panel
    PgUporAlt+V move the selection bar one page up
    PgDnorAlt+P move the selection bar one page down
    HomeorAlt+< move the selection bar to the first entry in the panel
    EndorAlt+> move the selection bar to the last entry in the panel
    Alt+G move the selection bar to the first visible entry in the panel
    Alt+R move the selection bar to the middle visible entry in the panel
    Alt+J move the selection bar to the last visible entry in the panel
    Alt+S start a quick filename search in the directory listing
    Alt+E change charset of current panel
    Alt+H show the directory history
    Alt+U move to the next directory in the history
    Alt+Y move to the previous directory in the history
    + select (tag) a group of files
    \ unselect a group of files
    Alt+* invert selection on the current panel
    Alt+I make the current directory of the current panel also the current directory of the other panel
    Alt+O If the currently selected file is a directory, load that directory on the other panel and moves the selection to the next file. If the currently selected file is not a directory, load the parent directory on the other panel and moves the selection to the next file
    Alt+L If the currently selected file is a link to the directory, load that directory on the other panel and moves the selection to the next file
    Ctrl+PgDn move to the child directory
    Ctrl+PgUp move to the parent directory
    Insert or Ctrl+T tag or untag files. To untag files, just retag a tagged file
    Shft+ tag file and move the selection bar to the next entry
    Shft+ tag file and move the selection bar to the previous entry
    Alt+Enter Copies selected filename in command line
    Ctrl+Shft+Enter Copies full path of selected file in the command line
    Alt+H Shows command line history
    Ctrl+X then c Opens chmod dialog for marked file
    Ctrl+X then o Opens chown dialog for marked file
    Alt+? Opens search dialog
    Ctrl+X then A Opens VFS list. If an ftp session times out, you can use this to free the open vfs so you can log in again.

    Keyboard shotcuts for editor

    F3Begin of text selection. Second press - end of text selection
    Shft+F3 Begin of block text selection
    F5 Copy text selection
    F6 Move text selection
    F8 Delete text selection
    Alt+i Go to previous bookmark
    Alt+j Go to next bookmark
    Alt+k Toggle bookmark
    Alt+l Go to line by number
    Alt+o Flush bookmarks
    Alt+q Insert literal. See table at bottom of this page
    Alt+t Sort of text in selection.
    Alt+u Execute external command and insert output into cursor position
    Ctrl+f Save selection into external file
    Ctrl+k Delete chars to end of line
    Ctrl+n Create new file
    Ctrl+s Toggle syntax highlighting
    Ctrl+t Select text charset
    Ctrl+u Undo
    Ctrl+x Go to end of next word
    Ctrl+y Delete line
    Ctrl+z Go to start of previous word
    Shft+F5 Insert external file content into cursor position
    Alt+Enter Codejump dialog
    Alt+- Move back into codejump (go to from function definition to function call)
    Alt++ Move forvard into codejump (go to from function call to function definition)
    Alt+n Toggle number of lines
    tab If 'persistent blocks' option is on, then move selected text to right
    Alt+tab If 'persistent blocks' option is on, then move selected text to left
    Shft+Arrows Text selection
    Alt+Arrows Block text selection
    Alt+Shft+- Toggle show visible tabs and trailing spaces

Installing and using Git

apt-get install git gitg gitk git-flow

Git cheat sheet

Create

  • Clone an existing repository

    git clone ssh://user@domain.com/repo.git

  • Create a new local repository

    git init

Local changes

  • Changed files in your working directory

    git status

  • Changes to tracked files

    git diff

  • Add all current changes to the next commit

    git add .

  • Add some changes in <file> to the next commit

    git add -p <file>

  • Commit all local changes in tracked files

    git commit -a

  • Change the last commit. Don‘t amend published commits!

    git commit --amend

Branching & Tags

  • List all existing branches

    git branch

  • Switch HEAD branch

    git checkout <branch>

  • Create a new branch based on your current HEAD

    git branch <new-branch>

  • Create a new tracking branch based on a remote branch

    git checkout --track <remote/branch>

  • Delete a local branch

    git branch -d <branch>

  • Mark the current commit with a tag

    git tag <tag-name>

Update & publish

  • List all currently configured remotes

    git remote -v

  • Show information about a remote

    git remote show <remote>

  • Add new remote repository, named <remote>

    git remote add <remote> <url>

  • Download all changes from , but don‘t integrate into HEAD

    git fetch <remote>

  • Download changes and directly merge/integrate into HEAD

    git pull <remote> <branch>

  • Publish local changes on a remote

    git push <remote> <branch>

  • Delete a branch on the remote

    git branch -dr <remote/branch>

  • Publish your tags

    git push --tags

Merge & Rebase

  • Merge into your current HEAD

    git merge <branch>

  • Rebase your current HEAD onto <branch> Don‘t rebase published commits!

    git rebase <branch>

  • Abort a rebase

    git rebase --abort

  • Continue a rebase after resolving conflicts

    git rebase --continue

  • Use your configured merge tool to solve conflicts

    git mergetool

  • Use your editor to manually solve conflicts

    git add <resolved-file>

  • After resolving mark file as resolved

    git rm <resolved-file>

Undo

  • Discard all local changes in your working directory

    git reset --hard HEAD

  • Discard local changes in a specific file

    git checkout <file>

  • Revert a commit (by producing a new commit with contrary changes)

    git revert <commit>

  • Reset your HEAD pointer to a previous commit & discard all changes since then

    git reset --hard <commit>

  • Reset your HEAD pointer to a previous commit & preserve all changes as unstaged changes

    git reset <commit>

  • Reset your HEAD pointer to a previous commit & preserve uncommitted local changes

    git reset --kepp <commit>

Using Gitlab

Registering in Gitlab

Go to Gitlab

Creating a project in Gitlab

  • Click to + button int the top menubar
  • Select new project submenu
  • Give a name for the new project

Add a member for the project

Setting roles of a new member

Setting remote repository for an existing git project

git remote add origin http://gitlab.com/<username>/<projectname>

Commit changes

git add --all

git commit -am "commit message"

push local modification to remote repository

git push origin master

fetch remote modification to the local repository fetch only without modification in stage

git fetch origin master

pull remote modification to the local repository and working directory

git pull origin master

Creating ssh keys for Gitlab

  1. Create an ssh key at your local machine

    ssh-keygen -t rsa -b 2048

    Do NOT add a password when generator ask you! (simple enter)

    default place of your public key is at ~/.ssh/id_rsa.pub.

  2. open this file with an editor and copy the whole content to clipboard

  3. open gitlab with a browser & click to personal data in the top right corner & click to preferences menu

  4. Click to SSH Keys menu

  5. copy the whole content of your id_rsa.pub to Key field

Converting https repository reference to ssh key repository reference at gitlab

Your original repository url is: https://gitlab.com/<your_username>/<project_name>.git

Converted url is git@gitlab.com:<your_username>/<project_name>.git

Example

Original repository: https://gitlab.com/Zidarics/zidarics_emb1.git

Converted repository: git@gitlab.com/Zidarics/zidarics_emb1.git

Installing test libraries

apt-get install libcunit libcunit-dev libcunit-doc libcunit-dev-curses-dev

apt-get install libmocka0 cmocka-doc libmocka-dev