Skip to content

Instantly share code, notes, and snippets.

View duongphuhiep's full-sized avatar

DUONG Phu-Hiep duongphuhiep

  • lemonway.fr
  • Paris, France
View GitHub Profile
@duongphuhiep
duongphuhiep / fluentd-configmap.yaml
Last active May 14, 2022 13:46
Configure fluentd 0.12 config to accept logs via HTTP inputs
apiVersion: v1
kind: ConfigMap
metadata:
name: fluentd-es-config
namespace: kube-system
labels:
addonmanager.kubernetes.io/mode: Reconcile
k8s-app: fluentd-es
kubernetes.io/minikube-addons: efk
data:
@duongphuhiep
duongphuhiep / webservice_challenge.md
Created July 28, 2021 07:58 — forked from lemonway/webservice_challenge.md
.NET Developer LemonWay Challenge

In this challenge, you will have to create a WebService and test it. You will then have to publish your code sources to Github, and send the link to [email protected] with your CV in attachment.

  • Feel free to use any library / framework or copy/paste codes of others with respect of the author's license. Please list the used libraries / code snippets in your README.md file.
  • There is no time limit.

1) Create a ASP.NET SOAP WebService

Open Visual Studio (the latest Community Edition is recommended).

Create a ASP.NET SOAP WebService (not a WCF WebService or a Restful WebService) with the following Web Methods:

@duongphuhiep
duongphuhiep / DepsInjDemo.cs
Created June 26, 2020 19:48
Dependencies Injection Demo
using Autofac;
using Autofac.Extensions.DependencyInjection;
using Microsoft.Extensions.DependencyInjection;
using System;
using System.Reflection;
namespace poc.client
{
public interface IWalletRepository
{
IMPORT TABLE wallet (
id bigserial primary key,
name text not null,
gender int,
email text,
first_name text,
last_name text,
creation_date timestamp not null,
situation int,
balance decimal not null,
@duongphuhiep
duongphuhiep / docker-compose.yml
Created April 27, 2020 20:40
docker compose postgres and pgadmin
version: '3'
services:
pg:
image: postgres
ports:
- "5432:5432"
environment:
- POSTGRES_USER=root
- POSTGRES_PASSWORD=root
volumes:
@duongphuhiep
duongphuhiep / tg.sql
Created April 26, 2020 19:20
Cosmetic sales - Sample Postgresql database
DROP DATABASE if exists tg;
CREATE DATABASE tg;
USE tg;
DROP TABLE IF EXISTS Export;
DROP TABLE IF EXISTS Client_Order;
DROP TABLE IF EXISTS Import;
DROP TABLE IF EXISTS Supplier_Order;
DROP TABLE IF EXISTS Facture;
DROP TABLE IF EXISTS Product;
DROP TABLE IF EXISTS Shipper;
@duongphuhiep
duongphuhiep / description.md
Last active April 23, 2020 14:09
couchebase ACID and race condition?

First transaction:

trans1 = transactions.run((txnctx) -> {
    b1 = readBalance(wallet1)
    b2 = readBalance(wallet2)
    //transfer 10$ from wallet1 to wallet2
    if (b1 > 10) {
        upsert(wallet1.balance = b1-10);
 upsert(wallet2.balance = b2+10);
#!/usr/bin/env python
from scapy.all import *
from random import randint
if __name__ == '__main__':
ports = [21,22,23,25,80,443,8080]
@duongphuhiep
duongphuhiep / index.html
Created March 22, 2019 15:54
VueJS introduction
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Hello World</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<script src="https://unpkg.com/vue/dist/vue.js"></script>
<style>
.classDone {
@duongphuhiep
duongphuhiep / authorization.md
Last active December 15, 2019 23:02
authorization

Many different interpration, here one of the example

  • Resource = a components or service (wallet, transaction, jobscheduler)

    • The Authorization server usually holds a list (or a Hierarchy) of all possible subjects
  • Rights (or Actions) = an interaction: SendEmail, CreateWallet, MoneyOut..

    • The Authorization server usually holds a list (or a Hierarchy) of all possible Rights (Actions)
  • Permission = Right + Resource (Right on a Resource)