Skip to content

Instantly share code, notes, and snippets.

@khiemdoan
Last active October 17, 2024 13:59
Show Gist options
  • Save khiemdoan/8e476fa5342708b785381033f0bd92cd to your computer and use it in GitHub Desktop.
Save khiemdoan/8e476fa5342708b785381033f0bd92cd to your computer and use it in GitHub Desktop.

Fedora Setup

Update packages

sudo dnf update

Enable linger

loginctl enable-linger
sudo loginctl enable-linger $USER

Enable Extra Packages for Enterprise Linux

sudo dnf install epel-release
# or
sudo dnf install https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm

Add RPM Fusion Repos

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

Firewall

sudo firewall-cmd --set-default-zone=drop
firewall-cmd --zone=public --permanent --add-interface=ens192
firewall-cmd --zone=internal --permanent --add-interface=eth0
sudo firewall-cmd --zone=public --add-rich-rule='rule family="ipv4" source address="0.0.0.0/0" reject'
sudo firewall-cmd --zone=public --add-rich-rule='rule family="ipv6" source address="::/0" reject'
sudo firewall-cmd --zone=public --add-rich-rule='rule family="ipv4" destination address="0.0.0.0/0" accept'
sudo firewall-cmd --zone=public --add-rich-rule='rule family="ipv6" destination address="::/0" accept'
sudo firewall-cmd --zone=internal --add-service=ssh --permanent
sudo firewall-cmd --zone=internal --add-port=22/tcp --permanent
sudo firewall-cmd --reload
sudo firewall-cmd --list-all
firewall-cmd --get-active-zones

Install Gnome extensions

sudo dnf install gnome-extensions-app

Install snap

sudo dnf install snapd
sudo ln -s /var/lib/snapd/snap /snap

Podman

sudo dnf install podman podman-compose
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 docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
sudo systemctl enable docker
sudo usermod -a -G docker $USER

Add cron: sudo crontab -e

@daily docker system prune --all --force
@reboot docker system prune --all --force

Edit /etc/docker/daemon.json

{
  "log-driver": "json-file",
  "log-opts": {
    "max-size": "10m",
    "max-file": "3"
  }
}

Visual Studio Code

sudo rpm --import https://packages.microsoft.com/keys/microsoft.asc
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" | sudo tee /etc/yum.repos.d/vscode.repo > /dev/null
dnf check-update
sudo dnf install code
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment