$ sudo dnf intall awscli
-
-
Save louiscklaw/e62f665b929b298d4a70f2e6a5b0d2a3 to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash | |
set -ex | |
git add . | |
git commit -m'update,' | |
git push |
# 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
β ~
$ sudo grubby --info=ALL
$ sudo grubby --default-index
$ sudo grubby --set-default 1
# file: /etc/dnf/dnf.conf
installonly_limit=3 -> 8
$ 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
$ sudo dnf install yt-dlp
$ yt-dlp https://www.youtube.com/watch?v=HylKpDmwaFA
$ git config --global user.email "[email protected]"
$ git config --global user.name "Louis Law"
$ git config pull.rebase true
I'm writing this here because a few things in here are spesific to this model laptop.
Dell XPS 15 9560 (4k) touch screen
$ 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
$ git config --global user.name "louiscklaw"
$ git config --global user.email "[email protected]"
$ git config --global credential.helper cache
$ git config --global credential.helper 'cache --timeout=43200'
refer to nvidia
$ sudo dnf install https://mirrors.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm
$ sudo dnf install watchdog
$ sudo systemctl start watchdog
$ sudo systemctl enable watchdog
$ 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
# 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
# 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
$ 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
no need to install tlp powertop should be handled by gnome.
Most things after setup are not specific for this laptop
#
= run as root
$
= run as normal user (you)
When grub shows up press e
Add the following to the boot parameter nouveau.modeset=0
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
This is more of a personl preferment because fedora uses usually an onder kernel.
sudo dnf install kernel --enablerepo=updates-testing --best --allowerasing
$ 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
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
$ 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
$ 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
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
sudo dnf install https://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm
sudo dnf update
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.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
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:
- Install NVIDIA proprietary drivers. Don't forget to install cuda/nvdec/nvenc support.
- After installing ffmpeg-free, install libavcodec-freeworld from RPM Fusion repository for H.264 decoding.
sudo dnf install ffmpeg-free libavcodec-freeworld
- 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
- 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.
- 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.
Configure VA-API Video decoding on NVIDIA
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 |
+---------------------------------------------------------------------------------------+
β ~
$ 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
https://fedoramagazine.org/how-to-setup-an-anonymous-ftp-download-server/
https://twitch-dl.bezdomni.net/installation.html
$ sudo dnf install pipx
$ pipx install twitch-dl