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
| #!/usr/bin/env ruby | |
| require 'json' | |
| username = ENV['OS_USERNAME'] | |
| tenant = ENV['OS_TENANT_NAME'] | |
| password = ENV['OS_PASSWORD'] | |
| # Get the fqdn of the server | |
| fqdn = `facter fqdn`.strip | |
| puts fqdn |
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
| description "fcarbon" | |
| author "Joe Topjian" | |
| start on (local-filesystems and net-device-up IFACE=eth0) | |
| stop on runlevel [016] | |
| respawn | |
| respawn limit 5 60 | |
| exec /usr/local/bin/fcarbon.rb |
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/bash | |
| mem_total=$(cat /proc/meminfo | awk '/^MemTotal/ { print $2; }') | |
| mem_free=$(cat /proc/meminfo | awk '/^MemFree/ { print $2; }') | |
| swap_free=$(cat /proc/meminfo | awk '/^SwapFree/ { print $2; }') | |
| swap_total=$(cat /proc/meminfo | awk '/^SwapTotal/ { print $2; }') | |
| slab_size=$(cat /proc/meminfo | awk '/^Slab/ { print $2; }') | |
| dcache_size=$(cat /proc/meminfo | awk '/^Cached/ { print $2; }') | |
| swapcache_size=$(cat /proc/meminfo | awk '/^SwapCached/ { print $2; }') |
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
| #!/usr/bin/env ruby | |
| require 'net/http' | |
| require 'uri' | |
| require 'json' | |
| require 'pp' | |
| consul_url = 'http://localhost:8500/v1/catalog' | |
| output = {} | |
| s_json = JSON.parse(Net::HTTP.get_response(URI.parse("#{consul_url}/services")).body) |
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
| procs -----------memory---------- ---swap-- -----io---- -system-- ------cpu----- | |
| r b swpd free buff cache si so bi bo in cs us sy id wa st | |
| 4 0 41688 24564 32840 296028 0 0 15 373 1 0 0 1 98 1 0 | |
| 0 0 41688 24528 32840 296084 0 0 44 0 426 1940 1 1 99 0 0 | |
| 0 0 41688 24340 32840 296124 0 0 40 34232 1076 4655 0 2 98 0 0 | |
| 2 0 41688 24260 32840 296168 0 0 44 0 455 4252 1 1 98 0 0 | |
| 0 0 41688 24308 32840 296220 0 0 56 0 683 1179 0 1 99 0 0 | |
| 0 1 41688 24244 32848 296260 0 0 40 376 949 2282 1 1 92 5 0 | |
| 0 0 41688 24216 32848 296292 0 0 64 0 876 1491 1 1 94 4 0 | |
| 0 0 41688 24092 32848 296372 0 0 72 0 829 2689 1 0 99 0 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
| { | |
| "sensu": [ | |
| <%- sensu_api_endpoints = scope['uchiwa::sensu_api_endpoints'] -%> | |
| <%- default_endpoint = scope['uchiwa::params::sensu_api_endpoints'][0] -%> | |
| <%- sensu_api_endpoints.each_with_index do |endpoint, i| -%> | |
| { | |
| "name": "<%= endpoint['name'] || default_endpoint['name'] %>", | |
| "host": "<%= endpoint['host'] || default_endpoint['host'] %>", | |
| "ssl": <%= endpoint['ssl'] || default_endpoint['ssl'] %>, | |
| "insecure": <%= endpoint['insecure'] || default_endpoint['insecure']%>, |
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
| <% if @ssl and @ssl_versions.count > 0-%> | |
| {ssl, [{versions, [<%= @ssl_versions.sort.map { |v| "'#{v}'" }.join(', ') %>]}]}, | |
| <% end -%> | |
| (snip) | |
| <%- if @ssl -%> | |
| {ssl_listeners, [<%= @ssl_port %>]}, | |
| {ssl_options, [<%- if @ssl_cacert != 'UNSET' -%>{cacertfile,"<%= @ssl_cacert %>"},<%- end -%> | |
| {certfile,"<%= @ssl_cert %>"}, |
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
| --- dhclient-script.orig 2015-01-28 18:29:27.253629187 +0000 | |
| +++ dhclient-script 2015-01-28 18:30:06.360597495 +0000 | |
| @@ -354,8 +354,7 @@ | |
| [ ! "${old_broadcast_address}" = "${new_broadcast_address}" ] || | |
| [ ! "${old_routers}" = "${new_routers}" ] || | |
| [ ! "${old_interface_mtu}" = "${new_interface_mtu}" ]; then | |
| - ip -4 addr add ${new_ip_address}/${new_prefix} broadcast ${new_broadcast_address} dev ${interface} \ | |
| - valid_lft ${new_dhcp_lease_time} preferred_lft ${new_dhcp_lease_time} >/dev/null 2>&1 | |
| + ip -4 addr add ${new_ip_address}/${new_prefix} broadcast ${new_broadcast_address} dev ${interface} >/dev/null 2>&1 | |
| ip link set dev ${interface} up |
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
| require 'etc' | |
| # First get a list of users via the homedir_users fact | |
| # | |
| # An example of this file looks like: | |
| # $ cat /etc/facter/facts.d/homedir_users.yaml | |
| # --- | |
| # homedir_users: | |
| # - root | |
| # - jdoe |
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/bash | |
| sudo apt-get update | |
| sudo apt-get install -y git make mercurial | |
| GOPKG=go1.4.2.linux-amd64.tar.gz | |
| wget https://storage.googleapis.com/golang/$GOPKG | |
| sudo tar -xvf $GOPKG -C /usr/local/ | |
| mkdir ~/go |