Written for Ubuntu LTS 10.4
$ sudo aptitude update $ sudo aptitude upgrade
--- a/src/configure.in | |
+++ b/src/configure.in | |
@@ -993,11 +993,17 @@ AC_ARG_ENABLE(rubyinterp, | |
AC_MSG_RESULT($enable_rubyinterp) | |
if test "$enable_rubyinterp" = "yes"; then | |
AC_MSG_CHECKING(--with-ruby-command argument) | |
+ dnl If a ruby command was provided, set RUBY_CMD to the name of the binary and RUBY_PATH to its directory | |
AC_ARG_WITH(ruby-command, [ --with-ruby-command=RUBY name of the Ruby command (default: ruby)], | |
- RUBY_CMD="$withval"; AC_MSG_RESULT($RUBY_CMD), | |
- RUBY_CMD="ruby"; AC_MSG_RESULT(defaulting to $RUBY_CMD)) |
## | |
# CarrierWave Amazon S3 File Reprocessor Rake Task | |
# | |
# Written (specifically) for: | |
# - CarrierWave | |
# - Ruby on Rails 3 | |
# - Amazon S3 | |
# | |
# Works with: | |
# - Any server of which you have write-permissions in the Rails.root/tmp directory |
MongoDB Aggregation | |
Min and Max | |
db.posts.find({}).sort({x: 1}).limit(1) return the post with the smallest value for x | |
db.posts.find({}).sort({x: -1}).limit(1) return the post with the largest value for x | |
Note: min and max queries are most efficient with an index on the field being sorted on. | |
Count | |
db.posts.count(selector) count the number of posts matching the given selector | |
db.posts.count({}) count the total number of posts |
node['filesystem']['/dev/disk0s2']['percent_used'] =~ /^(\d+)%$/ | |
percent_used = $1.to_i | |
if percent_used > 90 | |
include_recipe "raid::grow" | |
end |
!app_name | |
*.info -/var/log/app_name/rails.log | |
& @<%= log_server_ip %> | |
& ~ |
# config/assets.yml | |
# I include these assets in my layout via jammit's helpers | |
# include_javascripts :all | |
# include_stylesheets :all | |
# learn more about jammit here: http://documentcloud.github.com/jammit/ | |
compress_assets: off | |
package_path: "assets-compiled" |