notes

#Проверка файлов на одинаковые:

#Проверить и удалить двойные:

pi ~ $ fdupes -r -d -N /mnt/HD4/



#linux terminal games:

pi ~ $ sudo apt install bastet pacman4console nsnake greed moon-buggy



#Raspberry Login and Password:

Login: pi

Password: raspberry



#Raspberry config menu:

sudo raspi-config



#Зашифрованные пароли:

pi ~ $ sudo apt-get install apg -y

pi ~ $ apg -a 1 -m 128



#Настройка обновления одной строкой:

#Debian:

root ~ $ echo "alias sysupgrade='sudo apt-get update; sudo apt-get dist-upgrade -y'" >> ~/.bashrc

root ~ $ source ~/.bashrc

root ~ $ sysupgrade


#Centos:

root ~ $ echo "alias sysupgrade='sudo yum update -y'" >> ~/.bashrc

source ~/.bashrc

root ~ $ sysupgrade


#Manjaro:

echo "alias sysupgrade='sudo pacman -Syyu'" >> ~/.bashrc

source ~/.bashrc

sysupgrade



System Info:

pi ~ $ sudo inxi -Fxz



#Перечень дисков по uuid:

pi ~ $ ls -l /dev/disk/by-uuid/



#fstab монтирование со всеми зависимостями:

UUID=0F31-2878 /mnt/usb1 vfat auto,nofail,sync,users,rw,umask=777 0 0



#SSH:

#залить публичный ключ на сервер:

pi ~ $ scp ~/.ssh/id_rsa.pub root@192.168.0.21:~/.ssh/authorized_keys


#WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!:

pi ~ $ ssh-keygen -f "/root/.ssh/known_hosts" -R "192.168.0.2"

pi ~ $ ssh-keygen -R "you server hostname or ip" "



#scp ssh copy

scp -r root@137.240.0.0:/var/www root@138.76.0.0:/var/www

scp -r root@138.160.0.0:/var/www /home/rootone/www

rsync -avzrhe ssh --progress root@137.1.0.0:/var/www /home/rootone/www



#SSH /etc/ssh/ssh.config


Host dd

HostName 192.168.0.2

User root


Host dl

HostName 192.168.0.1

User root



#bash цвета


PS1='\[\e[0;32m\]\u\[\e[m\] \[\e[1;34m\]\w\[\e[m\] \[\e[1;32m\]\$\[\e[m\] \[\e[1;37m\]'


PS1="\[\e[32m\][\[\e[m\]\[\e[31m\]\u\[\e[m\]\[\e[33m\]@\[\e[m\]\[\e[32m\]\h\[\e[m\]:\[\e[36m\]\w\[\e[m\]\[\e[32m\]]\[\e[m\]\[\e[32;47m\]\\$\[\e[m\] "


PS1="[\[\e[1;34m\]$WINDOW\[\e[0m\]:\[\e[1;$UCOL\]\$(sens)\[\e[0m\]$SEP\u@\[\e[1;$ENV\]\h.$ENAME\[\e[0m\]:\[\e[1;31m\]\$(get_branch)\[\e[0m\] \w]\\$"


PS1=">\[\033[s\]\[\033[1;\$((COLUMNS-5))f\]\$(date +%H:%M)\[\033[u\]"



#TERMINAL 256 Colors

root ~ $ apt-get install ncurses-term

edit .bashrc - add this line the end:

export TERM=xterm-256color

Reload your .bashrc by typing

root ~ $ tput colors



#export term

export LANG=ru_RU.UTF-8

export LC_LANG=ru_RU.UTF-8

export LANGUAGE=ru_RU.UTF-8



#proton vpn


pi ~ $ sudo apt install -y openvpn dialog python3-pip python3-setuptools


pi ~ $ sudo pip3 install protonvpn-cli


pi ~ $ sudo protonvpn init


pi ~ $ sudo protonvpn status


pi ~ $ sudo protonvpn c --cc [countrycode]


pi ~ $ sudo protonvpn c -f #(Connect to the fastest server)


pi ~ $ sudo protonvpn disconnect #(Disconnect the current session)



#weather in terminal


pi ~ $ curl wttr.in/Berlin



#samba

sudo apt-get install samba samba-common-bin

sudo sudo mkdir -m 1777 /home/pi/pishare

sudo nano /etc/samba/smb.conf


[global]

workgroup = WORKGROUP

netbios name = pi server

string = files pi

guest account = nobody

map to guest = Bad User


[files pi4]

comment = pi4

path = /home/pi/pishare

browseable = Yes

guest ok = Yes

public = yes


sudo smbpasswd -a pi

sudo /etc/init.d/samba restart



#internet speed test


pi ~ $ sudo speedtest-cli


#If you can dream it, you can do it ;)