Skip to content

Instantly share code, notes, and snippets.

View jsmestad's full-sized avatar
👾

Justin Smestad jsmestad

👾
View GitHub Profile
@rodreegez
rodreegez / rails_tested.md
Created May 6, 2010 15:24
Hudson, Ruby Enterprise Edition, Nginx.

Testing Rails with Hudson CI

Written for Ubuntu LTS 10.4

Update and upgrade

  $ 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))
@thhermansen
thhermansen / carrierwave_tasks.rake
Created August 11, 2010 12:55 — forked from mrrooijen/carrierwave_tasks.rb
CarrierWave Amazon S3 reprosessor rake task
##
# 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

m1.large

Single mounted EBS, XFS

Iozone: Performance Test of File I/O
        Version $Revision: 3.308 $
  Compiled for 64 bit mode.
  Build: linux

Run began: Sun Aug 22 19:35:33 2010

m1.large

Iozone: Performance Test of File I/O
        Version $Revision: 3.308 $
  Compiled for 64 bit mode.
  Build: linux 

Contributors:William Norcott, Don Capps, Isom Crawford, Kirby Collins

Al Slater, Scott Rhine, Mike Wisner, Ken Goss

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 %>
& ~
@jacquescrocker
jacquescrocker / assets.yml
Created December 5, 2010 02:36
my barista config
# 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"
@tmm1
tmm1 / README.md
Created February 10, 2011 05:33
no longer requires any proxies! just replace your enhancers.js. also see https://gist.github.com/821736