Skip to content

Instantly share code, notes, and snippets.

View congto's full-sized avatar
🥁
Focusing

Tô Thành Công congto

🥁
Focusing
View GitHub Profile
@congto
congto / xenial-sources.list
Created November 21, 2017 08:28
xenial-sources.list
## Note, this file is written by cloud-init on first boot of an instance
## modifications made here will not survive a re-bundle.
## if you wish to make changes you can:
## a.) add 'apt_preserve_sources_list: true' to /etc/cloud/cloud.cfg
## or do the same in user-data
## b.) add sources in /etc/apt/sources.list.d
## c.) make changes to template file /etc/cloud/templates/sources.list.tmpl
# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
@congto
congto / trusty-sources.list
Created November 20, 2017 03:34
trusty-sources.list
# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb http://archive.ubuntu.com/ubuntu trusty main restricted
deb-src http://archive.ubuntu.com/ubuntu trusty main restricted
## Major bug fix updates produced after the final release of the
## distribution.
deb http://archive.ubuntu.com/ubuntu trusty-updates main restricted
deb-src http://archive.ubuntu.com/ubuntu trusty-updates main restricted
@congto
congto / dev_setup_cephfs_nfs_manila.md
Created October 20, 2017 15:58 — forked from ajarr/dev_setup_cephfs_nfs_manila.md
All-in-one dev setup for manila's cephfs/nfs-ganesha driver

Dev testing manila's cephfs(NFS) driver

Reference https://docs.openstack.org/developer/manila/devref/cephfs_driver.html

Create all-in-one** CephFS/Ganesha/Manila setup using devstack in a CentOS7 machine similar to the one in the upstream gate, gate-manila-tempest-minimal-dsvm-cephfs-nfs-centos-7-nv

** Ceph server daemons (1 OSD, 1 MON, 1 MDS), NFS-Ganesha server, and manila-services all run in the same machine.

  • Clone devstack
@congto
congto / log-openstack.md
Last active August 28, 2017 15:02
log-openstack.sh

Log-view log trong OpenStack

  • Tạo file log-openstack.sh với nội dung dưới
#!/bin/bash
# rapid CLI oneliner log inspection inside all log files
# Lookig for keywords "fail", "error", "unable", "warning".

for i in $(ls /var/log/*/*.log); do echo "=========="; echo $i; echo "========="; tail $i| egrep -i $1; done
@congto
congto / CiscoKeyGen.py
Created August 2, 2017 05:36 — forked from paalfe/CiscoKeyGen.py
Cisco IOU License Generator. Originally found at http://www.routingloops.co.uk/cisco/gns3-v1-1-install-on-ubuntu-14-04-lts/, I have done a few changes to it. Make the file executable with " chmod +x CiscoKeyGen.py " and execute it " ./CiscoKeyGen.py ".
#! /usr/bin/python
print "\n*********************************************************************"
print "Cisco IOU License Generator - Kal 2011, python port of 2006 C version"
import os
import socket
import hashlib
import struct
# get the host id and host name to calculate the hostkey
hostid=os.popen("hostid").read().strip()
hostname = socket.gethostname()
@congto
congto / nginx.conf_multiple_upstream.md
Created May 3, 2017 16:58
nginx.conf_multiple_upstream.md
@congto
congto / File_config_nginx_LB_apache_2node
Created April 26, 2017 02:01
File_config_nginx_LB_apache_2node
# For more information on configuration, see:
# * Official English Documentation: http://nginx.org/en/docs/
# * Official Russian Documentation: http://nginx.org/ru/docs/
user nginx;
worker_processes auto;
error_log /var/log/nginx/error.log;
pid /run/nginx.pid;
# Load dynamic modules. See /usr/share/nginx/README.dynamic.
@congto
congto / openresty-ubuntu-install.sh
Created April 25, 2017 13:52 — forked from developersteve/openresty-ubuntu-install.sh
Easy install openresty (used and tested on Ubuntu 14.04, 15.10 and 16.04)
#!/bin/bash
apt-get -y update
apt-get -y install nginx-extras build-essential libpcre3-dev libssl-dev libgeoip-dev libpq-dev libxslt1-dev libgd2-xpm-dev
wget -c https://openresty.org/download/openresty-1.9.15.1.tar.gz
tar zxvf openresty-1.9.15.1.tar.gz
cd openresty-1.9.15.1
./configure \
--sbin-path=/usr/sbin/nginx \
--conf-path=/etc/nginx/nginx.conf \
@congto
congto / openresty-ubuntu-install.sh
Created April 25, 2017 13:52 — forked from kingtuna/openresty-ubuntu-install.sh
Easy install openresty (used and tested on Ubuntu 14.04, 15.10 and 16.04)
#!/bin/bash
apt-get -y update
apt-get -y install nginx-extras build-essential libpcre3-dev libssl-dev libgeoip-dev libpq-dev libxslt1-dev libgd2-xpm-dev
wget -c https://openresty.org/download/openresty-1.11.2.1.tar.gz
tar zxvf openresty-1.11.2.1.tar.gz
cd openresty-1.11.2.1
./configure \
--sbin-path=/usr/sbin/nginx \
--conf-path=/etc/nginx/nginx.conf \
@congto
congto / cobbler_CentOS7_minimal
Last active April 24, 2017 03:28
cobbler_CentOS7_minimal.ks
#platform=x86, AMD64, or Intel EM64T
#version=DEVEL
# Firewall configuration
firewall --disabled
# Install OS instead of upgrade
install
# Use HTTP installation media
url --url="http://192.168.20.11/cblr/links/CentOS7-x86_64/"
# Root password