Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Sebastian Webber sebastianwebber

🏠
Working from home
View GitHub Profile
@davecoutts
davecoutts / unifi_ubuntu_2004.sh
Last active January 24, 2023 20:55
Install Ubiquiti Unifi Controller on Ubuntu 20.04
View unifi_ubuntu_2004.sh
# 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
@supix
supix / postgres_recovery.md
Last active December 29, 2022 14:53
Postgres error: Missing chunk 0 for toast value in pg_toast
View postgres_recovery.md

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 January 31, 2023 15:30
Byte formatting for Google Sheets
View Byte Formatting for Google Sheets.md
@TimJDFletcher
TimJDFletcher / GNUPG_agent_forwarding.md
Last active January 16, 2023 00:58 — forked from surhudm/GNUPG_agent_forwarding.md
GnuPG agent forwarding
View GNUPG_agent_forwarding.md

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
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
#!groovy
// imports
import jenkins.model.Jenkins
import jenkins.model.JenkinsLocationConfiguration
// parameters
def jenkinsParameters = [
email: 'Jenkins Admin <admin@jenkins.com>',
url: 'https://ci.jenkins.com:8083/'
@troyharvey
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
metadata:
name: mans-not-hot
labels:
app: mans-not-hot
spec:
replicas: 1
@jk3us
jk3us / .bash_profile
Last active May 19, 2017 19:23
My psql/tmux configuration
View .bash_profile
case "$TERM" in
screen*)
alias psql='PAGER=vim_psql_pager psql'
esac
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
subfuzion / curl.md
Last active February 5, 2023 18:56
curl POST examples
View curl.md

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.