{"id":64,"date":"2016-07-19T02:48:26","date_gmt":"2016-07-19T02:48:26","guid":{"rendered":"http:\/\/wizardofbots.com\/network\/?p=64"},"modified":"2016-07-19T02:48:26","modified_gmt":"2016-07-19T02:48:26","slug":"the-nicest-way-of-leaving-your-code-working-remotely-using-tmux","status":"publish","type":"post","link":"http:\/\/wizardofbots.com\/network\/the-nicest-way-of-leaving-your-code-working-remotely-using-tmux\/","title":{"rendered":"The nicest way of leaving your code working remotely using TMUX"},"content":{"rendered":"<p>TMUX is tha maaaaan! Sure as death that you are going to love this! Remember when you ran a scan on a remote VPS? every time that you left it working it got the broken pipe, so you lost the session and you don&#8217;t get the results you wanted till the end of the code.<\/p>\n<p>But with TMUX, you can leave running many SSH &#8220;sessions\/terminals&#8221; working many processes. You can leave scrapers, scanners, crawlers, and even an app working on nginx\/apache. Its like using all the process of your VPS and not losing any single fucking penny!<\/p>\n<p>Its something like this:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter\" src=\"https:\/\/media.giphy.com\/media\/xCjz6HAYhoTEA\/giphy.gif\" width=\"620\" height=\"320\" \/><\/p>\n<p>So let&#8217;s get physical now, for having tmux, of course you need to have linux on any provider you want, it can be 512 MB RAM, $5 USD on <a href=\"https:\/\/m.do.co\/c\/4fa73dd93a0c\" target=\"_blank\">Digitalocean<\/a>. Then once you have it, connect via SSH on the terminal like: ssh root@ip.<\/p>\n<p>Once you are in, make sure you have tmux installed:<\/p>\n<blockquote><p>sudo apt-get install tmux<\/p><\/blockquote>\n<p>Then, to open make sure to type <strong>tmux <\/strong> on the terminal and it will open.<\/p>\n<p>So basic navigation on the tmux would be this by default:<\/p>\n<ul>\n<li><strong><em>Ctrl-b c<\/em><\/strong> Create new window<\/li>\n<li><strong><em>Ctrl-b d<\/em><\/strong> Detach current client<\/li>\n<li><em><strong>Ctrl-b l<\/strong><\/em> Move to previously selected window<\/li>\n<li><em><strong>Ctrl-b n<\/strong><\/em> Move to the next window<\/li>\n<li><em><strong>Ctrl-b p<\/strong><\/em> Move to the previous window<\/li>\n<li><em><strong>Ctrl-b &amp;<\/strong><\/em> Kill the current window<\/li>\n<li><em><strong>Ctrl-b ,<\/strong><\/em> Rename the current window<\/li>\n<li><em><strong>Ctrl-b %<\/strong><\/em> Split the current window into two panes<\/li>\n<li><em><strong>Ctrl-b q<\/strong><\/em> Show pane numbers (used to switch between panes)<\/li>\n<li><em><strong>Ctrl-b o<\/strong><\/em> Switch to the next pane<\/li>\n<li><em><strong>Ctrl-b ?<\/strong><\/em> List all keybindings<\/li>\n<\/ul>\n<p>The trick here is that you can have as many SSH windows you want doing <strong>Ctrl-b c <\/strong>and then running other process that you can navigate with <em><strong>Ctrl-b n<\/strong><\/em> and\u00a0<em><strong>Ctrl-b p\u00a0<\/strong>(from next, previous)<\/em> , else you can have your window split if you do <strong>Ctrl-b % <\/strong> and you can watch all in panels.<\/p>\n<p><strong>IMPORTANT: <\/strong>If you want to exit TMUX and leave the session working with the scripts you ran, you have to do <strong>CTRL-B D <\/strong> which means it will detach.<\/p>\n<p>Then afterwards, when you come back from your procrastination you can go and type:<\/p>\n<blockquote><p><strong>tmux attach <\/strong><\/p><\/blockquote>\n<p>Which will make you restore your tmux session that you left working with other processes.<\/p>\n<p>Then when you come back to your session, you will see everything is finished or keep running extracting more data<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-65 size-full\" src=\"http:\/\/wizardofbots.com\/network\/wp-content\/uploads\/2016\/07\/tmux1.jpg\" alt=\"tmux1\" width=\"654\" height=\"459\" srcset=\"http:\/\/wizardofbots.com\/network\/wp-content\/uploads\/2016\/07\/tmux1.jpg 654w, http:\/\/wizardofbots.com\/network\/wp-content\/uploads\/2016\/07\/tmux1-600x421.jpg 600w, http:\/\/wizardofbots.com\/network\/wp-content\/uploads\/2016\/07\/tmux1-300x211.jpg 300w\" sizes=\"auto, (max-width: 654px) 100vw, 654px\" \/><\/p>\n<p>So now you know how to take the most of what you pay for the VPS, hope you like it and leave the love dudes ;).<\/p>\n<p>Here is a good vid that explains deeply more about tmux:<\/p>\n<p><iframe loading=\"lazy\" width=\"640\" height=\"360\" src=\"https:\/\/www.youtube.com\/embed\/BHhA_ZKjyxo\" frameborder=\"0\" allowfullscreen><\/iframe><\/p>\n","protected":false},"excerpt":{"rendered":"<p>TMUX is tha maaaaan! Sure as death that you are going to love this! Remember when you ran a scan on a remote VPS? every time that you left it working it got the broken pipe, so you lost the session and you don&#8217;t get the results you wanted till the end of the code. [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[15],"tags":[7,8,37,36,9],"class_list":["post-64","post","type-post","status-publish","format-standard","hentry","category-linux","tag-linux","tag-ssh","tag-tips","tag-tmux","tag-tutorials"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.8 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>The nicest way of leaving your code working remotely using TMUX - Wizard Of Bots<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/wizardofbots.com\/network\/the-nicest-way-of-leaving-your-code-working-remotely-using-tmux\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"The nicest way of leaving your code working remotely using TMUX - Wizard Of Bots\" \/>\n<meta property=\"og:description\" content=\"TMUX is tha maaaaan! Sure as death that you are going to love this! Remember when you ran a scan on a remote VPS? every time that you left it working it got the broken pipe, so you lost the session and you don&#8217;t get the results you wanted till the end of the code. [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/wizardofbots.com\/network\/the-nicest-way-of-leaving-your-code-working-remotely-using-tmux\/\" \/>\n<meta property=\"og:site_name\" content=\"Wizard Of Bots\" \/>\n<meta property=\"article:published_time\" content=\"2016-07-19T02:48:26+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/media.giphy.com\/media\/xCjz6HAYhoTEA\/giphy.gif\" \/>\n<meta name=\"author\" content=\"wizardofbots\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"wizardofbots\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/wizardofbots.com\\\/network\\\/the-nicest-way-of-leaving-your-code-working-remotely-using-tmux\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/wizardofbots.com\\\/network\\\/the-nicest-way-of-leaving-your-code-working-remotely-using-tmux\\\/\"},\"author\":{\"name\":\"wizardofbots\",\"@id\":\"https:\\\/\\\/wizardofbots.com\\\/network\\\/#\\\/schema\\\/person\\\/31f9e486da1c11791d94a861854a2a9f\"},\"headline\":\"The nicest way of leaving your code working remotely using TMUX\",\"datePublished\":\"2016-07-19T02:48:26+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/wizardofbots.com\\\/network\\\/the-nicest-way-of-leaving-your-code-working-remotely-using-tmux\\\/\"},\"wordCount\":438,\"commentCount\":0,\"image\":{\"@id\":\"https:\\\/\\\/wizardofbots.com\\\/network\\\/the-nicest-way-of-leaving-your-code-working-remotely-using-tmux\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/media.giphy.com\\\/media\\\/xCjz6HAYhoTEA\\\/giphy.gif\",\"keywords\":[\"linux\",\"ssh\",\"tips\",\"tmux\",\"tutorials\"],\"articleSection\":[\"Linux\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/wizardofbots.com\\\/network\\\/the-nicest-way-of-leaving-your-code-working-remotely-using-tmux\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/wizardofbots.com\\\/network\\\/the-nicest-way-of-leaving-your-code-working-remotely-using-tmux\\\/\",\"url\":\"https:\\\/\\\/wizardofbots.com\\\/network\\\/the-nicest-way-of-leaving-your-code-working-remotely-using-tmux\\\/\",\"name\":\"The nicest way of leaving your code working remotely using TMUX - Wizard Of Bots\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/wizardofbots.com\\\/network\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/wizardofbots.com\\\/network\\\/the-nicest-way-of-leaving-your-code-working-remotely-using-tmux\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/wizardofbots.com\\\/network\\\/the-nicest-way-of-leaving-your-code-working-remotely-using-tmux\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/media.giphy.com\\\/media\\\/xCjz6HAYhoTEA\\\/giphy.gif\",\"datePublished\":\"2016-07-19T02:48:26+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/wizardofbots.com\\\/network\\\/#\\\/schema\\\/person\\\/31f9e486da1c11791d94a861854a2a9f\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/wizardofbots.com\\\/network\\\/the-nicest-way-of-leaving-your-code-working-remotely-using-tmux\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/wizardofbots.com\\\/network\\\/the-nicest-way-of-leaving-your-code-working-remotely-using-tmux\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/wizardofbots.com\\\/network\\\/the-nicest-way-of-leaving-your-code-working-remotely-using-tmux\\\/#primaryimage\",\"url\":\"https:\\\/\\\/media.giphy.com\\\/media\\\/xCjz6HAYhoTEA\\\/giphy.gif\",\"contentUrl\":\"https:\\\/\\\/media.giphy.com\\\/media\\\/xCjz6HAYhoTEA\\\/giphy.gif\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/wizardofbots.com\\\/network\\\/the-nicest-way-of-leaving-your-code-working-remotely-using-tmux\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/wizardofbots.com\\\/network\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"The nicest way of leaving your code working remotely using TMUX\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/wizardofbots.com\\\/network\\\/#website\",\"url\":\"https:\\\/\\\/wizardofbots.com\\\/network\\\/\",\"name\":\"Wizard Of Bots\",\"description\":\"Botting and AI community\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/wizardofbots.com\\\/network\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/wizardofbots.com\\\/network\\\/#\\\/schema\\\/person\\\/31f9e486da1c11791d94a861854a2a9f\",\"name\":\"wizardofbots\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/f4b6351c857f15c433133aefc9869032236fea91dbe65dd274896d7dec23d0bd?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/f4b6351c857f15c433133aefc9869032236fea91dbe65dd274896d7dec23d0bd?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/f4b6351c857f15c433133aefc9869032236fea91dbe65dd274896d7dec23d0bd?s=96&d=mm&r=g\",\"caption\":\"wizardofbots\"},\"url\":\"http:\\\/\\\/wizardofbots.com\\\/network\\\/author\\\/wizardofbots\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"The nicest way of leaving your code working remotely using TMUX - Wizard Of Bots","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/wizardofbots.com\/network\/the-nicest-way-of-leaving-your-code-working-remotely-using-tmux\/","og_locale":"en_US","og_type":"article","og_title":"The nicest way of leaving your code working remotely using TMUX - Wizard Of Bots","og_description":"TMUX is tha maaaaan! Sure as death that you are going to love this! Remember when you ran a scan on a remote VPS? every time that you left it working it got the broken pipe, so you lost the session and you don&#8217;t get the results you wanted till the end of the code. [&hellip;]","og_url":"https:\/\/wizardofbots.com\/network\/the-nicest-way-of-leaving-your-code-working-remotely-using-tmux\/","og_site_name":"Wizard Of Bots","article_published_time":"2016-07-19T02:48:26+00:00","og_image":[{"url":"https:\/\/media.giphy.com\/media\/xCjz6HAYhoTEA\/giphy.gif","type":"","width":"","height":""}],"author":"wizardofbots","twitter_card":"summary_large_image","twitter_misc":{"Written by":"wizardofbots","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/wizardofbots.com\/network\/the-nicest-way-of-leaving-your-code-working-remotely-using-tmux\/#article","isPartOf":{"@id":"https:\/\/wizardofbots.com\/network\/the-nicest-way-of-leaving-your-code-working-remotely-using-tmux\/"},"author":{"name":"wizardofbots","@id":"https:\/\/wizardofbots.com\/network\/#\/schema\/person\/31f9e486da1c11791d94a861854a2a9f"},"headline":"The nicest way of leaving your code working remotely using TMUX","datePublished":"2016-07-19T02:48:26+00:00","mainEntityOfPage":{"@id":"https:\/\/wizardofbots.com\/network\/the-nicest-way-of-leaving-your-code-working-remotely-using-tmux\/"},"wordCount":438,"commentCount":0,"image":{"@id":"https:\/\/wizardofbots.com\/network\/the-nicest-way-of-leaving-your-code-working-remotely-using-tmux\/#primaryimage"},"thumbnailUrl":"https:\/\/media.giphy.com\/media\/xCjz6HAYhoTEA\/giphy.gif","keywords":["linux","ssh","tips","tmux","tutorials"],"articleSection":["Linux"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/wizardofbots.com\/network\/the-nicest-way-of-leaving-your-code-working-remotely-using-tmux\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/wizardofbots.com\/network\/the-nicest-way-of-leaving-your-code-working-remotely-using-tmux\/","url":"https:\/\/wizardofbots.com\/network\/the-nicest-way-of-leaving-your-code-working-remotely-using-tmux\/","name":"The nicest way of leaving your code working remotely using TMUX - Wizard Of Bots","isPartOf":{"@id":"https:\/\/wizardofbots.com\/network\/#website"},"primaryImageOfPage":{"@id":"https:\/\/wizardofbots.com\/network\/the-nicest-way-of-leaving-your-code-working-remotely-using-tmux\/#primaryimage"},"image":{"@id":"https:\/\/wizardofbots.com\/network\/the-nicest-way-of-leaving-your-code-working-remotely-using-tmux\/#primaryimage"},"thumbnailUrl":"https:\/\/media.giphy.com\/media\/xCjz6HAYhoTEA\/giphy.gif","datePublished":"2016-07-19T02:48:26+00:00","author":{"@id":"https:\/\/wizardofbots.com\/network\/#\/schema\/person\/31f9e486da1c11791d94a861854a2a9f"},"breadcrumb":{"@id":"https:\/\/wizardofbots.com\/network\/the-nicest-way-of-leaving-your-code-working-remotely-using-tmux\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/wizardofbots.com\/network\/the-nicest-way-of-leaving-your-code-working-remotely-using-tmux\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/wizardofbots.com\/network\/the-nicest-way-of-leaving-your-code-working-remotely-using-tmux\/#primaryimage","url":"https:\/\/media.giphy.com\/media\/xCjz6HAYhoTEA\/giphy.gif","contentUrl":"https:\/\/media.giphy.com\/media\/xCjz6HAYhoTEA\/giphy.gif"},{"@type":"BreadcrumbList","@id":"https:\/\/wizardofbots.com\/network\/the-nicest-way-of-leaving-your-code-working-remotely-using-tmux\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/wizardofbots.com\/network\/"},{"@type":"ListItem","position":2,"name":"The nicest way of leaving your code working remotely using TMUX"}]},{"@type":"WebSite","@id":"https:\/\/wizardofbots.com\/network\/#website","url":"https:\/\/wizardofbots.com\/network\/","name":"Wizard Of Bots","description":"Botting and AI community","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/wizardofbots.com\/network\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/wizardofbots.com\/network\/#\/schema\/person\/31f9e486da1c11791d94a861854a2a9f","name":"wizardofbots","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/f4b6351c857f15c433133aefc9869032236fea91dbe65dd274896d7dec23d0bd?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/f4b6351c857f15c433133aefc9869032236fea91dbe65dd274896d7dec23d0bd?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/f4b6351c857f15c433133aefc9869032236fea91dbe65dd274896d7dec23d0bd?s=96&d=mm&r=g","caption":"wizardofbots"},"url":"http:\/\/wizardofbots.com\/network\/author\/wizardofbots\/"}]}},"_links":{"self":[{"href":"http:\/\/wizardofbots.com\/network\/wp-json\/wp\/v2\/posts\/64","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/wizardofbots.com\/network\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/wizardofbots.com\/network\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/wizardofbots.com\/network\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/wizardofbots.com\/network\/wp-json\/wp\/v2\/comments?post=64"}],"version-history":[{"count":1,"href":"http:\/\/wizardofbots.com\/network\/wp-json\/wp\/v2\/posts\/64\/revisions"}],"predecessor-version":[{"id":66,"href":"http:\/\/wizardofbots.com\/network\/wp-json\/wp\/v2\/posts\/64\/revisions\/66"}],"wp:attachment":[{"href":"http:\/\/wizardofbots.com\/network\/wp-json\/wp\/v2\/media?parent=64"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/wizardofbots.com\/network\/wp-json\/wp\/v2\/categories?post=64"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/wizardofbots.com\/network\/wp-json\/wp\/v2\/tags?post=64"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}