Latest Blog Activity From Bear Den Designs

The Decider said over 2 years ago permalink Comment? (1)
Tagged: tmux vim iterm iterm2

iTerm2, tmux and vim

Switching up my development environment.

Recently I came across some posts describing tmux, a gnu/screen alternative. I use screen quite a bit but only when doing remote system admin and really enjoy it’s features. Especially being able to attach to a session that was terminated due to connectivity problems.

I had never given a second thought about using screen on my dev machine since is so quick to jump between apps. However, after reading through the Giant Robots Post I have had a re-think. In some ways I feel as though I’m stepping back 20 years but has dev really changed at all in 20 years? Maybe some of our methodologies but not the general trend of Test-Code-Deploy-Repeat.

Anyway, there are 3 tools needed to make this work on my Mac.

  1. iTerm2
  2. tmux
  3. and the best editor in the world, vim

iTerm2

Probably any terminal will do but iTerm2 is much faster at resizing than iTerm and is actively being developed.

tmux

This is a terminial multiplexor with many of the features of gnu/screen but in my opinion easier to configure. Recommended Tutorial The port version is a bit dated so I recommend installing from source. Follow the instructions. It’s your basic configure, make, make install.

vim

Now normally I run MacVim on my mac. It’s pretty. The console version courtesy of Apple seems just fine. It reads my .vimrc with no issues and behaves just great with Tim Pope’s Rails plugin.

Modifying my Behavior

This is the hardest part of the switch. I really hate my mouse and really thought that I had shun using it for many years now. However, I find myself reaching for it to switch windows when a command-tab is easier. It’s strange if I’m in my terminal I always command-tab to chrome but for some reason reach for the mouse when switching to macvim. Now that macvim is no longer in the equation I still find myself reaching for the mouse to move from my bash tmux pane to my vim pane.

Speaking of panes I run tmux full screen divided into 3 panes.

tmux_vim_bash

my .tmux.conf file:

set -g prefix C-a
unbind C-b
bind C-a send-prefix

bind-key C-a last-window

# Set status bar
set -g status-bg blue
set -g status-fg white

# Highlight active window
set-window-option -g window-status-current-bg red

# Automatically set window title
setw -g automatic-rename

# use "v" and "s" to do vertical/horizontal splits, like vim
bind s split-window -v
bind v split-window -h

# use the vim motion keys to move between panes
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R

# use vim motion keys while in copy mode
setw -g mode-keys vi
# force a reload of the config file
unbind r
bind r source-file ~/.tmux.conf
#
# # quick pane cyclingunbind ^A
bind ^A select-pane -t :.+

The Decider said over 2 years ago permalink Comment? (0)
Tagged: ruby

read this post unless busy

I really like unless but only if it makes something much more readable. Of course Jamis beat me to it

The Decider said over 2 years ago permalink Comment? (0)
Tagged: employment

We are hiring

Looking for a rails programmer with at least a Bachelors in Computer Science or Engineering and at least 2 years software development experience. This is a full time position with benefits.

We are a small but financially strong firm that expects a great attitude and superior skills. We are as agile, as possible :) and have a great passion for producing quality products.

The software we build helps children and the underserved in our communities. Your contribution will make a difference.

There is some travel 2-3 times per year.

Our office is near downtown in the trendy 5 Points/Riverside area. Lots of weird people, great restaurants and bars.

When applying a cover letter is required and should address these concerns:

  • When is the last time you created a complete RoR app? What did it do?
  • What does Array#reject! return ?
  • How do you continue your education in the field of computing?

Required Skills

  • Professional
  • Punctual
  • Great attitude
  • Exceptional Ruby Skills
    • Strong Ruby on Rails experience
  • 2 years experience software development
  • Famililiar with agile methodologies
  • At least a BS in Computer Science or Engineering
  • mySQL
  • git

Desired Skills

  • Deployment of RoR apps
  • Javascript fluent
  • Familiar with YUI
  • Haml
  • sass/CSS

The Decider said over 2 years ago permalink Comment? (0)
Tagged: ruby

EOY Ruby Roundup

I don’t know how I missed this EOY Ruby Roundup

Good stuff.

The Decider said over 3 years ago permalink Comment? (0)
Tagged: nginx

Fair Balancing for nginx

If you have a busy server running multiple mongrels you probably have noticed how nginx will sometimes queue requests onto already busy mongrels while some mongrels are completely idle.

There is now a fair balancer plugin for nginx that makes it fair rather than round robin. It’s easy to install. Grab the the plugin here and grab the latest stable release of nginx (I’m using 0.7.6) from here

Follow the directions on github:

Installation:

You’ll need to re-compile Nginx from source to include this module.
Modify your compile of Nginx by adding the following directive
(modified to suit your path of course):

./configure —with-http_ssl_module —add-module=/absolute/path/to/nginx-upstream-fair make make install

Usage:

Change your Nginx config file’s upstream block to include the ‘fair’ directive:

upstream mongrel { fair; server 127.0.0.1:5000; server 127.0.0.1:5001; server 127.0.0.1:5002; }

Caution

One issue I ran into was having to change my nginx config files that contained false to off. For example:

proxy_redirect false;

now reads

proxy_redirect off;