Skip to content

Instantly share code, notes, and snippets.

View cinhtau's full-sized avatar

Tan-Vinh Nguyen cinhtau

View GitHub Profile
@cinhtau
cinhtau / countries.json
Created February 16, 2022 10:27
ISO 3166-1 (Codes for the representation of names of countries and their subdivisions – Part 1: Country codes)
[{"alpha2":"AW","description":"Aruba","numeric":533,"regionCode":"B","alpha3":"ABW"},{"alpha2":"AF","description":"Afghanistan","numeric":4,"regionCode":"E","alpha3":"AFG"},{"alpha2":"AO","description":"Angola","numeric":24,"regionCode":"E","alpha3":"AGO"},{"alpha2":"AI","description":"Anguilla","numeric":660,"regionCode":"B","alpha3":"AIA"},{"alpha2":"AX","description":"Åland Islands","numeric":248,"regionCode":"D","alpha3":"ALA"},{"alpha2":"AL","description":"Albania","numeric":8,"regionCode":"D","alpha3":"ALB"},{"alpha2":"AD","description":"Andorra","numeric":20,"regionCode":"D","alpha3":"AND"},{"alpha2":"AE","description":"United Arab Emirates","numeric":784,"regionCode":"E","alpha3":"ARE"},{"alpha2":"AR","description":"Argentina","numeric":32,"regionCode":"B","alpha3":"ARG"},{"alpha2":"AM","description":"Armenia","numeric":51,"regionCode":"D","alpha3":"ARM"},{"alpha2":"AS","description":"American Samoa","numeric":16,"regionCode":"C","alpha3":"ASM"},{"alpha2":"AQ","description":"Antarctica","numeric":10,"
@cinhtau
cinhtau / cointainer.md
Last active October 6, 2021 13:50
Developer Docs - links for the daily work
@cinhtau
cinhtau / vote-626.md
Last active February 20, 2019 11:08
Voting Example

Data from vote 626

Remove type for ES 7.

POST _bulk
{"index":{"_index":"votes","_type":"doc","_id":"1"}}
{"canton":"Zürich","votes":{"yes":148438,"no":222301},"participation":40.2}
{"index":{"_index":"votes","_type":"doc","_id":"2"}}
{"canton":"Bern","votes":{"yes":96671,"no":179706},"participation":37.8}
@cinhtau
cinhtau / elasticsearch-s3-plugin.md
Last active November 14, 2019 12:20
Elasticsearch S3 Repository Quick Sheet

Installation

Step 1: Install Plugin

sudo bin/elasticsearch-plugin install repository-s3

Configuration

@cinhtau
cinhtau / 001-logstash-input.conf
Last active February 4, 2019 22:06
Fortune database Logstash Demonstration
input {
file {
path => "/home/vinh/development/projects/geek-fortune-cookies/databases/programming-wisdom"
sincedb_path => "/dev/null"
start_position => "beginning"
codec => multiline {
pattern => "^\%"
negate => true
what => "previous"
charset => "UTF-8"
@cinhtau
cinhtau / array-demo-improved.sh
Last active February 11, 2022 13:18
Working with Arrays in Linux Shell, bash and zsh, examples for https://blog.mimacom.com/arrays-on-linux-shell/
#!/usr/bin/zsh
echo "detecting shell:"
if [[ -n ${ZSH_VERSION} ]] && [[ ! -z ${ZSH_VERSION} ]]; then
INDEX_START=1
INDEX_OFFSET=0
echo " using zsh $ZSH_VERSION, index starts at $INDEX_START"
elif [[ -n $BASH_VERSION ]]; then
INDEX_START=0
INDEX_OFFSET=1
@cinhtau
cinhtau / docker-cheatsheet.md
Last active October 8, 2022 14:49
Docker Commands

View

Old way

docker ps

New consistent approach

# list containers
@cinhtau
cinhtau / filebeat.md
Last active November 13, 2018 16:07
2018-11-13 Elasticsearch Meet-up Stuttgart Demo 2 - Payments Statistics

Filebeat Checks

./filebeat test config
./filebeat test output
@cinhtau
cinhtau / 000_overview.md
Last active January 22, 2019 17:19
Demo Time
┌──Payments───────┐                     _._
│ ┌─────────────┐ │                _.-``__ ''-._
│ │  Terminal   │ │           _.-``    `.  `_.  ''-._
│ └─────────────┘ │       .-`` .-```.  ```\/    _.,_ ''-._
└────────┬────────┘      (    '      ,       .-`  | `,    )
         │               |`-._`-...-` __...-.``-._|'` _.-'|
         │               |    `-._   `._    /     _.-'    |
         ▼                `-._    `-._  `-./  _.-'    _.-'
┌─────────────────┐ |`-._`-._ `-.__.-' _.-'_.-'|