View rdns.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
-bash-4.3$ cat projects/illumos/
GATE="joyent_20161116T172759Z"; export GATE
CODEMGR_WS="/home/caius/smartos-live/projects/illumos"; export CODEMGR_WS
maxjobs() {
ncpu=`kstat -p cpu_info:::state | grep -c on-line`
if [[ $(( $ncpu + 2 )) -lt ${MAX_JOBS} ]]; then
expr $ncpu + 2
View rubocop_default_args_assignment.rb
# 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 =` 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
type '(Fixnum, Fixnum) -> Fixnum'
def sum_rdl(a, b)
a + b
View Makefile
.PHONY: save save_config save_commands save_scripts
make -j save_config save_commands save_scripts
ssh earl "/opt/vyatta/bin/vyatta-op-cmd-wrapper show configuration" 2> /dev/null > config.txt
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/
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
View a_output.txt
"Got 0 (false)"
"Got 1 (false)"
"Got 2 (true)"
"Got 3 (false)"
"Got 4 (false)"
"Got 5 (false)"
"Got 6 (false)"
"Got 7 (false)"
"Got 8 (false)"
"Got 9 (false)"