-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
2025-02-11 17:13:16.853057 new snippets
- Loading branch information
1 parent
35950ea
commit c4bf01b
Showing
17 changed files
with
1,587 additions
and
732 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
//date: 2025-02-11T16:49:54Z | ||
//url: https://api.github.com/gists/ab420b11b153844aa3613def8d239b51 | ||
//owner: https://api.github.com/users/xandersavvy | ||
|
||
package main | ||
|
||
import ( | ||
"fmt" | ||
"net" | ||
"sync" | ||
"time" | ||
) | ||
|
||
func scanPort(host string, port int, wg *sync.WaitGroup) { | ||
defer wg.Done() | ||
address := fmt.Sprintf("%s:%d", host, port) | ||
conn, err := net.DialTimeout("tcp", address, 1*time.Second) | ||
if err == nil { | ||
fmt.Printf("[+] Port %d is open\n", port) | ||
conn.Close() | ||
} | ||
} | ||
|
||
func main() { | ||
var host string | ||
var startPort, endPort int | ||
|
||
fmt.Print("Enter target host (IP or domain): ") | ||
fmt.Scanln(&host) | ||
fmt.Print("Enter start port: ") | ||
fmt.Scanln(&startPort) | ||
fmt.Print("Enter end port: ") | ||
fmt.Scanln(&endPort) | ||
|
||
var wg sync.WaitGroup | ||
|
||
for port := startPort; port <= endPort; port++ { | ||
wg.Add(1) | ||
go scanPort(host, port, &wg) | ||
} | ||
|
||
wg.Wait() | ||
} | ||
// Things to learn not from GPT 😂 | ||
/**** | ||
*printf just prints but Sprintf print and also return the formatted string which can be stored later | ||
*Waitgroup to add go routine so main function does not exit unless every go routine is resolved | ||
*net.DialTImeout to establish connection | ||
******/ | ||
/*** | ||
*Hey if you are here and have some development project please feel free to contact me on [email protected] | ||
****/ | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#date: 2025-02-11T17:09:28Z | ||
#url: https://api.github.com/gists/468a0ae55b280c7973243a029280d40d | ||
#owner: https://api.github.com/users/Zaryob | ||
|
||
bilateral_filtered = cv2.bilateralFilter(image, 9, 75, 75) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
#date: 2025-02-11T17:02:09Z | ||
#url: https://api.github.com/gists/aa582b938e1c3391f18c65af22ba79d0 | ||
#owner: https://api.github.com/users/Sdy603 | ||
|
||
import pandas as pd | ||
import requests | ||
import json | ||
|
||
# Load the CSV file | ||
file_path = 'df_getrunresults.csv' | ||
df = pd.read_csv(file_path) | ||
|
||
# Define the Custom Data API endpoint and API key | ||
API_ENDPOINT = 'https://yourinstance.getdx.net/api/customData.setAll' # Replace with the actual endpoint | ||
API_KEY = "**********" | ||
|
||
# Headers for the API request | ||
headers = { | ||
'Accepts': 'application/json', | ||
'Authorization': f'Bearer {API_KEY}', | ||
'Content-Type': 'application/json' | ||
} | ||
|
||
# Function to format the data as required by the Custom Data API | ||
def format_payload(row): | ||
return { | ||
"reference": f"{row['id']}", # Using id as part of the reference | ||
"key": f"status-{row['test_id']}", # Using test_id as the key | ||
"value": { | ||
"status_id": row['status_id'], | ||
"created_on": row['created_on'], | ||
"assignedto_id": row['assignedto_id'] if pd.notna(row['assignedto_id']) else None, | ||
"comment": row['comment'] if pd.notna(row['comment']) else "", | ||
"version": row['version'] if pd.notna(row['version']) else "N/A", | ||
"elapsed": row['elapsed'] if pd.notna(row['elapsed']) else "0", | ||
"defects": row['defects'] if pd.notna(row['defects']) else "None", | ||
"created_by": row['created_by'], | ||
"custom_step_results": row['custom_step_results'] if pd.notna(row['custom_step_results']) else None, | ||
"custom_chaos_testing_comments": row['custom_chaos_testing_comments'] if pd.notna(row['custom_chaos_testing_comments']) else None, | ||
"attachment_ids": json.loads(row['attachment_ids']) if pd.notna(row['attachment_ids']) else [] | ||
}, | ||
"timestamp": row['created_on'] | ||
} | ||
|
||
# Create the payload with all data | ||
payload = { | ||
"data": [format_payload(row) for index, row in df.iterrows()] | ||
} | ||
|
||
# Send the data to the API | ||
response = requests.post(API_ENDPOINT, headers=headers, json=payload) | ||
|
||
# Log the response | ||
if response.status_code == 200: | ||
print('Successfully sent data to the Custom Data API') | ||
else: | ||
print(f'Failed to send data: {response.status_code}, {response.text}') | ||
data: {response.status_code}, {response.text}') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#date: 2025-02-11T16:58:33Z | ||
#url: https://api.github.com/gists/cd530a0c185a799e624272dfd1092961 | ||
#owner: https://api.github.com/users/Zaryob | ||
|
||
# b) Dilation (Genişletme): Nesnelerin kenarlarına piksel ekleme. | ||
dilation = cv2.dilate(image, kernel, iterations=1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#date: 2025-02-11T16:57:35Z | ||
#url: https://api.github.com/gists/1f85cbd9d7db0666c6aa4b857085b701 | ||
#owner: https://api.github.com/users/Zaryob | ||
|
||
# a) Erosion (Aşındırma): Nesnelerin kenarlarından piksel kaybı sağlar. | ||
erosion = cv2.erode(image, kernel, iterations=1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#date: 2025-02-11T17:04:58Z | ||
#url: https://api.github.com/gists/998edbf13e78ae30922e7c7c40628144 | ||
#owner: https://api.github.com/users/Zaryob | ||
|
||
gaussian_blurred = cv2.GaussianBlur(image, (5, 5), 0) |
Oops, something went wrong.