-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathREADME.txt
More file actions
119 lines (104 loc) · 4.77 KB
/
README.txt
File metadata and controls
119 lines (104 loc) · 4.77 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
Anna Arroyo and Nikki Thanapaisal
package.json:
https://docs.npmjs.com/cli/v7/configuring-npm/package-json#dependencies
Gitlab set up:
GIT_SSL_NO_VERIFY=true git clone http://easel3.cs.utsarr.net/iaf873/cs4783-project-spring2021.git
If you want to get rid of 'GIT_SSL_NO_VERIFY=true':
git config http.sslVerify "false"
Creating a branch:
git checkout -b "name of branch"
Merging to master:
git checkout master
git merge "name of branch you want to merge"
Push new changes to remote:
GIT_SSL_NO_VERIFY=true git push origin master
If you messed up the password part:
Go to > Control Panel\User Accounts\Credential Manager > Manage Windows Credentials and remove all generic credentials involving Git.
Set up SSH key
https://www.youtube.com/watch?v=mNtQ55quG9M
SSL set up:
https://flaviocopes.com/express-https-self-signed-certificate/
DB setup:
https://codeforgeek.com/nodejs-mysql-tutorial/
https://flaviocopes.com/express-get-query-variables/
https://expressjs.com/en/api.html#req
SSH: (do it step by step)
keypairs gen -> gitlab https://www.youtube.com/watch?v=svRWcx7dT8g
virtual server:
1. ssh-keygen -> enter file name (press enter)-> skip passphrase specifically for that keypairs (press enter twice)
2. cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys (this helps ssh in the virtual server find your public keys)
3. (this is not required but this will fix ssh issue if doesnt work)
eval $(ssh-agent -s)
ssh-add <directory to private SSH key>
chmod 700 .ssh/
gitlab:
add public key .pub to your gitlab account
ssh using private key:
explaination: youtube.com/watch?v=mNtQ55quG9M
1. put your private key that you have generated in virtual machine into ~/.ssh of local
2. (this is not required but this will fix ssh issue if doesnt work)
eval $(ssh-agent -s)
ssh-add <directory to private SSH key>
chmod 700 .ssh/
3. ssh -i ~/.ssh/privatekeyfile abc123@10.100.201.3
ssh config file:
add a ~/.ssh/config entry
here is mine
Host easel3.cs.utsarr.net
User git
Preferredauthentications publickey
IdentityFile ~/.ssh/fru574_gitlab
that is what is in my .ssh/config file for my student account fru574 on easel4
https://linuxize.com/post/using-the-ssh-config-file/
connect:
https://10.100.201.3:12036/hello
pm2 start start.sh
pm2 stop 0
Security testing:
OWASP ZAP
OWASP Mutillidae
Docker:
https://www.youtube.com/watch?v=JSLpG_spOBM
https://www.docker.com/101-tutorial
https://docker-curriculum.com/
Windows:
https://docs.docker.com/docker-for-windows/install/
install WSL -> pick linux distributor -> change WSL version to 2 -> install docker normally
Commands:
create: docker run -dit ubuntu:latest
start: docker start id
stop: docker stop id
remove: docker rm -f id
Show containers: docker ps
Show all stopped/running container(not remove): docker pw -a
Show images: docker images
Show full ID: docker inspect --format="{{.Id}}" container_name
run bash in docker container: docker exec -it containerIDshort bash
create new image with exisitng container that has generic ubuntu image: docker commit id newname
tagging: docker tag localImageName dockerhub/link -> docker login -> docker push dockerhub/link
build with dockerfile: docker build . -t newnameofimage
*after build image with docker file you can run it
dockerfile:
https://docs.docker.com/develop/develop-images/dockerfile_best-practices/
Volume:
https://phoenixnap.com/kb/docker-volumes
create: docker volume create name
list: docker volume list
delete: docker volume rm name
info: docker inspect name
delete all volume(dangerous): docker volume prune
create container and connect to volume: docker run -dit --mount souce=VolumneName, destination=/VolumneName imageName
*you can mount volume to multilple containers, even if containers are gone, volume will be ok!
*you can also mount host dir as a volume
see container logs: docker logs id
DB:
docker run -d -p 3306:3306 -e MYSQL_ROOT_PASSWORD=hello --mount source=db,destination=/var/lib/mysql mariadb
*you can shell into mariadb
*specifice in dockerfile if you have db config ready to copy it over
prune everything except volumes: docker system prune -a
compose:
https://docs.docker.com/compose/
docker-compose up -d
docker-compose down
docker secret:
https://docs.docker.com/engine/swarm/secrets/