Skip to content

Instantly share code, notes, and snippets.

Working from home

Sebastian Webber sebastianwebber

Working from home
View GitHub Profile
davecoutts /
Last active January 24, 2023 20:55
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 for posting the updated install steps.
sudo apt update
sudo apt install --yes apt-transport-https
echo 'deb stable ubiquiti' | sudo tee /etc/apt/sources.list.d/100-ubnt-unifi.list
sudo wget -O /etc/apt/trusted.gpg.d/unifi-repo.gpg
supix /
Last active December 29, 2022 14:53
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 / Byte Formatting for Google
Last active January 31, 2023 15:30
Byte formatting for Google Sheets
View Byte Formatting for Google
TimJDFletcher /
Last active January 16, 2023 00:58 — forked from surhudm/
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

ivan-pinatti / jenkins-set-url-and-email.groovy
Last active September 11, 2021 03:22
Jenkins - Set URL and email via groovy script - #jenkins #groovy
View jenkins-set-url-and-email.groovy
// imports
import jenkins.model.Jenkins
import jenkins.model.JenkinsLocationConfiguration
// parameters
def jenkinsParameters = [
email: 'Jenkins Admin <>',
url: ''
troyharvey / deployment.yml
Last active February 1, 2023 12:00
Using Kubernetes envFrom for environment variables
View deployment.yml
# Use envFrom to load Secrets and ConfigMaps into environment variables
apiVersion: apps/v1beta2
kind: Deployment
name: mans-not-hot
app: mans-not-hot
replicas: 1
jk3us / .bash_profile
Last active May 19, 2017 19:23
My psql/tmux configuration
View .bash_profile
case "$TERM" in
alias psql='PAGER=vim_psql_pager psql'
View tuning-restore-postgres
ssl = off
maintenance_work_mem = 2GB
work_mem = 2GB
fsync = off
synchronous_commit = off
wal_level = minimal
max_wal_senders = 0
archive_mode = off
wal_buffers = -1
wal_writer_delay = 20ms
subfuzion /
Last active February 5, 2023 18:56
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.