Skip to content

Instantly share code, notes, and snippets.

Skyler Layne skylerto

Block or report user

Report or block skylerto

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View hab-Vagrantfile.rb
# -*- mode: ruby -*-
# vi: set ft=ruby :
# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure("2") do |config|
config.vm.box = "bento/centos-7.4"
config.vm.network "private_network", ip: "192.168.33.10"
@skylerto
skylerto / config.rb
Created Mar 24, 2018
Example config.rb for chef
View config.rb
# => .chef/config.rb
# see https://docs.chef.io/config_rb.html
# Chef commands interaction
cookbook_path ['path_to_cookbooks']
# Knife commands will run against local as opposed to a chef server,
# files created on the local as opposed to temp files then upload to chef
# server.
View local_chef_server.sh
#!/bin/bash
SSL_PORT=8443
CHEF_DIR=$(pwd)/.chef
# docker run --privileged -t --name localhost -d -p $SSL_PORT:443 -e CONTAINER_NAME=localhost cbuisson/chef-server
if [ -d "$CHEF_DIR" ]; then
rm -rf $CHEF_DIR
fi
@skylerto
skylerto / clean_docker_nexus.sh
Created Jan 12, 2018 — forked from matzegebbe/clean_docker_nexus.sh
Nexus Repository Manager keep the last X docker images delete all other
View clean_docker_nexus.sh
#!/bin/bash
REPO_URL="https://repository.xxx.net/repository/"
USER="admin"
PASSWORD="datpassword"
BUCKET="portal-docker"
KEEP_IMAGES=10
IMAGES=$(curl --silent -X GET -H 'Accept: application/vnd.docker.distribution.manifest.v2+json' -u ${USER}:${PASSWORD} "${REPO_URL}${BUCKET}/v2/_catalog" | jq .repositories | jq -r '.[]' )
@skylerto
skylerto / change.rb
Created Dec 19, 2017
Structs and attributes: wrapping a Struct in a class
View change.rb
require 'ostruct'
module AutomateSoup
##
# Class to represent operations on a change.
#
class Change
def initialize(hash)
@source = OpenStruct.new hash
end
@skylerto
skylerto / gist:9277afb86fa1bcf078dd0535888e8dc6
Created Dec 11, 2017 — forked from amokan/gist:3881064
jenkins-cli commands (v1.485)
View gist:9277afb86fa1bcf078dd0535888e8dc6
build
Builds a job, and optionally waits until its completion.
cancel-quiet-down
Cancel the effect of the "quiet-down" command.
clear-queue
Clears the build queue
connect-node
Reconnect to a node
copy-job
Copies a job.
View inspecting.rs
extern crate serde_json;
extern crate handlebars;
#[macro_use]
extern crate maplit;
use std::path::Path;
use handlebars::Handlebars;
use serde_json::Value;
View perl_modules.rb
$LOAD_PATH.unshift(*Dir[File.expand_path('../vendor/gems/**/lib', __FILE__)])
require 'ruby_expect'
# Custom resource based on the InSpec resource DSL
class PerlModules < Inspec.resource(1)
name 'perl_modules'
desc "
Perl Modules resource for extracting the perl modules via instmodsh.
View email.rb
require 'mail'
args = ARGV
user = args[0]
pass = args[1]
options = { :address => "smtp.gmail.com",
:port => 587,
:user_name => user,
:password => pass,
View properties.rb
module Properties
class << self
def load_properties(properties_filename)
properties = {}
File.open(properties_filename, 'r') do |properties_file|
properties_file.read.each_line do |line|
line.strip!
if (line[0] != ?# and line[0] != ?=)
i = line.index('=')
if (i)
You can’t perform that action at this time.