View gist:54b062dcfdfe4647db8e9468726742db
repos=(
binder
mahi
manatee
manta
mdata-client
moray
mountain-gorilla
node-sdc-clients
node-smartdc-auth
View rdns.php
<?php
// Looks up the IP address accessing us and prints rDNS record
$remote_ip = $_SERVER["REMOTE_ADDR"];
if (strstr($remote_ip, ', ')) {
$ips = explode(', ', $remote_ip);
$remote_ip = $ips[0];
}
View puppetd_branch
#!/usr/bin/env bash
# Find puppet cattle running a specific branch via mco puppetd
#
# USAGE: puppetd_branch BRANCH
#
set -e
declare branch="$1"
View error.txt
[root@headnode (ovh-1) ~]# sdcadm experimental update -y --all -x sapi -x moray -x binder -x manatee
Finding candidate update images for 25 services (manta, adminui, ca, amon, napi,
vm-agent, dhcpd, amonredis, workflow, net-agent, cn-agent, vmapi, ufds, mahi, cloudapi,
imgapi, fwapi, sdc, cnapi, docker, papi, redis, dockerlogger, cns, assets).
Using channel support
Note: There are no "manta" instances. Only the service configuration will be updated.
This update will make the following changes:
download 1 image (193 MiB):
image 33eec75a-85e4-11e6-8c40-977055a06d03
View illumos.sh
-bash-4.3$ cat projects/illumos/illumos.sh
NIGHTLY_OPTIONS="-CimMNnt"; export NIGHTLY_OPTIONS
GATE="joyent_20161116T172759Z"; export GATE
CODEMGR_WS="/home/caius/smartos-live/projects/illumos"; export CODEMGR_WS
MAX_JOBS=8; export MAX_JOBS
maxjobs() {
ncpu=`kstat -p cpu_info:::state | grep -c on-line`
if [[ $(( $ncpu + 2 )) -lt ${MAX_JOBS} ]]; then
expr $ncpu + 2
else
View rubocop_default_args_assignment.rb
# USAGE:
# rubocop -r ./tmp/rubocop_default_args_assignment.rb --only Style/RubocopDefaultArgsAssigmment app/
#
# Finds method definitions like `def my_thing(date = date)` which are circular references in ruby 2.3.1
# Change them to `def my_thing(date = self.date)` to maintain behaviour
#
module RuboCop
module Cop
module Style
# Check if default args are circular assignments
View simple_rdl_benchmark.rb
require "benchmark/ips"
require "rdl"
def sum(a, b)
a + b
end
type '(Fixnum, Fixnum) -> Fixnum'
def sum_rdl(a, b)
a + b
View Makefile
.PHONY: save save_config save_commands save_scripts
save:
make -j save_config save_commands save_scripts
save_config:
ssh earl "/opt/vyatta/bin/vyatta-op-cmd-wrapper show configuration" 2> /dev/null > config.txt
save_commands:
ssh earl "/opt/vyatta/bin/vyatta-op-cmd-wrapper show configuration commands" 2> /dev/null > commands.txt
View gfm_code_block.rb
#!/usr/bin/env ruby
# Converts a markdown file from 4-space code blocks to ``` gated code blocks.
# aka, normal markdown code blocks to Github Formatted markdown code blocks.
#
# Usage:
#
# ruby gfm_code_block.rb path/to/file.md
#
View list_sentence.rb
# Turn a list of elements into a sentence listing them
#
# Expected outcomes:
# [] => ""
# %w(one) => "one"
# %(one two) => "one and two"
# %w(one two three) => "one, two and three"
#
def list_sentence(elements)
case elements.size