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
| rvm install 1.9.2 -C --with-readline-dir=/opt/local,--build=x86_64-apple-darwin10 | |
| rvm use --create 1.9.2@rails3 | |
| rvm use --create 1.9.2@rails2 | |
| rvm use system | |
| rvm use 1.9.2@rails3 |
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
| disable oom-killer | |
| Run as root or add to script - for passenger | |
| for pid in $(pidof PassengerNginxHelperServer) ; do echo "disabling oom on pid $pid"; echo -17 | tee /proc/$pid/oom_adj > /dev/null; 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
| delete from solr - delete by query | |
| curl http://hostname:port/solr/update --data-binary '<delete><query>id:123456</query></delete>' -H 'Content-type:text/xml; charset=utf-8' | |
| curl http://hostname:port/solr/update --data-binary '<commit waitFlush="false" waitSearcher="false" expungeDeletes="true"/>' -H 'Content-type:text/xml; charset=utf-8' |
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
| bash < <( curl -L http://rvm.beginrescueend.com/releases/rvm-install-head ) | |
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
| echo "deb http://packages.devstructure.com lucid main" | sudo tee /etc/apt/sources.list.d/devstructure.list | |
| sudo wget -O /etc/apt/trusted.gpg.d/devstructure.gpg http://packages.devstructure.com/keyring.gpg | |
| sudo apt-get update | |
| sudo apt-get -y install blueprint |
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
| sum [n | n <- [3..999], n `mod` 5 == 0 || n `mod` 3 == 0] |
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
| vals = [0, 1] | |
| 34.times do | |
| val = vals[-1] + vals[-2] | |
| vals.push(val) if val < 4000000 | |
| end | |
| vals.select{|item| item % 2 == 0 }.inject(:+) |
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
| octave:2> max(factor(600851475143)) |
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
| def palindrome?(str); str.reverse == str; end | |
| max = 0 | |
| 900.upto(999) { |a| | |
| a.upto(999) { |b| | |
| max = [max, a * b].max if palindrome?((a * b).to_s) | |
| } | |
| } | |
| max |
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
| (400..2432902008176640000).step(20).each do |i| | |
| val = (1..20).to_a.select{|x| i%x==0}&(1..20).to_a | |
| if val.count == 20 | |
| puts i | |
| exit | |
| end | |
| end | |
| Use the product of the LCM's |
OlderNewer