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
| ENV["WATCHR"] = "1" | |
| system 'clear' | |
| def growl(message) | |
| growlnotify = `which growlnotify`.chomp | |
| title = "Watchr Test Results" | |
| image = message.include?('0 failures, 0 errors') ? "~/.watchr_images/passed.png" : "~/.watchr_images/failed.png" | |
| options = "-w -n Watchr --image '#{File.expand_path(image)}' -m '#{message}' '#{title}'" | |
| system %(#{growlnotify} #{options} &) | |
| end |
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
| #create sites-enabled directory to hold config symlinks | |
| sudo mkdir -p /etc/nginx/sites-enabled | |
| #symlink the webapps directory to /var/www/apps | |
| sudo mkdir -p /var/www | |
| sudo ln -ns /home/minhajuddin/webapps /var/www/apps | |
| #symlink an nginx config file to a webapps config file | |
| sudo ln -ns /var/www/apps/ramanujan/config/nginx.conf /etc/nginx/sites-enabled/ramanujan.conf | |
| #hookup /etc/init.d/nginx to auto-start at startup | |
| /usr/sbin/update-rc.d -f nginx defaults |
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
| /etc/apt/sources.list #==> File which stores information about apt sources. | |
| /etc/hosts #==> Stores the dns records | |
| /etc/network/interfaces #==> Stores the network settings like ip/dhcp/gateway etc,. |
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
| wc -l `git ls-files | grep -E 'cs$|spark$|aspx$|ascx$'` |
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
| #trace mongo in RPM | |
| Mongo::Collection.class_eval do | |
| include NewRelic::Agent::MethodTracer | |
| add_method_tracer :find | |
| add_method_tracer :find_one | |
| add_method_tracer :find_and_modify | |
| add_method_tracer :update | |
| add_method_tracer :insert | |
| add_method_tracer :save | |
| add_method_tracer :remove |
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
| ctrl-z | |
| bg | |
| touch /tmp/stdout | |
| touch /tmp/stderr | |
| gdb -p $! | |
| # In GDB | |
| p dup2(open("/tmp/stdout", 1), 1) | |
| p dup2(open("/tmp/stderr", 1), 2) |
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
| task :spec do | |
| require "rspec/core/rake_task" | |
| RSpec::Core::RakeTask.new(:client) do |t| | |
| t.pattern = "spec/**/*_spec.rb" | |
| end | |
| end |
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
| # with multiple collections + commands for renaming back the collections | |
| require 'mongo' | |
| # Stop writing to your database. | |
| # Then, for each collection: | |
| # Specify the DB and COLLECTION you want to convert. | |
| # Will insert all modified documents into a new collection | |
| # called 'new_' + old_collection_name. | |
| # Then you can delete the old collection and rename the new one |
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
| require "test/unit" | |
| require "rubygems" | |
| require "mongoid" | |
| Mongoid.configure do |config| | |
| name = "embed_hash_test" | |
| host = "localhost" | |
| config.master = Mongo::Connection.new.db(name) | |
| config.persist_in_safe_mode = false | |
| end |
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
| config.metals = ["Gridfs"] |