{"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=\"(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":{"_bbp_topic_count":0,"_bbp_reply_count":0,"_bbp_total_topic_count":0,"_bbp_total_reply_count":0,"_bbp_voice_count":0,"_bbp_anonymous_reply_count":0,"_bbp_topic_count_hidden":0,"_bbp_reply_count_hidden":0,"_bbp_forum_subforum_count":0,"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 v23.7 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\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=\"http:\/\/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=\"http:\/\/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\":\"WebPage\",\"@id\":\"http:\/\/wizardofbots.com\/network\/the-nicest-way-of-leaving-your-code-working-remotely-using-tmux\/\",\"url\":\"http:\/\/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\":\"http:\/\/wizardofbots.com\/network\/#website\"},\"primaryImageOfPage\":{\"@id\":\"http:\/\/wizardofbots.com\/network\/the-nicest-way-of-leaving-your-code-working-remotely-using-tmux\/#primaryimage\"},\"image\":{\"@id\":\"http:\/\/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\",\"dateModified\":\"2016-07-19T02:48:26+00:00\",\"author\":{\"@id\":\"http:\/\/wizardofbots.com\/network\/#\/schema\/person\/31f9e486da1c11791d94a861854a2a9f\"},\"breadcrumb\":{\"@id\":\"http:\/\/wizardofbots.com\/network\/the-nicest-way-of-leaving-your-code-working-remotely-using-tmux\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"http:\/\/wizardofbots.com\/network\/the-nicest-way-of-leaving-your-code-working-remotely-using-tmux\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"http:\/\/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\":\"http:\/\/wizardofbots.com\/network\/the-nicest-way-of-leaving-your-code-working-remotely-using-tmux\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"http:\/\/wizardofbots.com\/network\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"The nicest way of leaving your code working remotely using TMUX\"}]},{\"@type\":\"WebSite\",\"@id\":\"http:\/\/wizardofbots.com\/network\/#website\",\"url\":\"http:\/\/wizardofbots.com\/network\/\",\"name\":\"Wizard Of Bots\",\"description\":\"Botting and AI community\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"http:\/\/wizardofbots.com\/network\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"http:\/\/wizardofbots.com\/network\/#\/schema\/person\/31f9e486da1c11791d94a861854a2a9f\",\"name\":\"wizardofbots\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"http:\/\/wizardofbots.com\/network\/#\/schema\/person\/image\/\",\"url\":\"http:\/\/2.gravatar.com\/avatar\/584eebc303f64610559ab9f305f6928d?s=96&d=mm&r=g\",\"contentUrl\":\"http:\/\/2.gravatar.com\/avatar\/584eebc303f64610559ab9f305f6928d?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":"http:\/\/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":"http:\/\/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"}],"author":"wizardofbots","twitter_card":"summary_large_image","twitter_misc":{"Written by":"wizardofbots","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"http:\/\/wizardofbots.com\/network\/the-nicest-way-of-leaving-your-code-working-remotely-using-tmux\/","url":"http:\/\/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":"http:\/\/wizardofbots.com\/network\/#website"},"primaryImageOfPage":{"@id":"http:\/\/wizardofbots.com\/network\/the-nicest-way-of-leaving-your-code-working-remotely-using-tmux\/#primaryimage"},"image":{"@id":"http:\/\/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","dateModified":"2016-07-19T02:48:26+00:00","author":{"@id":"http:\/\/wizardofbots.com\/network\/#\/schema\/person\/31f9e486da1c11791d94a861854a2a9f"},"breadcrumb":{"@id":"http:\/\/wizardofbots.com\/network\/the-nicest-way-of-leaving-your-code-working-remotely-using-tmux\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["http:\/\/wizardofbots.com\/network\/the-nicest-way-of-leaving-your-code-working-remotely-using-tmux\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"http:\/\/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":"http:\/\/wizardofbots.com\/network\/the-nicest-way-of-leaving-your-code-working-remotely-using-tmux\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"http:\/\/wizardofbots.com\/network\/"},{"@type":"ListItem","position":2,"name":"The nicest way of leaving your code working remotely using TMUX"}]},{"@type":"WebSite","@id":"http:\/\/wizardofbots.com\/network\/#website","url":"http:\/\/wizardofbots.com\/network\/","name":"Wizard Of Bots","description":"Botting and AI community","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"http:\/\/wizardofbots.com\/network\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"http:\/\/wizardofbots.com\/network\/#\/schema\/person\/31f9e486da1c11791d94a861854a2a9f","name":"wizardofbots","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"http:\/\/wizardofbots.com\/network\/#\/schema\/person\/image\/","url":"http:\/\/2.gravatar.com\/avatar\/584eebc303f64610559ab9f305f6928d?s=96&d=mm&r=g","contentUrl":"http:\/\/2.gravatar.com\/avatar\/584eebc303f64610559ab9f305f6928d?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"}],"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}]}}