CREATE LOGIN [username] WITH PASSWORD = 'password', DEFAULT_DATABASE = [database_name]
GO
USE database_name;
CREATE USER username FOR LOGIN username;
GO
GRANT SELECT TO username
GO
To remind unique and useful source code
CREATE LOGIN [username] WITH PASSWORD = 'password', DEFAULT_DATABASE = [database_name]
GO
USE database_name;
CREATE USER username FOR LOGIN username;
GO
GRANT SELECT TO username
GO
1. ubah atau clone dari gitlab dengan ssh url
git remote set-url origin {url_ssh}
2. buat ssh key di server cpanel jika belum ada :
ssh-keygen -t ed25519 -C "youremailaddress@domain.tld DAY-MONTH-YEAR" -f ~/.ssh/my_key
3. bikin file config di ~/.ssh
diisi :
Host remote-git-repo-domain.tld
IdentityFile ~/.ssh/my_key
copas ssh self to server
cat ~/.ssh/id_rsa.pub | ssh root@ip_address "cat >> ~/.ssh/authorized_keys"
Contoh Controller :
Contoh View
Backup :
sudo pg_dump -U {user} -h {host} {db_name} > /{path}/{file}.sql
Restore :
psql -U {user} -h {host} {db_name} < /{path}/{file}.sql
Catatan Docker Command :
login
docker login registry.gitlab.com
docker images
docker pull registry.gitlab.com/aksiteknologi/etos:latest
docker run -p 80:80 -d --name <container_name> <url_images>
docker image prune --filter="dangling=true"
docker stop <container_name>
docker rm <container_name>
untuk melihat container di dalam docker
#docker ps
untuk masuk dalam container
#docker exec -it <nama-container> bash
#apache
sudo docker stop <nama-container>
sudo docker rm <nama-container>
sudo sh -c 'nohup mysql -h127.0.0.1 --user=root --password=xxxx -f -D db_name < db_file.sql 1>stdout_output.txt 2>stderr_output.txt &'
Docker ERROR Debugging
$ /home/gitlab-runner/nganu
$ docker-compose logs nginx -f
cek log container
docker container logs -f <container-name>
=====
gitlab-runner verify
sudo apt remove docker-compose -y
sudo curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
sudo ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose
docker-compose --version
gitlab-runner restart
gitlab-runner status
cat /etc/gitlab-runner/config.toml