From 6919672933fb436d21de35fcaba48a328fe00e6d Mon Sep 17 00:00:00 2001 From: Wen Wei Tseng Date: Mon, 27 Nov 2023 00:23:52 +0800 Subject: [PATCH] close #33 --- docs/linux/setup/environment-variables.md | 2 +- docs/linux/setup/fonts-setup.md | 22 ------- docs/linux/setup/index.md | 34 ++++++++++ docs/linux/setup/linux-local-time.md | 13 ---- docs/linux/setup/ubuntu-3rd-party.md | 77 ----------------------- docs/linux/setup/ubuntu-postinstall.md | 73 ++++++++++++++++++++- docs/linux/tips/copy-file-over-ssh.md | 14 +++-- 7 files changed, 114 insertions(+), 121 deletions(-) delete mode 100644 docs/linux/setup/fonts-setup.md create mode 100644 docs/linux/setup/index.md delete mode 100644 docs/linux/setup/linux-local-time.md delete mode 100644 docs/linux/setup/ubuntu-3rd-party.md diff --git a/docs/linux/setup/environment-variables.md b/docs/linux/setup/environment-variables.md index dc3f5b0..a3c38a1 100644 --- a/docs/linux/setup/environment-variables.md +++ b/docs/linux/setup/environment-variables.md @@ -41,4 +41,4 @@ tags: ## See also -[[windows/environment-variables|Windows environment variables]] +Setup [[windows/environment-variables|Windows environment variables]]. diff --git a/docs/linux/setup/fonts-setup.md b/docs/linux/setup/fonts-setup.md deleted file mode 100644 index d35a330..0000000 --- a/docs/linux/setup/fonts-setup.md +++ /dev/null @@ -1,22 +0,0 @@ ---- -title: Fonts Setup -tags: - - linux - - fonts ---- - -Install custom fonts in Linux systems and make the system recognize it using `fc-cache`. - -## Per user - -Copy your font files to `~/.local/share/fonts/`. Then, run `fc-cache` to rebuild the font cache. -```sh -fc-cache -fv -``` - -## System-wide - -Copy the font files to `/usr/share/fonts/`. Then, run `fc-cache` with admin rights to rebuild the font cache. -```sh -sudo fc-cache -fv /usr/share/fonts/ -``` diff --git a/docs/linux/setup/index.md b/docs/linux/setup/index.md new file mode 100644 index 0000000..dbfbd05 --- /dev/null +++ b/docs/linux/setup/index.md @@ -0,0 +1,34 @@ +--- +title: General Linux Setup +tags: + - linux +--- + ++ [[swap-setup|Setup swap]] ++ [[ubuntu-postinstall|Ubuntu post-install]] + +## Install fonts + +Copy the fonts files to `~/.local/share/fonts/`. Then, run `fc-cache` to rebuild the cache. + +```sh +fc-cache -fv +``` + +## Let Linux use local time + +When dual-booting Linux and Windows, one might want to set the clock to the local time zone in Linux[^localtime] + +```bash +timedatectl set-local-rtc 1 +``` + +[^localtime]: https://itsfoss.com/wrong-time-dual-boot/ + +## NAS setup + +Add the following entry to `/etc/fstab` to automatically mount NAS drives at boot + +```txt title="/etc/fstab" +//NAS_IP/directory /mnt/point cifs credentials=/etc/samba/credentials,uid=1000,gid=1000,_netdev,x-systemd.automount,x-systemd.mount-timeout=10 0 0 +``` diff --git a/docs/linux/setup/linux-local-time.md b/docs/linux/setup/linux-local-time.md deleted file mode 100644 index 7bd7dd4..0000000 --- a/docs/linux/setup/linux-local-time.md +++ /dev/null @@ -1,13 +0,0 @@ ---- -title: Linux local time -tags: - - linux ---- - -When dual-booting Linux and Windows, one might want to set the clock to the local time zone in Linux, which follows universal time (UTC) by default.[^1] - -```bash -timedatectl set-local-rtc 1 -``` - -[^1]: https://itsfoss.com/wrong-time-dual-boot/ diff --git a/docs/linux/setup/ubuntu-3rd-party.md b/docs/linux/setup/ubuntu-3rd-party.md deleted file mode 100644 index 97e0de4..0000000 --- a/docs/linux/setup/ubuntu-3rd-party.md +++ /dev/null @@ -1,77 +0,0 @@ ---- -title: Ubuntu 3rd party repositories -tags: - - linux ---- - -Adding 3rd party repositories for latest packages not available in xUbuntu's official repositories. - -First, install required package - -```bash -sudo apt update && sudo apt install -y apt-transport-https ca-certificates curl git gnupg-agent software-properties-common -``` - -## Kubuntu APP and KDE framework updates - -[Kubuntu backports](https://launchpad.net/~kubuntu-ppa/+archive/ubuntu/backports): Latest versions of KDE framework and APPs - -```bash -sudo add-apt-repository -y ppa:kubuntu-ppa/backports -sudo apt-get update && sudo apt full-upgrade -y -``` - -## Apps - -- [[apt#apt-fast apt but faster|apt-fast]] -- [[brave]] -- [[docker]] -- [[git]] -- [[qbittorrent]] -- [[vivaldi]] -- [[vscode]] - -## Drivers - -### Xanmod Linux kernel - -[Xanmod](https://xanmod.org/) is a general-purpose Linux kernel distribution with custom settings and new features. - -```bash -curl -fsSL https://dl.xanmod.org/gpg.key | sudo gpg --dearmor -o /usr/share/keyrings/xanmod-keyring.gpg -echo 'deb [signed-by=/usr/share/keyrings/xanmod-keyring.gpg] http://deb.xanmod.org releases main' | sudo tee /etc/apt/sources.list.d/xanmod-kernel.list > /dev/null -sudo apt update && sudo apt install -y linux-xanmod -``` - -### Nvidia GPU computing (CUDA) - -> The following section works for Ubuntu 22.04 LTS. - -Install nvidia CUDA runtime and compatible [GPU driver](https://developer.nvidia.com/cuda-downloads). - -```bash -wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/cuda-keyring_1.0-1_all.deb -sudo dpkg -i cuda-keyring_1.0-1_all.deb -sudo apt-get update -sudo apt-get -y install cuda -``` - -To add the CUDA compiler (`nvcc`) to the system `PATH`: - -```sh "title=~/.profile" -export PATH=/usr/local/cuda/bin:$PATH -export LD_LIBRARY_PATH=/usr/local/cuda/lib64:$LD_LIBRARY_PATH -``` - -### AMD and Intel open-source GPU driver (Mesa) - -Install the latest Mesa open source GPU drivers from the [kisak PPA](https://launchpad.net/~kisak/+archive/ubuntu/kisak-mesa) - -```bash -sudo add-apt-repository -y ppa:kisak/kisak-mesa -sudo apt update && sudo apt full-upgrade -y -``` - -## Themes - -Setup [[linux-themes]]. diff --git a/docs/linux/setup/ubuntu-postinstall.md b/docs/linux/setup/ubuntu-postinstall.md index 519eb5f..88fe7ec 100644 --- a/docs/linux/setup/ubuntu-postinstall.md +++ b/docs/linux/setup/ubuntu-postinstall.md @@ -28,7 +28,72 @@ sudo apt clean && sudo apt update && sudo apt full-upgrade -y ## Setup 3rd party repos -[[ubuntu-3rd-party]] +Adding 3rd party repositories for latest packages not available in xUbuntu's official repositories. + +First, install required package + +```bash +sudo apt update && sudo apt install -y apt-transport-https ca-certificates curl git gnupg-agent software-properties-common +``` + +The setup repos for apllications: + +- [[apt#apt-fast apt but faster|apt-fast]] +- [[brave]] +- [[docker]] +- [[git]] +- [[qbittorrent]] +- [[vivaldi]] +- [[vscode]] + +### Kubuntu APP and KDE framework updates + +[Kubuntu backports](https://launchpad.net/~kubuntu-ppa/+archive/ubuntu/backports): Latest versions of KDE framework and APPs + +```bash +sudo add-apt-repository -y ppa:kubuntu-ppa/backports +sudo apt-get update && sudo apt full-upgrade -y +``` + +### Xanmod Linux kernel + +[Xanmod](https://xanmod.org/) is a general-purpose Linux kernel distribution with custom settings and new features. + +```bash +curl -fsSL https://dl.xanmod.org/gpg.key | sudo gpg --dearmor -o /usr/share/keyrings/xanmod-keyring.gpg +echo 'deb [signed-by=/usr/share/keyrings/xanmod-keyring.gpg] http://deb.xanmod.org releases main' | sudo tee /etc/apt/sources.list.d/xanmod-kernel.list > /dev/null +sudo apt update && sudo apt install -y linux-xanmod +``` + +### Nvidia GPU computing (CUDA) + +> The following section works for Ubuntu 22.04 LTS. + +Install nvidia CUDA runtime and compatible [GPU driver](https://developer.nvidia.com/cuda-downloads). + +```bash +wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/cuda-keyring_1.0-1_all.deb +sudo dpkg -i cuda-keyring_1.0-1_all.deb +sudo apt-get update +sudo apt-get -y install cuda +``` + +To add the CUDA compiler (`nvcc`) to the system `PATH`: + +```sh "title=~/.profile" +export PATH=/usr/local/cuda/bin:$PATH +export LD_LIBRARY_PATH=/usr/local/cuda/lib64:$LD_LIBRARY_PATH +``` + +### AMD and Intel open-source GPU driver (Mesa) + +Install the latest Mesa open source GPU drivers from the [kisak PPA](https://launchpad.net/~kisak/+archive/ubuntu/kisak-mesa) + +```bash +sudo add-apt-repository -y ppa:kisak/kisak-mesa +sudo apt update && sudo apt full-upgrade -y +``` + ## (Optional) Wine and 32-bit games support @@ -160,7 +225,7 @@ sed 's/#.*$//' pkgs.txt | xargs sudo apt install -y - Double click to open files instead of single clicks: `Workspace behavior` => `General behavior` => `click behavior`. - Start with an empty session in `Desktop session`. -## Other apps if needed +## Applications - [[miniforge|Conda]] - [[setup-julia|Julia]] @@ -169,3 +234,7 @@ sed 's/#.*$//' pkgs.txt | xargs sudo apt install -y - [Hugo](https://github.com/gohugoio/hugo/releases/) - [Pandoc](https://github.com/jgm/pandoc/releases/) - [Virtualbox](https://www.virtualbox.org/) + +## Themes + +Setup [[linux-themes]]. diff --git a/docs/linux/tips/copy-file-over-ssh.md b/docs/linux/tips/copy-file-over-ssh.md index 3e31372..8990393 100644 --- a/docs/linux/tips/copy-file-over-ssh.md +++ b/docs/linux/tips/copy-file-over-ssh.md @@ -8,7 +8,7 @@ tags: How to copy files through the secure shell (SSH). -## Using scp command +## Using `scp` command `scp` works similar to the regular copy (`cp`) command.[^scp] @@ -18,19 +18,21 @@ How to copy files through the secure shell (SSH). scp [options] username1@source_host:directory1/filename1 username2@destination_host:directory2/filename2 ``` -## Using tar and pipe +## Using tar, pipe, and ssh commands ```sh tar cvf - $localdir | ssh someone@somemachine '(cd destdir && tar xBf -)' ``` -## Secure FTP (SFTP) +## Using `rsync` command -[Filezilla](https://filezilla-project.org/) could access remote servers via the Secure FTP (SFTP) protocol. +```sh +rsync -avh /source/folder/ username@nasip:dest/folder/ +``` -And newer versions of `scp` also use `sftp` by default.[^scpandsftp] +## Secure FTP (SFTP) -[^scpandsftp]: https://wiki.archlinux.org/title/SCP_and_SFTP +[Filezilla](https://filezilla-project.org/) and [WinSCP](https://winscp.net/eng/index.php) can access remote servers via the Secure FTP (SFTP) protocol. ## Mount remote directory as a disk via sshfs