Skip to content

Instantly share code, notes, and snippets.

View dungdm93's full-sized avatar
🏁
Working hard

Đặng Minh Dũng dungdm93

🏁
Working hard
  • VPBank
  • Hanoi, Vietnam
  • Facebook dungdm93
View GitHub Profile
{
"fileTable": [
".github/workflows/demo.yml"
],
"mask": [
{
"type": "regex",
"value": "\\bv1\\.[0-9A-Fa-f]{40}\\b"
},
{

chainguard

❯ crane digest cgr.dev/chainguard/python:latest
sha256:4cd9986c4e8c6c5f091a46f38f19b212e0f46a21e8e6e540596f266a123781c2

Image manifest

@dungdm93
dungdm93 / starship.toml
Created November 19, 2021 10:40
starship config
format = """
$username\
$hostname\
$directory\
$git_branch\
$git_commit\
$git_status\
$git_state\
$kubernetes\
$golang\
@dungdm93
dungdm93 / README.md
Last active September 15, 2021 15:16
Kafka
kafkacat -b bootstrap.kafka.host:9092 \
  -C -t topic \
  -s avro -r http://schema-registry.host:8081 \
  -f '
  Key (%K bytes): %k
  Value (%S bytes): %s
  Timestamp: %T
  Partition: %p
 Offset: %o
{
"exp": 1612718555,
"iat": 1612718255,
"auth_time": 1612717668,
"jti": "1546abd9-68c8-4167-a094-05bc09ca4811",
"iss": "https://keycloak.dungdm93.me/auth/realms/data",
"aud": [
"realm-management",
"account"
],

tar

# extract
tar -xvf archive.tar

# List files in archive.tar
tar -tvf archive.tar

# compress
tar -cvf archive.tar foo bar
-- Show all databases
SELECT
database_id,
name,
create_date
FROM sys.databases;
--or using Stored Procedure
EXEC sp_databases;
-- Switch database
@dungdm93
dungdm93 / README.md
Last active February 11, 2020 02:40
faster import nyc-taxi-data

PostgreSQL

Monitoring Progress of Index Construction

PostgreSQL 12+

SELECT 
  now()::TIME(0), 
  a.query, 
  p.phase, 
  p.blocks_total, 
  p.blocks_done, 
@dungdm93
dungdm93 / gradle.md
Last active May 4, 2020 05:54
maven commands
plugins {
  id "com.dorongold.task-tree" version "1.5"
}

task resolveDependencies {
    setDescription "Resolves all projects dependencies from the repository."
    setGroup "Build Server"

 doLast {
@dungdm93
dungdm93 / semver-regex.md
Last active September 23, 2019 07:25
SemVer regex

Canonical regex

/^
(?'MAJOR'
    0|(?:[1-9]\d*)
)
\.
(?'MINOR'
 0|(?:[1-9]\d*)