Skip to content

Instantly share code, notes, and snippets.

View amaltson's full-sized avatar

Arthur Maltson amaltson

View GitHub Profile
@amaltson
amaltson / gist:9494911
Created March 11, 2014 20:57
xip io dig
$ dig 192.168.33.10.xip.io +noall +answer
; <<>> DiG 9.8.3-P1 <<>> 192.168.33.10.xip.io +noall +answer
;; global options: +cmd
192.168.33.10.xip.io. 599 IN CNAME 2t77wg.xip.io.
2t77wg.xip.io. 599 IN A 192.168.33.10
@amaltson
amaltson / gist:9235581
Created February 26, 2014 18:37
Internal NTP servers
# A very simple client-only ntp configuration.
server 172.25.6.3
server 172.25.6.4
server 172.25.6.6
authenticate no
@amaltson
amaltson / initialization.rb
Created June 26, 2013 14:14
Ruby 2.0 initialization
class FooBar
def initialize(@name, @last_name)
#nice isn't it?
end
def to_s
"#@name #@last_name"
end
end
@amaltson
amaltson / gist:5148213
Created March 12, 2013 23:58
Clean run of openstack cookbooks
$ sudo chef-client
[2013-03-12T19:44:08-04:00] INFO: *** Chef 10.18.0 ***
[2013-03-12T19:44:09-04:00] INFO: Run List is [role[single-controller], role[single-compute]]
[2013-03-12T19:44:09-04:00] INFO: Run List expands to [osops-utils::packages, openssh, ntp, sosreport, rsyslog::default, hardware, osops-utils::default, mysql-openstack::server, erlang::default, rabbitmq-openstack::server, keystone::server, keystone::keystone-api, glance::setup, glance::registry, glance::api, nova::nova-setup, nova-network::nova-controller, nova::scheduler, nova::api-ec2, nova::api-os-compute, nova::volume, nova::nova-cert, nova::vncproxy, mysql::client, mysql::ruby, horizon::server, nova-network::nova-compute, nova::compute]
[2013-03-12T19:44:09-04:00] INFO: HTTP Request Returned 404 Not Found: No routes match the request: /reports/nodes/openstack1/runs
[2013-03-12T19:44:09-04:00] INFO: Starting Chef Run for openstack1
[2013-03-12T19:44:09-04:00] INFO: Running start handlers
[2013-03-12T19:44:09-04:00] INFO: Start handlers com
@amaltson
amaltson / rename.sh
Created February 12, 2013 20:44
Renaming authors
#!/bin/sh
git filter-branch -f --env-filter '
an="$GIT_AUTHOR_NAME"
am="$GIT_AUTHOR_EMAIL"
if [ "$GIT_AUTHOR_EMAIL" = "[email protected]" ]
then
an="New Name"
@amaltson
amaltson / gist:2775837
Created May 23, 2012 15:16
failing cucumber tests
[INFO] Successfully installed bundler-1.1.3
[INFO] 1 gem installed
[INFO]
[INFO] run with jruby 1.5.6 in mode 1.8
[INFO]
[INFO] Feature: Setup classloader with JBundler
[INFO]
[INFO] Scenario: checkout a new project with Gemfile.lock and setup the classloader with declared jar dependencies # features/jbundler.feature:3
[INFO] Given a fresh copy of "example"
@amaltson
amaltson / ruby-clone.rb
Created May 4, 2012 13:22
Ruby clone example
class B
def initialize(num)
@num = num
end
end
class A
def initialize(num)
@arr = []
(1..num).each {|i| @arr.push(B.new(i))}
@amaltson
amaltson / attributes default.rb
Created February 22, 2012 18:11
The erb file, should be rendered the same each time
...
default['hubot']['version'] = "2.1.3"
...
default['hubot-scripts']['version'] = "2.0.5"
@amaltson
amaltson / with knife -V
Created February 17, 2012 19:05
Installing git cookbook
chef-repo git:(master) knife cookbook site install git
zsh: correct 'cookbook' to 'cookbooks' [nyae]? n
Installing git to /home/arthur/chef-repo/cookbooks
Checking out the master branch.
Pristine copy branch (chef-vendor-git) exists, switching to it.
Downloading git from the cookbooks site at version 0.10.0 to /home/arthur/chef-repo/cookbooks/git.tar.gz
Cookbook saved: /home/arthur/chef-repo/cookbooks/git.tar.gz
Removing pre-existing version.
Uncompressing git version /home/arthur/chef-repo/cookbooks.
removing downloaded tarball
@amaltson
amaltson / default.rb
Created February 3, 2012 15:43
Using not_if block, but still continues to download
include_recipe "nodejs::npm"
hubot_user = "#{node['hubot']['user']}"
hubot_group = "#{node['hubot']['group']}"
install_dir = "#{node['hubot']['install_dir']}"
install_dir_parent = "#{node['hubot']['install_dir_parent']}"
version = "#{node['hubot']['version']}"
# Create the hubot user to run hubot
group hubot_group do