|
lsb_release -a
|
get current version of os
|
|
service <name of service> start/stop/restart/status
|
self explanatory
|
|
sudo apt-get update
|
|
sudo apt-get install git
|
|
sudo apt install net-tools
|
|
sudo apt install vim
|
|
sudo apt update
|
(server) update package repository
|
|
sudo apt install openssh-server
|
(server) install ssh
|
|
sudo systemctl status ssh
|
(server) check status of service
|
|
sudo ufw allow ssh
|
(server) enable firewall
|
|
sudo systemctl enable ssh
|
(server) start ssh upon boot
|
|
ssh-keygen
|
(client) create key pair
|
|
ssh-copy-id username@remote_host
|
(linux) copy public key
|
|
ssh <user>@<ip>
mkdir -p /.ssh sudo nano /.ssh/authorized_keys <copy content of .pub file> |
(windows) copy public key
|
|
sudo chown -R <user>:<user> ~/.ssh/authorized_keys
|
set ownership of key file
|
|
chmod 700 /home/username/.ssh
chmod 600 ~/.ssh/authorized_keys |
(server) set permissions
|
|
ssh <user>@<ip> -i <full path of private key>
|
(client) connect
|
|
open C:\Users\<username>\.ssh\config
add entry for ip address |
(windows) add entry into ssh config
|
|
sudo apt-get install xfce4
|
|
sudo apt-get install xrdp
|
|
sudo systemctl enable xrdp
|
|
echo xfce4-session >~/.xsession
|
|
sudo service xrdp restart
|
|
sudo passwd rdpuser
|
|
sudo apt install redis-server
|
install
|
|
sudo nano /etc/redis/redis.conf
|
change to supervised systemd
|
|
sudo systemctl restart redis.service
|
|
|
sudo systemctl enable /lib/systemd/system/redis-server.service
|
|
|
~/.bash_history
|
contains history even after reboot
|
|
!v
|
run last command that starts with v
|
|
!$
|
last argument
|
|
!?etc
|
last command contains etc
|
|
history
|
show command history
|
|
cd .
|
change to home dir
|
|
!30
|
run command at line number 30 from history
|
|
ctrl-r
|
search commands, esc or enter to edit or run
|
|
HISTCONTROL=erasedups
|
erase duplicate commands from history
|
|
history -c + history -w
|
clear history
|
|
history -r
|
whenever you last wrote
|
|
shutdown
|
shutdown
|
|
reboot
|
reboot
|
|
poweroff
|
same as shutdown
|
|
halt
|
same as shutdown
|
|
init 0
|
same as shutdown
|
|
init 6
|
same as shutdown
|
|
shutdown -r +n "warning"
|
reboot in n minutes, display warning
|
|
shutdown -r now
|
reboot now
|
|
shutdown -c
|
cancel a pending shutdown
|
|
shutdown -h
|
shutdown and then halt
|
|
shutdown hh:mm
|
shutdown at specified time
|
No comments yet.
Cheatography n. The art of mapping complex subjects into clear, instantly navigable reference guides.