Skip to content

Instantly share code, notes, and snippets.

View rubic's full-sized avatar

Jeff Bauer rubic

  • Rubicon, Inc.
  • Nashville, Tennessee
View GitHub Profile
@rubic
rubic / gist:dbd706610a243c0aeefe
Created February 23, 2015 21:15
bash script for running Salsa locally
#!/bin/bash
SALSA_VIRTENV="salsa"
cd $HOME/.virtualenvs/$SALSA_VIRTENV
source ./bin/activate
export PYTHONPATH="$HOME/Projects"
cd $HOME/Projects/salsa
python manage.py runserver 8080
stty sane
@rubic
rubic / init.el
Created September 25, 2015 17:33
eliminate smartparens in evil
;; Alternative way to defeat smartparens-mode
(add-hook 'evil-insert-state-entry-hook 'turn-off-smartparens-mode)
(add-hook 'evil-insert-state-exit-hook 'turn-on-smartparens-mode)
@rubic
rubic / salt-minion.conf
Created January 15, 2012 20:17
Upstart configuration file for salt-minion
# salt-minion.conf
description "salt-minion upstart daemon"
author "Jeff Bauer <jbauer@rubic.com>"
# copy this file to /etc/init
start on (net-device-up and local-filesystems)
stop on shutdown
expect fork
@rubic
rubic / gist:1618625
Created January 16, 2012 01:54
salt 0.9.4 traceback on master
Traceback (most recent call last):
File "/usr/lib/python2.7/multiprocessing/process.py", line 258, in _bootstrap
self.run()
File "/usr/local/lib/python2.7/dist-packages/salt/master.py", line 295, in run
self.__bind()
File "/usr/local/lib/python2.7/dist-packages/salt/master.py", line 251, in __bind
payload = salt.payload.unpackage(package)
File "/usr/local/lib/python2.7/dist-packages/salt/payload.py", line 21, in unpackage
return pickle.loads(package_)
ValueError: unregistered extension code 164
@rubic
rubic / master
Created January 21, 2012 10:36
salt configuration for the master daemon as an unprivileged (non-root) user
############################################################################
# My current salt configuration for the master daemon as an unprivileged
# non-root user.
# https://gist.github.com/1652306
############################################################################
##### Primary configuration settings #####
##########################################
# The address of the interface to bind to
#interface: 0.0.0.0
@rubic
rubic / ec2connection.py
Created January 21, 2012 17:44
Magic for working with EC2 instances interactively with IPython
# Magic imports for working interactively (ipython)
# ipython -i ec2connection.py
import re
import boto.ec2
RegionRegex = re.compile("^us-") # all regions starting with 'us-'
class EC2(object):
def __init__(self):
@rubic
rubic / gist:1657678
Created January 22, 2012 17:00
Portable method to install Java on Ubuntu cloud images
cloud-init: ##############################################################
#cloud-config
apt_upgrade: true
apt_sources:
- source: "ppa:sun-java-community-team/sun-java6"
user-script: #############################################################
#!/bin/sh
(setq inhibit-startup-message t) ; disables splash screen
(setq initial-scratch-message nil) ; suppress initial *scratch* buffer msg
(setq transient-mark-mode t) ; highlights the selected region
(tool-bar-mode -1) ; remove the toolbar
(setq default-major-mode 'text-mode) ; make text-mode default
(setq-default fill-column 66) ; set the fill column for word wrap
(setq-default indent-tabs-mode nil) ; spaces instead of tabs by default
(mouse-wheel-mode t) ; enable mouse wheel
(setq scroll-step 1) ; scroll up by a single line
(add-to-list 'load-path "~/.emacs.d") ; load path
@rubic
rubic / gitcheck.sh
Created March 16, 2016 13:41
gitcheck: check status between local and remote repositories
#!/bin/sh
git fetch
LOCAL=$(git rev-parse @)
REMOTE=$(git rev-parse @{u})
BASE=$(git merge-base @ @{u})
if [ $LOCAL = $REMOTE ]; then
echo "Up-to-date"
@rubic
rubic / spacemacs-cheatsheet.md
Created July 8, 2016 14:33
Spacemacs cheatsheet

emacs --daemon to run in the background. emacsclient.emacs24 <filename/dirname> to open in terminal

M-m and SPC can be used interchangeably.

  • Undo - C-/
  • Redo - C-?
  • Change case: 1. Camel Case : M-c 2. Upper Case : M-u
  1. Lower Case : M-l