This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | -- show running queries (pre 9.2) | |
| SELECT procpid, age(clock_timestamp(), query_start), usename, current_query | |
| FROM pg_stat_activity | |
| WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%' | |
| ORDER BY query_start desc; | |
| -- show running queries (9.2) | |
| SELECT pid, age(clock_timestamp(), query_start), usename, query | |
| FROM pg_stat_activity | |
| WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%' | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | # By Oto Brglez - <[email protected]> | |
| # Read: | |
| # http://opennlp.apache.org/documentation/1.5.2-incubating/apidocs/opennlp-tools/index.html | |
| # http://opennlp.apache.org/documentation/1.5.2-incubating/manual/opennlp.html#tools.sentdetect.detection | |
| require 'bundler/setup' | |
| require 'ruby-debug' | |
| require 'pp' | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | #!/bin/bash | |
| # Install fake erlang packages, then the ESL package | |
| # Afterwards, installing packages that depend on erlang, like rabbitmq, | |
| # will use the ESL packaged erlang without installing the older disto ones | |
| # | |
| apt-get install equivs | |
| # Create fake erlang packages, since we are using esl-erlang instead | |
| cd /tmp | |
| apt-get install -y equivs | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | #Model | |
| @user.should have(1).error_on(:username) # Checks whether there is an error in username | |
| @user.errors[:username].should include("can't be blank") # check for the error message | |
| #Rendering | |
| response.should render_template(:index) | |
| #Redirecting | |
| response.should redirect_to(movies_path) | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | #!./bin/knife exec | |
| # A knife exec script to change chef node's name, preserving all the attributes. | |
| # | |
| # Usage: knife exec rename-node.rb old-name new-name | |
| # | |
| # Script retrieves the Node object, changes its 'name' attribute, | |
| # creates new Node object with updated name and rest of attributes | |
| # untouched. Then it deletes old Node and Client objects from | |
| # database, and logs into the server to update it: | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | #!/bin/bash | |
| for cookbook in $(find * -type d -maxdepth 0); do | |
| git clone ./ ../${cookbook} | |
| cd ../${cookbook} | |
| git remote rm origin | |
| git filter-branch --subdirectory-filter ${cookbook} -- --all | |
| git gc --aggressive | |
| done | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | from pyparsing import * | |
| # By default, PyParsing treats \n as whitespace and ignores it | |
| # In our grammer, \n is significant, so tell PyParsing not to ignore it | |
| ParserElement.setDefaultWhitespaceChars(" \t") | |
| def parse(input_string): | |
| def convert_prop_to_dict(tokens): | |
| """Convert a list of field property tokens to a dict""" | |
| prop_dict = {} | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | Quick gist on getting vsphere and vcenter and fog/vsphere going | |
| # Things to download | |
| - Download free evaluation version of window 2008 | |
| - Download free evaluation of esxi v5 | |
| - Download free evaluation of esxi vsphere (control center) iso | |
| # Install esxi in vmware fusion | |
| 1)Install esxi in vmware (select vmware/esx as host) | |
| create a user root/pipopopo | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | #################################### | |
| # BASIC REQUIREMENTS | |
| # http://graphite.wikidot.com/installation | |
| # http://geek.michaelgrace.org/2011/09/how-to-install-graphite-on-ubuntu/ | |
| # Last tested & updated 10/13/2011 | |
| #################################### | |
| sudo apt-get update | |
| sudo apt-get upgrade |