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
if Rails.env.development?
module Dragonfly
module DataStorage
class FileDataStore
def retrieve(relative_path)
validate_uid!(relative_path)
path = absolute(relative_path)
pathname = Pathname.new(path)
if !pathname.exist?
@millisami
millisami / .tmux.conf
Created April 27, 2013 08:53
tmux conf
set -g prefix C-a
unbind C-b
bind C-a send-prefix
# Make mouse useful in copy mode
setw -g mode-mouse on
# Allow mouse to select which pane to use
set -g mouse-select-pane on
Gem versions are important due to dependency pinning problems w/ Berkshelf, Chef, and Vagrant
circa March 15th, 2013.
The older version of chef won't impact the version of chef that gets provisioned on your vagrant
box, it's just for loading the knife.rb configuration.
Use bundle exec if you want these things to operate together correctly.
$ bundle exec vagrant up solo
$ bundle exec berks upload
etc...
@millisami
millisami / gist:4681229
Created January 31, 2013 08:16
phpchef
Error executing action `install` on resource 'php_pear[mysql]'
================================================================================
Errno::ENOENT
-------------
No such file or directory - pear -d preferred_state=stable search mysql
Cookbook Trace:
---------------
/var/chef/cache/cookbooks/php/providers/pear.rb:243:in `pecl?'
bash -c '
echo <%= @config[:chef_node_name] %> > /tmp/chef_node_name
cat /tmp/chef_node_name | cut -d. -f1 > /tmp/proper_hostname
cat /tmp/chef_node_name | cut -d. -f2 | tr -d "\n" > /tmp/proper_dnsdomainname
echo -n "." >> /tmp/proper_dnsdomainname
cat /tmp/chef_node_name | cut -d. -f3 >> /tmp/proper_dnsdomainname
IPV4ADDR=`ip addr | grep eth0 | grep "inet " | cut -d " " -f 6 | cut -d \/ -f 1`
@millisami
millisami / gist:4572033
Created January 19, 2013 11:00
chef-bundler-errror
This file has been truncated, but you can view the full file.
ubuntu@milli:~$ sudo chef-client -l debug
[sudo] password for ubuntu:
[2013-01-19T16:40:15+05:45] INFO: *** Chef 10.14.4 ***
[2013-01-19T16:40:15+05:45] DEBUG: Loading plugin os
[2013-01-19T16:40:15+05:45] DEBUG: Loading plugin kernel
[2013-01-19T16:40:15+05:45] DEBUG: Loading plugin ruby
[2013-01-19T16:40:15+05:45] DEBUG: Loading plugin languages
[2013-01-19T16:40:15+05:45] DEBUG: ---- Begin ruby -e "require 'rbconfig'; puts %Q(platform=#{RUBY_PLATFORM},version=#{RUBY_VERSION},release_date=#{RUBY_RELEASE_DATE},target=#{::Config::CONFIG['target']},target_cpu=#{::Config::CONFIG['target_cpu']},target_vendor=#{::Config::CONFIG['target_vendor']},target_os=#{::Config::CONFIG['target_os']},host=#{::Config::CONFIG['host']},host_cpu=#{::Config::CONFIG['host_cpu']},host_os=#{::Config::CONFIG['host_os']},host_vendor=#{::Config::CONFIG['host_vendor']},bin_dir=#{::Config::CONFIG['bindir']},ruby_bin=#{::File.join(::Config::CONFIG['bindir'], ::Config::CONFIG['ruby_install_name'])},)" STDOUT ----
[2013-01-19T16:40:15+05:45
@millisami
millisami / gist:4571033
Created January 19, 2013 06:22
knife-server-installation
○ knife server bootstrap standalone --ssh-user ubuntu --node-name milli.example.com --host 172.16.17.130
Bootstrapping Chef on 172.16.17.130
172.16.17.130 knife sudo password:
Enter your password:
172.16.17.130
172.16.17.130 + setup
172.16.17.130
172.16.17.130 + apt-get update
172.16.17.130
0% [Working]0
@millisami
millisami / gist:4563576
Created January 18, 2013 10:07
knife-server-failed-install-log
millisami at millisami in ~/ChefServers/milli.example.com
○ knife server bootstrap standalone --ssh-user ubuntu --node-name milli.example.com --host 172.16.17.130
WARNING: Failed to authenticate ubuntu - trying password auth
Enter password for ubuntu@172.16.17.130:
Bootstrapping Chef on 172.16.17.130
172.16.17.130 knife sudo password:
Enter your password:
172.16.17.130
172.16.17.130 + setup
172.16.17.130
@millisami
millisami / .rspec
Created January 11, 2013 16:14 — forked from coreyhaines/.rspec
--colour
-I app
@millisami
millisami / install-ruby-2.0.0.sh
Created November 8, 2012 17:02 — forked from sferik/install-ruby-2.0.0.sh
Instructions to install on Ruby 2.0.0 on Mac OS X with homebrew
#!/usr/bin/env sh
brew update
brew install rbenv
brew install ruby-build
brew install openssl
CONFIGURE_OPTS=--with-openssl-dir=`brew --prefix openssl` rbenv install 2.0.0-preview1