Skip to content

Instantly share code, notes, and snippets.

View ce0la's full-sized avatar
👽
Peculiar Cloud Plumber

Ola ce0la

👽
Peculiar Cloud Plumber
  • $SHELL
  • 04:31 (UTC +01:00)
View GitHub Profile
@AlexBaranowski
AlexBaranowski / huge_pages_pg_calc.sh
Created February 1, 2019 16:54
Simple script to calculate huge pages for PostgreSQL. Please note that this is baseline and require further tunning.
#!/usr/bin/env bash
[ -z "$PGDATA" ] && echo "PGDATA is not defined!" && exit 1
[ ! -e $PGDATA/postmaster.pid ] && echo "Cannot find $PGDATA/postmaster.pid is PostgreSQL server running?" && exit 1
PG_PID=$(head -1 $PGDATA/postmaster.pid)
PG_MEM_U=$(grep ^VmPeak /proc/$PG_PID/status | awk '{print $3}')
HP_MEM_U=$(grep ^Hugepagesize /proc/meminfo | awk '{print $3}')
[ "$PG_MEM_U" != "$HP_MEM_U" ] && echo "The units differ please calculate the Huge Pages manually" && exit 1
PG_MEM=$(grep ^VmPeak /proc/$PG_PID/status | awk '{print $2}')
HP_MEM=$(grep ^Hugepagesize /proc/meminfo | awk '{print $2}')
@PurpleBooth
PurpleBooth / README-Template.md
Last active May 17, 2024 09:42
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@andreyvit
andreyvit / tmux.md
Created June 13, 2012 03:41
tmux cheatsheet

tmux cheat sheet

(C-x means ctrl+x, M-x means alt+x)

Prefix key

The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf:

remap prefix to Control + a

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name: