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 / README.md
Last active April 14, 2023 13:42 — forked from igorlg/aws_tags.rb
Facter for AWS EC2 Instance Tags
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 / 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?
#!/usr/bin/env python
"""
Recipe for creating and updating security groups programmatically.
"""
import collections
import boto
@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.

@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 / 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 / Vagrantfile
Last active August 29, 2015 14:13
How-to: Use Vagrant to Set Up a Virtual Hadoop Cluster (For CDH 4)
# -*- mode: ruby -*-
# vi: set ft=ruby :
$master_script = <<SCRIPT
#!/bin/bash
cat > /etc/hosts <<EOF
127.0.0.1 localhost
# The following lines are desirable for IPv6 capable hosts
::1 ip6-localhost ip6-loopback
@ozbillwang
ozbillwang / ruby-one-liners.md
Last active August 29, 2015 14:13 — forked from KL-7/one-liners.md
ruby one liner collection

One-liners

Reverse every line:

Input file:

$ cat foo
qwe
123

bar