Skip to content

Instantly share code, notes, and snippets.

View azizshamim's full-sized avatar
:octocat:
talkin' bout GitHub

Aziz Shamim azizshamim

:octocat:
talkin' bout GitHub
View GitHub Profile
@azizshamim
azizshamim / Gemfile
Last active December 18, 2015 20:39
How to use VeeWee + Vagrant
source 'https://rubygems.org'
gem 'veewee', :git => "git@github.com:jedi4ever/veewee.git"
@azizshamim
azizshamim / nova_boot_error
Created June 19, 2013 19:23
openstack errors
root@compute:~# nova boot --image 81221706-5abd-4357-ad44-7c24d30caef5 --flavor 1 --key-name nova-key test --poll
+-------------------------------------+--------------------------------------+
| Property | Value |
+-------------------------------------+--------------------------------------+
| OS-DCF:diskConfig | MANUAL |
| OS-EXT-SRV-ATTR:host | None |
| OS-EXT-SRV-ATTR:hypervisor_hostname | None |
| OS-EXT-SRV-ATTR:instance_name | instance-00000003 |
| OS-EXT-STS:power_state | 0 |
| OS-EXT-STS:task_state | scheduling |
@azizshamim
azizshamim / gist:5777352
Created June 13, 2013 21:05
veewee still sucks
shamim@ataxerxes:~ (ruby-1.9.3-p194)$ rvm gemset create foo
gemset created foo => /Users/ashamim/.rvm/gems/ruby-1.9.3-p194@foo
ashamim@ataxerxes:~ (ruby-1.9.3-p194)$ rvm gemset use foo
Using ruby-1.9.3-p194 with gemset foo
ashamim@ataxerxes:~ (ruby-1.9.3-p194@foo)$ gem list
*** LOCAL GEMS ***
bundler (1.3.5)
rake (0.8.7)
#!/usr/bin/env ruby
recipe_path = ARGV[0]
if recipe_path.nil?
STDERR.puts "usage: chef-apply RECIPE_FILE"
exit 1
end
recipe_path = File.expand_path(recipe_path)
#!/bin/bash
# Script for placing sudoers.d files with syntax-checking
# Making a temporary file to contain the sudoers-changes to be pre-checked
TMP=$(mktemp -t vagrant_sudoers)
cat /etc/sudoers > $TMP
cat >> $TMP <<EOF
# Allow passwordless startup of Vagrant when using NFS.
Cmnd_Alias VAGRANT_EXPORTS_ADD = /usr/bin/su root -c echo '*' >> /etc/exports
@azizshamim
azizshamim / gist:5666234
Created May 28, 2013 21:18
awesome regex
fix_hosts() { sed -i -r "/^[^ \t]+[ \t]+(([^ \t]+[ \t]+)+$1([ \t]+[^ \t]+)*|([^ \t]+[ \t]+)*$2([ \t]+[^ \t]+)+)$/ s/^(.*)($1)(.*)$/\1\3/; /^[^ \t]+[ \t]+$ 1[ \t]*$/d" "$2"; }
@azizshamim
azizshamim / default.pp
Created May 1, 2013 21:39
undef parameters in puppet
class foo (
$param1 = 'Hello World!'
) {
notice("${param1}")
}
class bar (
$param1 = 'Hello World!'
) {
notice("${param1}")
@azizshamim
azizshamim / test.pp
Last active December 16, 2015 21:19
$version_real = $version ? {
undef => 'present',
default => $version,
}
package { 'foobarbaz':
ensure => $version_real,
require => [
Package[$dependencies],
Package['sockjs-tornado'],
@azizshamim
azizshamim / git-pr
Created April 12, 2013 02:38
How to fetch git remotes and merge branches (should really be a git alias)
git fetch origin '+refs/pull/*/head:refs/remotes/origin/pr/*'
@azizshamim
azizshamim / vagrant warnings
Last active December 15, 2015 04:58
vagrant fail
There were warnings and/or errors while loading your Vagrantfile.
Your Vagrantfile was written for an earlier version of Vagrant,
and while Vagrant does the best it can to remain backwards
compatible, there are some cases where things have changed
significantly enough to warrant a message. These messages are
shown below.
Warnings:
* `config.vm.customize` calls are VirtualBox-specific. If you're
using any other provider, you'll have to find provider-specific configuration