Here is a description of the steps I took to cause knife bootstrap
to exit with error when the remote bootstrap process fails. I was
already calling the bootstrap programmatically (because I was adding a lot
of business logic to it) so I didn't patch the bootstrap class but
pulled out the pieces I needed.
This file contains 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
# Source accepts the protocol s3:// with the host as the bucket | |
# access_key_id and secret_access_key are just that | |
s3_file "/var/bulk/the_file.tar.gz" do | |
source "s3://your.bucket/the_file.tar.gz" | |
access_key_id your_key | |
secret_access_key your_secret | |
owner "root" | |
group "root" | |
mode 0644 | |
end |
This file contains 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 -c ' | |
echo <%= @config[:chef_node_name] %> > /tmp/chef_node_name | |
cat /tmp/chef_node_name | cut -d. -f1 > /tmp/proper_hostname | |
cat /tmp/chef_node_name | cut -d. -f2 | tr -d "\n" > /tmp/proper_dnsdomainname | |
echo -n "." >> /tmp/proper_dnsdomainname | |
cat /tmp/chef_node_name | cut -d. -f3 >> /tmp/proper_dnsdomainname | |
IPV4ADDR=`ip addr | grep eth0 | grep "inet " | cut -d " " -f 6 | cut -d \/ -f 1` |
This file contains 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
# Set cache dir | |
proxy_cache_path /var/cache/nginx levels=1:2 | |
keys_zone=microcache:5m max_size=1000m; | |
# Virtualhost/server configuration | |
server { | |
listen 80; | |
server_name yourhost.domain.com; | |
# Define cached location (may not be whole site) |
This file contains 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
Latency Comparison Numbers (~2012) | |
---------------------------------- | |
L1 cache reference 0.5 ns | |
Branch mispredict 5 ns | |
L2 cache reference 7 ns 14x L1 cache | |
Mutex lock/unlock 25 ns | |
Main memory reference 100 ns 20x L2 cache, 200x L1 cache | |
Compress 1K bytes with Zippy 3,000 ns 3 us | |
Send 1K bytes over 1 Gbps network 10,000 ns 10 us | |
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD |
This file contains 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/bash | |
if ! aws --version 2> /dev/null ; then | |
echo >&2 "command \`aws' is not found; maybe awscli is not installed" | |
exit 1 | |
fi | |
if ! jq --version 2> /dev/null ; then | |
echo >&2 "command \`jq' is not found; maybe jq is not installed" | |
exit 1 |
This file contains 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
#ulsk -UlyanovskCity -#uln -#ulpolit -ulpravda -_media73_ -#m1tv -gerontolog73 -voronin_wi -Upravdom73 -platonova1991 -pysinata -ulsez -spravedlivo_ul -Timofeev -Denc2421 -Simbirsk_RF -mintrud73 -polad_fs | |
This file contains 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
# This the bash script to handle up-and-runnig VM created through Vagrant | |
#!/usr/bin/env bash | |
# PRIVATE: error level message | |
error_message () { | |
echo "$(tput setaf 1)ERROR: $1$(tput sgr0)" | |
} | |
Concepts-Techniques-Models-Computer-Programming CMT это известная книжка CMT, за которой слава закрепилась не хуже чем у SICP
это из этой книжки классификация различных парадигм Если присмотришься, то увидишь, что Oz поддерживает большинство вариаций (с этой целью его и конструировали, чтобы можно было наглядно продемонстрировать различные подходы в одном языке)