-
Notifications
You must be signed in to change notification settings - Fork 11
Group 1 #3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
tranvanmy
wants to merge
1
commit into
framgiatw:master
Choose a base branch
from
tranvanmy:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Group 1 #3
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,81 @@ | ||
| # Framgia Training Workshop - Linux Essential 2 | ||
| ## Homework answer (Group 1) | ||
|
|
||
| ### Homework 1 | ||
| #### Question: "Why can a normal user change his/her password without root permission?" | ||
| #### Answer: Because the passwd command in installed setuid root: | ||
| - Check permission of passwd command | ||
| ``` | ||
| $ ls -l /usr/bin/passwd | ||
| -rwsr-xr-x 1 root root 41284 Sep 12 2012 /usr/bin/passwd | ||
| ``` | ||
| - The flag s(SUID) in the fourth position. This is a flag that can be set in the file permissions that tells Linux to assume the privileges of the user that owns the executable when it is run - in this case, root. | ||
|
|
||
| ### Homework 2 | ||
| ``` | ||
| sudo groupadd framgia | ||
| sudo chgrp framgia ~/shared_directory/ | ||
| sudo chmod g+s ~/shared_directory/ | ||
| umask 007 ; mkdir a_new_directory ; umask 117 | ||
| ``` | ||
| ### Homework 3 | ||
| #### Display line numbers | ||
| ` | ||
| set number | ||
| ` | ||
| #### Add support for Elixir language | ||
| - Plugin managers | ||
|
|
||
| The most common plugin managers include [vim-plug][vim-plug], | ||
| [NeoBundle][neobundle], [Vundle][vundle] and [pathogen.vim][pathogen]. | ||
|
|
||
| With pathogen.vim, just clone this repository inside `~/.vim/bundle`: | ||
|
|
||
| `bash | ||
| git clone https://github.com/elixir-lang/vim-elixir.git ~/.vim/bundle/vim-elixir | ||
| ` | ||
|
|
||
| With the other plugin managers, just follow the instructions on the homepage of | ||
| each plugin. In general, you have to add a line to your `~/.vimrc`: | ||
|
|
||
| ```viml | ||
| " vim-plug | ||
| Plug 'elixir-lang/vim-elixir' | ||
| " NeoBundle | ||
| NeoBundle 'elixir-lang/vim-elixir' | ||
| " Vundle | ||
| Plugin 'elixir-lang/vim-elixir' | ||
| ``` | ||
|
|
||
| - Manual installation | ||
|
|
||
| Copy the contents of each directory in the respective directories inside | ||
| `~/.vim`. | ||
| #### set default list of file encoding: `utf-8`, `shift-js`, `sjis`, other encoding. | ||
| `set fileencodings=utf-8,shift-js,sjis` | ||
| #### Disable arrow keys | ||
| ``` | ||
| noremap <Up> <Nop> | ||
| noremap <Down> <Nop> | ||
| noremap <Left> <Nop> | ||
| noremap <Right> <Nop> | ||
| ``` | ||
|
|
||
| #### Replace tab with 4 spaces | ||
| ``` | ||
| set tabstop=4 | ||
| set shiftwidth=4 | ||
| set expandtab | ||
| ``` | ||
|
|
||
| ### Homework 4 | ||
| ``` | ||
| ssh-keygen -t rsa -C "" dev_rsa | ||
| Host dev | ||
| HostName 128.45.53.123 | ||
| Port 2222 | ||
| User user_name | ||
| IdentityFile ~/.ssh/dev_rsa.key | ||
| ``` | ||
| ### Homework 5 | ||
| no answer | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sai indent