\# src(me) -> dest
iptables -A OUTPUT -p tcp --match multiport --dports 80,443 -d 10.11.12.55 -j ACCEPT -m comment --comment 'X-tee turvaserver'
\# dst -> src(me)
iptables -A INPUT -p tcp --match multiport --dports 80,443 -s 10.11.12.55 -j ACCEPT -m comment --comment 'X-tee turvaserver'
\# list by line numbers
iptables -L --line-numbers
\# reegli nr 24 kustutamine
iptables -D INPUT 24
\# reegli lisamine reale 53
iptables -I OUTPUT 53 -p tcp --match multiport --dports 80,443 -d 10.11.12.55 -j ACCEPT -m comment --comment 'X-tee turvaserver'
# macOS / OS X
##### Mac install sshpass
```
brew tap esolitos/ipa
brew install sshpass
```
##### Vagrant bash completion
`brew install vagrant-completion`
add to .bash\_profile:
```
if [ -f `brew --prefix`/etc/bash_completion.d/vagrant ]; then
source `brew --prefix`/etc/bash_completion.d/vagrant
fi
```
##### Ignore .DS\_Store globally
`echo ".DS_Store" > ~/.gitignore_global`
`git config --global core.excludesfile ~/.gitignore_global`
##### Update macOS DB File
`/usr/libexec/locate.updatedb`
##### Launch VS Code from Terminal
In VS Code do `- docker - [https://docs.docker.com/docker-for-mac/install/](https://docs.docker.com/docker-for-mac/install/)
- iterm2 - [https://iterm2.com/](https://iterm2.com/)
- fork - [https://git-fork.com/](https://git-fork.com/)
- homebrew - [https://brew.sh/](https://brew.sh/)
- postman - [https://www.postman.com/](https://www.postman.com/)
- skype - [https://www.skype.com/en/get-skype/](https://www.skype.com/en/get-skype/)
- skype for business - [https://www.microsoft.com/en-us/download/details.aspx?id=54108](https://www.microsoft.com/en-us/download/details.aspx?id=54108)
- visual studio code - [https://code.visualstudio.com/download](https://code.visualstudio.com/download')
#### Install with brew
##### ansible
`brew install ansible`
##### vagrant
`brew tap hashicorp/tap`
`brew install vagrant`
##### ansible-lint
`brew install ansible-lint`
##### bash-completion
[https://sourabhbajaj.com/mac-setup/BashCompletion/](https://sourabhbajaj.com/mac-setup/BashCompletion/)
##### vagrant-completion
`brew install vagrant-completion`
```
if [ -f `brew --prefix`/etc/bash_completion.d/vagrant ]; then
source `brew --prefix`/etc/bash_completion.d/vagrant
fi
```
##### sshpass
`brew tap esolitos/ipa`
`brew install sshpass`
##### terraform and terragrunt
`brew install terraform terragrunt`
#### htop
brew install htop
##### wget
brew install wget
##### whois
brew install whois
#### Install from App Store
- rocketchat
#### Backup
```
export PC_NAME=nimi && \
cd ~ && \
tar -zcf $PC_NAME-downloads-`date +"%Y-%m-%d_%H-%M"`.tar.gz ~/Downloads/ && \
tar -zcf $PC_NAME-desktop-`date +"%Y-%m-%d_%H-%M"`.tar.gz ~/Desktop/ && \
tar -zcf $PC_NAME-lab-`date +"%Y-%m-%d_%H-%M"`.tar.gz ~/LAB/
```
# Mounting
Get info of the disk(s)
```
fdisk -l
ls -l /dev/disk/by-uuid/
```
Manual USB mount
```
mount /dev/sdb1 /mnt/usb-ssd -o uid=qrl,gid=qrl,iocharset=utf8,nofail
```
Auto USB mount ( /etc/fstab )
```
UUID=6403-240D /mnt/usb-ssd exfat uid=qrl,gid=qrl,iocharset=utf8,nofail 0 0
```
Auto NAS mount ( /etc/fstab )
```
//192.168.1.109/usbdisk1 /mnt/nas-usb cifs username=qrl,password=qrl,iocharset=utf8,uid=1001,gid=1002,nofail 0 0
```
# Network
Newer Debian
```
resolvectl status
service systemd-resolved restart
```
Older Debian
```
systemd-resolve --status
systemctl restart systemd-resolved.service
```
# OpenSSL
##### Get sha256 fingerprint of cert
```
openssl x509 -noout -sha256 -fingerprint -in