Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save louiscklaw/e62f665b929b298d4a70f2e6a5b0d2a3 to your computer and use it in GitHub Desktop.
Save louiscklaw/e62f665b929b298d4a70f2e6a5b0d2a3 to your computer and use it in GitHub Desktop.

install

$ sudo dnf intall awscli

disable se-linux

# change to SELINUX=disabled
$ sudo -e /etc/selinux/config

# check SELinux enabled ?
$ getenforce
#!/usr/bin/env bash
set -ex
git add .
git commit -m'update,'
git push

install

# https://fedoraproject.org/wiki/Firefox_Hardware_acceleration#Configure_VA-API_Video_decoding_on_Intel

sudo dnf install -y intel-media-driver



# In a terminal, run vainfo to verify that VA-API works. 
# If VA-API is disabled you're probably running on new hardware and 
# you need intel-media-driver from RPM Fusion repository non-free. 
# When running the newer driver, 
# you may need to specify the "iHD" driver when running the vainfo command, 
# like so: LIBVA_DRIVER_NAME=iHD vainfo

```bash
/home/logic/.config/environment.d/61-intel-gpu.conf

# add line
LIBVA_DRIVER_NAME=iHD

sudo dnf install -y igt-gpu-tools



```bash
โžœ  ~ vainfo
Trying display: wayland
libva info: VA-API version 1.18.0
libva info: User environment variable requested driver 'iHD'
libva info: Trying to open /usr/lib64/dri/iHD_drv_video.so
libva info: Found init function __vaDriverInit_1_18
libva info: va_openDriver() returns 0
vainfo: VA-API version: 1.18 (libva 2.18.2)
vainfo: Driver version: Intel iHD driver for Intel(R) Gen Graphics - 23.1.6 ()
vainfo: Supported profile and entrypoints
      VAProfileNone                   :	VAEntrypointVideoProc
      VAProfileNone                   :	VAEntrypointStats
      VAProfileMPEG2Simple            :	VAEntrypointVLD
      VAProfileMPEG2Simple            :	VAEntrypointEncSlice
      VAProfileMPEG2Main              :	VAEntrypointVLD
      VAProfileMPEG2Main              :	VAEntrypointEncSlice
      VAProfileH264Main               :	VAEntrypointVLD
      VAProfileH264Main               :	VAEntrypointEncSlice
      VAProfileH264Main               :	VAEntrypointFEI
      VAProfileH264Main               :	VAEntrypointEncSliceLP
      VAProfileH264High               :	VAEntrypointVLD
      VAProfileH264High               :	VAEntrypointEncSlice
      VAProfileH264High               :	VAEntrypointFEI
      VAProfileH264High               :	VAEntrypointEncSliceLP
      VAProfileVC1Simple              :	VAEntrypointVLD
      VAProfileVC1Main                :	VAEntrypointVLD
      VAProfileVC1Advanced            :	VAEntrypointVLD
      VAProfileJPEGBaseline           :	VAEntrypointVLD
      VAProfileJPEGBaseline           :	VAEntrypointEncPicture
      VAProfileH264ConstrainedBaseline:	VAEntrypointVLD
      VAProfileH264ConstrainedBaseline:	VAEntrypointEncSlice
      VAProfileH264ConstrainedBaseline:	VAEntrypointFEI
      VAProfileH264ConstrainedBaseline:	VAEntrypointEncSliceLP
      VAProfileVP8Version0_3          :	VAEntrypointVLD
      VAProfileVP8Version0_3          :	VAEntrypointEncSlice
      VAProfileHEVCMain               :	VAEntrypointVLD
      VAProfileHEVCMain               :	VAEntrypointEncSlice
      VAProfileHEVCMain               :	VAEntrypointFEI
      VAProfileHEVCMain10             :	VAEntrypointVLD
      VAProfileHEVCMain10             :	VAEntrypointEncSlice
      VAProfileVP9Profile0            :	VAEntrypointVLD
      VAProfileVP9Profile2            :	VAEntrypointVLD
โžœ  ~

LAST UPDATE FEDORA 38 (2023-06-25)

grubby change default kernel

$ sudo grubby --info=ALL

