Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update start.py - Proxy Check Profress, Recommend Tool #582

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

DanHouseman
Copy link

Multiple Updates to start.py Script

Proxy Evaluation Progress Reporting

What Was Added

  • Implemented a progress reporting mechanism during proxy evaluation to display the number of proxies checked out of the total number of proxies.
  • Provides real-time feedback on the status of the proxy checking process.

Implementation Details

New Function check_proxies_with_progress

  • A new function wrapper around the existing proxy checking logic.
  • Uses a Counter object and a Lock to safely update and display progress from multiple threads.
  • Iterates over the proxies using a ThreadPoolExecutor and updates the progress after each proxy is checked.

Logging Progress

  • Added logging statements within a locked context to ensure thread safety.
  • Progress is logged using the logger.info method to output messages like "Checked x/y proxies".

Integration with handleProxyList

  • Replaced the original proxy checking call with check_proxies_with_progress to incorporate progress reporting.
  • Ensured that the total number of proxies and the threads count are appropriately passed to the function.

System Evaluation Tool

What Was Added

  • Introduced a new console command RECOMMEND within the ToolsConsole class.
  • This command evaluates the system's CPU and memory to recommend optimal performance settings, such as the maximum number of threads to use for attacks.

Implementation Details

New Method recommend

  • Added a recommend static method to the ToolsConsole class.
  • Utilizes the psutil library to retrieve system information:
    • CPU core count (cpu_count).
    • Total physical memory (virtual_memory).
  • Calculates the recommended number of threads based on:
    • The number of CPU cores (e.g., 100 threads per core).
    • Adjustments if the total memory is less than a certain threshold (e.g., 4 GB).

Console Integration

  • Updated the runConsole method to include the RECOMMEND command.
  • When the user types RECOMMEND, the script outputs the system information and recommendations.

Additional Adjustments and Fixes

Improved Thread Safety

  • Ensured that shared resources are accessed in a thread-safe manner using locks.
  • Prevented race conditions during progress updates.

Logging Enhancements

  • Adjusted logging levels to ensure that progress messages and recommendations are visible to the user.
  • Used logger.info for standard messages and logger.debug for more detailed output.

Error Handling

  • Enhanced error handling during proxy checking to catch exceptions without stopping the entire process.
  • Logged exceptions for debugging purposes.

Optimizations

  • Adjusted the frequency of progress updates to prevent overwhelming the console with messages.
  • Used a progress interval to log updates at certain checkpoints (e.g., every 1% of proxies checked).

Proxy Evaluation Progress Reporting,
System Evaluation Tool,
Additional Adjustments and Fixes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant