Skip to content

Instantly share code, notes, and snippets.

1: Generate CSR

openssl req -new -newkey rsa:2048 -nodes -keyout server-cert.key -out server-cert-sign-req.csr

# Country Name (2 letter code) [AU]:US
# State or Province Name (full name) [Some-State]:California
# Locality Name (eg, city) []:
# Organization Name (eg, company) [Internet Widgits Pty Ltd]:Flutterby Labs, Inc.
# Organizational Unit Name (eg, section) []:
# Common Name (eg, YOUR name) []:www.dogo.co
@re5et
re5et / edit.sh
Last active August 29, 2015 14:05
EDITOR=edit
#! /bin/bash
emacsclient -e "(external-edit \"$1\")" > /dev/null
@re5et
re5et / gist:bc9d8e5847b5fd697d15
Created February 5, 2015 19:30
The reasons we set START_CTX in our unicorn config
atom
so @keefe, the deal with the unicorn restart problem is this:
1) When restarting, unicorn takes the binary for the rails unicorn bin from $0
2) capistrano releases are changing this location
3) unicorn expects the binary it is using to stay in the same spot ($0)
so after: https://github.com/Bluescape/thoughtstream-chef/pull/278 and https://github.com/substantial/cookbook-rails_nginx_unicorn/pull/12
(defun next-instance-of()
"Find next instance of current word."
(interactive)
(let (myStr)
(setq myStr (thing-at-point 'word))
(search-forward myStr)
(backward-word)
))
(defun previous-instance-of()
# -*- mode: ruby -*-
# vi: set ft=ruby :
# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure(2) do |config|
# The most common configuration options are documented and commented below.
# For a complete reference, please see the online documentation at
@re5et
re5et / gist:863259
Created March 9, 2011 23:42
change_source_images_collection_name.rb
class ChangeSourceImagesCollectionName < Mongoid::Migration
def self.up
collection = connection.collection('source_images')
collection.rename('imagickals')
end
def self.down
collection = connection.collection('imagickals')
collection.rename('source_images')
end
@re5et
re5et / test
Created May 6, 2011 03:00
a test gist
revision 3
@re5et
re5et / gist:981235
Created May 19, 2011 17:05
git pre-commit hook to keep console.log out of commited code.
#!/bin/sh
has_console_log=$(git diff --cached | fgrep 'console.log')
if [ "$has_console_log" != "" ]
then
echo "ERROR: You have console.log in your commit. Remove them."
exit 1
fi
@re5et
re5et / gist:1384314
Created November 21, 2011 23:16
jQuery detach, work, reattach
(function($) {
$.fn.dwr = function(fn){
return this.each(function() {
var $this = $(this);
var tmpElement = $('<div/>');
$(this).after(tmpElement);
$this.detach();
fn.call(this);
tmpElement.replaceWith($this);
});
@re5et
re5et / grepkill.sh
Created June 7, 2012 20:26
grepkill
#! /bin/bash
case "$1" in
'' | -h | --help)
NOARGS=1 ;;
-d)
DRY=1; FIND=$2 ;;
*)
DRY=0; FIND=$1 ;;
esac