Skip to content

Instantly share code, notes, and snippets.

View ozbillwang's full-sized avatar
:octocat:

Bill Wang ozbillwang

:octocat:
View GitHub Profile
@ozbillwang
ozbillwang / node_aws.puppet.md
Last active August 18, 2020 20:22
node_aws option with puppet command

When reading the document Provisioning With Amazon Web Services, I am interesting how puppet provisions an Amazon AWS ec2 instance.

Default with puppet open source (I didn't test in PE), there is no option of node_aws. So when I run the command puppet help node_aws.

###Here is this error.

$ puppet help node_aws
Error: Could not load help for the face node_aws.
Please check the error logs for more information.
@ozbillwang
ozbillwang / work with multiple accounts in github.md
Last active August 29, 2015 14:14
work with multiple accounts in github

Search in google, found many solutions, but no one works for my case.

$ git push
ERROR: Permission to XYZ/sss.git denied to ABC.
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
@ozbillwang
ozbillwang / vm-resize-hard-disk.md
Last active August 29, 2015 14:16 — forked from christopher-hopper/vm-resize-hard-disk.md
Resize a Hard Disk for a Virtual Machine

The repository below resizes the vagrant box automatically, and I prefer this way.

https://github.com/SydOps/vagrant-box-resize

Here are the manual tasks with my updates and fork from christopher-hopper/vm-resize-hard-disk.md. But one issue is, after I manually resize, I found I can't use packer to re-baker vagrant box again.

Resize a Hard Disk for a Virtual Machine

Our Virtual Machines are provisioned using Vagrant from a Linux base box to run using VirutalBox. If the Hard Disk space runs out and you cannot remove files to free-up space, you can resize the Hard Disk using some VirtualBox and Linux commands.

#!/usr/bin/env python
"""
Recipe for creating and updating security groups programmatically.
"""
import collections
import boto
@ozbillwang
ozbillwang / vmware AppCatalyst
Created July 21, 2015 13:33
vmware AppCatalyst - another docker solution
http://networkinferno.net/appcatalyst-so-simple-a-networker-got-it-running
AppCatalyst – So simple a networker got it running
AppCatalyst
AppCatalyst is a thin hypervisor based on VMware Fusion that is targeted at Developers. Developers who want to use container based deployments on Virtual Machines can user AppCatalyst to deploy their workloads. VMware Photon is a minimal Linux Container Host that provides Docker, rkt, and Garden container specification out of the box. It is included in AppCatalyst as the default image.
Where VMware Fusion has a GUI there is none to be found with AppCatalyst. A REST API or CLI are primary touch points to rapidly spinning up and bringing down workloads. With a REST API exposed other automation tools can drive AppCatalyst. Vagrant anyone?
console.log('Loading event');
var AWS = require('aws-sdk');
var dynamodb = new AWS.DynamoDB();
exports.handler = function(event, context) {
console.log("Request received:\n", JSON.stringify(event));
console.log("Context received:\n", JSON.stringify(context));
var tableName = "OurBlogDemo";
var datetime = new Date().getTime().toString();
@ozbillwang
ozbillwang / README.md
Last active April 14, 2023 13:42 — forked from igorlg/aws_tags.rb
Facter for AWS EC2 Instance Tags
@ozbillwang
ozbillwang / How to run use "cloudformation-ruby-dsl" to generate cloudformation template.md
Last active October 21, 2015 00:37
How to run use "bazaarvoice/cloudformation-ruby-dsl" to generate cloudformation template

I was recommended to use github repository bazaarvoice/cloudformation-ruby-dsl to generate cloudformation template. But its README is not good enough.

Here are the steps on how to use it on my mac with bundler

$ git clonehttps://github.com/bazaarvoice/cloudformation-ruby-dsl.git
$ cd cloudformation-ruby-dsl
$ bundle install
$ bundle exec rake -T
rake build          # Build cloudformation-ruby-dsl-1.0.4.gem into the pkg directory
rake install        # Build and install cloudformation-ruby-dsl-1.0.4.gem into system gems
@ozbillwang
ozbillwang / connect_ec2.md
Last active December 8, 2015 23:21
Easy way to connect to ec2 instance in office behind proxy and at home

AWS ec2 instances normally have both public DNS name and public IP address. We can wisely use them for office environment which may behind proxy and directly connect from home.

Set below code in .ssh/config and enjoy convenience.

Suppose the instance has name as

ec2-54-252-146-85.ap-southeast-2.compute.amazonaws.com
54.252.146.85

So you can set as below