Skip to content

Instantly share code, notes, and snippets.

View jdrago999's full-sized avatar

jdrago999

  • San Francisco, CA
View GitHub Profile
def hello(name)
puts "Hello, #{name}!"
end
@jdrago999
jdrago999 / signin_controller_spec.rb
Created October 15, 2014 03:37
signin_controller_spec.rb
require 'spec_helper'
describe SigninController do
describe "#signin_page" do
before do
@user = FactoryGirl.create(:user)
end
context "when the user is already signed in" do
before do
controller.sign_in(@user)
[2014-11-05T23:57:12+00:00] ERROR: cookbook_file[/home/deployer/.ssh/id_rsa.pub] (inflection::default line 67) had an error: Chef::Exceptions::FileNotFound: Cookbook 'inflection' (0.1.0) does not contain a file at any of these locations:
files/ubuntu-12.04/id_deploy.pub
files/ubuntu/id_deploy.pub
files/default/id_deploy.pub
This cookbook _does_ contain: ['/tmp/kitchen/cookbooks/inflection/files/default/id_deploy','/tmp/kitchen/cookbooks/inflection/files/default/wrap-ssh4git.sh']
[2014-11-05T23:57:12+00:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)
>>>>>> Converge failed on instance <identity-ubuntu-1204>.
>>>>>> Please see .kitchen/logs/identity-ubuntu-1204.log for more details
>>>>>> ------Exception-------
#!/usr/bin/ruby2.0
class Proxy
instance_methods.each do |m|
undef_method m unless m =~ /(^__|^send$|^object_id$)/
end
def initialize(*targets)
@targets = targets
end
#!/bin/bash
set -e
sudo su
echo '64.150.181.206 energyworksadmin.wreckage.io' >> /etc/hosts
sleep 3
echo "Attempting to connect to energyworksadmin.wreckage.io..."
{
"always_show_minimap_viewport": true,
"indent_guide_options": [ "draw_normal", "draw_active" ],
"line_padding_bottom": 1,
"line_padding_top": 1,
"highlight_modified_tabs": true,
"translate_tabs_to_spaces": true,
"find_selected_text": true,
"word_wrap": true,
"bold_folder_labels": true,
@jdrago999
jdrago999 / install-consul.sh
Last active February 15, 2017 23:42 — forked from cbednarski/install-consul.sh
Ubuntu installer script for consul
#!/bin/bash -e
set -x
mkdir -p /tmp/consul
cd /tmp/consul
# Consul Configuration File
tee consul.json <<CONSULCONFIG
{
@jdrago999
jdrago999 / gist:ca09953cf7fb6769565dcfd1beaea449
Created May 5, 2017 19:04 — forked from brianburridge/gist:11298396
How to load MySQL time zone tables from Mac OS time zone files

The easiest way to load the Mysql Time Zone tables from your Mac OS time zone fields is via this command:

mysql_tzinfo_to_sql /usr/share/zoneinfo | mysql -u root mysql

However, on many systems like mine that will fail because some of the time zone information is incompatible with the database schema for the time zone tables.

Therefore, you'll want to load the time zone information into a text file and edit it to only include the time zones you need. (Or, attempt to find the data breaking the import.)

mysql_tzinfo_to_sql /usr/share/zoneinfo > zone_import.sql
@jdrago999
jdrago999 / webpack.nginx.conf
Created June 19, 2017 17:50 — forked from SiZapPaaiGwat/webpack.nginx.conf
webpack-dev-server configuration in nginx on development server
upstream ws_server {
server 127.0.0.1:8080;
}
server {
listen 80;
server_name 10.1.2.225;
location / {
proxy_pass http://ws_server/;
@jdrago999
jdrago999 / setup-rabbitmq.sh
Last active August 23, 2017 06:24
Install RabbitMQ with basic configuration
#!/bin/bash
### Usage:
# RABBITMQ_DEFAULT_USER=someuser RABBITMQ_DEFAULT_PASS=secret123 RABBITMQ_DEFAULT_VHOST=myvhost setup-rabbitmq.sh
set -euo pipefail
apt-get update -y
apt-get install -y curl wget gnupg apt-transport-https
# Add Debian Wheezy backports repository to obtain init-system-helpers