Skip to content

Instantly share code, notes, and snippets.

View gondoi's full-sized avatar
🏠
Working from home

BK Box gondoi

🏠
Working from home
View GitHub Profile

Keybase proof

I hereby claim:

  • I am gondoi on github.
  • I am bkbox (https://keybase.io/bkbox) on keybase.
  • I have a public key whose fingerprint is 4ADC 0960 51F3 FDBF C739 268F F165 AB07 DE6D 98A5

To claim this, I am signing this object:

@gondoi
gondoi / array_of_hash.rb
Created August 22, 2014 20:38
Array of hashes
jobs = []
job = {}
job['month'] = 'jan'
job['day'] = 'mon'
jobs << job
@gondoi
gondoi / client-12_04.log
Last active August 29, 2015 14:05
chef-client cookbook exits after first bootstrap on Ubuntu 12.04
# Logfile created on 2014-08-18 19:58:55 +0000 by logger.rb/31641
[2014-08-18T19:58:55+00:00] INFO: Daemonizing..
[2014-08-18T19:58:55+00:00] INFO: Forked, in 1541. Privileges: 0 0
[2014-08-18T19:58:56+00:00] INFO: SIGTERM received, exiting gracefully
[2014-08-18T19:58:58+00:00] FATAL: Chef is already running pid 1541
[2014-08-18T20:01:36+00:00] INFO: Forking chef instance to converge...
[2014-08-18T20:01:36+00:00] WARN:
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
SSL validation of HTTPS requests is disabled. HTTPS connections are still
encrypted, but chef is not able to detect forged replies or man in the middle
@gondoi
gondoi / client.log
Created August 14, 2014 20:53
chef on ubuntu 12.04
[2014-08-14T20:23:26+00:00] INFO: Daemonizing..
[2014-08-14T20:23:26+00:00] INFO: Forked, in 1507. Privileges: 0 0
[2014-08-14T20:23:37+00:00] INFO: SIGTERM received, exiting gracefully
[2014-08-14T20:23:37+00:00] FATAL: Chef is already running pid 1507
[2014-08-14T20:27:33+00:00] INFO: Forking chef instance to converge...
[2014-08-14T20:27:33+00:00] WARN:
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
SSL validation of HTTPS requests is disabled. HTTPS connections are still
encrypted, but chef is not able to detect forged replies or man in the middle
attacks.
@gondoi
gondoi / 404s.out
Created July 30, 2014 21:01
404s with new chef-zero
$ bundle exec rspec test/unit/spec/
[2014-07-30T15:59:17-05:00] DEBUG: No chefignore file found at /var/folders/6x/nxr258v10j92x646f7n89rsh0000gn/T/d20140730-34083-xkebbp/chefignore no files will be ignored
[2014-07-30T15:59:17-05:00] INFO: Saving apt
[2014-07-30T15:59:17-05:00] INFO: Saving build-essential
[2014-07-30T15:59:17-05:00] INFO: Saving chef-sugar
[2014-07-30T15:59:17-05:00] INFO: Saving redis-multi
[2014-07-30T15:59:17-05:00] INFO: Saving redisio
[2014-07-30T15:59:17-05:00] INFO: Saving ulimit
[2014-07-30T15:59:17-05:00] DEBUG: Chef::HTTP calling Chef::HTTP::JSONInput#handle_request
[2014-07-30T15:59:17-05:00] DEBUG: Chef::HTTP calling Chef::HTTP::JSONToModelOutput#handle_request
@gondoi
gondoi / test.rb
Last active August 29, 2015 14:02
version check for nokogiri
if node['xml']['nokogiri']['use_system_libraries']
if node['xml']['nokogiri']['version'].nil? ||
version(node['xml']['nokogiri']['version']).satisfies?('> 1.6.1')
Chef::Application.fatal!("You must specify a version less than or equal to 1.6.1 of nokogiri to use system libraries. You set: #{node['xml']['nokogiri']['version']}.")
else
ENV['NOKOGIRI_USE_SYSTEM_LIBRARIES'] = node['xml']['nokogiri']['use_system_libraries'].to_s
end
end
@gondoi
gondoi / error.out
Last active August 29, 2015 14:02
nokogiri install error
[2014-06-03T18:26:20+00:00] FATAL: Stacktrace dumped to /tmp/kitchen/cache/chef-stacktrace.out
Chef Client failed. 11 resources updated in 67.458017893 seconds
[2014-06-03T18:26:20+00:00] ERROR: chef_gem[nokogiri] (xml::ruby line 35) had an error: Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
/opt/chef/embedded/bin/ruby extconf.rb
Building nokogiri using system libraries.
libxml2 version 2.6.21 or later is required!
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers. Check the mkmf.log file for more
======================================================================
FAIL: satori.tests.test_bash.TestLocalPlatformInfo.test_is_debian
tags: worker-2
----------------------------------------------------------------------
Empty attachments:
stderr
stdout
Traceback (most recent call last):
File "./satori/tests/test_bash.py", line 77, in test_is_debian
@gondoi
gondoi / simple_facts.py
Last active August 29, 2015 13:57
Simple script to get Ansible facts on localhost.
import json
from ansible.runner import Runner
from ansible import inventory
hosts = ['localhost']
inventory_manager = inventory.Inventory(hosts)
runner = Runner(