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
  • GitHub Staff
  • Nashville, TN
View GitHub Profile
@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 / 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 / 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 / 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"; }
#!/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
#!/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)
@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)
@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 / Gemfile
Last active December 18, 2015 20:39
How to use VeeWee + Vagrant
source 'https://rubygems.org'
gem 'veewee', :git => "[email protected]:jedi4ever/veewee.git"
@azizshamim
azizshamim / error1.txt
Last active December 19, 2015 05:19
packer.io hanging on build
PACKER_LOG=1 packer build template.json
2013/07/01 14:12:51 Packer Version: 0.1.3
2013/07/01 14:12:51 Packer Target OS/Arch: darwin amd64
2013/07/01 14:12:51 Detected home directory from env var: /Users/ashamim
2013/07/01 14:12:51 Attempting to open config file: /Users/ashamim/.packerconfig
2013/07/01 14:12:51 File doesn't exist, but doesn't need to. Ignoring.
2013/07/01 14:12:51 Packer config: &{PluginMinPort:0 PluginMaxPort:0 Builders:map[amazon-ebs:packer-builder-amazon-ebs digitalocean:packer-builder-digitalocean virtualbox:packer-builder-virtualbox vmware:packer-builder-vmware] Commands:map[build:packer-command-build validate:packer-command-validate] PostProcessors:map[vagrant:packer-post-processor-vagrant] Provisioners:map[shell:packer-provisioner-shell]}
2013/07/01 14:12:51 Setting cache directory: /Volumes/development_bundle/Dropbox/git/fup/checkd.in/checkd.in-chef/vagrant/ubuntu-10.04/packer_cache
2013/07/01 14:12:51 Environment.Cli: []string{"build", "template.json"}
2013/07/01 14:12:51 command + ar