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 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
################################
@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 / daemon.json
Created August 12, 2017 12:20
My Docker daemon.json
{
"live-restore": true,
"storage-driver": "overlay2",
"registry-mirrors": ["https://registry-mirror.example.com"]
}
@winggundamth
winggundamth / gist:72a795d1aad9a1cceafb9f52f6a8e28e
Created August 25, 2017 11:48
How to git clone with another ssh-key
GIT_SSH_COMMAND='ssh -i ~/.ssh/id_rsa_2' git pull
export GIT_SSH_COMMAND='ssh -i ~/.ssh/id_rsa_2'
# 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 / docker-compose.yml
Created April 28, 2018 09:01
Elasticsearch Cluster + Grafana Docker Compose File
version: '3'
services:
es1:
image: docker.elastic.co/elasticsearch/elasticsearch:6.2.4
container_name: es1
environment:
cluster.name: "docker-cluster"
bootstrap.memory_lock: "true"
ES_JAVA_OPTS: "-Xms512m -Xmx512m"
TAKE_FILE_OWNERSHIP: "true"
@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