Remote Pair Programming With Tmux in the Cloud

|

I like to pair program with my fellow engineers from time to time when I’m stuck on a problem or want to ensure reviews for complex code changes don’t take a long time. Remote pair programming isn’t as high bandwidth as sitting next to each other, but the experience can be improved with the help of a telephony tool and a shared tmux session in a cloud VM.


How to Setup Ircd-hybrid With SSL on Ubuntu

|

Spotify uses IRC (internet relay chat) for instant messaging with an SSL layer for encryption. Everytime I logon I get a (notice) *** You are connected using SSL cipher "RSA-AES-128-CBC-SHA1" banner. Here’s how I setup an encrypted IRC service on my home Ubuntu server. Installing the vanilla ircd-hybrid package is straight forward, but the package in the official repo isn’t compiled with SSL support. I needed to build it myself with the SSL patch.




Farts and Craps With David Xia – Waterboarding

|

Waterboarding has been a controversial topic ever since the fall of 2007, when it was widely reported that the CIA was using waterboarding on extrajudicial prisoners and that the Justice Department authorized the procedure as an “enhanced interrogation technique.” Many consider waterboarding torture and a violation of Common Article 3 of the Geneva Conventions.

I’m in no way trying to diminish the implications waterboarding with this personal experiment. I wanted to experience waterboarding first-hand in order to better understand the context surrounding the debate. I never truly feared for my life because my trusted friends administered the waterboarding and I held a wooden block which I would drop when I couldn’t take anymore. But I can say that when done right, I felt like I was drowning. I had no control over my spasms and gags.


Ice Climbing at Lake Placid

|

I went ice climbing with some friends last weekend at Lake Placid, NY. Although it was physically punishing, it was a lot of fun. We learned a lot of rope and climbing skills and will definitely be applying them to our future spelunking or climbing trips.




Vim + Tmux + Cloud Virtual Machine = Increased Productivity

|

Recently I’ve been working with a kick-ass combination of Vim, tmux, and my cloud virtual machine that has increased my productivity.

Workflow

  1. Open terminal
  2. ssh into cloud VM
  3. Create a new tmux session (tmux new -s [session name]) or attach to an existing one (tmux attach -t [session name])
  4. List tmux sessions with tmux list-sessions
  5. Use Vim, open like 50 tabs, don’t care about it
  6. Lose network connection, put computer to sleep, abruptly or accidentally close terminal application because you’re like F**k this. I’m going home, or intentionally detach from tmux session (ctrl-b d)
  7. Reattach to tmux session
  8. BAM, it’s like you never left!

C Stdlib IO Functions and System Call Equivalents

|

I’m reading The C Programming Language and trying to remember C’s standard library functions for IO and their system call equivalents. I couldn’t find a side-by-side chart online, so I created this to help me.

C stdlib return value header system call return value header
files file pointer FILE *fp stdio.h file descriptor int td
streams stdin, stdout, stderr stdio.h 0, 1, 2
open FILE *fopen(char *name, char *mode) file pointer on success, NULL on failure stdio.h int open(char *name, int flags, int perms) file descriptor on success, -1 on error fctnl.h
create (fopen creates file if it doesn’t exist) int creat(char *name, int perms) fctnl.h
read int getc(FILE *fp); getchar = getc(stdin) next char, EOF on end of file or error stdio.h int read(int fd, char *buf, int n) number bytes read, 0 on EOF, -1 on error stdio.h
read char *fgets(char *line, int maxline); gets = fgets(stdin) *line on success, NULL on EOF or error stdio.h
write int putc(int c, FILE *fp) char written on success, EOF on error stdio.h int write(int fd, char *buf, int n) number bytes written, 0 on EOF, -1 on error stdio.h
write int fputs(char *line, FILE *fp); puts = fputs(stout) non-negative int on success, EOF on error stdio.h
close int fclose(FILE *fp) 0 on success stdio.h int close(int fd) 0 on success unistd.h
perms r, w, a
flags O_RDONLY, O_WRONLY, O_RDWR fctnl.h
BUFSIZ stdio.h