Skip to content

Instantly share code, notes, and snippets.

View ktdung's full-sized avatar
💭
be happy 💯

ktdung

💭
be happy 💯
View GitHub Profile
@ktdung
ktdung / LINUX BASH COMMAND
Created August 21, 2025 02:46 — forked from axecnarf87/LINUX BASH COMMAND
Linux Foundations - LFS101x - Introduction to Linux Course - basic Command and some brief basic knowledge
Service - Program which runs as a background process
"initramfs" filesystem image contains programs and binary files that perform all actions needed to mount the proper root filesystem in RAM.
"init" program on the root filesystem (/sbin/init) is executed. Handles the mounting and pivoting over to the final real root filesystem. If special hardware drivers are needed before the mass storage can be accessed, they must be in the initramfs image.
The kernel runs the "/sbin/init" program. This then becomes the initial processes to get the system running.
"parted -l" to determine the type of partition table
"parted /dev/sda p" for listing the device node of the physical drive (/dev/sda), not a partition (/dev/sda1, /dev/sda2, etc. are partitions).
"gdisk -l /dev/sda" Interactive GUID partition table (GPT) manipulator
-The older startup system (SysVinit) viewed things as a serial process, divided into a series of sequential stages.
@ktdung
ktdung / hls.sh
Created July 5, 2025 05:56 — forked from stenuto/hls.sh
HLS ffmpeg script
#!/bin/bash
# Function to display usage information
usage() {
echo "Usage: $0 /path/to/input.mp4 [ /path/to/output_directory ]"
exit 1
}
# Check if at least one argument (input file) is provided
if [ $# -lt 1 ]; then
# CLI
sudo apt update && apt install \
git curl docker.io \
build-essential pkg-config autoconf bison rustc cargo clang \
libssl-dev libreadline-dev zlib1g-dev libyaml-dev libreadline-dev libncurses5-dev libffi-dev libgdbm-dev libjemalloc2 \
libvips imagemagick libmagickwand-dev libsqlite3-0 \
redis-server mysql-server sqlite3 libmysqlclient-dev apache2-utils \
rbenv
# UI apps
@ktdung
ktdung / latency.markdown
Created June 5, 2023 12:32 — forked from hellerbarde/latency.markdown
Latency numbers every programmer should know

Latency numbers every programmer should know

L1 cache reference ......................... 0.5 ns
Branch mispredict ............................ 5 ns
L2 cache reference ........................... 7 ns
Mutex lock/unlock ........................... 25 ns
Main memory reference ...................... 100 ns             
Compress 1K bytes with Zippy ............. 3,000 ns  =   3 µs
Send 2K bytes over 1 Gbps network ....... 20,000 ns  =  20 µs
SSD random read ........................ 150,000 ns  = 150 µs

Read 1 MB sequentially from memory ..... 250,000 ns = 250 µs

@ktdung
ktdung / -setup-windows-wsl-devenv.md
Created June 5, 2023 12:31 — forked from leodutra/-setup-windows-wsl-devenv.md
Install and Setup Windows Subsystem 2 for Linux, Hyper, ZSH + Oh My Zsh + Powerlevel9k + plugins, FNM + VSCode (+ext) and Nerd Font

Setup Windows Subsystem 2 for Linux

Windows Subsystem 2 for Linux, Hyper, ZSH + Oh My Zsh + Powerlevel9k + plugins, FNM + VSCode (+ext) and Nerd Font

To setup native Linux, see this gist

Preview

Requirements

@ktdung
ktdung / -setup-linux-devenv.md
Created June 5, 2023 12:30 — forked from leodutra/-setup-linux-devenv.md
Install and Setup Ubuntu Linux dev env with Terminator, ZSH (+ .zshrc) + Oh My Zsh + Powerlevel9k + plugins, Rust, FNM + VSCode (+ext) and Nerd Font

Setup Ubuntu Linux Dev Environment

Terminator, ZSH (+ .zshrc) + Oh My Zsh + Powerlevel9k + plugins, Rust, FNM + VSCode (+ext) and Nerd Font

To setup Linux for WSL2, see this gist

Preview

Requirements

Problem

I have two Github accounts: oanhnn (personal) and superman (for work). I want to use both accounts on same computer (without typing password everytime, when doing git push or pull).

Solution

Use ssh keys and define host aliases in ssh config file (each alias for an account).

How to?

  1. Generate ssh key pairs for accounts and add them to GitHub accounts.
@ktdung
ktdung / installing-node-with-nvm.md
Created August 22, 2019 06:21 — forked from d2s/installing-node-with-nvm.md
Installing Node.js to Linux & macOS & WSL with nvm