-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstrux.txt
90 lines (65 loc) · 1.99 KB
/
instrux.txt
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
connect to your instance
ssh -i .\Hackathon29.pem ec2-user@<your server id>.eu-central-1.compute.amazonaws.com
NGINX
install nginx
sudo yum install nginx
check if installed
nginx -v
run the service
sudo systemctl start nginx.service
check if it is running
sudo systemctl status nginx.service
Edit the file that should be vissible in browser
sudo vi /usr/share/nginx/html/index.html
connect to your instance (we have only http)
http://ec2-3-79-150-211.eu-central-1.compute.amazonaws.com/
NODEJS
please use
sudo su to install node with proper priviledges
this hould appear in your console
[root@ip-...............]
https://docs.aws.amazon.com/sdk-for-javascript/v2/developer-guide/setting-up-node-on-ec2-instance.html
you can test with simple script
/////////////////////////////////
var http = require('http');
//create a server object:
http.createServer(function (req, res) {
res.write('** Hackathon mode is on !!!! **'); //write a response to the client
res.end(); //end the response
}).listen(80); //the server object listens on port 80
/////////////////////////////////
PYTHON
sudo su -
install python
yum install python
verivy working:
python3 -m http.server 80 --bind 0.0.0.0
To check your api key
--> [5:52 PM] Sebastian Edenberg
sk--------------------------
curl https://api.openai.com/v1/chat/completions -H "Content-Type: application/json" -H "Authorization: Bearer sk-------------------" -d '{
"model": "gpt-4",
"messages": [
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "Hello!"
}
]
}'
curl https://api.openai.com/v1/chat/completions -H "Content-Type: application/json" -H "Authorization: Bearer sk------------------------------" -d '{
"model": "gpt-4",
"messages": [
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "Tell me a riddle!!"
}
]
}'