Skip to content

Instantly share code, notes, and snippets.

@jzzdog
Last active October 19, 2021 07:06
Show Gist options
  • Save jzzdog/7298ee3f081d08192cd7 to your computer and use it in GitHub Desktop.
Save jzzdog/7298ee3f081d08192cd7 to your computer and use it in GitHub Desktop.
Ubunutu tooltips

Initial server settings

Create new user

adduser deploy

Add new usert to the sudo group

gpasswd -a deploy sudo

Check your local ssh config and add new host

cat ~/.ssh/config

Generate ssh key if you have not done it earlear

ssh-keygen

Copy key to remote host

ssh-copy-id ac

If problem, try to check if tht server side ssh service installed and fix it if not

sudo apt-get install ssh

more information: www.digitalocean.com/community/tutorials/initial-server-setup-with-ubuntu-14-04

Sublime text

sudo add-apt-repository ppa:webupd8team/sublime-text-2
sudo apt-get update
sudo apt-get install sublime-text

Vim

sudo apt-get install vim

u – undo Ctrl + R – redo

normal mode

h,j,k,l – basic movement w,e,b – word movement esc – exit from other modes to normal mode

insert mode

i – enter insert mode :wq – write and quite :q! – quite wo save

visual mode

e – select the word d – delete=cut selected y – paste p – paste

more info at www.openvim.com/

My favorite terminal commands

cat

redirect to standart ouptut

alias | grep git

outut alias list

top, htop, ps aux

show process list

nmap localhost

check opened ports

history | grep ssh

check typed commands history

scp ac:~/dump.sql .

copy from remote server

scp ~/examples.desktop ac:~/

Copy to remote server

Additional info

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment