Docker - SQL Server

Create SQL Server Container

sudo docker run -e 'ACCEPT_EULA=Y' \
  -e 'SA_PASSWORD=Asrofil123!' \
  -p 1433:1433 \
  --name sql2022 \
  -d mcr.microsoft.com/mssql/server:2022-latest

Start SQL Server Container

sudo docker start sql2022

Stop SQL Server Container

sudo docker stop sql2022

MySQL Configuration

Credentials:

  • Username: asrofil
  • Password: Asrofil123!

Connect to MySQL:

mysql -u asrofil -p

System Administration

View All Partitions

lsblk

Configure Boot Loader (GRUB)

sudo nano /etc/default/grub

After editing, update GRUB:

sudo update-grub

Switch PHP Version

sudo update-alternatives --config php

Install application .deb

sudo apt install <path>

Network & Process Management

View Running Applications and Ports

# View all listening ports
sudo ss -tulpn
 
# Filter specific application (e.g., Apache)
sudo ss -tulpn | grep apache2
 
# Alternative using netstat
sudo netstat -tulpn

View Application Path

which <app_name>
 
# Examples:
which php
which python3
which node

Monitor System Resources

# Modern, feature-rich monitor
btop
 
# Classic process monitor
htop
 
# Basic process list
top

Kill Running Process

# Kill by PID
kill -9 <PID>
 
# Kill by process name
pkill <process_name>
 
# Example:
kill -9 1234
pkill apache2

Get Application Class Name (X11)

xprop | grep WM_CLASS
 
# Usage: Run command, then click on the window

Tmux - Terminal Multiplexer

Session Management

CommandDescription
tmux lsList all sessions
tmux new-session -s <name>Create new session
tmux attach -t <name>Attach to session
tmux kill-session -t <name>Kill session
aquaCreate and run aquarium session (custom alias)

Key Bindings

Prefix Key: Ctrl+a

Pane Management

KeybindingAction
Ctrl+a then vSplit vertical (left/right)
Ctrl+a then xSplit horizontal (top/bottom)
Ctrl+a then qClose current pane
Ctrl+a then h/j/k/lNavigate panes (Vim-style)
Ctrl+a then H/J/K/LResize panes

Session Management

KeybindingAction
Ctrl+a then sSwitch between sessions
Ctrl+a then dDetach from session
Ctrl+a then $Rename current session

Window Management

KeybindingAction
Ctrl+a then cCreate new window
Ctrl+a then nNext window
Ctrl+a then pPrevious window
Ctrl+a then wList windows
Ctrl+a then ,Rename current window

Other

KeybindingAction
Ctrl+a then rReload tmux config
Ctrl+a then PLoad preset layout
Ctrl+a then ?Show all keybindings

Custom Aliases

Tmux Aquarium Session

alias aqua='tmux new-session -s aquarium -d && \
  tmux send-keys -t aquarium "asciiquarium" C-m && \
  tmux attach -t aquarium'

Usage:

aqua  # Creates and attaches to aquarium session

Quick Reference

Docker Commands

docker ps                    # List running containers
docker ps -a                 # List all containers
docker images                # List images
docker logs <container>      # View container logs
docker exec -it <container> bash  # Enter container shell

File Permissions

chmod +x <file>             # Make executable
chmod 755 <file>            # rwxr-xr-x
chmod 644 <file>            # rw-r--r--

Service Management (systemd)

sudo systemctl start <service>
sudo systemctl stop <service>
sudo systemctl restart <service>
sudo systemctl status <service>
sudo systemctl enable <service>   # Auto-start on boot
sudo systemctl disable <service>

Download file from notion

curl -L -o "Nama_File.drawio" "URL_PANJANG_ITU"
atau
save as > nama_file.drawio

Telegram desktop muncul di semua window

Contoh: atur agar jendela dengan kelas tertentu tidak muncul di taskbar

gsettings set org.gnome.shell.app-switcher current-workspace-only true

Update artcraft product in my personal repo

cd /home/asrofil/Project/artcraft-workspace/artcraft
./artcraft-sync

Notes

  • Always backup configurations before editing
  • Use sudo for system-level operations
  • Check service status before making changes
  • Document any custom configurations for future reference