DevOps Tools and Documentation. If your desktop using windows, download and install git-scm. Use terminal or git bash for the next section.
Please make sure your server or desktop has SSH key. To check it please do this command :
cat ~/.ssh/id_rsa.pub
if there is no key appears, plese generate the key also set global config of git and please add the public key to your github profile.
ssh-keygen -t rsa -b 4096 -C "rolly@awang.ga"
git config --global user.email "rolly@awang.ga"
git config --global user.name "Rolly Maulana Awangga"
cat ~/.ssh/id_rsa.pub
Mounting drive and generate ssh
import os
from google.colab import drive
drive.mount('/content/drive')
folder = '/content/drive/My Drive/SK2/fix/siabre'
savedir=folder
os.chdir(savedir) #change dir
!pwd
generate ssh key, add github.com host, and backup key to current folder for next future use
!ssh-keygen -t rsa -b 4096 -C "rolly@awang.ga"
!git config --global user.name "Rolly Maulana Awangga"
!git config --global user.email rolly@awang.ga
!ssh-keyscan -t rsa github.com >> ~/.ssh/known_hosts
!cat ~/.ssh/id_rsa.pub
!cp -R /root/.ssh/ ./ssh/
for next use just
!cp -R ./ssh/ /root/.ssh/
clone and change dir
!git clone url
os.chdir('/content/drive/My Drive/SK2/fix/siabre')
Please create git repo first and copy ssh uri, for example :
git@github.com:awangga/crot.git
use it in replace with : git remote add origin Go to your website folder for example in : /var/www/html/siap
cd /var/www/html/siap
git init
git commit -m "first commit"
git remote add origin git@github.com:awangga/crot.git
git pull origin main --allow-unrelated-histories
git push origin main
If database name is dbname then, On Source Server :
mysqldump -u root -p --opt dbname > dbname.sql
scp dbname.sql user@192.168.1.219:~/
then go to target server:
ssh user@192.168.1.219
mysql -u root -p dbname < dbname.sql
Using git bash create yout key, you dont have to do this if you already have a key
ssh-keygen -t rsa -b 4096 -C "rolly@awang.ga"
send key to the server
cat ~/.ssh/id_rsa.pub | ssh usernya@hostnya.com 'cat >> .ssh/authorized_keys'
ssh into server and change permission
chmod 700 .ssh; chmod 640 .ssh/authorized_keys
Check Disk Usage
sudo du -hc --max-depth=1 /