$ sudo grubby --default-index

$ sudo grubby --set-default 1

increase retain kernel number

# file: /etc/dnf/dnf.conf
installonly_limit=3 -> 8

disable error reporting

$ sudo systemctl -t service | grep abrt

$ sudo systemctl stop abrt-journal-core.service 
$ sudo systemctl disable  abrt-journal-core.service

$ sudo systemctl stop abrt-oops.service
$ sudo systemctl disable abrt-oops.service

$ sudo systemctl stop abrt-xorg.service
$ sudo systemctl disable abrt-xorg.service

$ sudo systemctl stop abrtd.service
$ sudo systemctl disable abrtd.service

yt-dlp

$ sudo dnf install yt-dlp
$ yt-dlp https://www.youtube.com/watch?v=HylKpDmwaFA

setup git

$ git config --global user.email "louiscklaw@users.noreply.github.com"
$ git config --global user.name "Louis Law"

$ git config pull.rebase true

My laptop:

I'm writing this here because a few things in here are spesific to this model laptop.
Dell XPS 15 9560 (4k) touch screen

VScode:

$ sudo rpm --import https://packages.microsoft.com/keys/microsoft.asc
$ sudo sh -c 'echo -e "[code]\nname=Visual Studio Code\nbaseurl=https://packages.microsoft.com/yumrepos/vscode\nenabled=1\ngpgcheck=1\ngpgkey=https://packages.microsoft.com/keys/microsoft.asc" > /etc/yum.repos.d/vscode.repo'
$ sudo dnf check-update
$ sudo dnf install -y code
$ echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p
$ sudo dnf install -y powerline-fonts

The programs i need for programming

Git

$ git config --global user.name "louiscklaw"
$ git config --global user.email "louiscklaw@users.noreply.github.com"
$ git config --global credential.helper cache
$ git config --global credential.helper 'cache --timeout=43200'

install GPU driver

NVIDIA

refer to nvidia

INTEL

enable rpmfusion

$ sudo dnf install https://mirrors.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm

Install watchdog to fix a job is running for...

$ sudo dnf install watchdog
$ sudo systemctl start watchdog
$ sudo systemctl enable watchdog

Node/Nodejs:

$ sudo dnf module install -y nodejs:16/common
$ sudo dnf module list nodejs
$ sudo dnf module enable -y nodejs:16

# dnf module install nodejs:16/common
$ sudo dnf install -y nodejs

# install yarn
$ npm install --global yarn

# install pnpm
$ npm install -g pnpm

Other programs:

# install android studio
set -x
rm -rf /tmp/install_android
rm -rf /opt/android-studio

sudo dnf install -y aria2

set -ex

sudo dnf install -y java-11-openjdk-devel

sudo mkdir -p /tmp/install_android
sudo chmod 777 -R /tmp/install_android

pushd /tmp/install_android
  aria2c -x 16 -s 99999 --dht-listen-port=51000-51099 https://redirector.gvt1.com/edgedl/android/studio/ide-zips/2022.1.1.19/android-studio-2022.1.1.19-linux.tar.gz
  tar -xvzf android-studio-*-linux.tar.gz

  sudo mv android-studio /opt/
  sudo chmod +x /opt/android-studio/bin/studio.sh

popd

/opt/android-studio/bin/studio.sh
$ sudo dnf install -y blender
$ sudo dnf install -y prusa-slicer
$ sudo dnf install -y ibus-cangjie-engine-cangjie
# install docker
$ sudo dnf remove -y docker \
    docker-client \
    docker-client-latest \
    docker-common \
    docker-latest \
    docker-latest-logrotate \
    docker-logrotate \
    docker-selinux \
    docker-engine-selinux \
    docker-engine
$ sudo dnf -y install dnf-plugins-core
$ sudo dnf config-manager \
    --add-repo \
    https://download.docker.com/linux/fedora/docker-ce.repo
$ sudo dnf install -y docker-ce \
  docker-ce-cli \
  containerd.io \
  docker-buildx-plugin \
  docker-compose-plugin
$ sudo systemctl start docker
$ sudo docker run hello-world

# add louis to docker group
$ sudo su
$ vi /etc/group

