Skip to content

Instantly share code, notes, and snippets.

View hoangddt's full-sized avatar

Hoang Truong hoangddt

View GitHub Profile
@hoangddt
hoangddt / worker.js
Created August 1, 2024 07:41 — forked from longseespace/worker.js
Cloudflare Worker Proxy
addEventListener('fetch', (event) => {
event.respondWith(handleRequest(event.request));
});
async function handleRequest(request) {
const url = new URL(request.url);
const { pathname, search } = url;
var newPathname = pathname;
if (pathname.startsWith('/docs')) {
newPathname = pathname.replace('/docs', '');
@hoangddt
hoangddt / UND_ERR_INVALID_ARG.txt
Created January 31, 2024 05:42
UND_ERR_INVALID_ARG log
0|example.io | upstream image response failed for /img/assets/hero.png TypeError: fetch failed
0|example.io | at Object.fetch (node:internal/deps/undici/undici:11730:11)
0|example.io | at async invokeRequest (/var/www/example.io/node_modules/next/dist/server/lib/server-ipc/invoke-request.js:16:12)
0|example.io | at async /var/www/example.io/node_modules/next/dist/server/next-server.js:362:35
0|example.io | at async imageOptimizer (/var/www/example.io/node_modules/next/dist/server/image-optimizer.js:537:13)
0|example.io | at async cacheEntry.imageResponseCache.get.incrementalCache (/var/www/example.io/node_modules/next/dist/server/next-server.js:517:61)
0|example.io | at async /var/www/example.io/node_modules/next/dist/server/response-cache/index.js:102:36 {
0|example.io | cause: InvalidArgumentError: invalid connection header
0|example.io | at processHeader (/var/www/example.io/node_modules/next/dist/compiled/undici/index.js:1:102994)
0|example.io | at new Reque
{
"meta": { "theme": "elegant" },
"basics": {
"name": "Truong Van Quoc Hoang",
"label": "Backend Department Manager",
"picture": "https://i.imgur.com/T2FZbqt.jpg",
"summary": "I am a Backend Department Manager who can build applications from the ground up. I have worked mostly at startup so I am used to wearing many hats. As a department manager, I focus on building the team and enable the developer to work efficient to deliver product with highest quality and on time. I'm generally very flexible when investigating new roles.",
"website": "https://hoangddt.net",
"email": "[email protected]",
"phone": "+84 34 865 8156",
@hoangddt
hoangddt / libreswan-client-install
Last active August 1, 2020 05:03
libreswan-client-install
#!/bin/bash
apt-get -yq install wget dnsutils openssl \
iptables iproute2 gawk grep sed net-tools || exiterr2
apt-get -yq install libnss3-dev libnspr4-dev pkg-config \
libpam0g-dev libcap-ng-dev libcap-ng-utils libselinux1-dev \
libcurl4-nss-dev flex bison gcc make libnss3-tools \
libevent-dev ppp xl2tpd || exiterr2
@hoangddt
hoangddt / docker-command.sh
Last active January 21, 2019 08:23
Docker compose keycloak, Postgres Database
#!/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 December 20, 2018 10:50 — forked from masak/explanation.md
How is git commit sha1 formed

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 <[email protected]>
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 October 3, 2018 03:32
Code Editor setting
// 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",
@hoangddt
hoangddt / ssh_root_user.md
Last active September 11, 2018 09:36
SSH root user

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 September 7, 2018 09:10
Writing table

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 / link.md
Created August 22, 2018 09:57
fix helm issue