Skip to content

Instantly share code, notes, and snippets.

@thaihust
thaihust / ubuntu-cloud-virtualbox.sh
Created April 1, 2017 07:40 — forked from smoser/ubuntu-cloud-virtualbox.sh
example of using Ubuntu cloud images with virtualbox
## Install necessary packages
$ sudo apt-get install virtualbox-ose qemu-utils genisoimage cloud-utils
## get kvm unloaded so virtualbox can load
$ sudo modprobe -r kvm_amd kvm_intel
$ sudo service virtualbox stop
$ sudo service virtualbox start
## URL to most recent cloud image of 12.04
$ img_url="http://cloud-images.ubuntu.com/server/releases/12.04/release"
@thaihust
thaihust / resource_alloc_docker.md
Last active April 18, 2017 02:16 — forked from afolarin/resource_alloc_docker.md
Resource Allocation in Docker

Container Resource Allocation Options in docker-run

You have various options for controlling resources (cpu, memory, disk) in docker. These are principally via the docker-run command options.

Dynamic CPU Allocation

-c, --cpu-shares=0         
CPU shares (relative weight, specify some numeric value which is used to allocate relative cpu share)

Reserved CPU Allocation

@thaihust
thaihust / clearwater.md
Last active April 20, 2017 07:40 — forked from sushant-hiray/clearwater.md
Installation Instructions for project clearwater

Prereqs

  • Atleast 7 VM's: 1 corresponding to each node and 1 for DNS Server.
  • Keep note of the IP's of each VM and assign them to a node.
  • A publicly accessible IP address of each of the above machines and a private IP address for each of them (these may be the same address depending on the machine environment). These will be referred to as <publicIP> and <privateIP> below.
  • The FQDN of the machine, which resolves to the machine's public IP address (if the machine has no FQDN, you should instead use the public IP). Referred to as <hostname> below.
  • A DNS root zone in which to install your repository and the ability to configure records within that zone. This root zone will be referred to as <zone> below. In setting of DNS, this is referred to as ims.hom

Setting up a DNS Server

@thaihust
thaihust / README.md
Created July 23, 2017 04:11 — forked from leonardofed/README.md
A curated list of AWS resources to prepare for the AWS Certifications


A curated list of AWS resources to prepare for the AWS Certifications

A curated list of awesome AWS resources you need to prepare for the all 5 AWS Certifications. This gist will include: open source repos, blogs & blogposts, ebooks, PDF, whitepapers, video courses, free lecture, slides, sample test and many other resources.

For more about AWS and AWS Certifications and updates to this Gist you should follow me @leonardofed


@thaihust
thaihust / 0-README.md
Created July 23, 2017 04:13 — forked from leonardofed/0-README.md
AWS Lambda: Advanced Coding Session - clda.co/aws-lambda-webinar

AWS Lambda: Advanced Coding Session (slides)

Live demos:

  1. Amazon API Gateway Access Control
  2. Amazon Kinesis Streams processing
  3. Amazon Cognito Sync trigger
  4. AWS CloudFormation Custom Resources
@thaihust
thaihust / dos2unix.md
Created November 2, 2017 01:19 — forked from umidjons/dos2unix.md
Execute dos2unix for directory recursively.

Will recursively find all files inside current directory and call for these files dos2unix command. Would break if you had spaces in file name.

find . -type f -exec dos2unix {} \;

Wouldn't break if you had spaces in file names.

find . -type f -print0 | xargs -0 dos2unix
@thaihust
thaihust / pcs-crmsh cheatsheet.md
Created November 24, 2017 07:58 — forked from beekhof/pcs-crmsh cheatsheet.md
Transition guide for common crmsh commands

Display the configuration

crmsh # crm configure show
pcs   # pcs cluster cib

Display the current status

crmsh # crm_mon -1
pcs   # pcs status
#!/bin/bash
MGMT_IP=$(ifconfig br-mgmt | grep 'inet addr:'| cut -d: -f2 | awk '{ print $1}')
HOST=$(hostname -s)
ADMIN_IP=$(hiera management_vip)
PUB_IP=$(hiera public_vip)
USER='masakari'
PASS='masakari'
DIR="$(dirname `readlink -f $0`)"
@thaihust
thaihust / main.yml
Created December 14, 2017 08:54 — forked from bjallen/main.yml
ansible mysql percona task
---
- name: Add Percona apt signing key
sudo: yes
apt_key: keyserver=keys.gnupg.net id=1C4CBDCDCD2EFD2A state=present
- name: Add Percona repository
sudo: yes
apt_repository: repo='deb http://repo.percona.com/apt trusty main' state=present
- name: Add Percona source repository
@thaihust
thaihust / local.conf
Created February 28, 2018 15:46 — forked from hieulq/local.conf
DevStack local.conf
[[local|localrc]]
#RECLONE=yes
#OFFLINE=True
USE_SCREEN=True
# Credentials
DATABASE_PASSWORD=vietstack
ADMIN_PASSWORD=vietstack
SERVICE_PASSWORD=vietstack
RABBIT_PASSWORD=vietstack