Skip to content

Instantly share code, notes, and snippets.

View lequocvuong's full-sized avatar

Vuong Le lequocvuong

View GitHub Profile
@mynamebvh
mynamebvh / index.js
Last active January 13, 2026 07:15
Generate QR Banking
const VietQR = require("./vietQR");
const vietQR = new VietQR();
vietQR
.setBeneficiaryOrganization("970423", "mynamebvh")
.setTransactionAmount("50000")
.setAdditionalDataFieldTemplate("test");
console.log(vietQR.build());
@farhad0085
farhad0085 / postgresql scaling - master-slave replication.md
Last active November 23, 2025 19:46
Set up master-slave replication in PostgreSQL, including all the necessary configuration files and settings.

Set up master-slave replication in PostgreSQL, including all the necessary configuration files and settings.

Assuming that you already have two servers with PostgreSQL installed, one of which will be designated as the master and the other as the slave, here are the steps to set up master-slave replication:

On the master server:

  1. Open the postgresql.conf file (usually located in /etc/postgresql/<version>/main/) and modify the following settings:
listen_addresses = '*'
@akhdaniel
akhdaniel / Setup PGPool + PostgreSQL 12.md
Last active March 3, 2024 21:49
Setup PGPool + PostgreSQL 12

A. Infrastructure

FQDN IP Purpose 1 Purpose 2
IT-RDBMS01.itenlight.com 10.1.10.150 Primary PostgreSQL instance Active pgpool-II instance
IT-RDBMS02.itenlight.com 10.1.10.155 Standby PostgreSQL instance Standby pgpool-II instance

Virtual IP that will be used is 10.1.10.159.

@kharysharpe
kharysharpe / README.md
Created October 4, 2020 02:01
Hourly and Daily MYSQL Backup / Dump with Retention Period

Steps

Create directories

mkdir -p /backup/mysql/hourly
mkdir -p /backup/mysql/daily

Set permissions on scripts:

@anilahir
anilahir / sql.md
Created December 20, 2019 08:14
MySQL transaction within stored procedure example

Create stored procedure :

DROP PROCEDURE IF EXISTS sp_delete_users_till_date;

DELIMITER //

CREATE PROCEDURE sp_delete_users_till_date(location_id INT, till_date DATE)
@nghminh163
nghminh163 / resetteamviewer.py
Created October 22, 2018 11:46
Reset ID Teamviewer
#!/usr/bin/env python
#coding:utf-8
import sys
import os
import glob
import platform
import re
import random
import string
@vanushwashere
vanushwashere / Redis-cli commands.md
Last active January 8, 2025 08:05
Redis CLI most used and basic commands

Source

https://habrahabr.ru/post/204354/

Authentication

bash> redis-cli -h 127.0.0.1 -p 6379 -a mysupersecretpassword //with ip bash> redis-cli -s /tmp/redis.sock -p 6379 -a mysupersecretpassword //with socket

or

redis> AUTH mysupersecretpassword

@ibraheem4
ibraheem4 / postgres-brew.md
Last active March 18, 2026 07:26
Installing Postgres via Brew (OSX)

Installing Postgres via Brew

Pre-Reqs

Brew Package Manager

In your command-line run the following commands:

  1. brew doctor
  2. brew update
@NikolayS
NikolayS / 00_slowest_queries_full.sql
Last active November 28, 2023 19:06
Useful Postgres Queries
-- In pg_stat_statements, there is a problem: sometimes (quite often), it registers the same query twice (or even more).
-- It's easy to check in your DB:
--
-- with heh as (
-- select userid, dbid, query, count(*), array_agg(queryid) queryids
-- from pg_stat_statements group by 1, 2, 3 having count(*) > 1
-- ) select left(query, 85) || '...', userid, dbid, count, queryids from heh;
--
-- This query gives you "full picture", aggregating stats for each query-database-username ternary
@vielhuber
vielhuber / README.sh
Last active December 15, 2025 11:21
MySQL: Import/export backup/restore dump mysqldump on command line #sql
# export
mysqldump -h localhost --port 3306 -u username -p"password" --routines database > dump.sql
# import
mysql -h localhost --port 3306 -u username -p"XXX" --default-character-set=utf8 database < dump.sql
# import with progress
pv dump.sql | mysql -h localhost --port 3306 -u username -p"XXX" --default-character-set=utf8 database
# note when using passwords with "$": escape passwords needed