AustinLeath
User since Nov 17, 2022
107 Posts
Recent Posts
import concurrent.futuresimport requestsimport timeimport loggingimport urllib3# Disable SSL warningsurllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)# URL of the API endpointurl = "https://compile.codecatch.net/compile/code"# Payload to be sent in the POST requestpayload = {"language": "python","content": "print(\"test\")"}headers = {"Content-Type": "application/json","Authorization": "Bearer xyz"}# init logging with basic configlogging.basicConfig(level=logging.INFO, format='%(asctime)s - %(levelname)s - %(message)s')# Function to send a POST requestdef send_post_request():response = requests.post(url, json=payload, headers=headers, verify=False)return response.status_code# Number of requests to sendnum_requests = 1000 # You can adjust this number as needed# Function to perform the load testdef load_test():start_time = time.time()success_count = 0total_duration = 0with concurrent.futures.ThreadPoolExecutor(max_workers=50) as executor:futures = [executor.submit(send_post_request) for _ in range(num_requests)]for future in concurrent.futures.as_completed(futures):try:status_code = future.result()if status_code == 200:success_count += 1total_duration = time.time() - start_timelogging.info(f"Request completed with status code: {status_code}")except Exception as e:logging.error(f"Request generated an exception: {e}")requests_per_second = success_count / total_durationlogging.info(f"Total successful requests: {success_count}")logging.info(f"Total duration: {total_duration} seconds")logging.info(f"Requests per second: {requests_per_second}")if __name__ == "__main__":load_test()
# default to using syslog. /etc/rsyslog.d/45-frr.conf places the log# /var/log/frr/frr.log## Note:# FRR's configuration shell, vtysh, dynamically edits the live, in-memory# configuration while FRR is running. When instructed, vtysh will persist the# live configuration to this file, overwriting its contents. If you want to# avoid this, you can edit this file manually before starting FRR, or instruct# vtysh to write configuration to a different file.#log syslog informationalhostname UDM-SEfrr defaults datacenterlog file stdoutservice integrated-vtysh-config!!router bgp 65001bgp router-id 172.16.72.254neighbor 172.16.72.1 remote-as 65000neighbor 172.16.72.1 default-originate!address-family ipv4 unicastredistribute connectedredistribute kernelneighbor V4 soft-reconfiguration inboundneighbor V4 route-map ALLOW-ALL inneighbor V4 route-map ALLOW-ALL outexit-address-family!route-map ALLOW-ALL permit 10!line vty!
{"postId": "93d3dc33-cf39-48e0-8a7e-2d72a0f33847","descriptionGeneratedTime": "2024-09-26T05:34:44.737Z","description": "**Description:**\n\nThis Pascal code is a simple \"Hello, World!\" program. It uses the `writeln` function to print \"Hello, World!\" to the console and then ends the program.\n\n**Improvement Insights:**\n\n1. **Add Comments:** Although the code is straightforward, adding comments can make it more readable and easier to understand, especially for beginners.\n\n Improved version:\n ```pascal\n program HelloWorld;\n begin\n // Print \"Hello, World!\" to the console\n writeln('Hello, World!');\n end.\n ```\n\n2. **User Interaction:** To make the program more interactive, you could modify it to accept user input before printing the message.\n\n Improved version:\n ```pascal\n program HelloWorld;\n uses\n sysutils;\n var\n userName: string;\n begin\n // Prompt user to enter their name\n writeln('Please enter your name:');\n readln(userName);\n // Greet the user\n writeln('Hello, ' + userName + '!');\n end.\n ```"}
CLIENT_VPN_ID="cvpn-endpoint-xxxxxxxxxxxx"for region in $(aws ec2 describe-regions --query "Regions[].RegionName" --output text); doecho "Searching in region: $region"aws ec2 describe-client-vpn-endpoints --region $region --query "ClientVpnEndpoints[?ClientVpnEndpointId=='$CLIENT_VPN_ID']" --output tabledone
program HelloWorld;beginwriteln('Hello, World!');end.
from collections import defaultdictfaceValues = [1, 2, 3, 4, 5, 6]sums = defaultdict(int)for i in range(6):for j in range(6):sums[faceValues[i] + faceValues[j]] += 1print('sum', 'count')for key in sorted(sums.keys()):print(f'{key:0>2}: {sums[key]}')
Post Statistics
Posts
No Posts Found
It looks like AustinLeath has no public posts
Likes
Please Log In
You must be authenticated to view a user's likes
Profile Privacy
Multi-Factor Authentication
Multi-Factor Authentication (MFA) is an authentication method that requires you to provide two or more verification factors to gain access to your account. In addition to username and password, MFA requires you to verify your email on every login, which decreases the likelihood of someone stealing your account.
Change Password
Identity Color
Changes the color of your profile icon and cursor highlight in the live code editor. You and other users will be able to view this change.
Delete Account
Deleting your account is permanent. All data associated with your account will be lost.