Learn to pair program with wemux like the top Symfony2 devs

If you have been around long enough you have probably heard about wemux or tmux. The thing sounds very confusing and the readme on wemux github repo does not make it any easier to newbies like us. But I was stubborn enough to get the first human newbie readable information on what this is and how it works and how it can help. And also where I got stuck and need some real help.

So the first thing is of course to clone the repo and start following the first manual installing instructions from the reamde at https://github.com/zolrath/wemux.
The second thing is when you realize and say “what is this thing?” or “why am I doing this?”. Basically wemux is a wrapper like cli tool sitting on top of tmux. What is tmux? tmux is a terminal multiplexer tool, it basically allows splitting your windows into several panes and hook sessions with different users. You could just use tmux alone, but why trying to show off something we don’t know about? Let’s just use wemux, wemux saves us to do some hard work on tmux or so we think. So after setting everything wemux readme says we should we are still at odds because we want to know how do I tell my friend to pair program with me? Well, the thing you want to do is to first have a way your friend can connect to you and look up the same code via ssh to your computer. Then you both can edit the same file or different files at the same time in different panes. For that you would need a bit of setup.

Third thing, you want to make sure your IP is reachable by your friend. So you “port forward” from firewall to your ip on the inside. The port to forward is 22 from your router to your computer. This can be done by opening a browser on and configuring your router ADSL or other to forward a port. If you cannot figure out where that option is it would be good to take a look at your router manual.

Fourth thing, because your ubuntu or linux box is running a firewall you need to open up to forward that port 22. This advanced stuff can be summarized with the following command:

sudo iptables -L -n | grep ACCEPT  // this is just to see what is there
sudo iptables -A INPUT -p tcp --dport ssh -j ACCEPT  // this one is the real stuff that makes the difference

This command opened the firewall on my box for the ssh to not timeout. Now an external user, my friend can join my box. However he does not have a user account yet!

Fifth thing, now we create an (ssh) user account into my box.

~ sudo adduser mark
Adding user `mark' ...
Adding new group `mark' (1002) ...
Adding new user `mark' (1002) with group `mark' ...
Creating home directory `/home/mark' ...
Copying files from `/etc/skel' ...
Enter new UNIX password: 
Retype new UNIX password: 
passwd: password updated successfully
Changing the user information for mark
Enter the new value, or press ENTER for the default
	Full Name []: Mark
	Room Number []: 
	Work Phone []: 
	Home Phone []: 
	Other []: 
Is the information correct? [Y/n]

Sixth thing, now I run:

wemux start
wemux users
// then use your vim or pico editor to work on your files
// and also use tmux commands to split or do work with your panes

Tell your friend to ssh you using the ip you see in http://www.whatsmyip.org with his user and password and then ask him to try to attach to server or join you. His username has to be in the host_list or such. He then can pair program with you!
Now I have problems with the pair mode, it seems everytime my friend connects it goes into mirror mode. How to solve this?

Special thanks to my friend Mark Badolato.

Doing better than what I deserve by the Lord’s grace!

Leave a Reply

Your email address will not be published. Required fields are marked *