Skip to content

Instantly share code, notes, and snippets.

@GamePlayer-8
GamePlayer-8 / Launch-pipewire.sh
Last active July 19, 2023 08:09
Launch-pipewire.sh
#!/bin/sh
export PIPEWIRE_RUNTIME=<PATH>
mkdir "$PIPEWIRE_RUNTIME"/{runtime,logs} 2>/dev/null 3>&2
export DISPLAY="127.0.0.1:0.0"
export XDG_RUNTIME_DIR="$PIPEWIRE_RUNTIME"/runtime
pipewire -c "$PIPEWIRE_RUNTIME"/pipewire.conf >"$PIPEWIRE_RUNTIME"/logs/pipewire.log 2>&1 3>&1 &
pipewire_pid=$!
@GamePlayer-8
GamePlayer-8 / Launch-X11.sh
Last active July 19, 2023 08:16
Launch-X11.sh
#!/bin/sh
export X11_RUNTIME=<PATH>
mkdir "$X11_RUNTIME"/{runtime,logs} 2>/dev/null 3>&2
X -listen tcp >"$X11_RUNTIME"/logs/X.log 2>&1 3>&1 &
X_pid=$!
echo "$X_pid" > "$X11_RUNTIME"/runtime/X.pid
# To prefer IPv4 over everything else
precedence ::ffff:0:0/96 100
precedence ::1/128 50
precedence ::/0 40
precedence 2002::/16 30
precedence ::/96 20
@GamePlayer-8
GamePlayer-8 / GeoIP.conf
Created July 19, 2023 08:24
GeoIP.conf
# Please see https://dev.maxmind.com/geoip/updating-databases?lang=en for
# instructions on setting up geoipupdate, including information on how to
# download a pre-filled GeoIP.conf file.
# Replace YOUR_ACCOUNT_ID_HERE and YOUR_LICENSE_KEY_HERE with an active account
# ID and license key combination associated with your MaxMind account. These
# are available from https://www.maxmind.com/en/my_license_key.
AccountID YOUR_ACCOUNT_ID_HERE
LicenseKey YOUR_LICENSE_KEY_HERE
@GamePlayer-8
GamePlayer-8 / sysctl.conf
Created July 19, 2023 08:31
sysctl.conf
kernel.printk = 4 4 1 7
kernel.panic = 10
kernel.sysrq = 0
kernel.shmmax = 4294967296
kernel.shmall = 4194304
kernel.core_uses_pid = 1
kernel.msgmnb = 65536
kernel.msgmax = 65536
vm.swappiness = 20
vm.dirty_ratio = 80
@GamePlayer-8
GamePlayer-8 / ramdrive.sh
Created August 6, 2023 17:25
Get RAM for tmpfs (safe) a.k.a. RamDrive
#!/bin/sh
result=$(free -m | awk '/Mem/ {printf "%.0f\n", $7/1024}')
divided_value=$(awk "BEGIN { printf \"%.2f\n\", $result / 1.7 }")
final_value=$(awk "BEGIN { printf \"%.0f\n\", $divided_value }")
echo 'Allocating '$final_value' GB of RAM as RamDrive at /ramdrive...'
mkdir /ramdrive 2>/dev/null 3>&2
umount -R /ramdrive 2>/dev/null 3>&2
STEP 1/10: FROM archlinux
STEP 2/10: RUN useradd yay
--> 9979f3485cab
STEP 3/10: RUN mkdir /home/yay && chown -R yay:yay /home/yay
--> 1fc81fd0c69e
STEP 4/10: RUN pacman -Syu --noconfirm go git base-devel sudo
:: Synchronizing package databases...
core downloading...
extra downloading...
:: Starting full system upgrade...
@GamePlayer-8
GamePlayer-8 / Dockerfile
Created August 15, 2023 08:22
Dockerfile for yay ArchLinux
FROM archlinux
RUN useradd yay
RUN mkdir /home/yay && \
chown -R yay:yay /home/yay
RUN pacman -Syu --noconfirm go git base-devel sudo
RUN echo '%wheel ALL=(ALL:ALL) NOPASSWD: ALL' >> /etc/sudoers && \
usermod -aG wheel yay
@GamePlayer-8
GamePlayer-8 / cleanup-images.sh
Created August 15, 2023 08:37
Cleanup podman images
#!/bin/bash
podman images | grep '<none>' | cut -d '>' -f 3 | cut -d ' ' -f 10 | xargs -I "{}" podman image rm -f "{}"
@GamePlayer-8
GamePlayer-8 / PKGBUILD
Last active August 22, 2023 12:42
Cubic Server `PKGBUILD` file.
# Maintainer: Chimmie Firefly <gameplayer2019pl (at) tutamail (dot) com>
pkgname=cubic-server-git
_pkgname=cubic-server-git
pkgver=r1442.efa5d7d4
pkgrel=1
pkgdesc='A fast and extensible C++ implementation of Minecraft is server.'
arch=(
'i686'
'x86_64'