Skip to content

Instantly share code, notes, and snippets.

View binary132's full-sized avatar
🎩
✧*。ヾ(。>﹏<。)ノ゙✧*。

Bodie binary132

🎩
✧*。ヾ(。>﹏<。)ノ゙✧*。
View GitHub Profile
// Bodie Solomon 2013
// TCP Echo client
#include <iostream>
#include <boost/array.hpp>
#include <boost/asio.hpp>
#define MAX_LENGTH 1024
using boost::asio::ip::tcp;
@binary132
binary132 / commonlines.pl
Created April 29, 2013 22:11
Display 100 most common lines from STDIN. Unlimited input (external sort.)
#!/usr/local/bin/perl
use strict;
use warnings;
# JBS 2013
# External sort
# read lines (possibly billions of lines) from standard input
# print out the 100 most common lines
@binary132
binary132 / hexdump.pl
Created April 22, 2013 18:17
Hex dump STDIN to STDOUT, with byte index and ASCII text display.
#!/usr/local/bin/perl
# Bodie Solomon 2013
# question 2: hex dump
use strict;
use warnings;
{
local $/ = \16;
@binary132
binary132 / primes.pl
Last active December 16, 2015 11:49
Seive of Aritosthenes in Perl (print to STDOUT all prime numbers less than or equal to N, in argument -pN).
#!/usr/bin/perl
use Getopt::Std;
use vars '$opt_p';
use strict;
use warnings;
getopts('p:');

TMUX - Single window group, multiple session.

So I have been using tmux for a while and have grown to like it and have since added many many customizations to it. Now once you start getting the hang of it, you'll naturally want to do more with the tool.

Now tmux has a concept of window-group and session and if you are like me you'll want multiple session that connects to the same window group instead of a new window group every time. Basically I just need different views into the same set of windows that I have already created, I don't want to create a new set of windows every time I fire up my terminal.

This is the default case if you simply use the tmux command as your login shell, effectively creating a new group of windows every time you start tmux.

This is less than ideal because, if you are like me, you fire up one-off terminals all the time and you don't want all those one-off jobs to stay running in the background. Plus sometimes you need information fro