{"id":783,"date":"2021-11-21T21:42:19","date_gmt":"2021-11-21T21:42:19","guid":{"rendered":"https:\/\/blog.thomarite.uk\/?p=783"},"modified":"2021-11-21T21:42:19","modified_gmt":"2021-11-21T21:42:19","slug":"python-threads","status":"publish","type":"post","link":"https:\/\/blog.thomarite.uk\/index.php\/2021\/11\/21\/python-threads\/","title":{"rendered":"Python Threads"},"content":{"rendered":"\n<p>I had to check the reachability of many IPs so I decided to &#8220;write&#8221; a python script to get this done quickly (yes, I can use nmap but not in this case). I realized that the script was very slow, even just sending two probes&#8230;. so I decided to find something else and <a href=\"https:\/\/gist.github.com\/sourceperl\/10288663\">this<\/a> was perfect for me. So thanks for the original author as it helped me a lot. I have never tried python threads before so I was quite happy that it worked so smoothly. I adapted for my needs and this is what I <a href=\"https:\/\/github.com\/thomarite\/scripts\/blob\/main\/ping-th.py\">have<\/a>. I remember reading about threads in golang so it helped to understand what it is doing. But likely I will be able to use this as base for more tasks.<\/p>\n\n\n\n<p>As well, I realized that I havent pushed anything in git and that there are extra security layers in place. So I had to create a new <a href=\"https:\/\/docs.github.com\/en\/authentication\/keeping-your-account-and-data-secure\/creating-a-personal-access-token\">token<\/a> for being able to push my changes to the repo.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I had to check the reachability of many IPs so I decided to &#8220;write&#8221; a python script to get this done quickly (yes, I can use nmap but not in this case). I realized that the script was very slow, even just sending two probes&#8230;. so I decided to find something else and this was &hellip; <a href=\"https:\/\/blog.thomarite.uk\/index.php\/2021\/11\/21\/python-threads\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Python Threads&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[25],"tags":[],"class_list":["post-783","post","type-post","status-publish","format-standard","hentry","category-python"],"_links":{"self":[{"href":"https:\/\/blog.thomarite.uk\/index.php\/wp-json\/wp\/v2\/posts\/783","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.thomarite.uk\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.thomarite.uk\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.thomarite.uk\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.thomarite.uk\/index.php\/wp-json\/wp\/v2\/comments?post=783"}],"version-history":[{"count":1,"href":"https:\/\/blog.thomarite.uk\/index.php\/wp-json\/wp\/v2\/posts\/783\/revisions"}],"predecessor-version":[{"id":784,"href":"https:\/\/blog.thomarite.uk\/index.php\/wp-json\/wp\/v2\/posts\/783\/revisions\/784"}],"wp:attachment":[{"href":"https:\/\/blog.thomarite.uk\/index.php\/wp-json\/wp\/v2\/media?parent=783"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.thomarite.uk\/index.php\/wp-json\/wp\/v2\/categories?post=783"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.thomarite.uk\/index.php\/wp-json\/wp\/v2\/tags?post=783"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}