for d in */; do
dir=${d%/}
if [ "$dir" == "containerd" ]; then
continue
fi
echo "Backing up $dir ..."
tar -pczf $dir.tar.gz $dir
done
for d in */; do dir=${d%/}; if [ "$dir" == "containerd" ]; then continue; fi; echo "Backing up $dir ..."; tar -pczf $dir.tar.gz $dir; done
rm *.tar.gz
As usual
Import SSH identities from Github
curl -L https://github.com/<username>.keys >> ~/.ssh/authorized_keys
sudo apt install ncdu
ncdu -r /opt
Generate the key:
ssh-keygen -t rsa -b 4096 -C "your_email@example.com"
ssh-keygen -t ed25519 -a 100 -C "your_email@example.com"
And upload to Github, or send directly to server with the following command:
ssh-copy-id user@host
To provent multiple passsword entry run (start the ssh-agent in the background):
ssh-agent -s
Add your SSH key to the ssh-agent
ssh-add ~/.ssh/id_rsa
ssh-add ~/.ssh/id_ed25519
https://code.visualstudio.com/docs/remote/troubleshooting#_quick-start-using-ssh-keys
$pubKey=(Get-Content "$HOME\.ssh\id_rsa.pub" | Out-String)
$pubKey=(Get-Content "$HOME\.ssh\id_ed25519.pub" | Out-String)
ssh "<user>@<host>" "mkdir -p ~/.ssh && chmod 700 ~/.ssh && echo '${pubKey}' >> ~/.ssh/authorized_keys && chmod 600 ~/.ssh/authorized_keys"
To provent multiple passsword entry run (make sure tools are available and start the ssh-agent in the background):
Get-Service -Name ssh-agent | Set-Service -StartupType Manual
Start-Service ssh-agent
Add your SSH key to the ssh-agent
ssh-add $HOME\.ssh\id_rsa
ssh-add $HOME\.ssh\id_ed25519
To find the files count
find . -type f -print | wc -l
Edit the following file:
nano /etc/sysctl.conf
And add: fs.inotify.max_user_watches=524288
at the end of the file (Will use up 540 MiB of memory).
Then load the changes with:
sysctl -p
https://docs.docker.com/install/linux/docker-ce/ubuntu/
apt remove docker docker-engine docker.io containerd runc
apt update
apt install apt-transport-https ca-certificates curl gnupg-agent software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add -
apt-key fingerprint 0EBFCD88
add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
apt update
apt install docker-ce docker-ce-cli containerd.io
docker run hello-world
usermod -aG docker $USER
https://docs.docker.com/compose/install/#install-as-a-container
curl -L "https://github.com/docker/compose/releases/download/1.25.5/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose
And to get autocompletion:
curl -L https://raw.githubusercontent.com/docker/compose/1.25.5/contrib/completion/bash/docker-compose -o /etc/bash_completion.d/docker-compose
Upload the compressed files back on the server
for backup in *.tar.gz; do
tar -pxzf "$backup";
done
for backup in *.tar.gz; do tar -pxzf "$backup"; done
rm *.tar.gz
netstat -anop | grep ":53\b"
https://github.com/pi-hole/docker-pi-hole#installing-on-ubuntu
sed -r -i.orig 's/#?DNSStubListener=yes/DNSStubListener=no/g' /etc/systemd/resolved.conf
mv /etc/resolv.conf /etc/resolv.conf.bak
ln -s /run/systemd/resolve/resolv.conf /etc/resolv.conf
systemctl restart systemd-resolved
touch traefik/acme.json
chmod 600 traefik/acme.json
docker network create traefik_proxy
cd /opt/<...>/
docker-compose up -d
Should show IP
nslookup google.com [pihole-server-ip]
Should say Address: 0.0.0.0
nslookup doubleclick.com [pihole-server-ip]
ipconfig /release
ipconfig /renew
ipconfig /flushdns