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
| diff --git a/cmdline.c b/cmdline.c | |
| index fdde32c..aa039ee 100644 | |
| --- a/cmdline.c | |
| +++ b/cmdline.c | |
| @@ -38,6 +38,9 @@ const char *gengetopt_args_info_help[] = { | |
| " -s, --slope=STRING Either zero|positive|negative|both (default='both')", | |
| " -x, --tmax=INT The maximum time in seconds between gmetric calls \n (default='60')", | |
| " -d, --dmax=INT The lifetime in seconds of this metric (default='0')", | |
| + " -g, --group=STRING Group of the metric", | |
| + " -D, --desc=STRING Description of the metric", |
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
| # Get source | |
| wget http://sourceforge.net/projects/ganglia/files/ganglia%20monitoring%20core/3.1.7/ganglia-3.1.7.tar.gz/download | |
| tar xzf ganglia-3.1.7.tar.gz | |
| cd ganglia-3.1.7 | |
| # Get dependencies | |
| sudo apt-get install libapr1-dev libconfuse-dev libexpat1-dev libpcre3-dev | |
| # Apply patch (http://gist.github.com/633214) | |
| cd gmetric |
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
| sysconfdir appears to be the default value | |
| Prior to release 3.1.3, Ganglia ignored the value of sysconfdir | |
| passed to configure and would always use /etc/ganglia | |
| This is considered a bug because the help text from configure | |
| informs the user that the default location is PREFIX/etc | |
| If you wish to continue using /etc/ganglia for gmond.conf and | |
| other configuration files, you must now explicitly specify | |
| --sysconfdir=/etc/ganglia |
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
| class User < ActiveRecord::Base | |
| typed_serialize :preferences, Array | |
| end | |
| ruby-1.9.1-p378 > User.first.preferences | |
| RuntimeError: implicit argument passing of super from method defined by define_method() is not supported. Specify all arguments explicitly. | |
| from /Users/toby/.rvm/gems/ruby-1.9.1-p378@jibe/gems/typed_serialize-0.1.0/lib/typed_serialize.rb:7:in `block in typed_serialize' | |
| from (irb):3 | |
| from /Users/toby/.rvm/rubies/ruby-1.9.1-p378/bin/irb:17:in `<main>' |
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
| function pwdx { | |
| lsof -a -p $1 -d cwd -n | tail -1 | awk '{print $NF}' | |
| } |
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
| $ find public/images/ -iname *mtv* | |
| $ find public/images/ -iname *MTV* | |
| public/images//MTV Networks.png | |
| public/images//small_mtv.png | |
| $ sudo port install findutils | |
| $ gfind public/images/ -iname *mtv* | |
| public/images/MTV Networks.png |
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
| function gemcd { | |
| cd $(dirname $(gem which $1)) | |
| } |
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 'mongo' | |
| db = Mongo::Connection.new('test-db') | |
| coll = db.collection('test') | |
| coll.size # => 0 | |
| doc = { 'date' => Time.now.utc, 'other' => 'asdfasdf' } | |
| coll.insert(doc) | |
| record = coll.find.first | |
| record['date'].class # => Time |
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
| # Example of association mapping in ElasticSearch. Assumes ES is running on localhost:9200 (the default). | |
| # Clear index. | |
| curl -XDELETE 'localhost:9200/testassoc' | |
| # Store 'B' objects. | |
| curl -XPUT 'localhost:9200/testassoc/B/1' -d '{ | |
| "content" : "Lorem ipsum dolor sit amet, consectetuer adipiscing elit" | |
| }' | |
| curl -XPUT 'localhost:9200/testassoc/B/2' -d '{ |
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
| # Example of association mapping in ElasticSearch. Assumes ES is running on localhost:9200 (the default). | |
| # Clear index. | |
| curl -XDELETE 'localhost:9200/testassoc' | |
| # Store 'B' objects. | |
| curl -XPUT 'localhost:9200/testassoc/B/1' -d '{ | |
| "content" : "Lorem ipsum dolor sit amet, consectetuer adipiscing elit" | |
| }' | |
| curl -XPUT 'localhost:9200/testassoc/B/2' -d '{ |