Skip to content

Instantly share code, notes, and snippets.

@drbraden
drbraden / gist:9be3000b1e381e159632
Last active August 29, 2015 14:11
How to remap "jj" or "jk" to Escape in Atom when using vim-mode
# Built from a couple of comments at https://github.com/atom/vim-mode/issues/334
# In ~/.atom/init.coffee
atom.workspaceView.command 'insert-incomplete-keybinding', (e)->
if oe = e.originalEvent && e.originalEvent.originalEvent
char = String.fromCharCode(oe.which)
char = char.toLowerCase() unless oe.shift
atom.workspace.activePaneItem.insertText(char)
# In ~/.atom/keymap.cson
'.editor.vim-mode.insert-mode':
@drbraden
drbraden / gist:ec94c02b7a2010359a63
Created October 23, 2014 19:05
Using Capistrano to deploy files to directory not owned by user
template = ERB.new(File.read('templates/UI/httpd.conf.erb'))
result = template.result(binding)
put(result, "/etc/httpd/httpd.conf")
@drbraden
drbraden / gist:2bdb8092760e850a7f49
Last active August 29, 2015 14:06
Upgrade bash on Debian Lenny (5.0), and other older systems
#
# Method of upgrading bash on Debian 5.0, in order to fix
# the vulnerability "shellshock", officially known as:
#
# CVE-2014-6271
# CVE-2014-7169
#
# The credit for this belongs to user "cft" on Hacker News,
# for upgrading Ubuntu 8.04: https://news.ycombinator.com/item?id=8371438
#
@drbraden
drbraden / watchdock.sh
Last active December 22, 2015 01:28
Use socat to monitor docker's pipe
socat -v UNIX-LISTEN:listener,fork UNIX:/var/run/docker.sock