Skip to content

Instantly share code, notes, and snippets.

View hoochiecoo's full-sized avatar

Anatoly hoochiecoo

View GitHub Profile
import telebot
import gspread
from google.oauth2.service_account import Credentials
# Google Sheets credentials and setup
scopes = ["https://www.googleapis.com/auth/spreadsheets"]
creds = Credentials.from_service_account_file("credentials.json", scopes=scopes)
client = gspread.authorize(creds)
sheet_id = ""
modules:
jmeter:
path: ~/.bzt/jmeter-taurus/bin/jmeter
download-link: https://archive.apache.org/dist/jmeter/binaries/apache-jmeter-5.4.2.zip
version: 5.4.2
fix-jars: true
execution:
- concurrency: 1
hold-for: 1m
@hoochiecoo
hoochiecoo / 1.yml
Created July 11, 2024 13:06
blazemeter petstore
modules:
jmeter:
path: ~/.bzt/jmeter-taurus/bin/jmeter
download-link: https://archive.apache.org/dist/jmeter/binaries/apache-jmeter-5.4.2.zip
version: 5.4.2
fix-jars: true
execution:
- concurrency: 1
hold-for: 1m
// Initialize variables to hold peer connections and data channels
let pc1, pc2, dc1, dc2;
// Function to start the connection process for peer 1 (Offerer)
async function startPeer1() {
pc1 = new RTCPeerConnection();
// Create data channel for peer 1
dc1 = pc1.createDataChannel('channel');
@hoochiecoo
hoochiecoo / webrt-console.js
Created July 4, 2024 14:59
work in console
// Initialize variables to hold peer connections and data channels
let pc1, pc2, dc1, dc2;
// Function to start the connection process for peer 1 (Offerer)
async function startPeer1() {
pc1 = new RTCPeerConnection();
// Create data channel for peer 1
dc1 = pc1.createDataChannel('channel');
@hoochiecoo
hoochiecoo / collapse.js
Created June 28, 2024 08:51
collapse all xpath elements
// Select all elements matching the XPath expression
const xpathExpression = '//*[@fill="var(--markmap-circle-open-bg)"]';
const matchingElements = document.evaluate(xpathExpression, document, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null);
// Iterate through each matching element and simulate a click
for (let i = 0; i < matchingElements.snapshotLength; i++) {
const element = matchingElements.snapshotItem(i);
// Check if the element is an interactive element or has a click event handler
if (element.tagName.toLowerCase() === 'a' || element.tagName.toLowerCase() === 'button' || typeof element.click === 'function') {
alert('HEY ONE BUBA')
sudo launchctl load -w /Library/LaunchDaemons/org.openvpn.client.plist
docker run --rm -it -p 8080:8080 theasp/novnc
Simpliest way to open VNC to selenoid:
localhost:4444 - selenoid server
2a398b1d73ca57e2559ad4ca785abae3 - your session id
https://novnc.com/noVNC/vnc.html?host=localhost&port=4444&path=vnc/2a398b1d73ca57e2559ad4ca785abae3&password=selenoid
@hoochiecoo
hoochiecoo / hooks.py
Created February 27, 2024 10:25
saving screenshot to html using embed custom def
import base64
def before_all(context):
def embed_data(mime_type, data, caption):
# If data is empty we want to finish html tag with at least one character
non_empty_data = " " if not data else data
for formatter in context._runner.formatters:
if "html" in formatter.name:
formatter.embedding(mime_type=mime_type, data=non_empty_data, caption=caption)
return