# modify this line
...
docker:x:974:logic
...
# enable remote address 2375
# https://docs.docker.com/config/daemon/remote-access/

# sudo netstat -lntp | grep dockerd

https://www.ibm.com/docs/en/addi/6.1.0?topic=prerequisites-configuring-docker-engine-listen-tcp-socket

# at docker host, 
# sudo systemctl edit docker.service
# Add or modify the following lines
[Service]
ExecStart=
ExecStart=/usr/bin/dockerd -H fd:// -H tcp://0.0.0.0:2376

registry.iamon99.com

{
  "builder": {
    "gc": {
      "defaultKeepStorage": "20GB",
      "enabled": true
    }
  },
  "experimental": false,
  "features": {
    "buildkit": true
  },
  "insecure-registries":["192.168.10.61:5000", "registry.iamon99.com"]
}
# after add 

$ sudo systemctl daemon-reload

$ sudo systemctl restart docker.service

$ sudo netstat -lntp | grep dockerd
```bash
# microsoft edge
$ sudo rpm --import https://packages.microsoft.com/keys/microsoft.asc
$ sudo dnf config-manager --add-repo https://packages.microsoft.com/yumrepos/edge
$ sudo dnf install -y microsoft-edge-stable
$ sudo dnf install -y fedora-workstation-repositories
$ sudo dnf config-manager --set-enabled google-chrome
$ sudo dnf install -y google-chrome-stable

$ sudo dnf install -y ffmpeg-free vlc tilix
$ sudo dnf install -y neofetch
$ sudo dnf install -y util-linux-user
$ sudo dnf install -y zsh zsh-autosuggestions zsh-syntax-highlighting
$ sudo dnf install -y git curl wget watchdog
$ sudo dnf install -y httpie tree aria2
$ sudo dnf install -y entr filezilla vlc mpv gnome-mpv  traceroute
$ sudo dnf install -y neofetch flameshot rsync tmate
$ sudo dnf install -y meld
$ sudo dnf install -y zip unzip
$ sudo dnf install kicad kicad-packages3d kicad-doc

setup tmux

$ sudo dnf install -y tmux

# install oh-my-tmux
$ cd
$ git clone https://github.com/gpakosz/.tmux.git
$ ln -s -f .tmux/.tmux.conf
$ cp .tmux/.tmux.conf.local .
# set host name
sudo hostnamectl set-hostname "fedora-notebook"
# gnome extensions
sudo dnf install -y \
  gnome-shell-extension-common.noarch \
  gnome-shell-extension-caffeine.noarch \
  gnome-shell-extension-gsconnect \
  gnome-shell-extension-user-theme.noarch

power efficient

no need to install tlp powertop should be handled by gnome.

Some notes:

Most things after setup are not specific for this laptop
# = run as root
$ = run as normal user (you)

Parking:

Install and On first boot

When grub shows up press e
Add the following to the boot parameter nouveau.modeset=0

When installed and first booted up(abonded, should be supportd after install without this step)

NOTE: Make sure to add the boot parameter to the first bootup

$ sudo su
# passwd
# dnf update
# dnf install nano -y
# nano /etc/default/grub

Add the following ot the GRUB_CMDLINE_LINUX parameter nouveau.modeset=0

# grub2-mkconfig -o /boot/efi/EFI/fedora/grub.cfg
# shutdown 0 -rf

If the laptop makes it to the desktop it works

Install latest kernel(not using)

This is more of a personl preferment because fedora uses usually an onder kernel.

sudo dnf install kernel --enablerepo=updates-testing --best --allowerasing

UPDATE SWAP CONFIGURATION / PRESSURE

$ sudo vi /etc/sysctl.d/99-sysctl.conf

# add these two lines
# vm.swappiness=10
# vm.vfs_cache_pressure=50

# reload changes to take effect
# sudo systemctl restart systemd-sysctl.service

install virtualbox

https://docs.fedoraproject.org/en-US/iot/virtual-machine-setup/

$ sudo pip install magic-wormhole
$ sudo dnf -y install @development-tools
$ sudo dnf install kernel-headers kernel-devel dkms -y

$ cat <<EOF | sudo tee /etc/yum.repos.d/virtualbox.repo 
[virtualbox]
name=Fedora $releasever - $basearch - VirtualBox
baseurl=http://download.virtualbox.org/virtualbox/rpm/fedora/36/\$basearch
enabled=1
gpgcheck=1
repo_gpgcheck=1
gpgkey=https://www.virtualbox.org/download/oracle_vbox.asc
EOF

$ sudo dnf search virtualbox

$ sudo dnf install VirtualBox-7.0

$ virtualbox

PREPARE ISO

$ wget https://mirror.xtom.com.hk/fedora/releases/36/Workstation/x86_64/iso/Fedora-Workstation-Live-x86_64-36-1.5.iso
# wget https://mirror.xtom.com.hk/fedora/releases/37/Workstation/x86_64/iso/Fedora-Workstation-Live-x86_64-37-1.7.iso
# wget https://mirror.xtom.com.hk/fedora/releases/38/Workstation/x86_64/iso/Fedora-Workstation-Live-x86_64-38-1.6.iso


set -x
sudo umount /dev/sda{1,2,3,4}

set -ex

sudo dd if=./Fedora-Workstation-Live-x86_64-37-1.7.iso of=/dev/sda bs=128M status=progress

Relevant dell xps laptop links and thanks to

enable nvidia in docker container

$ sudo dnf config-manager --add-repo https://download.docker.com/linux/fedora/docker-ce.repo
$ sudo dnf install docker-ce docker-ce-cli containerd.io docker-compose-plugin

# install container toolkit
$ curl -s -L https://nvidia.github.io/libnvidia-container/centos8/libnvidia-container.repo | sudo tee /etc/yum.repos.d/nvidia-container-toolkit.repo
$ sudo dnf install nvidia-docker2
# Edit /etc/nvidia-container-runtime/config.toml
$ sudo vi /etc/nvidia-container-runtime/config.toml

# modify
no-cgroups = true

# reboot machine, restart docker daemon

# test container
$ docker run --privileged --gpus all nvidia/cuda:11.0.3-base-ubuntu20.04 nvidia-smi

References

https://jchuynh.medium.com/how-to-install-nvidia-docker-on-fedora-36-cc8516dcb4af

Kernel parameters

This library requires that the nvidia_drm kernel module is configured with the parameter nvidia-drm.modeset=1

modify

media.ffmpeg.vaapi.enabled true

Required, enables the use of VA-API. media.rdd-ffmpeg.enabled true

Required, default on FF97. Forces ffmpeg usage into the RDD process, rather than the content process. media.av1.enabled false Optional, disables AV1. If your GPU doesn't support AV1, this will prevent sites using it and falling back to software decoding. gfx.x11-egl.force-enabled true

Required, this driver requires that Firefox use the EGL backend. It may be enabled by default. It is recommended to test it with the MOZ_X11_EGL=1 environment variable before enabling it in the Firefox configuration. widget.dmabuf.force-enabled true

Required on NVIDIA 470 series drivers, and currently REQUIRED on 500+ drivers due to a Firefox change. Note that Firefox isn't coded to allow DMA-BUF support without GBM support, so it may not function completely correctly when it's forced on.

environment variables

MOZ_DISABLE_RDD_SANDBOX 1

Disables the sandbox for the RDD process that the decoder runs in.

EGL_PLATFORM wayland

Required on FF98+ when running on Wayland, due to a regression that has been introduced.

LIBVA_DRIVER_NAME nvidia

For libva versions prior to 2.15, this forces libva to load the nvidia backend.

__EGL_VENDOR_LIBRARY_FILENAMES /usr/share/glvnd/egl_vendor.d/10_nvidia.json

Required for the 470 driver series only. It overrides the list of drivers the glvnd library can use to prevent Firefox from using the MESA driver by mistake.

#!/usr/bin/env bash

set -x

sudo dnf update -y # and reboot if you are not on the latest kernel
sudo dnf install -y akmod-nvidia # rhel/centos users can use kmod-nvidia instead
sudo dnf install -y xorg-x11-drv-nvidia-cuda #optional for cuda/nvdec/nvenc 

sudo dnf clean all

to enable nvidia graphics card under fedora 38

install RPM-nonfree

sudo dnf install https://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm
sudo dnf update

๐Ÿ”— Video decoding

Hardware accelerated video decoding (for video playback or for WebRTC) is available via VA-API for both X11 and Wayland. Since firefox-101.0.1-4 package it's enabled by default for Intel/AMD users.

You can check VA-API acceleration state at about:support page, look at HARDWARE_VIDEO_DECODING row. If there's available by default, you're running on hardware by default.

You may install enhanced-h264ify Firefox extension to disable non-accelerated video formats.

install driver(RPM-nonfree)

./install.sh

sudo dnf update -y # and reboot if you are not on the latest kernel
sudo dnf install akmod-nvidia # rhel/centos users can use kmod-nvidia instead
sudo dnf install xorg-x11-drv-nvidia-cuda #optional for cuda/nvdec/nvenc support

๐Ÿ”— Configure VA-API Video decoding on NVIDIA

Accelerated video decoding works on NVIDIA proprietary drivers thanks to Stephen "elFarto" and his nvidia-vaapi-driver project. It's VA-API implemention using > NVIDIA's NVDEC decoder.

You can enable VA-API on NVIDIA / Fedora 37 by these steps:

  1. Install NVIDIA proprietary drivers. Don't forget to install cuda/nvdec/nvenc support.
  2. After installing ffmpeg-free, install libavcodec-freeworld from RPM Fusion repository for H.264 decoding. sudo dnf install ffmpeg-free libavcodec-freeworld
  3. Install nvidia-vaapi-driver from RPM Fusion repository non-free. Don't use Fedora provided libva-vdpau-driver package as it's old and broken. sudo dnf install -y nvidia-vaapi-driver
  4. Run Firefox and force enable VA-API as it's disabled on NVIDIA by default. Go to about:config page and set media.ffmpeg.vaapi.enabled to true.
  5. Run Firefox with NVD_BACKEND=direct MOZ_DISABLE_RDD_SANDBOX=1 env variables.
vi ~/.config/environment.d/60-gpu.conf

# add lines
NVD_BACKEND=direct
MOZ_DISABLE_RDD_SANDBOX=1

Web page rendering on Wayland, Hardware acceleration should work out-of-the-box on Wayland.

enable in firefox

Configure VA-API Video decoding on NVIDIA

chrome supported ?

VDPAU/VAAPI

https://rpmfusion.org/Howto/NVIDIA

  • -> look into VDPAU/VAAPI
โžœ  ~ nvidia-smi
Fri Jun 23 14:14:36 2023
+---------------------------------------------------------------------------------------+
| NVIDIA-SMI 530.41.03              Driver Version: 530.41.03    CUDA Version: 12.1     |
|-----------------------------------------+----------------------+----------------------+
| GPU  Name                  Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf            Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|                                         |                      |               MIG M. |
|=========================================+======================+======================|
|   0  NVIDIA GeForce GTX 1050         Off| 00000000:01:00.0 Off |                  N/A |
| N/A   49C    P8               N/A /  N/A|      1MiB /  4096MiB |      0%      Default |
|                                         |                      |                  N/A |
+-----------------------------------------+----------------------+----------------------+

+---------------------------------------------------------------------------------------+
| Processes:                                                                            |
|  GPU   GI   CI        PID   Type   Process name                            GPU Memory |
|        ID   ID                                                             Usage      |
|=======================================================================================|
|    0   N/A  N/A      2015      G   /usr/bin/gnome-shell                          1MiB |
+---------------------------------------------------------------------------------------+
โžœ  ~

Steps :

$ sudo dnf install vsftpd
$ sudo systemctl enable vsftpd

# edit /etc/vsftpd/vsftpd.conf
$ sudo -e /etc/vsftpd/vsftpd.conf
# modify this line
anonymous_enable=YES

# check this line
local_enable=NO
write_enable=NO
no_anon_password=YES

# i disabled the SELinux and firewall at the moment
$ sudo systemctl start vsftpd

Reference:

https://fedoramagazine.org/how-to-setup-an-anonymous-ftp-download-server/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment