Skip to content

Instantly share code, notes, and snippets.

View Sauraus's full-sized avatar
:octocat:
Coding

Antek Baranski Sauraus

:octocat:
Coding
  • Vid Inc
  • Los Angeles, CA
View GitHub Profile
@Sauraus
Sauraus / editor.rb
Last active November 3, 2015 01:57
Unity cookbook
#
# Cookbook Name:: unity
# Library:: editor
#
# Copyright (C) 2015 Disney Consumer Products Interactive
#
# All rights reserved - Do Not Redistribute
#
require 'chef/resource'
@Sauraus
Sauraus / gist:774985a7f80b78bbcbd2
Last active November 17, 2015 22:54
Funky berks version constraint
[(xxxxx = 6.1.7) -> (ark = 1.0.1)], [(yyyyyy = 9.0.15) -> (maven = 0.16.4) -> (ark >= 0.0.0)], [(yyyyyy = 9.0.15) -> (maven = {1.1.0,1.3.0}) -> (ark ~> 0.4)], [(yyyyyy = 9.0.15) -> (maven = 2.0.1) -> (ark ~> 0.9)], [(yyyyyy = 9.0.15) -> (groovy = 0.0.1) -> (ark >= 0.0.0)], [(yyyyyy = 9.0.15) -> (ark >= 0.0.0)], [(zzzzzzzzzzzzz = 1.1.7) -> (xxxxx = 6.1.7) -> (ark = 1.0.1)]`
@Sauraus
Sauraus / gist:5977921
Created July 11, 2013 18:30
Example Multi OS & Multi guest VagrantFile
Vagrant.require_plugin "vagrant-windows"
win2k8_servers = {
:www => {
:hostname => "www",
:rdp_port => 3390,
:winrm_port => 5986
},
:api => {
:hostname => "api",
if provider
# Verify that the given provider matches what the box has.
if box_provider.to_sym != provider
@logger.error("Added box provider doesnt match expected: #{box_provider}")
raise Errors::BoxProviderDoesntMatch, :expected => provider, :actual => box_provider
end
else
# We weren't given a provider, so store this one.
provider = box_provider.to_sym
@Sauraus
Sauraus / gist:6127168
Created July 31, 2013 23:29
How to add version attribute here?
pkgs.flatten.each do |pkg|
r = package pkg do
action( node['build_essential']['compiletime'] ? :nothing : :install )
end
r.run_action(:install) if node['build_essential']['compiletime']
end
@Sauraus
Sauraus / memcached_instance.rb
Created August 12, 2013 17:53
Why is the :port not merged into the params hash for the definition?
define :memcached_instance do
include_recipe "runit"
include_recipe "memcached"
opts = params
runit_service "memcached-#{params[:name]}" do
run_template_name "memcached"
default_logger true
cookbook "memcached"
@Sauraus
Sauraus / recipe.rb
Last active January 22, 2016 18:38
wrong number of arguments (2 for 0..1)
include_recipe 'unity::editor'
include_recipe value_for_platform_family(
windows: 'my-jenkins::windows',
mac_os_x: 'my-jenkins::mac_os_x'
)
windows_package 'Visual Studio 2015 Tools for Unity' do
source 'http://my_server/software/microsoft/visualstudio/2015/vstu2015.msi'
checksum 'b326526c02c0142d0a2e7d6fe4f448a96bbebd5b4f8f333dd181d3ada911fbfa'
kitchen converge linux-slave-centos-67
-----> Starting Kitchen (v1.7.3)
-----> Converging <linux-slave-centos-67>...
Preparing files for transfer
Preparing dna.json
Resolving cookbook dependencies with Berkshelf 4.3.2...
Removing non-cookbook files before transfer
Preparing data_bags
Preparing nodes
Preparing secret
@Sauraus
Sauraus / output1
Created June 10, 2016 22:05
Why is this code returning NULL when no RETURN is present?
================================================================================
Recipe Compile Error in /tmp/kitchen/cache/cookbooks/diw-jenkins/recipes/server.rb
================================================================================
Chef::Exceptions::InvalidDataBagItemID
--------------------------------------
Data Bag items must have an id matching /^[\.\-[:alnum:]_]+$/, you gave: nil
Cookbook Trace:
---------------
@Sauraus
Sauraus / keybase.md
Created July 20, 2016 18:18
keybase.md

Keybase proof

I hereby claim:

  • I am Sauraus on github.
  • I am sauraus (https://keybase.io/sauraus) on keybase.
  • I have a public key whose fingerprint is 0001 814F E3C5 8766 639E 2242 9FEA 2AE1 0798 BD07

To claim this, I am signing this object: