Skip to content

Instantly share code, notes, and snippets.

View millisami's full-sized avatar
🎯
Focusing on landing a Web3 Job

Sachin Sagar Rai millisami

🎯
Focusing on landing a Web3 Job
View GitHub Profile
@millisami
millisami / error
Created September 22, 2012 14:22
active_record connection not established
/Product/WebClient/Desktop/Rails/releases/1f22d10234dd63b3f59701dba95fbf152c4cfc38/vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:374:in `retrieve_connection': ActiveRecord::ConnectionNotEstablished (ActiveRecord::ConnectionNotEstablished)
from /Product/WebClient/Desktop/Rails/releases/1f22d10234dd63b3f59701dba95fbf152c4cfc38/vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.1/lib/active_record/connection_adapters/abstract/connection_specification.rb:168:in `retrieve_connection'
from /Product/WebClient/Desktop/Rails/releases/1f22d10234dd63b3f59701dba95fbf152c4cfc38/vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.1/lib/active_record/connection_adapters/abstract/connection_specification.rb:142:in `connection'
from /Product/WebClient/Desktop/Rails/releases/1f22d10234dd63b3f59701dba95fbf152c4cfc38/vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.1/lib/active_record/model_schema.rb:228:in `columns'
from /Product/WebClient/Desktop/Rails/releases/1f22d102
@millisami
millisami / gist:3731707
Created September 16, 2012 09:14 — forked from mhorbul/gist:3726422
set an attribute on the node
# Knife plugin to set an attribute on the node
# Usage:
# $knife node exec [nodename] 'node.set[:somevalue] = true'
class NodeExec < Chef::Knife
banner "knife node exec NODE CODE (options)"
deps do
require 'chef/search/query'
end
@millisami
millisami / gist:3691725
Created September 10, 2012 15:58 — forked from lucasfais/gist:1207002
Sublime Text 2 - Useful Shortcuts

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt
@millisami
millisami / geoip_service.rb
Created September 3, 2012 12:18 — forked from mislav/geoip_service.rb
Simple GeoIP service class using freegeoip.net and Faraday
require 'faraday_middleware'
require 'hashie/mash'
# Public: GeoIP service using freegeoip.net
#
# See https://github.com/fiorix/freegeoip#readme
#
# Examples
#
# res = GeoipService.new.call '173.194.64.19'
@millisami
millisami / perferences.json
Created August 22, 2012 11:17 — forked from soffes/perferences.json
My Sublime Text 2 config
{
"auto_complete_delay": 100,
"caret_style": "blink",
"color_scheme": "Packages/Color Scheme - Default/Twilight.tmTheme",
"draw_minimap_border": false,
"ensure_newline_at_eof_on_save": false,
"font_face": "Monaco",
"font_size": 15.0,
"highlight_line": true,
"file_exclude_patterns":
ec2-107-20-189-224.compute-1.amazonaws.com Unpacking chef (from .../tmp/chef-full_10.12.0_i386.deb) ...
ec2-107-20-189-224.compute-1.amazonaws.com
ec2-107-20-189-224.compute-1.amazonaws.com Setting up chef (10.12.0-1.ubuntu.11.04) ...
ec2-107-20-189-224.compute-1.amazonaws.com
ec2-107-20-189-224.compute-1.amazonaws.com Thank you for installing Chef!
ec2-107-20-189-224.compute-1.amazonaws.com
ec2-107-20-189-224.compute-1.amazonaws.com Processing triggers for initramfs-tools ...
ec2-107-20-189-224.compute-1.amazonaws.com
ec2-107-20-189-224.compute-1.amazonaws.com update-initramfs: Generating /boot/initrd.img-3.2.0-27-virtual
ec2-107-20-189-224.compute-1.amazonaws.com
± knife ssh -m 107.20.189.224 "sudo chef-client -l debug" --no-host-key-verify -x ubuntu -i ~/.ssh/secret.pem
107.20.189.224 /usr/local/lib/ruby/gems/1.9.1/gems/systemu-2.2.0/lib/systemu.rb:29: Use RbConfig instead of obsolete and deprecated Config.
107.20.189.224
107.20.189.224 [Wed, 08 Aug 2012 17:03:29 +0000] INFO: *** Chef 10.12.0 ***
107.20.189.224
107.20.189.224 [Wed, 08 Aug 2012 17:03:29 +0000] DEBUG: Loading plugin os
107.20.189.224
107.20.189.224 [Wed, 08 Aug 2012 17:03:29 +0000] DEBUG: Loading plugin kernel
107.20.189.224
107.20.189.224 [Wed, 08 Aug 2012 17:03:29 +0000] DEBUG: Loading plugin ruby
@millisami
millisami / code.rb
Created August 3, 2012 08:41 — forked from caius/code.rb
require "uri"
(URI::REGEXP.constants - ["PATTERN"]).each do |rc|
puts "#{rc}: #{URI::REGEXP.const_get(rc)}"
end
URI::REGEXP::PATTERN.constants.each do |pc|
puts "#{pc}: #{URI::REGEXP::PATTERN.const_get(pc)}"
end
@millisami
millisami / knife-config
Created July 27, 2012 07:53 — forked from capoferro/knife-config
Shell script to swap knife configs
#!/bin/sh
die () {
echo >&2 "$@"
exit 1
}
available_configs () {
echo "Available configs:"
ls -A ~ | grep .chef- | sed 's/.chef-//'
}
@millisami
millisami / README.md
Created July 27, 2012 07:50 — forked from atomic-penguin/README.md
multi-knife-howto

Overview

Here is an example shared configuration for knife. You can drop this off in your chef-repo/.chef/ directory, and multiple developers can use the same knife configuration to interact with more than one Chef server, or the Opscode platform.

By using Bash functions and environment variables we can change the chef server, which knife is configured to use, on the fly.

NOTE: knife will probably ignore your ~/.chef/knife.rb once you begin using a shared knife.rb in your chef-repo directory.

Preparation