Skip to content

Instantly share code, notes, and snippets.

Quoc Hoang hoangddt

Block or report user

Report or block hoangddt

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@hoangddt
hoangddt / docker-command.sh
Last active Jan 21, 2019
Docker compose keycloak, Postgres Database
View docker-command.sh
#!/bin/bash
docker run --rm -p 8888:8080 -e POSTGRES_USER=keycloak -e POSTGRES_DATABASE=keycloak_db -e POSTGRES_PASSWORD=4vSm/fNxO6LHSymo3yVPgQ== -e POSTGRES_PORT_5432_TCP_ADDR=postgres.default -e POSTGRES_PORT_5432_TCP_PORT='5432' my-keycloak
docker run --name=postgres -p 5432:5432 -e POSTGRES_USER=keycloak -e POSTGRES_DB=keycloak_db -e POSTGRES_PASSWORD=local postgres
psql -h localhost -p 5432 -U keycloak keycloak_db
docker run -it --rm --link postgres:postgres postgres psql -h postgres -U keycloak keycloak_db
@hoangddt
hoangddt / explanation.md
Created Dec 20, 2018 — forked from masak/explanation.md
How is git commit sha1 formed
View explanation.md

Ok, I geeked out, and this is probably more information than you need. But it completely answers the question. Sorry. ☺

Locally, I'm at this commit:

$ git show
commit d6cd1e2bd19e03a81132a23b2025920577f84e37
Author: jnthn <jnthn@jnthn.net>
Date:   Sun Apr 15 16:35:03 2012 +0200

    When I added FIRST/NEXT/LAST, it was idiomatic but not quite so fast. This makes it faster. Another little bit of masak++'s program.
@hoangddt
hoangddt / user_setting.md
Last active Oct 3, 2018
Code Editor setting
View user_setting.md
// VS COde
{
    "window.zoomLevel": 0,
    "workbench.colorTheme": "Material Theme",
    "editor.fontFamily": "Inconsolata-g",
    // "editor.fontWeight": "100",
    "editor.fontSize": 11,
    "editor.letterSpacing": 0.3,
    "editor.minimap.showSlider": "always",
View ssh_root_user.md

https://tecadmin.net/how-to-enable-ssh-as-root-on-aws-ubuntu-instance/

sudo service ssh reload

/etc/ssh/sshd_config

authorized_keys

no-port-forwarding,no-agent-forwarding,no-X11-forwarding,command="echo 'Please login as the user "admin" rather than the user "root".';echo;sleep 10" ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC7cyhhhowluDtBnq3cw6opWeuD/AtwFWguGzwKwRZdlGjsNEv7hrsYeee6Cd82B8/pYdXX/e1Lg02hrmBnunvaB/BZD1Kb7IGvzplOjeJiaFqQvW6QMyWd1pt7ZiHmzyZ0uEBgBsgnblBink+25xqAb8gJD5fHVdzT8aEP8M3gs3dMScfhbxWIPC/a8cyzQ/8khNPdyQtaC0eEmXUHGhNsWnDmQv47lDaKjMi+AsoRxrtceGokWg6a9D/IGsxtKFMkMB/RM83UH/Yjcw9HxQPcKDUWEnnhMPGGGuPwQmikDdsipOT7RzFQZhF2MgNp7dwcnpxzp/sT1KW54L6ZjELP id_rsa

@hoangddt
hoangddt / table.md
Last active Sep 7, 2018
Writing table
View table.md

Task: http://ielts-simon.com/ielts-help-and-english-pr/2011/01/ielts-writing-task-1-consumer-durables-table.html

The table give information about the consumer durables owned in Britain over the course of 11 years starting 1972.

Looking at the graph, it is immediately obvious that all the equipments in Britain exprienced an upward progression. The percentage of television registered the highest percentage throughout the period.

In 1972, television registered 93 percent, then increase steadily to 98 percent in 1983. A similar trend was seen in refrigerator and vacuum cleaner, they both slightly increase throughtout the period. To be specific, the figures for these start at 73 and 87 to 94 and 95 respectively. The percent of central heating in 1972 was 39, then increased exponentially to 64 in 1983. A sinilar trend was seen in telephone, which nearly doubled from 42 to 77 percent.

@hoangddt
hoangddt / ssh-agent
Created Aug 21, 2018
ssh-agent add default private key
View ssh-agent
ssh-add ~/.ssh/id_rsa
ssh-add -L
@hoangddt
hoangddt / x-docker-run
Created Aug 15, 2018
Override the entrypoint when using docker run
View x-docker-run
docker run --rm -ti --entrypoint='' <image> bash
@hoangddt
hoangddt / 1_kubernetes_on_macOS.md
Created Aug 2, 2018 — forked from kevin-smets/1_kubernetes_on_macOS.md
Local Kubernetes setup on macOS with minikube on VirtualBox and local Docker registry
View 1_kubernetes_on_macOS.md

Requirements

Minikube requires that VT-x/AMD-v virtualization is enabled in BIOS. To check that this is enabled on OSX / macOS run:

sysctl -a | grep machdep.cpu.features | grep VMX

If there's output, you're good!

Prerequisites

@hoangddt
hoangddt / docker_phpmyadmin.sh
Last active Aug 6, 2018
Phpmyadmin docker quick run
View docker_phpmyadmin.sh
$ docker run -d --link <container'sname>:db -p 8080:80 --net=<netname> phpmyadmin/phpmyadmin
adminer for almost all databases
$ docker run --rm --link database:db --net=docker-zulip_default -p 8888:8080 adminer
You can’t perform that action at this time.