Skip to content

Instantly share code, notes, and snippets.

View lvnilesh's full-sized avatar
💭
🏆 Vibranium Status Level

LV Nilesh lvnilesh

💭
🏆 Vibranium Status Level
View GitHub Profile
@lvnilesh
lvnilesh / class2go.wsgi
Created December 7, 2012 23:23 — forked from nveid/class2go.wsgi
class2go.wsgi
import os, sys
import site
# Remember original sys.path.
prev_sys_path = list(sys.path)
# we add currently directory to path and change to it
pwd = os.path.dirname(os.path.abspath(__file__))
os.chdir(pwd)
sys.path = [pwd] + sys.path
1021 rberger $ knife cookbook bulk delete '.*' -p -c ~/.chef.production/knife.rb
[
"activemq",
"apache2",
"apparmor",
"application",
"apt",
"aws",
"boost",
"bootstrap",
@lvnilesh
lvnilesh / setup-chef-server.sh
Created December 8, 2012 23:12
configure an Ubuntu precise machine in the cloud with ports 22, 4000, and 4040 first
# Configure an Ubuntu precise machine in the cloud with ports 22, 4000, and 4040 first
# Then logon to that machine and run this script
sudo apt-get -y install sudo wget lsb-release
echo "deb http://apt.opscode.com/ `lsb_release -cs`-0.10 main" | sudo tee /etc/apt/sources.list.d/opscode.list
sudo mkdir -p /etc/apt/trusted.gpg.d
gpg --keyserver keys.gnupg.net --recv-keys 83EF826A
gpg --export [email protected] | sudo tee /etc/apt/trusted.gpg.d/opscode-keyring.gpg > /dev/null
@lvnilesh
lvnilesh / gist:4243058
Created December 9, 2012 02:35
berks failure
➜ myface git:(master) ✗ knife hp server create \
> -E test \
> -N vial \
> -G test \
> -I 120 \
> -f 102 \
> -S hpdefault \
> -i /Users/nilesh/Downloads/hpdefault.pem \
> -x ubuntu \
> -r 'role[base]'
;;
;; Stub makefile to building xforty-drupal
;;
;----------------------------------------
; base make file
;----------------------------------------
; If you want to use the latest HEAD from 7.x branch
;includes[] = http://github.com/xforty/xforty-drupal/raw/7.x/xforty-com.make
api = 2
core = 7.x
projects[drupal][type] = core
projects[drupal][version] = 7.17
; http://drupal.org/node/1371216#comment-5600570 (fixes undefined function for text.install)
projects[drupal][patch][] = http://drupal.org/files/undefined_function_during_install-1371216-3.patch
; http://drupal.org/node/1330952#comment-5358448 (fixes "Incorrect integer value" errors with fields)
projects[drupal][patch][] = http://drupal.org/files/field_sql_storage_null_string_fix-1330952-2-D7.patch
@lvnilesh
lvnilesh / Cheffile
Created December 13, 2012 23:10 — forked from anonymous/Cheffile
#!/usr/bin/env ruby
#^syntax detection
site 'http://community.opscode.com/api/v1'
cookbook 'apache2'
@lvnilesh
lvnilesh / base.rb
Created December 14, 2012 02:31
describes a base role for our cloud instances.
name "base"
description "Base role applied to all nodes."
run_list(
"recipe[apache2]"
)
override_attributes(
:authorization => {
:sudo => {
:users => ["ubuntu"],
:passwordless => true
@lvnilesh
lvnilesh / rubber
Created December 16, 2012 19:18 — forked from anonymous/rubber
➜ Projects rails new app -d postgresql
create
create README.rdoc
create Rakefile
create config.ru
create .gitignore
create Gemfile
create app
create app/assets/images/rails.png
create app/assets/javascripts/application.js
# Ruby file to use the Google Prediction API, with a very hacked OAuth2
# You'll want to replace all the custom variables including..
# 1. Your google storage bucket name
# 2. Your google storage access credentials (note that gstore only works with "legacy" google storage access so you'll need to enabled this)
# 3. Your OAuth credentials which you setup from here https://code.google.com/apis/console/ by selecting "API Access"
# Note that I choose "Create client ID" and then "Installed Application".
#
# This script is intended to be run as a regular background process (like a cron job) to process data. It has no access to a browser and no web server to expose a callback url. Hence the hacking of OAuth2. This seems completely wrong to me but I haven't gotten any other authentication with the API to work. If anyone knows a better way please post a comment!
#