{"id":20148427,"url":"https://github.com/stablecaps/netup_pydemo","last_synced_at":"2026-06-12T07:32:32.777Z","repository":{"id":197663386,"uuid":"699085494","full_name":"stablecaps/netup_pydemo","owner":"stablecaps","description":"A Python3 program to check network connectivity and suggest possible reasons for lost connectivity.","archived":false,"fork":false,"pushed_at":"2026-06-02T00:03:45.000Z","size":49950,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-02T02:08:36.108Z","etag":null,"topics":["demo"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/stablecaps.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2023-10-01T21:40:33.000Z","updated_at":"2024-01-23T21:10:13.000Z","dependencies_parsed_at":"2026-01-01T08:03:12.136Z","dependency_job_id":null,"html_url":"https://github.com/stablecaps/netup_pydemo","commit_stats":null,"previous_names":["stablecaps/netup_pydemo"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/stablecaps/netup_pydemo","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stablecaps%2Fnetup_pydemo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stablecaps%2Fnetup_pydemo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stablecaps%2Fnetup_pydemo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stablecaps%2Fnetup_pydemo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stablecaps","download_url":"https://codeload.github.com/stablecaps/netup_pydemo/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stablecaps%2Fnetup_pydemo/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34234557,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-12T02:00:06.859Z","response_time":109,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["demo"],"created_at":"2024-11-13T22:37:35.962Z","updated_at":"2026-06-12T07:32:32.760Z","avatar_url":"https://github.com/stablecaps.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# NetUp Demo - 2020 (A Timed Interview Test ~10 days)\n\n## Overview\n\nA Python3 program to check network connectivity and suggest possible reasons for lost connectivity. Tested working on Ubuntu 20.04.\n\nWrite a script using Python that:\n1. Determines the state of Internet connectivity.\n2. If a loss of connectivity is detected, determines the cause and reports it.\n3. For as many causes as possible, suggests a fix.\n4. Sets the script’s exit status to indicate whether or not Internet connectivity was present\n\n#### Note: This code has been written to showcase my Python3 dev skills, so yes, I went OTT! :)\n\n## Dependencies\n\nFormatting \u0026 colour works best with green on black background. With anything else, your mileage may vary!\n\n```\nTested on ubuntu 20.04\npython3.8\npython3.8-vemv\nroute (built into 20.04)\nnmcli (built into 20.04)\nnc (netcat)\ntraceroute\ndig\n```\n\n## Install\n```\nsudo apt install python3.8 python3.8-venv python3.8-venv netcat traceroute\n```\n\n```\npython3.8 -m venv venv\nsource venv/bin/activate\npip install -r requirements.txt\n```\n\n## Run all tests\n```\npytest\n\n```\n\n## Usage\n\n```\n# Launch publicip subroutine\npython netup_luncher.py publicip\n\n# Launch connection subroutine\npython netup_luncher.py connx\n\n# Launch dns server checker subroutine\npython netup_luncher.py dns\n\n# Launch traceroute subroutine\npython netup_luncher.py traceroute\n\n# Launch all routines\npython netup_luncher.py all\n\n# Launch all routines and force initial error so all routines are run\npython netup_luncher.py all --force true\n\n```\n\n### Simulating Failure:\n\n#### Trigger start of test routine:\n\n```\n\n## ~Change line 99 to:~\n~tcp_ping_commm = \"nc -vz -w 5 www.google.com 8080\"~\n\nnow use:\npython netup_luncher.py all --force true\n```\n\n#### Check connectivity\nDisconnect network connection\n\n#### Test local issue\nBlock TCP/UDP on router so at least one hop is made\n\n#### DNS fail\nhttps://serverfault.com/questions/776049/how-to-simulate-dns-server-response-timeout\nWhat you need is a \"black hole server\". You can use blackhole.webpagetest.org (72.66.115.13) which will silently drop all requests.\n\n\n## Things left to do\nQuite a fun test, but I would have liked a bit more time to thoroughly test the script so more definitive exit points (with status codes) could be made. This would involve testing connectivity via various protocols and figuring out how to implement that for testing.\n\nI would also have liked to write more tests to check the functionality of the program given enough time.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstablecaps%2Fnetup_pydemo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstablecaps%2Fnetup_pydemo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstablecaps%2Fnetup_pydemo/lists"}