Skip to content

Instantly share code, notes, and snippets.

View TrongTan124's full-sized avatar

Nguyễn Trọng Tấn TrongTan124

  • VNPT-IT
  • Hà Nội, Việt Nam
View GitHub Profile
@TrongTan124
TrongTan124 / elasticsearch.yml
Created April 27, 2017 04:18 — forked from reyjrar/elasticsearch.yml
ElasticSearch config for a write-heavy cluster
##################################################################
# /etc/elasticsearch/elasticsearch.yml
#
# Base configuration for a write heavy cluster
#
# Cluster / Node Basics
cluster.name: logng
# Node can have abritrary attributes we can use for routing
@TrongTan124
TrongTan124 / slackpost
Created May 5, 2017 02:53 — forked from dopiaza/slackpost
Post a message to a Slack channel
#!/bin/bash
# Usage: slackpost <token> <channel> <message>
# Enter the name of your slack host here - the thing that appears in your URL:
# https://slackhost.slack.com/
slackhost=PUT_YOUR_HOST_HERE
token=$1
@TrongTan124
TrongTan124 / mos-websso.rst
Created May 24, 2017 09:00 — forked from bretonium/mos-websso.rst
How to configure Mirantis OpenStack for WebSSO via Okta
  • To use openstack cli you need to switch it to using v3 API. Do this:
    1. cp openrc openrc.v3
    2. edit openrc.v3 and
      • add there this line: export OS_IDENTITY_API_VERSION=3
      • change OS_AUTH_URL to point to v3.
  • Create an identity provider

    openstack identity provider create idp_1 # idp_1 is an id. Use any you like. I like idp_1

@TrongTan124
TrongTan124 / byobuCommands
Created July 10, 2017 09:29 — forked from jshaw/byobuCommands
Byobu Commands
Byobu Commands
==============
byobu Screen manager
Level 0 Commands (Quick Start)
------------------------------
<F2> Create a new window
stack@octavia:~$ cat /etc/octavia/octavia.conf |egrep -v "^$|^#"
[DEFAULT]
transport_url = rabbit://stackrabbit:[email protected]:5672/
api_handler = queue_producer
bind_host = 172.16.68.59
logging_exception_prefix = ERROR %(name)s %(instance)s
logging_default_format_string = %(color)s%(levelname)s %(name)s [-%(color)s] %(instance)s%(color)s%(message)s
logging_context_format_string = %(color)s%(levelname)s %(name)s [%(global_request_id)s %(request_id)s %(project_name)s %(user_name)s%(color)s] %(instance)s%(color)s%(message)s
logging_debug_format_suffix = {{(pid=%(process)d) %(funcName)s %(pathname)s:%(lineno)d}}
[api_settings]
[DEFAULT]
# Print debugging output (set logging level to DEBUG instead of default WARNING level).
debug = {{ debug }}
{% if not octavia_v2|bool %}
bind_host = 0.0.0.0
bind_port = {{ octavia_service_port }}
# api_handler = queue_producer
#
# How should authentication be handled (keystone, noauth)
Sắp xếp ưu tiên
Là việc cần làm đầu tiên trong quản trị công việc và quản lý thời gian. Không sắp xếp được ưu tiên sẽ dẫn đến hiệu quả thấp và tình trạng "hoàn thành xuất sắc mọi nhiệm vụ, trừ những nhiệm vụ được giao".
Không dễ, nhưng có vài nguyên tắc:
1) Việc gấp làm trước. Nhưng thế nào là gấp thì lại là cả vấn đề. Cân nhắc về độ gấp, ngoài thời hạn, cần tính đến: hệ quả thế nào nếu chưa làm? có cơ hội làm lại hay không? ảnh hưởng đến những ai, việc gì? có phương án dự phòng không?
Nếu con bạn đi nhà trẻ, đến giờ đón con mà không có ai đón hộ thì đó là việc gấp. Không thể trì hoãn đến mai. Hệ quả có thể vô cùng nghiêm trọng.
import json
import requests
import time
import urllib
TOKEN = "687340460:AAE0ThDoRNnMiXr5dZAxSY68C4R4AzNUJpg"
URL = "https://api.telegram.org/bot{}/".format(TOKEN)
IMAGE_API_URL = "https://pixabay.com/api/?key=12005214-6f8260241d904f7e38503e6b0&q="
helm repo add wso2 https://helm.wso2.com
helm repo update
git clone https://github.com/wso2/kubernetes-apim.git
export HELM_HOME=/root/kubernetes-apim/advanced
#export KUBERNETES_HOME=/root/kubernetes-apim/advanced
ll $HELM_HOME/am-pattern-1/confs
Byobu is a suite of enhancements to tmux, as a command line
tool providing live system status, dynamic window management,
and some convenient keybindings:
F1 * Used by X11 *
Shift-F1 Display this help
F2 Create a new window
Shift-F2 Create a horizontal split
Ctrl-F2 Create a vertical split
Ctrl-Shift-F2 Create a new session