Skip to content

Instantly share code, notes, and snippets.

View byhbt's full-sized avatar

Thanh Huynh (Thành) byhbt

View GitHub Profile
@byhbt
byhbt / deploy_to_aws_ecs_private.yml
Created November 28, 2021 15:50
Github Action Workflow push image to ECR - Private Registry
name: Deploy to Amazon ECS
on:
push:
branches:
- main
env:
ECS_CLUSTER: ${{ secrets.ECS_CLUSTER }}
ECS_SERVICE: ${{ secrets.ECS_SERVICE }}
@byhbt
byhbt / deploy_to_aws_ecs.yml
Last active November 28, 2021 15:41
Github Action Workflow push image to ECR - Public Registry
name: Deploy to Amazon ECS
on:
push:
branches:
- main
env:
ECS_CLUSTER: ${{ secrets.ECS_CLUSTER }}
ECS_SERVICE: ${{ secrets.ECS_SERVICE }}
@byhbt
byhbt / apache2.sh
Created March 4, 2021 11:32 — forked from mikepfeiffer/apache2.sh
EC2 Bootstrap Script for Apache v2
#!/bin/bash
yum update -y
yum install -y httpd
instanceId=$(curl http://169.254.169.254/latest/meta-data/instance-id)
echo "<h1>Hello World from $instanceId</h1>" > /var/www/html/index.html
systemctl start httpd
systemctl enable httpd
{
"body": {
"key": {
"eldest_kid": "0120f7cb5ae5977ab8023cb27415c7f242e0d1ca3c627f1d2f365c27d7cd6cb2c7cb0a",
"host": "keybase.io",
"kid": "0120f7cb5ae5977ab8023cb27415c7f242e0d1ca3c627f1d2f365c27d7cd6cb2c7cb0a",
"uid": "92dd8c78b39d1ac841135be28fa76419",
"username": "huynhbathanh"
},
"merkle_root": {
@byhbt
byhbt / RAILS_6_CHEATSHEET.md
Last active March 12, 2020 04:54 — forked from mdang/RAILS_CHEATSHEET.md
Ruby on Rails Cheatsheet

Ruby on Rails Cheatsheet

Architecture

Create a new application

Install the Rails gem if you haven't done so before

@byhbt
byhbt / programming-achievements.md
Last active January 7, 2020 16:32 — forked from SantiagoValdez/programming-achievements.md
Programming Achievements: How to Level Up as a Developer.

Current [-]. Completed [X]

Learn a variety of commonly-used programming languages:

  • [] Write a program in Ruby
  • [] Write a program in Python
  • [] Write a program in C
  • [] Write a program in C++
  • [] Write a program in Java
  • [] Write a program in Objective-C
@byhbt
byhbt / demo.php
Created January 5, 2020 04:06
How to use elastica
<?php
/**
* Cách 1: Sử dụng EsHelper để build query
*/
$esHelper = new EsHelper();
$term = $esHelper->createTerm('company_id', -1);
$boolQuery = $esHelper->createBoolQuery();
$boolQuery->addMust($term);
gsviecweb git:(trunk) ✗ docker-compose up --force-recreate
Creating network "gsviecweb_default" with the default driver
Creating gsviecweb_redis-master_1 ... done
Creating gsviecweb_db_1 ... done
Creating gsviecweb_php_1 ... done
Creating gsviecweb_phpmyadmin_1 ... done
Attaching to gsviecweb_redis-master_1, gsviecweb_db_1, gsviecweb_phpmyadmin_1, gsviecweb_php_1
redis-master_1 | 1:C 20 Oct 2019 07:13:50.706 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
redis-master_1 | 1:C 20 Oct 2019 07:13:50.706 # Redis version=5.0.6, bits=64, commit=00000000, modified=0, pid=1, just started
redis-master_1 | 1:C 20 Oct 2019 07:13:50.706 # Warning: no config file specified, using the default config. In order to specify a config file use redis-server /path/to/redis.conf
@byhbt
byhbt / gist:38c64e6f4a0555562ef74250fa2ad356
Created October 20, 2019 07:10
gsviec docker-composer up issue
➜ gsviecweb git:(trunk) docker-compose up
Creating network "gsviecweb_default" with the default driver
Creating gsviecweb_db_1 ... done
Creating gsviecweb_redis_1 ... done
Creating gsviecweb_phpmyadmin_1 ... done
Creating gsviecweb_php_1 ... done
Attaching to gsviecweb_db_1, gsviecweb_redis_1, gsviecweb_phpmyadmin_1, gsviecweb_php_1
db_1 | 2019-10-20 07:09:42+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 5.7.28-1debian9 started.
redis_1 | 1:C 20 Oct 2019 07:09:42.502 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
redis_1 | 1:C 20 Oct 2019 07:09:42.502 # Redis version=5.0.6, bits=64, commit=00000000, modified=0, pid=1, just started
@byhbt
byhbt / gist:53a7d72fbb487a4b1a39f8761ebc80f5
Created October 20, 2019 02:43
log docker-compose up
➜ gsviecweb git:(trunk) ✗ docker-compose up --build --force-recreate
WARNING: Found orphan containers (gsviecweb_redis-master_1) for this project. If you removed or renamed this service in your compose file, you can run this command with the --remove-orphans flag to clean it up.
Recreating gsviecweb_redis_1 ... done
Recreating gsviecweb_db_1 ... done
Recreating gsviecweb_phpmyadmin_1 ... done
Recreating gsviecweb_php_1 ... done
Attaching to gsviecweb_redis_1, gsviecweb_db_1, gsviecweb_php_1, gsviecweb_phpmyadmin_1
redis_1 | 1:C 20 Oct 2019 01:43:03.591 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
redis_1 | 1:C 20 Oct 2019 01:43:03.591 # Redis version=5.0.6, bits=64, commit=00000000, modified=0, pid=1, just started
redis_1 | 1:C 20 Oct 2019 01:43:03.591 # Warning: no config file specified, using the default config. In order to specify a config file use redis-server /path/to/redis.conf