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
| RSpec.configure do |config| | |
| config.mock_with :rr | |
| config.before do | |
| any_instance_of User do |u| | |
| stub(u).save_attached_files { true } | |
| stub(u).destroy_attached_files { true } | |
| end | |
| 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
| var ifconfig = require('./ifconfig'); | |
| ifconfig.inet4(function(result) { | |
| console.log(result); | |
| }); |
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
| #!/bin/sh | |
| DNS_KEY=/path/to/example.com.key | |
| DOMAIN=example.com | |
| USER_DATA=`/usr/bin/curl -s http://169.254.169.254/latest/user-data` | |
| HOSTNAME=`echo $USER_DATA` | |
| hostname $HOSTNAME.$DOMAIN | |
| LOCIP=`/usr/bin/curl -s http://169.254.169.254/latest/meta-data/local-ipv4` |
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
| /(?:25[0-5]|2[0-4]\d|1\d\d|\d\d|\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|\d\d|\d)){3}/ |
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
| script "add key" do | |
| interpreter "bash" | |
| user "root" | |
| not_if "apt-key list | grep 7F0CEB10" | |
| code <<-EOC | |
| apt-key adv --keyserver keyserver.ubuntu.com --recv 7F0CEB10 | |
| EOC | |
| end | |
| script "add aptline" do |
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
| script "add key" do | |
| interpreter "bash" | |
| user "root" | |
| not_if "apt-key list | grep 7F0CEB10" | |
| code <<-EOC | |
| apt-key adv --keyserver keyserver.ubuntu.com --recv 7F0CEB10 | |
| EOC | |
| end | |
| script "add aptline" do |
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
| package "libcurl4-openssl-dev" | |
| gem_package "passenger" do | |
| gem_binary "#{node['ruby']['current']}/bin/gem" | |
| options "--no-ri --no-rdoc" | |
| end | |
| script "install nginx with passenger" do | |
| interpreter "bash" | |
| user "root" |
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
| template "/etc/network/if-up.d/tcp_keepalive_time" do | |
| source "/etc/network/if-up.d/tcp_keepalive_time.erb" | |
| owner "root" | |
| group "root" | |
| mode "0744" | |
| end | |
| script "change tcp keepalive" do | |
| interpreter "bash" | |
| user "root" |
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 Time | |
| def unixtime(options = {}) | |
| if options[:millis] | |
| (to_i * 1000) + ('%03d' % [usec / 1000.0]).to_i | |
| else | |
| to_i | |
| end | |
| 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
| sudo apt-get install lmdadm | |
| sudo mdadm -C /dev/md0 -l10 -n4 -f /dev/xvdf[1234] |