{"id":650,"date":"2016-03-07T00:01:06","date_gmt":"2016-03-07T00:01:06","guid":{"rendered":"http:\/\/blog.paranoidprofessor.com\/?p=650"},"modified":"2016-03-07T00:01:06","modified_gmt":"2016-03-07T00:01:06","slug":"command-line-junkie-speed-test","status":"publish","type":"post","link":"https:\/\/blog.paranoidprofessor.com\/index.php\/2016\/03\/07\/command-line-junkie-speed-test\/","title":{"rendered":"command line junkie &#8211; speed test"},"content":{"rendered":"<p>Graphical operating systems really does make it easier to multi-task, especially for people who are not comfortable on the command line.\u00a0 It is really easy to switch between your spreadsheet, web browsers and photo viewer programs in this type of environment.<\/p>\n<p>I suppose a tabbed browser is a logical extension of that metaphor and it does make it easy to open up quite a few pages at the same time.\u00a0 I probably even open too many sites and periodically my connection seems overly slow.\u00a0 This would explain why from time to time my browsing comes to a standstill.\u00a0 It could be that I am overwhelming my bandwidth or someone else in our household is watching you-tube or perhaps even downloading a Linux distribution without my knowledge.<\/p>\n<p>In the true fashion of the user, it is easier to blame your ISP than to investigate the real source of the problem.\u00a0 As that is usually the position I usually take, my first step is usually to check my connection.<\/p>\n<p>Google will return quite a number of different speed tests that you can use to test the connection from your browser.\u00a0 I actually find the command line a quicker and easier to check as there is always one open and especially because I never bother to bookmark a speed test.<\/p>\n<p>Debian has a package which will allow me to perform my own speed test without a browser.\u00a0 It is easy enough to install it using apt-get.<\/p>\n<div class=\"sbody-code\">\n<pre><code># apt-get install speedtest-cli\r\nReading package lists... Done\r\nBuilding dependency tree\r\nReading state information... Done\r\nThe following NEW packages will be installed:\r\nspeedtest-cli\r\n0 upgraded, 1 newly installed, 0 to remove and 26 not upgraded.\r\nNeed to get 12.3 kB of archives.\r\nAfter this operation, 91.1 kB of additional disk space will be used.\r\nGet:1 http:\/\/ftp.de.debian.org\/debian\/ jessie\/main speedtest-cli all 0.3.1-1 [12.3 kB]\r\nFetched 12.3 kB in 0s (108 kB\/s)\r\nSelecting previously unselected package speedtest-cli.\r\n(Reading database ... 124629 files and directories currently installed.)\r\nPreparing to unpack ...\/speedtest-cli_0.3.1-1_all.deb ...\r\nUnpacking speedtest-cli (0.3.1-1) ...\r\nProcessing triggers for man-db (2.7.0.2-5) ...\r\nSetting up speedtest-cli (0.3.1-1) ...<\/code><\/pre>\n<\/div>\n<p>The command is great.\u00a0 Simply type <strong>speedtest<\/strong> from the command prompt to find out about the upload and download speeds.<\/p>\n<div class=\"sbody-code\">\n<pre><code># <strong>speedtest<\/strong>\r\nRetrieving speedtest.net configuration...\r\nRetrieving speedtest.net server list...\r\nTesting from Deutsche Telekom AG (79.243.68.175)...\r\nSelecting best server based on latency...\r\nHosted by Base-Mail (Frankfurt) [6.98 km]: 27.114 ms\r\nTesting download speed........................................\r\nDownload: 13.10 Mbits\/s\r\nTesting upload speed..................................................\r\nUpload: 7.26 Mbits\/s\r\n<\/code><\/pre>\n<\/div>\n<p>Oddly enough this worked just fine for a few days but then ceased to work.\u00a0 After some investigation, I cannot understand why this either worked briefly or why it stopped working at all.\u00a0 Yet the fix is pretty simple I discovered it on one of the <a href=\"https:\/\/forums.bunsenlabs.org\/viewtopic.php?id=961\" target=\"_blank\">forums<\/a>.<\/p>\n<p>Just do a small change to the speedtest_cli.py in the \/usr\/lib\/python2.7\/dist-packages directory.\u00a0 The fix is to change the name of the URL that is being called &#8211; the change is one line 345.<\/p>\n<p>From<\/p>\n<blockquote><p>uh = urlopen(&#8216;http:\/\/www.speedtest.net\/speedtest-servers-static.php&#8217;)<\/p><\/blockquote>\n<p>To<\/p>\n<blockquote><p>uh = urlopen(&#8216;http:\/\/c.speedtest.net\/speedtest-servers-static.php&#8217;)<\/p><\/blockquote>\n<p>This is a convenient tool if you are concerned about checking your Internet throughput at a given time.<\/p>\n<p>I haven&#8217;t needed to track my available throughput over the course of the day, but with this tool it wouldn&#8217;t be too much of a task to write up a small script which would run this command every five minutes and save the statistics to a file.<\/p>\n<div class=\"sbody-code\">\n<pre><code># speedtest | egrep \"Download|Upload\"\r\nDownload: 46.27 Mbits\/s\r\nUpload: 8.75 Mbits\/s<\/code><\/pre>\n<\/div>\n<p>Perhaps one of these days I will write up such a script.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Graphical operating systems really does make it easier to multi-task, especially for people who are not comfortable on the command line.\u00a0 It is really easy to switch between your spreadsheet, web browsers and photo viewer programs in this type of &hellip; <a href=\"https:\/\/blog.paranoidprofessor.com\/index.php\/2016\/03\/07\/command-line-junkie-speed-test\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[2,3],"tags":[17,39],"_links":{"self":[{"href":"https:\/\/blog.paranoidprofessor.com\/index.php\/wp-json\/wp\/v2\/posts\/650"}],"collection":[{"href":"https:\/\/blog.paranoidprofessor.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.paranoidprofessor.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.paranoidprofessor.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.paranoidprofessor.com\/index.php\/wp-json\/wp\/v2\/comments?post=650"}],"version-history":[{"count":6,"href":"https:\/\/blog.paranoidprofessor.com\/index.php\/wp-json\/wp\/v2\/posts\/650\/revisions"}],"predecessor-version":[{"id":755,"href":"https:\/\/blog.paranoidprofessor.com\/index.php\/wp-json\/wp\/v2\/posts\/650\/revisions\/755"}],"wp:attachment":[{"href":"https:\/\/blog.paranoidprofessor.com\/index.php\/wp-json\/wp\/v2\/media?parent=650"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.paranoidprofessor.com\/index.php\/wp-json\/wp\/v2\/categories?post=650"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.paranoidprofessor.com\/index.php\/wp-json\/wp\/v2\/tags?post=650"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}