# UNIX SERVER TIPS ## Configuration files Feel free to use your own configuration files on the server! ~/.ghci ~/.gitconfig ~/.vimrc ~/.zsh/* etc. etc. ## ssh keys Use ssh-keygen on your computer to create a pair of ssh keys (public/private), and add the **public** key to the authorized keys of your user on the server. (if you are not sharing your computer with other people, it makes sense to leave the passphrase blank. In this way, you'll be able to connect with a simple ssh command without using a password.) Example: ssh-keygen This should create the files ~/.ssh/id_rsa and ~/.ssh/id_rsa.pub. All you need to do now is append the contents of id_rsa.pub to your ~/.ssh/authorized_keys file, which you can do by running the following command on your computer: cat ~/.ssh/id_rsa.pub | ssh USERNAME@haskell.imd.ufrn.br "cat >> ~/.ssh/authorized_keys" After this, you should be able to connect to haskell.imd.ufrn.br without using a password. ## RSYNC rsync is a powerful program for "synchronizing" two directories, smart enough to copy only the modified/new files. Common usage: rsync -av user1@host1:path/to/folder/ user2@host2:path/to/folder2/ (Obs: the prefix "user@host:" should be omitted if it's a local folder.) For example, to copy the directory homework from your computer to the server, you'd do: rsync -av homework/ USERNAME@haskell.imd.ufrn.br:homework/ And for the opposite direction just switch the arguments. (The trailing slashes are important for rsync. Read its man page!) ## GIT Even better, if you store your haskell (home)work on github, you can use git on your computer and on your server as well. ## TMUX Use tmux when working on the server! A couple of aliases I've already set up for you: t start a new tmux session tt attach to an existing tmux session (You should only need 1 tmux session on the server.) ## SHELL The default shell on the server is zsh. If you have chosen vim or nvim as your editor of choice, zsh will behave in a vi-like way. (By default the shell is in insert mode, but hitting ESC, it will drop to normal mode, etc.) Keep this in mind if you think that the shell is behaving in a weird way, you might be in normal mode. (Just hit 'i' to return to insert mode.) ## MORE TIPS... ? I might be adding more tips in this file, so check back later.