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
PreCommit: | |
PuppetValidate: | |
enabled: true | |
description: 'Validates puppet syntax' | |
include: '**/*.pp' |
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
repos=( | |
binder | |
mahi | |
manatee | |
manta | |
mdata-client | |
moray | |
mountain-gorilla | |
node-sdc-clients | |
node-smartdc-auth |
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
<?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]; | |
} |
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 bash | |
# Find puppet cattle running a specific branch via mco puppetd | |
# | |
# USAGE: puppetd_branch BRANCH | |
# | |
set -e | |
declare branch="$1" |
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
[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 |
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-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 |
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
# 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 |
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 "benchmark/ips" | |
require "rdl" | |
def sum(a, b) | |
a + b | |
end | |
type '(Fixnum, Fixnum) -> Fixnum' | |
def sum_rdl(a, b) | |
a + b |
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
.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 |
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 | |
# 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 | |
# |