-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 511d11a
Showing
7 changed files
with
987 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# Created by https://www.gitignore.io/api/osx | ||
# Edit at https://www.gitignore.io/?templates=osx | ||
|
||
### OSX ### | ||
# General | ||
.DS_Store | ||
.AppleDouble | ||
.LSOverride | ||
|
||
# Icon must end with two \r | ||
Icon | ||
|
||
# Thumbnails | ||
._* | ||
|
||
# Files that might appear in the root of a volume | ||
.DocumentRevisions-V100 | ||
.fseventsd | ||
.Spotlight-V100 | ||
.TemporaryItems | ||
.Trashes | ||
.VolumeIcon.icns | ||
.com.apple.timemachine.donotpresent | ||
|
||
# Directories potentially created on remote AFP share | ||
.AppleDB | ||
.AppleDesktop | ||
Network Trash Folder | ||
Temporary Items | ||
.apdisk | ||
|
||
# End of https://www.gitignore.io/api/osx |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,213 @@ | ||
# Pumice | ||
![pumice](https://github.com/zearp/pumice/assets/63272687/cff79de2-c50d-454f-ac3e-356605e24398) | ||
|
||
My spin on Rocky Linux. Nothing fancy. Bare bones with only the things I need and want. The aim of this repo is to have my stuff easily available to myself and anyone interested. It is essentially a kickstart file that can be modified to suit your needs and build an iso with. Compared to a normal Rocky Linux dark mode is enabled by default, third party repo's been added and a different (minimal) selection of packages is used. Kickstarts are a great way to customise Rocky Linux. The iso can be installed without an active internet connection. | ||
<details> | ||
<summary>Packages:</summary> | ||
|
||
- GUI Stuff: | ||
- Cockpit, manage stuff (remotely) from your browser | ||
- Eye of Gnome image viewer | ||
- Evince document viewer | ||
- Flatseal to manage Flatpak permissions | ||
- gedit, simple text editor | ||
- Gnome disk utility | ||
- Gnome font vieuwer | ||
- Gnome schreenshot tool | ||
- Gnome software centre | ||
- Gnome system monitor | ||
- Gnome terminal | ||
- Gnome tweaks | ||
- Nautilus file manager | ||
- Plymouth spinner boot theme | ||
- Shell utils: | ||
- bat 🦀 | ||
- btop | ||
- eza 🦀 | ||
- grubby | ||
- htop | ||
- nano | ||
- nvme-cli | ||
- pciutils | ||
- pfetch 🦀 | ||
- usbutils | ||
- ripgrep 🦀 | ||
- rsync | ||
- wget | ||
- zsh | ||
- and many others! | ||
- Extra repo's: | ||
- RPM Fusion | ||
- EPEL | ||
- El Repo | ||
- Flatpaks via the Gnome software centre | ||
|
||
</details> | ||
|
||
#### Contents: | ||
* [Installation](#installation) | ||
* [Post install](#post-install) | ||
* [Updating](#updating) | ||
|
||
### Installation | ||
1. Disable SELinux: | ||
```sh | ||
sudo setenforce 0 | ||
``` | ||
2. Install required packages: | ||
```sh | ||
sudo dnf -y --refresh update && sudo dnf -y install epel-release | ||
sudo dnf -y install --nogpgcheck rpmfusion-free-release \ | ||
https://mirrors.rpmfusion.org/nonfree/el/rpmfusion-nonfree-release-$(rpm -E %rhel).noarch.rpm | ||
sudo dnf -y install mock mock-rpmfusion-free mock-rpmfusion-nonfree | ||
``` | ||
3. Add yourself to the mock group and logout: | ||
```sh | ||
sudo usermod -a -G mock $USER && exit | ||
``` | ||
4. Log back in and create ```/etc/mock/pumice.cfg``` and paste in the following: | ||
```sh | ||
include('rocky+epel-9-x86_64.cfg') | ||
include('templates/rpmfusion_free-epel.tpl') | ||
include('templates/rpmfusion_nonfree-epel.tpl') | ||
config_opts['root'] = "pumice-9-{{ target_arch }}" | ||
config_opts['description'] = 'Pumice 9' | ||
``` | ||
5. Initialise and enter the mock environment: | ||
```sh | ||
mock -r pumice --init --nobest | ||
mock -r pumice --install lorax-lmc-novirt nano pykickstart git | ||
mock -r pumice --shell --isolation=simple --enable-network | ||
``` | ||
<sup>The --nobest option is not strickly needed, just sometimes its fails to initialise and this option prevents/fixes it.</sup> | ||
|
||
6. From inside the mock enviroment download the kickstart file and edit, then flatten it: | ||
```sh | ||
git clone https://github.com/zearp/pumice && cd pumice/kickstart | ||
nano pumice.ks | ||
ksflatten -c pumice.ks -o flat.ks | ||
``` | ||
7. Generate the iso with the following command: | ||
```sh | ||
livemedia-creator --ks flat.ks --no-virt --resultdir /var/lmc --project="Pumice" --make-iso \ | ||
--volid Pumice-9 --iso-only --iso-name Pumice-9-x86_64.iso --releasever=9 --nomacboot && exit | ||
``` | ||
8. When it's done we'll move the iso file to the current directory and clean up: | ||
```sh | ||
sudo mv /var/lib/mock/pumice-9-x86_64/root/var/lmc/Pumice-9-x86_64.iso . | ||
sudo chown $USER:$USER Pumice-9-x86_64.iso | ||
mock -r pumice --scrub=all | ||
``` | ||
9. Re-enable SELinux: | ||
```sh | ||
sudo setenforce 1 | ||
``` | ||
That's all, you can now use the iso file to install. | ||
# Post install | ||
Some (hopefully) useful post install stuff. | ||
### Remove left overs. | ||
``` | ||
sudo dnf -y remove anaconda\* | ||
sudo dnf clean all | ||
``` | ||
Optionally if you just want to use ```dnf``` remove flatpak, flatseal and gnome-software. | ||
``` | ||
sudo dnf -y remove flatpak\* flatseal gnome-software | ||
``` | ||
On AMD iGPU/GPU systems the Intel driver can be removed too: | ||
``` | ||
sudo dnf -y remove intel-media-driver | ||
``` | ||
### Verify SELinux | ||
Security is paramount so let's make sure SELinux is running in ```enforcement``` mode. run the following command to check the current enforcement status: | ||
``` | ||
sudo getenforce | ||
``` | ||
If it shows ```Enforcing``` we don't need to do anything. If it shows ```Permissive``` run the following command, reboot and check the enforcement status again: | ||
``` | ||
sudo fixfiles onboot | ||
``` | ||
For more information please refer to [this](https://docs.rockylinux.org/guides/security/learning_selinux) page. | ||
### Check for and install firmware updates | ||
Run these commands one by one and only update if you want to. If everything is workign fine it might not be needed to update anything. Refer to the release notes and change logs for each firmware update. | ||
``` | ||
sudo fwupdmgr refresh | ||
sudo fwupdmgr get-updates | ||
## make sure you need/want these updates! | ||
sudo fwupdmgr update | ||
``` | ||
### Cockpit | ||
Cockpit is a nice web frontend to do basic monitoring and managements tasks. I suggest using it not only on servers but anywhere and also when you need to troubleshoot issues. It has some great utilities and access to log files and services and so on. The default location is ```http://localhost:9090```. For more information please read [this](https://www.redhat.com/sysadmin/intro-cockpit) page. | ||
### El Repo kernel | ||
Sometimes you need a more modern kernel, for example very recent hardware. We can use the El Repo repository for that. The only cost is that secure boot will no longer function. To enable and install El Repo's 6.x kernel run the following commands: | ||
``` | ||
sudo dnf -y install elrepo-release | ||
sudo yum --enablerepo=elrepo-kernel install kernel-lt kernel-lt-modules-extra | ||
``` | ||
Now reboot and press the escape key to show the grub menu and select the new kernel from the list. | ||
We can replace ```lt``` for ```ml``` if you want even newer mainline kernel as opposed to the long term support kernel. If everything works well run the following commands to set a new default kernel and remove the old default kernel: | ||
``` | ||
sudo echo -e "DEFAULTKERNEL=kernel-lt-core\nUPDATEDEFAULT=yes" | sudo tee /etc/sysconfig/kernel | ||
sudo dnf -y remove kernel kernel-core | ||
``` | ||
You can also modify the kickstart to build your iso with a 6.x kernel instead. For more information see [this](https://elrepo.org/tiki/kernel-lt) page. In order to compile modules it may be needed to install the ```kernel-devel-matched``` package. | ||
### AMD Drivers | ||
Only works with the stock 5.x kernels. This will give you OpenCL and some additonal video encoders/decoders. Download the latest installer rpm [here](https://repo.radeon.com/amdgpu-install/latest/rhel/9.3/) and install it: | ||
``` | ||
sudo rpm -i amdgpu-install*.rpm | ||
sudo amdgpu-install | ||
sudo reboot | ||
``` | ||
### Firefox | ||
For hardware encoding set ```media.ffmpeg.vaapi.enabled``` and ```gfx.webrender.all``` to true in ```about:config``` and restart Firefox. To test check cpu/gpu usage in ```nvtop``` or ```intel_gpu_top```. The latter may have to be compiled from source or if you dare manually install the Fedora package (```igt-gpu-tools```). If you use the Flatpak version it may also be needed to run Firefox in Wayland mode by adding an enviroment option using Flatseal. This shouldn't be needed anymore. | ||
It is recommended to block unsupported codecs using [this](https://addons.mozilla.org/en-US/firefox/addon/enhanced-h264ify) add-on. For example, my NUC 8 does not support AV1 but does support VP8/9 and h264. Setting the add-on to only block AV1 tries to makes it so videos are being decoded by the gpu. To see which codecs are supported you can use the ```vainfo``` command. | ||
You will see entries like ```VAProfileH264``` and so on. Disable any you don't have but are listed in the ```enhanced-h264ify``` add-on. This way Firefox won't be rendering videos ususing the cpu (as much). If you run into a video that doesn't play disabling the add-on and refreshing the page should fix it and let Firefox use the cpu to render the video. | ||
While we're at it let's install [uBlock Origin](https://addons.mozilla.org/en-GB/firefox/addon/ublock-origin) to block some ads and trackers. | ||
### Misc. | ||
- Change shell to zsh: | ||
```sh | ||
sudo usermod --shell /usr/bin/zsh $USER | ||
``` | ||
- Less flickering when booting and old school network interface names: | ||
```sh | ||
grubby --update-kernel=ALL --args="loglevel=3 systemd.show_status=auto rd.udev.log_level=3 vt.global_cursor_default=0 biosdevname=0 net.ifnames=0" | ||
``` | ||
- Sort apps alphabetically, logout and in to apply, don't use sudo here: | ||
```sh | ||
gsettings set org.gnome.shell app-picker-layout "[]" | ||
``` | ||
- Sync login screen settings (gdm): | ||
```sh | ||
sudo cp ~/.config/monitors.xml /var/lib/gdm/.config/ | ||
``` | ||
- Remove brightness slider (when applicable): | ||
```sh | ||
sudo grubby --update-kernel ALL --args acpi_backlight=none | ||
``` | ||
- Compiling kernel modules: | ||
```sh | ||
sudo dnf -y install kernel-devel dkms | ||
``` | ||
- Disable sleep/suspend completely, disable it in Gnome settings first or else you get false positive notifications about impending suspends. Re-run with ```unmask``` to re-enable: | ||
```sh | ||
sudo systemctl mask sleep.target suspend.target hibernate.target hybrid-sleep.target | ||
``` | ||
- The firewall (```firewalld```) is enabled and allowing; cockpit and ssh. For some basics on opening ports/services and more information please refer to [this](https://docs.rockylinux.org/guides/security/firewalld-beginners) page. | ||
# Updating | ||
Easy mode! | ||
``` | ||
sudo dnf --refresh update | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
# basic zshrc -- the best shell there is =] | ||
# | ||
|
||
# enable colours and set prompt | ||
# | ||
autoload -U colors && colors | ||
PS1="%B%{$fg[blue]%}[%{$fg[cyan]%}%n%{$fg[white]%}@%{$fg[green]%}%M %{$fg[magenta]%}%~%{$fg[blue]%}]%{$reset_color%}$%b " | ||
|
||
# save some history | ||
# | ||
HISTFILE=~/.zsh_history | ||
HISTSIZE=10000 | ||
SAVEHIST=10000 | ||
setopt appendhistory | ||
setopt hist_ignore_all_dups | ||
setopt hist_ignore_space | ||
|
||
# setup simple aliases | ||
# | ||
alias cat="bat -p" | ||
alias grep="rg" | ||
alias diff="diff --color=auto" | ||
alias ip="ip -color=auto" | ||
alias ls="eza --group-directories-first" | ||
alias ll="eza --group-directories-first -alg --git" | ||
alias tree="eza -Tla --time-style=long-iso" | ||
alias nano="nano -c" | ||
|
||
# env | ||
# | ||
#export LESS="-R --use-color -Dd+r$Du+b" | ||
export EDITOR="nano" | ||
export VISUAL="nano" | ||
|
||
# enable auto completion | ||
# | ||
autoload -U compinit | ||
zstyle ':completion:*' menu select | ||
zmodload zsh/complist | ||
compinit | ||
_comp_options+=(globdots) | ||
|
||
# timers | ||
# | ||
function preexec() { | ||
timer=$(($(date +%s%0N)/1000000)) | ||
} | ||
|
||
function precmd() { | ||
if [ $timer ]; then | ||
now=$(($(date +%s%0N)/1000000)) | ||
elapsed=$(($now-$timer)) | ||
|
||
export RPROMPT="%F{yellow}${elapsed}ms %{$reset_color%}" | ||
unset timer | ||
fi | ||
} | ||
|
||
# use vim and arrow heys to navigate auto complete | ||
# | ||
bindkey -M menuselect 'h' vi-backward-char | ||
bindkey -M menuselect 'k' vi-up-line-or-history | ||
bindkey -M menuselect 'l' vi-forward-char | ||
bindkey -M menuselect 'j' vi-down-line-or-history | ||
bindkey -M menuselect 'left' vi-backward-char | ||
bindkey -M menuselect 'up' vi-up-line-or-history | ||
bindkey -M menuselect 'right' vi-forward-char | ||
bindkey -M menuselect 'down' vi-down-line-or-history | ||
|
||
# make it so newly added executables can be auto completed | ||
# | ||
zstyle ':completion:*' rehash true | ||
|
||
# auto suggestions | ||
# | ||
source /usr/share/zsh-autosuggestions/zsh-autosuggestions.zsh | ||
|
||
# pfetch | ||
# | ||
export PF_COL1="7" | ||
export PF_COL2="8" | ||
export PF_INFO="ascii os host kernel uptime pkgs memory shell editor wm de palette" | ||
#[[ "$(cat /proc/$PPID/comm)" =~ "(kgx|foot|alacritty|sshd)" ]] && echo "" && pfetch | ||
|
||
# enable syntax highlighting, needs to be loaded last | ||
# | ||
source /usr/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh |
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.