Skip to content

Instantly share code, notes, and snippets.

View congdinh's full-sized avatar
🤠
Always learning

Neo congdinh

🤠
Always learning
View GitHub Profile
@congdinh
congdinh / clean.sh
Created July 17, 2025 07:05
Free up disk space on Ubuntu - clean log, cache, archive packages/apt archives, orphaned packages, old kernel and remove the trash
#!/bin/sh
#Check the Drive Space Used by Cached Files
du -sh /var/cache/apt/archives
#Clean all the log file
#for logs in `find /var/log -type f`; do > $logs; done
logs=`find /var/log -type f`
for i in $logs
@congdinh
congdinh / install_zsh.sh
Created February 10, 2025 08:26
Install Oh my zsh and auto suggestion
#!/bin/bash
# Download iterm2 + zsh from these links
#https://sourabhbajaj.com/mac-setup/iTerm/zsh.html
#https://iterm2.com/
# Verify Zsh installation
zsh --version
# Install Oh My Zsh
@congdinh
congdinh / zshrc.sh
Created August 5, 2024 03:33
Simple .zshrc config file with plugins: git colored-man-pages zsh-syntax-highlighting zsh-autosuggestions
# Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc.
# Initialization code that may require console input (password prompts, [y/n]
# confirmations, etc.) must go above this block; everything else may go below.
if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then
source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh"
fi
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH
# Path to your oh-my-zsh installation.
# Generated by Powerlevel10k configuration wizard on 2022-03-19 at 22:48 +07.
# Based on romkatv/powerlevel10k/config/p10k-lean.zsh, checksum 11390.
# Wizard options: nerdfont-complete + powerline, small icons, unicode, lean, 24h time,
# 1 line, compact, few icons, concise, instant_prompt=verbose.
# Type `p10k configure` to generate another config.
#
# Config for Powerlevel10k with lean prompt style. Type `p10k configure` to generate
# your own config based on it.
#
# Tip: Looking for a nice color? Here's a one-liner to print colormap.
@congdinh
congdinh / Neo Blank.Iterm2.json
Created June 26, 2024 03:09
Neo Blank Iterm2 Preset
{
"Set Local Environment Vars" : false,
"Working Directory" : "\/Users\/neo",
"Prompt Before Closing 2" : false,
"Selected Text Color" : {
"Green Component" : 0.92142927646636963,
"Blue Component" : 0.93115901947021484,
"Red Component" : 0.90730977058410645
},
"Rows" : 25,
@congdinh
congdinh / create_swap.sh
Last active June 18, 2025 03:47
sh create_swap.sh --input=2048k
#!/bin/bash
# Script này tạo và thiết lập một file swap trên hệ thống Linux.
# Nó sẽ kiểm tra xem có swap nào đã được kích hoạt hay không,
# nếu có thì sẽ tắt và xóa file swap hiện tại trước khi tạo mới.
# Sau đó, nó sẽ tạo một file swap với dung lượng được chỉ định,
swapoff /swapfile
rm -f /swapfile
@congdinh
congdinh / docker-compose-elk.yml
Created April 1, 2024 10:06
Docker Compose ElasticSearch Latest Version - Kibana Dashboard - Cerebro Management - ElasticHQ Management
version: 3.8
services:
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:8.13.0
container_name: neo-es-node-1
hostname: neo-es-node-1
environment:
- network.host=0.0.0.0
- xpack.license.self_generated.type=basic
- xpack.security.enabled=false
@congdinh
congdinh / settings.json
Last active April 4, 2024 02:51
Vscode 2024 NodeJS
{
// General Settings:
"breadcrumbs.enabled": false,
"editor.formatOnSave": true,
// "editor.stickyScroll.enabled": false,
"explorer.compactFolders": false,
"explorer.sortOrder": "type",
"extensions.ignoreRecommendations": true,
"files.autoSave": "off",
"security.workspace.trust.banner": "never",
@congdinh
congdinh / docker-compose-postgres-metabase.yml
Last active March 22, 2024 09:39
Docker Compose Postgres Metabase
version: '3.5'
services:
metabase:
image: metabase/metabase:latest
container_name: metabase
hostname: metabase
restart: always
volumes:
- ./mbdata:/metabase
- ./metabase-db:/metabase.db
@congdinh
congdinh / mongodb-cheatsheet.md
Created December 19, 2023 04:29
MongoDB Learning

Mongo

  • MongoDB là cơ sở dữ liệu đa nền tảng, hướng documents (document oriented).

  • Mongo có 2 khái niệm là collection và document.

  • Một server Mongo thì có thể chứa nhiều database.

  • Database gồm nhiều collection, mỗi collection gồm nhiều document.

  • Document là một tập cái cặp key - value, document trong một collection có schema động, chúng không nhất thiết phải có cùng tập các field hay cùng cấu trúc.

  • Bảng tương quan giữa RDBMS(Relational Database Management System) và MongoDB:

table