Skip to content

lorenzodeluca/ComputerNetworks2024

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ComputerNetworks2024

vim(cause nano is too easy): cheat sheet: https://vim.rtorr.com/

Preconditions

Copy the .vimrc file into your home directory on the server using Unix's scp command.

Remember to change MATRICOLA with your Unipd Student ID.

Login using your SSH credentials.

scp -O ./.vimrc MATRICOLA@SERVER_IP:/home/MATRICOLA/.vimrc 

vim how to format code in cmd mode(keystroke): gg=G Explanation: gg goes to the top of the file, = is a command to fix the indentation and G tells it to perform the operation to the end of the file.

Content of .vimrc

This .vimrc config file allows you to:

  • Use your mouse: scrolling wheel to move up or down, click and point
  • Move line Up/Down using Ctrl+Shift+Up/Down
  • Press F8 to Compile the C program without exiting Vim
  • Press F9 to Execute the C program without exiting Vim
  • Auto close brackets

Other configurations:

  • Replace tabs with 3 spaces
  • Highlight matching parentheses
  • Auto indent on brackets
  • Show line number
  • Highlight current line
  • Search characters as they are entered
  • Search is case insesitive if no case letters are entered, but case sensitive if case letters are entered
  • Highlight search results

How to search in VIM:

Click to expand!

Search is UNIDIRECTIONAL but when the search reach one end of the file, pressing n continues the search, starting from the other end of the file.

Search from the current line forward/backwards

To search forward use /

To search bacward use ?

x es:

ESC (go into Command mode)

/query (forward)
?query (backward)

ENTER (to stop writing in the search query)

(now all search results of the query are highlighted)

n (to move to the NEXT occurence in the search results)
N (to move to the PREVIOUS occurence in the search results)

ESC (to exit Search mode)

How to Compile and Execute without exiting VIM:

Click to expand!

To Compile press F8

To Execute press F9

ESC (go into Command mode)

F8 (compile shortcut)
F9 (execute shortcut)

CTRL+C (to exit compilation/executable) 

Enter (to re-enter in vim)

How to Move current line Up or Down in VIM:

Click to expand!
ESC (go into Command mode)

CTRL+SHIFT+PAGE UP  (to move line up)
CTRL+SHIFT+PAGE DOWN (to move line down)

i (go into Insert mode)

How to Select, Copy/Cut and Paste in VIM:

Click to expand!
Select with the mouse the text you want to copy
[ALTERNATIVE
    ESC (go into Command mode)
    V100G (to select from current line to line 100, included, using Visual mode)]

y (to Copy/yank)
d (to Cut/delete)

p (to Paste after the cursor)

How to copy from another file in VIM:

Click to expand!

Open the file from which you want to copy in Vim using:

vi ogFile.c (ogFile is the destination file)

ESC (go into Command mode)

:ePATH/file (open 'source' file at Path)

(select the lines that you want to copy)
y (copy/yank)

:q (close the 'source' file)

vi ogFile.c (open the 'destination' file)

p (paste the copied lines into the 'destination' file)

If you've made an error, CTRL+z is u:

Click to expand!
ESC (go into Command mode)

u (to Undo)

If you've pressed CTRL + s and now the screen is frozen, press CTRL + q (to unfreeze screen)

Click to expand!
CTRL + s (now screen is frozen)

(every command that you type when the screen is frozen will be executed, it just won't be displayed in the terminal)

CTRL + q (to unfreeze the screen)

In questa repo sono contenuti i programmi sviluppati dal professore durante il corso tenuto nell'A.A. 21/22 e riscritti per essere più chiaramente comprensibili e più estensivamente commentati.

  • Client web HTTP/1.1
    • Risoluzione degli hostname in IP
    • Parsing degli header
    • Supporta il Transfer-Encoding: chunked
  • Server web
    • Invio di file statici nella cartella del server
    • Autorization richiesta nella cartella secure tramite basic HTTP auth ������ RFC2617
    • Invio tramite Transfer-Encoding: chunked
  • Proxy web
    • Modalità GET in chiaro
    • Modalità CONNECT tramite TLS tunnelling
  • Socket web server

    Compilare con: gcc wsock.c -o wsock -lcrypto

    • Handshake socket
    • Comunicazione bidirezionale tra server e client

Standard di riferimento (Standards)

About

i added to the repo some infos from other repos related to the same exams and from other people that suggested me. Thanks for the help, i did this repo to hopefully help other people that are preparing for this exams.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors