Skip to content

Instantly share code, notes, and snippets.

View winggundamth's full-sized avatar

Jirayut Nimsaeng (Dear) winggundamth

View GitHub Profile
@winggundamth
winggundamth / docker-compose.yml
Created February 21, 2016 22:18
Sample how to do multi-host overlay networking on swarm with docker compose
version: '2'
services:
db:
image: mysql
environment:
- MYSQL_ROOT_PASSWORD=mypass
- constraint:node==node01
networks:
- backend
@winggundamth
winggundamth / docker-compose.yml
Created February 23, 2016 18:09
Sample how to do one host bridge networking with docker compose
version: '2'
services:
db:
image: mysql
environment:
- MYSQL_ROOT_PASSWORD=mypass
wp:
image: wordpress
server {
listen 80;
server_name CHANGEME;
## redirect http to https ##
rewrite ^ https://CHANGEME$request_uri? permanent;
}
server {
listen 443 ssl;
@winggundamth
winggundamth / db.sh
Last active August 7, 2016 08:12
Bash shell to import/export database from container
#!/bin/bash
set -ex
DB_HOST=mysql
DB_USERNAME=root
DB_PASSWORD=password
DB_NAME=wp13
DB_IMAGE=mariadb:10.1.16
DB_CONTAINER=dockerwphlp_wp-db-hlp13_1
sudo mount /dev/sdd1 /mnt
sudo vi /etc/apt/sources.list
################################
deb file:/mnt/ trusty main restricted
################################
sudo apt-get install bridge-utils vlan ifenslave
sudo vi /etc/apt/sources.list
################################
#deb file:/mnt/ trusty main restricted
################################
# Configure via SSH
sudo vi /etc/network/interfaces
################################################################################
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
# The loopback network interface
auto lo
iface lo inet loopback
@winggundamth
winggundamth / gist:f836e113522a9710b54c88de985c83bc
Created January 6, 2017 14:12
Create InfluxDB database and non-admin user then grant all permission to that user
CREATE USER "username" WITH PASSWORD 'password'
CREATE DATABASE "database"
GRANT ALL ON "username" TO "database"
@winggundamth
winggundamth / gist:7fe69a99ffcd1dfd14471101497b1407
Last active September 5, 2021 09:59
Download Cirros QCOW2 image and convert to raw for Ceph then upload image to OpenStack
source openrc
wget http://download.cirros-cloud.net/0.3.4/cirros-0.3.4-x86_64-disk.img
qemu-img convert -f qcow2 -O raw cirros-0.3.4-x86_64-disk.img cirros-0.3.4-x86_64-disk.raw
openstack image create --public --protected --disk-format raw --file cirros-0.3.4-x86_64-disk.raw cirros-0.3.4-x86_64
@winggundamth
winggundamth / gist:b37fcd73726fa732c6dfb3faae214f8c
Last active January 28, 2017 18:15 — forked from yuuichi-fujioka/install package to qcow image.sh
Prepare OpenStack Ubuntu QCOW2 Image
sudo apt-get install qemu-utils
sudo modprobe nbd
sudo qemu-nbd --connect=/dev/nbd0 /full/path/to/qcow2/image/file
sudo mkdir /mnt/ubuntu
sudo mount /dev/nbd0p1 /mnt/ubuntu
@winggundamth
winggundamth / setup-osa-aio.sh
Last active June 27, 2023 02:58
Install OpenStack Ansible all-in-one shell script
#!/usr/bin/env bash
set -e -x -u
# Update and install required packages
apt update
apt -y dist-upgrade
apt install -y git vim python unzip iotop htop iftop
# Clone OSA