Skip to content

Instantly share code, notes, and snippets.

@tung1404
tung1404 / fr.md
Last active March 28, 2025 06:31 — forked from klllr/fr.md

Educational materials

In English

French in Action

http://rutracker.org/forum/viewtopic.php?t=3623122

A complete course for learning French, consisting of video lessons, audio, a textbook and a collection of exercises. The video is a funny fifty-episode series with a bunch of fan service and is completely in French, so it is definitely worth watching, even if you do not know English and will not do the exercises. The audio lessons are based on the material of each episode, new vocabulary and grammar are presented, and cultural features are analyzed. Due to the fact that the course is completely self-contained, contains a huge number of exercises with answers and promotes immersion in the language environment, it is one of the best options for independent study.

@tung1404
tung1404 / Office_kms
Created February 3, 2025 12:10 — forked from OkoyaUsman/Office_kms
KMS server Windows
cd\Program Files\Microsoft Office\Office16
cd\Program Files (x86)\Microsoft Office\Office16
cscript OSPP.VBS /sethst:kms.digiboy.ir
cscript OSPP.VBS /actcscript OSPP.VBS /dstatus
slmgr.vbs /ckms
# Reference: https://indominusbyte.github.io/fastapi-jwt-auth/usage/basic/
from fastapi import FastAPI, Depends, Request, HTTPException
from fastapi.responses import JSONResponse
from fastapi_jwt_auth import AuthJWT
from fastapi_jwt_auth.exceptions import AuthJWTException
from pydantic import BaseModel
app = FastAPI()
@tung1404
tung1404 / Dockerfile
Created September 24, 2024 02:09 — forked from ryuichi24/Dockerfile
docker-compose setup for Jenkins with python3
FROM jenkins/jenkins:lts-alpine
USER root
RUN apk add --no-cache python3
RUN python3 -m ensurepip
RUN python3 -m pip install --upgrade pip
RUN if [ ! -e /usr/bin/pip ]; then ln -s pip3 /usr/bin/pip ; fi
RUN if [[ ! -e /usr/bin/python ]]; then ln -sf /usr/bin/python3 /usr/bin/python; fi
RUN rm -r /root/.cache
RUN apk add pkgconf
RUN apk add build-base
@tung1404
tung1404 / jwt.md
Created September 15, 2024 09:37 — forked from koo6357/jwt.md
JWT - RSA256

JWT

RSA256 알고리즘 - 비대칭키 암호

엄청 큰 숫자는 소인수분해하기가 힘들다는 것을 이용한다.

아래 설명은 개인적으로 이해한 뇌피셜의 표현이다.

6 = 2 x 3;

@tung1404
tung1404 / pino_trace_caller.js
Created June 5, 2024 07:30 — forked from miguelmota/pino_trace_caller.js
Node.js pino logger show caller filename and line number
import path from 'path'
import pino from 'pino'
const STACKTRACE_OFFSET = 2
const LINE_OFFSET = 7
const { symbols : { asJsonSym} } = pino
function traceCaller (pinoInstance) {
const get = (target, name) => name === asJsonSym ? asJson : target[name]
@tung1404
tung1404 / client.tsx
Created June 5, 2024 04:40 — forked from mishushakov/client.tsx
A React hook for calling Next.js Server Actions from client components
'use client'
import { test } from './server'
import { useServerAction } from './hook'
export default function Home() {
const { data, loading, error, execute: testAction } = useServerAction(test)
if (loading) return <div>Loading...</div>
if (error) return <div>Error: {error.message}</div>
@tung1404
tung1404 / esm-package.md
Created May 31, 2024 09:16 — forked from sindresorhus/esm-package.md
Pure ESM package

Pure ESM package

The package that linked you here is now pure ESM. It cannot be require()'d from CommonJS.

This means you have the following choices:

  1. Use ESM yourself. (preferred)
    Use import foo from 'foo' instead of const foo = require('foo') to import the package. You also need to put "type": "module" in your package.json and more. Follow the below guide.
  2. If the package is used in an async context, you could use await import(…) from CommonJS instead of require(…).
  3. Stay on the existing version of the package until you can move to ESM.
@tung1404
tung1404 / jwtUntrusted.kt
Created March 26, 2024 07:40 — forked from bastman/jwtUntrusted.kt
kotlin parse jwt untrusted - ignore signature
// see: https://github.com/auth0-blog/spring-boot-jwts/blob/master/src/main/java/com/example/security/TokenAuthenticationService.java
//Example:
val json:String= JwtUntrusted.parseClaimsUntrustedToJson("Bearer xxx")
object JwtUntrusted {
// requires (gradle): compile group: 'io.jsonwebtoken', name: 'jjwt', version: '0.9.0'
private val JSON = jacksonObjectMapper()
fun removeSignature(jwt:String) = jwt.replaceAfterLast(".", "").trim()
@tung1404
tung1404 / Django installations on Ubuntu.md
Created December 6, 2023 14:56 — forked from 101t/Django installations on Ubuntu.md
Quick Start with Django installations on Ubuntu

Django installations on Ubuntu

Installing Python in system

First step install dependencies.

sudo apt-get install git python-setuptools python-pip python-dev \
&& sudo apt-get install python3-pip python3-dev virtualenv

then install local envirement of Django project.