-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSample Secrets.txt
96 lines (66 loc) · 2.06 KB
/
Sample Secrets.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
91
92
93
94
95
# Example One
import requests
API_TOKEN = "ATCTT3xFfGN0z4AQmYoXKUTlcZMKjS_QktL8mBHHrz7r5A_AEK5ulPbLvObzS9YLvX6uKdR1lV8lHfpsodhQiDMtkLqij5Md2lRwXQAZ0CDhN5R-0KhkP_Oi0nhgOzh0ed3wOSEUPhI78iF2jRFnCIQ1KDroo9e7HDvDzSQ1JsOjhVxxVN8QcJw=DB89F672"
def fetch_data():
headers = {"Authorization": f"Bearer {API_TOKEN}"}
response = requests.get("https://api.example.com/data", headers=headers)
return response.json()
data = fetch_data()
print(data)
# Example Two
const axios = require('axios');
const digitalocean_pat = "doo_v1_4ea90994efe8999d0892b4469bc754a44c656f8e843361e1e4d1cd04ac85c381";
async function getDroplets() {
try {
const response = await axios.get('https://api.digitalocean.com/v2/droplets', {
headers: {
'Authorization': `Bearer ${digitalocean_pat}`
}
});
console.log(response.data);
} catch (error) {
console.error("Error fetching droplets:", error);
}
}
getDroplets();
# Example Three
<?php
$server = "localhost";
$username = "admin";
$app_password = 'Adm1n4cce55ForR@el';
$database = "my_database";
$conn = new mysqli($server, $username, $app_password, $database);
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
echo "Connected successfully to the database";
$conn->close();
?>
# Example Four
require 'net/http'
require 'json'
HF_TOKEN = "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"
uri = URI("https://api.huggingface.co/models/some-model")
request = Net::HTTP::Get.new(uri)
request["Authorization"] = "Bearer #{HF_TOKEN}"
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http|
http.request(request)
end
puts JSON.parse(response.body)
# Example Five
package main
import (
"database/sql"
"fmt"
"log"
_ "github.com/go-sql-driver/mysql"
)
const dsn = "mysql://root:Q4vF1ntgh5gt$@MyInternalService/SignIn/action"
func main() {
db, err := sql.Open("mysql", dsn)
if err != nil {
log.Fatalf("Failed to connect to the database: %v", err)
}
defer db.Close()
fmt.Println("Successfully connected to the database!")
}