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
@gondoi
gondoi / test.sh
Created January 28, 2014 22:45
virtualenvwrapper and rvm
$ #install virtualvenvwrapper
$ #install rvm
$ #start new shell
$ echo $PATH
$ mkvirtualenv test
$ echo $PATH
$ mkvirtualenv test2
$ echo $PATH # < once you create a second, or switch from one venv to another via workon, the PATH gets reset.
# Strainerfile
knife test: bundle exec knife cookbook test $COOKBOOK
rubocop: bundle exec rubocop $COOKBOOK
foodcritic: bundle exec foodcritic -f any $SANDBOX/$COOKBOOK
chefspec: bundle exec rspec $SANDBOX/$COOKBOOK/spec
kitchen: bundle exec kitchen test --destroy=always
@gondoi
gondoi / cloud-init.log
Last active December 27, 2015 14:39
test script
2013-11-06 18:28:04,160 - util.py[DEBUG]: Cloud-init v. 0.7 running 'init-local' at Wed, 06 Nov 2013 18:28:03 +0000. Up 9.12 seconds.
2013-11-06 18:28:04,199 - util.py[DEBUG]: Writing to /var/log/cloud-init.log - ab: [420] 0 bytes
2013-11-06 18:28:04,200 - util.py[DEBUG]: Changing the ownership of /var/log/cloud-init.log to 101:4
2013-11-06 18:28:04,201 - util.py[DEBUG]: Attempting to remove /var/lib/cloud/instance/boot-finished
2013-11-06 18:28:04,201 - util.py[DEBUG]: Attempting to remove /var/lib/cloud/instance
2013-11-06 18:28:04,201 - util.py[DEBUG]: Attempting to remove /var/lib/cloud/data/no-net
2013-11-06 18:28:04,201 - util.py[DEBUG]: Reading from /var/lib/cloud/instance/obj.pkl (quiet=False)
2013-11-06 18:28:04,203 - importer.py[DEBUG]: Looking for modules ['ubuntu', 'cloudinit.distros.ubuntu'] that have attributes ['Distro']
2013-11-06 18:28:04,224 - importer.py[DEBUG]: Found ubuntu with attributes ['Distro'] in ['cloudinit.distros.ubuntu']
2013-11-06 18:28:04,224 - stages.py[DEBUG]: Using distro c
@gondoi
gondoi / novaclienterror.py
Created October 17, 2013 15:57
Error when using novaclient with supernova
Traceback (most recent call last):
File "/home/bkbox/.venvs/system/local/lib/python2.7/site-packages/novaclient/shell.py", line 737, in main
OpenStackComputeShell().main(map(strutils.safe_decode, sys.argv[1:]))
File "/home/bkbox/.venvs/system/local/lib/python2.7/site-packages/novaclient/shell.py", line 667, in main
self.cs.authenticate()
File "/home/bkbox/.venvs/system/local/lib/python2.7/site-packages/novaclient/v1_1/client.py", line 171, in authenticate
self.client.authenticate()
File "/home/bkbox/.venvs/system/local/lib/python2.7/site-packages/novaclient/client.py", line 331, in authenticate
auth_url = self._plugin_auth(auth_url)
File "/home/bkbox/.venvs/system/local/lib/python2.7/site-packages/novaclient/client.py", line 394, in _plugin_auth
@gondoi
gondoi / aliases.sh
Last active December 19, 2015 00:49
Backgrounded ruby install
# from command: alias; typset -F
alias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo error)" "$(history|tail -n1|sed -e '\''s/^\s*[0-9]\+\s*//;s/[;&|]\s*alert$//'\'')"'
alias egrep='egrep --color=auto'
alias fgrep='fgrep --color=auto'
alias grep='grep --color=auto'
alias l='ls -CF'
alias la='ls -A'
alias ll='ls -alF'
alias ls='ls --color=auto'
alias rvm-restart='rvm_reload_flag=1 source '\''/home/bkbox/.rvm/scripts/rvm'\'''
@gondoi
gondoi / mixin-file.rb
Last active December 17, 2015 02:29
lock_wait has been added as an option to the apt_package resource.
class File
def flocked? &block
flockstruct = [Fcntl::F_RDLCK, 0, 0, 0, 0].pack("ssqqi")
fcntl Fcntl::F_GETLK, flockstruct
status = flockstruct.unpack("ssqqi")[0]
case status
when Fcntl::F_UNLCK
return false
when Fcntl::F_WRLCK|Fcntl::F_RDLCK
return true
@gondoi
gondoi / export.json
Created April 17, 2013 22:19
Export from juju-jitsu
{
"services": [
{
"name": "wordpress",
"exposed": true,
"unit_count": 1,
"charm": "cs:precise/wordpress-11",
"config": {
"debug": "no",
"engine": "nginx",
@gondoi
gondoi / .kitchen.yml
Last active December 15, 2015 03:09
build-essentials w/ test-kitchen
suites:
- name: default
run_list:
- recipe[build-essential]
attributes:
build_essential:
- compiletime: true
@gondoi
gondoi / insecure_option.rb
Created January 29, 2013 16:15
Setting insecure flag
option :openstack_insecure,
:long => "--insecure",
:description => "Ignore SSL certificate on the Auth URL",
:boolean => true,
:default => false,
:proc => Proc.new { |key| Chef::Config[:knife][:openstack_insecure] = !key }
@gondoi
gondoi / Vagrantfile
Created October 17, 2012 15:46
Quick test machine to install devstack
Vagrant::Config.run do |config|
config.vm.box = "precise"
config.vm.box_url = "http://files.vagrantup.com/precise64.box"
config.vm.provision :shell, :inline => "apt-get update && apt-get install -y git-core"
config.vm.provision :shell, :inline => "git clone https://github.com/openstack-dev/devstack.git"
end
# Then:
# vagrant ssh