Skip to content

Instantly share code, notes, and snippets.

View sebastianwebber's full-sized avatar
🏠
Working from home

Sebastian Webber sebastianwebber

🏠
Working from home
View GitHub Profile
@denji
denji / nginx-tuning.md
Last active April 24, 2024 19:39
NGINX tuning for best performance

Moved to git repository: https://github.com/denji/nginx-tuning

NGINX Tuning For Best Performance

For this configuration you can use web server you like, i decided, because i work mostly with it to use nginx.

Generally, properly configured nginx can handle up to 400K to 500K requests per second (clustered), most what i saw is 50K to 80K (non-clustered) requests per second and 30% CPU load, course, this was 2 x Intel Xeon with HyperThreading enabled, but it can work without problem on slower machines.

You must understand that this config is used in testing environment and not in production so you will need to find a way to implement most of those features best possible for your servers.

@subfuzion
subfuzion / curl.md
Last active April 23, 2024 14:44
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

@supix
supix / postgres_recovery.md
Last active April 22, 2024 20:37
Postgres error: Missing chunk 0 for toast value in pg_toast

The problem

In some cases, it is possible that PostgreSQL tables get corrupted. This can happen in case of hardware failures (e.g. hard disk drives with write-back cache enabled, RAID controllers with faulty/worn out battery backup, etc.), as clearly reported in this wiki page. Furthermore, it can happen in case of incorrect setup, as well.

One of the symptoms of such corruptions is the following message:

ERROR: missing chunk number 0 for toast value 123456 in pg_toast_45678

This almost surely indicates that a corrupted chunk is present within a table file. But there is a good way to get rid of it.

@loganvolkers
loganvolkers / Byte Formatting for Google Sheets.md
Last active April 16, 2024 10:42
Byte formatting for Google Sheets
@TimJDFletcher
TimJDFletcher / GNUPG_agent_forwarding.md
Last active April 10, 2024 20:09 — forked from surhudm/GNUPG_agent_forwarding.md
GnuPG agent forwarding

Forward GnuPG agent from macOS to Linux

On the remote machine

Run gpg once as your to create the directory structure

gpg --list-keys

For headless systemd based hosts

@marktheunissen
marktheunissen / pedantically_commented_playbook.yml
Last active March 31, 2024 18:45 — forked from phred/pedantically_commented_playbook.yml
Insanely complete Ansible playbook, showing off all the options
This playbook has been removed as it is now very outdated.
@dergachev
dergachev / ssh-forward-clipboard.md
Last active March 12, 2024 00:00
Forward your clipboard via SSH reverse tunnels

Exposing your clipboard over SSH

I frequently administer remote servers over SSH, and need to copy data to my clipboard. If the text I want to copy all fits on one screen, then I simply select it with my mouse and press CMD-C, which asks relies on m y terminal emulator (xterm2) to throw it to the clipboard.

This isn't practical for larger texts, like when I want to copy the whole contents of a file.

If I had been editing large-file.txt locally, I could easily copy its contents by using the pbcopy command:

@davecoutts
davecoutts / unifi_ubuntu_2004.sh
Last active March 11, 2024 23:27
Install Ubiquiti Unifi Controller on Ubuntu 20.04
# Install Ubiquiti Unifi Controller on Ubuntu 20.04.
# As tested on a fresh install of ubuntu-20.04.1-live-server, August 22nd 2020.
# Thanks to https://gist.github.com/tmuncks for posting the updated install steps.
sudo apt update
sudo apt install --yes apt-transport-https
echo 'deb https://www.ui.com/downloads/unifi/debian stable ubiquiti' | sudo tee /etc/apt/sources.list.d/100-ubnt-unifi.list
sudo wget -O /etc/apt/trusted.gpg.d/unifi-repo.gpg https://dl.ui.com/unifi/unifi-repo.gpg
@troyharvey
troyharvey / deployment.yml
Last active February 27, 2024 04:47
Using Kubernetes envFrom for environment variables
# Use envFrom to load Secrets and ConfigMaps into environment variables
apiVersion: apps/v1beta2
kind: Deployment
metadata:
name: mans-not-hot
labels:
app: mans-not-hot
spec:
replicas: 1
@skratchdot
skratchdot / donate.md
Created January 25, 2016 17:42
My Paypal donate button in markdown format

Donation Button

Donate