{"action":"created","issue":{"url":"https://api.github.com/repos/hephaest0s/usbkill/issues/26","labels_url":"https://api.github.com/repos/hephaest0s/usbkill/issues/26/labels{/name}","comments_url":"https://api.github.com/repos/hephaest0s/usbkill/issues/26/comments","events_url":"https://api.github.com/repos/hephaest0s/usbkill/issues/26/events","html_url":"https://github.com/hephaest0s/usbkill/issues/26","id":73734507,"number":26,"title":"SyntaxError: invalid syntax","user":{"login":"arraiano","id":10519766,"avatar_url":"https://avatars.githubusercontent.com/u/10519766?v=3","gravatar_id":"","url":"https://api.github.com/users/arraiano","html_url":"https://github.com/arraiano","followers_url":"https://api.github.com/users/arraiano/followers","following_url":"https://api.github.com/users/arraiano/following{/other_user}","gists_url":"https://api.github.com/users/arraiano/gists{/gist_id}","starred_url":"https://api.github.com/users/arraiano/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arraiano/subscriptions","organizations_url":"https://api.github.com/users/arraiano/orgs","repos_url":"https://api.github.com/users/arraiano/repos","events_url":"https://api.github.com/users/arraiano/events{/privacy}","received_events_url":"https://api.github.com/users/arraiano/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-05-06T20:54:21Z","updated_at":"2015-05-06T20:56:44Z","closed_at":null,"body":"Hello! I've just downloaded usbkill to try it, but i've this error:\r\n ~ $ sudo python3 usbkill.py\r\n  File \"usbkill.py\", line 4\r\n    <!DOCTYPE html>\r\n    ^\r\nSyntaxError: invalid syntax\r\n\r\nI've runing usbkill on a virtual machine with Linux Mint 17.1 32 bits. \r\n\r\nThank you very much!"},"comment":{"url":"https://api.github.com/repos/hephaest0s/usbkill/issues/comments/99607325","html_url":"https://github.com/hephaest0s/usbkill/issues/26#issuecomment-99607325","issue_url":"https://api.github.com/repos/hephaest0s/usbkill/issues/26","id":99607325,"user":{"login":"arraiano","id":10519766,"avatar_url":"https://avatars.githubusercontent.com/u/10519766?v=3","gravatar_id":"","url":"https://api.github.com/users/arraiano","html_url":"https://github.com/arraiano","followers_url":"https://api.github.com/users/arraiano/followers","following_url":"https://api.github.com/users/arraiano/following{/other_user}","gists_url":"https://api.github.com/users/arraiano/gists{/gist_id}","starred_url":"https://api.github.com/users/arraiano/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arraiano/subscriptions","organizations_url":"https://api.github.com/users/arraiano/orgs","repos_url":"https://api.github.com/users/arraiano/repos","events_url":"https://api.github.com/users/arraiano/events{/privacy}","received_events_url":"https://api.github.com/users/arraiano/received_events","type":"User","site_admin":false},"created_at":"2015-05-06T20:56:44Z","updated_at":"2015-05-06T20:56:44Z","body":"yes...i've downloaded it just 10 minutes ago. Here it is:\r\n\r\n\r\n\r\n<!DOCTYPE html>\r\n<html lang=\"en\" class=\"\">\r\n  <head prefix=\"og: http://ogp.me/ns# fb: http://ogp.me/ns/fb# object: http://ogp.me/ns/object# article: http://ogp.me/ns/article# profile: http://ogp.me/ns/profile#\">\r\n    <meta charset='utf-8'>\r\n    <meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\">\r\n    <meta http-equiv=\"Content-Language\" content=\"en\">\r\n    \r\n    \r\n    <title>usbkill/usbkill.py at master · hephaest0s/usbkill · GitHub</title>\r\n    <link rel=\"search\" type=\"application/opensearchdescription+xml\" href=\"/opensearch.xml\" title=\"GitHub\">\r\n    <link rel=\"fluid-icon\" href=\"https://github.com/fluidicon.png\" title=\"GitHub\">\r\n    <link rel=\"apple-touch-icon\" sizes=\"57x57\" href=\"/apple-touch-icon-114.png\">\r\n    <link rel=\"apple-touch-icon\" sizes=\"114x114\" href=\"/apple-touch-icon-114.png\">\r\n    <link rel=\"apple-touch-icon\" sizes=\"72x72\" href=\"/apple-touch-icon-144.png\">\r\n    <link rel=\"apple-touch-icon\" sizes=\"144x144\" href=\"/apple-touch-icon-144.png\">\r\n    <meta property=\"fb:app_id\" content=\"1401488693436528\">\r\n\r\n      <meta content=\"@github\" name=\"twitter:site\" /><meta content=\"summary\" name=\"twitter:card\" /><meta content=\"hephaest0s/usbkill\" name=\"twitter:title\" /><meta content=\"« usbkill » is an anti-forensic kill-switch that waits for a change on your USB ports and then immediately shuts down your computer.\" name=\"twitter:description\" /><meta content=\"https://avatars3.githubusercontent.com/u/11010193?v=3&amp;s=400\" name=\"twitter:image:src\" />\r\n      <meta content=\"GitHub\" property=\"og:site_name\" /><meta content=\"object\" property=\"og:type\" /><meta content=\"https://avatars3.githubusercontent.com/u/11010193?v=3&amp;s=400\" property=\"og:image\" /><meta content=\"hephaest0s/usbkill\" property=\"og:title\" /><meta content=\"https://github.com/hephaest0s/usbkill\" property=\"og:url\" /><meta content=\"« usbkill » is an anti-forensic kill-switch that waits for a change on your USB ports and then immediately shuts down your computer.\" property=\"og:description\" />\r\n      <meta name=\"browser-stats-url\" content=\"https://api.github.com/_private/browser/stats\">\r\n    <meta name=\"browser-errors-url\" content=\"https://api.github.com/_private/browser/errors\">\r\n    <link rel=\"assets\" href=\"https://assets-cdn.github.com/\">\r\n    \r\n    <meta name=\"pjax-timeout\" content=\"1000\">\r\n    \r\n\r\n    <meta name=\"msapplication-TileImage\" content=\"/windows-tile.png\">\r\n    <meta name=\"msapplication-TileColor\" content=\"#ffffff\">\r\n    <meta name=\"selected-link\" value=\"repo_source\" data-pjax-transient>\r\n      <meta name=\"google-analytics\" content=\"UA-3769691-2\">\r\n\r\n    <meta content=\"collector.githubapp.com\" name=\"octolytics-host\" /><meta content=\"collector-cdn.github.com\" name=\"octolytics-script-host\" /><meta content=\"github\" name=\"octolytics-app-id\" /><meta content=\"054F5681:741A:AE0DB93:554A7A47\" name=\"octolytics-dimension-request_id\" />\r\n    \r\n    <meta content=\"Rails, view, blob#show\" name=\"analytics-event\" />\r\n    <meta class=\"js-ga-set\" name=\"dimension1\" content=\"Logged Out\">\r\n    <meta class=\"js-ga-set\" name=\"dimension2\" content=\"Header v3\">\r\n    <meta name=\"is-dotcom\" content=\"true\">\r\n    <meta name=\"hostname\" content=\"github.com\">\r\n    <meta name=\"user-login\" content=\"\">\r\n\r\n    \r\n    <link rel=\"icon\" type=\"image/x-icon\" href=\"https://assets-cdn.github.com/favicon.ico\">\r\n\r\n\r\n    <meta content=\"authenticity_token\" name=\"csrf-param\" />\r\n<meta content=\"w3CFYlt/qnEYZ0VzISR1Qr4odKliVlD/J9HdINM9zZi89lGYxxOZKY4ValCF3494I8aw55Pj71jVBRJJNOEfrw==\" name=\"csrf-token\" />\r\n\r\n    <link href=\"https://assets-cdn.github.com/assets/github-151090982a2c2c28413901d35eb6c3c28cd671be5a101bcaec3d0e55a4ea39b7.css\" media=\"all\" rel=\"stylesheet\" />\r\n    <link href=\"https://assets-cdn.github.com/assets/github2-ca7a40afa0db1779efa9ffb34d294ce481fd29f4e44c7a92d9e568a4cce75671.css\" media=\"all\" rel=\"stylesheet\" />\r\n    \r\n    \r\n\r\n\r\n    <meta http-equiv=\"x-pjax-version\" content=\"81b2b43007725a4504e8fb5d4c12fc0d\">\r\n\r\n      \r\n  <meta name=\"description\" content=\"« usbkill » is an anti-forensic kill-switch that waits for a change on your USB ports and then immediately shuts down your computer.\">\r\n  <meta name=\"go-import\" content=\"github.com/hephaest0s/usbkill git https://github.com/hephaest0s/usbkill.git\">\r\n\r\n  <meta content=\"11010193\" name=\"octolytics-dimension-user_id\" /><meta content=\"hephaest0s\" name=\"octolytics-dimension-user_login\" /><meta content=\"30810457\" name=\"octolytics-dimension-repository_id\" /><meta content=\"hephaest0s/usbkill\" name=\"octolytics-dimension-repository_nwo\" /><meta content=\"true\" name=\"octolytics-dimension-repository_public\" /><meta content=\"false\" name=\"octolytics-dimension-repository_is_fork\" /><meta content=\"30810457\" name=\"octolytics-dimension-repository_network_root_id\" /><meta content=\"hephaest0s/usbkill\" name=\"octolytics-dimension-repository_network_root_nwo\" />\r\n  <link href=\"https://github.com/hephaest0s/usbkill/commits/master.atom\" rel=\"alternate\" title=\"Recent Commits to usbkill:master\" type=\"application/atom+xml\">\r\n\r\n  </head>\r\n\r\n\r\n  <body class=\"logged_out  env-production windows vis-public page-blob\">\r\n    <a href=\"#start-of-content\" tabindex=\"1\" class=\"accessibility-aid js-skip-to-content\">Skip to content</a>\r\n    <div class=\"wrapper\">\r\n      \r\n      \r\n      \r\n\r\n\r\n        \r\n        <div class=\"header header-logged-out\" role=\"banner\">\r\n  <div class=\"container clearfix\">\r\n\r\n    <a class=\"header-logo-wordmark\" href=\"https://github.com/\" data-ga-click=\"(Logged out) Header, go to homepage, icon:logo-wordmark\">\r\n      <span class=\"mega-octicon octicon-logo-github\"></span>\r\n    </a>\r\n\r\n    <div class=\"header-actions\" role=\"navigation\">\r\n        <a class=\"btn btn-primary\" href=\"/join\" data-ga-click=\"(Logged out) Header, clicked Sign up, text:sign-up\">Sign up</a>\r\n      <a class=\"btn\" href=\"/login?return_to=%2Fhephaest0s%2Fusbkill%2Fblob%2Fmaster%2Fusbkill.py\" data-ga-click=\"(Logged out) Header, clicked Sign in, text:sign-in\">Sign in</a>\r\n    </div>\r\n\r\n    <div class=\"site-search repo-scope js-site-search\" role=\"search\">\r\n      <form accept-charset=\"UTF-8\" action=\"/hephaest0s/usbkill/search\" class=\"js-site-search-form\" data-global-search-url=\"/search\" data-repo-search-url=\"/hephaest0s/usbkill/search\" method=\"get\"><div style=\"margin:0;padding:0;display:inline\"><input name=\"utf8\" type=\"hidden\" value=\"&#x2713;\" /></div>\r\n  <input type=\"text\"\r\n    class=\"js-site-search-field is-clearable\"\r\n    data-hotkey=\"s\"\r\n    name=\"q\"\r\n    placeholder=\"Search\"\r\n    data-global-scope-placeholder=\"Search GitHub\"\r\n    data-repo-scope-placeholder=\"Search\"\r\n    tabindex=\"1\"\r\n    autocapitalize=\"off\">\r\n  <div class=\"scope-badge\">This repository</div>\r\n</form>\r\n    </div>\r\n\r\n      <ul class=\"header-nav left\" role=\"navigation\">\r\n          <li class=\"header-nav-item\">\r\n            <a class=\"header-nav-link\" href=\"/explore\" data-ga-click=\"(Logged out) Header, go to explore, text:explore\">Explore</a>\r\n          </li>\r\n          <li class=\"header-nav-item\">\r\n            <a class=\"header-nav-link\" href=\"/features\" data-ga-click=\"(Logged out) Header, go to features, text:features\">Features</a>\r\n          </li>\r\n          <li class=\"header-nav-item\">\r\n            <a class=\"header-nav-link\" href=\"https://enterprise.github.com/\" data-ga-click=\"(Logged out) Header, go to enterprise, text:enterprise\">Enterprise</a>\r\n          </li>\r\n          <li class=\"header-nav-item\">\r\n            <a class=\"header-nav-link\" href=\"/blog\" data-ga-click=\"(Logged out) Header, go to blog, text:blog\">Blog</a>\r\n          </li>\r\n      </ul>\r\n\r\n  </div>\r\n</div>\r\n\r\n\r\n\r\n      <div id=\"start-of-content\" class=\"accessibility-aid\"></div>\r\n          <div class=\"site\" itemscope itemtype=\"http://schema.org/WebPage\">\r\n    <div id=\"js-flash-container\">\r\n      \r\n    </div>\r\n    <div class=\"pagehead repohead instapaper_ignore readability-menu\">\r\n      <div class=\"container\">\r\n        \r\n<ul class=\"pagehead-actions\">\r\n\r\n  <li>\r\n      <a href=\"/login?return_to=%2Fhephaest0s%2Fusbkill\"\r\n    class=\"btn btn-sm btn-with-count tooltipped tooltipped-n\"\r\n    aria-label=\"You must be signed in to watch a repository\" rel=\"nofollow\">\r\n    <span class=\"octicon octicon-eye\"></span>\r\n    Watch\r\n  </a>\r\n  <a class=\"social-count\" href=\"/hephaest0s/usbkill/watchers\">\r\n    87\r\n  </a>\r\n\r\n  </li>\r\n\r\n  <li>\r\n      <a href=\"/login?return_to=%2Fhephaest0s%2Fusbkill\"\r\n    class=\"btn btn-sm btn-with-count tooltipped tooltipped-n\"\r\n    aria-label=\"You must be signed in to star a repository\" rel=\"nofollow\">\r\n    <span class=\"octicon octicon-star\"></span>\r\n    Star\r\n  </a>\r\n\r\n    <a class=\"social-count js-social-count\" href=\"/hephaest0s/usbkill/stargazers\">\r\n      581\r\n    </a>\r\n\r\n  </li>\r\n\r\n    <li>\r\n      <a href=\"/login?return_to=%2Fhephaest0s%2Fusbkill\"\r\n        class=\"btn btn-sm btn-with-count tooltipped tooltipped-n\"\r\n        aria-label=\"You must be signed in to fork a repository\" rel=\"nofollow\">\r\n        <span class=\"octicon octicon-repo-forked\"></span>\r\n        Fork\r\n      </a>\r\n      <a href=\"/hephaest0s/usbkill/network\" class=\"social-count\">\r\n        121\r\n      </a>\r\n    </li>\r\n</ul>\r\n\r\n        <h1 itemscope itemtype=\"http://data-vocabulary.org/Breadcrumb\" class=\"entry-title public\">\r\n          <span class=\"mega-octicon octicon-repo\"></span>\r\n          <span class=\"author\"><a href=\"/hephaest0s\" class=\"url fn\" itemprop=\"url\" rel=\"author\"><span itemprop=\"title\">hephaest0s</span></a></span><!--\r\n       --><span class=\"path-divider\">/</span><!--\r\n       --><strong><a href=\"/hephaest0s/usbkill\" class=\"js-current-repository\" data-pjax=\"#js-repo-pjax-container\">usbkill</a></strong>\r\n\r\n          <span class=\"page-context-loader\">\r\n            <img alt=\"\" height=\"16\" src=\"https://assets-cdn.github.com/assets/spinners/octocat-spinner-32-e513294efa576953719e4e2de888dd9cf929b7d62ed8d05f25e731d02452ab6c.gif\" width=\"16\" />\r\n          </span>\r\n\r\n        </h1>\r\n      </div><!-- /.container -->\r\n    </div><!-- /.repohead -->\r\n\r\n    <div class=\"container\">\r\n      <div class=\"repository-with-sidebar repo-container new-discussion-timeline  \">\r\n        <div class=\"repository-sidebar clearfix\">\r\n            \r\n<nav class=\"sunken-menu repo-nav js-repo-nav js-sidenav-container-pjax js-octicon-loaders\"\r\n     role=\"navigation\"\r\n     data-pjax=\"#js-repo-pjax-container\"\r\n     data-issue-count-url=\"/hephaest0s/usbkill/issues/counts\">\r\n  <ul class=\"sunken-menu-group\">\r\n    <li class=\"tooltipped tooltipped-w\" aria-label=\"Code\">\r\n      <a href=\"/hephaest0s/usbkill\" aria-label=\"Code\" class=\"selected js-selected-navigation-item sunken-menu-item\" data-hotkey=\"g c\" data-selected-links=\"repo_source repo_downloads repo_commits repo_releases repo_tags repo_branches /hephaest0s/usbkill\">\r\n        <span class=\"octicon octicon-code\"></span> <span class=\"full-word\">Code</span>\r\n        <img alt=\"\" class=\"mini-loader\" height=\"16\" src=\"https://assets-cdn.github.com/assets/spinners/octocat-spinner-32-e513294efa576953719e4e2de888dd9cf929b7d62ed8d05f25e731d02452ab6c.gif\" width=\"16\" />\r\n</a>    </li>\r\n\r\n      <li class=\"tooltipped tooltipped-w\" aria-label=\"Issues\">\r\n        <a href=\"/hephaest0s/usbkill/issues\" aria-label=\"Issues\" class=\"js-selected-navigation-item sunken-menu-item\" data-hotkey=\"g i\" data-selected-links=\"repo_issues repo_labels repo_milestones /hephaest0s/usbkill/issues\">\r\n          <span class=\"octicon octicon-issue-opened\"></span> <span class=\"full-word\">Issues</span>\r\n          <span class=\"js-issue-replace-counter\"></span>\r\n          <img alt=\"\" class=\"mini-loader\" height=\"16\" src=\"https://assets-cdn.github.com/assets/spinners/octocat-spinner-32-e513294efa576953719e4e2de888dd9cf929b7d62ed8d05f25e731d02452ab6c.gif\" width=\"16\" />\r\n</a>      </li>\r\n\r\n    <li class=\"tooltipped tooltipped-w\" aria-label=\"Pull requests\">\r\n      <a href=\"/hephaest0s/usbkill/pulls\" aria-label=\"Pull requests\" class=\"js-selected-navigation-item sunken-menu-item\" data-hotkey=\"g p\" data-selected-links=\"repo_pulls /hephaest0s/usbkill/pulls\">\r\n          <span class=\"octicon octicon-git-pull-request\"></span> <span class=\"full-word\">Pull requests</span>\r\n          <span class=\"js-pull-replace-counter\"></span>\r\n          <img alt=\"\" class=\"mini-loader\" height=\"16\" src=\"https://assets-cdn.github.com/assets/spinners/octocat-spinner-32-e513294efa576953719e4e2de888dd9cf929b7d62ed8d05f25e731d02452ab6c.gif\" width=\"16\" />\r\n</a>    </li>\r\n\r\n  </ul>\r\n  <div class=\"sunken-menu-separator\"></div>\r\n  <ul class=\"sunken-menu-group\">\r\n\r\n    <li class=\"tooltipped tooltipped-w\" aria-label=\"Pulse\">\r\n      <a href=\"/hephaest0s/usbkill/pulse\" aria-label=\"Pulse\" class=\"js-selected-navigation-item sunken-menu-item\" data-selected-links=\"pulse /hephaest0s/usbkill/pulse\">\r\n        <span class=\"octicon octicon-pulse\"></span> <span class=\"full-word\">Pulse</span>\r\n        <img alt=\"\" class=\"mini-loader\" height=\"16\" src=\"https://assets-cdn.github.com/assets/spinners/octocat-spinner-32-e513294efa576953719e4e2de888dd9cf929b7d62ed8d05f25e731d02452ab6c.gif\" width=\"16\" />\r\n</a>    </li>\r\n\r\n    <li class=\"tooltipped tooltipped-w\" aria-label=\"Graphs\">\r\n      <a href=\"/hephaest0s/usbkill/graphs\" aria-label=\"Graphs\" class=\"js-selected-navigation-item sunken-menu-item\" data-selected-links=\"repo_graphs repo_contributors /hephaest0s/usbkill/graphs\">\r\n        <span class=\"octicon octicon-graph\"></span> <span class=\"full-word\">Graphs</span>\r\n        <img alt=\"\" class=\"mini-loader\" height=\"16\" src=\"https://assets-cdn.github.com/assets/spinners/octocat-spinner-32-e513294efa576953719e4e2de888dd9cf929b7d62ed8d05f25e731d02452ab6c.gif\" width=\"16\" />\r\n</a>    </li>\r\n  </ul>\r\n\r\n\r\n</nav>\r\n\r\n              <div class=\"only-with-full-nav\">\r\n                  \r\n<div class=\"clone-url open\"\r\n  data-protocol-type=\"http\"\r\n  data-url=\"/users/set_protocol?protocol_selector=http&amp;protocol_type=clone\">\r\n  <h3><span class=\"text-emphasized\">HTTPS</span> clone URL</h3>\r\n  <div class=\"input-group js-zeroclipboard-container\">\r\n    <input type=\"text\" class=\"input-mini input-monospace js-url-field js-zeroclipboard-target\"\r\n           value=\"https://github.com/hephaest0s/usbkill.git\" readonly=\"readonly\">\r\n    <span class=\"input-group-button\">\r\n      <button aria-label=\"Copy to clipboard\" class=\"js-zeroclipboard btn btn-sm zeroclipboard-button tooltipped tooltipped-s\" data-copied-hint=\"Copied!\" type=\"button\"><span class=\"octicon octicon-clippy\"></span></button>\r\n    </span>\r\n  </div>\r\n</div>\r\n\r\n  \r\n<div class=\"clone-url \"\r\n  data-protocol-type=\"subversion\"\r\n  data-url=\"/users/set_protocol?protocol_selector=subversion&amp;protocol_type=clone\">\r\n  <h3><span class=\"text-emphasized\">Subversion</span> checkout URL</h3>\r\n  <div class=\"input-group js-zeroclipboard-container\">\r\n    <input type=\"text\" class=\"input-mini input-monospace js-url-field js-zeroclipboard-target\"\r\n           value=\"https://github.com/hephaest0s/usbkill\" readonly=\"readonly\">\r\n    <span class=\"input-group-button\">\r\n      <button aria-label=\"Copy to clipboard\" class=\"js-zeroclipboard btn btn-sm zeroclipboard-button tooltipped tooltipped-s\" data-copied-hint=\"Copied!\" type=\"button\"><span class=\"octicon octicon-clippy\"></span></button>\r\n    </span>\r\n  </div>\r\n</div>\r\n\r\n\r\n\r\n<p class=\"clone-options\">You can clone with\r\n  <a href=\"#\" class=\"js-clone-selector\" data-protocol=\"http\">HTTPS</a> or <a href=\"#\" class=\"js-clone-selector\" data-protocol=\"subversion\">Subversion</a>.\r\n  <a href=\"https://help.github.com/articles/which-remote-url-should-i-use\" class=\"help tooltipped tooltipped-n\" aria-label=\"Get help on which URL is right for you.\">\r\n    <span class=\"octicon octicon-question\"></span>\r\n  </a>\r\n</p>\r\n\r\n\r\n  <a href=\"https://windows.github.com\" class=\"btn btn-sm sidebar-button\" title=\"Save hephaest0s/usbkill to your computer and use it in GitHub Desktop.\" aria-label=\"Save hephaest0s/usbkill to your computer and use it in GitHub Desktop.\">\r\n    <span class=\"octicon octicon-device-desktop\"></span>\r\n    Clone in Desktop\r\n  </a>\r\n\r\n\r\n                <a href=\"/hephaest0s/usbkill/archive/master.zip\"\r\n                   class=\"btn btn-sm sidebar-button\"\r\n                   aria-label=\"Download the contents of hephaest0s/usbkill as a zip file\"\r\n                   title=\"Download the contents of hephaest0s/usbkill as a zip file\"\r\n                   rel=\"nofollow\">\r\n                  <span class=\"octicon octicon-cloud-download\"></span>\r\n                  Download ZIP\r\n                </a>\r\n              </div>\r\n        </div><!-- /.repository-sidebar -->\r\n\r\n        <div id=\"js-repo-pjax-container\" class=\"repository-content context-loader-container\" data-pjax-container>\r\n\r\n          \r\n\r\n<a href=\"/hephaest0s/usbkill/blob/9e1f76087df106ef3e3b20b7efb6eeacac70f745/usbkill.py\" class=\"hidden js-permalink-shortcut\" data-hotkey=\"y\">Permalink</a>\r\n\r\n<!-- blob contrib key: blob_contributors:v21:52b4ba96fa068c8cd3b530f7a454b1f7 -->\r\n\r\n<div class=\"file-navigation js-zeroclipboard-container\">\r\n  \r\n<div class=\"select-menu js-menu-container js-select-menu left\">\r\n  <span class=\"btn btn-sm select-menu-button js-menu-target css-truncate\" data-hotkey=\"w\"\r\n    data-master-branch=\"master\"\r\n    data-ref=\"master\"\r\n    title=\"master\"\r\n    role=\"button\" aria-label=\"Switch branches or tags\" tabindex=\"0\" aria-haspopup=\"true\">\r\n    <span class=\"octicon octicon-git-branch\"></span>\r\n    <i>branch:</i>\r\n    <span class=\"js-select-button css-truncate-target\">master</span>\r\n  </span>\r\n\r\n  <div class=\"select-menu-modal-holder js-menu-content js-navigation-container\" data-pjax aria-hidden=\"true\">\r\n\r\n    <div class=\"select-menu-modal\">\r\n      <div class=\"select-menu-header\">\r\n        <span class=\"select-menu-title\">Switch branches/tags</span>\r\n        <span class=\"octicon octicon-x js-menu-close\" role=\"button\" aria-label=\"Close\"></span>\r\n      </div>\r\n\r\n      <div class=\"select-menu-filters\">\r\n        <div class=\"select-menu-text-filter\">\r\n          <input type=\"text\" aria-label=\"Filter branches/tags\" id=\"context-commitish-filter-field\" class=\"js-filterable-field js-navigation-enable\" placeholder=\"Filter branches/tags\">\r\n        </div>\r\n        <div class=\"select-menu-tabs\">\r\n          <ul>\r\n            <li class=\"select-menu-tab\">\r\n              <a href=\"#\" data-tab-filter=\"branches\" data-filter-placeholder=\"Filter branches/tags\" class=\"js-select-menu-tab\">Branches</a>\r\n            </li>\r\n            <li class=\"select-menu-tab\">\r\n              <a href=\"#\" data-tab-filter=\"tags\" data-filter-placeholder=\"Find a tag…\" class=\"js-select-menu-tab\">Tags</a>\r\n            </li>\r\n          </ul>\r\n        </div>\r\n      </div>\r\n\r\n      <div class=\"select-menu-list select-menu-tab-bucket js-select-menu-tab-bucket\" data-tab-filter=\"branches\">\r\n\r\n        <div data-filterable-for=\"context-commitish-filter-field\" data-filterable-type=\"substring\">\r\n\r\n\r\n            <a class=\"select-menu-item js-navigation-item js-navigation-open selected\"\r\n               href=\"/hephaest0s/usbkill/blob/master/usbkill.py\"\r\n               data-name=\"master\"\r\n               data-skip-pjax=\"true\"\r\n               rel=\"nofollow\">\r\n              <span class=\"select-menu-item-icon octicon octicon-check\"></span>\r\n              <span class=\"select-menu-item-text css-truncate-target\" title=\"master\">\r\n                master\r\n              </span>\r\n            </a>\r\n        </div>\r\n\r\n          <div class=\"select-menu-no-results\">Nothing to show</div>\r\n      </div>\r\n\r\n      <div class=\"select-menu-list select-menu-tab-bucket js-select-menu-tab-bucket\" data-tab-filter=\"tags\">\r\n        <div data-filterable-for=\"context-commitish-filter-field\" data-filterable-type=\"substring\">\r\n\r\n\r\n        </div>\r\n\r\n        <div class=\"select-menu-no-results\">Nothing to show</div>\r\n      </div>\r\n\r\n    </div>\r\n  </div>\r\n</div>\r\n\r\n  <div class=\"btn-group right\">\r\n    <a href=\"/hephaest0s/usbkill/find/master\"\r\n          class=\"js-show-file-finder btn btn-sm empty-icon tooltipped tooltipped-s\"\r\n          data-pjax\r\n          data-hotkey=\"t\"\r\n          aria-label=\"Quickly jump between files\">\r\n      <span class=\"octicon octicon-list-unordered\"></span>\r\n    </a>\r\n    <button aria-label=\"Copy file path to clipboard\" class=\"js-zeroclipboard btn btn-sm zeroclipboard-button tooltipped tooltipped-s\" data-copied-hint=\"Copied!\" type=\"button\"><span class=\"octicon octicon-clippy\"></span></button>\r\n  </div>\r\n\r\n  <div class=\"breadcrumb js-zeroclipboard-target\">\r\n    <span class='repo-root js-repo-root'><span itemscope=\"\" itemtype=\"http://data-vocabulary.org/Breadcrumb\"><a href=\"/hephaest0s/usbkill\" class=\"\" data-branch=\"master\" data-direction=\"back\" data-pjax=\"true\" itemscope=\"url\"><span itemprop=\"title\">usbkill</span></a></span></span><span class=\"separator\">/</span><strong class=\"final-path\">usbkill.py</strong>\r\n  </div>\r\n</div>\r\n\r\n\r\n  <div class=\"commit file-history-tease\">\r\n    <div class=\"file-history-tease-header\">\r\n        <img alt=\"@deekayen\" class=\"avatar\" data-user=\"382319\" height=\"24\" src=\"https://avatars0.githubusercontent.com/u/382319?v=3&amp;s=48\" width=\"24\" />\r\n        <span class=\"author\"><a href=\"/deekayen\" rel=\"contributor\">deekayen</a></span>\r\n        <time datetime=\"2015-05-06T14:48:29Z\" is=\"relative-time\">May 6, 2015</time>\r\n        <div class=\"commit-title\">\r\n            <a href=\"/hephaest0s/usbkill/commit/73419170b093c58ea05bc551d8db73fa32f30d44\" class=\"message\" data-pjax=\"true\" title=\"Add killall loginwindow Finder to Darwin halt.\">Add killall loginwindow Finder to Darwin halt.</a>\r\n        </div>\r\n    </div>\r\n\r\n    <div class=\"participation\">\r\n      <p class=\"quickstat\">\r\n        <a href=\"#blob_contributors_box\" rel=\"facebox\">\r\n          <strong>4</strong>\r\n           contributors\r\n        </a>\r\n      </p>\r\n          <a class=\"avatar-link tooltipped tooltipped-s\" aria-label=\"hephaest0s\" href=\"/hephaest0s/usbkill/commits/master/usbkill.py?author=hephaest0s\"><img alt=\"@hephaest0s\" class=\"avatar\" data-user=\"11010193\" height=\"20\" src=\"https://avatars3.githubusercontent.com/u/11010193?v=3&amp;s=40\" width=\"20\" /> </a>\r\n    <a class=\"avatar-link tooltipped tooltipped-s\" aria-label=\"deekayen\" href=\"/hephaest0s/usbkill/commits/master/usbkill.py?author=deekayen\"><img alt=\"@deekayen\" class=\"avatar\" data-user=\"382319\" height=\"20\" src=\"https://avatars2.githubusercontent.com/u/382319?v=3&amp;s=40\" width=\"20\" /> </a>\r\n    <a class=\"avatar-link tooltipped tooltipped-s\" aria-label=\"pwnsdx\" href=\"/hephaest0s/usbkill/commits/master/usbkill.py?author=pwnsdx\"><img alt=\"@pwnsdx\" class=\"avatar\" data-user=\"2057765\" height=\"20\" src=\"https://avatars1.githubusercontent.com/u/2057765?v=3&amp;s=40\" width=\"20\" /> </a>\r\n    <a class=\"avatar-link tooltipped tooltipped-s\" aria-label=\"Brobin\" href=\"/hephaest0s/usbkill/commits/master/usbkill.py?author=Brobin\"><img alt=\"@Brobin\" class=\"avatar\" data-user=\"6194619\" height=\"20\" src=\"https://avatars3.githubusercontent.com/u/6194619?v=3&amp;s=40\" width=\"20\" /> </a>\r\n\r\n\r\n    </div>\r\n    <div id=\"blob_contributors_box\" style=\"display:none\">\r\n      <h2 class=\"facebox-header\">Users who have contributed to this file</h2>\r\n      <ul class=\"facebox-user-list\">\r\n          <li class=\"facebox-user-list-item\">\r\n            <img alt=\"@hephaest0s\" data-user=\"11010193\" height=\"24\" src=\"https://avatars1.githubusercontent.com/u/11010193?v=3&amp;s=48\" width=\"24\" />\r\n            <a href=\"/hephaest0s\">hephaest0s</a>\r\n          </li>\r\n          <li class=\"facebox-user-list-item\">\r\n            <img alt=\"@deekayen\" data-user=\"382319\" height=\"24\" src=\"https://avatars0.githubusercontent.com/u/382319?v=3&amp;s=48\" width=\"24\" />\r\n            <a href=\"/deekayen\">deekayen</a>\r\n          </li>\r\n          <li class=\"facebox-user-list-item\">\r\n            <img alt=\"@pwnsdx\" data-user=\"2057765\" height=\"24\" src=\"https://avatars3.githubusercontent.com/u/2057765?v=3&amp;s=48\" width=\"24\" />\r\n            <a href=\"/pwnsdx\">pwnsdx</a>\r\n          </li>\r\n          <li class=\"facebox-user-list-item\">\r\n            <img alt=\"@Brobin\" data-user=\"6194619\" height=\"24\" src=\"https://avatars1.githubusercontent.com/u/6194619?v=3&amp;s=48\" width=\"24\" />\r\n            <a href=\"/Brobin\">Brobin</a>\r\n          </li>\r\n      </ul>\r\n    </div>\r\n  </div>\r\n\r\n<div class=\"file\">\r\n  <div class=\"file-header\">\r\n    <div class=\"file-actions\">\r\n\r\n      <div class=\"btn-group\">\r\n        <a href=\"/hephaest0s/usbkill/raw/master/usbkill.py\" class=\"btn btn-sm \" id=\"raw-url\">Raw</a>\r\n          <a href=\"/hephaest0s/usbkill/blame/master/usbkill.py\" class=\"btn btn-sm js-update-url-with-hash\">Blame</a>\r\n        <a href=\"/hephaest0s/usbkill/commits/master/usbkill.py\" class=\"btn btn-sm \" rel=\"nofollow\">History</a>\r\n      </div>\r\n\r\n        <a class=\"octicon-btn tooltipped tooltipped-nw\"\r\n           href=\"https://windows.github.com\"\r\n           aria-label=\"Open this file in GitHub for Windows\"\r\n           data-ga-click=\"Repository, open with desktop, type:windows\">\r\n            <span class=\"octicon octicon-device-desktop\"></span>\r\n        </a>\r\n\r\n          <button type=\"button\" class=\"octicon-btn disabled tooltipped tooltipped-n\" aria-label=\"You must be signed in to make or propose changes\">\r\n            <span class=\"octicon octicon-pencil\"></span>\r\n          </button>\r\n\r\n        <button type=\"button\" class=\"octicon-btn octicon-btn-danger disabled tooltipped tooltipped-n\" aria-label=\"You must be signed in to make or propose changes\">\r\n          <span class=\"octicon octicon-trashcan\"></span>\r\n        </button>\r\n    </div>\r\n\r\n    <div class=\"file-info\">\r\n        172 lines (137 sloc)\r\n        <span class=\"file-info-divider\"></span>\r\n      6.258 kb\r\n    </div>\r\n  </div>\r\n  \r\n  <div class=\"blob-wrapper data type-python\">\r\n      <table class=\"highlight tab-size-8 js-file-line-container\">\r\n      <tr>\r\n        <td id=\"L1\" class=\"blob-num js-line-number\" data-line-number=\"1\"></td>\r\n        <td id=\"LC1\" class=\"blob-code blob-code-inner js-file-line\"><span class=\"pl-c\">#    This program is free software: you can redistribute it and/or modify</span></td>\r\n      </tr>\r\n      <tr>\r\n        <td id=\"L2\" class=\"blob-num js-line-number\" data-line-number=\"2\"></td>\r\n        <td id=\"LC2\" class=\"blob-code blob-code-inner js-file-line\"><span class=\"pl-c\">#    it under the terms of the GNU General Public License as published by</span></td>\r\n      </tr>\r\n      <tr>\r\n        <td id=\"L3\" class=\"blob-num js-line-number\" data-line-number=\"3\"></td>\r\n        <td id=\"LC3\" class=\"blob-code blob-code-inner js-file-line\"><span class=\"pl-c\">#    the Free Software Foundation, either version 3 of the License, or</span></td>\r\n      </tr>\r\n      <tr>\r\n        <td id=\"L4\" class=\"blob-num js-line-number\" data-line-number=\"4\"></td>\r\n        <td id=\"LC4\" class=\"blob-code blob-code-inner js-file-line\"><span class=\"pl-c\">#    (at your option) any later version.</span></td>\r\n      </tr>\r\n      <tr>\r\n        <td id=\"L5\" class=\"blob-num js-line-number\" data-line-number=\"5\"></td>\r\n        <td id=\"LC5\" class=\"blob-code blob-code-inner js-file-line\"> </td>\r\n      </tr>\r\n      <tr>\r\n        <td id=\"L6\" class=\"blob-num js-line-number\" data-line-number=\"6\"></td>\r\n        <td id=\"LC6\" class=\"blob-code blob-code-inner js-file-line\"><span class=\"pl-c\">#    This program is distributed in the hope that it will be useful,</span></td>\r\n      </tr>\r\n      <tr>\r\n        <td id=\"L7\" class=\"blob-num js-line-number\" data-line-number=\"7\"></td>\r\n        <td id=\"LC7\" class=\"blob-code blob-code-inner js-file-line\"><span class=\"pl-c\">#    but WITHOUT ANY WARRANTY; without even the implied warranty of</span></td>\r\n      </tr>\r\n      <tr>\r\n        <td id=\"L8\" class=\"blob-num js-line-number\" data-line-number=\"8\"></td>\r\n        <td id=\"LC8\" class=\"blob-code blob-code-inner js-file-line\"><span class=\"pl-c\">#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span></td>\r\n      </tr>\r\n      <tr>\r\n        <td id=\"L9\" class=\"blob-num js-line-number\" data-line-number=\"9\"></td>\r\n        <td id=\"LC9\" class=\"blob-code blob-code-inner js-file-line\"><span class=\"pl-c\">#    GNU General Public License for more details.</span></td>\r\n      </tr>\r\n      <tr>\r\n        <td id=\"L10\" class=\"blob-num js-line-number\" data-line-number=\"10\"></td>\r\n        <td id=\"LC10\" class=\"blob-code blob-code-inner js-file-line\">\r\n</td>\r\n      </tr>\r\n      <tr>\r\n        <td id=\"L11\" class=\"blob-num js-line-number\" data-line-number=\"11\"></td>\r\n        <td id=\"LC11\" class=\"blob-code blob-code-inner js-file-line\"><span class=\"pl-c\">#    You should have received a copy of the GNU General Public License</span></td>\r\n      </tr>\r\n      <tr>\r\n        <td id=\"L12\" class=\"blob-num js-line-number\" data-line-number=\"12\"></td>\r\n        <td id=\"LC12\" class=\"blob-code blob-code-inner js-file-line\"><span class=\"pl-c\">#    along with this program.  If not, see &lt;http://www.gnu.org/licenses/&gt;.</span></td>\r\n      </tr>\r\n      <tr>\r\n        <td id=\"L13\" class=\"blob-num js-line-number\" data-line-number=\"13\"></td>\r\n        <td id=\"LC13\" class=\"blob-code blob-code-inner js-file-line\">\r\n</td>\r\n      </tr>\r\n      <tr>\r\n        <td id=\"L14\" class=\"blob-num js-line-number\" data-line-number=\"14\"></td>\r\n        <td id=\"LC14\" class=\"blob-code blob-code-inner js-file-line\"><span class=\"pl-c\"># Contact: hephaestos@riseup.net - 8764 EF6F D5C1 7838 8D10 E061 CF84 9CE5 42D0 B12B</span></td>\r\n      </tr>\r\n      <tr>\r\n        <td id=\"L15\" class=\"blob-num js-line-number\" data-line-number=\"15\"></td>\r\n        <td id=\"LC15\" class=\"blob-code blob-code-inner js-file-line\">\r\n</td>\r\n      </tr>\r\n      <tr>\r\n        <td id=\"L16\" class=\"blob-num js-line-number\" data-line-number=\"16\"></td>\r\n        <td id=\"LC16\" class=\"blob-code blob-code-inner js-file-line\"><span class=\"pl-k\">import</span> re</td>\r\n      </tr>\r\n      <tr>\r\n        <td id=\"L17\" class=\"blob-num js-line-number\" data-line-number=\"17\"></td>\r\n        <td id=\"LC17\" class=\"blob-code blob-code-inner js-file-line\"><span class=\"pl-k\">import</span> subprocess</td>\r\n      </tr>\r\n      <tr>\r\n        <td id=\"L18\" class=\"blob-num js-line-number\" data-line-number=\"18\"></td>\r\n        <td id=\"LC18\" class=\"blob-code blob-code-inner js-file-line\"><span class=\"pl-k\">import</span> platform</td>\r\n      </tr>\r\n      <tr>\r\n        <td id=\"L19\" class=\"blob-num js-line-number\" data-line-number=\"19\"></td>\r\n        <td id=\"LC19\" class=\"blob-code blob-code-inner js-file-line\"><span class=\"pl-k\">import</span> os, sys, signal</td>\r\n      </tr>\r\n      <tr>\r\n        <td id=\"L20\" class=\"blob-num js-line-number\" data-line-number=\"20\"></td>\r\n        <td id=\"LC20\" class=\"blob-code blob-code-inner js-file-line\"><span class=\"pl-k\">from</span> time <span class=\"pl-k\">import</span> time, sleep</td>\r\n      </tr>\r\n      <tr>\r\n        <td id=\"L21\" class=\"blob-num js-line-number\" data-line-number=\"21\"></td>\r\n        <td id=\"LC21\" class=\"blob-code blob-code-inner js-file-line\">\r\n</td>\r\n      </tr>\r\n      <tr>\r\n        <td id=\"L22\" class=\"blob-num js-line-number\" data-line-number=\"22\"></td>\r\n        <td id=\"LC22\" class=\"blob-code blob-code-inner js-file-line\"><span class=\"pl-c\"># We compile this function beforehand for efficiency.</span></td>\r\n      </tr>\r\n      <tr>\r\n        <td id=\"L23\" class=\"blob-num js-line-number\" data-line-number=\"23\"></td>\r\n        <td id=\"LC23\" class=\"blob-code blob-code-inner js-file-line\">DEVICE_RE <span class=\"pl-k\">=</span> re.compile(<span class=\"pl-s\"><span class=\"pl-pds\">&quot;</span>.+ID\\s(?P&lt;id&gt;\\w+:\\w+)<span class=\"pl-pds\">&quot;</span></span>)</td>\r\n      </tr>\r\n      <tr>\r\n        <td id=\"L24\" class=\"blob-num js-line-number\" data-line-number=\"24\"></td>\r\n        <td id=\"LC24\" class=\"blob-code blob-code-inner js-file-line\">\r\n</td>\r\n      </tr>\r\n      <tr>\r\n        <td id=\"L25\" class=\"blob-num js-line-number\" data-line-number=\"25\"></td>\r\n        <td id=\"LC25\" class=\"blob-code blob-code-inner js-file-line\"><span class=\"pl-c\"># Set the settings filename here</span></td>\r\n      </tr>\r\n      <tr>\r\n        <td id=\"L26\" class=\"blob-num js-line-number\" data-line-number=\"26\"></td>\r\n        <td id=\"LC26\" class=\"blob-code blob-code-inner js-file-line\">SETTINGS_FILE <span class=\"pl-k\">=</span> <span class=\"pl-s\"><span class=\"pl-pds\">&#39;</span>/etc/usbkill/settings<span class=\"pl-pds\">&#39;</span></span>;</td>\r\n      </tr>\r\n      <tr>\r\n        <td id=\"L27\" class=\"blob-num js-line-number\" data-line-number=\"27\"></td>\r\n        <td id=\"LC27\" class=\"blob-code blob-code-inner js-file-line\">\r\n</td>\r\n      </tr>\r\n      <tr>\r\n        <td id=\"L28\" class=\"blob-num js-line-number\" data-line-number=\"28\"></td>\r\n        <td id=\"LC28\" class=\"blob-code blob-code-inner js-file-line\">help_message <span class=\"pl-k\">=</span> <span class=\"pl-s\"><span class=\"pl-pds\">&quot;</span>usbkill is a simple program with one goal: quickly shutdown the computer when a usb is inserted or removed.<span class=\"pl-cce\">\\n</span>It logs to /var/log/usbkill/kills.log<span class=\"pl-cce\">\\n</span>You can configure a whitelist of usb ids that are acceptable to insert and the remove.<span class=\"pl-cce\">\\n</span>The usb id can be found by running the command &#39;lsusb&#39;.<span class=\"pl-cce\">\\n</span>Settings can be changed in /ect/usbkill/settings<span class=\"pl-cce\">\\n\\n</span>In order to be able to shutdown the computer, this program needs to run as root.<span class=\"pl-cce\">\\n</span><span class=\"pl-pds\">&quot;</span></span></td>\r\n      </tr>\r\n      <tr>\r\n        <td id=\"L29\" class=\"blob-num js-line-number\" data-line-number=\"29\"></td>\r\n        <td id=\"LC29\" class=\"blob-code blob-code-inner js-file-line\">\r\n</td>\r\n      </tr>\r\n      <tr>\r\n        <td id=\"L30\" class=\"blob-num js-line-number\" data-line-number=\"30\"></td>\r\n        <td id=\"LC30\" class=\"blob-code blob-code-inner js-file-line\"><span class=\"pl-k\">def</span> <span class=\"pl-en\">log</span>(<span class=\"pl-smi\">msg</span>):</td>\r\n      </tr>\r\n      <tr>\r\n        <td id=\"L31\" class=\"blob-num js-line-number\" data-line-number=\"31\"></td>\r\n        <td id=\"LC31\" class=\"blob-code blob-code-inner js-file-line\">\tlogfile <span class=\"pl-k\">=</span> <span class=\"pl-s\"><span class=\"pl-pds\">&quot;</span>/var/log/usbkill/usbkill.log<span class=\"pl-pds\">&quot;</span></span></td>\r\n      </tr>\r\n      <tr>\r\n        <td id=\"L32\" class=\"blob-num js-line-number\" data-line-number=\"32\"></td>\r\n        <td id=\"LC32\" class=\"blob-code blob-code-inner js-file-line\">\r\n</td>\r\n      </tr>\r\n      <tr>\r\n        <td id=\"L33\" class=\"blob-num js-line-number\" data-line-number=\"33\"></td>\r\n        <td id=\"LC33\" class=\"blob-code blob-code-inner js-file-line\">\t<span class=\"pl-k\">with</span> <span class=\"pl-c1\">open</span>(logfile, <span class=\"pl-s\"><span class=\"pl-pds\">&#39;</span>a+<span class=\"pl-pds\">&#39;</span></span>) <span class=\"pl-k\">as</span> log:</td>\r\n      </tr>\r\n      <tr>\r\n        <td id=\"L34\" class=\"blob-num js-line-number\" data-line-number=\"34\"></td>\r\n        <td id=\"LC34\" class=\"blob-code blob-code-inner js-file-line\">\t\tcontents <span class=\"pl-k\">=</span> <span class=\"pl-s\"><span class=\"pl-pds\">&#39;</span><span class=\"pl-cce\">\\n</span><span class=\"pl-c1\">{0}</span> <span class=\"pl-c1\">{1}</span><span class=\"pl-cce\">\\n</span>Current state:<span class=\"pl-pds\">&#39;</span></span>.format(<span class=\"pl-c1\">str</span>(time()), msg)</td>\r\n      </tr>\r\n      <tr>\r\n        <td id=\"L35\" class=\"blob-num js-line-number\" data-line-number=\"35\"></td>\r\n        <td id=\"LC35\" class=\"blob-code blob-code-inner js-file-line\">\t\tlog.write(contents)</td>\r\n      </tr>\r\n      <tr>\r\n        <td id=\"L36\" class=\"blob-num js-line-number\" data-line-number=\"36\"></td>\r\n        <td id=\"LC36\" class=\"blob-code blob-code-inner js-file-line\">\t</td>\r\n      </tr>\r\n      <tr>\r\n        <td id=\"L37\" class=\"blob-num js-line-number\" data-line-number=\"37\"></td>\r\n        <td id=\"LC37\" class=\"blob-code blob-code-inner js-file-line\">\t<span class=\"pl-c\"># Log current usb state:</span></td>\r\n      </tr>\r\n      <tr>\r\n        <td id=\"L38\" class=\"blob-num js-line-number\" data-line-number=\"38\"></td>\r\n        <td id=\"LC38\" class=\"blob-code blob-code-inner js-file-line\">\tos.system(<span class=\"pl-s\"><span class=\"pl-pds\">&quot;</span>lsusb &gt;&gt; <span class=\"pl-pds\">&quot;</span></span> <span class=\"pl-k\">+</span> logfile)</td>\r\n      </tr>\r\n      <tr>\r\n        <td id=\"L39\" class=\"blob-num js-line-number\" data-line-number=\"39\"></td>\r\n        <td id=\"LC39\" class=\"blob-code blob-code-inner js-file-line\">\t</td>\r\n      </tr>\r\n      <tr>\r\n        <td id=\"L40\" class=\"blob-num js-line-number\" data-line-number=\"40\"></td>\r\n        <td id=\"LC40\" class=\"blob-code blob-code-inner js-file-line\"><span class=\"pl-k\">def</span> <span class=\"pl-en\">kill_computer</span>():</td>\r\n      </tr>\r\n      <tr>\r\n        <td id=\"L41\" class=\"blob-num js-line-number\" data-line-number=\"41\"></td>\r\n        <td id=\"LC41\" class=\"blob-code blob-code-inner js-file-line\">\t<span class=\"pl-c\"># Log what is happening:</span></td>\r\n      </tr>\r\n      <tr>\r\n        <td id=\"L42\" class=\"blob-num js-line-number\" data-line-number=\"42\"></td>\r\n        <td id=\"LC42\" class=\"blob-code blob-code-inner js-file-line\">\tlog(<span class=\"pl-s\"><span class=\"pl-pds\">&quot;</span>Detected USB change. Dumping lsusb and killing computer...<span class=\"pl-pds\">&quot;</span></span>)</td>\r\n      </tr>\r\n      <tr>\r\n        <td id=\"L43\" class=\"blob-num js-line-number\" data-line-number=\"43\"></td>\r\n        <td id=\"LC43\" class=\"blob-code blob-code-inner js-file-line\">\t</td>\r\n      </tr>\r\n      <tr>\r\n        <td id=\"L44\" class=\"blob-num js-line-number\" data-line-number=\"44\"></td>\r\n        <td id=\"LC44\" class=\"blob-code blob-code-inner js-file-line\">\t<span class=\"pl-c\"># Sync the filesystem so that the recent log entry does not get lost.</span></td>\r\n      </tr>\r\n      <tr>\r\n        <td id=\"L45\" class=\"blob-num js-line-number\" data-line-number=\"45\"></td>\r\n        <td id=\"LC45\" class=\"blob-code blob-code-inner js-file-line\">\tos.system(<span class=\"pl-s\"><span class=\"pl-pds\">&quot;</span>sync<span class=\"pl-pds\">&quot;</span></span>)</td>\r\n      </tr>\r\n      <tr>\r\n        <td id=\"L46\" class=\"blob-num js-line-number\" data-line-number=\"46\"></td>\r\n        <td id=\"LC46\" class=\"blob-code blob-code-inner js-file-line\">\t</td>\r\n      </tr>\r\n      <tr>\r\n        <td id=\"L47\" class=\"blob-num js-line-number\" data-line-number=\"47\"></td>\r\n        <td id=\"LC47\" class=\"blob-code blob-code-inner js-file-line\">\t<span class=\"pl-c\"># Get the current platform</span></td>\r\n      </tr>\r\n      <tr>\r\n        <td id=\"L48\" class=\"blob-num js-line-number\" data-line-number=\"48\"></td>\r\n        <td id=\"LC48\" class=\"blob-code blob-code-inner js-file-line\">\tCURRENT_PLATFORM <span class=\"pl-k\">=</span> platform.system().upper()</td>\r\n      </tr>\r\n      <tr>\r\n        <td id=\"L49\" class=\"blob-num js-line-number\" data-line-number=\"49\"></td>\r\n        <td id=\"LC49\" class=\"blob-code blob-code-inner js-file-line\">\t</td>\r\n      </tr>\r\n      <tr>\r\n        <td id=\"L50\" class=\"blob-num js-line-number\" data-line-number=\"50\"></td>\r\n        <td id=\"LC50\" class=\"blob-code blob-code-inner js-file-line\">\t<span class=\"pl-c\"># Poweroff computer immediately</span></td>\r\n      </tr>\r\n      <tr>\r\n        <td id=\"L51\" class=\"blob-num js-line-number\" data-line-number=\"51\"></td>\r\n        <td id=\"LC51\" class=\"blob-code blob-code-inner js-file-line\">\t<span class=\"pl-k\">if</span> CURRENT_PLATFORM.startswith(<span class=\"pl-s\"><span class=\"pl-pds\">&quot;</span>DARWIN<span class=\"pl-pds\">&quot;</span></span>):</td>\r\n      </tr>\r\n      <tr>\r\n        <td id=\"L52\" class=\"blob-num js-line-number\" data-line-number=\"52\"></td>\r\n        <td id=\"LC52\" class=\"blob-code blob-code-inner js-file-line\">\t\t<span class=\"pl-c\"># OS X (Darwin) - Will halt ungracefully, without signaling apps</span></td>\r\n      </tr>\r\n      <tr>\r\n        <td id=\"L53\" class=\"blob-num js-line-number\" data-line-number=\"53\"></td>\r\n        <td id=\"LC53\" class=\"blob-code blob-code-inner js-file-line\">\t\tos.system(<span class=\"pl-s\"><span class=\"pl-pds\">&quot;</span>killall loginwindow Finder &amp;&amp; halt -q<span class=\"pl-pds\">&quot;</span></span>)</td>\r\n      </tr>\r\n      <tr>\r\n        <td id=\"L54\" class=\"blob-num js-line-number\" data-line-number=\"54\"></td>\r\n        <td id=\"LC54\" class=\"blob-code blob-code-inner js-file-line\">\t<span class=\"pl-k\">elif</span> CURRENT_PLATFORM.endswith(<span class=\"pl-s\"><span class=\"pl-pds\">&quot;</span>BSD<span class=\"pl-pds\">&quot;</span></span>):</td>\r\n      </tr>\r\n      <tr>\r\n        <td id=\"L55\" class=\"blob-num js-line-number\" data-line-number=\"55\"></td>\r\n        <td id=\"LC55\" class=\"blob-code blob-code-inner js-file-line\">\t\t<span class=\"pl-c\"># BSD-based systems - Will shutdown</span></td>\r\n      </tr>\r\n      <tr>\r\n        <td id=\"L56\" class=\"blob-num js-line-number\" data-line-number=\"56\"></td>\r\n        <td id=\"LC56\" class=\"blob-code blob-code-inner js-file-line\">\t\tos.system(<span class=\"pl-s\"><span class=\"pl-pds\">&quot;</span>shutdown -h now<span class=\"pl-pds\">&quot;</span></span>)</td>\r\n      </tr>\r\n      <tr>\r\n        <td id=\"L57\" class=\"blob-num js-line-number\" data-line-number=\"57\"></td>\r\n        <td id=\"LC57\" class=\"blob-code blob-code-inner js-file-line\">\t<span class=\"pl-k\">else</span>:</td>\r\n      </tr>\r\n      <tr>\r\n        <td id=\"L58\" class=\"blob-num js-line-number\" data-line-number=\"58\"></td>\r\n        <td id=\"LC58\" class=\"blob-code blob-code-inner js-file-line\">\t\t<span class=\"pl-c\"># Linux-based systems - Will shutdown</span></td>\r\n      </tr>\r\n      <tr>\r\n        <td id=\"L59\" class=\"blob-num js-line-number\" data-line-number=\"59\"></td>\r\n        <td id=\"LC59\" class=\"blob-code blob-code-inner js-file-line\">\t\tos.system(<span class=\"pl-s\"><span class=\"pl-pds\">&quot;</span>poweroff -f<span class=\"pl-pds\">&quot;</span></span>)</td>\r\n      </tr>\r\n      <tr>\r\n        <td id=\"L60\" class=\"blob-num js-line-number\" data-line-number=\"60\"></td>\r\n        <td id=\"LC60\" class=\"blob-code blob-code-inner js-file-line\">\r\n</td>\r\n      </tr>\r\n      <tr>\r\n        <td id=\"L61\" class=\"blob-num js-line-number\" data-line-number=\"61\"></td>\r\n        <td id=\"LC61\" class=\"blob-code blob-code-inner js-file-line\"><span class=\"pl-k\">def</span> <span class=\"pl-en\">lsusb</span>():</td>\r\n      </tr>\r\n      <tr>\r\n        <td id=\"L62\" class=\"blob-num js-line-number\" data-line-number=\"62\"></td>\r\n        <td id=\"LC62\" class=\"blob-code blob-code-inner js-file-line\">\t<span class=\"pl-c\"># A python version of the command &#39;lsusb&#39; that returns a list of connected usbids</span></td>\r\n      </tr>\r\n      <tr>\r\n        <td id=\"L63\" class=\"blob-num js-line-number\" data-line-number=\"63\"></td>\r\n        <td id=\"LC63\" class=\"blob-code blob-code-inner js-file-line\">\tdf <span class=\"pl-k\">=</span> subprocess.check_output(<span class=\"pl-s\"><span class=\"pl-pds\">&quot;</span>lsusb<span class=\"pl-pds\">&quot;</span></span>, <span class=\"pl-smi\">shell</span><span class=\"pl-k\">=</span><span class=\"pl-c1\">True</span>).decode(<span class=\"pl-s\"><span class=\"pl-pds\">&#39;</span>utf-8<span class=\"pl-pds\">&#39;</span></span>)</td>\r\n      </tr>\r\n      <tr>\r\n        <td id=\"L64\" class=\"blob-num js-line-number\" data-line-number=\"64\"></td>\r\n        <td id=\"LC64\" class=\"blob-code blob-code-inner js-file-line\">\tdevices <span class=\"pl-k\">=</span> []</td>\r\n      </tr>\r\n      <tr>\r\n        <td id=\"L65\" class=\"blob-num js-line-number\" data-line-number=\"65\"></td>\r\n        <td id=\"LC65\" class=\"blob-code blob-code-inner js-file-line\">\t<span class=\"pl-k\">for</span> line <span class=\"pl-k\">in</span> df.split(<span class=\"pl-s\"><span class=\"pl-pds\">&#39;</span><span class=\"pl-cce\">\\n</span><span class=\"pl-pds\">&#39;</span></span>):</td>\r\n      </tr>\r\n      <tr>\r\n        <td id=\"L66\" class=\"blob-num js-line-number\" data-line-number=\"66\"></td>\r\n        <td id=\"LC66\" class=\"blob-code blob-code-inner js-file-line\">\t    info <span class=\"pl-k\">=</span> DEVICE_RE.match(line)</td>\r\n      </tr>\r\n      <tr>\r\n        <td id=\"L67\" class=\"blob-num js-line-number\" data-line-number=\"67\"></td>\r\n        <td id=\"LC67\" class=\"blob-code blob-code-inner js-file-line\">\t    <span class=\"pl-k\">if</span> info:</td>\r\n      </tr>\r\n      <tr>\r\n        <td id=\"L68\" class=\"blob-num js-line-number\" data-line-number=\"68\"></td>\r\n        <td id=\"LC68\" class=\"blob-code blob-code-inner js-file-line\">\t        dinfo <span class=\"pl-k\">=</span> info.groupdict()</td>\r\n      </tr>\r\n      <tr>\r\n        <td id=\"L69\" class=\"blob-num js-line-number\" data-line-number=\"69\"></td>\r\n        <td id=\"LC69\" class=\"blob-code blob-code-inner js-file-line\">\t        devices.append(dinfo[<span class=\"pl-s\"><span class=\"pl-pds\">&#39;</span>id<span class=\"pl-pds\">&#39;</span></span>])</td>\r\n      </tr>\r\n      <tr>\r\n        <td id=\"L70\" class=\"blob-num js-line-number\" data-line-number=\"70\"></td>\r\n        <td id=\"LC70\" class=\"blob-code blob-code-inner js-file-line\">\t<span class=\"pl-k\">return</span> devices</td>\r\n      </tr>\r\n      <tr>\r\n        <td id=\"L71\" class=\"blob-num js-line-number\" data-line-number=\"71\"></td>\r\n        <td id=\"LC71\" class=\"blob-code blob-code-inner js-file-line\">\r\n</td>\r\n      </tr>\r\n      <tr>\r\n        <td id=\"L72\" class=\"blob-num js-line-number\" data-line-number=\"72\"></td>\r\n        <td id=\"LC72\" class=\"blob-code blob-code-inner js-file-line\"><span class=\"pl-k\">def</span> <span class=\"pl-en\">settings_template</span>(<span class=\"pl-smi\">filename</span>):</td>\r\n      </tr>\r\n      <tr>\r\n        <td id=\"L73\" class=\"blob-num js-line-number\" data-line-number=\"73\"></td>\r\n        <td id=\"LC73\" class=\"blob-code blob-code-inner js-file-line\">\t<span class=\"pl-c\"># Make sure there is the settings folder</span></td>\r\n      </tr>\r\n      <tr>\r\n        <td id=\"L74\" class=\"blob-num js-line-number\" data-line-number=\"74\"></td>\r\n        <td id=\"LC74\" class=\"blob-code blob-code-inner js-file-line\">\t<span class=\"pl-k\">if</span> <span class=\"pl-k\">not</span> os.path.isdir(<span class=\"pl-s\"><span class=\"pl-pds\">&quot;</span>/etc/usbkill/<span class=\"pl-pds\">&quot;</span></span>):</td>\r\n      </tr>\r\n      <tr>\r\n        <td id=\"L75\" class=\"blob-num js-line-number\" data-line-number=\"75\"></td>\r\n        <td id=\"LC75\" class=\"blob-code blob-code-inner js-file-line\">\t\tos.mkdir(<span class=\"pl-s\"><span class=\"pl-pds\">&quot;</span>/etc/usbkill/<span class=\"pl-pds\">&quot;</span></span>)</td>\r\n      </tr>\r\n      <tr>\r\n        <td id=\"L76\" class=\"blob-num js-line-number\" data-line-number=\"76\"></td>\r\n        <td id=\"LC76\" class=\"blob-code blob-code-inner js-file-line\">\t<span class=\"pl-c\"># Make sure there is a settings file</span></td>\r\n      </tr>\r\n      <tr>\r\n        <td id=\"L77\" class=\"blob-num js-line-number\" data-line-number=\"77\"></td>\r\n        <td id=\"LC77\" class=\"blob-code blob-code-inner js-file-line\">\t<span class=\"pl-k\">if</span> <span class=\"pl-k\">not</span> os.path.isfile(filename):</td>\r\n      </tr>\r\n      <tr>\r\n        <td id=\"L78\" class=\"blob-num js-line-number\" data-line-number=\"78\"></td>\r\n        <td id=\"LC78\" class=\"blob-code blob-code-inner js-file-line\">\t\t<span class=\"pl-c\"># Pre-populate the settings file if it does not exist yet</span></td>\r\n      </tr>\r\n      <tr>\r\n        <td id=\"L79\" class=\"blob-num js-line-number\" data-line-number=\"79\"></td>\r\n        <td id=\"LC79\" class=\"blob-code blob-code-inner js-file-line\">\t\t<span class=\"pl-k\">with</span> <span class=\"pl-c1\">open</span>(filename, <span class=\"pl-s\"><span class=\"pl-pds\">&#39;</span>w<span class=\"pl-pds\">&#39;</span></span>) <span class=\"pl-k\">as</span> f:</td>\r\n      </tr>\r\n      <tr>\r\n        <td id=\"L80\" class=\"blob-num js-line-number\" data-line-number=\"80\"></td>\r\n        <td id=\"LC80\" class=\"blob-code blob-code-inner js-file-line\">\t\t\tf.write(<span class=\"pl-s\"><span class=\"pl-pds\">&quot;</span># whitelist command lists the usb ids that you want whitelisted<span class=\"pl-cce\">\\n</span><span class=\"pl-pds\">&quot;</span></span>)</td>\r\n      </tr>\r\n      <tr>\r\n        <td id=\"L81\" class=\"blob-num js-line-number\" data-line-number=\"81\"></td>\r\n        <td id=\"LC81\" class=\"blob-code blob-code-inner js-file-line\">\t\t\tf.write(<span class=\"pl-s\"><span class=\"pl-pds\">&quot;</span># find the correct usbid for your trusted usb using the command &#39;lsusb&#39;<span class=\"pl-cce\">\\n</span><span class=\"pl-pds\">&quot;</span></span>)</td>\r\n      </tr>\r\n      <tr>\r\n        <td id=\"L82\" class=\"blob-num js-line-number\" data-line-number=\"82\"></td>\r\n        <td id=\"LC82\" class=\"blob-code blob-code-inner js-file-line\">\t\t\tf.write(<span class=\"pl-s\"><span class=\"pl-pds\">&quot;</span># usbid looks something line 0123:9abc<span class=\"pl-cce\">\\n</span><span class=\"pl-pds\">&quot;</span></span>)</td>\r\n      </tr>\r\n      <tr>\r\n        <td id=\"L83\" class=\"blob-num js-line-number\" data-line-number=\"83\"></td>\r\n        <td id=\"LC83\" class=\"blob-code blob-code-inner js-file-line\">\t\t\tf.write(<span class=\"pl-s\"><span class=\"pl-pds\">&quot;</span># Be warned! other parties can copy your trusted usbid to another usb device!<span class=\"pl-cce\">\\n</span><span class=\"pl-pds\">&quot;</span></span>)</td>\r\n      </tr>\r\n      <tr>\r\n        <td id=\"L84\" class=\"blob-num js-line-number\" data-line-number=\"84\"></td>\r\n        <td id=\"LC84\" class=\"blob-code blob-code-inner js-file-line\">\t\t\tf.write(<span class=\"pl-s\"><span class=\"pl-pds\">&quot;</span># use whitelist command and single space separation as follows:<span class=\"pl-cce\">\\n</span><span class=\"pl-pds\">&quot;</span></span>)</td>\r\n      </tr>\r\n      <tr>\r\n        <td id=\"L85\" class=\"blob-num js-line-number\" data-line-number=\"85\"></td>\r\n        <td id=\"LC85\" class=\"blob-code blob-code-inner js-file-line\">\t\t\tf.write(<span class=\"pl-s\"><span class=\"pl-pds\">&quot;</span># whitelist usbid1 usbid2 etc<span class=\"pl-cce\">\\n</span><span class=\"pl-pds\">&quot;</span></span>)</td>\r\n      </tr>\r\n      <tr>\r\n        <td id=\"L86\" class=\"blob-num js-line-number\" data-line-number=\"86\"></td>\r\n        <td id=\"LC86\" class=\"blob-code blob-code-inner js-file-line\">\t\t\tf.write(<span class=\"pl-s\"><span class=\"pl-pds\">&quot;</span>whitelist <span class=\"pl-cce\">\\n\\n</span><span class=\"pl-pds\">&quot;</span></span>)</td>\r\n      </tr>\r\n      <tr>\r\n        <td id=\"L87\" class=\"blob-num js-line-number\" data-line-number=\"87\"></td>\r\n        <td id=\"LC87\" class=\"blob-code blob-code-inner js-file-line\">\t\t\tf.write(<span class=\"pl-s\"><span class=\"pl-pds\">&quot;</span># allow for a certain amount of sleep time between checks, e.g. 0.5 seconds:<span class=\"pl-cce\">\\n</span><span class=\"pl-pds\">&quot;</span></span>)</td>\r\n      </tr>\r\n      <tr>\r\n        <td id=\"L88\" class=\"blob-num js-line-number\" data-line-number=\"88\"></td>\r\n        <td id=\"LC88\" class=\"blob-code blob-code-inner js-file-line\">\t\t\tf.write(<span class=\"pl-s\"><span class=\"pl-pds\">&quot;</span>sleep 0.5<span class=\"pl-cce\">\\n</span><span class=\"pl-pds\">&quot;</span></span>)</td>\r\n      </tr>\r\n      <tr>\r\n        <td id=\"L89\" class=\"blob-num js-line-number\" data-line-number=\"89\"></td>\r\n        <td id=\"LC89\" class=\"blob-code blob-code-inner js-file-line\">\r\n</td>\r\n      </tr>\r\n      <tr>\r\n        <td id=\"L90\" class=\"blob-num js-line-number\" data-line-number=\"90\"></td>\r\n        <td id=\"LC90\" class=\"blob-code blob-code-inner js-file-line\"><span class=\"pl-k\">def</span> <span class=\"pl-en\">load_settings</span>(<span class=\"pl-smi\">filename</span>):</td>\r\n      </tr>\r\n      <tr>\r\n        <td id=\"L91\" class=\"blob-num js-line-number\" data-line-number=\"91\"></td>\r\n        <td id=\"LC91\" class=\"blob-code blob-code-inner js-file-line\">\t<span class=\"pl-c\"># read all lines of settings file</span></td>\r\n      </tr>\r\n      <tr>\r\n        <td id=\"L92\" class=\"blob-num js-line-number\" data-line-number=\"92\"></td>\r\n        <td id=\"LC92\" class=\"blob-code blob-code-inner js-file-line\">\t<span class=\"pl-k\">with</span> <span class=\"pl-c1\">open</span>(filename, <span class=\"pl-s\"><span class=\"pl-pds\">&#39;</span>r<span class=\"pl-pds\">&#39;</span></span>) <span class=\"pl-k\">as</span> f:</td>\r\n      </tr>\r\n      <tr>\r\n        <td id=\"L93\" class=\"blob-num js-line-number\" data-line-number=\"93\"></td>\r\n        <td id=\"LC93\" class=\"blob-code blob-code-inner js-file-line\">\t\tlines <span class=\"pl-k\">=</span> f.readlines()</td>\r\n      </tr>\r\n      <tr>\r\n        <td id=\"L94\" class=\"blob-num js-line-number\" data-line-number=\"94\"></td>\r\n        <td id=\"LC94\" class=\"blob-code blob-code-inner js-file-line\">\t</td>\r\n      </tr>\r\n      <tr>\r\n        <td id=\"L95\" class=\"blob-num js-line-number\" data-line-number=\"95\"></td>\r\n        <td id=\"LC95\" class=\"blob-code blob-code-inner js-file-line\">\t<span class=\"pl-c\"># Find the only two supported settings</span></td>\r\n      </tr>\r\n      <tr>\r\n        <td id=\"L96\" class=\"blob-num js-line-number\" data-line-number=\"96\"></td>\r\n        <td id=\"LC96\" class=\"blob-code blob-code-inner js-file-line\">\tdevices <span class=\"pl-k\">=</span> <span class=\"pl-c1\">None</span></td>\r\n      </tr>\r\n      <tr>\r\n        <td id=\"L97\" class=\"blob-num js-line-number\" data-line-number=\"97\"></td>\r\n        <td id=\"LC97\" class=\"blob-code blob-code-inner js-file-line\">\tsleep_time <span class=\"pl-k\">=</span> <span class=\"pl-c1\">None</span></td>\r\n      </tr>\r\n      <tr>\r\n        <td id=\"L98\" class=\"blob-num js-line-number\" data-line-number=\"98\"></td>\r\n        <td id=\"LC98\" class=\"blob-code blob-code-inner js-file-line\">\t<span class=\"pl-k\">for</span> line <span class=\"pl-k\">in</span> lines:</td>\r\n      </tr>\r\n      <tr>\r\n        <td id=\"L99\" class=\"blob-num js-line-number\" data-line-number=\"99\"></td>\r\n        <td id=\"LC99\" class=\"blob-code blob-code-inner js-file-line\">\t\t<span class=\"pl-k\">if</span> line[:<span class=\"pl-c1\">10</span>] <span class=\"pl-k\">==</span> <span class=\"pl-s\"><span class=\"pl-pds\">&quot;</span>whitelist <span class=\"pl-pds\">&quot;</span></span>:</td>\r\n      </tr>\r\n      <tr>\r\n        <td id=\"L100\" class=\"blob-num js-line-number\" data-line-number=\"100\"></td>\r\n        <td id=\"LC100\" class=\"blob-code blob-code-inner js-file-line\">\t\t\tdevices <span class=\"pl-k\">=</span> line.replace(<span class=\"pl-s\"><span class=\"pl-pds\">&quot;</span><span class=\"pl-cce\">\\n</span><span class=\"pl-pds\">&quot;</span></span>,<span class=\"pl-s\"><span class=\"pl-pds\">&quot;</span><span class=\"pl-pds\">&quot;</span></span>).replace(<span class=\"pl-s\"><span class=\"pl-pds\">&quot;</span>  <span class=\"pl-pds\">&quot;</span></span>,<span class=\"pl-s\"><span class=\"pl-pds\">&quot;</span> <span class=\"pl-pds\">&quot;</span></span>).split(<span class=\"pl-s\"><span class=\"pl-pds\">&quot;</span> <span class=\"pl-pds\">&quot;</span></span>)[<span class=\"pl-c1\">1</span>:]</td>\r\n      </tr>\r\n      <tr>\r\n        <td id=\"L101\" class=\"blob-num js-line-number\" data-line-number=\"101\"></td>\r\n        <td id=\"LC101\" class=\"blob-code blob-code-inner js-file-line\">\t\t<span class=\"pl-k\">if</span> line[:<span class=\"pl-c1\">6</span>] <span class=\"pl-k\">==</span> <span class=\"pl-s\"><span class=\"pl-pds\">&quot;</span>sleep <span class=\"pl-pds\">&quot;</span></span>:</td>\r\n      </tr>\r\n      <tr>\r\n        <td id=\"L102\" class=\"blob-num js-line-number\" data-line-number=\"102\"></td>\r\n        <td id=\"LC102\" class=\"blob-code blob-code-inner js-file-line\">\t\t\tsleep_time <span class=\"pl-k\">=</span> <span class=\"pl-c1\">float</span>(line.replace(<span class=\"pl-s\"><span class=\"pl-pds\">&quot;</span><span class=\"pl-cce\">\\n</span><span class=\"pl-pds\">&quot;</span></span>,<span class=\"pl-s\"><span class=\"pl-pds\">&quot;</span><span class=\"pl-pds\">&quot;</span></span>).replace(<span class=\"pl-s\"><span class=\"pl-pds\">&quot;</span>  <span class=\"pl-pds\">&quot;</span></span>,<span class=\"pl-s\"><span class=\"pl-pds\">&quot;</span> <span class=\"pl-pds\">&quot;</span></span>).split(<span class=\"pl-s\"><span class=\"pl-pds\">&quot;</span> <span class=\"pl-pds\">&quot;</span></span>).pop())</td>\r\n      </tr>\r\n      <tr>\r\n        <td id=\"L103\" class=\"blob-num js-line-number\" data-line-number=\"103\"></td>\r\n        <td id=\"LC103\" class=\"blob-code blob-code-inner js-file-line\">\r\n</td>\r\n      </tr>\r\n      <tr>\r\n        <td id=\"L104\" class=\"blob-num js-line-number\" data-line-number=\"104\"></td>\r\n        <td id=\"LC104\" class=\"blob-code blob-code-inner js-file-line\">\t<span class=\"pl-k\">assert</span> <span class=\"pl-k\">not</span> <span class=\"pl-c1\">None</span> <span class=\"pl-k\">in</span> [devices, sleep_time], <span class=\"pl-s\"><span class=\"pl-pds\">&quot;</span>Please set the &#39;sleep&#39; and &#39;whitelist&#39; parameters in &#39;/etc/usbkill/settings&#39; !<span class=\"pl-pds\">&quot;</span></span></td>\r\n      </tr>\r\n      <tr>\r\n        <td id=\"L105\" class=\"blob-num js-line-number\" data-line-number=\"105\"></td>\r\n        <td id=\"LC105\" class=\"blob-code blob-code-inner js-file-line\">\t<span class=\"pl-k\">assert</span> sleep_time <span class=\"pl-k\">&gt;</span> <span class=\"pl-c1\">0.0</span>, <span class=\"pl-s\"><span class=\"pl-pds\">&quot;</span>Please allow for positive non-zero &#39;sleep&#39; delay between usb checks!<span class=\"pl-pds\">&quot;</span></span></td>\r\n      </tr>\r\n      <tr>\r\n        <td id=\"L106\" class=\"blob-num js-line-number\" data-line-number=\"106\"></td>\r\n        <td id=\"LC106\" class=\"blob-code blob-code-inner js-file-line\">\t<span class=\"pl-k\">return</span> devices, sleep_time</td>\r\n      </tr>\r\n      <tr>\r\n        <td id=\"L107\" class=\"blob-num js-line-number\" data-line-number=\"107\"></td>\r\n        <td id=\"LC107\" class=\"blob-code blob-code-inner js-file-line\">\t</td>\r\n      </tr>\r\n      <tr>\r\n        <td id=\"L108\" class=\"blob-num js-line-number\" data-line-number=\"108\"></td>\r\n        <td id=\"LC108\" class=\"blob-code blob-code-inner js-file-line\"><span class=\"pl-k\">def</span> <span class=\"pl-en\">loop</span>(<span class=\"pl-smi\">whitelisted_devices</span>, <span class=\"pl-smi\">sleep_time</span>):</td>\r\n      </tr>\r\n      <tr>\r\n        <td id=\"L109\" class=\"blob-num js-line-number\" data-line-number=\"109\"></td>\r\n        <td id=\"LC109\" class=\"blob-code blob-code-inner js-file-line\">\t<span class=\"pl-c\"># Main loop that checks every &#39;sleep_time&#39; seconds if computer should be killed.</span></td>\r\n      </tr>\r\n      <tr>\r\n        <td id=\"L110\" class=\"blob-num js-line-number\" data-line-number=\"110\"></td>\r\n        <td id=\"LC110\" class=\"blob-code blob-code-inner js-file-line\">\t<span class=\"pl-c\"># Allows only whitelisted usb devices to connect!</span></td>\r\n      </tr>\r\n      <tr>\r\n        <td id=\"L111\" class=\"blob-num js-line-number\" data-line-number=\"111\"></td>\r\n        <td id=\"LC111\" class=\"blob-code blob-code-inner js-file-line\">\t<span class=\"pl-c\"># Does not allow usb device that was present during program start to disconnect!</span></td>\r\n      </tr>\r\n      <tr>\r\n        <td id=\"L112\" class=\"blob-num js-line-number\" data-line-number=\"112\"></td>\r\n        <td id=\"LC112\" class=\"blob-code blob-code-inner js-file-line\">\tstart_devices <span class=\"pl-k\">=</span> lsusb()</td>\r\n      </tr>\r\n      <tr>\r\n        <td id=\"L113\" class=\"blob-num js-line-number\" data-line-number=\"113\"></td>\r\n        <td id=\"LC113\" class=\"blob-code blob-code-inner js-file-line\">\tacceptable_devices <span class=\"pl-k\">=</span> <span class=\"pl-c1\">set</span>(start_devices <span class=\"pl-k\">+</span> whitelisted_devices)</td>\r\n      </tr>\r\n      <tr>\r\n        <td id=\"L114\" class=\"blob-num js-line-number\" data-line-number=\"114\"></td>\r\n        <td id=\"LC114\" class=\"blob-code blob-code-inner js-file-line\">\t</td>\r\n      </tr>\r\n      <tr>\r\n        <td id=\"L115\" class=\"blob-num js-line-number\" data-line-number=\"115\"></td>\r\n        <td id=\"LC115\" class=\"blob-code blob-code-inner js-file-line\">\t<span class=\"pl-c\"># Write to logs that loop is starting:</span></td>\r\n      </tr>\r\n      <tr>\r\n        <td id=\"L116\" class=\"blob-num js-line-number\" data-line-number=\"116\"></td>\r\n        <td id=\"LC116\" class=\"blob-code blob-code-inner js-file-line\">\tmsg <span class=\"pl-k\">=</span> <span class=\"pl-s\"><span class=\"pl-pds\">&quot;</span>Started patrolling the USB ports every <span class=\"pl-pds\">&quot;</span></span> <span class=\"pl-k\">+</span> <span class=\"pl-c1\">str</span>(sleep_time) <span class=\"pl-k\">+</span> <span class=\"pl-s\"><span class=\"pl-pds\">&quot;</span> seconds...<span class=\"pl-pds\">&quot;</span></span></td>\r\n      </tr>\r\n      <tr>\r\n        <td id=\"L117\" class=\"blob-num js-line-number\" data-line-number=\"117\"></td>\r\n        <td id=\"LC117\" class=\"blob-code blob-code-inner js-file-line\">\tlog(msg)</td>\r\n      </tr>\r\n      <tr>\r\n        <td id=\"L118\" class=\"blob-num js-line-number\" data-line-number=\"118\"></td>\r\n        <td id=\"LC118\" class=\"blob-code blob-code-inner js-file-line\">\t<span class=\"pl-k\">print</span>(msg)</td>\r\n      </tr>\r\n      <tr>\r\n        <td id=\"L119\" class=\"blob-num js-line-number\" data-line-number=\"119\"></td>\r\n        <td id=\"LC119\" class=\"blob-code blob-code-inner js-file-line\">\t</td>\r\n      </tr>\r\n      <tr>\r\n        <td id=\"L120\" class=\"blob-num js-line-number\" data-line-number=\"120\"></td>\r\n        <td id=\"LC120\" class=\"blob-code blob-code-inner js-file-line\">\t<span class=\"pl-c\"># Main loop</span></td>\r\n      </tr>\r\n      <tr>\r\n        <td id=\"L121\" class=\"blob-num js-line-number\" data-line-number=\"121\"></td>\r\n        <td id=\"LC121\" class=\"blob-code blob-code-inner js-file-line\">\t<span class=\"pl-k\">while</span> <span class=\"pl-c1\">True</span>:</td>\r\n      </tr>\r\n      <tr>\r\n        <td id=\"L122\" class=\"blob-num js-line-number\" data-line-number=\"122\"></td>\r\n        <td id=\"LC122\" class=\"blob-code blob-code-inner js-file-line\">\t\t<span class=\"pl-c\"># List the current usb devices</span></td>\r\n      </tr>\r\n      <tr>\r\n        <td id=\"L123\" class=\"blob-num js-line-number\" data-line-number=\"123\"></td>\r\n        <td id=\"LC123\" class=\"blob-code blob-code-inner js-file-line\">\t\tcurrent_devices <span class=\"pl-k\">=</span> lsusb()</td>\r\n      </tr>\r\n      <tr>\r\n        <td id=\"L124\" class=\"blob-num js-line-number\" data-line-number=\"124\"></td>\r\n        <td id=\"LC124\" class=\"blob-code blob-code-inner js-file-line\">\t\t</td>\r\n      </tr>\r\n      <tr>\r\n        <td id=\"L125\" class=\"blob-num js-line-number\" data-line-number=\"125\"></td>\r\n        <td id=\"LC125\" class=\"blob-code blob-code-inner js-file-line\">\t\t<span class=\"pl-c\"># Check that all current devices are in the set of acceptable devices</span></td>\r\n      </tr>\r\n      <tr>\r\n        <td id=\"L126\" class=\"blob-num js-line-number\" data-line-number=\"126\"></td>\r\n        <td id=\"LC126\" class=\"blob-code blob-code-inner js-file-line\">\t\t<span class=\"pl-k\">for</span> device <span class=\"pl-k\">in</span> current_devices:</td>\r\n      </tr>\r\n      <tr>\r\n        <td id=\"L127\" class=\"blob-num js-line-number\" data-line-number=\"127\"></td>\r\n        <td id=\"LC127\" class=\"blob-code blob-code-inner js-file-line\">\t\t\t<span class=\"pl-k\">if</span> device <span class=\"pl-k\">not</span> <span class=\"pl-k\">in</span> acceptable_devices:</td>\r\n      </tr>\r\n      <tr>\r\n        <td id=\"L128\" class=\"blob-num js-line-number\" data-line-number=\"128\"></td>\r\n        <td id=\"LC128\" class=\"blob-code blob-code-inner js-file-line\">\t\t\t\tkill_computer()</td>\r\n      </tr>\r\n      <tr>\r\n        <td id=\"L129\" class=\"blob-num js-line-number\" data-line-number=\"129\"></td>\r\n        <td id=\"LC129\" class=\"blob-code blob-code-inner js-file-line\">\t\t\t\t</td>\r\n      </tr>\r\n      <tr>\r\n        <td id=\"L130\" class=\"blob-num js-line-number\" data-line-number=\"130\"></td>\r\n        <td id=\"LC130\" class=\"blob-code blob-code-inner js-file-line\">\t\t<span class=\"pl-c\"># Check that all start devices are still present in current devices</span></td>\r\n      </tr>\r\n      <tr>\r\n        <td id=\"L131\" class=\"blob-num js-line-number\" data-line-number=\"131\"></td>\r\n        <td id=\"LC131\" class=\"blob-code blob-code-inner js-file-line\">\t\t<span class=\"pl-k\">for</span> device <span class=\"pl-k\">in</span> start_devices:</td>\r\n      </tr>\r\n      <tr>\r\n        <td id=\"L132\" class=\"blob-num js-line-number\" data-line-number=\"132\"></td>\r\n        <td id=\"LC132\" class=\"blob-code blob-code-inner js-file-line\">\t\t\t<span class=\"pl-k\">if</span> device <span class=\"pl-k\">not</span> <span class=\"pl-k\">in</span> current_devices:</td>\r\n      </tr>\r\n      <tr>\r\n        <td id=\"L133\" class=\"blob-num js-line-number\" data-line-number=\"133\"></td>\r\n        <td id=\"LC133\" class=\"blob-code blob-code-inner js-file-line\">\t\t\t\tkill_computer()</td>\r\n      </tr>\r\n      <tr>\r\n        <td id=\"L134\" class=\"blob-num js-line-number\" data-line-number=\"134\"></td>\r\n        <td id=\"LC134\" class=\"blob-code blob-code-inner js-file-line\">\t\t\t\t</td>\r\n      </tr>\r\n      <tr>\r\n        <td id=\"L135\" class=\"blob-num js-line-number\" data-line-number=\"135\"></td>\r\n        <td id=\"LC135\" class=\"blob-code blob-code-inner js-file-line\">\t\tsleep(sleep_time)</td>\r\n      </tr>\r\n      <tr>\r\n        <td id=\"L136\" class=\"blob-num js-line-number\" data-line-number=\"136\"></td>\r\n        <td id=\"LC136\" class=\"blob-code blob-code-inner js-file-line\">\r\n</td>\r\n      </tr>\r\n      <tr>\r\n        <td id=\"L137\" class=\"blob-num js-line-number\" data-line-number=\"137\"></td>\r\n        <td id=\"LC137\" class=\"blob-code blob-code-inner js-file-line\"><span class=\"pl-k\">def</span> <span class=\"pl-en\">exit_handler</span>(<span class=\"pl-smi\">signum</span>, <span class=\"pl-smi\">frame</span>):</td>\r\n      </tr>\r\n      <tr>\r\n        <td id=\"L138\" class=\"blob-num js-line-number\" data-line-number=\"138\"></td>\r\n        <td id=\"LC138\" class=\"blob-code blob-code-inner js-file-line\">\t<span class=\"pl-k\">print</span>(<span class=\"pl-s\"><span class=\"pl-pds\">&quot;</span><span class=\"pl-cce\">\\n</span>Exiting because exit signal was received<span class=\"pl-cce\">\\n</span><span class=\"pl-pds\">&quot;</span></span>)</td>\r\n      </tr>\r\n      <tr>\r\n        <td id=\"L139\" class=\"blob-num js-line-number\" data-line-number=\"139\"></td>\r\n        <td id=\"LC139\" class=\"blob-code blob-code-inner js-file-line\">\tlog(<span class=\"pl-s\"><span class=\"pl-pds\">&quot;</span>Exiting because exit signal was received<span class=\"pl-pds\">&quot;</span></span>)</td>\r\n      </tr>\r\n      <tr>\r\n        <td id=\"L140\" class=\"blob-num js-line-number\" data-line-number=\"140\"></td>\r\n        <td id=\"LC140\" class=\"blob-code blob-code-inner js-file-line\">\tsys.exit(<span class=\"pl-c1\">0</span>)</td>\r\n      </tr>\r\n      <tr>\r\n        <td id=\"L141\" class=\"blob-num js-line-number\" data-line-number=\"141\"></td>\r\n        <td id=\"LC141\" class=\"blob-code blob-code-inner js-file-line\">\r\n</td>\r\n      </tr>\r\n      <tr>\r\n        <td id=\"L142\" class=\"blob-num js-line-number\" data-line-number=\"142\"></td>\r\n        <td id=\"LC142\" class=\"blob-code blob-code-inner js-file-line\"><span class=\"pl-k\">if</span> <span class=\"pl-c1\">__name__</span><span class=\"pl-k\">==</span><span class=\"pl-s\"><span class=\"pl-pds\">&quot;</span>__main__<span class=\"pl-pds\">&quot;</span></span>:</td>\r\n      </tr>\r\n      <tr>\r\n        <td id=\"L143\" class=\"blob-num js-line-number\" data-line-number=\"143\"></td>\r\n        <td id=\"LC143\" class=\"blob-code blob-code-inner js-file-line\">\t<span class=\"pl-c\"># Check arguments</span></td>\r\n      </tr>\r\n      <tr>\r\n        <td id=\"L144\" class=\"blob-num js-line-number\" data-line-number=\"144\"></td>\r\n        <td id=\"LC144\" class=\"blob-code blob-code-inner js-file-line\">\targs <span class=\"pl-k\">=</span> sys.argv[<span class=\"pl-c1\">1</span>:]</td>\r\n      </tr>\r\n      <tr>\r\n        <td id=\"L145\" class=\"blob-num js-line-number\" data-line-number=\"145\"></td>\r\n        <td id=\"LC145\" class=\"blob-code blob-code-inner js-file-line\">\t<span class=\"pl-k\">if</span> <span class=\"pl-s\"><span class=\"pl-pds\">&#39;</span>-h<span class=\"pl-pds\">&#39;</span></span> <span class=\"pl-k\">in</span> args <span class=\"pl-k\">or</span> <span class=\"pl-s\"><span class=\"pl-pds\">&#39;</span>--help<span class=\"pl-pds\">&#39;</span></span> <span class=\"pl-k\">in</span> args:</td>\r\n      </tr>\r\n      <tr>\r\n        <td id=\"L146\" class=\"blob-num js-line-number\" data-line-number=\"146\"></td>\r\n        <td id=\"LC146\" class=\"blob-code blob-code-inner js-file-line\">\t\tsys.exit(help_message)</td>\r\n      </tr>\r\n      <tr>\r\n        <td id=\"L147\" class=\"blob-num js-line-number\" data-line-number=\"147\"></td>\r\n        <td id=\"LC147\" class=\"blob-code blob-code-inner js-file-line\">\t<span class=\"pl-k\">elif</span> <span class=\"pl-c1\">len</span>(args) <span class=\"pl-k\">&gt;</span> <span class=\"pl-c1\">0</span>:</td>\r\n      </tr>\r\n      <tr>\r\n        <td id=\"L148\" class=\"blob-num js-line-number\" data-line-number=\"148\"></td>\r\n        <td id=\"LC148\" class=\"blob-code blob-code-inner js-file-line\">\t\tsys.exit(<span class=\"pl-s\"><span class=\"pl-pds\">&quot;</span><span class=\"pl-cce\">\\n</span>Argument not understood. Can only understand -h<span class=\"pl-cce\">\\n</span><span class=\"pl-pds\">&quot;</span></span>)</td>\r\n      </tr>\r\n      <tr>\r\n        <td id=\"L149\" class=\"blob-num js-line-number\" data-line-number=\"149\"></td>\r\n        <td id=\"LC149\" class=\"blob-code blob-code-inner js-file-line\">\t\t</td>\r\n      </tr>\r\n      <tr>\r\n        <td id=\"L150\" class=\"blob-num js-line-number\" data-line-number=\"150\"></td>\r\n        <td id=\"LC150\" class=\"blob-code blob-code-inner js-file-line\">\t<span class=\"pl-c\"># Check if program is run as root, else exit.</span></td>\r\n      </tr>\r\n      <tr>\r\n        <td id=\"L151\" class=\"blob-num js-line-number\" data-line-number=\"151\"></td>\r\n        <td id=\"LC151\" class=\"blob-code blob-code-inner js-file-line\">\t<span class=\"pl-c\"># Root is needed to power off the computer.</span></td>\r\n      </tr>\r\n      <tr>\r\n        <td id=\"L152\" class=\"blob-num js-line-number\" data-line-number=\"152\"></td>\r\n        <td id=\"LC152\" class=\"blob-code blob-code-inner js-file-line\">\t<span class=\"pl-k\">if</span> <span class=\"pl-k\">not</span> os.geteuid() <span class=\"pl-k\">==</span> <span class=\"pl-c1\">0</span>:</td>\r\n      </tr>\r\n      <tr>\r\n        <td id=\"L153\" class=\"blob-num js-line-number\" data-line-number=\"153\"></td>\r\n        <td id=\"LC153\" class=\"blob-code blob-code-inner js-file-line\">\t\tsys.exit(<span class=\"pl-s\"><span class=\"pl-pds\">&quot;</span><span class=\"pl-cce\">\\n</span>This program needs to run as root.<span class=\"pl-cce\">\\n</span><span class=\"pl-pds\">&quot;</span></span>)</td>\r\n      </tr>\r\n      <tr>\r\n        <td id=\"L154\" class=\"blob-num js-line-number\" data-line-number=\"154\"></td>\r\n        <td id=\"LC154\" class=\"blob-code blob-code-inner js-file-line\">\t</td>\r\n      </tr>\r\n      <tr>\r\n        <td id=\"L155\" class=\"blob-num js-line-number\" data-line-number=\"155\"></td>\r\n        <td id=\"LC155\" class=\"blob-code blob-code-inner js-file-line\">\t<span class=\"pl-c\"># Make sure there is a logging folder</span></td>\r\n      </tr>\r\n      <tr>\r\n        <td id=\"L156\" class=\"blob-num js-line-number\" data-line-number=\"156\"></td>\r\n        <td id=\"LC156\" class=\"blob-code blob-code-inner js-file-line\">\t<span class=\"pl-k\">if</span> <span class=\"pl-k\">not</span> os.path.isdir(<span class=\"pl-s\"><span class=\"pl-pds\">&quot;</span>/var/log/usbkill/<span class=\"pl-pds\">&quot;</span></span>):</td>\r\n      </tr>\r\n      <tr>\r\n        <td id=\"L157\" class=\"blob-num js-line-number\" data-line-number=\"157\"></td>\r\n        <td id=\"LC157\" class=\"blob-code blob-code-inner js-file-line\">\t\tos.mkdir(<span class=\"pl-s\"><span class=\"pl-pds\">&quot;</span>/var/log/usbkill/<span class=\"pl-pds\">&quot;</span></span>)</td>\r\n      </tr>\r\n      <tr>\r\n        <td id=\"L158\" class=\"blob-num js-line-number\" data-line-number=\"158\"></td>\r\n        <td id=\"LC158\" class=\"blob-code blob-code-inner js-file-line\">\t</td>\r\n      </tr>\r\n      <tr>\r\n        <td id=\"L159\" class=\"blob-num js-line-number\" data-line-number=\"159\"></td>\r\n        <td id=\"LC159\" class=\"blob-code blob-code-inner js-file-line\">\t<span class=\"pl-c\"># Make sure settings file is available</span></td>\r\n      </tr>\r\n      <tr>\r\n        <td id=\"L160\" class=\"blob-num js-line-number\" data-line-number=\"160\"></td>\r\n        <td id=\"LC160\" class=\"blob-code blob-code-inner js-file-line\">\tsettings_template(SETTINGS_FILE)</td>\r\n      </tr>\r\n      <tr>\r\n        <td id=\"L161\" class=\"blob-num js-line-number\" data-line-number=\"161\"></td>\r\n        <td id=\"LC161\" class=\"blob-code blob-code-inner js-file-line\">\r\n</td>\r\n      </tr>\r\n      <tr>\r\n        <td id=\"L162\" class=\"blob-num js-line-number\" data-line-number=\"162\"></td>\r\n        <td id=\"LC162\" class=\"blob-code blob-code-inner js-file-line\">\t<span class=\"pl-c\"># Register handlers for clean exit of loop</span></td>\r\n      </tr>\r\n      <tr>\r\n        <td id=\"L163\" class=\"blob-num js-line-number\" data-line-number=\"163\"></td>\r\n        <td id=\"LC163\" class=\"blob-code blob-code-inner js-file-line\">\t<span class=\"pl-k\">for</span> sig <span class=\"pl-k\">in</span> [signal.SIGINT, signal.SIGTERM, signal.SIGQUIT, ]:</td>\r\n      </tr>\r\n      <tr>\r\n        <td id=\"L164\" class=\"blob-num js-line-number\" data-line-number=\"164\"></td>\r\n        <td id=\"LC164\" class=\"blob-code blob-code-inner js-file-line\">\t\tsignal.signal(sig, exit_handler)</td>\r\n      </tr>\r\n      <tr>\r\n        <td id=\"L165\" class=\"blob-num js-line-number\" data-line-number=\"165\"></td>\r\n        <td id=\"LC165\" class=\"blob-code blob-code-inner js-file-line\">\t\t</td>\r\n      </tr>\r\n      <tr>\r\n        <td id=\"L166\" class=\"blob-num js-line-number\" data-line-number=\"166\"></td>\r\n        <td id=\"LC166\" class=\"blob-code blob-code-inner js-file-line\">\t<span class=\"pl-c\"># Load settings</span></td>\r\n      </tr>\r\n      <tr>\r\n        <td id=\"L167\" class=\"blob-num js-line-number\" data-line-number=\"167\"></td>\r\n        <td id=\"LC167\" class=\"blob-code blob-code-inner js-file-line\">\twhitelisted_devices, sleep_time <span class=\"pl-k\">=</span> load_settings(SETTINGS_FILE)</td>\r\n      </tr>\r\n      <tr>\r\n        <td id=\"L168\" class=\"blob-num js-line-number\" data-line-number=\"168\"></td>\r\n        <td id=\"LC168\" class=\"blob-code blob-code-inner js-file-line\">\t</td>\r\n      </tr>\r\n      <tr>\r\n        <td id=\"L169\" class=\"blob-num js-line-number\" data-line-number=\"169\"></td>\r\n        <td id=\"LC169\" class=\"blob-code blob-code-inner js-file-line\">\t<span class=\"pl-c\"># Start main loop</span></td>\r\n      </tr>\r\n      <tr>\r\n        <td id=\"L170\" class=\"blob-num js-line-number\" data-line-number=\"170\"></td>\r\n        <td id=\"LC170\" class=\"blob-code blob-code-inner js-file-line\">\tloop(whitelisted_devices, sleep_time)</td>\r\n      </tr>\r\n      <tr>\r\n        <td id=\"L171\" class=\"blob-num js-line-number\" data-line-number=\"171\"></td>\r\n        <td id=\"LC171\" class=\"blob-code blob-code-inner js-file-line\">\t</td>\r\n      </tr>\r\n</table>\r\n\r\n  </div>\r\n\r\n</div>\r\n\r\n<a href=\"#jump-to-line\" rel=\"facebox[.linejump]\" data-hotkey=\"l\" style=\"display:none\">Jump to Line</a>\r\n<div id=\"jump-to-line\" style=\"display:none\">\r\n  <form accept-charset=\"UTF-8\" action=\"\" class=\"js-jump-to-line-form\" method=\"get\"><div style=\"margin:0;padding:0;display:inline\"><input name=\"utf8\" type=\"hidden\" value=\"&#x2713;\" /></div>\r\n    <input class=\"linejump-input js-jump-to-line-field\" type=\"text\" placeholder=\"Jump to line&hellip;\" autofocus>\r\n    <button type=\"submit\" class=\"btn\">Go</button>\r\n</form></div>\r\n\r\n        </div>\r\n\r\n      </div><!-- /.repo-container -->\r\n      <div class=\"modal-backdrop\"></div>\r\n    </div><!-- /.container -->\r\n  </div><!-- /.site -->\r\n\r\n\r\n    </div><!-- /.wrapper -->\r\n\r\n      <div class=\"container\">\r\n  <div class=\"site-footer\" role=\"contentinfo\">\r\n    <ul class=\"site-footer-links right\">\r\n        <li><a href=\"https://status.github.com/\" data-ga-click=\"Footer, go to status, text:status\">Status</a></li>\r\n      <li><a href=\"https://developer.github.com\" data-ga-click=\"Footer, go to api, text:api\">API</a></li>\r\n      <li><a href=\"https://training.github.com\" data-ga-click=\"Footer, go to training, text:training\">Training</a></li>\r\n      <li><a href=\"https://shop.github.com\" data-ga-click=\"Footer, go to shop, text:shop\">Shop</a></li>\r\n        <li><a href=\"https://github.com/blog\" data-ga-click=\"Footer, go to blog, text:blog\">Blog</a></li>\r\n        <li><a href=\"https://github.com/about\" data-ga-click=\"Footer, go to about, text:about\">About</a></li>\r\n\r\n    </ul>\r\n\r\n    <a href=\"https://github.com\" aria-label=\"Homepage\">\r\n      <span class=\"mega-octicon octicon-mark-github\" title=\"GitHub\"></span>\r\n</a>\r\n    <ul class=\"site-footer-links\">\r\n      <li>&copy; 2015 <span title=\"0.05818s from github-fe132-cp1-prd.iad.github.net\">GitHub</span>, Inc.</li>\r\n        <li><a href=\"https://github.com/site/terms\" data-ga-click=\"Footer, go to terms, text:terms\">Terms</a></li>\r\n        <li><a href=\"https://github.com/site/privacy\" data-ga-click=\"Footer, go to privacy, text:privacy\">Privacy</a></li>\r\n        <li><a href=\"https://github.com/security\" data-ga-click=\"Footer, go to security, text:security\">Security</a></li>\r\n        <li><a href=\"https://github.com/contact\" data-ga-click=\"Footer, go to contact, text:contact\">Contact</a></li>\r\n    </ul>\r\n  </div>\r\n</div>\r\n\r\n\r\n    <div class=\"fullscreen-overlay js-fullscreen-overlay\" id=\"fullscreen_overlay\">\r\n  <div class=\"fullscreen-container js-suggester-container\">\r\n    <div class=\"textarea-wrap\">\r\n      <textarea name=\"fullscreen-contents\" id=\"fullscreen-contents\" class=\"fullscreen-contents js-fullscreen-contents\" placeholder=\"\"></textarea>\r\n      <div class=\"suggester-container\">\r\n        <div class=\"suggester fullscreen-suggester js-suggester js-navigation-container\"></div>\r\n      </div>\r\n    </div>\r\n  </div>\r\n  <div class=\"fullscreen-sidebar\">\r\n    <a href=\"#\" class=\"exit-fullscreen js-exit-fullscreen tooltipped tooltipped-w\" aria-label=\"Exit Zen Mode\">\r\n      <span class=\"mega-octicon octicon-screen-normal\"></span>\r\n    </a>\r\n    <a href=\"#\" class=\"theme-switcher js-theme-switcher tooltipped tooltipped-w\"\r\n      aria-label=\"Switch themes\">\r\n      <span class=\"octicon octicon-color-mode\"></span>\r\n    </a>\r\n  </div>\r\n</div>\r\n\r\n\r\n\r\n    \r\n    \r\n\r\n    <div id=\"ajax-error-message\" class=\"flash flash-error\">\r\n      <span class=\"octicon octicon-alert\"></span>\r\n      <a href=\"#\" class=\"octicon octicon-x flash-close js-ajax-error-dismiss\" aria-label=\"Dismiss error\"></a>\r\n      Something went wrong with that request. Please try again.\r\n    </div>\r\n\r\n\r\n      <script crossorigin=\"anonymous\" src=\"https://assets-cdn.github.com/assets/frameworks-84fc3143b171e74e470108cd11d4b5f9941e18d77c48b5129eee1cc3e2a7c210.js\"></script>\r\n      <script async=\"async\" crossorigin=\"anonymous\" src=\"https://assets-cdn.github.com/assets/github-6041f8d69bcb162df9379deea911e6650ef05c165928b3b952b10fa547d2bed2.js\"></script>\r\n      \r\n      \r\n\r\n  </body>\r\n</html>\r\n"}}