Skip to content

Instantly share code, notes, and snippets.

View jpinnix's full-sized avatar

Jeremy Pinnix jpinnix

View GitHub Profile
task :setup_known_hosts do
run "echo 'github.com,65.74.180.52 ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAq2A7hRGmdnm9tUDbO9IDSwBK6TbQa+PXYPCPy6rbTrTtw7PHkccKrpp0yVhp5HdEIcKr6pLlVDBfOLX9QUsyCOV0wzfjIJNlGEYsdlLJizHhbn2mUjvSAHQqZETYP81eFzLQNnPHt4EVVUh7VfDESU84KezmD5QlWpXLmvU31/yMf+Se8xhHTvKSCZIFImWwoG6mbUoWf9nzpIoaSjB+weqqUUmpaaasXVal72J+UX2B+2RPW3RcT0eOzQgqlJL3RKrTJvdsjE3JEAvGq3lGHSZXy28G3skua2SmVi/w4yCE6gbODqnTWlg7+wC604ydGXA8VJiS5ap43JXiUFFAaQ==' > ~/.ssh/known_hosts"
end
before "deploy:update_code", "setup_known_hosts"
@jpinnix
jpinnix / gist:400152
Created May 13, 2010 18:07
jQuery - Make all external links open in new tab/window
// JQuery - Make all external links open in new tab/window
// Mashup of:
// http://travisroberts.tumblr.com/post/595428703/jquery-external-links-open-new-window
// http://snipplr.com/view.php?codeview&id=29949
$(document).ready(function() {
$("a[href*='http://']:not([href*='"+location.hostname+"'])").click( function() {
window.open( $(this).attr('href') );
return false;
});
@ryanb
ryanb / application.html.erb
Created January 19, 2011 19:31
Example of very simple password authentication.
<!-- layout file -->
<% if current_user %>
Welcome <%= current_user.username %>. Not you? <%= link_to "Log out", logout_path %>
<% else %>
<%= link_to "Sign up", signup_path %> or <%= link_to "log in", login_path %>.
<% end %>
@0xadada
0xadada / README.md
Last active August 5, 2022 16:48
VIM movement, keyboard commands and shortcuts
@jeremy
jeremy / schema.xml
Created April 2, 2011 00:53
Basecamp Solr schema
<?xml version="1.0" encoding="UTF-8" ?>
<schema name="basecamp" version="1.3">
<types>
<!-- indexed/stored verbatim -->
<fieldType name="string" class="solr.StrField" sortMissingLast="true" omitNorms="true" omitTermFreqAndPositions="true"/>
<!-- "true" or "false" -->
<fieldType name="boolean" class="solr.BoolField" sortMissingLast="true" omitNorms="true" omitTermFreqAndPositions="true"/>
<!-- binary data, base64 -->
@brianhempel
brianhempel / all_s3_objects.rb
Created March 21, 2012 15:21
List/fetch all objects in a bucket with AWS::S3 Ruby gem
# by default you only get 1000 objects at a time
# so you have to roll your own cursor
S3.connect!
objects = []
last_key = nil
begin
new_objects = AWS::S3::Bucket.objects(bucket_name, :marker => last_key)
objects += new_objects
@mahemoff
mahemoff / names.txt
Created April 5, 2012 22:24
Reserved username list
###
A meta-compilation of:
https://raw.github.com/gist/1453705/d253733a56632a8d2c29321a75c18b627fa4dda8/reserved_usernames.rb
http://blog.postbit.com/reserved-username-list.html
http://www.quora.com/How-do-sites-prevent-vanity-URLs-from-colliding-with-future-features
(Took out some company-specific terms at the top of the first one (e.g. imulus, stacks), added one term so far - 'edits'.)
NOTE: Does not include profanities. You may or may not want to add a list of those.
(See https://www.google.com/search?q=profanity+list, but don't try to apply regexp's here because Scunthorpe - http://en.wikipedia.org/wiki/Scunthorpe_problem)
@dstroot
dstroot / install-redis.sh
Created May 23, 2012 17:56
Install Redis on Amazon EC2 AMI
#!/bin/bash
# from here: http://www.codingsteps.com/install-redis-2-6-on-amazon-ec2-linux-ami-or-centos/
# and here: https://raw.github.com/gist/257849/9f1e627e0b7dbe68882fa2b7bdb1b2b263522004/redis-server
###############################################
# To use:
# wget https://raw.github.com/gist/2776679/04ca3bbb9f085b192f6aca945120fe12d59f15f9/install-redis.sh
# chmod 777 install-redis.sh
# ./install-redis.sh
###############################################
echo "*****************************************"
@DavidWittman
DavidWittman / clouddns-export.py
Last active December 12, 2018 01:06
Exports all domains for a Rackspace Cloud account in BIND9 format
#!/usr/bin/env python
import json
import os
import time
import clouddns
USERNAME = ''
APIKEY = ''
@marcuswestin
marcuswestin / aws-ssl-termination-digicert.md
Last active August 28, 2018 15:18
How to set up an AWS SSL terminating Elastic Load Balancer with a Digicert certificate

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