Skip to content

Instantly share code, notes, and snippets.

View vanduc95's full-sized avatar
:octocat:

Nguyen Van Duc vanduc95

:octocat:
View GitHub Profile
@vanduc95
vanduc95 / grep.sh
Last active November 5, 2020 15:54 — forked from isyufu/grep.sh
grep cheat sheet
#!/bin/sh
#http://www.thegeekstuff.com/2011/01/advanced-regular-expressions-in-grep-command-with-10-examples-%E2%80%93-part-ii/
# GENERAL
# print lines begining with range of letters
grep ^[A-D] table.txt
# REGEX
@vanduc95
vanduc95 / find.sh
Created November 5, 2020 15:38 — forked from gr1ev0us/find.sh
Cheatsheet for find linux
# List of cheatsheet for linux find.
# Taken from here http://alvinalexander.com/unix/edu/examples/find.shtml
# basic 'find file' commands
# --------------------------
find / -name foo.txt -type f -print # full command
find / -name foo.txt -type f # -print isn't necessary
find / -name foo.txt # don't have to specify "type==file"
find . -name foo.txt # search under the current dir
find . -name "foo.*" # wildcard
@vanduc95
vanduc95 / curl.md
Created November 2, 2020 09:05 — forked from subfuzion/curl.md
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

test_command='curl -sL \
-w "%{http_code}\\n" \
"http://localhost:8000/people/" \
-o /dev/null \
--connect-timeout 3 \
--max-time 5'
if [[ $(test_command) == "200" ]] ;
then
echo "OK" ;
else
@vanduc95
vanduc95 / Postman.desktop
Created November 29, 2018 07:28 — forked from aviskase/Postman.desktop
Install Postman
[Desktop Entry]
Encoding=UTF-8
Name=Postman
Exec=postman
Icon=/home/USERNAME/Postman/app/resources/app/assets/icon.png
Terminal=false
Type=Application
Categories=Development;
[[local|localrc]]
RECLONE=True
GIT_BASE=${GIT_BASE:-https://git.openstack.org}
HORIZON_BRANCH=stable/pike
KEYSTONE_BRANCH=stable/pike
SWIFT_BRANCH=stable/pike
SWIFT3_BRANCH=1.12
#-----------------------------
# Common congigurations
#-----------------------------
[[local|localrc]]
RECLONE=True
GIT_BASE=http://git.openstack.org
HORIZON_BRANCH=stable/pike
KEYSTONE_BRANCH=stable/pike
SWIFT_BRANCH=stable/pike
#-----------------------------
# Common congigurations
#-----------------------------

Install Ceilometer + Gnocchi with backend Ceph

In Controller node

  • Create database
mysql -uroot -pWelcome123

CREATE DATABASE gnocchi;
GRANT ALL PRIVILEGES ON gnocchi.* TO 'gnocchi'@'localhost' IDENTIFIED BY 'Welcome123' WITH GRANT OPTION ;

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
@vanduc95
vanduc95 / install Ceph Luminous on Ubuntu 16.04.md
Last active October 15, 2020 11:45
install Ceph Luminous on Ubuntu 16.04

Hướng dẫn cài đặt Ceph Luminous


I. Cài đặt cơ bản


1. Chuẩn bị môi trường

1.1 Mô hình mạng