Skip to content

Instantly share code, notes, and snippets.

View nilreml's full-sized avatar
💾
Core dump in progress

Merlin nilreml

💾
Core dump in progress
  • Hamburg, Germany
  • 16:00 (UTC +02:00)
View GitHub Profile
i don't care about cookies
ublock origin
https://github.com/yourduskquibbles/webannoyances#one-click-installation
about:config
accessibility.browsewithcaret_shortcut.enabled;false
browser.aboutConfig.showWarning;false
browser.backspace_action;0
browser.compactmode.show;true
browser.download.animateNotifications;false
@nilreml
nilreml / mysql
Last active March 10, 2024 11:15
NOTE: make sure you understand each option's implications before applying any of this
[mysqld]
# general
max_connections=4000
table_open_cache=8000
table_open_cache_instances=16
max_prepared_stmt_count=512000
back_log=1500
NOTE: don't do any of this unless you understand all it's implications
https://engineering.linkedin.com/performance/optimizing-linux-memory-management-low-latency-high-throughput-databases
Linux's NUMA optimizations can be effectively disabled by doing the following:
Turn zone reclaim mode off: add vm.zone_reclaim_mode = 0 to /etc/sysctl.conf and run sysctl -p to load the new settings.
Enable NUMA interleaving for your application: run with numactl --interleave=all COMMAND
These are now the defaults on all our production systems.
Filesystem benchmarking:
su -
apt install vim git firmware-linux-*
exit
cd
mkdir git
cd git
git clone https://github.com/nilreml/caveat-emptor
cd caveat-emptor
cd bootstrap-debian
./bootstrap.sh
Import CA trust
sudo mkdir /usr/local/share/ca-certificates/[org]
cp [CA/CAchain.crt] /usr/local/share/ca-certificates/[org]
sudo update-ca-certificates
Create a private key
openssl genrsa -out server.key 4096
Generate a new private key and certificate signing request
openssl req -out server.csr -new -newkey rsa:4096 -nodes -keyout server.key
APT mirror:
sed -i -- 's/deb.debian.org/mirror.netcologne.de/g' /etc/apt/sources.list.d/*
APT components:
main contrib non-free non-free-firmware -> see end
APT external repos:
apt install extrepo
sed -i -E "s/# (- (contrib|non-free))/\1/g" /etc/extrepo/config.yaml
apt update
Apt cache & non-interactive config:
ARG DEBIAN_FRONTEND=noninteractive
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
# hadolint ignore=DL3008,DL3014
RUN --mount=type=cache,target=/var/cache/apt \
--mount=type=cache,target=/var/lib/apt/lists \
# Use german apt mirror
Slow apt search:
rm /etc/apt/apt.conf.d/docker-gzip-indexes
rm /var/lib/apt/lists/*.lz4
apt update
browser.compactmode.show true
browser.search.region EN
browser.tabs.insertAfterCurrent true
browser.tabs.loadBookmarksInBackground true
browser.tabs.loadBookmarksInTabs true
browser.tabs.tabClipWidth 10000
browser.toolbars.bookmarks.visibility always
browser.translations.neverTranslateLanguages de
browser.uidensity 1
full-screen-api.transition.timeout 0
@nilreml
nilreml / poetry
Last active March 25, 2024 10:59
Bash completions:
mkdir -p ${XDG_DATA_HOME:-~/.local/share}/bash-completion/completions
poetry completions bash > ${XDG_DATA_HOME:-~/.local/share}/bash-completion/completions/poetry
Enter virtual environment:
poetry shell
Exit virtual environment:
exit