|
Miscellaneous scripts
This repository contains miscellaneous scripts that does not fit in one repository, yet I will use them sometimes for my personal use. Note that some of the scripts might contain hardcoded paths and opinionated presets, and you are advised to inspect them before actually using.
|
Go to the source code of this file.
Namespaces | |
| namespace | webtunnel |
Functions | |
| webtunnel._iter_log_lines (str log_dir, str filename_glob) | |
| list[dict] | webtunnel.extract_ips (str log_dir, str filter_path, str filename_glob='access.log *') |
| str | webtunnel.format_bytes (int n) |
| pd.DataFrame | webtunnel.get_geolocation_data (list[str] ips, str db_path) |
| None | webtunnel.plot_map (pd.DataFrame df, str output_file) |
| None | webtunnel.print_summary (list[dict] records, pd.DataFrame df, str focus_country) |
Variables | |
| str | webtunnel.DB_PATH = 'GeoLite2-City.mmdb' |
| str | webtunnel.FOCUS_COUNTRY = 'Russia' |
| list[dict] | webtunnel.ip_list = extract_ips(LOG_DIR, SEARCH_PATH) |
| pd.DataFrame | webtunnel.location_data = get_geolocation_data([r['ip'] for r in ip_list], DB_PATH) |
| str | webtunnel.LOG_DIR = 'nginx' |
| str | webtunnel.OUTPUT_IMAGE = 'ip_map.png' |
| str | webtunnel.SEARCH_PATH = '/yUNshbl1fOXngs4JRBkrJIFU' |