diff --git a/notkaramel-guide-to-linux/.github.md b/notkaramel-guide-to-linux/.github.md new file mode 100644 index 0000000..21781e3 --- /dev/null +++ b/notkaramel-guide-to-linux/.github.md @@ -0,0 +1,5 @@ +Issue templates + +Pull Request templates + +deploy.yml templates? \ No newline at end of file diff --git a/notkaramel-guide-to-linux/Backend.md b/notkaramel-guide-to-linux/Backend.md new file mode 100644 index 0000000..01b3171 --- /dev/null +++ b/notkaramel-guide-to-linux/Backend.md @@ -0,0 +1,2 @@ +everything about `notkaramel.github.io` backend development! + diff --git a/notkaramel-guide-to-linux/Database.md b/notkaramel-guide-to-linux/Database.md new file mode 100644 index 0000000..75a93d4 --- /dev/null +++ b/notkaramel-guide-to-linux/Database.md @@ -0,0 +1,2 @@ +everything about `notkaramel.github.io` database development! + diff --git a/notkaramel-guide-to-linux/Frontend.md b/notkaramel-guide-to-linux/Frontend.md new file mode 100644 index 0000000..9a51ba7 --- /dev/null +++ b/notkaramel-guide-to-linux/Frontend.md @@ -0,0 +1 @@ +everything about `notkaramel.github.io` frontend development! \ No newline at end of file diff --git a/notkaramel-guide-to-linux/Home.md b/notkaramel-guide-to-linux/Home.md new file mode 100644 index 0000000..d8ba736 --- /dev/null +++ b/notkaramel-guide-to-linux/Home.md @@ -0,0 +1,3 @@ +Welcome to the notkaramel wiki! + +Here is everything about notkaramel GitHub and his software development journey! \ No newline at end of file diff --git a/notkaramel-guide-to-linux/_Sidebar.md b/notkaramel-guide-to-linux/_Sidebar.md new file mode 100644 index 0000000..c2c1cc5 --- /dev/null +++ b/notkaramel-guide-to-linux/_Sidebar.md @@ -0,0 +1,16 @@ +### [`notkaramel` wiki](.) +0. [.github](./.github) + +1. notkaramel: everything about me + - [That ✨ _special_ ✨ repo](./notkaramel) + - [Everything Linux](./linux) + - [Arch Installation Guide](./ArchInstallation) + - [Core Packages](./CorePackages) + - [i3 Configuration](./i3Configuration) + - [Network Configuration](./NetworkConfiguration) + - dotfiles + +2. [notkaramel.github.io](./notkaramel.github.io) + - [2.1. Frontend](./Frontend) + - [2.2. Backend](./Backend) + - [2.3. Database](./Database) diff --git a/notkaramel-guide-to-linux/linux/ArchInstallation.md b/notkaramel-guide-to-linux/linux/ArchInstallation.md new file mode 100644 index 0000000..48cf691 --- /dev/null +++ b/notkaramel-guide-to-linux/linux/ArchInstallation.md @@ -0,0 +1,170 @@ +# Arch Installation Documentation (non dual-boot) +> by @notkaramel + +## Prerequisite +- [ ] USB Drive (~800MB) with [archiso](https://archlinux.org/download/) + - From Windows: Use `rufus` to flash ISO to drive + - From Linux: + - Using `rpi-imager` (AUR) via custom image + - MultiWriter `gnome-multi-writer` + +## Network Configuration +- Using wired connection is preferable +- `archiso` has iwctl built-in. It can connect to regular IEEE 802.11x wifi, i.e., Wifi with SSID and passphrase. + +## Booting & Partition +- Update system clock +```sh +timedatectl set-ntp true +``` + +- Using `fdisk` for partitioning +```sh +fdisk -l # list all partitions +fdisk /dev/device # e.g.: /dev/sda, /dev/nvme0n1 +``` + +- Now you're inside `fdisk` CLI: `m` for help menu + 0. If fresh install, or disk not GPT, do `g` to create new empty GPT table + 1. `n`: new partition + - Partition number: go by default or your preferred order + - First sector: rcm go by default + - Last sector: use `+SIZE` to set partition size (e.g.: +500MiB, +2G) + 2. `t`: change partition type + - Partition number: remember from previously determined + - `L` for option menu, `Q` to quit menu + - Recommend GPT table: + + | Partition | # | Type (`t` option) | Size | + |-------------------|---|-------------------|-----------| + | EFI System | 1 | EFI (1) | +600MiB | + | Swap (optional) | 2 | Linux swap (19) | +4GiB | + | Root | 3 | Linux root (23) | +50GiB | + | Home | 4 | Linux home (42) | the rest | + +> Partition a swap if the PC has low RAM (swap's size should be 2x RAM) + 3. `w`: write table to disk and exit + 4. `q`: quit without saving changes + +- Format partitions +```sh +mkfs.fat -F 32 /dev/EFI_Partition +mkswap /dev/SWAP_Partition +mkfs.ext4 /dev/ROOT_and_HOME +``` + +- Mounting & activate partitions +```sh +swapon /dev/SWAP_Partition +mount /dev/ROOT /mnt +mount /dev/HOME /mnt/home +mount --mkdir /dev/EFI /mnt/boot // for the EFI file system +``` + +- Edit `/etc/pacman.conf` and enable `ParallelDownloads = ...` for faster download +- Install essential packages (see [CorePackages.md](CorePackages.md) for more). `pacstrap` also have flags like `-K` to initialize empty pacman keyring +```sh +pacstrap /mnt base linux linux-firmware base base-devel # ... +``` +- Generate file system table `fstab` +```sh +genfstab -U /mnt >> /mnt/etc/fstab +``` + +- Now, `arch-chroot` to `/mnt` and go to next steps! + +## `arch-chroot` and root configuration + +> I highly recommend install `fish` shell of out-of-the-box suggestions. +```sh +pacman -S fish +chsh root +# New shell: /usr/bin/fish +``` + +- Set timezone +```sh +ln -sf /usr/share/zoneinfo/REGION/CITY /etc/localtime +``` +- Set system clock to hardware (or vice versa, do `man hwclock`) +```sh +hwclock --systohc +``` + +- Get text editor of choice: `nano`, `vim`, `neovim`, etc. + +- Localization: uncomment locale in `/etc/locale.gen` + - e.g.: en\_CA.UTF-8, fr\_CA.UTF-8 +```sh +locale-gen +``` + +- Create `locale.conf` to set up LANG +``` +LANG=en_CA.UTF-8 +``` + +- Network Configuration + - In `/etc/hostname`: + ``` + myHostName + ``` + - In `/etc/hosts`: + ``` + 127.0.0.1 localhost + ::1 localhost + 127.0.1.1 myHostName + ``` +- `mkinitcpio` +``` +mkinitcpio -P # using all presets, see `man mkinitcpio` for more +``` + +- Root password using `passwd` +- Add non-root user +``` +useradd -m myUser # `-m` create a folder in /home/myUser +passwd myUser # to set password +``` + +- Add user to access/privilege groups: +```sh +usermod -aG wheel,audio,video,optical,storage myUser +``` +> later on, groups like `docker` for Docker dev, or `uucp` for embedded (Arduino) are also required + +- Install `sudo` and edit `visudo`. +```sh +pacman -S sudo +EDITOR=nvim visudo # visudo uses vi by default, but you can specify your preferred text editor +``` + +- Here, root user can determine how users should have access to sudo. It's good to have password whenever `sudo` is called, but users can opt-out +```txt +%wheel ALL = (ALL) ALL +# %wheel ALL = (ALL) NOPASSWD: ALL +``` + +- Install GRUB and Dual-boot stuffs +```sh +pacman -S efitbootmgr os-prober grub +``` + +- Install `grub` to EFI menu (boot menu) && Generate GRUB config: +```sh +grub-install --target=x86_64-efi --efi-directory=/boot --bootloader-id=GRUB –recheck +grub-mkconfig -o /boot/grub/grub.cfg +``` + +- Exit, unmount everything, and you're done! +```sh +exit # Ctrl + D +umount -a /mnt # unmount all +``` + +## Source +- [Arch Wiki Guide](https://wiki.archlinux.org/title/Installation_guide) +- [DistroTube Guide](https://youtu.be/PQgyW10xD8s) +- [Dual boot with Windows - ArchWiki](https://wiki.archlinux.org/title/Dual_boot_with_Windows) +- [Partitioning - ArchWiki](https://wiki.archlinux.org/title/Partitioning#Discrete_partitions) +- [EFI system partition - ArchWiki](https://wiki.archlinux.org/title/EFI_system_partition#Mount_the_partition) diff --git a/notkaramel-guide-to-linux/linux/CorePackages.md b/notkaramel-guide-to-linux/linux/CorePackages.md new file mode 100644 index 0000000..22b498a --- /dev/null +++ b/notkaramel-guide-to-linux/linux/CorePackages.md @@ -0,0 +1,140 @@ +# List of Core Packages + +There is no order or obligation to download all. Download with intension! + +Notation styles: +- `package` or package (AUR, or just notes) [group] +- package1, package2 (AUR), package3 (cool one) [grp1] + +--- +## Arch Installation +### Linux Kernel & Firmware +- `linux` or `linux-lts` +- linux-firmware +- linux-headers (optional) + +### Core Packages +- base, base-devel +- grub, efibootmgr, os-prober +- sudo +- man-db (for manuals and `man` command) +- intel-ucode (or amd-ucode) + +### Wireless Internet Connection +- wpa\_supplicant +- dhcpcd +> If intended to use GNOME DE, install `NetworkManager` alone is good enough. It uses `wpa_supplicant` and `dhcp_client` under the hood. + +### Text editors +- nano +- vi +- vim +- neovim + +### Tools & Drivers +- git +- curl, wget +- `yay` or `yay-bin` (requires `base-devel` above) +```sh +git clone https://aur.archlinux.org/yay +cd yay +makepkg -si +``` +- neofetch +- ntfs-3g (to use NTFS drive) +- nvidia, nvidia-utils +- [xorg], wayland +--- +## User Interface (post-installation) +### Fonts & Visual +- ttf-firacode-nerd, ttf-fira-code (there is also woff2 version) +- noto-fonts-cjk, noto-fonts-emoji, noto-fonts-extra +- tree +- picom (transparency in X11) +- feh (view picture + set background) +### Shell-related +- zsh, fish +- alacritty +- gnome-console (`kgx`), or gnome-terminal +- tmux +- bashtop, htop, gotop (AUR) +- oh-my-bash-git (AUR), oh-my-zsh-git (AUR) +- bash-completion, zsh-completions +- zsh-autosuggestions (AUR, git), zsh-syntax-highlighting (AUR, git) +- picom (for transparency of Alacritty and X11 transition) +- lf, ranger (file manager) +- xdotool (commandline automation | rofimoji insertion mode) + +### Window Manager (WM) +* xorg-xinit (to aquire `startx`) +* i3 experience (See i3Configuration.md for more): + - i3-wm [i3] + - i3blocks [i3] + - i3lock [i3] + - i3status [i3] + - dmenu | rofi (dynamic menu) + + +* Dual Monitors: + - xrandr + - arandr + + +### Utilities +- pipewire, wireplumber, pipewire-audio, pipewire-v4l2 +- jack2 (for `obs-studio`), helvum (wiring devices), jack2-dbus & a2jmidid ([Using MIDI devices](https://wiki.archlinux.org/title/JACK_Audio_Connection_Kit#Using_MIDI_devices), see ArchWiki for more) +- bluez, bluez-utils (for `bluetoothctl`) +- blueberry (managing bluetooth devices) +- gnome-keyring (keychain), seahorse (managing keys like GPG) +- touchegg (AUR, touchpad gesture for X11), touche (AUR, GUI for touchegg) +- ibus (multi-lang), ibus-bamboo (AUR, Vietnamese ibus interface [ibus-bamboo GitHub](https://github.com/BambooEngine/ibus-bamboo#arch-linux-v%C3%A0-c%C3%A1c-distro-t%C6%B0%C6%A1ng-t%E1%BB%B1)) +- jq, hq, yq: parsing JSON, HTML, YAML, respectively +- android-udev: connecting Android device to linux + +### Desktop Environment +* GNOME experience: + - [gnome] (select what you want/need) + - [gnome-extra] + - gdm, gdm-settings (AUR) +* KDE Plasma experience: [plasma] [kde-applications] [kde-utilities] + +### SDK +- jdk-openjdk +- android-tools +- base-devel, gcc, cmake, clang, ... + +### System Controllers +- pactl (PulseAudio controller), amixer (ALSA controller) +- brightnessctl (brightness controller) +- playerctl (Media Player Controller) +- zsa-udev (for ZSA Moonlander Keyboards) + +### Everyday apps +* Coding: (open-source version does not have profile sync) + - visual-studio-code-bin (AUR) + - code, code-marketplace (AUR) + - vscodium (AUR), vscodium-marketplace (AUR) +* Communication + - zoom (AUR) + - slack-desktop (AUR) + - discord +* Office Suite, Art & Music + - onlyoffice-bin (AUR) + - musescore [pro-audio], muse-hub-bin (AUR but it's broken there. I suggest download `.deb` and unpack using `ar x` and install using `tar` instead) + - yoshimi [pro-audio lv2-plugins] + - spotify (AUR) + - obs-studio + - vlc +* Entertainment (Games) + - minecraft-launcher (AUR) +* Quality of life + - nautilus [gnome] + sushi [gnome] + - power-profiles-daemon (Managing power profiles) + +--- +### Fun ones +- lolcat +- cowsay +- cmatrix, tmatrix (AUR) +- hollywood (AUR) +- obsidian (Markdown Text Editor) diff --git a/notkaramel-guide-to-linux/linux/NetworkConfiguration.md b/notkaramel-guide-to-linux/linux/NetworkConfiguration.md new file mode 100644 index 0000000..9858d14 --- /dev/null +++ b/notkaramel-guide-to-linux/linux/NetworkConfiguration.md @@ -0,0 +1,3 @@ +# Network Configuration + + diff --git a/notkaramel-guide-to-linux/linux/README.md b/notkaramel-guide-to-linux/linux/README.md new file mode 100644 index 0000000..89e2fe4 --- /dev/null +++ b/notkaramel-guide-to-linux/linux/README.md @@ -0,0 +1,12 @@ +# Linux configuration +--- +## Motivation +Every now and then, I encounter a literally breaking bug(s), or just impulsive thought that I want to reinstall and start fresh. + +Starting off with my own version of Arch Installation Docs was nice, since I have done that so many times. There was also the dual-boot version. Both were in `.docx` file and stored on OneDrive, but since GitHub allows more coder-friendly interface, I decided to migrate everything to a repo. What's better than my own GitHub front page repo, since Linux is now a part of my personality (I'm the nice one, trust me). + +## Chapters +1. [Arch Installation](./ArchInstallation.md) +2. [List of Essential Packages](./CorePackages.md) +3. [Network Configuration](./NetworkConfiguration.md) +4. [i3 Configuration](./i3Configuration.md) diff --git a/notkaramel-guide-to-linux/linux/SwayConfiguration.md b/notkaramel-guide-to-linux/linux/SwayConfiguration.md new file mode 100644 index 0000000..9283cc8 --- /dev/null +++ b/notkaramel-guide-to-linux/linux/SwayConfiguration.md @@ -0,0 +1,22 @@ +# Sway configuration + +Similar to the i3 experience, sway can simply use the config of i3, with tweaks all around to make things work smoothly with Wayland + +## Documentation: +- `man 5 sway` +- https://wiki.archlinux.org/title/wayland +- https://github.com/swaywm/sway/wiki/i3-Migration-Guide +- https://wiki.archlinux.org/title/sway +- https://github.com/swaywm/sway/wiki + +## Major configuration +### Utilities +- wl-clipboard: wayland clipboard +- mako: notification daemon +- kanshi: autorandr alt +- wdisplays (AUR): arandr alt +- wtype: xdotool alt +- wlrctl: support wlroots extensions +- ydotool: command-line automation tool (similar to wlrctl) +- wayvnc: remote desktop that works with VNC backend and wlroots + diff --git a/notkaramel-guide-to-linux/linux/i3Configuration.md b/notkaramel-guide-to-linux/linux/i3Configuration.md new file mode 100644 index 0000000..b378bbf --- /dev/null +++ b/notkaramel-guide-to-linux/linux/i3Configuration.md @@ -0,0 +1,216 @@ +# `i3` Configuration and Everything + +Pain, but worth it :) +Movinya was here :)) + +--- +## 0. List of config files (relative to `$HOME`) +- General `i3 configuration file: `.config/i3/config` +- Programs configs: (relative to user's `$HOME`) +```sh +alacritty # .alacritty.yml +bash # .bashrc +zsh # .zshrc +fish # .config/fish/config +tmux # .tmux.conf +neofetch # .config +ssh # .ssh/config +``` +- Visual themes (folders, rather than config file): +```sh +icons # .icons/ +themes # .themes/ +oh-my-bash # .oh-my-bash/ +oh-my-zsh # .oh-my-zsh/ +``` +> NOTE: `.icons/` is also home to themes and cursor themes (default by `lxappearence` too!) + +## Natural Scrolling +The default config file for libinput is at `/usr/share/X11/xorg.conf.d/40-libinput.conf`. Copy it to `/etc/X11/xorg.conf.d` then edit it your preferred text editor (with `sudo`) + +``` +nvim /etc/X11/xorg.conf.d/40-libinput.conf +... +Section "InputClass" + Identifier "libinput touchpad catchall" + ... + Option "NaturalScrolling" "on" # add this +EndSection +... +``` + +## Network Configuration (wpa\_supplicant & dhcpcd) +- NOTE: recommend using NetworkManager for out-of-the-box experience, but using wpa\_supplicant and dhcpcd directly give better control over network management +- Configuration locations: + - System-wide: `/etc/wpa_supplicant/wpa_supplicant.conf` + - User-specific: `$HOME/.config/wpa_supplicant.conf` + - Example: `/usr/share/wpa_supplicant/wpa_supplicant.conf` +- `wpa_supplicant.conf` configuration: +```yml +nvim ~/.config/wpa_supplicant.conf +--- +# for normal wifi +# Can as well do `wpa_passpharse > ~/.config/wpa_supplicant.conf` to generate the psk +network={ + ssid= + psk= +} + +# for education wifi +network={ + ssid="SSID" + key_mgmt=WPA-EAP + EAP=PEAP + phase2="auth=MSCHAPV2" + identity="USERNAME" + password="PASSWORD" +} +``` +- To activate wpa_supplicant: +```sh +sudo wpa_supplicant -B -i wlan0 -D nl80211 -c ~/.config/wpa_supplicant.conf +``` +> Note: the interface (`-i` flag) could be something else, e.g. wlo1. You can check it using the following command: +```sh +ip addr +``` + +- Make sure the interface is up/unblock, using: +```sh +ifstat wlo1 # to check +ip link set wlo1 up # to unblock interfce +``` + +- Set wpa_supplicant to run at boot (systemd): + - Create a service file at `/etc/systemd/system/wpa_supplicant@.service`: +```sh +# create file +touch /etc/wpa_supplicant/wpa_supplicant-wlo1.conf +# copy content +cat /home/USER/.config/wpa_supplicant.conf > /etc/wpa_supplicant/wpa_supplicant-wlo1.conf +# enable the service +systemctl enable wpa_supplicant@wlo1 +``` +> Note: I expected to enable `dhcpcd@wlo1` as well but it seems to be working without it. + +## Bluetooth Configuration +- Using `bluetoothctl`, from `bluez-utils` package. Recommend using `blueberry` as the GUI interface. + +## Multiple Displays +- hmm + +## Clipboard manager +- + + +--- +## THE CONFIG FILE: `.config/i3/config` + +### 1. Media Player: `playerctl` +``` +bindsym XF86AudioPlay exec playerctl play-pause +bindsym XF86AudioNext exec playerctl next +bindsym XF86AudioPrev exec playerctl previous +``` + +### 2. Brightness Controller: `brightnessctl` +``` +# Increase/Decrease screen brightness +bindsym XF86MonBrightUp exec brightnessctl set 10%+ +bindsym XF86MonBrightDown exec brightnessctl set 10%- +``` + +### 3. Volume Controller: `pactl` of PulseAudio +``` +bindsym XF86AudioRaiseVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ +10% && $refresh_i3status + +bindsym XF86AudioLowerVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ -10% && $refresh_i3status + +bindsym XF86AudioMute exec --no-startup-id pactl set-sink-mute @DEFAULT_SINK@ toggle && $refresh_i3status +``` + +### 4. Transparency in X11 +``` +exec --no-startup-id picom --shadow --inactive-opacity=0.9 --shadow-radius=60 --shadow-opacity=0.2 --fade-in-step=0.8 & +``` + +### 5. Wallpaper +``` +exec --no-startup-id feh --bg-scale --randomize $HOME/.wallpaper/* +``` + +### 6. Lock Screen +``` +bindsym $mod+l exec i3lock -c 9a4000 -p win -e +``` + +### 7. Gaps & Coloring +``` + +# --- Coloring --- +# class border backgr. text indicator child_border +client.focused #4c7899 #067A67 #ffffff #2e9ef4 #285577 +client.focused_inactive #333333 #161C1A #ffffff #484e50 #5f676a +client.unfocused #333333 #222222 #888888 #292d2e #222222 +client.urgent #2f343a #900000 #ffffff #900000 #900000 +client.placeholder #000000 #0c0c0c #ffffff #000000 #0c0c0c + +client.background #ffffff + +# --- Gaps --- +# `inner` is like padding in CSS +# gaps inner [px] +gaps inner 8 + +# `outer` is like margin in CSS +# gaps outer|horizontal|vertical|top|left|bottom|right [px] + +# smart_gaps on|off|inverse_outer +smart_gaps inverse_outer +``` + +### 8. i3bar & i3status +- `.i3/config` +``` +# --- i3bar --- +bar { + status_command i3status + i3bar_command i3bar --transparency + position top + font pango:Fira Code Bold 11 + separator_symbol ":|:" + + colors { + background #013714b0 + statusline #ffffff + separator #6666660a + + focused_workspace #4c7899 #285577 #ffffff + active_workspace #333333 #5f676a #ffffff + inactive_workspace #333333 #222222 #888888 + urgent_workspace #2f343a #900000 #ffffff + binding_mode #2f343a #900000 #ffffff + } +} +``` +- `.i3status.conf` +``` +# --- i3status --- +``` + +### 9. Dynamic Menu: rofi +``` +bindcode $mod+40 exec "rofi -show drun" +``` +Inside `.config/rofi/config.rasi`: +``` +configuration { + modi: "drun,ssh,emoji:rofimoji,window"; + combi-modi: "drun,ssh,emoji:rofimoji"; +} +@theme "glue_pro_blue" + +``` + +### Auto-tiling +- Install `autotiling` (AUR) diff --git a/notkaramel-guide-to-linux/linux/linux.md b/notkaramel-guide-to-linux/linux/linux.md new file mode 100644 index 0000000..eb653f1 --- /dev/null +++ b/notkaramel-guide-to-linux/linux/linux.md @@ -0,0 +1,2 @@ +Everything about my Linux +--- diff --git a/notkaramel-guide-to-linux/notkaramel.github.io.md b/notkaramel-guide-to-linux/notkaramel.github.io.md new file mode 100644 index 0000000..1bff467 --- /dev/null +++ b/notkaramel-guide-to-linux/notkaramel.github.io.md @@ -0,0 +1 @@ +Everything about [`notkaramel.github.io`](https://notkaramel.github.io/) \ No newline at end of file diff --git a/notkaramel-guide-to-linux/notkaramel.md b/notkaramel-guide-to-linux/notkaramel.md new file mode 100644 index 0000000..3dfa166 --- /dev/null +++ b/notkaramel-guide-to-linux/notkaramel.md @@ -0,0 +1 @@ +Weird stuffs to show on GitHub profile \ No newline at end of file